handler-playable-sdk 0.5.548 → 0.5.550

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(_0x59ccba,_0x45ed0c){var a0_0x3ffa40={_0x37128d:0x21a,_0x453a88:0x226,_0x34bc97:0x20a,_0x2f0c7e:'6WU]',_0x2249e7:0x214,_0x352751:0x20f,_0x26c762:0x206,_0xd49761:0x43,_0x2504ef:0x50,_0x3ba55d:0x53f,_0x406082:0x532,_0x11fe86:'bQS8',_0x389a2f:0x539,_0x438192:0x542,_0x137bdc:0x4b,_0xecd44:0x41,_0x14d6bd:0x51c,_0x4c93b2:0x51e,_0x40575e:'&(Tq',_0x153c42:0x522,_0x506aa6:0x51b,_0x4f17e1:0x227,_0x405f4f:0x231,_0x278c61:0x22d,_0x205f91:'yfMe',_0x2d6ec0:0x52d,_0x383f47:0x524,_0x6d18f:0x518,_0x3d03fd:0x527,_0x3b6c27:0x227,_0xff293d:0x234,_0xa84c3a:'b(v7',_0x3c8a42:0x51f,_0xed482c:0x51a,_0x2460ea:'jTT9',_0x38e1cb:0x50a},a0_0x13135e={_0xf8bec5:0x1b3},a0_0xbf6661={_0xa161a:0x3ba},a0_0x202503={_0x1b4bd7:0x388},_0x3f3773=_0x59ccba();function _0x234fde(_0x3a425a,_0x4b74bc,_0x277b2c,_0x7bffbe,_0x59be7f){return a0_0x3d17(_0x3a425a- -a0_0x202503._0x1b4bd7,_0x59be7f);}function _0x2b6625(_0x3717ff,_0x166da7,_0x36d74d,_0x5793cb,_0x4e04d1){return a0_0x3d17(_0x166da7-a0_0xbf6661._0xa161a,_0x36d74d);}function _0x23c057(_0x22808a,_0x4adbe8,_0x371368,_0x4eb899,_0x47c234){return a0_0x3d17(_0x371368- -a0_0x13135e._0xf8bec5,_0x4adbe8);}while(!![]){try{var _0x2c47d9=-parseInt(_0x234fde(-a0_0x3ffa40._0x37128d,-0x216,-a0_0x3ffa40._0x453a88,-a0_0x3ffa40._0x34bc97,a0_0x3ffa40._0x2f0c7e))/(0x911+-0x1*-0x1785+-0x2095)+-parseInt(_0x234fde(-a0_0x3ffa40._0x2249e7,-a0_0x3ffa40._0x352751,-a0_0x3ffa40._0x26c762,-a0_0x3ffa40._0x37128d,'E9hJ'))/(0x355+-0x2587+0x2234)+parseInt(_0x23c057(-0x47,'z00x',-a0_0x3ffa40._0xd49761,-0x3a,-a0_0x3ffa40._0x2504ef))/(0x32a+-0xd*0x2c+0x2f*-0x5)+-parseInt(_0x2b6625(a0_0x3ffa40._0x3ba55d,a0_0x3ffa40._0x406082,a0_0x3ffa40._0x11fe86,a0_0x3ffa40._0x389a2f,a0_0x3ffa40._0x438192))/(0x185+-0x22*0x5e+-0x3a9*-0x3)*(-parseInt(_0x23c057(-a0_0x3ffa40._0x137bdc,'D!Cd',-0x4e,-a0_0x3ffa40._0xecd44,-0x5b))/(-0x1*-0xa53+0x43a*-0x2+-0x1da))+-parseInt(_0x2b6625(a0_0x3ffa40._0x14d6bd,a0_0x3ffa40._0x4c93b2,a0_0x3ffa40._0x40575e,a0_0x3ffa40._0x153c42,a0_0x3ffa40._0x506aa6))/(0xa*-0x265+-0x8b*0x1c+0x2*0x1396)+parseInt(_0x234fde(-a0_0x3ffa40._0x453a88,-a0_0x3ffa40._0x4f17e1,-a0_0x3ffa40._0x405f4f,-a0_0x3ffa40._0x278c61,a0_0x3ffa40._0x205f91))/(0x11db+-0x13*0x11+-0x1091*0x1)*(parseInt(_0x2b6625(a0_0x3ffa40._0x2d6ec0,a0_0x3ffa40._0x383f47,'jTT9',a0_0x3ffa40._0x6d18f,a0_0x3ffa40._0x3d03fd))/(-0x2581+0x33*0x4+0x24bd))+-parseInt(_0x234fde(-a0_0x3ffa40._0x3b6c27,-a0_0x3ffa40._0x4f17e1,-a0_0x3ffa40._0x37128d,-a0_0x3ffa40._0xff293d,a0_0x3ffa40._0xa84c3a))/(0x459+-0xc8e*-0x3+-0x29fa)*(parseInt(_0x2b6625(a0_0x3ffa40._0x3c8a42,a0_0x3ffa40._0xed482c,a0_0x3ffa40._0x2460ea,a0_0x3ffa40._0x38e1cb,0x516))/(0x2*-0xd86+0x25ac+0x54b*-0x2));if(_0x2c47d9===_0x45ed0c)break;else _0x3f3773['push'](_0x3f3773['shift']());}catch(_0x108a5d){_0x3f3773['push'](_0x3f3773['shift']());}}}(a0_0x31cc,-0x100eec+0xb749*0x1c+0x8ac86*0x1));var a0_0x11a667=(function(){var _0x6f0de=!![];return function(_0x5995cb,_0x2e3f5b){var a0_0x119fec={_0x42b1ad:0x367,_0x4e2ef3:0x384,_0x74c6ee:'yD@!',_0x3edbff:0x379},_0x2e7132=_0x6f0de?function(){function _0x30c78e(_0xe3ae03,_0x3f7421,_0x214be7,_0x624ce6,_0x427420){return a0_0x3d17(_0xe3ae03-0x217,_0x624ce6);}if(_0x2e3f5b){var _0x3bf5cb=_0x2e3f5b[_0x30c78e(0x376,a0_0x119fec._0x42b1ad,a0_0x119fec._0x4e2ef3,a0_0x119fec._0x74c6ee,a0_0x119fec._0x3edbff)](_0x5995cb,arguments);return _0x2e3f5b=null,_0x3bf5cb;}}:function(){};return _0x6f0de=![],_0x2e7132;};}()),a0_0xa7841a=a0_0x11a667(this,function(){var a0_0x42b577={_0x59eebd:0x399,_0x1d42bf:0x38c,_0x220c4a:'4CG[',_0x331e73:0x1c6,_0x413b02:0x1cf,_0x22828f:0x1ce,_0x327c6c:'&irm',_0x29a6c4:0x387,_0x27b1eb:0x37e,_0x28d4d4:'r7PI',_0xb42d61:0x380,_0x43e797:0x38b,_0x503600:0xe4,_0x4f83c3:0xd5,_0x31c579:0xdc,_0xf76f12:'O[eA',_0x4a6987:0x100,_0x10a425:0xf4,_0x1f426d:0xe8,_0x3e8197:'efAz',_0x35151d:0xe5,_0x54e2a6:0xeb,_0x32625b:'ayK!',_0x5cbc0c:0x1d8,_0x32f7ae:0x1d6,_0x41892f:0x1e6,_0x4d67f9:'OOp1',_0x50d0e5:0x1e8,_0x5eecb7:0x1ed,_0x2dc4a6:0x1ef,_0x275596:0x1e5,_0x2cd037:'mvw4',_0x28dc71:0x1c8,_0x4f9b3b:0x1cc,_0x4fe17e:'^w$i',_0x5b4b06:0x1d9,_0x3925ad:0x1d5,_0x27c3a4:0x1ce,_0x1e2461:0x1d7,_0x31f588:'ayK!',_0x57202e:0x397,_0x572b5f:'9Rg$',_0x38d241:0x383},a0_0x144070={_0x79451:0x342},a0_0x34d60e={_0x36253c:0x21d};function _0x37e189(_0x3bcb03,_0x4ffcc9,_0x7c3a71,_0x188ef6,_0x5bc5d6){return a0_0x3d17(_0x188ef6-a0_0x34d60e._0x36253c,_0x7c3a71);}function _0x1e2b40(_0x28f8a0,_0x28b151,_0x5cf3d4,_0x544f14,_0x6903be){return a0_0x3d17(_0x544f14- -a0_0x144070._0x79451,_0x6903be);}function _0x2aa88b(_0x5ca013,_0x3aee0a,_0x237fec,_0x3cf50b,_0x42d405){return a0_0x3d17(_0x3aee0a- -0x24e,_0x3cf50b);}return a0_0xa7841a[_0x37e189(a0_0x42b577._0x59eebd,a0_0x42b577._0x1d42bf,a0_0x42b577._0x220c4a,0x38a,0x387)+_0x1e2b40(-a0_0x42b577._0x331e73,-a0_0x42b577._0x413b02,-a0_0x42b577._0x22828f,-0x1d0,a0_0x42b577._0x327c6c)]()[_0x37e189(a0_0x42b577._0x29a6c4,a0_0x42b577._0x27b1eb,a0_0x42b577._0x28d4d4,a0_0x42b577._0xb42d61,a0_0x42b577._0x43e797)+'h'](_0x2aa88b(-a0_0x42b577._0x503600,-a0_0x42b577._0x4f83c3,-a0_0x42b577._0x31c579,a0_0x42b577._0xf76f12,-0xd5)+')+)+)'+'+$')[_0x2aa88b(-a0_0x42b577._0x4a6987,-a0_0x42b577._0x10a425,-a0_0x42b577._0x1f426d,a0_0x42b577._0x3e8197,-a0_0x42b577._0x35151d)+_0x2aa88b(-a0_0x42b577._0x54e2a6,-0xe5,-0xe3,a0_0x42b577._0x32625b,-0xdf)]()[_0x1e2b40(-a0_0x42b577._0x5cbc0c,-a0_0x42b577._0x32f7ae,-0x1e1,-a0_0x42b577._0x41892f,a0_0x42b577._0x4d67f9)+_0x1e2b40(-a0_0x42b577._0x50d0e5,-a0_0x42b577._0x5eecb7,-a0_0x42b577._0x2dc4a6,-a0_0x42b577._0x275596,a0_0x42b577._0x2cd037)+'r'](a0_0xa7841a)[_0x1e2b40(-a0_0x42b577._0x28dc71,-0x1d5,-a0_0x42b577._0x32f7ae,-a0_0x42b577._0x4f9b3b,a0_0x42b577._0x4fe17e)+'h'](_0x1e2b40(-a0_0x42b577._0x5b4b06,-a0_0x42b577._0x3925ad,-a0_0x42b577._0x27c3a4,-a0_0x42b577._0x1e2461,a0_0x42b577._0x31f588)+_0x37e189(a0_0x42b577._0x57202e,0x37e,a0_0x42b577._0x572b5f,a0_0x42b577._0x1d42bf,a0_0x42b577._0x38d241)+'+$');});a0_0xa7841a();import{A as a0_0x4fcb30,B as a0_0x44fc2e,C as a0_0x8cfe70,D as a0_0x27650f,b as a0_0x1c8850,c as a0_0x3255e1,d as a0_0x1bc5c8,e as a0_0x1605fe,f as a0_0x243d35,g as a0_0x3b0052,h as a0_0x68ec07,i as a0_0x2e4861,j as a0_0x9dd528,k as a0_0x166421,l as a0_0x4f3972,m as a0_0x496c20,n as a0_0x350de7,o as a0_0x1356c0,p as a0_0x265a17,q as a0_0xfaf558,r as a0_0x20ae53,s as a0_0x4bdb7c,t as a0_0x558039,u as a0_0x3b4a29,v as a0_0x4481bd,w as a0_0x42b63e,x as a0_0x2c403d,y as a0_0x3a414b,z as a0_0x46a6d0}from'../chunk-2M4VIBDT.js';import{a as a0_0x59a732,b as a0_0x2b4e39,c as a0_0x4115d5,d as a0_0x2d608a,e as a0_0x571d40}from'../chunk-I5OOVR5U.js';import'../chunk-PW2FGMCO.js';import'../chunk-HVKF2KYL.js';import'../chunk-E6WJCS24.js';import'../chunk-JXBG6UFL.js';export{a0_0x59a732 as AssetCache,a0_0x4115d5 as AssetLoader,a0_0x3b4a29 as AssetSystem,a0_0x2d608a as AssetTextures,a0_0x4bdb7c as Assets,a0_0x1356c0 as BaseSystem,a0_0x350de7 as GameEngine,a0_0x1605fe as GameObject,a0_0x243d35 as GameObjectManager,a0_0x496c20 as ObjectFactory,a0_0x1bc5c8 as Renderer,a0_0x265a17 as RuntimeObjectRegistry,a0_0x3255e1 as Transform,a0_0x44fc2e as applyScreenAnchor,a0_0xfaf558 as basePixi,a0_0x42b63e as clearResponsiveElements,a0_0x1c8850 as createPixiBase,a0_0x9dd528 as getRegisteredFontIds,a0_0x4481bd as globalResponsiveMultipliers,a0_0x571d40 as initAssetTextures,a0_0x558039 as initAssets,a0_0x8cfe70 as layout,a0_0x4f3972 as playLottieOverlay,a0_0x2e4861 as registerFont,a0_0x2b4e39 as registerType,a0_0x3a414b as resolveAnchorVec2,a0_0x3b0052 as resolveFont,a0_0x68ec07 as resolveFontWeight,a0_0x46a6d0 as resolveScreenAnchorPoint,a0_0x4fcb30 as resolveScreenRatioPoint,a0_0x27650f as runInitSequence,a0_0x166421 as setLottieInstance,a0_0x20ae53 as spawnSceneFromConfig,a0_0x2c403d as updateScreenState};function a0_0x3d17(_0x5c4fb6,_0x364aa3){_0x5c4fb6=_0x5c4fb6-(-0x1a6*-0x2+-0x15db+0x3*0x6a3);var _0x457bd1=a0_0x31cc();var _0x2e2608=_0x457bd1[_0x5c4fb6];if(a0_0x3d17['SYlgrS']===undefined){var _0x1844c7=function(_0x1e96dd){var _0x30a910='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x117586='',_0x541008='',_0x50effb=_0x117586+_0x1844c7;for(var _0xbbf481=-0x1*0x143c+0x5*-0x74f+0x55*0xab,_0x34ff42,_0x5da89e,_0x16758a=-0x175f*-0x1+0x44*-0x40+-0x7*0xe9;_0x5da89e=_0x1e96dd['charAt'](_0x16758a++);~_0x5da89e&&(_0x34ff42=_0xbbf481%(0xd*-0x2f4+-0x221*0x8+-0x1bb8*-0x2)?_0x34ff42*(0x6af+0x6e7+0x472*-0x3)+_0x5da89e:_0x5da89e,_0xbbf481++%(-0x1*0x26b3+0x8*0x300+0xeb7*0x1))?_0x117586+=_0x50effb['charCodeAt'](_0x16758a+(0x60b+0x149b+0x83*-0x34))-(-0x95e+-0xb25+0x1*0x148d)!==0x4a4+0x268*-0xd+0x1aa4?String['fromCharCode'](0x1df2+-0x7c9+-0x152a&_0x34ff42>>(-(-0xd*0x1e9+-0x4b1*-0x5+0x162)*_0xbbf481&-0x798+-0x748+0xee6)):_0xbbf481:-0x104f+0x7*0x16+0xfb5){_0x5da89e=_0x30a910['indexOf'](_0x5da89e);}for(var _0x4a1e77=0x1*0x13df+-0x445*0x7+0xa04*0x1,_0x10b9f7=_0x117586['length'];_0x4a1e77<_0x10b9f7;_0x4a1e77++){_0x541008+='%'+('00'+_0x117586['charCodeAt'](_0x4a1e77)['toString'](-0x1db*-0xb+0x1a4e+-0x2ea7))['slice'](-(0x22b+-0x1051+-0x4b8*-0x3));}return decodeURIComponent(_0x541008);};var _0x8d049b=function(_0x948e7f,_0xead450){var _0x5daa7b=[],_0x50bb91=-0x127+0x1efd*-0x1+-0xbb*-0x2c,_0x33f39e,_0x2e320d='';_0x948e7f=_0x1844c7(_0x948e7f);var _0x412e11;for(_0x412e11=-0x7a6+0x3bf*-0x7+0x1d*0x12b;_0x412e11<0x39*0x46+-0x1*0x2d1+-0xbc5*0x1;_0x412e11++){_0x5daa7b[_0x412e11]=_0x412e11;}for(_0x412e11=-0x1*0x229d+-0x26b8+0x4955*0x1;_0x412e11<0x7*-0x194+-0x19be+-0x12e5*-0x2;_0x412e11++){_0x50bb91=(_0x50bb91+_0x5daa7b[_0x412e11]+_0xead450['charCodeAt'](_0x412e11%_0xead450['length']))%(-0x250b*0x1+-0x234b+0x413*0x12),_0x33f39e=_0x5daa7b[_0x412e11],_0x5daa7b[_0x412e11]=_0x5daa7b[_0x50bb91],_0x5daa7b[_0x50bb91]=_0x33f39e;}_0x412e11=0x1*0x8f+-0xaab+0xa1c,_0x50bb91=-0x16*0x139+-0x21f4+-0x2*-0x1e6d;for(var _0x544f05=0x24b8+-0x86b+0x69*-0x45;_0x544f05<_0x948e7f['length'];_0x544f05++){_0x412e11=(_0x412e11+(-0x74b+-0x19a9+0x3b*0x8f))%(-0xe16+-0x11e1+-0x3*-0xafd),_0x50bb91=(_0x50bb91+_0x5daa7b[_0x412e11])%(0x3d*-0x15+-0x1*-0x599+-0x1a*-0x4),_0x33f39e=_0x5daa7b[_0x412e11],_0x5daa7b[_0x412e11]=_0x5daa7b[_0x50bb91],_0x5daa7b[_0x50bb91]=_0x33f39e,_0x2e320d+=String['fromCharCode'](_0x948e7f['charCodeAt'](_0x544f05)^_0x5daa7b[(_0x5daa7b[_0x412e11]+_0x5daa7b[_0x50bb91])%(0x1b*-0x4+-0x17f2+0x195e)]);}return _0x2e320d;};a0_0x3d17['FLcBoJ']=_0x8d049b,a0_0x3d17['zJvfae']={},a0_0x3d17['SYlgrS']=!![];}var _0x518a76=_0x457bd1[0x1805+-0x1*-0x44+-0x1849],_0x1416e2=_0x5c4fb6+_0x518a76,_0x5294cb=a0_0x3d17['zJvfae'][_0x1416e2];if(!_0x5294cb){if(a0_0x3d17['LrwgHO']===undefined){var _0x1174a9=function(_0x556e30){this['udjeMR']=_0x556e30,this['uqgmgz']=[-0xb70*0x3+-0x1*-0x16eb+0xb66,0xddf*-0x1+0x11*0x3+0xdac,0x12a+-0x26b*0x1+0x141],this['xXPmBU']=function(){return'newState';},this['insgjr']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['tzkTEG']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x1174a9['prototype']['GcMeYB']=function(){var _0xa0ac05=new RegExp(this['insgjr']+this['tzkTEG']),_0x4c3f7c=_0xa0ac05['test'](this['xXPmBU']['toString']())?--this['uqgmgz'][-0x1*0xc28+-0x1442+-0x2b*-0xc1]:--this['uqgmgz'][-0x1f*-0xb5+0x179f+-0x43*0xae];return this['ePrWZx'](_0x4c3f7c);},_0x1174a9['prototype']['ePrWZx']=function(_0x50a494){if(!Boolean(~_0x50a494))return _0x50a494;return this['ECQgvG'](this['udjeMR']);},_0x1174a9['prototype']['ECQgvG']=function(_0x548f10){for(var _0x5465a3=-0x1*-0x203+-0x1*0x1c27+0x689*0x4,_0x59ccba=this['uqgmgz']['length'];_0x5465a3<_0x59ccba;_0x5465a3++){this['uqgmgz']['push'](Math['round'](Math['random']())),_0x59ccba=this['uqgmgz']['length'];}return _0x548f10(this['uqgmgz'][-0x111f+0xa*-0x265+-0x2911*-0x1]);},new _0x1174a9(a0_0x3d17)['GcMeYB'](),a0_0x3d17['LrwgHO']=!![];}_0x2e2608=a0_0x3d17['FLcBoJ'](_0x2e2608,_0x364aa3),a0_0x3d17['zJvfae'][_0x1416e2]=_0x2e2608;}else _0x2e2608=_0x5294cb;return _0x2e2608;}function a0_0x31cc(){var _0x37cbc2=['kr0xA0qhW50nx8okW63cVwK','W6jsW7VcL2O','WRVdUvXXWQi','ex/cS8o6WQWiWPPVW4O','W5NdR1pcJvC','aSkvWQpdSSo5zqldRJVcRG','WRZcUmkeWQXCWPZdPGZdNW','hwOnW7PajxZcNJFdHa4','ow01WQZdUa','WOdcJCo8kbxcOSodf8oVWQBcJmoVrG','dCkMsKjZW5FdUq','CmoFBIBdISoktq','aSk8pmk/WO7cKbVcSmoSgW','W6/cKqzQW6ftruO+WPlcHG','W43cU8kl','bSktWQFdTmoLvJldHI7cGa','WOZdVCoeW5JdOW','W5aLv8kxWRlcVaGlfJHaW5C','W4S+W6HJWOy','lXizBKiaWRe8r8ofW4dcLW','pHrPlmoP','W6NcNqjRW6alc1qaWQZcO8k1ya','W50mwCoNW67dS8oGW75wWQriWPldNW','xSoIBG','WRnVA8k7wSk6zMJcKt/dGtpcTa','WRxcSmkrW6hdH8oUrSo1WO9KWPzkWQO','re8uuatdH8ktzsCK','wrxcOuRdLW','WRSBWOtcJvmEW6ldGgtdJSovW7lcOa','W64KoYhcOb9UowCLW7m4WP4','CSoMbv9e','jehcPComuq'];a0_0x31cc=function(){return _0x37cbc2;};return a0_0x31cc();}
1
+ (function(_0x51d5a3,_0x5c170b){var a0_0x5381f8={_0x1816e3:0x14d,_0xa4a928:0x12b,_0x2819fb:0x12f,_0x228499:'&Q6l',_0x270123:0x126,_0x4c90e5:0x143,_0x3db323:0x122,_0x1ebf01:'c[k]',_0x30aa5f:0x14f,_0x1c7656:0x149,_0xfc3c5c:'S&*2',_0xac9bd:0x146,_0x380115:0x121,_0x5ddcb7:'Yce0',_0xa8c431:0x108,_0x3b8b0f:0x11c,_0x52cf9b:'PIwN',_0x4f3907:0x125,_0x23fc7e:0x123,_0x15fe0b:0x137,_0x176dd5:0x14a,_0x59bebe:0x13a,_0xf2cca0:0x13f,_0xa63cb9:0x12a,_0x586aec:0x11f,_0x31d9c6:'S63M',_0x1ea95a:0x121,_0x3b0938:0x115,_0x2b04c9:0x139,_0x52be91:0x138,_0x2b1751:'o*P8',_0x369a28:0x144,_0x5a81e6:'IL!A',_0x1d7a6c:0x13e,_0x347c50:0x138,_0x55b382:0x105,_0x5b9cd7:'bW5g',_0x2737b1:0x110,_0x590f04:0x114},a0_0x19a096={_0x4e2493:0x1a},a0_0x23801c={_0x298ed8:0x8};function _0x41b826(_0xffffbc,_0x7650cc,_0xe10b39,_0x1a4eed,_0x19bad0){return a0_0x51fc(_0x19bad0- -a0_0x23801c._0x298ed8,_0xffffbc);}function _0x673e93(_0x487a5c,_0x23f09f,_0x4a0467,_0xe5c562,_0x2519d2){return a0_0x51fc(_0xe5c562- -a0_0x19a096._0x4e2493,_0x23f09f);}function _0x15e388(_0x3de860,_0xbb998e,_0x5035ac,_0x41febc,_0x4033b2){return a0_0x51fc(_0x41febc-0x5,_0x5035ac);}var _0x515f25=_0x51d5a3();while(!![]){try{var _0x5b3370=parseInt(_0x15e388(0x15c,0x150,'c$GJ',a0_0x5381f8._0x1816e3,a0_0x5381f8._0x1816e3))/(-0x139*0x1f+-0x62f*-0x2+0x198a)+parseInt(_0x41b826('JX&2',0x12c,a0_0x5381f8._0xa4a928,0x13a,a0_0x5381f8._0x2819fb))/(0xcd2+0x7eb+-0x14bb)*(parseInt(_0x41b826(a0_0x5381f8._0x228499,0x13f,a0_0x5381f8._0x270123,a0_0x5381f8._0x4c90e5,0x133))/(0x20be+0x2*0xde5+-0x3c85*0x1))+parseInt(_0x673e93(a0_0x5381f8._0x3db323,a0_0x5381f8._0x1ebf01,0x121,a0_0x5381f8._0x2819fb,0x122))/(0x1760+0x1*0x244e+-0xe*0x443)*(parseInt(_0x15e388(a0_0x5381f8._0x30aa5f,a0_0x5381f8._0x1c7656,a0_0x5381f8._0xfc3c5c,a0_0x5381f8._0xac9bd,0x147))/(-0x171e+-0x1*0x55e+0x1c81*0x1))+parseInt(_0x673e93(a0_0x5381f8._0x380115,a0_0x5381f8._0x5ddcb7,0x115,0x113,a0_0x5381f8._0xa8c431))/(0x221+-0x224e*-0x1+0x2cd*-0xd)*(-parseInt(_0x673e93(a0_0x5381f8._0x3b8b0f,a0_0x5381f8._0x52cf9b,a0_0x5381f8._0x4f3907,a0_0x5381f8._0x23fc7e,0x11c))/(-0x8*-0x3c7+0x1*0x24e2+-0x4d*0xdf))+parseInt(_0x15e388(a0_0x5381f8._0x15fe0b,a0_0x5381f8._0x176dd5,'Q([[',a0_0x5381f8._0x59bebe,a0_0x5381f8._0xf2cca0))/(-0x5*-0x13e+0x1*-0x18c7+0x1299)*(-parseInt(_0x673e93(a0_0x5381f8._0x23fc7e,'3%UZ',a0_0x5381f8._0xa63cb9,0x12d,0x120))/(-0x1f6+-0x118b*-0x2+-0x2117))+parseInt(_0x673e93(a0_0x5381f8._0x586aec,a0_0x5381f8._0x31d9c6,a0_0x5381f8._0x1ea95a,a0_0x5381f8._0x3b0938,0x110))/(0x562*-0x2+0x1b01+0x8f*-0x1d)*(parseInt(_0x15e388(a0_0x5381f8._0x2b04c9,a0_0x5381f8._0x52be91,a0_0x5381f8._0x2b1751,a0_0x5381f8._0x369a28,a0_0x5381f8._0x59bebe))/(-0x2b*-0xcc+-0xeff*-0x1+-0xaf*0x48))+-parseInt(_0x15e388(0x14a,0x141,a0_0x5381f8._0x5a81e6,a0_0x5381f8._0x1d7a6c,a0_0x5381f8._0x347c50))/(0xd8c+-0x2*-0x8ab+0x1ed6*-0x1)*(parseInt(_0x673e93(a0_0x5381f8._0x55b382,a0_0x5381f8._0x5b9cd7,a0_0x5381f8._0x2737b1,a0_0x5381f8._0x590f04,a0_0x5381f8._0x3b0938))/(0x751+-0x139a+0xc56));if(_0x5b3370===_0x5c170b)break;else _0x515f25['push'](_0x515f25['shift']());}catch(_0x2460bf){_0x515f25['push'](_0x515f25['shift']());}}}(a0_0x7c14,0x76c9*-0x27+0xb*-0xd8cf+0x13*0x234e3));var a0_0x5c19ce=(function(){var a0_0x65ff06={_0x9c6201:0x4f9,_0x1f67f2:0x4f1},_0x569033=!![];return function(_0x285f15,_0x56b245){var a0_0x387373={_0x123fa8:0x3c4},_0x119930=_0x569033?function(){function _0x41afa2(_0x3a318c,_0x7f4561,_0x343162,_0x5cc3f6,_0x11ae8c){return a0_0x51fc(_0x5cc3f6-a0_0x387373._0x123fa8,_0x3a318c);}if(_0x56b245){var _0x6f459d=_0x56b245[_0x41afa2('W23Y',0x4f0,a0_0x65ff06._0x9c6201,0x4f0,a0_0x65ff06._0x1f67f2)](_0x285f15,arguments);return _0x56b245=null,_0x6f459d;}}:function(){};return _0x569033=![],_0x119930;};}()),a0_0x18f897=a0_0x5c19ce(this,function(){var a0_0x155033={_0x3e54b5:0x25e,_0x1c6a54:0x25f,_0x5ae249:0x267,_0x2e99c4:'aQmr',_0x400fad:0x250,_0x578449:0x52,_0x5c5b8b:0x3d,_0x1c106c:'RS@i',_0x4f4ea8:0x268,_0x36a1cc:0x25b,_0x2895a1:0x26f,_0x453a33:'(C3b',_0x25df79:0x25c,_0x4edb86:0x271,_0x389f70:0x277,_0x3e6c90:0x4c,_0xcdfed4:0x57,_0x4124e5:0x5c,_0x351009:0x53,_0x2c277f:'CdXC',_0x84004a:0x270,_0x4f5d38:'JX&2',_0x14ad80:0x3f,_0x11d598:0x42,_0x4ba8eb:'Ah*A',_0x46dd45:0x26a,_0x3f45e9:0x266,_0x145206:0x271,_0x3826f1:'BS3M',_0x44b447:0x260,_0x170654:0x262,_0x4ecc98:0x263},a0_0x224154={_0x4eac2c:0x153};function _0x475021(_0x3d9ca3,_0x3749f6,_0x4dd199,_0x322f03,_0x2b7371){return a0_0x51fc(_0x4dd199- -0xef,_0x2b7371);}function _0x3ad5bd(_0x4c627e,_0x2a31f0,_0x591e5a,_0x3f9a8a,_0x546408){return a0_0x51fc(_0x3f9a8a- -a0_0x224154._0x4eac2c,_0x546408);}function _0x42b5d2(_0x3b7e29,_0x1f99dd,_0x5f05a2,_0xa4de61,_0x2834ab){return a0_0x51fc(_0x3b7e29-0x12e,_0xa4de61);}return a0_0x18f897[_0x42b5d2(a0_0x155033._0x3e54b5,a0_0x155033._0x1c6a54,a0_0x155033._0x5ae249,a0_0x155033._0x2e99c4,a0_0x155033._0x400fad)+_0x475021(a0_0x155033._0x578449,a0_0x155033._0x5c5b8b,0x44,0x44,a0_0x155033._0x1c106c)]()[_0x42b5d2(a0_0x155033._0x4f4ea8,a0_0x155033._0x36a1cc,a0_0x155033._0x2895a1,a0_0x155033._0x453a33,a0_0x155033._0x1c6a54)+'h']('(((.+'+')+)+)'+'+$')[_0x42b5d2(0x26c,a0_0x155033._0x25df79,a0_0x155033._0x4edb86,'Ykd6',a0_0x155033._0x389f70)+_0x475021(a0_0x155033._0x3e6c90,a0_0x155033._0xcdfed4,a0_0x155033._0x4124e5,a0_0x155033._0x351009,a0_0x155033._0x2c277f)]()[_0x42b5d2(a0_0x155033._0x84004a,0x26f,a0_0x155033._0x84004a,a0_0x155033._0x4f5d38,0x27c)+_0x475021(a0_0x155033._0x14ad80,0x3d,a0_0x155033._0x11d598,0x3f,a0_0x155033._0x4ba8eb)+'r'](a0_0x18f897)['searc'+'h'](_0x42b5d2(a0_0x155033._0x46dd45,a0_0x155033._0x3f45e9,a0_0x155033._0x145206,a0_0x155033._0x3826f1,a0_0x155033._0x44b447)+_0x42b5d2(a0_0x155033._0x170654,0x267,a0_0x155033._0x4ecc98,'RS@i',0x269)+'+$');});a0_0x18f897();import{A as a0_0x24b443,B as a0_0x5c4475,C as a0_0x430f6e,D as a0_0x466084,b as a0_0x5dff41,c as a0_0x7a1a1a,d as a0_0x7a808e,e as a0_0x3ef1a2,f as a0_0x41091f,g as a0_0x29267d,h as a0_0xb83fd7,i as a0_0x3fbf63,j as a0_0x11ea5f,k as a0_0x4d1164,l as a0_0x35ec34,m as a0_0x54f039,n as a0_0x123bb3,o as a0_0x5c5dbc,p as a0_0x42856a,q as a0_0x5374ef,r as a0_0x1271b2,s as a0_0x6b6e24,t as a0_0x3f7c93,u as a0_0x105c27,v as a0_0x44fdd8,w as a0_0x4fc0de,x as a0_0x50d2bd,y as a0_0x343eb6,z as a0_0x907bd1}from'../chunk-CKDDVHY7.js';import{a as a0_0x47afab,b as a0_0x58a42e,c as a0_0x1d11da,d as a0_0x1d4834,e as a0_0xafbd96}from'../chunk-I5OOVR5U.js';function a0_0x7c14(){var _0x42f237=['FX1vf8oR','WOJcI8kwCZnaDuSvsmoMCSkIW4m','hrtdI1LlW6esW58TW5KFW7y','aNNdPMfWFCktWQ0','W6hdPfHyWRnefSkrCSkdfa','aCoZW57dRc/dPrmR','i8k5W7/dLHddGd5+W5nVWRmP','sCkudatdR8oFAIKoWRf8','jmk6W698iZ9f','W5pcGmo1','WPn2WQJcKNq','bmo3fq3cRmkiWQrwWODPtcK','WRWcW5BdTZ0Uz8oZdCowW6a3WRP6','FCk9WPJdISoeWRrej8oE','j8kvpSodW58','pCk7W4BdJN4','WOPUWPSIqCotWP7cVtS','WQHyiG','W6GDBmk6WOm','WOOAruJcK8oLv8otWQ3cHCo9odC','EKz/iSo0WQ/dNmki','lH1tdSosWQTI','hSkCE8ksWOFdUCkCvaVcGW','WOWBD8oNW7bKWPBcPq','rCkgWPGFWPC','WP/dGSk8W6eXjGJdRSooWR8geG','WQFcTSk6WQ4E','khVcHtmxo8opWQFdOq','cNtcTxddOW','W6VcIqldOmo+yH7cRZ4PWO9G','W73cGc8WWOxdVaRcRh9Ikua','W5ZcR8oQW7zJCCoTAa1F'];a0_0x7c14=function(){return _0x42f237;};return a0_0x7c14();}import'../chunk-PW2FGMCO.js';import'../chunk-HVKF2KYL.js';import'../chunk-E6WJCS24.js';import'../chunk-JXBG6UFL.js';function a0_0x51fc(_0x36901e,_0x3d25b7){_0x36901e=_0x36901e-(-0x2*-0xef9+-0x185c*-0x1+-0x3*0x11b6);var _0x4acd6f=a0_0x7c14();var _0x5a308f=_0x4acd6f[_0x36901e];if(a0_0x51fc['dkOVST']===undefined){var _0x4c3793=function(_0x5eda99){var _0x1b4266='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x13790e='',_0x292333='',_0x16dce1=_0x13790e+_0x4c3793;for(var _0x570fd9=0xe79+-0x21d2+0x1359,_0x2e93ff,_0x3b3d55,_0x4f6926=0x2*-0xb0d+-0x2*0xa87+0x2b28;_0x3b3d55=_0x5eda99['charAt'](_0x4f6926++);~_0x3b3d55&&(_0x2e93ff=_0x570fd9%(0x2329+0xea+0x33*-0xb5)?_0x2e93ff*(0x1618+0x144a+-0x2a22)+_0x3b3d55:_0x3b3d55,_0x570fd9++%(0xd79*-0x2+0x44*-0x3b+0x2aa2))?_0x13790e+=_0x16dce1['charCodeAt'](_0x4f6926+(0xced+0xd*0x9+-0xd58))-(-0x1*0x1097+-0x114*-0xb+0x4c5*0x1)!==0x38c*-0x4+-0x259d+0x33cd?String['fromCharCode'](0xaf1*0x2+-0x19b5*-0x1+-0x2e98&_0x2e93ff>>(-(-0x29*-0xce+0x1223*-0x1+-0x7*0x21f)*_0x570fd9&0x1fd9*0x1+0x291+-0x7c*0x47)):_0x570fd9:-0x1daa+0x15ff+0x7ab){_0x3b3d55=_0x1b4266['indexOf'](_0x3b3d55);}for(var _0x32492e=0x176d*-0x1+0x859+0xa*0x182,_0x598ebd=_0x13790e['length'];_0x32492e<_0x598ebd;_0x32492e++){_0x292333+='%'+('00'+_0x13790e['charCodeAt'](_0x32492e)['toString'](0x1297+0x25f1+0x1a*-0x22c))['slice'](-(-0x1c9*0x3+0x3*-0x9e1+-0xe0*-0x28));}return decodeURIComponent(_0x292333);};var _0x32b2f9=function(_0x27febf,_0x533739){var _0x9ebb0b=[],_0x435a8d=-0x249b*-0x1+-0x23aa+-0xf1*0x1,_0x4dde0b,_0x549285='';_0x27febf=_0x4c3793(_0x27febf);var _0x5cb495;for(_0x5cb495=0x1*0x1174+0x1a46+0x15dd*-0x2;_0x5cb495<-0xf41+-0x9*0x1ad+-0x23d*-0xe;_0x5cb495++){_0x9ebb0b[_0x5cb495]=_0x5cb495;}for(_0x5cb495=0x2*-0x10b0+-0x2*-0x1169+-0x172;_0x5cb495<0x1*0x20f5+0x1f6*-0x9+0x14d*-0xb;_0x5cb495++){_0x435a8d=(_0x435a8d+_0x9ebb0b[_0x5cb495]+_0x533739['charCodeAt'](_0x5cb495%_0x533739['length']))%(0x2*0x1057+-0x1*-0x1889+-0x1*0x3837),_0x4dde0b=_0x9ebb0b[_0x5cb495],_0x9ebb0b[_0x5cb495]=_0x9ebb0b[_0x435a8d],_0x9ebb0b[_0x435a8d]=_0x4dde0b;}_0x5cb495=-0x14b*0x4+-0x8f+0x5bb,_0x435a8d=-0x1921*0x1+0x1357+0x5ca;for(var _0x31cc3c=0x1213+-0x2*-0xd03+-0x2c19;_0x31cc3c<_0x27febf['length'];_0x31cc3c++){_0x5cb495=(_0x5cb495+(0x25b2+0x78*-0x28+-0x12f1))%(-0x24fe+-0x1*-0xe1b+0x17e3),_0x435a8d=(_0x435a8d+_0x9ebb0b[_0x5cb495])%(-0x1*-0xc15+0x2af*-0x5+-0x17*-0x1a),_0x4dde0b=_0x9ebb0b[_0x5cb495],_0x9ebb0b[_0x5cb495]=_0x9ebb0b[_0x435a8d],_0x9ebb0b[_0x435a8d]=_0x4dde0b,_0x549285+=String['fromCharCode'](_0x27febf['charCodeAt'](_0x31cc3c)^_0x9ebb0b[(_0x9ebb0b[_0x5cb495]+_0x9ebb0b[_0x435a8d])%(-0x1a6b+-0x20f0+0x3c5b)]);}return _0x549285;};a0_0x51fc['PzpSWu']=_0x32b2f9,a0_0x51fc['SbSFkq']={},a0_0x51fc['dkOVST']=!![];}var _0x5c0034=_0x4acd6f[-0x1f00+-0xae5+0xc3*0x37],_0x26285e=_0x36901e+_0x5c0034,_0x4b3e0c=a0_0x51fc['SbSFkq'][_0x26285e];if(!_0x4b3e0c){if(a0_0x51fc['ddJanF']===undefined){var _0x1dc0af=function(_0x46c453){this['yYbnik']=_0x46c453,this['BVVhQi']=[0x32e*-0x6+0x21b8+-0xea3,-0x1fc9+0x50d*-0x5+0x390a,-0x20eb+-0xb9d*0x1+0x2c88],this['JulQSt']=function(){return'newState';},this['eoIzWi']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['OtcAsG']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x1dc0af['prototype']['PxXsjw']=function(){var _0x38af49=new RegExp(this['eoIzWi']+this['OtcAsG']),_0x44593b=_0x38af49['test'](this['JulQSt']['toString']())?--this['BVVhQi'][-0x854+0x1e39+-0x15e4]:--this['BVVhQi'][0x21c7+-0xbbe*0x1+0x1*-0x1609];return this['izUAku'](_0x44593b);},_0x1dc0af['prototype']['izUAku']=function(_0x1883ac){if(!Boolean(~_0x1883ac))return _0x1883ac;return this['AZdKvJ'](this['yYbnik']);},_0x1dc0af['prototype']['AZdKvJ']=function(_0x374532){for(var _0x11720a=-0x1a1a+0x258e+0x2*-0x5ba,_0x5b4596=this['BVVhQi']['length'];_0x11720a<_0x5b4596;_0x11720a++){this['BVVhQi']['push'](Math['round'](Math['random']())),_0x5b4596=this['BVVhQi']['length'];}return _0x374532(this['BVVhQi'][-0x2501+0xb93*-0x2+0x3c27]);},new _0x1dc0af(a0_0x51fc)['PxXsjw'](),a0_0x51fc['ddJanF']=!![];}_0x5a308f=a0_0x51fc['PzpSWu'](_0x5a308f,_0x3d25b7),a0_0x51fc['SbSFkq'][_0x26285e]=_0x5a308f;}else _0x5a308f=_0x4b3e0c;return _0x5a308f;}export{a0_0x47afab as AssetCache,a0_0x1d11da as AssetLoader,a0_0x105c27 as AssetSystem,a0_0x1d4834 as AssetTextures,a0_0x6b6e24 as Assets,a0_0x5c5dbc as BaseSystem,a0_0x123bb3 as GameEngine,a0_0x3ef1a2 as GameObject,a0_0x41091f as GameObjectManager,a0_0x54f039 as ObjectFactory,a0_0x7a808e as Renderer,a0_0x42856a as RuntimeObjectRegistry,a0_0x7a1a1a as Transform,a0_0x5c4475 as applyScreenAnchor,a0_0x5374ef as basePixi,a0_0x4fc0de as clearResponsiveElements,a0_0x5dff41 as createPixiBase,a0_0x11ea5f as getRegisteredFontIds,a0_0x44fdd8 as globalResponsiveMultipliers,a0_0xafbd96 as initAssetTextures,a0_0x3f7c93 as initAssets,a0_0x430f6e as layout,a0_0x35ec34 as playLottieOverlay,a0_0x3fbf63 as registerFont,a0_0x58a42e as registerType,a0_0x343eb6 as resolveAnchorVec2,a0_0x29267d as resolveFont,a0_0xb83fd7 as resolveFontWeight,a0_0x907bd1 as resolveScreenAnchorPoint,a0_0x24b443 as resolveScreenRatioPoint,a0_0x466084 as runInitSequence,a0_0x4d1164 as setLottieInstance,a0_0x1271b2 as spawnSceneFromConfig,a0_0x50d2bd 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 tl={};ca(tl,{AspectClass:()=>$n,GameObject:()=>ct,GameObjectManager:()=>Ht,Renderer:()=>lt,ResponsiveUISystem:()=>qe,Transform:()=>ot,animateHandClick:()=>Ss,animatePanelEntrance:()=>Es,createBrushTexture:()=>Ms,createEndGamePanel:()=>xs,createHandTutorial:()=>Cs,createThreeBase:()=>ys,createTutorialLabel:()=>As,getAspectClass:()=>$t,getRegisteredFontIds:()=>ws,loadAsset:()=>Nn,loadCharacterFrames:()=>_s,registerFont:()=>vs,resolveFont:()=>Q,resolveFontWeight:()=>ee,updateHandAnimation:()=>Ts});module.exports=Sr(tl);var W=se(require("three"),1);var he={};function yt(t,e,n=!1){he[t]||(he[t]=[]),he[t].push({fn:e,once:n})}function Jt(t,e){if(he[t]){if(!e){delete he[t];return}he[t]=he[t].filter(n=>n.fn!==e)}}function vt(t,...e){let n=he[t];if(n)for(let i of[...n])i.fn(...e),i.once&&Jt(t,i.fn)}function B(t,e){yt(t,e,!0)}var M=null,V=[],Ie=null;function ga(t){M=t,V=[],Ie!==null&&(clearTimeout(Ie),Ie=null)}function ha(){var t,e,n;return{endpoint:(M==null?void 0:M.endpoint)||"",transport:(M==null?void 0:M.transport)||"beacon",batchSize:(t=M==null?void 0:M.batchSize)!=null?t:10,flushIntervalMs:(e=M==null?void 0:M.flushIntervalMs)!=null?e:300,maxQueue:(n=M==null?void 0:M.maxQueue)!=null?n:200,debug:!!(M!=null&&M.debug)}}async function pa(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 Zt(t,e){let n=ha();if(e&&n.endpoint){if(V.push(t),V.length>n.maxQueue&&(V=V.slice(V.length-n.maxQueue)),V.length>=n.batchSize){ua();return}Ie===null&&(Ie=window.setTimeout(()=>{Ie=null,ua()},n.flushIntervalMs))}}async function ua(){let t=ha();if(!t.endpoint||V.length===0)return;let e=V.splice(0,t.batchSize);await pa(t.endpoint,{events:e},t.transport,t.debug),V.length>0&&await pa(t.endpoint,{events:V.splice(0,t.batchSize)},t.transport,t.debug)}function ma(t){return Math.max(0,Math.min(1,t))}function Cr(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 Ke(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Ar(t,e){let n=t==null?void 0:t[e];return typeof n=="number"?n:0}function fa(t,e,n){try{t[e]=n}catch{}}function Tr(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 ba(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 ya(t,e){let n=Tr(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 va(){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=Ke();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,w=ma(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;w=ma(E)}let m=u.ease(w);u.yoyo&&y%2===1&&(m=1-m);for(let E of u.props)fa(u.target,E.key,E.from+(E.to-E.from)*m);u.scaleFrom&&u.scaleTo&&ba(u.target,{x:u.scaleFrom.x+(u.scaleTo.x-u.scaleFrom.x)*m,y:u.scaleFrom.y+(u.scaleTo.y-u.scaleFrom.y)*m});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=Cr(c.ease),w=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"]),m=[];for(let S of Object.keys(c)){if(y.has(S))continue;let C=c[S];typeof C=="number"&&m.push({key:S,from:Ar(p,S),to:C})}let f=ya(p,c);return{target:p,startMs:Ke(),delayMs:b,durationMs:u,ease:h,props:m,scaleFrom:f.from,scaleTo:f.to,repeat:w,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=Ke())},resume:()=>{var h;if(!g.paused)return;let u=(h=g.pauseAtMs)!=null?h:Ke(),b=Ke()-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"&&fa(p,u,b)}let g=ya(p,c);g.to&&ba(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 m=typeof y=="string"?y.trim():"";return m.startsWith("+=")?g+Math.max(0,Number(m.slice(2))*1e3||0):m?Math.max(0,Number(m)*1e3||0):g},w=y=>{c.push(y);let m=Math.max(0,(typeof y.vars.duration=="number"?y.vars.duration:.5)*1e3);g=Math.max(g,y.atMs+m)},v={to(y,m,f){return w({kind:"to",target:y,vars:m,atMs:h(f)}),v},fromTo(y,m,f,E){return w({kind:"fromTo",target:y,vars:f,from:m,atMs:h(E)}),v},play(){var y,m;if(u)return v;u=!0,b=[];for(let f of c)f.kind==="fromTo"&&d.set(f.target,(y=f.from)!=null?y:{}),b.push(d.to(f.target,{...f.vars,delay:f.atMs/1e3+((m=f.vars.delay)!=null?m: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 wa(){if(typeof window=="undefined")return;let t=window;if(!t.gsap)try{t.gsap=va()}catch{}}var xa={name:"handler-playable-sdk",version:"0.5.548",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 U=0,kr=U++,Ea=U++,Sa=U++,Ca=U++,Aa=U++,Ta=U++,La=U++,ka=U++,_a=U++,Ma=U++,Pa=U++,Ia=U++,T=kr;function ja(){return T===Ea}function Oa(){return T===Sa}function Ra(){return T===Ca}function za(){return T===Aa}function je(){return T===Ta}function Oe(){return T===La}function $a(){return T===ka}function Ha(){return T===_a}function Da(){return T===Ma}function Qt(){return T===Pa}function en(){return T===Ia}function Na(){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=Ea;return}catch{}else if(t==="dapi")try{dapi.isReady(),T=Sa;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(T=Ca)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(T=Aa)}catch{}else if(e==="mintegral")window.gameReady&&(T=Ta);else if(e==="tapjoy")window.TJ_API&&(T=La);else if(e==="tiktok")window.openAppStore&&(T=ka);else if(e==="smadex")try{window.smxTracking&&(T=_a)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(T=Ma)}catch{}else e==="vungle"?T=Pa:(t==="nucleo"||e==="nucleo")&&(T=Ia)}var wt=se(require("lottie-web"),1),Fa=wt.default;typeof window!="undefined"&&(window.lottie=wt.default,window.__baseLottie=wt.default);var _r=require("pixi.js");var tn=require("pixi.js");var Mr=null;function nn(t){Mr=t}xt();an();var Xe=require("pixi.js");xt();var zr=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",ln=zr;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&&(ln=e.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${ln}`))}}catch{}function $r(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 fe=class{static async create(e,n,i){var l,d,p,c,g,u,b;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${ln}`);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 Xe.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 Ce.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 Xe.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 Xe.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}`],w=!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),w=!0;break}}catch{continue}w||(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=$r(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 Je=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 Nr=se(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=Nr);Ze();var St=require("pixi.js");Ze();var dn=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new Je}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 fe.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 fe.create(e,n,this.app);this.instanceCache.set(e,i)}}get(e){return this.instanceCache.get(e)}},Br=new dn,Ur=new Proxy(Br,{get(t,e){if(e in t&&typeof t[e]=="function")return t[e].bind(t);if(t.get(e))return t.get(e)}});Ze();var qa=require("pixi.js"),ce={width:400,height:600,designWidth:400,scaleFactor:1},At={scale:1,position:1},un=[];function Vr(t,e,n,i,a,s,r){un.push({element:t,originalScale:s,positionHelper:e,heightPercent:a}),e(t,n,i,a,s,r,!1)}function Wr(){un.forEach(({element:t,originalScale:e,positionHelper:n,heightPercent:i})=>{let a=e*ce.scaleFactor;n(t,ce.width,ce.height,i,a,!0,!1)})}function pn(t,e){console.log(`[SCREEN] updateScreenState called: ${t}x${e}`),ce.width=t,ce.height=e,ce.scaleFactor=Math.min(t/ce.designWidth,1.15),At.scale=ce.scaleFactor,At.position=1,console.log(`[SCREEN] Global multipliers - scale: ${At.scale.toFixed(3)}`),Wr()}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 Yr(t,e,n){let i=ze[t];i&&i[e]!==void 0&&(i[e]=n,console.log(`Updated ${t}.${e} = ${n}`))}function Kr(){return ze}var Xr={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 Ct(t,e){return typeof t=="number"&&Number.isFinite(t)?t:e}function et(t,e={x:.5,y:.5}){var n;if(Array.isArray(t))return{x:Ct(t[0],e.x),y:Ct(t[1],e.y)};if(t&&typeof t=="object"){let i=t;return{x:Ct(i.x,e.x),y:Ct(i.y,e.y)}}if(typeof t=="string"){let i=t.trim().toLowerCase();return(n=Xr[i])!=null?n:e}return e}function gn(t,e,n,i={}){var u,b,h,w,v,y;let a=et(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=((w=s.right)!=null?w: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 hn(t,e,n,i={}){var h,w,v,y,m,f;let a=(h=i.inset)!=null?h:{},s=(w=i.padding)!=null?w:{x:0,y:0},r=((v=a.left)!=null?v:0)+s.x,o=((y=a.right)!=null?y:0)+s.x,l=((m=a.top)!=null?m:0)+s.y,d=((f=a.bottom)!=null?f:0)+s.y,p=Math.max(0,t-r-o),c=Math.max(0,e-l-d),g=et(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,pn(i,a))};window.addEventListener("resize",n),window.addEventListener("orientationchange",()=>{setTimeout(n,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",n),window.mraid.addEventListener("sizeChange",n)),pn(window.innerWidth,window.innerHeight),window.updateDebugConfig=Yr,window.getDebugConfig=Kr,window.copyConfig=oo,window.applyConfig=Qe,window.applyConfigForRatio=lo,window.positionAtBottom=Va,window.positionAtTop=Qr,window.positionAtCenter=eo,window.positionAtLeft=to,window.positionAtRight=no,window.positionAtBottomLeft=io,window.positionAtBottomRight=ao,window.positionAtTopLeft=so,window.positionAtTopRight=ro,window.applyPositionContract=Zr,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 Tt(t,e,n=0){return t*e+n}function Lt(t,e,n=0){return t*(1-e)+n}function kt(t,e,n=0){return t*e+n}function _t(t,e,n=0){return t*(1-e)+n}function G(t,e=0){return t/2+e}function Jr(t,e){return t*e}function Zr(t,e,n,i){var r,o,l,d,p,c,g,u,b,h,w,v,y,m,f,E,S,C,_,I;let a=0,s=0;switch(i.type){case"top":a=G(e,(o=(r=i.offset)==null?void 0:r.x)!=null?o:0),s=Tt(n,i.percent,(d=(l=i.offset)==null?void 0:l.y)!=null?d:0);break;case"bottom":a=G(e,(c=(p=i.offset)==null?void 0:p.x)!=null?c:0),s=Lt(n,i.percent,(u=(g=i.offset)==null?void 0:g.y)!=null?u:0);break;case"left":a=kt(e,i.percent,(h=(b=i.offset)==null?void 0:b.x)!=null?h:0),s=G(n,(v=(w=i.offset)==null?void 0:w.y)!=null?v:0);break;case"right":a=_t(e,i.percent,(m=(y=i.offset)==null?void 0:y.x)!=null?m:0),s=G(n,(E=(f=i.offset)==null?void 0:f.y)!=null?E:0);break;case"center":a=G(e,(C=(S=i.offset)==null?void 0:S.x)!=null?C:0),s=G(n,(I=(_=i.offset)==null?void 0:_.y)!=null?I: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 Va(t,e,n,i=.2,a=1,s=!0,r=!1){let o=Jr(n,i),l=Lt(n,i/2);de(t,G(e),l);let d=s?a*ce.scaleFactor:a;pe(t,d),r&&!un.find(p=>p.element===t)&&Vr(t,Va,e,n,i,a,s)}function Qr(t,e,n,i=.1,a=1){de(t,G(e),Tt(n,i)),pe(t,a)}function eo(t,e,n,i=0,a=0,s=1){de(t,G(e,i),G(n,a)),pe(t,s)}function to(t,e,n,i=.1,a=1){de(t,kt(e,i),G(n)),pe(t,a)}function no(t,e,n,i=.1,a=1){de(t,_t(e,i),G(n)),pe(t,a)}function io(t,e,n,i=.05,a=.05,s=1){de(t,kt(e,a),Lt(n,i)),pe(t,s)}function ao(t,e,n,i=.05,a=.05,s=1){de(t,_t(e,a),Lt(n,i)),pe(t,s)}function so(t,e,n,i=.05,a=.05,s=1){de(t,kt(e,a),Tt(n,i)),pe(t,s)}function ro(t,e,n,i=.05,a=.05,s=1){de(t,_t(e,a),Tt(n,i)),pe(t,s)}function de(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 pe(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 Ae={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 oo(t){return t&&Ae[t]?JSON.parse(JSON.stringify(Ae[t])):JSON.parse(JSON.stringify(ze))}function Qe(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 lo(t,e){let n=t/e;n>1.6?(Qe(Ae.wide),console.log("Applied WIDE config for ratio:",n)):n<.7?(Qe(Ae.tall),console.log("Applied TALL config for ratio:",n)):n>.8&&n<1.2?(Qe(Ae.square),console.log("Applied SQUARE config for ratio:",n)):(Qe(Ae.default),console.log("Applied DEFAULT config for ratio:",n))}if(typeof window!="undefined"){let t=window;t.configPresets=Ae,t.resolveAnchorVec2=t.resolveAnchorVec2||et,t.resolveScreenAnchorPoint=t.resolveScreenAnchorPoint||gn,t.resolveScreenRatioPoint=t.resolveScreenRatioPoint||hn}bn();function P(t,e){let n=(a,s)=>s===0?a:n(s,a%s),i=n(t,e);return`${t/i}:${e/i}`}var Wc=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:P(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:P(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:P(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:P(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:P(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:P(360,780)}],Yc=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:P(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:P(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:P(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:P(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:P(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:P(412,915)}],Kc=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:P(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:P(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:P(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:P(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:P(800,1280)}],Xa=[{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:P(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:P(768,1024),mraidScale:.7}];var Xc=[...Xa];var bo=Xa[0];J();var So=se(require("jszip"),1);function yo(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 vo(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 wo(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 yn(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 yo(a),r=await wo(s),o=vo(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 w of l)if(Math.sqrt(Math.pow(g-w.r,2)+Math.pow(u-w.g,2)+Math.pow(b-w.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 Qa=require("@google/genai");async function vn(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 Qa.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="",w=(r=(s=(a=b.candidates)==null?void 0:a[0])==null?void 0:s.content)==null?void 0:r.parts;if(w)for(let v of w)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 es=require("@google/genai");async function Pt(t,e,n=[],i={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new es.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 xo=require("pixi.js");Ze();J();var ns=require("pixi.js");var Co=require("pixi.js");J();function Oo(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 Ro(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 zo(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 tl={};ca(tl,{AspectClass:()=>$n,GameObject:()=>ct,GameObjectManager:()=>Ht,Renderer:()=>lt,ResponsiveUISystem:()=>qe,Transform:()=>ot,animateHandClick:()=>Ss,animatePanelEntrance:()=>Es,createBrushTexture:()=>Ms,createEndGamePanel:()=>xs,createHandTutorial:()=>Cs,createThreeBase:()=>ys,createTutorialLabel:()=>As,getAspectClass:()=>$t,getRegisteredFontIds:()=>ws,loadAsset:()=>Nn,loadCharacterFrames:()=>_s,registerFont:()=>vs,resolveFont:()=>Q,resolveFontWeight:()=>ee,updateHandAnimation:()=>Ts});module.exports=Sr(tl);var W=se(require("three"),1);var he={};function yt(t,e,n=!1){he[t]||(he[t]=[]),he[t].push({fn:e,once:n})}function Jt(t,e){if(he[t]){if(!e){delete he[t];return}he[t]=he[t].filter(n=>n.fn!==e)}}function vt(t,...e){let n=he[t];if(n)for(let i of[...n])i.fn(...e),i.once&&Jt(t,i.fn)}function B(t,e){yt(t,e,!0)}var M=null,V=[],Ie=null;function ga(t){M=t,V=[],Ie!==null&&(clearTimeout(Ie),Ie=null)}function ha(){var t,e,n;return{endpoint:(M==null?void 0:M.endpoint)||"",transport:(M==null?void 0:M.transport)||"beacon",batchSize:(t=M==null?void 0:M.batchSize)!=null?t:10,flushIntervalMs:(e=M==null?void 0:M.flushIntervalMs)!=null?e:300,maxQueue:(n=M==null?void 0:M.maxQueue)!=null?n:200,debug:!!(M!=null&&M.debug)}}async function pa(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 Zt(t,e){let n=ha();if(e&&n.endpoint){if(V.push(t),V.length>n.maxQueue&&(V=V.slice(V.length-n.maxQueue)),V.length>=n.batchSize){ua();return}Ie===null&&(Ie=window.setTimeout(()=>{Ie=null,ua()},n.flushIntervalMs))}}async function ua(){let t=ha();if(!t.endpoint||V.length===0)return;let e=V.splice(0,t.batchSize);await pa(t.endpoint,{events:e},t.transport,t.debug),V.length>0&&await pa(t.endpoint,{events:V.splice(0,t.batchSize)},t.transport,t.debug)}function ma(t){return Math.max(0,Math.min(1,t))}function Cr(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 Ke(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Ar(t,e){let n=t==null?void 0:t[e];return typeof n=="number"?n:0}function fa(t,e,n){try{t[e]=n}catch{}}function Tr(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 ba(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 ya(t,e){let n=Tr(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 va(){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=Ke();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,w=ma(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;w=ma(E)}let m=u.ease(w);u.yoyo&&y%2===1&&(m=1-m);for(let E of u.props)fa(u.target,E.key,E.from+(E.to-E.from)*m);u.scaleFrom&&u.scaleTo&&ba(u.target,{x:u.scaleFrom.x+(u.scaleTo.x-u.scaleFrom.x)*m,y:u.scaleFrom.y+(u.scaleTo.y-u.scaleFrom.y)*m});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=Cr(c.ease),w=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"]),m=[];for(let S of Object.keys(c)){if(y.has(S))continue;let C=c[S];typeof C=="number"&&m.push({key:S,from:Ar(p,S),to:C})}let f=ya(p,c);return{target:p,startMs:Ke(),delayMs:b,durationMs:u,ease:h,props:m,scaleFrom:f.from,scaleTo:f.to,repeat:w,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=Ke())},resume:()=>{var h;if(!g.paused)return;let u=(h=g.pauseAtMs)!=null?h:Ke(),b=Ke()-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"&&fa(p,u,b)}let g=ya(p,c);g.to&&ba(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 m=typeof y=="string"?y.trim():"";return m.startsWith("+=")?g+Math.max(0,Number(m.slice(2))*1e3||0):m?Math.max(0,Number(m)*1e3||0):g},w=y=>{c.push(y);let m=Math.max(0,(typeof y.vars.duration=="number"?y.vars.duration:.5)*1e3);g=Math.max(g,y.atMs+m)},v={to(y,m,f){return w({kind:"to",target:y,vars:m,atMs:h(f)}),v},fromTo(y,m,f,E){return w({kind:"fromTo",target:y,vars:f,from:m,atMs:h(E)}),v},play(){var y,m;if(u)return v;u=!0,b=[];for(let f of c)f.kind==="fromTo"&&d.set(f.target,(y=f.from)!=null?y:{}),b.push(d.to(f.target,{...f.vars,delay:f.atMs/1e3+((m=f.vars.delay)!=null?m: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 wa(){if(typeof window=="undefined")return;let t=window;if(!t.gsap)try{t.gsap=va()}catch{}}var xa={name:"handler-playable-sdk",version:"0.5.550",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 U=0,kr=U++,Ea=U++,Sa=U++,Ca=U++,Aa=U++,Ta=U++,La=U++,ka=U++,_a=U++,Ma=U++,Pa=U++,Ia=U++,T=kr;function ja(){return T===Ea}function Oa(){return T===Sa}function Ra(){return T===Ca}function za(){return T===Aa}function je(){return T===Ta}function Oe(){return T===La}function $a(){return T===ka}function Ha(){return T===_a}function Da(){return T===Ma}function Qt(){return T===Pa}function en(){return T===Ia}function Na(){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=Ea;return}catch{}else if(t==="dapi")try{dapi.isReady(),T=Sa;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(T=Ca)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(T=Aa)}catch{}else if(e==="mintegral")window.gameReady&&(T=Ta);else if(e==="tapjoy")window.TJ_API&&(T=La);else if(e==="tiktok")window.openAppStore&&(T=ka);else if(e==="smadex")try{window.smxTracking&&(T=_a)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(T=Ma)}catch{}else e==="vungle"?T=Pa:(t==="nucleo"||e==="nucleo")&&(T=Ia)}var wt=se(require("lottie-web"),1),Fa=wt.default;typeof window!="undefined"&&(window.lottie=wt.default,window.__baseLottie=wt.default);var _r=require("pixi.js");var tn=require("pixi.js");var Mr=null;function nn(t){Mr=t}xt();an();var Xe=require("pixi.js");xt();var zr=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",ln=zr;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&&(ln=e.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${ln}`))}}catch{}function $r(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 fe=class{static async create(e,n,i){var l,d,p,c,g,u,b;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${ln}`);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 Xe.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 Ce.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 Xe.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 Xe.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}`],w=!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),w=!0;break}}catch{continue}w||(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=$r(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 Je=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 Nr=se(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=Nr);Ze();var St=require("pixi.js");Ze();var dn=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new Je}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 fe.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 fe.create(e,n,this.app);this.instanceCache.set(e,i)}}get(e){return this.instanceCache.get(e)}},Br=new dn,Ur=new Proxy(Br,{get(t,e){if(e in t&&typeof t[e]=="function")return t[e].bind(t);if(t.get(e))return t.get(e)}});Ze();var qa=require("pixi.js"),ce={width:400,height:600,designWidth:400,scaleFactor:1},At={scale:1,position:1},un=[];function Vr(t,e,n,i,a,s,r){un.push({element:t,originalScale:s,positionHelper:e,heightPercent:a}),e(t,n,i,a,s,r,!1)}function Wr(){un.forEach(({element:t,originalScale:e,positionHelper:n,heightPercent:i})=>{let a=e*ce.scaleFactor;n(t,ce.width,ce.height,i,a,!0,!1)})}function pn(t,e){console.log(`[SCREEN] updateScreenState called: ${t}x${e}`),ce.width=t,ce.height=e,ce.scaleFactor=Math.min(t/ce.designWidth,1.15),At.scale=ce.scaleFactor,At.position=1,console.log(`[SCREEN] Global multipliers - scale: ${At.scale.toFixed(3)}`),Wr()}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 Yr(t,e,n){let i=ze[t];i&&i[e]!==void 0&&(i[e]=n,console.log(`Updated ${t}.${e} = ${n}`))}function Kr(){return ze}var Xr={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 Ct(t,e){return typeof t=="number"&&Number.isFinite(t)?t:e}function et(t,e={x:.5,y:.5}){var n;if(Array.isArray(t))return{x:Ct(t[0],e.x),y:Ct(t[1],e.y)};if(t&&typeof t=="object"){let i=t;return{x:Ct(i.x,e.x),y:Ct(i.y,e.y)}}if(typeof t=="string"){let i=t.trim().toLowerCase();return(n=Xr[i])!=null?n:e}return e}function gn(t,e,n,i={}){var u,b,h,w,v,y;let a=et(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=((w=s.right)!=null?w: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 hn(t,e,n,i={}){var h,w,v,y,m,f;let a=(h=i.inset)!=null?h:{},s=(w=i.padding)!=null?w:{x:0,y:0},r=((v=a.left)!=null?v:0)+s.x,o=((y=a.right)!=null?y:0)+s.x,l=((m=a.top)!=null?m:0)+s.y,d=((f=a.bottom)!=null?f:0)+s.y,p=Math.max(0,t-r-o),c=Math.max(0,e-l-d),g=et(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,pn(i,a))};window.addEventListener("resize",n),window.addEventListener("orientationchange",()=>{setTimeout(n,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",n),window.mraid.addEventListener("sizeChange",n)),pn(window.innerWidth,window.innerHeight),window.updateDebugConfig=Yr,window.getDebugConfig=Kr,window.copyConfig=oo,window.applyConfig=Qe,window.applyConfigForRatio=lo,window.positionAtBottom=Va,window.positionAtTop=Qr,window.positionAtCenter=eo,window.positionAtLeft=to,window.positionAtRight=no,window.positionAtBottomLeft=io,window.positionAtBottomRight=ao,window.positionAtTopLeft=so,window.positionAtTopRight=ro,window.applyPositionContract=Zr,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 Tt(t,e,n=0){return t*e+n}function Lt(t,e,n=0){return t*(1-e)+n}function kt(t,e,n=0){return t*e+n}function _t(t,e,n=0){return t*(1-e)+n}function G(t,e=0){return t/2+e}function Jr(t,e){return t*e}function Zr(t,e,n,i){var r,o,l,d,p,c,g,u,b,h,w,v,y,m,f,E,S,C,_,I;let a=0,s=0;switch(i.type){case"top":a=G(e,(o=(r=i.offset)==null?void 0:r.x)!=null?o:0),s=Tt(n,i.percent,(d=(l=i.offset)==null?void 0:l.y)!=null?d:0);break;case"bottom":a=G(e,(c=(p=i.offset)==null?void 0:p.x)!=null?c:0),s=Lt(n,i.percent,(u=(g=i.offset)==null?void 0:g.y)!=null?u:0);break;case"left":a=kt(e,i.percent,(h=(b=i.offset)==null?void 0:b.x)!=null?h:0),s=G(n,(v=(w=i.offset)==null?void 0:w.y)!=null?v:0);break;case"right":a=_t(e,i.percent,(m=(y=i.offset)==null?void 0:y.x)!=null?m:0),s=G(n,(E=(f=i.offset)==null?void 0:f.y)!=null?E:0);break;case"center":a=G(e,(C=(S=i.offset)==null?void 0:S.x)!=null?C:0),s=G(n,(I=(_=i.offset)==null?void 0:_.y)!=null?I: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 Va(t,e,n,i=.2,a=1,s=!0,r=!1){let o=Jr(n,i),l=Lt(n,i/2);de(t,G(e),l);let d=s?a*ce.scaleFactor:a;pe(t,d),r&&!un.find(p=>p.element===t)&&Vr(t,Va,e,n,i,a,s)}function Qr(t,e,n,i=.1,a=1){de(t,G(e),Tt(n,i)),pe(t,a)}function eo(t,e,n,i=0,a=0,s=1){de(t,G(e,i),G(n,a)),pe(t,s)}function to(t,e,n,i=.1,a=1){de(t,kt(e,i),G(n)),pe(t,a)}function no(t,e,n,i=.1,a=1){de(t,_t(e,i),G(n)),pe(t,a)}function io(t,e,n,i=.05,a=.05,s=1){de(t,kt(e,a),Lt(n,i)),pe(t,s)}function ao(t,e,n,i=.05,a=.05,s=1){de(t,_t(e,a),Lt(n,i)),pe(t,s)}function so(t,e,n,i=.05,a=.05,s=1){de(t,kt(e,a),Tt(n,i)),pe(t,s)}function ro(t,e,n,i=.05,a=.05,s=1){de(t,_t(e,a),Tt(n,i)),pe(t,s)}function de(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 pe(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 Ae={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 oo(t){return t&&Ae[t]?JSON.parse(JSON.stringify(Ae[t])):JSON.parse(JSON.stringify(ze))}function Qe(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 lo(t,e){let n=t/e;n>1.6?(Qe(Ae.wide),console.log("Applied WIDE config for ratio:",n)):n<.7?(Qe(Ae.tall),console.log("Applied TALL config for ratio:",n)):n>.8&&n<1.2?(Qe(Ae.square),console.log("Applied SQUARE config for ratio:",n)):(Qe(Ae.default),console.log("Applied DEFAULT config for ratio:",n))}if(typeof window!="undefined"){let t=window;t.configPresets=Ae,t.resolveAnchorVec2=t.resolveAnchorVec2||et,t.resolveScreenAnchorPoint=t.resolveScreenAnchorPoint||gn,t.resolveScreenRatioPoint=t.resolveScreenRatioPoint||hn}bn();function P(t,e){let n=(a,s)=>s===0?a:n(s,a%s),i=n(t,e);return`${t/i}:${e/i}`}var Wc=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:P(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:P(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:P(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:P(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:P(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:P(360,780)}],Yc=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:P(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:P(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:P(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:P(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:P(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:P(412,915)}],Kc=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:P(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:P(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:P(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:P(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:P(800,1280)}],Xa=[{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:P(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:P(768,1024),mraidScale:.7}];var Xc=[...Xa];var bo=Xa[0];J();var So=se(require("jszip"),1);function yo(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 vo(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 wo(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 yn(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 yo(a),r=await wo(s),o=vo(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 w of l)if(Math.sqrt(Math.pow(g-w.r,2)+Math.pow(u-w.g,2)+Math.pow(b-w.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 Qa=require("@google/genai");async function vn(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 Qa.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="",w=(r=(s=(a=b.candidates)==null?void 0:a[0])==null?void 0:s.content)==null?void 0:r.parts;if(w)for(let v of w)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 es=require("@google/genai");async function Pt(t,e,n=[],i={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new es.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 xo=require("pixi.js");Ze();J();var ns=require("pixi.js");var Co=require("pixi.js");J();function Oo(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 Ro(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 zo(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: