handler-playable-sdk 0.3.55 → 0.3.56

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.
@@ -1 +1 @@
1
- function a0_0x1fe9(_0x431946,_0x546a0e){_0x431946=_0x431946-(0x92d*0x1+-0x10*0x56+-0x1f4);var _0x58a3c4=a0_0x1ee0();var _0x3563cf=_0x58a3c4[_0x431946];if(a0_0x1fe9['fNgWiC']===undefined){var _0x24d0f0=function(_0x5da80a){var _0x554ce0='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x15cce2='',_0x5bcdd4='',_0x348233=_0x15cce2+_0x24d0f0;for(var _0x4dcb82=-0xb5+0x1*0x1e88+0x3*-0x9f1,_0x59aaad,_0x33bcb1,_0x46572f=-0x2438+-0x29*0x92+0x3b9a;_0x33bcb1=_0x5da80a['charAt'](_0x46572f++);~_0x33bcb1&&(_0x59aaad=_0x4dcb82%(-0x23eb+0x104f+0x13a0)?_0x59aaad*(-0x190*0xa+-0xfc+0x34*0x53)+_0x33bcb1:_0x33bcb1,_0x4dcb82++%(-0x4d5*0x3+0xbe3*0x1+0x2a0))?_0x15cce2+=_0x348233['charCodeAt'](_0x46572f+(-0x592+-0xce*0xd+0x1012))-(-0x7ed*-0x3+0x226e+-0x1*0x3a2b)!==0x13eb*-0x1+0x22cc+-0xee1?String['fromCharCode'](0x3bf+0xd12*-0x1+-0xa52*-0x1&_0x59aaad>>(-(-0x3e5*-0x4+0x2169*0x1+-0x30fb)*_0x4dcb82&-0xc6f*0x1+0x1296+-0x621)):_0x4dcb82:-0x2679+-0x20f4+-0x45*-0x109){_0x33bcb1=_0x554ce0['indexOf'](_0x33bcb1);}for(var _0x519415=0x1*-0x18db+-0xd*-0x161+0x2*0x377,_0x22f698=_0x15cce2['length'];_0x519415<_0x22f698;_0x519415++){_0x5bcdd4+='%'+('00'+_0x15cce2['charCodeAt'](_0x519415)['toString'](0xd1a*0x1+0x26bc+-0x33c6))['slice'](-(-0x2411*-0x1+0x645*-0x5+0x2*-0x25b));}return decodeURIComponent(_0x5bcdd4);};var _0x484d71=function(_0x15e87d,_0x561ff8){var _0x1f9600=[],_0x308faa=0xe06+-0xd*0x7d+-0x7ad,_0x5547ed,_0x26aa22='';_0x15e87d=_0x24d0f0(_0x15e87d);var _0xcffb74;for(_0xcffb74=-0x212a+0x1f31+-0x65*-0x5;_0xcffb74<0x5*0x5cf+0x7*0x3d7+-0x4a*0xbe;_0xcffb74++){_0x1f9600[_0xcffb74]=_0xcffb74;}for(_0xcffb74=-0x564+-0x1e6b+0x23cf;_0xcffb74<0x1185+-0x8ea+-0xb1*0xb;_0xcffb74++){_0x308faa=(_0x308faa+_0x1f9600[_0xcffb74]+_0x561ff8['charCodeAt'](_0xcffb74%_0x561ff8['length']))%(-0x2d*-0x9e+0x8ed+0x1e1*-0x13),_0x5547ed=_0x1f9600[_0xcffb74],_0x1f9600[_0xcffb74]=_0x1f9600[_0x308faa],_0x1f9600[_0x308faa]=_0x5547ed;}_0xcffb74=0xb5a+-0x38f+-0x7cb,_0x308faa=0xd2f+0x1601+-0x233*0x10;for(var _0x5c1852=-0x1111*-0x1+-0x928+-0x7e9*0x1;_0x5c1852<_0x15e87d['length'];_0x5c1852++){_0xcffb74=(_0xcffb74+(-0xa91*0x1+0x123d+0x97*-0xd))%(0x5a+0xc8d+-0xbe7),_0x308faa=(_0x308faa+_0x1f9600[_0xcffb74])%(-0x2*0xe48+-0x2378+-0x8*-0x821),_0x5547ed=_0x1f9600[_0xcffb74],_0x1f9600[_0xcffb74]=_0x1f9600[_0x308faa],_0x1f9600[_0x308faa]=_0x5547ed,_0x26aa22+=String['fromCharCode'](_0x15e87d['charCodeAt'](_0x5c1852)^_0x1f9600[(_0x1f9600[_0xcffb74]+_0x1f9600[_0x308faa])%(0x3a7+0x8*0x2f6+0xb*-0x265)]);}return _0x26aa22;};a0_0x1fe9['DaKPDV']=_0x484d71,a0_0x1fe9['iLjhOM']={},a0_0x1fe9['fNgWiC']=!![];}var _0x4e5c40=_0x58a3c4[0x1*-0x1862+0x11df+0x1*0x683],_0x12259b=_0x431946+_0x4e5c40,_0x4af141=a0_0x1fe9['iLjhOM'][_0x12259b];if(!_0x4af141){if(a0_0x1fe9['NOjwKf']===undefined){var _0x5dcd5f=function(_0x5e2185){this['cQxhKT']=_0x5e2185,this['uVFSCm']=[-0x28a*0x7+0x26d+0x189*0xa,-0xc2*0x29+-0xc6a*0x1+0x2b7c,-0xb9a+0x1*0x779+0x421],this['luovPt']=function(){return'newState';},this['TfcYhB']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['fMbXks']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x5dcd5f['prototype']['lMenZY']=function(){var _0x52914f=new RegExp(this['TfcYhB']+this['fMbXks']),_0xe6a130=_0x52914f['test'](this['luovPt']['toString']())?--this['uVFSCm'][0x921+0x9cc+0xad*-0x1c]:--this['uVFSCm'][-0x3*-0x4a8+0x1*-0x5bc+-0x83c];return this['LZFhiE'](_0xe6a130);},_0x5dcd5f['prototype']['LZFhiE']=function(_0x8715e8){if(!Boolean(~_0x8715e8))return _0x8715e8;return this['IxvIBH'](this['cQxhKT']);},_0x5dcd5f['prototype']['IxvIBH']=function(_0x50c312){for(var _0x14b561=0x12*-0x28+-0x2302+0x25d2,_0x55afec=this['uVFSCm']['length'];_0x14b561<_0x55afec;_0x14b561++){this['uVFSCm']['push'](Math['round'](Math['random']())),_0x55afec=this['uVFSCm']['length'];}return _0x50c312(this['uVFSCm'][0x4*0x18b+0xae+0x6da*-0x1]);},new _0x5dcd5f(a0_0x1fe9)['lMenZY'](),a0_0x1fe9['NOjwKf']=!![];}_0x3563cf=a0_0x1fe9['DaKPDV'](_0x3563cf,_0x546a0e),a0_0x1fe9['iLjhOM'][_0x12259b]=_0x3563cf;}else _0x3563cf=_0x4af141;return _0x3563cf;}(function(_0x37d772,_0x4c2929){var a0_0x1b26e0={_0x4554dc:0x4e0,_0x37ac14:0x4e7,_0x3b1b76:0x4f2,_0x3a8991:'$U^S',_0x7e1821:0x35,_0x5ace83:0x2b,_0x5b5fcc:0x29,_0x5e1151:0x4cd,_0x49a7fa:'eITi',_0x24b7d7:0x4dd,_0x2535bf:'eBXK',_0x5e11d1:0x4e5,_0x2216b9:0x4d0,_0x160b5e:'h5z*',_0x1f24fd:0x18,_0x568b51:0x19,_0x1b1214:0x24,_0x2f8c0f:'S9Xu',_0x46d9e1:0x32,_0x12349a:0x1b,_0x19f2d8:'w^jS',_0x2a8bf5:0x1e,_0x3d4b7b:0x4de,_0x22248e:0x4e8,_0x5e31ba:'gV!W',_0x57fbfe:0x4f4,_0x246e2a:0x4df,_0x4f335e:0x18,_0x33af3d:0x18,_0x20e791:0x10,_0x145efc:0x17,_0x1e755a:'[dLr',_0x162d77:0x11,_0x3fca64:0x18},a0_0x59f3bf={_0x4bed52:0x220},a0_0x107006={_0x4386e6:0x206};function _0x3b3bf3(_0x33ce20,_0x324bdb,_0x2f2896,_0x5c23af,_0x230bdf){return a0_0x1fe9(_0x33ce20- -a0_0x107006._0x4386e6,_0x324bdb);}var _0x574c97=_0x37d772();function _0x53b4c1(_0x10f24b,_0x2531eb,_0x358d76,_0x494e0c,_0x5ea1eb){return a0_0x1fe9(_0x2531eb-0x2f4,_0x358d76);}function _0x2e26de(_0xb180a1,_0x25e076,_0x5deff3,_0x367d10,_0x2541a5){return a0_0x1fe9(_0xb180a1- -a0_0x59f3bf._0x4bed52,_0x2541a5);}while(!![]){try{var _0x224c28=parseInt(_0x53b4c1(a0_0x1b26e0._0x4554dc,a0_0x1b26e0._0x37ac14,'qagL',0x4e2,a0_0x1b26e0._0x3b1b76))/(-0x3ec*0x3+0x2*0xb47+-0xac9)+parseInt(_0x3b3bf3(-0x28,a0_0x1b26e0._0x3a8991,-a0_0x1b26e0._0x7e1821,-a0_0x1b26e0._0x5ace83,-a0_0x1b26e0._0x5b5fcc))/(0x1e*-0x109+0xaf5+-0x1*-0x141b)*(-parseInt(_0x53b4c1(0x4bf,a0_0x1b26e0._0x5e1151,a0_0x1b26e0._0x49a7fa,0x4c2,0x4d8))/(0x14fb+0x625+-0x1b1d))+-parseInt(_0x53b4c1(0x4df,a0_0x1b26e0._0x24b7d7,a0_0x1b26e0._0x2535bf,a0_0x1b26e0._0x5e11d1,a0_0x1b26e0._0x2216b9))/(0x1450+0x1025+0x1*-0x2471)*(-parseInt(_0x3b3bf3(-0x20,a0_0x1b26e0._0x160b5e,-a0_0x1b26e0._0x1f24fd,-0x1d,-a0_0x1b26e0._0x568b51))/(0x851+0x96d*0x1+0x11b9*-0x1))+parseInt(_0x3b3bf3(-a0_0x1b26e0._0x1b1214,a0_0x1b26e0._0x2f8c0f,-a0_0x1b26e0._0x46d9e1,-a0_0x1b26e0._0x12349a,-0x2e))/(0x218d+-0x34*-0x17+0x7f*-0x4d)+parseInt(_0x3b3bf3(-0x1e,a0_0x1b26e0._0x19f2d8,-0x12,-a0_0x1b26e0._0x5b5fcc,-a0_0x1b26e0._0x2a8bf5))/(0x25aa+0x1ed1+-0x223a*0x2)+-parseInt(_0x53b4c1(a0_0x1b26e0._0x3d4b7b,a0_0x1b26e0._0x22248e,a0_0x1b26e0._0x5e31ba,a0_0x1b26e0._0x57fbfe,a0_0x1b26e0._0x246e2a))/(0x6e1*0x5+0x351+-0x25ae)+parseInt(_0x3b3bf3(-a0_0x1b26e0._0x4f335e,'pUkd',-a0_0x1b26e0._0x33af3d,-a0_0x1b26e0._0x20e791,-a0_0x1b26e0._0x145efc))/(0xfbf*0x2+-0xd31+-0x1244)*(-parseInt(_0x3b3bf3(-a0_0x1b26e0._0x145efc,a0_0x1b26e0._0x1e755a,-a0_0x1b26e0._0x12349a,-a0_0x1b26e0._0x162d77,-a0_0x1b26e0._0x3fca64))/(0x2462+-0x174*-0x1a+-0x4a20));if(_0x224c28===_0x4c2929)break;else _0x574c97['push'](_0x574c97['shift']());}catch(_0x55b858){_0x574c97['push'](_0x574c97['shift']());}}}(a0_0x1ee0,0xb*0x8abb+0x8*-0x9b9c+0x1*0x332cf));var a0_0x55adcb=(function(){var _0x2a1781=!![];return function(_0x35b324,_0x4512aa){var a0_0x48ea60={_0x52283b:0x255,_0x706c1:0x260,_0x16ff4d:0x254,_0x57b432:'5x8D',_0x178af6:0x251},a0_0x5570b3={_0x24b509:0x67},_0x24ce8a=_0x2a1781?function(){function _0x5967a3(_0x426fbc,_0x4f0836,_0xd4a747,_0x4b4725,_0x309db){return a0_0x1fe9(_0xd4a747-a0_0x5570b3._0x24b509,_0x4b4725);}if(_0x4512aa){var _0x1cd8a5=_0x4512aa[_0x5967a3(a0_0x48ea60._0x52283b,a0_0x48ea60._0x706c1,a0_0x48ea60._0x16ff4d,a0_0x48ea60._0x57b432,a0_0x48ea60._0x178af6)](_0x35b324,arguments);return _0x4512aa=null,_0x1cd8a5;}}:function(){};return _0x2a1781=![],_0x24ce8a;};}()),a0_0x5b131a=a0_0x55adcb(this,function(){var a0_0x44d3b9={_0x955f08:0x554,_0x1cde0e:0x54b,_0x3f0430:'ifV@',_0x18347f:0x551,_0x5ede84:'1NsD',_0x60c0a6:0x44d,_0x169a49:'VLM(',_0x5c59cb:0x1f3,_0x361bf3:0x1fe,_0x374b39:0x200,_0x49a540:0x540,_0x41e511:0x534,_0x4c6a6a:'uCSg',_0x2a84b9:0x538,_0x450ad5:'T$qG',_0x26f4b8:0x45d,_0x3317d7:0x46b,_0x546f1b:'qagL',_0x45c349:0x457,_0xd8d416:0x458,_0x403283:0x44a,_0x52f0c1:0x449,_0x48ed34:'I^hV',_0x578536:0x1f7,_0xb02e91:0x1f6,_0xb543e3:0x54a,_0x399f0e:0x553,_0x5d58d3:'pUkd',_0x5b2063:0x537,_0x4bba5c:0x1e9,_0x195117:0x1ef,_0x4ee083:0x1fb,_0x1b9c0f:0x208,_0x17988e:0x1fc,_0x4ba274:0x1f0,_0x1c60ab:'VOro',_0x5acb3e:0x445},a0_0x45dca9={_0xe1ac03:0x12},a0_0x57c91f={_0x3c4064:0x26d},a0_0x445ffe={_0x27e783:0x361};function _0x2da52b(_0x2481b2,_0x5f009d,_0x4c4406,_0x4fe45c,_0x4f2beb){return a0_0x1fe9(_0x5f009d-a0_0x445ffe._0x27e783,_0x4fe45c);}function _0x1e7336(_0xee5242,_0x3d144e,_0x3acc12,_0x4916ad,_0x33b61b){return a0_0x1fe9(_0x3acc12-a0_0x57c91f._0x3c4064,_0xee5242);}function _0x2fba21(_0x2d774f,_0x32e814,_0x1c8c50,_0x718ebd,_0x534949){return a0_0x1fe9(_0x718ebd-a0_0x45dca9._0xe1ac03,_0x2d774f);}return a0_0x5b131a[_0x2da52b(a0_0x44d3b9._0x955f08,0x548,a0_0x44d3b9._0x1cde0e,a0_0x44d3b9._0x3f0430,a0_0x44d3b9._0x18347f)+_0x1e7336(a0_0x44d3b9._0x5ede84,0x44f,a0_0x44d3b9._0x60c0a6,0x440,0x43f)]()[_0x2fba21(a0_0x44d3b9._0x169a49,0x1f9,a0_0x44d3b9._0x5c59cb,a0_0x44d3b9._0x361bf3,a0_0x44d3b9._0x374b39)+'h'](_0x2da52b(0x538,a0_0x44d3b9._0x49a540,a0_0x44d3b9._0x41e511,a0_0x44d3b9._0x4c6a6a,a0_0x44d3b9._0x2a84b9)+')+)+)'+'+$')[_0x1e7336(a0_0x44d3b9._0x450ad5,0x45b,a0_0x44d3b9._0x26f4b8,a0_0x44d3b9._0x3317d7,0x46a)+_0x1e7336(a0_0x44d3b9._0x546f1b,a0_0x44d3b9._0x45c349,a0_0x44d3b9._0xd8d416,a0_0x44d3b9._0x403283,a0_0x44d3b9._0x52f0c1)]()[_0x2fba21(a0_0x44d3b9._0x48ed34,0x202,a0_0x44d3b9._0x578536,a0_0x44d3b9._0x578536,a0_0x44d3b9._0xb02e91)+_0x2da52b(a0_0x44d3b9._0xb543e3,0x544,a0_0x44d3b9._0x399f0e,a0_0x44d3b9._0x5d58d3,a0_0x44d3b9._0x5b2063)+'r'](a0_0x5b131a)[_0x2fba21('1ENh',a0_0x44d3b9._0x4bba5c,a0_0x44d3b9._0xb02e91,a0_0x44d3b9._0x195117,0x1f1)+'h'](_0x2fba21('5x8D',a0_0x44d3b9._0x4ee083,a0_0x44d3b9._0x1b9c0f,a0_0x44d3b9._0x17988e,a0_0x44d3b9._0x4ba274)+_0x1e7336(a0_0x44d3b9._0x1c60ab,0x452,0x447,0x447,a0_0x44d3b9._0x5acb3e)+'+$');});a0_0x5b131a();import{A as a0_0x5ce457,B as a0_0x15b95b,C as a0_0x116e81,D as a0_0x5bb4f4,b as a0_0x96d121,c as a0_0x54063b,d as a0_0x8985ad,e as a0_0x459ac8,f as a0_0x53c296,g as a0_0x4d4059,h as a0_0x340a90,i as a0_0x40cd50,j as a0_0x27f12e,k as a0_0x20ab92,l as a0_0x5152a1,m as a0_0x1e0ab6,n as a0_0x2b5caf,o as a0_0x735ec2,p as a0_0x55c1ee,q as a0_0x136946,r as a0_0x27c41f,s as a0_0x401ed0,t as a0_0x1782ee,u as a0_0x5322c7,v as a0_0x507f1d,w as a0_0x5cabb2,x as a0_0x43520b,y as a0_0x38afba,z as a0_0x43443f}from'../chunk-6OSSL2F7.js';import{a as a0_0x38270d,b as a0_0x1c7576,c as a0_0x291c25,d as a0_0xa90a0b,e as a0_0x7ec732}from'../chunk-I5OOVR5U.js';import'../chunk-LV4HGC5G.js';function a0_0x1ee0(){var _0x5260bf=['A8kUWPBdRmo/CwTDybbqEW','W5S5WOJcJmoE','W6eVW5RcOeBcJJOMqmopWQ8fka','F8oNEKFdJG','xf7cMGPWf8oeWQ1PW51sWORdSq','BYHwWPWo','ymoVW5D4qYFdImo3omoefg/dJq','rSouqCknxXpcVa','WRJcGSoIW5pdPq','WOv7WOq','BSoNWQRdMbq','W7hdMSk6WPhcTW','WPH8W5JdJ8kjgCoRb1ldTCkiWOfo','W6ZdSWTDDmolW6pcNG','W5nkgbj6','BSkGWPtdRSo9CX1gEbvay0S','wmoElXpcLCkEW73dLLVdHLLSW5e','W5GKW5e7W73cS8opWP7dQ14DWQe','pCkRW6y1WO7dJY/dMLPcW4JcNmob','WPzaW5fvkZe6xq','dH0LuCoODfGEiCoN','D8kMmSoNeG','fCo0wLGhg8knWORdVbi','W48+uNaho8oKW7X1ymk3uW','wuddVdW+','w8ozkHxdOConWQBdT2NdJq','fKdcUcCb','W4yjiG','W4O2vxudp8k7W4P+ySk5Bmok'];a0_0x1ee0=function(){return _0x5260bf;};return a0_0x1ee0();}import'../chunk-ZLL42OOV.js';import'../chunk-E6WJCS24.js';import'../chunk-JXBG6UFL.js';export{a0_0x38270d as AssetCache,a0_0x291c25 as AssetLoader,a0_0x5322c7 as AssetSystem,a0_0xa90a0b as AssetTextures,a0_0x401ed0 as Assets,a0_0x735ec2 as BaseSystem,a0_0x2b5caf as GameEngine,a0_0x459ac8 as GameObject,a0_0x53c296 as GameObjectManager,a0_0x1e0ab6 as ObjectFactory,a0_0x8985ad as Renderer,a0_0x55c1ee as RuntimeObjectRegistry,a0_0x54063b as Transform,a0_0x15b95b as applyScreenAnchor,a0_0x136946 as basePixi,a0_0x5cabb2 as clearResponsiveElements,a0_0x96d121 as createPixiBase,a0_0x27f12e as getRegisteredFontIds,a0_0x507f1d as globalResponsiveMultipliers,a0_0x7ec732 as initAssetTextures,a0_0x1782ee as initAssets,a0_0x116e81 as layout,a0_0x5152a1 as playLottieOverlay,a0_0x40cd50 as registerFont,a0_0x1c7576 as registerType,a0_0x38afba as resolveAnchorVec2,a0_0x4d4059 as resolveFont,a0_0x340a90 as resolveFontWeight,a0_0x43443f as resolveScreenAnchorPoint,a0_0x5ce457 as resolveScreenRatioPoint,a0_0x5bb4f4 as runInitSequence,a0_0x20ab92 as setLottieInstance,a0_0x27c41f as spawnSceneFromConfig,a0_0x43520b as updateScreenState};
1
+ (function(_0xde99e8,_0x546899){var a0_0x114f6f={_0x471cd5:0x2eb,_0x3f004e:0x2e0,_0x542de1:0x2e8,_0x17e74d:'%ELG',_0x7b41fe:0x2d9,_0x36cad3:0x2d7,_0x1de7f3:0x2d6,_0x3e3347:'nEjH',_0x2965b8:0x1d2,_0x47e942:'PWV!',_0x644b51:0x1bb,_0x39d0b0:0x1cb,_0x127518:0x1d9,_0x347406:0x1ce,_0x30068c:0x2e1,_0x40ce82:0x2e6,_0xb744aa:0x2d7,_0x113f26:0x2d9,_0x4bfd27:'@zzM',_0x3faef9:0xe,_0x1aad0c:0x8,_0x4433c1:0xb,_0x485895:0x14,_0x13d3b2:0x2d6,_0x4d2ae8:0x2da,_0xa1d36:0x2e2,_0x42842a:0x2e8,_0x1c2b4e:0x2e8,_0x38c89a:0x2d1,_0x4531bd:0x2d9,_0x17e2e1:0x2d0,_0x1760f9:'SA#l',_0x2352cb:0x9,_0x376854:0xa,_0x1430ac:'Ot#H',_0x3f8e0e:0x2,_0x485368:0xd,_0x3d4de5:0x2d9,_0x27d434:0x2db,_0x3ec6f1:0x2d3,_0x1a7314:'*H&x',_0x32e588:0x1c6,_0x5b6ca8:0x1d0,_0x59cb87:0x1bf,_0x1131c8:'BWKm',_0x2ed7a0:0x1d7,_0x2c0a93:0x1e6,_0x5057bc:0x1ca,_0x15830a:'e$IA'},a0_0x355b3e={_0x3f7a62:0x235},a0_0x124975={_0x23081b:0x12f};function _0x56031b(_0x3fdb25,_0x467837,_0x4f3648,_0x304299,_0x26bda6){return a0_0x23f5(_0x304299- -0x9c,_0x4f3648);}function _0x468bc2(_0x503fac,_0x4994ad,_0x3c9208,_0x3304d5,_0x281828){return a0_0x23f5(_0x503fac-a0_0x124975._0x23081b,_0x3304d5);}function _0x4dccef(_0x38a759,_0x51a6d5,_0x40f69c,_0x21f6d6,_0x39866f){return a0_0x23f5(_0x40f69c-a0_0x355b3e._0x3f7a62,_0x39866f);}var _0x5cc1c2=_0xde99e8();while(!![]){try{var _0x2f419b=-parseInt(_0x4dccef(0x2e0,a0_0x114f6f._0x471cd5,a0_0x114f6f._0x3f004e,a0_0x114f6f._0x542de1,a0_0x114f6f._0x17e74d))/(-0x116b+0x2*0xe1e+-0xad0)*(parseInt(_0x4dccef(a0_0x114f6f._0x7b41fe,a0_0x114f6f._0x36cad3,a0_0x114f6f._0x1de7f3,0x2df,a0_0x114f6f._0x3e3347))/(-0x221d+0x169c+0xb83))+-parseInt(_0x468bc2(0x1c7,a0_0x114f6f._0x2965b8,0x1d0,a0_0x114f6f._0x47e942,a0_0x114f6f._0x644b51))/(-0xe50*0x1+-0xef2*0x2+-0x405*-0xb)*(parseInt(_0x468bc2(a0_0x114f6f._0x39d0b0,0x1d1,a0_0x114f6f._0x127518,'E*IE',a0_0x114f6f._0x347406))/(0x3f3*-0x7+0x1*-0x17d7+0x3380))+-parseInt(_0x4dccef(a0_0x114f6f._0x30068c,a0_0x114f6f._0x40ce82,a0_0x114f6f._0xb744aa,a0_0x114f6f._0x113f26,a0_0x114f6f._0x4bfd27))/(-0x1d14+-0x1f6d+0x3c86)*(parseInt(_0x56031b(-a0_0x114f6f._0x3faef9,-a0_0x114f6f._0x1aad0c,'e$IA',-a0_0x114f6f._0x4433c1,-a0_0x114f6f._0x485895))/(0x1*-0xd85+-0x1*0x1bcf+-0x4f*-0x86))+-parseInt(_0x4dccef(a0_0x114f6f._0x13d3b2,a0_0x114f6f._0x4d2ae8,a0_0x114f6f._0xa1d36,a0_0x114f6f._0x42842a,'Q8Sr'))/(0x1731+-0x16d3+-0x57)*(-parseInt(_0x4dccef(a0_0x114f6f._0x1c2b4e,a0_0x114f6f._0x38c89a,a0_0x114f6f._0x4531bd,a0_0x114f6f._0x17e2e1,a0_0x114f6f._0x1760f9))/(-0x2441+-0x194*0x5+-0x107*-0x2b))+parseInt(_0x56031b(-a0_0x114f6f._0x2352cb,a0_0x114f6f._0x376854,a0_0x114f6f._0x1430ac,-a0_0x114f6f._0x3f8e0e,a0_0x114f6f._0x485368))/(-0xb04+0x1fea+-0x14dd)*(parseInt(_0x4dccef(0x2dc,a0_0x114f6f._0x3d4de5,a0_0x114f6f._0x27d434,a0_0x114f6f._0x3ec6f1,a0_0x114f6f._0x1a7314))/(-0x1cba+0x5*0x2e9+0xe37))+-parseInt(_0x468bc2(a0_0x114f6f._0x32e588,a0_0x114f6f._0x5b6ca8,a0_0x114f6f._0x59cb87,a0_0x114f6f._0x1131c8,0x1c4))/(0x19*0x67+0xc4a+0x5*-0x476)+parseInt(_0x468bc2(a0_0x114f6f._0x2ed7a0,a0_0x114f6f._0x2c0a93,a0_0x114f6f._0x5057bc,a0_0x114f6f._0x15830a,a0_0x114f6f._0x5057bc))/(-0x22c7*0x1+0x161*-0x16+0x4129);if(_0x2f419b===_0x546899)break;else _0x5cc1c2['push'](_0x5cc1c2['shift']());}catch(_0x20473d){_0x5cc1c2['push'](_0x5cc1c2['shift']());}}}(a0_0x5bdc,-0x47c8+-0x79*-0x10d5+0x997d*-0x5));var a0_0x583e33=(function(){var a0_0x298c32={_0x445953:0x1e5,_0x42522d:0x1e8,_0x58d397:0x1e0,_0x39c4b5:'Q8Sr'},_0x1bf016=!![];return function(_0x66d017,_0x3ca332){var a0_0x5d30b2={_0x113a97:0x283},_0x2702f3=_0x1bf016?function(){function _0x2eb325(_0xc51ae0,_0x4d2721,_0x27d277,_0x2eb8c5,_0x3f61ac){return a0_0x23f5(_0x2eb8c5- -a0_0x5d30b2._0x113a97,_0x3f61ac);}if(_0x3ca332){var _0x171e5a=_0x3ca332[_0x2eb325(-0x1da,-a0_0x298c32._0x445953,-a0_0x298c32._0x42522d,-a0_0x298c32._0x58d397,a0_0x298c32._0x39c4b5)](_0x66d017,arguments);return _0x3ca332=null,_0x171e5a;}}:function(){};return _0x1bf016=![],_0x2702f3;};}()),a0_0x206d2e=a0_0x583e33(this,function(){var a0_0x5ac6a7={_0x1b8890:0x18b,_0x423364:'dtDG',_0x2a0bb0:0x18d,_0xf95a11:0x193,_0x60d186:0x383,_0x471da7:0x388,_0x21eaf0:0x386,_0x3387d2:0x1c9,_0x21eb29:0x1d5,_0x1dc0ad:0x1c3,_0x1b063e:0x1ce,_0x228a66:0x1a9,_0x3b4126:'dtDG',_0x86e4a4:0x19c,_0x5d5b43:0x1a3,_0x4b1b27:0x19e,_0x10d8e9:0x1a5,_0x25c1a7:')Yr9',_0x2f2d04:0x1af,_0x15f63d:0x19c,_0x25408d:'nqP#',_0x2c475e:0x1a0,_0x4dc6f4:0x190,_0x4b99d4:0x192,_0x4e38e9:0x197,_0x33e052:0x399,_0x4b86f9:0x38c,_0x53a5ab:0x386,_0x12af19:0x390,_0x56905a:0x1a8,_0x2f89c8:0x19d,_0x3e1536:0x38a,_0xe02476:'jiQ3',_0x2be346:0x39b,_0x86ed1b:0x38b,_0xa12cbb:0x3ab,_0x518d42:'Q8Sr',_0x4d559b:0x3a0,_0x54f4d6:0x3ae},a0_0x519c44={_0x8040d0:0x25e},a0_0x7a7bd3={_0x45c5f1:0x2f9},a0_0x16808a={_0x9b5bb3:0xfa},_0x3afe0d={};_0x3afe0d[_0x217fc9(a0_0x5ac6a7._0x1b8890,a0_0x5ac6a7._0x423364,a0_0x5ac6a7._0x2a0bb0,a0_0x5ac6a7._0xf95a11,a0_0x5ac6a7._0x1b8890)]='(((.+'+_0x3885d9(a0_0x5ac6a7._0x60d186,'yQiB',a0_0x5ac6a7._0x471da7,a0_0x5ac6a7._0x21eaf0,0x379)+'+$';function _0x217fc9(_0x5398c1,_0x51024c,_0x589a01,_0x2eb341,_0x1d49f9){return a0_0x23f5(_0x2eb341-a0_0x16808a._0x9b5bb3,_0x51024c);}function _0x3885d9(_0x58b102,_0x5eaaf4,_0x26ce54,_0x2f09b9,_0x3049a2){return a0_0x23f5(_0x26ce54-a0_0x7a7bd3._0x45c5f1,_0x5eaaf4);}function _0x1bcaff(_0x4f1495,_0x1ae4f0,_0x4f4a70,_0x2da2dc,_0x19e000){return a0_0x23f5(_0x2da2dc- -a0_0x519c44._0x8040d0,_0x19e000);}var _0x3e8f3f=_0x3afe0d;return a0_0x206d2e[_0x1bcaff(-a0_0x5ac6a7._0x3387d2,-a0_0x5ac6a7._0x21eb29,-a0_0x5ac6a7._0x1dc0ad,-a0_0x5ac6a7._0x1b063e,'eLAS')+_0x217fc9(a0_0x5ac6a7._0x228a66,a0_0x5ac6a7._0x3b4126,a0_0x5ac6a7._0x86e4a4,a0_0x5ac6a7._0x5d5b43,a0_0x5ac6a7._0x4b1b27)]()[_0x217fc9(a0_0x5ac6a7._0x10d8e9,a0_0x5ac6a7._0x25c1a7,a0_0x5ac6a7._0x2f2d04,0x1a8,a0_0x5ac6a7._0x15f63d)+'h'](_0x3e8f3f[_0x217fc9(a0_0x5ac6a7._0x86e4a4,a0_0x5ac6a7._0x25408d,a0_0x5ac6a7._0x2c475e,0x195,a0_0x5ac6a7._0x4dc6f4)])[_0x217fc9(0x17c,a0_0x5ac6a7._0x423364,a0_0x5ac6a7._0x4b99d4,0x18c,a0_0x5ac6a7._0x4e38e9)+_0x3885d9(a0_0x5ac6a7._0x33e052,'P4w6',a0_0x5ac6a7._0x4b86f9,a0_0x5ac6a7._0x53a5ab,a0_0x5ac6a7._0x12af19)]()['const'+_0x217fc9(a0_0x5ac6a7._0x2c475e,'q#K7',a0_0x5ac6a7._0x56905a,0x1a4,a0_0x5ac6a7._0x2f89c8)+'r'](a0_0x206d2e)[_0x3885d9(a0_0x5ac6a7._0x3e1536,a0_0x5ac6a7._0xe02476,a0_0x5ac6a7._0x33e052,a0_0x5ac6a7._0x2be346,a0_0x5ac6a7._0x86ed1b)+'h'](_0x3e8f3f[_0x3885d9(a0_0x5ac6a7._0xa12cbb,a0_0x5ac6a7._0x518d42,a0_0x5ac6a7._0x4d559b,a0_0x5ac6a7._0x54f4d6,a0_0x5ac6a7._0xa12cbb)]);});a0_0x206d2e();import{A as a0_0x16b727,B as a0_0x28dfb4,C as a0_0x3ee7e8,D as a0_0x2e77eb,b as a0_0x45c5ca,c as a0_0x4c1d9b,d as a0_0x3a5147,e as a0_0x59258f,f as a0_0x2c5e2e,g as a0_0x2783c2,h as a0_0x5a6766,i as a0_0x5b589f,j as a0_0x40ecea,k as a0_0x3711ca,l as a0_0x35d7bd,m as a0_0x5a37fb,n as a0_0x4da11a,o as a0_0x40aabe,p as a0_0x1631d2,q as a0_0x2207f3,r as a0_0x199b4c,s as a0_0x12807b,t as a0_0x31f696,u as a0_0x549f03,v as a0_0x13870b,w as a0_0x44a110,x as a0_0x26232e,y as a0_0x41d159,z as a0_0x3419fd}from'../chunk-LAZBRAEA.js';import{a as a0_0x516c42,b as a0_0x3a5763,c as a0_0x111c01,d as a0_0x196b50,e as a0_0x1a741d}from'../chunk-I5OOVR5U.js';import'../chunk-LV4HGC5G.js';import'../chunk-ZLL42OOV.js';import'../chunk-E6WJCS24.js';import'../chunk-JXBG6UFL.js';function a0_0x5bdc(){var _0x398611=['uSoNW5NdHqWObs7dPmo8vsJcSW','W5K9eCkGWPa','jCoCpCkMW53dJM3cQZr+','W5hcS8oXW5hdPa','EmkmWRJcVaNdQmo5','gmkbC8oQWR8xxCkpWPKqCqO','C8okW4HwmSkGceZdIJSNW57dRq','WQVcVSk+mq9VeCk5WODQamkAW5mP','rSk4W7BdImkY','WRVdNCkJW70InZ0','zLFdRCoJW6DdW7ldGmoahMe','vdddSCk1W50','W5JcVmofW4ibtqXHrtThDa','axNcSmoVWPDhW5FdKmkugfe4W4e','vSkMWO3dHs1xl8kkDG','wWFdICkHW74','WPGRi8ohWPKFW5/dVCkxoKbZW4ldMa','W54upG','W5eRWQnrqa','aa/dQKFcLM3dJtXrFw/dVW','jCkAWORdPthcNmkyWOZcT1BcG8kH','b3JdKCkDW5WOWQ3dMq','W60jo1rg','aCkFW7pdGmkNsSkM','W5ldSGqaiq','W6pdOaCiWQ4','WPSMvCkuW597WQtcMW','W4mvcSkSWRG','zJSY','WR3cHmk4W7iWicXz','WQ3cTmk+uNOas8ovWOS','WPpcI8k9AWWQwa','WRihbvhcQmkYrCohW6aMW6aBCa'];a0_0x5bdc=function(){return _0x398611;};return a0_0x5bdc();}function a0_0x23f5(_0x49ac15,_0x4e8b33){_0x49ac15=_0x49ac15-(-0x2*0x9f7+0x1176*-0x2+0x3768);var _0x5137e6=a0_0x5bdc();var _0x3b04b9=_0x5137e6[_0x49ac15];if(a0_0x23f5['LRQdVd']===undefined){var _0x2be90d=function(_0x420ddd){var _0x1f2f8b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0xdbef33='',_0x3d73b8='',_0x465edb=_0xdbef33+_0x2be90d;for(var _0x4d717e=0x17*0x106+0x104*-0x4+-0x137a,_0x2f4d50,_0x3795f3,_0x1a8d33=0x11b*-0x13+-0x1*-0x1ebd+-0x9bc*0x1;_0x3795f3=_0x420ddd['charAt'](_0x1a8d33++);~_0x3795f3&&(_0x2f4d50=_0x4d717e%(0x1*-0x199c+0x1*-0xdc7+0x2767)?_0x2f4d50*(0xc*0x1b+-0xe*-0x28d+-0x24ba)+_0x3795f3:_0x3795f3,_0x4d717e++%(0x11*0x59+-0x86d+-0x51*-0x8))?_0xdbef33+=_0x465edb['charCodeAt'](_0x1a8d33+(-0x1f*-0xb1+0x1786*0x1+-0x3*0xef9))-(-0x1375*-0x1+0x1694+-0x29ff)!==-0x1471*-0x1+0x2383*-0x1+0xf12?String['fromCharCode'](-0x38c+-0x1b05+0x1f90&_0x2f4d50>>(-(0x10fc+0xf98+-0x2092)*_0x4d717e&-0x2567+-0xee*0x17+-0x1*-0x3acf)):_0x4d717e:0x8db*0x2+0x49*-0x17+-0x1*0xb27){_0x3795f3=_0x1f2f8b['indexOf'](_0x3795f3);}for(var _0x4bff12=-0x1*0x1375+-0x1*-0x959+0x4*0x287,_0x13d4f6=_0xdbef33['length'];_0x4bff12<_0x13d4f6;_0x4bff12++){_0x3d73b8+='%'+('00'+_0xdbef33['charCodeAt'](_0x4bff12)['toString'](0x1e41+-0x1*0x1476+0x35*-0x2f))['slice'](-(0x8b5+0x21f8+0x2aab*-0x1));}return decodeURIComponent(_0x3d73b8);};var _0x2ec4da=function(_0x1de7b7,_0x1112a0){var _0x146e90=[],_0x3700d0=0xe1f*0x1+-0x306*-0x2+-0x142b,_0x260f58,_0x13d7e7='';_0x1de7b7=_0x2be90d(_0x1de7b7);var _0x48d643;for(_0x48d643=-0xb31+-0x90c*0x2+0x1d49;_0x48d643<0x3*0x5b8+0x1*-0x7d3+-0x855;_0x48d643++){_0x146e90[_0x48d643]=_0x48d643;}for(_0x48d643=-0x123f+-0x25b8+-0x1*-0x37f7;_0x48d643<-0x1421*0x1+0x943+0xbde;_0x48d643++){_0x3700d0=(_0x3700d0+_0x146e90[_0x48d643]+_0x1112a0['charCodeAt'](_0x48d643%_0x1112a0['length']))%(-0x83*0x1+-0x373*-0x2+-0x563*0x1),_0x260f58=_0x146e90[_0x48d643],_0x146e90[_0x48d643]=_0x146e90[_0x3700d0],_0x146e90[_0x3700d0]=_0x260f58;}_0x48d643=-0x31*-0x4e+0xb89*-0x2+0x824,_0x3700d0=-0x1452+-0x997*-0x3+0x7*-0x135;for(var _0xedded1=-0x3e6*0xa+0x1034*0x1+0x16c8;_0xedded1<_0x1de7b7['length'];_0xedded1++){_0x48d643=(_0x48d643+(-0xb1*0x25+0x2*0x137a+-0xd5e))%(-0x2*0x3e+-0x1*0x66b+-0x7*-0x121),_0x3700d0=(_0x3700d0+_0x146e90[_0x48d643])%(-0x19cd*0x1+-0x1eb9+0x1*0x3986),_0x260f58=_0x146e90[_0x48d643],_0x146e90[_0x48d643]=_0x146e90[_0x3700d0],_0x146e90[_0x3700d0]=_0x260f58,_0x13d7e7+=String['fromCharCode'](_0x1de7b7['charCodeAt'](_0xedded1)^_0x146e90[(_0x146e90[_0x48d643]+_0x146e90[_0x3700d0])%(-0x1*-0x1a05+0x25*0x9e+-0x2fdb)]);}return _0x13d7e7;};a0_0x23f5['sHyXTL']=_0x2ec4da,a0_0x23f5['DapfgB']={},a0_0x23f5['LRQdVd']=!![];}var _0xc32dcc=_0x5137e6[-0xdba+0xdf*0xf+-0xa9*-0x1],_0x954f86=_0x49ac15+_0xc32dcc,_0xf52438=a0_0x23f5['DapfgB'][_0x954f86];if(!_0xf52438){if(a0_0x23f5['eVVhMr']===undefined){var _0x52c168=function(_0x167d7e){this['FeLzSS']=_0x167d7e,this['WIPgmM']=[0x4bd+0x107d+0x1539*-0x1,0x4fa+-0x8f*-0x45+-0x2b85,0x1*-0x1b61+-0x23c7*0x1+0x3f28],this['mQfaAz']=function(){return'newState';},this['buJVaC']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['ZOfXIJ']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x52c168['prototype']['gYirnU']=function(){var _0x223e8e=new RegExp(this['buJVaC']+this['ZOfXIJ']),_0x56a3ba=_0x223e8e['test'](this['mQfaAz']['toString']())?--this['WIPgmM'][-0x1*-0x15c1+0x1a7d+-0x35*0xe9]:--this['WIPgmM'][0x1b47+0x65b+-0x2*0x10d1];return this['lTBYnJ'](_0x56a3ba);},_0x52c168['prototype']['lTBYnJ']=function(_0x2dfbf8){if(!Boolean(~_0x2dfbf8))return _0x2dfbf8;return this['tYeYXM'](this['FeLzSS']);},_0x52c168['prototype']['tYeYXM']=function(_0x176692){for(var _0x2a3b6e=-0x7d8+-0x56d+-0xd45*-0x1,_0xca0746=this['WIPgmM']['length'];_0x2a3b6e<_0xca0746;_0x2a3b6e++){this['WIPgmM']['push'](Math['round'](Math['random']())),_0xca0746=this['WIPgmM']['length'];}return _0x176692(this['WIPgmM'][-0x3b4*-0x7+-0x1dc0+0x3d4]);},new _0x52c168(a0_0x23f5)['gYirnU'](),a0_0x23f5['eVVhMr']=!![];}_0x3b04b9=a0_0x23f5['sHyXTL'](_0x3b04b9,_0x4e8b33),a0_0x23f5['DapfgB'][_0x954f86]=_0x3b04b9;}else _0x3b04b9=_0xf52438;return _0x3b04b9;}export{a0_0x516c42 as AssetCache,a0_0x111c01 as AssetLoader,a0_0x549f03 as AssetSystem,a0_0x196b50 as AssetTextures,a0_0x12807b as Assets,a0_0x40aabe as BaseSystem,a0_0x4da11a as GameEngine,a0_0x59258f as GameObject,a0_0x2c5e2e as GameObjectManager,a0_0x5a37fb as ObjectFactory,a0_0x3a5147 as Renderer,a0_0x1631d2 as RuntimeObjectRegistry,a0_0x4c1d9b as Transform,a0_0x28dfb4 as applyScreenAnchor,a0_0x2207f3 as basePixi,a0_0x44a110 as clearResponsiveElements,a0_0x45c5ca as createPixiBase,a0_0x40ecea as getRegisteredFontIds,a0_0x13870b as globalResponsiveMultipliers,a0_0x1a741d as initAssetTextures,a0_0x31f696 as initAssets,a0_0x3ee7e8 as layout,a0_0x35d7bd as playLottieOverlay,a0_0x5b589f as registerFont,a0_0x3a5763 as registerType,a0_0x41d159 as resolveAnchorVec2,a0_0x2783c2 as resolveFont,a0_0x5a6766 as resolveFontWeight,a0_0x3419fd as resolveScreenAnchorPoint,a0_0x16b727 as resolveScreenRatioPoint,a0_0x2e77eb as runInitSequence,a0_0x3711ca as setLottieInstance,a0_0x199b4c as spawnSceneFromConfig,a0_0x26232e as updateScreenState};
@@ -43,7 +43,7 @@
43
43
  <button class="debug-btn primary" data-modal-apply>Apply</button>
44
44
  </div>
45
45
  </div>
46
- `,this.modal=i}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(r=>{r.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(r=>{r.addEventListener("click",o=>{let d=o.target.dataset.tab;d&&this.switchTab(d)})});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 s=this.modal.querySelector("[data-modal-apply]");s==null||s.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",r=>{r.target===this.modal&&this.close()})}switchTab(e){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab")===e)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab-panel")===e)})}openAiEditor(e){let n=window.__openAiEditor;if(typeof n!="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}`,n(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 Xo={};ra(Xo,{AspectClass:()=>In,GameObject:()=>ot,GameObjectManager:()=>$t,Renderer:()=>rt,ResponsiveUISystem:()=>Ge,Transform:()=>st,animateHandClick:()=>xs,animatePanelEntrance:()=>vs,createBrushTexture:()=>_s,createEndGamePanel:()=>ys,createHandTutorial:()=>ws,createThreeBase:()=>fs,createTutorialLabel:()=>Es,getAspectClass:()=>Dt,getRegisteredFontIds:()=>bs,loadAsset:()=>$n,loadCharacterFrames:()=>Ts,registerFont:()=>ms,resolveFont:()=>Z,resolveFontWeight:()=>Q,updateHandAnimation:()=>Ss});module.exports=xr(Xo);var V=ae(require("three"),1);var ge={};function mt(t,e,n=!1){ge[t]||(ge[t]=[]),ge[t].push({fn:e,once:n})}function Xt(t,e){if(ge[t]){if(!e){delete ge[t];return}ge[t]=ge[t].filter(n=>n.fn!==e)}}function bt(t,...e){let n=ge[t];if(n)for(let i of[...n])i.fn(...e),i.once&&Xt(t,i.fn)}function B(t,e){mt(t,e,!0)}var P=null,W=[],ke=null;function da(t){P=t,W=[],ke!==null&&(clearTimeout(ke),ke=null)}function pa(){var t,e,n;return{endpoint:(P==null?void 0:P.endpoint)||"",transport:(P==null?void 0:P.transport)||"beacon",batchSize:(t=P==null?void 0:P.batchSize)!=null?t:10,flushIntervalMs:(e=P==null?void 0:P.flushIntervalMs)!=null?e:300,maxQueue:(n=P==null?void 0:P.maxQueue)!=null?n:200,debug:!!(P!=null&&P.debug)}}async function la(t,e,n,i){let a=JSON.stringify(e);if(n==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let s=navigator.sendBeacon(t,new Blob([a],{type:"application/json"}));i&&console.log("[handler.telemetry] beacon",s,e);return}catch(s){i&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",s)}try{await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),i&&console.log("[handler.telemetry] fetch",e)}catch(s){i&&console.warn("[handler.telemetry] fetch failed",s)}}function Jt(t,e){let n=pa();if(e&&n.endpoint){if(W.push(t),W.length>n.maxQueue&&(W=W.slice(W.length-n.maxQueue)),W.length>=n.batchSize){ca();return}ke===null&&(ke=window.setTimeout(()=>{ke=null,ca()},n.flushIntervalMs))}}async function ca(){let t=pa();if(!t.endpoint||W.length===0)return;let e=W.splice(0,t.batchSize);await la(t.endpoint,{events:e},t.transport,t.debug),W.length>0&&await la(t.endpoint,{events:W.splice(0,t.batchSize)},t.transport,t.debug)}function ua(t){return Math.max(0,Math.min(1,t))}function wr(t){let e=String(t!=null?t:"power2.out");if(e==="linear")return n=>n;if(e==="sine.inOut")return n=>.5-Math.cos(Math.PI*n)/2;if(e==="power2.out"||e==="easeOutQuad")return n=>1-(1-n)*(1-n);if(e.startsWith("back.out")){let n=e.match(/back\.out\(([\d.]+)\)/),i=n?Number(n[1]):1.8;return a=>1+(i+1)*Math.pow(a-1,3)+i*Math.pow(a-1,2)}return n=>1-(1-n)*(1-n)}function Ve(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Er(t,e){let n=t==null?void 0:t[e];return typeof n=="number"?n:0}function ga(t,e,n){try{t[e]=n}catch{}}function Sr(t){let e=t==null?void 0:t.scale;if(!e)return null;let n=typeof e.x=="number"?e.x:1,i=typeof e.y=="number"?e.y:1;return{x:n,y:i}}function ha(t,e){let n=t==null?void 0:t.scale;if(n)try{typeof n.set=="function"?n.set(e.x,e.y):(typeof n.x=="number"&&(n.x=e.x),typeof n.y=="number"&&(n.y=e.y))}catch{}}function fa(t,e){let n=Sr(t);if(!n)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:n.x,y:n.y},to:{x:i!=null?i:n.x,y:a!=null?a:n.y}}}function ma(){let t=new Set,e=new WeakMap,n=null,i=()=>{if(n!=null)return;n=requestAnimationFrame(()=>{n=null,o(),t.size>0&&i()})},a=p=>{var g;t.add(p);let c=(g=e.get(p.target))!=null?g:new Set;c.add(p),e.set(p.target,c),i()},s=p=>{t.delete(p);let c=e.get(p.target);c&&(c.delete(p),c.size===0&&e.delete(p.target))},r=p=>{p.killed||(p.killed=!0,s(p))},o=()=>{var c,g;let p=Ve();for(let u of Array.from(t)){if(u.killed||u.paused)continue;let b=p-u.startMs-u.delayMs;if(b<0)continue;let h=u.durationMs>0?b/u.durationMs:1,x=ua(h),v=u.repeat>=0?u.repeat+1:1,y=u.repeat>0?Math.min(Math.floor(h),v-1):0;if(u.repeat>0&&h>=1){let E=h-y;x=ua(E)}let f=u.ease(x);u.yoyo&&y%2===1&&(f=1-f);for(let E of u.props)ga(u.target,E.key,E.from+(E.to-E.from)*f);u.scaleFrom&&u.scaleTo&&ha(u.target,{x:u.scaleFrom.x+(u.scaleTo.x-u.scaleFrom.x)*f,y:u.scaleFrom.y+(u.scaleTo.y-u.scaleFrom.y)*f});try{(c=u.onUpdate)==null||c.call(u)}catch{}if(h>=v){r(u);try{(g=u.onComplete)==null||g.call(u)}catch{}}}},l=(p,c,g)=>{var E;let u=Math.max(0,(typeof c.duration=="number"?c.duration:.5)*1e3),b=Math.max(0,(typeof c.delay=="number"?c.delay:0)*1e3+((E=g==null?void 0:g.delayMsOverride)!=null?E:0)),h=wr(c.ease),x=typeof c.repeat=="number"?Math.max(0,c.repeat|0):0,v=c.yoyo===!0,y=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),f=[];for(let S of Object.keys(c)){if(y.has(S))continue;let A=c[S];typeof A=="number"&&f.push({key:S,from:Er(p,S),to:A})}let m=fa(p,c);return{target:p,startMs:Ve(),delayMs:b,durationMs:u,ease:h,props:f,scaleFrom:m.from,scaleTo:m.to,repeat:x,yoyo:v,onUpdate:typeof c.onUpdate=="function"?c.onUpdate:void 0,onComplete:typeof c.onComplete=="function"?c.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},d={to(p,c){let g=l(p,c);return a(g),{kill:()=>r(g),pause:()=>{g.paused||(g.paused=!0,g.pauseAtMs=Ve())},resume:()=>{var h;if(!g.paused)return;let u=(h=g.pauseAtMs)!=null?h:Ve(),b=Ve()-u;g.startMs+=b,g.paused=!1,g.pauseAtMs=null},isActive:()=>!g.killed&&!g.paused}},fromTo(p,c,g){return d.set(p,c),d.to(p,g)},set(p,c){if(!p||!c)return;for(let u of Object.keys(c)){let b=c[u];u==="scale"||u==="scaleX"||u==="scaleY"||typeof b=="number"&&ga(p,u,b)}let g=fa(p,c);g.to&&ha(p,g.to)},killTweensOf(p){let c=e.get(p);if(c)for(let g of Array.from(c))r(g)},timeline(p={}){let c=[],g=0,u=!1,b=[],h=y=>{if(typeof y=="number")return Math.max(0,y*1e3);let f=typeof y=="string"?y.trim():"";return f.startsWith("+=")?g+Math.max(0,Number(f.slice(2))*1e3||0):f?Math.max(0,Number(f)*1e3||0):g},x=y=>{c.push(y);let f=Math.max(0,(typeof y.vars.duration=="number"?y.vars.duration:.5)*1e3);g=Math.max(g,y.atMs+f)},v={to(y,f,m){return x({kind:"to",target:y,vars:f,atMs:h(m)}),v},fromTo(y,f,m,E){return x({kind:"fromTo",target:y,vars:m,from:f,atMs:h(E)}),v},play(){var y,f;if(u)return v;u=!0,b=[];for(let m of c)m.kind==="fromTo"&&d.set(m.target,(y=m.from)!=null?y:{}),b.push(d.to(m.target,{...m.vars,delay:m.atMs/1e3+((f=m.vars.delay)!=null?f:0)}));return v},pause(){for(let y of b)y.pause();return v},kill(){for(let y of b)y.kill();b=[],u=!1}};return p.paused||v.play(),v}};return d}function ba(){if(typeof window=="undefined")return;let t=window;if(!t.gsap)try{t.gsap=ma()}catch{}}var ya={name:"handler-playable-sdk",version:"0.3.55",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 G=0,Cr=G++,va=G++,xa=G++,wa=G++,Ea=G++,Sa=G++,Aa=G++,Ca=G++,Ta=G++,_a=G++,La=G++,Ma=G++,T=Cr;function Pa(){return T===va}function ka(){return T===xa}function Ra(){return T===wa}function Oa(){return T===Ea}function Re(){return T===Sa}function Oe(){return T===Aa}function Ia(){return T===Ca}function ja(){return T===Ta}function Da(){return T===_a}function Zt(){return T===La}function Qt(){return T===Ma}function $a(){let t=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(t==="mraid")try{mraid.getState(),T=va;return}catch{}else if(t==="dapi")try{dapi.isReady(),T=xa;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(T=wa)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(T=Ea)}catch{}else if(e==="mintegral")window.gameReady&&(T=Sa);else if(e==="tapjoy")window.TJ_API&&(T=Aa);else if(e==="tiktok")window.openAppStore&&(T=Ca);else if(e==="smadex")try{window.smxTracking&&(T=Ta)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(T=_a)}catch{}else e==="vungle"?T=La:(t==="nucleo"||e==="nucleo")&&(T=Ma)}var yt=ae(require("lottie-web"),1),Ha=yt.default;typeof window!="undefined"&&(window.lottie=yt.default,window.__baseLottie=yt.default);var Tr=require("pixi.js");var en=require("pixi.js");var _r=null;function tn(t){_r=t}vt();nn();var Ye=require("pixi.js");vt();var Or=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",on=Or;if(typeof window!="undefined")try{let t=new XMLHttpRequest;if(t.open("GET","./build-settings.json",!1),t.send(),t.status===200&&t.responseText){let e=JSON.parse(t.responseText);e!=null&&e.buildMode&&(on=e.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${on}`))}}catch{}function Ir(t){var n,i,a,s,r;if(typeof window!="undefined"&&window.resolveAnchorVec2)return window.resolveAnchorVec2(t);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(t))return{x:(n=t[0])!=null?n:.5,y:(i=t[1])!=null?i:.5};if(t&&typeof t=="object"&&"x"in t&&"y"in t)return{x:(a=t.x)!=null?a:.5,y:(s=t.y)!=null?s:.5};if(typeof t=="string"){let o=t.trim().toLowerCase();return(r=e[o])!=null?r:{x:.5,y:.5}}return null}var Ae=class{static async create(e,n,i){var l,d,p,c,g,u,b;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${on}`);let a=(l=n==null?void 0:n.render)==null?void 0:l.asset;if(!a){console.log(`[ObjectFactory] No asset definition for: ${e}, returning empty container`);let h=new Ye.Container;return this.applyTransform(h,n==null?void 0:n.transform,n),h}let s=(d=n==null?void 0:n.identity)==null?void 0:d.id;console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${e}, configId: ${s}, type: ${a.type}, path: ${a.path}`);let r=await Se.load(e,a,i,s);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${e}, rawAsset type: ${(p=r==null?void 0:r.constructor)==null?void 0:p.name}`);let o;if(a.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",r,"for object:",e),o=new Ye.Sprite(r),console.log("[ObjectFactory] Created object:",o,"type:",(c=o==null?void 0:o.constructor)==null?void 0:c.name),this.applyTransform(o,n==null?void 0:n.transform,n);else if(a.type==="json")if(console.log("[ObjectFactory] JSON asset for",e,"rawAsset type:",(g=r==null?void 0:r.constructor)==null?void 0:g.name,r),r&&(((u=r.constructor)==null?void 0:u.name)==="Container"||r instanceof Ye.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let h=[a.path,`/assets/${a.path}`,`assets/${a.path}`,`../assets/${a.path}`],x=!1;for(let v of h)try{let y=await fetch(v);if(y.ok){o=await y.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",v,"type:",(b=o==null?void 0:o.constructor)==null?void 0:b.name),x=!0;break}}catch{continue}x||(console.error("[ObjectFactory] Failed to reload JSON from any path"),o=r)}else o=r;else o=r,o&&typeof o=="object"&&("x"in o||"position"in o)&&this.applyTransform(o,n==null?void 0:n.transform,n);return o}static applyTransform(e,n,i){var a,s,r,o;if(!(!n||!e)&&(n.position&&("x"in e&&"y"in e?(e.x=(a=n.position.x)!=null?a:0,e.y=(s=n.position.y)!=null?s:0):"position"in e&&e.position&&e.position.set((r=n.position.x)!=null?r:0,(o=n.position.y)!=null?o:0)),n.scale!==void 0&&"scale"in e&&e.scale&&(typeof e.scale=="object"&&"set"in e.scale?e.scale.set(n.scale):e.scale=n.scale),n.rotation!==void 0&&"rotation"in e&&(e.rotation=n.rotation),n.anchor&&"anchor"in e&&e.anchor)){let l=Ir(n.anchor);l&&("set"in e.anchor?e.anchor.set(l.x,l.y):(e.anchor.x=l.x,e.anchor.y=l.y))}}};var Ke=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 $r=ae(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=$r);Xe();var wt=require("pixi.js");Xe();var cn=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new Ke}init(e,n){this.registry.init(e),this.app=n}updateConfig(e){this.registry.init(e),this.instanceCache.clear(),this.readyPromise=null}async ready(){this.readyPromise&&await this.readyPromise;let n=this.registry.getAllIds().filter(a=>!this.instanceCache.has(a));if(n.length===0)return;let i=async a=>{a.length&&(console.log("[Assets] Loading objects:",a),await Promise.all(a.map(async s=>{var o;let r=this.registry.get(s);if(!r){console.warn("[Assets] No config found for object:",s);return}try{let l=await Ae.create(s,r,this.app);this.instanceCache.set(s,l),console.log("[Assets] Loaded object:",s,(o=l==null?void 0:l.constructor)==null?void 0:o.name)}catch(l){console.error("[Assets] Failed to load object:",s,l)}})))};return this.readyPromise=(async()=>{await i(n);let a=this.registry.getAllIds().filter(s=>!this.instanceCache.has(s));a.length>0&&(console.warn("[Assets] Retrying missing assets:",a),await i(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 n=this.registry.get(e);if(n){let i=await Ae.create(e,n,this.app);this.instanceCache.set(e,i)}}get(e){return this.instanceCache.get(e)}},zr=new cn,Nr=new Proxy(zr,{get(t,e){if(e in t&&typeof t[e]=="function")return t[e].bind(t);if(t.get(e))return t.get(e)}});Xe();var Ba=require("pixi.js"),le={width:400,height:600,designWidth:400,scaleFactor:1},St={scale:1,position:1},pn=[];function Gr(t,e,n,i,a,s,r){pn.push({element:t,originalScale:s,positionHelper:e,heightPercent:a}),e(t,n,i,a,s,r,!1)}function Ur(){pn.forEach(({element:t,originalScale:e,positionHelper:n,heightPercent:i})=>{let a=e*le.scaleFactor;n(t,le.width,le.height,i,a,!0,!1)})}function dn(t,e){console.log(`[SCREEN] updateScreenState called: ${t}x${e}`),le.width=t,le.height=e,le.scaleFactor=Math.min(t/le.designWidth,1.15),St.scale=le.scaleFactor,St.position=1,console.log(`[SCREEN] Global multipliers - scale: ${St.scale.toFixed(3)}`),Ur()}var Ze={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 qr(t,e,n){let i=Ze[t];i&&i[e]!==void 0&&(i[e]=n,console.log(`Updated ${t}.${e} = ${n}`))}function Wr(){return Ze}var Vr={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 Et(t,e){return typeof t=="number"&&Number.isFinite(t)?t:e}function At(t,e={x:.5,y:.5}){var n;if(Array.isArray(t))return{x:Et(t[0],e.x),y:Et(t[1],e.y)};if(t&&typeof t=="object"){let i=t;return{x:Et(i.x,e.x),y:Et(i.y,e.y)}}if(typeof t=="string"){let i=t.trim().toLowerCase();return(n=Vr[i])!=null?n:e}return e}function Ga(t,e,n,i={}){var u,b,h,x,v,y;let a=At(n),s=(u=i.inset)!=null?u:{},r=(b=i.padding)!=null?b:{x:0,y:0},o=((h=s.left)!=null?h:0)+r.x,l=((x=s.right)!=null?x:0)+r.x,d=((v=s.top)!=null?v:0)+r.y,p=((y=s.bottom)!=null?y:0)+r.y,c=Math.max(0,t-o-l),g=Math.max(0,e-d-p);return{x:o+c*a.x,y:d+g*a.y}}function Ua(t,e,n,i={}){var h,x,v,y,f,m;let a=(h=i.inset)!=null?h:{},s=(x=i.padding)!=null?x:{x:0,y:0},r=((v=a.left)!=null?v:0)+s.x,o=((y=a.right)!=null?y:0)+s.x,l=((f=a.top)!=null?f:0)+s.y,d=((m=a.bottom)!=null?m:0)+s.y,p=Math.max(0,t-r-o),c=Math.max(0,e-l-d),g=At(n,{x:.5,y:.5}),u=Math.min(Math.max(g.x,0),1),b=Math.min(Math.max(g.y,0),1);return{x:r+p*u,y:l+c*b}}if(typeof window!="undefined"){let t=window.innerWidth,e=window.innerHeight,n=()=>{let i=window.innerWidth,a=window.innerHeight;(i!==t||a!==e)&&(t=i,e=a,dn(i,a))};window.addEventListener("resize",n),window.addEventListener("orientationchange",()=>{setTimeout(n,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",n),window.mraid.addEventListener("sizeChange",n)),dn(window.innerWidth,window.innerHeight),window.updateDebugConfig=qr,window.getDebugConfig=Wr,window.copyConfig=ao,window.applyConfig=Je,window.applyConfigForRatio=so,window.positionAtBottom=qa,window.positionAtTop=Xr,window.positionAtCenter=Jr,window.positionAtLeft=Zr,window.positionAtRight=Qr,window.positionAtBottomLeft=eo,window.positionAtBottomRight=to,window.positionAtTopLeft=no,window.positionAtTopRight=io,window.applyPositionContract=Kr,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 Ct(t,e,n=0){return t*e+n}function Tt(t,e,n=0){return t*(1-e)+n}function _t(t,e,n=0){return t*e+n}function Lt(t,e,n=0){return t*(1-e)+n}function U(t,e=0){return t/2+e}function Yr(t,e){return t*e}function Kr(t,e,n,i){var r,o,l,d,p,c,g,u,b,h,x,v,y,f,m,E,S,A,M,R;let a=0,s=0;switch(i.type){case"top":a=U(e,(o=(r=i.offset)==null?void 0:r.x)!=null?o:0),s=Ct(n,i.percent,(d=(l=i.offset)==null?void 0:l.y)!=null?d:0);break;case"bottom":a=U(e,(c=(p=i.offset)==null?void 0:p.x)!=null?c:0),s=Tt(n,i.percent,(u=(g=i.offset)==null?void 0:g.y)!=null?u:0);break;case"left":a=_t(e,i.percent,(h=(b=i.offset)==null?void 0:b.x)!=null?h:0),s=U(n,(v=(x=i.offset)==null?void 0:x.y)!=null?v:0);break;case"right":a=Lt(e,i.percent,(f=(y=i.offset)==null?void 0:y.x)!=null?f:0),s=U(n,(E=(m=i.offset)==null?void 0:m.y)!=null?E:0);break;case"center":a=U(e,(A=(S=i.offset)==null?void 0:S.x)!=null?A:0),s=U(n,(R=(M=i.offset)==null?void 0:M.y)!=null?R:0);break}t.position?t.position.set(a,s):(t.x=a,t.y=s),i.scale!==void 0&&i.scale!==1&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(i.scale,i.scale):(t.scale.x=i.scale,t.scale.y=i.scale))}function qa(t,e,n,i=.2,a=1,s=!0,r=!1){let o=Yr(n,i),l=Tt(n,i/2);ce(t,U(e),l);let d=s?a*le.scaleFactor:a;de(t,d),r&&!pn.find(p=>p.element===t)&&Gr(t,qa,e,n,i,a,s)}function Xr(t,e,n,i=.1,a=1){ce(t,U(e),Ct(n,i)),de(t,a)}function Jr(t,e,n,i=0,a=0,s=1){ce(t,U(e,i),U(n,a)),de(t,s)}function Zr(t,e,n,i=.1,a=1){ce(t,_t(e,i),U(n)),de(t,a)}function Qr(t,e,n,i=.1,a=1){ce(t,Lt(e,i),U(n)),de(t,a)}function eo(t,e,n,i=.05,a=.05,s=1){ce(t,_t(e,a),Tt(n,i)),de(t,s)}function to(t,e,n,i=.05,a=.05,s=1){ce(t,Lt(e,a),Tt(n,i)),de(t,s)}function no(t,e,n,i=.05,a=.05,s=1){ce(t,_t(e,a),Ct(n,i)),de(t,s)}function io(t,e,n,i=.05,a=.05,s=1){ce(t,Lt(e,a),Ct(n,i)),de(t,s)}function ce(t,e,n){t&&t.position?typeof t.position.set=="function"?t.position.set(e,n):(t.position.x=e,t.position.y=n):t&&(t.x=e,t.y=n)}function de(t,e){e!==1&&t&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(e,e):t.scale.x!==void 0&&t.scale.y!==void 0&&(t.scale.x=e,t.scale.y=e))}var Ce={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 ao(t){return t&&Ce[t]?JSON.parse(JSON.stringify(Ce[t])):JSON.parse(JSON.stringify(Ze))}function Je(t){Object.keys(t).forEach(e=>{let n=e;Ze[n]&&t[n]&&Object.assign(Ze[n],t[n])}),console.log("Config applied:",t)}function so(t,e){let n=t/e;n>1.6?(Je(Ce.wide),console.log("Applied WIDE config for ratio:",n)):n<.7?(Je(Ce.tall),console.log("Applied TALL config for ratio:",n)):n>.8&&n<1.2?(Je(Ce.square),console.log("Applied SQUARE config for ratio:",n)):(Je(Ce.default),console.log("Applied DEFAULT config for ratio:",n))}if(typeof window!="undefined"){let t=window;t.configPresets=Ce,t.resolveAnchorVec2=t.resolveAnchorVec2||At,t.resolveScreenAnchorPoint=t.resolveScreenAnchorPoint||Ga,t.resolveScreenRatioPoint=t.resolveScreenRatioPoint||Ua}hn();function k(t,e){let n=(a,s)=>s===0?a:n(s,a%s),i=n(t,e);return`${t/i}:${e/i}`}var Bc=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:k(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:k(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:k(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:k(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:k(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:k(360,780)}],Gc=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:k(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:k(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:k(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:k(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:k(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:k(412,915)}],Uc=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:k(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:k(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:k(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:k(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:k(800,1280)}],Ka=[{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:k(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:k(768,1024),mraidScale:.7}];var qc=[...Ka];var ho=Ka[0];fe();var xo=ae(require("jszip"),1);function bo(t){return new Promise((e,n)=>{let i=new FileReader;i.onerror=()=>n(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(t)})}function yo(t){var a;let[e,n]=t.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:n!=null?n:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}async function vo(t){return await new Promise(e=>{let n=new Image;n.onload=()=>e({width:n.naturalWidth||n.width,height:n.naturalHeight||n.height}),n.onerror=()=>e(null),n.src=t})}async function fn(t){var e,n;try{console.log("[ImageUtils] Fetching image data from URL:",t);let i=await fetch(t);if(!i.ok)return console.warn("[ImageUtils] Fetch failed with status:",i.status,t),null;let a=await i.blob();console.log("[ImageUtils] Blob received, size:",a.size,"type:",a.type);let s=await bo(a),r=await vo(s),o=yo(s);return console.log("[ImageUtils] Success resolution:",r==null?void 0:r.width,"x",r==null?void 0:r.height,"mime:",o.mimeType),{base64:o.base64,mimeType:o.mimeType,dataUrl:s,width:(e=r==null?void 0:r.width)!=null?e:0,height:(n=r==null?void 0:r.height)!=null?n:0}}catch(i){return console.error("[ImageUtils] Error fetching image data:",i),null}}async function Mt(t,e=30){try{console.log("[ImageUtils] Removing background color...");let n=await new Promise((c,g)=>{let u=new Image;u.onload=()=>c(u),u.onerror=()=>g(new Error("Failed to load image")),u.src=t}),i=document.createElement("canvas");i.width=n.width,i.height=n.height;let a=i.getContext("2d");if(!a)return console.error("[ImageUtils] Failed to get canvas context"),t;a.drawImage(n,0,0);let s=a.getImageData(0,0,i.width,i.height),r=s.data,l=[{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(c=>({r:r[c.offset],g:r[c.offset+1],b:r[c.offset+2]})),d=0;for(let c=0;c<r.length;c+=4){let g=r[c],u=r[c+1],b=r[c+2],h=!1;for(let x of l)if(Math.sqrt(Math.pow(g-x.r,2)+Math.pow(u-x.g,2)+Math.pow(b-x.b,2))<e){h=!0;break}h&&(r[c+3]=0,d++)}return console.log(`[ImageUtils] Removed background from ${d} pixels (4-corner sampling, tolerance: ${e})`),a.putImageData(s,0,0),i.toDataURL("image/png")}catch(n){return console.error("[ImageUtils] Error removing background:",n),t}}var Xa=require("@google/genai");async function mn(t,e,n=[],i={}){var a,s,r,o,l,d,p;try{if(!(t!=null&&t.trim()))throw new Error("Gemini API key is required");if(!(e!=null&&e.trim()))throw new Error("Prompt is required");for(let v=0;v<n.length;v++){let y=n[v];if(!y.base64||!y.mimeType)throw new Error(`Image ${v+1} is missing required data`);if(y.base64.length<1e3&&console.warn(`Image ${v+1} data appears very small, may be corrupted`),!y.mimeType.startsWith("image/"))throw new Error(`Image ${v+1} has invalid MIME type: ${y.mimeType}`)}let c=new Xa.GoogleGenAI({apiKey:t}),g="gemini-2.5-flash",u=[e];n.length>0&&n.forEach((v,y)=>{u.push({inlineData:{data:v.base64,mimeType:v.mimeType}}),console.log(`[Gemini] Added image ${y+1}: ${v.mimeType}, size: ${Math.round(v.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${n.length} images and prompt length: ${e.length}`);let b=await c.models.generateContent({model:g,contents:u}),h="",x=(r=(s=(a=b.candidates)==null?void 0:a[0])==null?void 0:s.content)==null?void 0:r.parts;if(x)for(let v of x)v.text&&(h+=v.text);if(!h.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${h.length}`),h}catch(c){throw console.error("[Gemini] API error:",c),(o=c.message)!=null&&o.includes("Unable to process input image")?new Error("Unable to process the uploaded image. Please ensure it's a valid PNG, JPG, or JPEG file under 10MB and not corrupted."):(l=c.message)!=null&&l.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(d=c.message)!=null&&d.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(p=c.message)!=null&&p.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):c}}var Ja=require("@google/genai");async function Pt(t,e,n=[],i={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new Ja.GoogleGenAI({apiKey:t}),s=[{text:e}];n.length>0&&n.forEach((o,l)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${l}`),s.push({inlineData:{mimeType:o.mimeType,data:o.base64}})}),console.info("[GEMINI-REAL-SDK] Calling generateContent with model: gemini-2.5-flash-image");let r=await a.models.generateContent({model:"gemini-2.5-flash-image",contents:s});if(console.info("[GEMINI-REAL-SDK] Received response from model"),!r.candidates||!r.candidates[0]||!r.candidates[0].content||!r.candidates[0].content.parts)throw new Error("Gemini 2.5 Flash Image returned invalid response structure.");for(let o of r.candidates[0].content.parts)if(o.text)console.log(o.text);else if(o.inlineData){let l=o.inlineData.data,d=o.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${d};base64,${l}`}throw new Error("Gemini 2.5 Flash Image returned no image data.")}catch(a){throw console.error("[GEMINI-REAL-SDK] Error in generateImageWithGemini25Flash:",JSON.stringify(a,Object.getOwnPropertyNames(a),2)),a}}var wo=require("pixi.js");Xe();fe();var Qa=require("pixi.js");var Eo=require("pixi.js");fe();function Mo(t){return new Promise((e,n)=>{let i=new FileReader;i.onerror=()=>n(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(t)})}function Po(t){var a;let[e,n]=t.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:n!=null?n:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}function ko(t){return`
46
+ `,this.modal=i}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(r=>{r.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(r=>{r.addEventListener("click",o=>{let d=o.target.dataset.tab;d&&this.switchTab(d)})});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 s=this.modal.querySelector("[data-modal-apply]");s==null||s.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",r=>{r.target===this.modal&&this.close()})}switchTab(e){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab")===e)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab-panel")===e)})}openAiEditor(e){let n=window.__openAiEditor;if(typeof n!="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}`,n(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 Xo={};ra(Xo,{AspectClass:()=>In,GameObject:()=>ot,GameObjectManager:()=>$t,Renderer:()=>rt,ResponsiveUISystem:()=>Ge,Transform:()=>st,animateHandClick:()=>xs,animatePanelEntrance:()=>vs,createBrushTexture:()=>_s,createEndGamePanel:()=>ys,createHandTutorial:()=>ws,createThreeBase:()=>fs,createTutorialLabel:()=>Es,getAspectClass:()=>Dt,getRegisteredFontIds:()=>bs,loadAsset:()=>$n,loadCharacterFrames:()=>Ts,registerFont:()=>ms,resolveFont:()=>Z,resolveFontWeight:()=>Q,updateHandAnimation:()=>Ss});module.exports=xr(Xo);var V=ae(require("three"),1);var ge={};function mt(t,e,n=!1){ge[t]||(ge[t]=[]),ge[t].push({fn:e,once:n})}function Xt(t,e){if(ge[t]){if(!e){delete ge[t];return}ge[t]=ge[t].filter(n=>n.fn!==e)}}function bt(t,...e){let n=ge[t];if(n)for(let i of[...n])i.fn(...e),i.once&&Xt(t,i.fn)}function B(t,e){mt(t,e,!0)}var P=null,W=[],ke=null;function da(t){P=t,W=[],ke!==null&&(clearTimeout(ke),ke=null)}function pa(){var t,e,n;return{endpoint:(P==null?void 0:P.endpoint)||"",transport:(P==null?void 0:P.transport)||"beacon",batchSize:(t=P==null?void 0:P.batchSize)!=null?t:10,flushIntervalMs:(e=P==null?void 0:P.flushIntervalMs)!=null?e:300,maxQueue:(n=P==null?void 0:P.maxQueue)!=null?n:200,debug:!!(P!=null&&P.debug)}}async function la(t,e,n,i){let a=JSON.stringify(e);if(n==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let s=navigator.sendBeacon(t,new Blob([a],{type:"application/json"}));i&&console.log("[handler.telemetry] beacon",s,e);return}catch(s){i&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",s)}try{await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),i&&console.log("[handler.telemetry] fetch",e)}catch(s){i&&console.warn("[handler.telemetry] fetch failed",s)}}function Jt(t,e){let n=pa();if(e&&n.endpoint){if(W.push(t),W.length>n.maxQueue&&(W=W.slice(W.length-n.maxQueue)),W.length>=n.batchSize){ca();return}ke===null&&(ke=window.setTimeout(()=>{ke=null,ca()},n.flushIntervalMs))}}async function ca(){let t=pa();if(!t.endpoint||W.length===0)return;let e=W.splice(0,t.batchSize);await la(t.endpoint,{events:e},t.transport,t.debug),W.length>0&&await la(t.endpoint,{events:W.splice(0,t.batchSize)},t.transport,t.debug)}function ua(t){return Math.max(0,Math.min(1,t))}function wr(t){let e=String(t!=null?t:"power2.out");if(e==="linear")return n=>n;if(e==="sine.inOut")return n=>.5-Math.cos(Math.PI*n)/2;if(e==="power2.out"||e==="easeOutQuad")return n=>1-(1-n)*(1-n);if(e.startsWith("back.out")){let n=e.match(/back\.out\(([\d.]+)\)/),i=n?Number(n[1]):1.8;return a=>1+(i+1)*Math.pow(a-1,3)+i*Math.pow(a-1,2)}return n=>1-(1-n)*(1-n)}function Ve(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Er(t,e){let n=t==null?void 0:t[e];return typeof n=="number"?n:0}function ga(t,e,n){try{t[e]=n}catch{}}function Sr(t){let e=t==null?void 0:t.scale;if(!e)return null;let n=typeof e.x=="number"?e.x:1,i=typeof e.y=="number"?e.y:1;return{x:n,y:i}}function ha(t,e){let n=t==null?void 0:t.scale;if(n)try{typeof n.set=="function"?n.set(e.x,e.y):(typeof n.x=="number"&&(n.x=e.x),typeof n.y=="number"&&(n.y=e.y))}catch{}}function fa(t,e){let n=Sr(t);if(!n)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:n.x,y:n.y},to:{x:i!=null?i:n.x,y:a!=null?a:n.y}}}function ma(){let t=new Set,e=new WeakMap,n=null,i=()=>{if(n!=null)return;n=requestAnimationFrame(()=>{n=null,o(),t.size>0&&i()})},a=p=>{var g;t.add(p);let c=(g=e.get(p.target))!=null?g:new Set;c.add(p),e.set(p.target,c),i()},s=p=>{t.delete(p);let c=e.get(p.target);c&&(c.delete(p),c.size===0&&e.delete(p.target))},r=p=>{p.killed||(p.killed=!0,s(p))},o=()=>{var c,g;let p=Ve();for(let u of Array.from(t)){if(u.killed||u.paused)continue;let b=p-u.startMs-u.delayMs;if(b<0)continue;let h=u.durationMs>0?b/u.durationMs:1,x=ua(h),v=u.repeat>=0?u.repeat+1:1,y=u.repeat>0?Math.min(Math.floor(h),v-1):0;if(u.repeat>0&&h>=1){let E=h-y;x=ua(E)}let f=u.ease(x);u.yoyo&&y%2===1&&(f=1-f);for(let E of u.props)ga(u.target,E.key,E.from+(E.to-E.from)*f);u.scaleFrom&&u.scaleTo&&ha(u.target,{x:u.scaleFrom.x+(u.scaleTo.x-u.scaleFrom.x)*f,y:u.scaleFrom.y+(u.scaleTo.y-u.scaleFrom.y)*f});try{(c=u.onUpdate)==null||c.call(u)}catch{}if(h>=v){r(u);try{(g=u.onComplete)==null||g.call(u)}catch{}}}},l=(p,c,g)=>{var E;let u=Math.max(0,(typeof c.duration=="number"?c.duration:.5)*1e3),b=Math.max(0,(typeof c.delay=="number"?c.delay:0)*1e3+((E=g==null?void 0:g.delayMsOverride)!=null?E:0)),h=wr(c.ease),x=typeof c.repeat=="number"?Math.max(0,c.repeat|0):0,v=c.yoyo===!0,y=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),f=[];for(let S of Object.keys(c)){if(y.has(S))continue;let A=c[S];typeof A=="number"&&f.push({key:S,from:Er(p,S),to:A})}let m=fa(p,c);return{target:p,startMs:Ve(),delayMs:b,durationMs:u,ease:h,props:f,scaleFrom:m.from,scaleTo:m.to,repeat:x,yoyo:v,onUpdate:typeof c.onUpdate=="function"?c.onUpdate:void 0,onComplete:typeof c.onComplete=="function"?c.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},d={to(p,c){let g=l(p,c);return a(g),{kill:()=>r(g),pause:()=>{g.paused||(g.paused=!0,g.pauseAtMs=Ve())},resume:()=>{var h;if(!g.paused)return;let u=(h=g.pauseAtMs)!=null?h:Ve(),b=Ve()-u;g.startMs+=b,g.paused=!1,g.pauseAtMs=null},isActive:()=>!g.killed&&!g.paused}},fromTo(p,c,g){return d.set(p,c),d.to(p,g)},set(p,c){if(!p||!c)return;for(let u of Object.keys(c)){let b=c[u];u==="scale"||u==="scaleX"||u==="scaleY"||typeof b=="number"&&ga(p,u,b)}let g=fa(p,c);g.to&&ha(p,g.to)},killTweensOf(p){let c=e.get(p);if(c)for(let g of Array.from(c))r(g)},timeline(p={}){let c=[],g=0,u=!1,b=[],h=y=>{if(typeof y=="number")return Math.max(0,y*1e3);let f=typeof y=="string"?y.trim():"";return f.startsWith("+=")?g+Math.max(0,Number(f.slice(2))*1e3||0):f?Math.max(0,Number(f)*1e3||0):g},x=y=>{c.push(y);let f=Math.max(0,(typeof y.vars.duration=="number"?y.vars.duration:.5)*1e3);g=Math.max(g,y.atMs+f)},v={to(y,f,m){return x({kind:"to",target:y,vars:f,atMs:h(m)}),v},fromTo(y,f,m,E){return x({kind:"fromTo",target:y,vars:m,from:f,atMs:h(E)}),v},play(){var y,f;if(u)return v;u=!0,b=[];for(let m of c)m.kind==="fromTo"&&d.set(m.target,(y=m.from)!=null?y:{}),b.push(d.to(m.target,{...m.vars,delay:m.atMs/1e3+((f=m.vars.delay)!=null?f:0)}));return v},pause(){for(let y of b)y.pause();return v},kill(){for(let y of b)y.kill();b=[],u=!1}};return p.paused||v.play(),v}};return d}function ba(){if(typeof window=="undefined")return;let t=window;if(!t.gsap)try{t.gsap=ma()}catch{}}var ya={name:"handler-playable-sdk",version:"0.3.56",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 G=0,Cr=G++,va=G++,xa=G++,wa=G++,Ea=G++,Sa=G++,Aa=G++,Ca=G++,Ta=G++,_a=G++,La=G++,Ma=G++,T=Cr;function Pa(){return T===va}function ka(){return T===xa}function Ra(){return T===wa}function Oa(){return T===Ea}function Re(){return T===Sa}function Oe(){return T===Aa}function Ia(){return T===Ca}function ja(){return T===Ta}function Da(){return T===_a}function Zt(){return T===La}function Qt(){return T===Ma}function $a(){let t=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(t==="mraid")try{mraid.getState(),T=va;return}catch{}else if(t==="dapi")try{dapi.isReady(),T=xa;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(T=wa)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(T=Ea)}catch{}else if(e==="mintegral")window.gameReady&&(T=Sa);else if(e==="tapjoy")window.TJ_API&&(T=Aa);else if(e==="tiktok")window.openAppStore&&(T=Ca);else if(e==="smadex")try{window.smxTracking&&(T=Ta)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(T=_a)}catch{}else e==="vungle"?T=La:(t==="nucleo"||e==="nucleo")&&(T=Ma)}var yt=ae(require("lottie-web"),1),Ha=yt.default;typeof window!="undefined"&&(window.lottie=yt.default,window.__baseLottie=yt.default);var Tr=require("pixi.js");var en=require("pixi.js");var _r=null;function tn(t){_r=t}vt();nn();var Ye=require("pixi.js");vt();var Or=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",on=Or;if(typeof window!="undefined")try{let t=new XMLHttpRequest;if(t.open("GET","./build-settings.json",!1),t.send(),t.status===200&&t.responseText){let e=JSON.parse(t.responseText);e!=null&&e.buildMode&&(on=e.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${on}`))}}catch{}function Ir(t){var n,i,a,s,r;if(typeof window!="undefined"&&window.resolveAnchorVec2)return window.resolveAnchorVec2(t);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(t))return{x:(n=t[0])!=null?n:.5,y:(i=t[1])!=null?i:.5};if(t&&typeof t=="object"&&"x"in t&&"y"in t)return{x:(a=t.x)!=null?a:.5,y:(s=t.y)!=null?s:.5};if(typeof t=="string"){let o=t.trim().toLowerCase();return(r=e[o])!=null?r:{x:.5,y:.5}}return null}var Ae=class{static async create(e,n,i){var l,d,p,c,g,u,b;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${on}`);let a=(l=n==null?void 0:n.render)==null?void 0:l.asset;if(!a){console.log(`[ObjectFactory] No asset definition for: ${e}, returning empty container`);let h=new Ye.Container;return this.applyTransform(h,n==null?void 0:n.transform,n),h}let s=(d=n==null?void 0:n.identity)==null?void 0:d.id;console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${e}, configId: ${s}, type: ${a.type}, path: ${a.path}`);let r=await Se.load(e,a,i,s);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${e}, rawAsset type: ${(p=r==null?void 0:r.constructor)==null?void 0:p.name}`);let o;if(a.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",r,"for object:",e),o=new Ye.Sprite(r),console.log("[ObjectFactory] Created object:",o,"type:",(c=o==null?void 0:o.constructor)==null?void 0:c.name),this.applyTransform(o,n==null?void 0:n.transform,n);else if(a.type==="json")if(console.log("[ObjectFactory] JSON asset for",e,"rawAsset type:",(g=r==null?void 0:r.constructor)==null?void 0:g.name,r),r&&(((u=r.constructor)==null?void 0:u.name)==="Container"||r instanceof Ye.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let h=[a.path,`/assets/${a.path}`,`assets/${a.path}`,`../assets/${a.path}`],x=!1;for(let v of h)try{let y=await fetch(v);if(y.ok){o=await y.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",v,"type:",(b=o==null?void 0:o.constructor)==null?void 0:b.name),x=!0;break}}catch{continue}x||(console.error("[ObjectFactory] Failed to reload JSON from any path"),o=r)}else o=r;else o=r,o&&typeof o=="object"&&("x"in o||"position"in o)&&this.applyTransform(o,n==null?void 0:n.transform,n);return o}static applyTransform(e,n,i){var a,s,r,o;if(!(!n||!e)&&(n.position&&("x"in e&&"y"in e?(e.x=(a=n.position.x)!=null?a:0,e.y=(s=n.position.y)!=null?s:0):"position"in e&&e.position&&e.position.set((r=n.position.x)!=null?r:0,(o=n.position.y)!=null?o:0)),n.scale!==void 0&&"scale"in e&&e.scale&&(typeof e.scale=="object"&&"set"in e.scale?e.scale.set(n.scale):e.scale=n.scale),n.rotation!==void 0&&"rotation"in e&&(e.rotation=n.rotation),n.anchor&&"anchor"in e&&e.anchor)){let l=Ir(n.anchor);l&&("set"in e.anchor?e.anchor.set(l.x,l.y):(e.anchor.x=l.x,e.anchor.y=l.y))}}};var Ke=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 $r=ae(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=$r);Xe();var wt=require("pixi.js");Xe();var cn=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new Ke}init(e,n){this.registry.init(e),this.app=n}updateConfig(e){this.registry.init(e),this.instanceCache.clear(),this.readyPromise=null}async ready(){this.readyPromise&&await this.readyPromise;let n=this.registry.getAllIds().filter(a=>!this.instanceCache.has(a));if(n.length===0)return;let i=async a=>{a.length&&(console.log("[Assets] Loading objects:",a),await Promise.all(a.map(async s=>{var o;let r=this.registry.get(s);if(!r){console.warn("[Assets] No config found for object:",s);return}try{let l=await Ae.create(s,r,this.app);this.instanceCache.set(s,l),console.log("[Assets] Loaded object:",s,(o=l==null?void 0:l.constructor)==null?void 0:o.name)}catch(l){console.error("[Assets] Failed to load object:",s,l)}})))};return this.readyPromise=(async()=>{await i(n);let a=this.registry.getAllIds().filter(s=>!this.instanceCache.has(s));a.length>0&&(console.warn("[Assets] Retrying missing assets:",a),await i(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 n=this.registry.get(e);if(n){let i=await Ae.create(e,n,this.app);this.instanceCache.set(e,i)}}get(e){return this.instanceCache.get(e)}},zr=new cn,Nr=new Proxy(zr,{get(t,e){if(e in t&&typeof t[e]=="function")return t[e].bind(t);if(t.get(e))return t.get(e)}});Xe();var Ba=require("pixi.js"),le={width:400,height:600,designWidth:400,scaleFactor:1},St={scale:1,position:1},pn=[];function Gr(t,e,n,i,a,s,r){pn.push({element:t,originalScale:s,positionHelper:e,heightPercent:a}),e(t,n,i,a,s,r,!1)}function Ur(){pn.forEach(({element:t,originalScale:e,positionHelper:n,heightPercent:i})=>{let a=e*le.scaleFactor;n(t,le.width,le.height,i,a,!0,!1)})}function dn(t,e){console.log(`[SCREEN] updateScreenState called: ${t}x${e}`),le.width=t,le.height=e,le.scaleFactor=Math.min(t/le.designWidth,1.15),St.scale=le.scaleFactor,St.position=1,console.log(`[SCREEN] Global multipliers - scale: ${St.scale.toFixed(3)}`),Ur()}var Ze={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 qr(t,e,n){let i=Ze[t];i&&i[e]!==void 0&&(i[e]=n,console.log(`Updated ${t}.${e} = ${n}`))}function Wr(){return Ze}var Vr={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 Et(t,e){return typeof t=="number"&&Number.isFinite(t)?t:e}function At(t,e={x:.5,y:.5}){var n;if(Array.isArray(t))return{x:Et(t[0],e.x),y:Et(t[1],e.y)};if(t&&typeof t=="object"){let i=t;return{x:Et(i.x,e.x),y:Et(i.y,e.y)}}if(typeof t=="string"){let i=t.trim().toLowerCase();return(n=Vr[i])!=null?n:e}return e}function Ga(t,e,n,i={}){var u,b,h,x,v,y;let a=At(n),s=(u=i.inset)!=null?u:{},r=(b=i.padding)!=null?b:{x:0,y:0},o=((h=s.left)!=null?h:0)+r.x,l=((x=s.right)!=null?x:0)+r.x,d=((v=s.top)!=null?v:0)+r.y,p=((y=s.bottom)!=null?y:0)+r.y,c=Math.max(0,t-o-l),g=Math.max(0,e-d-p);return{x:o+c*a.x,y:d+g*a.y}}function Ua(t,e,n,i={}){var h,x,v,y,f,m;let a=(h=i.inset)!=null?h:{},s=(x=i.padding)!=null?x:{x:0,y:0},r=((v=a.left)!=null?v:0)+s.x,o=((y=a.right)!=null?y:0)+s.x,l=((f=a.top)!=null?f:0)+s.y,d=((m=a.bottom)!=null?m:0)+s.y,p=Math.max(0,t-r-o),c=Math.max(0,e-l-d),g=At(n,{x:.5,y:.5}),u=Math.min(Math.max(g.x,0),1),b=Math.min(Math.max(g.y,0),1);return{x:r+p*u,y:l+c*b}}if(typeof window!="undefined"){let t=window.innerWidth,e=window.innerHeight,n=()=>{let i=window.innerWidth,a=window.innerHeight;(i!==t||a!==e)&&(t=i,e=a,dn(i,a))};window.addEventListener("resize",n),window.addEventListener("orientationchange",()=>{setTimeout(n,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",n),window.mraid.addEventListener("sizeChange",n)),dn(window.innerWidth,window.innerHeight),window.updateDebugConfig=qr,window.getDebugConfig=Wr,window.copyConfig=ao,window.applyConfig=Je,window.applyConfigForRatio=so,window.positionAtBottom=qa,window.positionAtTop=Xr,window.positionAtCenter=Jr,window.positionAtLeft=Zr,window.positionAtRight=Qr,window.positionAtBottomLeft=eo,window.positionAtBottomRight=to,window.positionAtTopLeft=no,window.positionAtTopRight=io,window.applyPositionContract=Kr,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 Ct(t,e,n=0){return t*e+n}function Tt(t,e,n=0){return t*(1-e)+n}function _t(t,e,n=0){return t*e+n}function Lt(t,e,n=0){return t*(1-e)+n}function U(t,e=0){return t/2+e}function Yr(t,e){return t*e}function Kr(t,e,n,i){var r,o,l,d,p,c,g,u,b,h,x,v,y,f,m,E,S,A,M,R;let a=0,s=0;switch(i.type){case"top":a=U(e,(o=(r=i.offset)==null?void 0:r.x)!=null?o:0),s=Ct(n,i.percent,(d=(l=i.offset)==null?void 0:l.y)!=null?d:0);break;case"bottom":a=U(e,(c=(p=i.offset)==null?void 0:p.x)!=null?c:0),s=Tt(n,i.percent,(u=(g=i.offset)==null?void 0:g.y)!=null?u:0);break;case"left":a=_t(e,i.percent,(h=(b=i.offset)==null?void 0:b.x)!=null?h:0),s=U(n,(v=(x=i.offset)==null?void 0:x.y)!=null?v:0);break;case"right":a=Lt(e,i.percent,(f=(y=i.offset)==null?void 0:y.x)!=null?f:0),s=U(n,(E=(m=i.offset)==null?void 0:m.y)!=null?E:0);break;case"center":a=U(e,(A=(S=i.offset)==null?void 0:S.x)!=null?A:0),s=U(n,(R=(M=i.offset)==null?void 0:M.y)!=null?R:0);break}t.position?t.position.set(a,s):(t.x=a,t.y=s),i.scale!==void 0&&i.scale!==1&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(i.scale,i.scale):(t.scale.x=i.scale,t.scale.y=i.scale))}function qa(t,e,n,i=.2,a=1,s=!0,r=!1){let o=Yr(n,i),l=Tt(n,i/2);ce(t,U(e),l);let d=s?a*le.scaleFactor:a;de(t,d),r&&!pn.find(p=>p.element===t)&&Gr(t,qa,e,n,i,a,s)}function Xr(t,e,n,i=.1,a=1){ce(t,U(e),Ct(n,i)),de(t,a)}function Jr(t,e,n,i=0,a=0,s=1){ce(t,U(e,i),U(n,a)),de(t,s)}function Zr(t,e,n,i=.1,a=1){ce(t,_t(e,i),U(n)),de(t,a)}function Qr(t,e,n,i=.1,a=1){ce(t,Lt(e,i),U(n)),de(t,a)}function eo(t,e,n,i=.05,a=.05,s=1){ce(t,_t(e,a),Tt(n,i)),de(t,s)}function to(t,e,n,i=.05,a=.05,s=1){ce(t,Lt(e,a),Tt(n,i)),de(t,s)}function no(t,e,n,i=.05,a=.05,s=1){ce(t,_t(e,a),Ct(n,i)),de(t,s)}function io(t,e,n,i=.05,a=.05,s=1){ce(t,Lt(e,a),Ct(n,i)),de(t,s)}function ce(t,e,n){t&&t.position?typeof t.position.set=="function"?t.position.set(e,n):(t.position.x=e,t.position.y=n):t&&(t.x=e,t.y=n)}function de(t,e){e!==1&&t&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(e,e):t.scale.x!==void 0&&t.scale.y!==void 0&&(t.scale.x=e,t.scale.y=e))}var Ce={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 ao(t){return t&&Ce[t]?JSON.parse(JSON.stringify(Ce[t])):JSON.parse(JSON.stringify(Ze))}function Je(t){Object.keys(t).forEach(e=>{let n=e;Ze[n]&&t[n]&&Object.assign(Ze[n],t[n])}),console.log("Config applied:",t)}function so(t,e){let n=t/e;n>1.6?(Je(Ce.wide),console.log("Applied WIDE config for ratio:",n)):n<.7?(Je(Ce.tall),console.log("Applied TALL config for ratio:",n)):n>.8&&n<1.2?(Je(Ce.square),console.log("Applied SQUARE config for ratio:",n)):(Je(Ce.default),console.log("Applied DEFAULT config for ratio:",n))}if(typeof window!="undefined"){let t=window;t.configPresets=Ce,t.resolveAnchorVec2=t.resolveAnchorVec2||At,t.resolveScreenAnchorPoint=t.resolveScreenAnchorPoint||Ga,t.resolveScreenRatioPoint=t.resolveScreenRatioPoint||Ua}hn();function k(t,e){let n=(a,s)=>s===0?a:n(s,a%s),i=n(t,e);return`${t/i}:${e/i}`}var Bc=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:k(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:k(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:k(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:k(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:k(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:k(360,780)}],Gc=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:k(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:k(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:k(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:k(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:k(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:k(412,915)}],Uc=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:k(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:k(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:k(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:k(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:k(800,1280)}],Ka=[{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:k(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:k(768,1024),mraidScale:.7}];var qc=[...Ka];var ho=Ka[0];fe();var xo=ae(require("jszip"),1);function bo(t){return new Promise((e,n)=>{let i=new FileReader;i.onerror=()=>n(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(t)})}function yo(t){var a;let[e,n]=t.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:n!=null?n:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}async function vo(t){return await new Promise(e=>{let n=new Image;n.onload=()=>e({width:n.naturalWidth||n.width,height:n.naturalHeight||n.height}),n.onerror=()=>e(null),n.src=t})}async function fn(t){var e,n;try{console.log("[ImageUtils] Fetching image data from URL:",t);let i=await fetch(t);if(!i.ok)return console.warn("[ImageUtils] Fetch failed with status:",i.status,t),null;let a=await i.blob();console.log("[ImageUtils] Blob received, size:",a.size,"type:",a.type);let s=await bo(a),r=await vo(s),o=yo(s);return console.log("[ImageUtils] Success resolution:",r==null?void 0:r.width,"x",r==null?void 0:r.height,"mime:",o.mimeType),{base64:o.base64,mimeType:o.mimeType,dataUrl:s,width:(e=r==null?void 0:r.width)!=null?e:0,height:(n=r==null?void 0:r.height)!=null?n:0}}catch(i){return console.error("[ImageUtils] Error fetching image data:",i),null}}async function Mt(t,e=30){try{console.log("[ImageUtils] Removing background color...");let n=await new Promise((c,g)=>{let u=new Image;u.onload=()=>c(u),u.onerror=()=>g(new Error("Failed to load image")),u.src=t}),i=document.createElement("canvas");i.width=n.width,i.height=n.height;let a=i.getContext("2d");if(!a)return console.error("[ImageUtils] Failed to get canvas context"),t;a.drawImage(n,0,0);let s=a.getImageData(0,0,i.width,i.height),r=s.data,l=[{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(c=>({r:r[c.offset],g:r[c.offset+1],b:r[c.offset+2]})),d=0;for(let c=0;c<r.length;c+=4){let g=r[c],u=r[c+1],b=r[c+2],h=!1;for(let x of l)if(Math.sqrt(Math.pow(g-x.r,2)+Math.pow(u-x.g,2)+Math.pow(b-x.b,2))<e){h=!0;break}h&&(r[c+3]=0,d++)}return console.log(`[ImageUtils] Removed background from ${d} pixels (4-corner sampling, tolerance: ${e})`),a.putImageData(s,0,0),i.toDataURL("image/png")}catch(n){return console.error("[ImageUtils] Error removing background:",n),t}}var Xa=require("@google/genai");async function mn(t,e,n=[],i={}){var a,s,r,o,l,d,p;try{if(!(t!=null&&t.trim()))throw new Error("Gemini API key is required");if(!(e!=null&&e.trim()))throw new Error("Prompt is required");for(let v=0;v<n.length;v++){let y=n[v];if(!y.base64||!y.mimeType)throw new Error(`Image ${v+1} is missing required data`);if(y.base64.length<1e3&&console.warn(`Image ${v+1} data appears very small, may be corrupted`),!y.mimeType.startsWith("image/"))throw new Error(`Image ${v+1} has invalid MIME type: ${y.mimeType}`)}let c=new Xa.GoogleGenAI({apiKey:t}),g="gemini-2.5-flash",u=[e];n.length>0&&n.forEach((v,y)=>{u.push({inlineData:{data:v.base64,mimeType:v.mimeType}}),console.log(`[Gemini] Added image ${y+1}: ${v.mimeType}, size: ${Math.round(v.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${n.length} images and prompt length: ${e.length}`);let b=await c.models.generateContent({model:g,contents:u}),h="",x=(r=(s=(a=b.candidates)==null?void 0:a[0])==null?void 0:s.content)==null?void 0:r.parts;if(x)for(let v of x)v.text&&(h+=v.text);if(!h.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${h.length}`),h}catch(c){throw console.error("[Gemini] API error:",c),(o=c.message)!=null&&o.includes("Unable to process input image")?new Error("Unable to process the uploaded image. Please ensure it's a valid PNG, JPG, or JPEG file under 10MB and not corrupted."):(l=c.message)!=null&&l.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(d=c.message)!=null&&d.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(p=c.message)!=null&&p.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):c}}var Ja=require("@google/genai");async function Pt(t,e,n=[],i={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new Ja.GoogleGenAI({apiKey:t}),s=[{text:e}];n.length>0&&n.forEach((o,l)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${l}`),s.push({inlineData:{mimeType:o.mimeType,data:o.base64}})}),console.info("[GEMINI-REAL-SDK] Calling generateContent with model: gemini-2.5-flash-image");let r=await a.models.generateContent({model:"gemini-2.5-flash-image",contents:s});if(console.info("[GEMINI-REAL-SDK] Received response from model"),!r.candidates||!r.candidates[0]||!r.candidates[0].content||!r.candidates[0].content.parts)throw new Error("Gemini 2.5 Flash Image returned invalid response structure.");for(let o of r.candidates[0].content.parts)if(o.text)console.log(o.text);else if(o.inlineData){let l=o.inlineData.data,d=o.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${d};base64,${l}`}throw new Error("Gemini 2.5 Flash Image returned no image data.")}catch(a){throw console.error("[GEMINI-REAL-SDK] Error in generateImageWithGemini25Flash:",JSON.stringify(a,Object.getOwnPropertyNames(a),2)),a}}var wo=require("pixi.js");Xe();fe();var Qa=require("pixi.js");var Eo=require("pixi.js");fe();function Mo(t){return new Promise((e,n)=>{let i=new FileReader;i.onerror=()=>n(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(t)})}function Po(t){var a;let[e,n]=t.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:n!=null?n:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}function ko(t){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: