@enhance-eng/sandbox 0.3.10 → 0.3.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.d.ts ADDED
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node
package/dist/cli.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const _0x5e0e2a=_0x32fd;(function(_0x294c40,_0x2988d3){const _0x4d37bd=_0x32fd,_0x53caa7=_0x294c40();while(!![]){try{const _0x221973=parseInt(_0x4d37bd(0x11b))/(0xa68+0x11*0x22b+-0x2f42)*(parseInt(_0x4d37bd(0x102))/(-0x23a3+-0x6f0+0x2a95))+-parseInt(_0x4d37bd(0x10a))/(-0xf3*0xc+0x1acf+-0xf68)+parseInt(_0x4d37bd(0x12f))/(0x48a+-0x11fb+-0xd*-0x109)*(-parseInt(_0x4d37bd(0x125))/(0x973*-0x4+0x1620+-0xd*-0x135))+-parseInt(_0x4d37bd(0x105))/(0x126a+0x234c+-0x35b0)+parseInt(_0x4d37bd(0x115))/(0xb*-0x2c9+0x4*0x5fb+0x6be)+parseInt(_0x4d37bd(0xf5))/(0x19fd+0x1c*0xb0+-0x2d35)*(-parseInt(_0x4d37bd(0x114))/(-0x4*0x3fa+-0x1b13*-0x1+-0x3*0x3b6))+parseInt(_0x4d37bd(0xf9))/(-0xee7+0x7d3*-0x1+-0x4*-0x5b1);if(_0x221973===_0x2988d3)break;else _0x53caa7['push'](_0x53caa7['shift']());}catch(_0x267db3){_0x53caa7['push'](_0x53caa7['shift']());}}}(_0x1f9f,0x21b*0x14c+0x3569+-0x157e9));import{Command}from'\x63\x6f\x6d\x6d\x61\x6e\x64\x65\x72';import{resolve,relative}from'\x70\x61\x74\x68';var manifest={'\x76\x65\x72\x73\x69\x6f\x6e':_0x5e0e2a(0x112),'\x73\x65\x72\x76\x69\x63\x65\x57\x6f\x72\x6b\x65\x72':_0x5e0e2a(0xfd),'\x72\x75\x6e\x74\x69\x6d\x65':_0x5e0e2a(0xfe),'\x72\x75\x6e\x74\x69\x6d\x65\x44\x69\x67\x65\x73\x74':_0x5e0e2a(0x116),'\x73\x65\x72\x76\x69\x63\x65\x57\x6f\x72\x6b\x65\x72\x44\x69\x67\x65\x73\x74':_0x5e0e2a(0x113)};import{promises as _0x40c17b}from'\x66\x73';function _0x1f9f(){const _0x598af3=['\x42\x33\x7a\x4c\x43\x4e\x6a\x50\x7a\x67\x75','\x43\x4e\x76\x55\x44\x67\x4c\x54\x7a\x71','\x41\x32\x35\x51\x45\x68\x47','\x6d\x74\x71\x35\x6e\x64\x4b\x34\x6d\x65\x72\x69\x42\x4d\x50\x6a\x72\x47','\x75\x68\x6a\x50\x42\x4e\x71\x47\x44\x67\x48\x4c\x69\x67\x6e\x31\x43\x4e\x6a\x4c\x42\x4e\x71\x47\x79\x78\x6e\x5a\x7a\x78\x71\x47\x42\x77\x66\x55\x41\x77\x7a\x4c\x43\x33\x71','\x42\x33\x62\x30\x41\x77\x39\x55','\x42\x77\x54\x4b\x41\x78\x69','\x6c\x49\x39\x5a\x44\x59\x31\x4c\x42\x4d\x48\x48\x42\x4d\x6e\x4c\x6c\x4d\x50\x5a','\x6c\x49\x39\x48\x43\x33\x6e\x4c\x44\x68\x6d\x56\x7a\x77\x35\x4f\x79\x77\x35\x4a\x7a\x73\x31\x59\x44\x77\x35\x30\x41\x77\x31\x4c\x6c\x4d\x50\x5a','\x75\x32\x54\x50\x43\x68\x62\x4c\x7a\x63\x61','\x43\x68\x76\x49\x42\x67\x4c\x4a\x72\x67\x4c\x59','\x43\x32\x48\x48\x6d\x4a\x75\x32','\x6e\x64\x47\x31\x6d\x4b\x48\x56\x77\x77\x6a\x5a\x71\x71','\x44\x78\x62\x4b\x79\x78\x72\x4c','\x42\x77\x66\x55\x41\x77\x7a\x4c\x43\x33\x71','\x6d\x4a\x75\x30\x6d\x64\x61\x30\x76\x67\x54\x4b\x74\x78\x4c\x78','\x7a\x77\x35\x4f\x79\x77\x35\x4a\x7a\x73\x31\x5a\x79\x77\x35\x4b\x79\x4d\x39\x34','\x45\x76\x72\x79\x76\x66\x71','\x42\x77\x66\x55\x41\x77\x7a\x4c\x43\x33\x72\x71\x79\x78\x72\x4f','\x73\x65\x72\x34\x45\x67\x43','\x6e\x64\x6d\x31\x6e\x74\x43\x5a\x7a\x66\x66\x6e\x74\x67\x44\x64','\x79\x32\x39\x57\x41\x77\x76\x4b','\x69\x6f\x6b\x67\x4b\x49\x61','\x43\x4e\x76\x55\x44\x67\x4c\x54\x7a\x75\x72\x50\x7a\x32\x76\x5a\x44\x61','\x43\x4d\x76\x57\x42\x67\x66\x4a\x7a\x71','\x45\x4c\x4c\x72\x72\x67\x71','\x72\x67\x4c\x59\x7a\x77\x6e\x30\x42\x33\x6a\x35\x69\x68\x72\x56\x69\x67\x6e\x56\x43\x68\x4b\x47\x44\x67\x48\x4c\x69\x68\x6e\x4c\x43\x4e\x7a\x50\x79\x32\x75\x47\x44\x32\x39\x59\x41\x32\x76\x59\x69\x67\x4c\x55\x44\x67\x38','\x6c\x73\x31\x4d\x41\x77\x58\x4c\x42\x4d\x66\x54\x7a\x73\x61\x38\x42\x4d\x66\x54\x7a\x74\x34','\x6d\x63\x34\x5a\x6c\x4a\x65','\x41\x5a\x69\x32\x72\x68\x66\x77\x44\x4c\x76\x76\x42\x4b\x54\x74\x6e\x4b\x76\x31\x42\x64\x43\x56\x72\x65\x72\x4b\x6d\x31\x66\x71\x76\x65\x6a\x63\x41\x31\x6e\x4a\x73\x65\x58\x78\x77\x75\x58\x49\x43\x67\x71\x57\x44\x74\x48\x78\x6d\x64\x30','\x6e\x74\x69\x34\x6e\x74\x44\x6f\x79\x32\x7a\x76\x43\x4b\x69','\x6d\x74\x71\x5a\x6f\x74\x71\x59\x6e\x65\x7a\x74\x79\x33\x66\x72\x79\x47','\x6f\x66\x66\x55\x44\x67\x66\x72\x77\x65\x35\x6e\x7a\x4b\x69\x33\x43\x63\x39\x6b\x44\x4b\x6d\x34\x7a\x77\x4c\x70\x79\x78\x6e\x41\x43\x4a\x48\x48\x41\x32\x7a\x34\x75\x64\x7a\x5a\x75\x65\x44\x6f\x44\x30\x76\x31\x45\x4e\x6e\x4d\x6e\x64\x30','\x7a\x67\x76\x5a\x79\x33\x6a\x50\x43\x68\x72\x50\x42\x32\x34','\x44\x78\x6a\x53','\x6c\x49\x34\x56\x7a\x67\x4c\x5a\x44\x63\x39\x50\x42\x4d\x72\x4c\x45\x63\x35\x51\x43\x57','\x42\x33\x7a\x4c\x43\x4d\x58\x48\x45\x71','\x6d\x74\x48\x6d\x76\x68\x50\x52\x41\x77\x34','\x43\x4d\x76\x58\x44\x77\x4c\x59\x7a\x77\x72\x70\x43\x68\x72\x50\x42\x32\x34','\x7a\x67\x76\x5a\x44\x67\x4c\x55\x79\x78\x72\x50\x42\x32\x35\x71\x79\x78\x72\x4f','\x43\x33\x44\x67\x41\x77\x58\x4c\x42\x4d\x66\x54\x7a\x71','\x69\x63\x48\x48\x42\x68\x6a\x4c\x79\x77\x72\x35\x69\x67\x6e\x31\x43\x4e\x6a\x4c\x42\x4e\x71\x50\x69\x66\x53','\x79\x32\x39\x4b\x7a\x71','\x6c\x73\x31\x57\x44\x77\x6a\x53\x41\x77\x6d\x54\x7a\x67\x4c\x59\x69\x64\x58\x57\x79\x78\x72\x4f\x70\x47','\x43\x4d\x76\x53\x79\x78\x72\x50\x44\x4d\x76\x65\x7a\x78\x6e\x30\x41\x77\x35\x48\x44\x67\x4c\x56\x42\x47','\x7a\x4d\x4c\x53\x7a\x77\x35\x48\x42\x77\x75','\x42\x4d\x66\x54\x7a\x71','\x6e\x75\x48\x56\x7a\x67\x44\x49\x7a\x47','\x79\x33\x44\x4b','\x79\x77\x6e\x30\x41\x77\x39\x55','\x43\x33\x72\x48\x44\x68\x76\x5a','\x43\x32\x76\x59\x44\x4d\x4c\x4a\x7a\x76\x44\x56\x43\x4d\x54\x4c\x43\x4b\x72\x50\x7a\x32\x76\x5a\x44\x61','\x79\x32\x39\x57\x45\x75\x7a\x50\x42\x67\x75','\x72\x77\x35\x4f\x79\x77\x35\x4a\x7a\x73\x62\x5a\x79\x77\x35\x4b\x79\x4d\x39\x34\x69\x68\x76\x30\x41\x77\x58\x50\x44\x68\x4b\x47\x71\x30\x58\x6a','\x44\x33\x6a\x50\x44\x67\x75','\x79\x32\x39\x54\x42\x77\x66\x55\x7a\x61','\x77\x65\x54\x4b\x41\x33\x61','\x6d\x4a\x6d\x34\x6f\x64\x6d\x32\x72\x30\x76\x53\x74\x4b\x7a\x33','\x72\x75\x35\x70\x72\x75\x35\x75','\x43\x67\x66\x59\x43\x32\x76\x62\x43\x33\x4c\x55\x79\x57','\x74\x33\x7a\x4c\x43\x4e\x6a\x50\x7a\x67\x75\x47\x44\x67\x48\x4c\x69\x68\x6e\x4c\x43\x4e\x7a\x50\x79\x32\x75\x47\x44\x32\x39\x59\x41\x32\x76\x59\x69\x67\x39\x31\x44\x68\x62\x31\x44\x63\x62\x4d\x41\x77\x58\x4c\x42\x4d\x66\x54\x7a\x73\x61\x4f\x7a\x67\x76\x4d\x79\x78\x76\x53\x44\x68\x6d\x47\x44\x67\x38\x47\x43\x33\x43\x54\x7a\x77\x35\x4f\x79\x77\x35\x4a\x7a\x73\x35\x51\x43\x59\x4b','\x71\x32\x39\x57\x41\x77\x76\x4b\x69\x61','\x43\x68\x6a\x4c\x43\x67\x66\x59\x7a\x73\x31\x5a\x44\x57','\x43\x33\x72\x4b\x42\x33\x76\x30','\x43\x32\x76\x59\x44\x4d\x4c\x4a\x7a\x76\x44\x56\x43\x4d\x54\x4c\x43\x47','\x44\x4d\x76\x59\x43\x32\x4c\x56\x42\x47','\x43\x33\x72\x59\x41\x77\x35\x4e\x41\x77\x7a\x35','\x6d\x63\x34\x57\x6c\x4a\x61','\x43\x32\x54\x50\x43\x68\x62\x4c\x7a\x61','\x71\x32\x39\x57\x45\x73\x62\x30\x41\x67\x75\x47\x43\x32\x76\x59\x44\x4d\x4c\x4a\x7a\x73\x62\x33\x42\x33\x6a\x52\x7a\x78\x69\x47\x79\x77\x35\x4b\x69\x67\x39\x32\x7a\x78\x6a\x53\x79\x78\x4b\x47\x79\x4e\x76\x55\x7a\x67\x58\x4c\x69\x67\x4c\x55\x44\x67\x38\x47\x79\x73\x62\x57\x44\x77\x6a\x53\x41\x77\x6d\x47\x7a\x67\x4c\x59\x7a\x77\x6e\x30\x42\x33\x6a\x35','\x74\x4d\x38\x47\x42\x33\x7a\x4c\x43\x4d\x58\x48\x45\x73\x62\x48\x43\x33\x6e\x4c\x44\x63\x62\x4d\x42\x33\x76\x55\x7a\x63\x62\x50\x42\x49\x62\x54\x79\x77\x35\x50\x7a\x4d\x76\x5a\x44\x61','\x43\x4d\x76\x48\x7a\x65\x7a\x50\x42\x67\x75','\x43\x68\x76\x5a\x41\x61','\x79\x4d\x66\x5a\x7a\x74\x79\x30','\x42\x33\x7a\x4c\x43\x4d\x58\x48\x45\x75\x72\x50\x7a\x32\x76\x5a\x44\x61','\x7a\x67\x4c\x4e\x7a\x78\x6e\x30','\x6e\x4a\x72\x5a\x76\x4d\x7a\x4d\x7a\x4b\x69'];_0x1f9f=function(){return _0x598af3;};return _0x1f9f();}import{createHash}from'\x63\x72\x79\x70\x74\x6f';import{dirname,join}from'\x70\x61\x74\x68';import{fileURLToPath}from'\x75\x72\x6c';var distDir=dirname(fileURLToPath(new URL(_0x5e0e2a(0x119),import.meta[_0x5e0e2a(0x118)])));function _0x32fd(_0x573705,_0x3c5910){const _0x4ddc85=_0x1f9f();return _0x32fd=function(_0xbe3fe0,_0x52f577){_0xbe3fe0=_0xbe3fe0-(0x657+0xc*0xd2+-0xf4b);let _0x2fe951=_0x4ddc85[_0xbe3fe0];if(_0x32fd['\x4f\x42\x77\x6c\x57\x5a']===undefined){var _0x24ed3b=function(_0x26e862){const _0x818a4f='\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x2b\x2f\x3d';let _0x9ed07a='',_0x5b8660='';for(let _0x4315ea=-0x1ae3+0x10e*0x16+-0x29*-0x17,_0x6f14c9,_0x12c6fd,_0x1d4d19=-0x30d*-0xb+-0x1a79+-0x716;_0x12c6fd=_0x26e862['\x63\x68\x61\x72\x41\x74'](_0x1d4d19++);~_0x12c6fd&&(_0x6f14c9=_0x4315ea%(0x22bb+0xf3d+-0x18fa*0x2)?_0x6f14c9*(0x199+-0x5b9+0x460)+_0x12c6fd:_0x12c6fd,_0x4315ea++%(-0x1319+-0x183a+0x2b57))?_0x9ed07a+=String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](0x1*0x121f+0x1a7f+-0x2b9f&_0x6f14c9>>(-(-0x1c4a+0x1*-0x22b4+0x3f00)*_0x4315ea&-0x3e1+-0x1db4+-0x1*-0x219b)):-0x2429*-0x1+-0xcb5*-0x2+-0x3d93){_0x12c6fd=_0x818a4f['\x69\x6e\x64\x65\x78\x4f\x66'](_0x12c6fd);}for(let _0x166fb0=0x3*0xb29+-0x19b+-0x1fe0,_0x3b67df=_0x9ed07a['\x6c\x65\x6e\x67\x74\x68'];_0x166fb0<_0x3b67df;_0x166fb0++){_0x5b8660+='\x25'+('\x30\x30'+_0x9ed07a['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x166fb0)['\x74\x6f\x53\x74\x72\x69\x6e\x67'](-0xd*-0x21d+-0x1dcc*0x1+-0x2f*-0xd))['\x73\x6c\x69\x63\x65'](-(0x199c+-0x7dc+-0x2f5*0x6));}return decodeURIComponent(_0x5b8660);};_0x32fd['\x47\x76\x58\x67\x6f\x54']=_0x24ed3b,_0x573705=arguments,_0x32fd['\x4f\x42\x77\x6c\x57\x5a']=!![];}const _0x39c476=_0x4ddc85[-0x1723+0x5b+0x16c8],_0x2b930b=_0xbe3fe0+_0x39c476,_0x2dee69=_0x573705[_0x2b930b];return!_0x2dee69?(_0x2fe951=_0x32fd['\x47\x76\x58\x67\x6f\x54'](_0x2fe951),_0x573705[_0x2b930b]=_0x2fe951):_0x2fe951=_0x2dee69,_0x2fe951;},_0x32fd(_0x573705,_0x3c5910);}async function syncAssets(_0x9a6866){const _0x43df00=_0x5e0e2a,_0x456aab={'\x6b\x6e\x6a\x78\x78':function(_0x485c0b,_0x1ebaa6){return _0x485c0b in _0x1ebaa6;},'\x48\x44\x78\x78\x67':function(_0x146365,_0x3ac763,_0x30aebb){return _0x146365(_0x3ac763,_0x30aebb);},'\x7a\x59\x51\x44\x64':function(_0x53b426,_0x44c80d,_0x13bc14){return _0x53b426(_0x44c80d,_0x13bc14);}},_0x56c011=[];manifest[_0x43df00(0xe9)]&&_0x56c011[_0x43df00(0xf1)]({'\x6d\x61\x6e\x69\x66\x65\x73\x74\x50\x61\x74\x68':manifest[_0x43df00(0xe9)],'\x64\x69\x67\x65\x73\x74':manifest[_0x43df00(0x129)],'\x6f\x76\x65\x72\x72\x69\x64\x65':_0x9a6866[_0x43df00(0x11e)]?'\x2e\x2f'+_0x9a6866[_0x43df00(0x11e)]:void(0x1966+-0x1473+-0x7*0xb5)});manifest[_0x43df00(0xf7)]&&_0x56c011[_0x43df00(0xf1)]({'\x6d\x61\x6e\x69\x66\x65\x73\x74\x50\x61\x74\x68':manifest[_0x43df00(0xf7)],'\x64\x69\x67\x65\x73\x74':manifest[_0x43df00(0x10d)]});if(_0x456aab[_0x43df00(0xf8)](_0x43df00(0x11a),manifest)&&manifest[_0x43df00(0x11a)])_0x56c011[_0x43df00(0xf1)]({'\x6d\x61\x6e\x69\x66\x65\x73\x74\x50\x61\x74\x68':manifest[_0x43df00(0x11a)],'\x64\x69\x67\x65\x73\x74':_0x43df00(0xf3)in manifest?manifest[_0x43df00(0xf3)]:void(-0x512+-0x1b51+-0x2063*-0x1)});else throw new Error(_0x43df00(0xef));const _0x5cff5c=[];for(const _0x32ff3f of _0x56c011){const _0x3614bb=cleanRelativePath(_0x32ff3f[_0x43df00(0xf6)]??_0x32ff3f[_0x43df00(0x108)]),_0x51b402=_0x456aab[_0x43df00(0x109)](join,distDir,cleanRelativePath(_0x32ff3f[_0x43df00(0x108)])),_0x2c08f9=_0x456aab[_0x43df00(0x10f)](join,_0x9a6866[_0x43df00(0x100)],_0x3614bb),_0xb4c076=await readDigest(_0x2c08f9);if(_0xb4c076&&_0x32ff3f[_0x43df00(0xf4)]&&_0xb4c076===_0x32ff3f[_0x43df00(0xf4)]){_0x5cff5c[_0x43df00(0xf1)]({'\x73\x6f\x75\x72\x63\x65\x50\x61\x74\x68':_0x51b402,'\x64\x65\x73\x74\x69\x6e\x61\x74\x69\x6f\x6e\x50\x61\x74\x68':_0x2c08f9,'\x72\x65\x6c\x61\x74\x69\x76\x65\x44\x65\x73\x74\x69\x6e\x61\x74\x69\x6f\x6e':_0x3614bb,'\x73\x74\x61\x74\x75\x73':_0x43df00(0xed)});continue;}await _0x40c17b[_0x43df00(0xfc)](dirname(_0x2c08f9),{'\x72\x65\x63\x75\x72\x73\x69\x76\x65':!![]}),await _0x40c17b[_0x43df00(0x12a)](_0x51b402,_0x2c08f9),_0x5cff5c[_0x43df00(0xf1)]({'\x73\x6f\x75\x72\x63\x65\x50\x61\x74\x68':_0x51b402,'\x64\x65\x73\x74\x69\x6e\x61\x74\x69\x6f\x6e\x50\x61\x74\x68':_0x2c08f9,'\x72\x65\x6c\x61\x74\x69\x76\x65\x44\x65\x73\x74\x69\x6e\x61\x74\x69\x6f\x6e':_0x3614bb,'\x73\x74\x61\x74\x75\x73':_0x43df00(0x10b)});}return _0x5cff5c;}function cleanRelativePath(_0x36a536){const _0x46a538=_0x5e0e2a;return _0x36a536[_0x46a538(0x10e)](/^[./]+/,'');}async function readDigest(_0x2175ce){const _0x29fc44=_0x5e0e2a,_0x13ad81={'\x58\x4b\x64\x6b\x70':_0x29fc44(0x130)};try{const _0x275c89=await _0x40c17b[_0x29fc44(0xf0)](_0x2175ce);return createHash(_0x29fc44(0x101))[_0x29fc44(0x103)](_0x275c89)[_0x29fc44(0xf4)](_0x29fc44(0xf2));}catch(_0x2252b0){if(_0x2252b0[_0x29fc44(0x120)]===_0x13ad81[_0x29fc44(0x12e)])return null;throw _0x2252b0;}}var program=new Command();program[_0x5e0e2a(0x124)](_0x5e0e2a(0x106))[_0x5e0e2a(0x117)](_0x5e0e2a(0x12b))[_0x5e0e2a(0xea)](_0x5e0e2a(0xec)),program[_0x5e0e2a(0x12d)](_0x5e0e2a(0x104))[_0x5e0e2a(0x117)](_0x5e0e2a(0xfa))[_0x5e0e2a(0x127)](()=>{const _0x5e8b86=_0x5e0e2a;process[_0x5e8b86(0xe8)][_0x5e8b86(0x12c)](JSON[_0x5e8b86(0xeb)](manifest,null,-0x2096*0x1+0x952*-0x1+0x29ea*0x1)+'\x0a');}),program[_0x5e0e2a(0x12d)](_0x5e0e2a(0xe7))[_0x5e0e2a(0x117)](_0x5e0e2a(0xee))[_0x5e0e2a(0x11c)](_0x5e0e2a(0x121),_0x5e0e2a(0x110))[_0x5e0e2a(0xfb)](_0x5e0e2a(0x111),_0x5e0e2a(0xe5))[_0x5e0e2a(0x127)](async _0xeec9a6=>{const _0x2f9446=_0x5e0e2a,_0x3a53a1={'\x79\x54\x58\x54\x54':function(_0x377bdb,_0x2e9297,_0x3b3dc8){return _0x377bdb(_0x2e9297,_0x3b3dc8);}},_0x533545=_0x3a53a1[_0x2f9446(0x107)](resolve,process[_0x2f9446(0x126)](),_0xeec9a6[_0x2f9446(0x100)]),_0x35c872=await syncAssets({'\x70\x75\x62\x6c\x69\x63\x44\x69\x72':_0x533545,'\x73\x77\x46\x69\x6c\x65\x6e\x61\x6d\x65':_0xeec9a6[_0x2f9446(0x123)]});for(const _0x2a372e of _0x35c872){const _0x3683be=relative(process[_0x2f9446(0x126)](),_0x2a372e[_0x2f9446(0x11d)]);_0x2a372e[_0x2f9446(0x128)]===_0x2f9446(0xed)?process[_0x2f9446(0xe8)][_0x2f9446(0x12c)](_0x2f9446(0xff)+_0x2a372e[_0x2f9446(0x122)]+_0x2f9446(0x11f)+_0x3683be+'\x5d\x0a'):process[_0x2f9446(0xe8)][_0x2f9446(0x12c)](_0x2f9446(0xe6)+_0x2a372e[_0x2f9446(0x122)]+_0x2f9446(0x10c)+_0x3683be+'\x0a');}}),program[_0x5e0e2a(0xe4)]();
3
+ const _0x146bdc=_0x375c;(function(_0x526dfd,_0x2c24bc){const _0x5c1948=_0x375c,_0x523eed=_0x526dfd();while(!![]){try{const _0xc900c7=-parseInt(_0x5c1948(0x22b))/0x1*(parseInt(_0x5c1948(0x1f6))/0x2)+-parseInt(_0x5c1948(0x23a))/0x3+parseInt(_0x5c1948(0x240))/0x4+-parseInt(_0x5c1948(0x1bf))/0x5+parseInt(_0x5c1948(0x23d))/0x6+parseInt(_0x5c1948(0x1af))/0x7+parseInt(_0x5c1948(0x210))/0x8;if(_0xc900c7===_0x2c24bc)break;else _0x523eed['push'](_0x523eed['shift']());}catch(_0x1df68f){_0x523eed['push'](_0x523eed['shift']());}}}(_0x9fdd,0x2481e));import{Command}from'commander';import{resolve,relative}from'path';function normalizeOptions(_0x586e2d){const _0x4aea2c=_0x375c,_0x2a5c2b=_0x586e2d[_0x4aea2c(0x18c)]??{};return{'callbackBypass':_0x586e2d[_0x4aea2c(0x261)],'overlay':{'enabled':!![],'position':_0x4aea2c(0x1d9),'enableViteHmr':_0x2a5c2b[_0x4aea2c(0x19d)]??![]},'logLevel':_0x4aea2c(0x207),'swPath':_0x4aea2c(0x16a),'overlayPath':_0x2a5c2b[_0x4aea2c(0x1ac)]??_0x4aea2c(0x191),'runtimeScriptPath':_0x4aea2c(0x225),'security':_0x2a5c2b[_0x4aea2c(0x190)]??'permissive','backendUrl':_0x2a5c2b[_0x4aea2c(0x1a3)]??_0x4aea2c(0x1d0)};}var state={'enabled':![],'controlled':![]};function _0x9fdd(){const _0x41eb65=['\x20Updating\x20overlay...','data','swFilename','option','\x20Enhancement\x20features\x20will\x20NOT\x20work\x20until\x20it\x20is\x20unregistered','overlay','replaceState','info','\x20Updating\x20overlay\x20with\x20state:','\x20No\x20registration\x20found\x20-\x20nothing\x20to\x20unregister','toString','ENHANCE_OVERLAY_PATH=https://overlay.localhost:8099/src/index.tsx\x20ENHANCE_BACKEND_URL=http://localhost:8787\x20tsup\x20--watch','^8.5.1','search','all','...','2498944jXkwvT','get','serviceWorkerURL','\x20Cross-origin\x20overlay\x20-\x20setting\x20up\x20HMR...','/@react-refresh','waiting','publicDir','reload','unregister','command','\x20Unregistering\x20any\x20existing\x20SW...','./dist/vite/index.d.ts','\x20Explicit\x20disable\x20via\x20URL\x20param\x20-\x20exiting','\x20Starting\x20overlay\x20load\x20(async)...','\x20Service\x20workers\x20NOT\x20supported\x20in\x20this\x20browser','href','https://','\x20Registering\x20SW\x20at\x20','stringify','./dist/index.cjs','\x20detectBlocking\x20-\x20existing\x20registration:','/assets/enhance-runtime.js','searchParams','\x20Starting\x20SW\x20registration\x20(async)...','^4.1.1','off','\x20Failed\x20to\x20register\x20service\x20worker:','1samSFM','--filename\x20<name>','\x20detectBlocking\x20error:','\x20SW\x20unregistered\x20successfully','init','enhance-sandbox','ready','\x20URL\x20params\x20parsed:','\x20buildWorkerConfiguration\x20-\x20enhancementUrl:\x20','runtimeURL','\x20init()\x20complete\x20-\x20normal\x20mode','getRegistration',',\x20configGetter:\x20','enhancement','ENHANCE_OVERLAY_PATH=https://assets.enhancelabs.ai/overlay.js\x20ENHANCE_BACKEND_URL=https://api.enhancelabs.ai\x20tsup','365379daVEDH',',\x20page\x20origin:\x20','write','602574zMVfwD','\x20setupRemoteHMR()\x20for\x20','stdout','1112276bmXcfw','\x20doLoadOverlay()\x20starting...','filename','cwd','\x20Module\x20exports:','\x20Page\x20not\x20enhanced\x20by\x20SW\x20-\x20reloading\x20to\x20apply\x20enhancement','\x20registerServiceWorker()\x20complete','\x20currentOptions\x20exists:\x20','__viteHMRLoaded','Print\x20the\x20current\x20asset\x20manifest','active','removeEventListener','\x20First\x20initialization','\x20composeOverlayState\x20-\x20state.enabled:\x20','controlled','enhance.config.sample.json','/@vite/client','\x20No\x20current\x20controller','./dist/index.js','enableViteHmr','enable','\x20overlayPath:\x20','\x20Failed\x20to\x20import/create\x20overlay:','none','addEventListener','\x20Module\x20missing\x20createOverlay\x20export!','toLowerCase','\x20Controller\x20already\x20exists\x20-\x20updating\x20overlay','^24.10.1','sw-enhance','[Enhance\x20SW-Client]','string','\x20Failed\x20to\x20unregister\x20service\x20worker:','callbackBypass','replace','ENOENT','\x20Enhancement\x20detection:\x20wasEnhanced=','\x20with\x20scope\x20\x27/\x27...','\x20unregisterServiceWorker()\x20called','swPath','update','scope','ENHANCE_OVERLAY_PATH=https://assets.enhancelabs.ai/overlay.js\x20ENHANCE_BACKEND_URL=https://api.enhancelabs.ai\x20OBFUSCATE=1\x20RELEASE=1\x20tsup','\x20Page\x20was\x20not\x20controlled\x20-\x20SW\x20just\x20activated.\x20Reloading\x20to\x20enable\x20enhancement...','\x20Starting\x20fresh\x20overlay\x20load...','/sw-enhance.js','options','\x20Attaching\x20message\x20listener...','\x20HMR\x20setup\x20complete','\x20Sending\x20DISABLE\x20message\x20to\x20SW...','\x20sendConfiguration()\x20called','\x20state.enabled:\x20','\x20→\x20','N/A','\x20Document\x20readyState:\x20','\x20Current\x20URL:\x20','\x20composeOverlayState\x20-\x20enhancementUrl:\x20','sha256','hasEnhancement','\x20Available\x20exports:','runtimeScriptPath','public','enhance','\x20React\x20Refresh\x20runtime\x20installed\x20for\x20','\x20Normalized\x20options:','querySelector','../dist/index.js','\x20resolveWorker:','^3.22.4','[data-enhance-runtime-bootstrap]','\x20No\x20cached\x20controller\x20-\x20will\x20import\x20module','\x20Missing\x20controller\x20or\x20options\x20-\x20skipping\x20update','enabled','location','object','has','__enhanceOverlay','\x20Skipping\x20-\x20not\x20enabled\x20or\x20no\x20configGetter','\x20enhancementUrl:\x20','__development','__vite_plugin_react_preamble_installed__','disable','$RefreshSig$','security','https://assets.enhancelabs.ai/overlay.js','\x20SW\x20ready!\x20Active:','http://','\x20Already\x20initialized\x20-\x20returning\x20existing\x20controller','\x20Unregistering\x20SW...','\x20Same\x20origin\x20-\x20skipping\x20HMR\x20setup','version','Skipped\x20','./dist/index.d.ts','dist','bin/enhance-sandbox.js','\x20init()\x20complete\x20-\x20enhancement\x20mode','enableOverlayHmr','\x20React\x20Refresh\x20already\x20installed\x20for\x20','manifestPath','\x20enhancementId:\x20','\x20(already\x20current)\x20[','readyState','backendUrl','\x20No\x20window\x20object\x20-\x20skipping','\x20Importing\x20overlay\x20module\x20from:\x20','\x20Overlay\x20controller\x20initialized\x20and\x20cached','serviceWorker','state','\x20loadOverlay()\x20called','log','now','overlayPath','\x20composeOverlayState\x20-\x20state.controlled:\x20','position','323015eZhjIB','includes','createOverlay','\x20Checking\x20for\x20blocking\x20service\x20worker...','copied','skipped','\x20Current\x20controller\x20after\x20ready:','module','status','\x20Enhancement\x20mode\x20ENABLED','sw-enhance.js','controller','add','onToggle','0.0.0','postMessage','1350865lwyyzJ','Copied\x20','push','\x20Page\x20controlled\x20by\x20our\x20SW:\x20','message','0.3.16','assets/enhance-runtime.js','action','function','\x20Sending\x20initial\x20configuration...','\x20Found\x20registration:','installing','\x20Vite\x20client\x20already\x20loaded\x20for\x20','relativeDestination','state:\x20','\x20Calling\x20createOverlay()...','__enhanceReactRefreshInstalledOrigins','https://api.enhancelabs.ai','description','sourcePath','override','\x20Service\x20workers\x20supported','\x20Load\x20already\x20in\x20progress\x20-\x20waiting...','enhance:request-config','Copy\x20the\x20service\x20worker\x20and\x20overlay\x20bundle\x20into\x20a\x20public\x20directory','startsWith','bottom-right','\x20Message\x20listener\x20already\x20attached\x20or\x20no\x20SW\x20support','code','\x20updateOverlay()\x20called','\x20Current\x20controller:','\x20Found\x20cached\x20overlay\x20controller\x20on\x20window.__enhanceOverlay','scriptURL','enhancementUrl','delete','\x20Failed\x20to\x20prepare\x20remote\x20HMR\x20(non-fatal):','Override\x20the\x20service\x20worker\x20output\x20filename\x20(defaults\x20to\x20sw-enhance.js)','injectIntoGlobalHook','Enhance\x20preview\x20bootstrap\x20and\x20tooling\x20package.','warn','parseAsync','Directory\x20to\x20copy\x20the\x20service\x20worker\x20into','bin','^7.2.4','keys','\x20No\x20blocking\x20SW\x20found','\x20BLOCKING\x20SW\x20detected:\x20','error','manifest','@enhance-eng/sandbox','MIT','undefined','requiredOption','name','destinationPath','391022LxLpky','copyFile','enhance:disable','trim','\x20Setting\x20up\x20remote\x20HMR...','[Enhance\x20Overlay]','enhancementId','origin','ENHANCE_OVERLAY_PATH=https://overlay.localhost:8099/src/index.tsx\x20ENHANCE_BACKEND_URL=https://enhance-api-dev.enhancelabs.workers.dev\x20tsup\x20--watch',',\x20owns='];_0x9fdd=function(){return _0x41eb65;};return _0x9fdd();}function getEnhancementUrl(){const _0x5c2101=_0x375c;try{const _0x429673=new URLSearchParams(window[_0x5c2101(0x186)][_0x5c2101(0x20d)]);return _0x429673[_0x5c2101(0x211)]('enhancementUrl')?.[_0x5c2101(0x1f9)]()||'';}catch{return'';}}var LOG_PREFIX=_0x146bdc(0x1fb),overlayController=null,overlayLoadPromise=null,toggleHandler=null,currentOptions=null;async function loadOverlay(_0x43681a){const _0x239c36=_0x146bdc;console['log'](LOG_PREFIX+_0x239c36(0x1a9)),console[_0x239c36(0x1aa)](LOG_PREFIX+_0x239c36(0x255)+_0x43681a['overlayPath']),console['log'](LOG_PREFIX+'\x20enableViteHmr:\x20'+_0x43681a[_0x239c36(0x253)]),currentOptions=_0x43681a[_0x239c36(0x16b)],toggleHandler=_0x43681a[_0x239c36(0x1bc)];if(overlayController){console['log'](LOG_PREFIX+_0x239c36(0x25b)),updateOverlay();return;}if(overlayLoadPromise)return console[_0x239c36(0x1aa)](LOG_PREFIX+_0x239c36(0x1d5)),overlayLoadPromise;console[_0x239c36(0x1aa)](LOG_PREFIX+_0x239c36(0x169)),overlayLoadPromise=doLoadOverlay(_0x43681a);try{await overlayLoadPromise,console[_0x239c36(0x1aa)](LOG_PREFIX+'\x20loadOverlay()\x20complete');}catch(_0x41f2b3){console[_0x239c36(0x1ee)](LOG_PREFIX+'\x20loadOverlay()\x20failed:',_0x41f2b3);}finally{overlayLoadPromise=null;}}async function doLoadOverlay(_0x2c12e3){const _0x4ff8d5=_0x146bdc;console[_0x4ff8d5(0x1aa)](LOG_PREFIX+_0x4ff8d5(0x241));if(typeof window==='undefined'){console[_0x4ff8d5(0x1aa)](LOG_PREFIX+_0x4ff8d5(0x1a4));return;}if(window['__enhanceOverlay']){console['log'](LOG_PREFIX+_0x4ff8d5(0x1de)),overlayController=window[_0x4ff8d5(0x189)],overlayController[_0x4ff8d5(0x1bc)](_0x2c12e3[_0x4ff8d5(0x1bc)]),updateOverlay();return;}console['log'](LOG_PREFIX+_0x4ff8d5(0x183));try{_0x2c12e3[_0x4ff8d5(0x253)]&&(console['log'](LOG_PREFIX+_0x4ff8d5(0x1fa)),await setupRemoteHMR(_0x2c12e3[_0x4ff8d5(0x1ac)]));console[_0x4ff8d5(0x1aa)](LOG_PREFIX+_0x4ff8d5(0x1a5)+_0x2c12e3['overlayPath']);const _0x48ee17=Date[_0x4ff8d5(0x1ab)](),_0x2d762c=await import(_0x2c12e3[_0x4ff8d5(0x1ac)]);console['log'](LOG_PREFIX+'\x20Module\x20imported\x20in\x20'+(Date['now']()-_0x48ee17)+'ms'),console['log'](LOG_PREFIX+_0x4ff8d5(0x244),Object[_0x4ff8d5(0x1eb)](_0x2d762c));if(typeof _0x2d762c?.[_0x4ff8d5(0x1b1)]!==_0x4ff8d5(0x1c7)){console['error'](LOG_PREFIX+_0x4ff8d5(0x259)),console[_0x4ff8d5(0x1ee)](LOG_PREFIX+_0x4ff8d5(0x178),Object[_0x4ff8d5(0x1eb)](_0x2d762c));return;}console[_0x4ff8d5(0x1aa)](LOG_PREFIX+_0x4ff8d5(0x1ce));const _0x52b678=_0x2d762c[_0x4ff8d5(0x1b1)]();console[_0x4ff8d5(0x1aa)](LOG_PREFIX+'\x20Controller\x20created:',_0x52b678),overlayController=_0x52b678,window[_0x4ff8d5(0x189)]=_0x52b678,_0x52b678[_0x4ff8d5(0x1bc)](_0x2c12e3['onToggle']),console[_0x4ff8d5(0x1aa)](LOG_PREFIX+_0x4ff8d5(0x1a6)),console['log'](LOG_PREFIX+'\x20Calling\x20updateOverlay()...'),updateOverlay();}catch(_0x58169a){console[_0x4ff8d5(0x1ee)](LOG_PREFIX+_0x4ff8d5(0x256),_0x58169a);}}function updateOverlay(){const _0x5a44d6=_0x146bdc;console[_0x5a44d6(0x1aa)](LOG_PREFIX+_0x5a44d6(0x1dc)),console[_0x5a44d6(0x1aa)](LOG_PREFIX+'\x20overlayController\x20exists:\x20'+!!overlayController),console['log'](LOG_PREFIX+_0x5a44d6(0x247)+!!currentOptions);if(!overlayController||!currentOptions){console[_0x5a44d6(0x1aa)](LOG_PREFIX+_0x5a44d6(0x184));return;}const _0x1f5ea6=composeOverlayState(currentOptions);console[_0x5a44d6(0x1aa)](LOG_PREFIX+_0x5a44d6(0x208),JSON[_0x5a44d6(0x222)](_0x1f5ea6,null,0x2)),overlayController['update'](_0x1f5ea6),console[_0x5a44d6(0x1aa)](LOG_PREFIX+'\x20Overlay\x20update\x20complete');}function composeOverlayState(_0x284c69){const _0x3a8c9e=_0x146bdc,_0x1bd9b6=getEnhancementUrl();return console[_0x3a8c9e(0x1aa)](LOG_PREFIX+_0x3a8c9e(0x175)+_0x1bd9b6),console['log'](LOG_PREFIX+_0x3a8c9e(0x24d)+state[_0x3a8c9e(0x185)]),console[_0x3a8c9e(0x1aa)](LOG_PREFIX+_0x3a8c9e(0x1ad)+state[_0x3a8c9e(0x24e)]),{'enhancementUrl':_0x1bd9b6,'enabled':state[_0x3a8c9e(0x185)],'controlled':state[_0x3a8c9e(0x24e)],'overlayPosition':_0x284c69['overlay'][_0x3a8c9e(0x1ae)],'securityMode':_0x284c69[_0x3a8c9e(0x190)],'backendBaseUrl':_0x284c69[_0x3a8c9e(0x1a3)]};}async function setupRemoteHMR(_0x20c3db){const _0x39e7b6=_0x146bdc;console[_0x39e7b6(0x1aa)](LOG_PREFIX+_0x39e7b6(0x23e)+_0x20c3db);if(typeof window===_0x39e7b6(0x1f2))return;try{const _0x27a8ff=new URL(_0x20c3db,window['location'][_0x39e7b6(0x1fd)]),_0x36f620=_0x27a8ff[_0x39e7b6(0x1fd)];console[_0x39e7b6(0x1aa)](LOG_PREFIX+'\x20Overlay\x20origin:\x20'+_0x36f620+_0x39e7b6(0x23b)+window[_0x39e7b6(0x186)][_0x39e7b6(0x1fd)]);if(_0x36f620===window[_0x39e7b6(0x186)][_0x39e7b6(0x1fd)]){console[_0x39e7b6(0x1aa)](LOG_PREFIX+_0x39e7b6(0x196));return;}console['log'](LOG_PREFIX+_0x39e7b6(0x213)),await ensureReactRefreshPreamble(_0x36f620),await ensureViteClient(_0x36f620),console[_0x39e7b6(0x1aa)](LOG_PREFIX+_0x39e7b6(0x16d));}catch(_0x540603){console[_0x39e7b6(0x1e6)](LOG_PREFIX+_0x39e7b6(0x1e2),_0x540603);}}async function ensureReactRefreshPreamble(_0x50d17e){const _0x8497af=_0x146bdc;window[_0x8497af(0x1cf)]??=new Set();if(window['__enhanceReactRefreshInstalledOrigins'][_0x8497af(0x188)](_0x50d17e)){console[_0x8497af(0x1aa)](LOG_PREFIX+_0x8497af(0x19e)+_0x50d17e);return;}console[_0x8497af(0x1aa)](LOG_PREFIX+'\x20Installing\x20React\x20Refresh\x20runtime\x20from\x20'+_0x50d17e+_0x8497af(0x20f));const _0x3e4d68=await import(_0x50d17e+_0x8497af(0x214)),_0x4ea87f=_0x3e4d68&&typeof _0x3e4d68===_0x8497af(0x187)&&'default'in _0x3e4d68?_0x3e4d68['default']:_0x3e4d68;if(!isRefreshRuntime(_0x4ea87f)){console[_0x8497af(0x1e6)](LOG_PREFIX+'\x20Invalid\x20React\x20Refresh\x20runtime');return;}_0x4ea87f['injectIntoGlobalHook'](window),window['$RefreshReg$']=()=>{},window[_0x8497af(0x18f)]=()=>_0x2bd5c9=>_0x2bd5c9,window[_0x8497af(0x18d)]=!![],window[_0x8497af(0x1cf)]['add'](_0x50d17e),console[_0x8497af(0x1aa)](LOG_PREFIX+_0x8497af(0x17c)+_0x50d17e);}async function ensureViteClient(_0x44ac9f){const _0x1c7f17=_0x146bdc;window[_0x1c7f17(0x248)]??=new Set();if(window[_0x1c7f17(0x248)][_0x1c7f17(0x188)](_0x44ac9f)){console[_0x1c7f17(0x1aa)](LOG_PREFIX+_0x1c7f17(0x1cb)+_0x44ac9f);return;}console['log'](LOG_PREFIX+'\x20Loading\x20Vite\x20HMR\x20client\x20from\x20'+_0x44ac9f+_0x1c7f17(0x20f)),await import(_0x44ac9f+_0x1c7f17(0x250)),window[_0x1c7f17(0x248)][_0x1c7f17(0x1bb)](_0x44ac9f),console['log'](LOG_PREFIX+'\x20Vite\x20HMR\x20client\x20loaded\x20for\x20'+_0x44ac9f);}function isRefreshRuntime(_0x1ee225){const _0x1da44f=_0x146bdc;return typeof _0x1ee225===_0x1da44f(0x187)&&_0x1ee225!==null&&_0x1da44f(0x1e4)in _0x1ee225&&typeof _0x1ee225[_0x1da44f(0x1e4)]==='function';}var WORKER_MESSAGE_CONFIG='enhance:configure',WORKER_MESSAGE_DISABLE=_0x146bdc(0x1f8),WORKER_MESSAGE_REQUEST_CONFIG=_0x146bdc(0x1d6),LOG_PREFIX2=_0x146bdc(0x25e),registration=null,messageListener=null,currentOptions2=null,configGetter=null;async function registerServiceWorker(_0x9fb112){const _0x50433b=_0x146bdc;console[_0x50433b(0x1aa)](LOG_PREFIX2+'\x20registerServiceWorker()\x20called'),console['log'](LOG_PREFIX2+'\x20swPath:\x20'+_0x9fb112[_0x50433b(0x164)]);if(!(_0x50433b(0x1a7)in navigator)){console['warn'](LOG_PREFIX2+_0x50433b(0x21e));return;}console[_0x50433b(0x1aa)](LOG_PREFIX2+_0x50433b(0x1d4));const _0x3bd5b2=navigator[_0x50433b(0x1a7)][_0x50433b(0x1ba)];console[_0x50433b(0x1aa)](LOG_PREFIX2+_0x50433b(0x1dd),_0x3bd5b2?.[_0x50433b(0x1df)]??_0x50433b(0x257)),console[_0x50433b(0x1aa)](LOG_PREFIX2+'\x20Controller\x20state:',_0x3bd5b2?.[_0x50433b(0x1a8)]??_0x50433b(0x172));const _0x3cb6d7=!!_0x3bd5b2;currentOptions2=_0x9fb112,configGetter=()=>buildWorkerConfiguration(_0x9fb112),console[_0x50433b(0x1aa)](LOG_PREFIX2+_0x50433b(0x1b2));const _0x35f157=await detectBlockingServiceWorker(_0x9fb112[_0x50433b(0x164)]);if(_0x35f157){console[_0x50433b(0x1ee)](LOG_PREFIX2+_0x50433b(0x1ed)+_0x35f157),console['error'](LOG_PREFIX2+_0x50433b(0x204));return;}console[_0x50433b(0x1aa)](LOG_PREFIX2+_0x50433b(0x1ec));try{console[_0x50433b(0x1aa)](LOG_PREFIX2+_0x50433b(0x221)+_0x9fb112[_0x50433b(0x164)]+_0x50433b(0x265)),registration=await navigator[_0x50433b(0x1a7)]['register'](_0x9fb112[_0x50433b(0x164)],{'scope':'/'}),console[_0x50433b(0x1aa)](LOG_PREFIX2+'\x20Registration\x20returned:',{'scope':registration['scope'],'active':registration[_0x50433b(0x24a)]?.[_0x50433b(0x1df)],'waiting':registration[_0x50433b(0x215)]?.[_0x50433b(0x1df)],'installing':registration[_0x50433b(0x1ca)]?.[_0x50433b(0x1df)]}),console['log'](LOG_PREFIX2+'\x20Waiting\x20for\x20navigator.serviceWorker.ready...');const _0xc8e820=await navigator['serviceWorker'][_0x50433b(0x231)];console['log'](LOG_PREFIX2+_0x50433b(0x192),_0xc8e820[_0x50433b(0x24a)]?.[_0x50433b(0x1df)]);const _0x402dec=ownsCurrentController(_0x9fb112[_0x50433b(0x164)]);state[_0x50433b(0x24e)]=_0x402dec,console[_0x50433b(0x1aa)](LOG_PREFIX2+_0x50433b(0x1c2)+_0x402dec),console[_0x50433b(0x1aa)](LOG_PREFIX2+_0x50433b(0x1b5),navigator[_0x50433b(0x1a7)][_0x50433b(0x1ba)]?.[_0x50433b(0x1df)]??_0x50433b(0x257));if(!_0x3cb6d7&&!navigator[_0x50433b(0x1a7)][_0x50433b(0x1ba)]){console['log'](LOG_PREFIX2+_0x50433b(0x168)),window[_0x50433b(0x186)][_0x50433b(0x217)]();return;}console[_0x50433b(0x1aa)](LOG_PREFIX2+_0x50433b(0x16c)),attachMessageListener(),console['log'](LOG_PREFIX2+_0x50433b(0x1c8)),await sendConfiguration();if(state[_0x50433b(0x185)]){const _0x30582=document[_0x50433b(0x17e)](_0x50433b(0x182))!==null;console[_0x50433b(0x1aa)](LOG_PREFIX2+_0x50433b(0x264)+_0x30582);if(!_0x30582){console[_0x50433b(0x1aa)](LOG_PREFIX2+_0x50433b(0x245)),window[_0x50433b(0x186)][_0x50433b(0x217)]();return;}}console['log'](LOG_PREFIX2+_0x50433b(0x200)),updateOverlay(),console[_0x50433b(0x1aa)](LOG_PREFIX2+_0x50433b(0x246));}catch(_0xc14890){console[_0x50433b(0x1ee)](LOG_PREFIX2+_0x50433b(0x22a),_0xc14890);}}async function sendConfiguration(){const _0x24caf5=_0x146bdc;console['log'](LOG_PREFIX2+_0x24caf5(0x16f)),console[_0x24caf5(0x1aa)](LOG_PREFIX2+_0x24caf5(0x170)+state[_0x24caf5(0x185)]+_0x24caf5(0x237)+!!configGetter);if(!state[_0x24caf5(0x185)]||!configGetter){console[_0x24caf5(0x1aa)](LOG_PREFIX2+_0x24caf5(0x18a));return;}const _0x3658a6=await resolveWorker();if(!_0x3658a6){console[_0x24caf5(0x1e6)](LOG_PREFIX2+'\x20No\x20service\x20worker\x20active\x20to\x20configure');return;}const _0x18316b=configGetter();console[_0x24caf5(0x1aa)](LOG_PREFIX2+'\x20Sending\x20config\x20to\x20SW:',JSON[_0x24caf5(0x222)](_0x18316b,null,0x2)),_0x3658a6['postMessage']({'type':WORKER_MESSAGE_CONFIG,'config':_0x18316b}),console[_0x24caf5(0x1aa)](LOG_PREFIX2+'\x20Config\x20sent\x20to\x20SW');}async function unregisterServiceWorker(_0x432d55){const _0x91b9b9=_0x146bdc;console[_0x91b9b9(0x1aa)](LOG_PREFIX2+_0x91b9b9(0x266));if(!('serviceWorker'in navigator)){console[_0x91b9b9(0x1aa)](LOG_PREFIX2+'\x20No\x20serviceWorker\x20support\x20-\x20nothing\x20to\x20unregister');return;}detachMessageListener();try{const _0x19dee9=registration??await navigator[_0x91b9b9(0x1a7)]['getRegistration']('/');if(!_0x19dee9){console[_0x91b9b9(0x1aa)](LOG_PREFIX2+_0x91b9b9(0x209));return;}console[_0x91b9b9(0x1aa)](LOG_PREFIX2+_0x91b9b9(0x1c9),{'scope':_0x19dee9[_0x91b9b9(0x166)],'active':_0x19dee9['active']?.[_0x91b9b9(0x1df)],'waiting':_0x19dee9[_0x91b9b9(0x215)]?.[_0x91b9b9(0x1df)],'installing':_0x19dee9[_0x91b9b9(0x1ca)]?.[_0x91b9b9(0x1df)]});const _0x131098=[_0x19dee9[_0x91b9b9(0x24a)]?.['scriptURL'],_0x19dee9[_0x91b9b9(0x215)]?.[_0x91b9b9(0x1df)],_0x19dee9[_0x91b9b9(0x1ca)]?.[_0x91b9b9(0x1df)]],_0x9fa264=_0x131098['some'](_0x14e6d8=>_0x14e6d8&&ownsServiceWorker(_0x14e6d8,_0x432d55));if(!_0x9fa264){console[_0x91b9b9(0x1aa)](LOG_PREFIX2+'\x20Registration\x20is\x20not\x20ours\x20-\x20not\x20unregistering');return;}_0x19dee9[_0x91b9b9(0x24a)]&&(console[_0x91b9b9(0x1aa)](LOG_PREFIX2+_0x91b9b9(0x16e)),_0x19dee9[_0x91b9b9(0x24a)][_0x91b9b9(0x1be)]({'type':WORKER_MESSAGE_DISABLE})),console['log'](LOG_PREFIX2+_0x91b9b9(0x195)),await _0x19dee9[_0x91b9b9(0x218)](),registration=null,console[_0x91b9b9(0x1aa)](LOG_PREFIX2+_0x91b9b9(0x22e));}catch(_0x1bc5b4){console[_0x91b9b9(0x1ee)](LOG_PREFIX2+_0x91b9b9(0x260),_0x1bc5b4);}}function attachMessageListener(){const _0x261107=_0x146bdc;if(!navigator[_0x261107(0x1a7)]||messageListener){console[_0x261107(0x1aa)](LOG_PREFIX2+_0x261107(0x1da));return;}messageListener=_0x49a4f3=>{const _0x1b6602=_0x261107,_0x545340=_0x49a4f3[_0x1b6602(0x201)];console['log'](LOG_PREFIX2+'\x20Received\x20message\x20from\x20SW:',_0x545340);if(!_0x545340||typeof _0x545340!=='object')return;_0x545340['type']===WORKER_MESSAGE_REQUEST_CONFIG&&(console[_0x1b6602(0x1aa)](LOG_PREFIX2+'\x20SW\x20requested\x20config\x20-\x20sending...'),void sendConfiguration());},navigator[_0x261107(0x1a7)][_0x261107(0x258)]('message',messageListener),console[_0x261107(0x1aa)](LOG_PREFIX2+'\x20Message\x20listener\x20attached');}function detachMessageListener(){const _0x573bf4=_0x146bdc;navigator['serviceWorker']&&messageListener&&(navigator[_0x573bf4(0x1a7)][_0x573bf4(0x24b)](_0x573bf4(0x1c3),messageListener),messageListener=null,console[_0x573bf4(0x1aa)](LOG_PREFIX2+'\x20Message\x20listener\x20detached'));}function ownsServiceWorker(_0xec49ab,_0x2091ea){const _0x36f63e=_0x146bdc,_0x2a91ae=typeof window!==_0x36f63e(0x1f2)?window[_0x36f63e(0x186)][_0x36f63e(0x1fd)]:'',_0x182c61=new URL(_0x2091ea,_0x2a91ae||void 0x0)[_0x36f63e(0x21f)],_0x1e2b6d=_0xec49ab===_0x182c61||_0xec49ab[_0x36f63e(0x1b0)](_0x36f63e(0x25d));return console[_0x36f63e(0x1aa)](LOG_PREFIX2+'\x20ownsServiceWorker?\x20scriptURL='+_0xec49ab+',\x20expected='+_0x182c61+_0x36f63e(0x1ff)+_0x1e2b6d),_0x1e2b6d;}function ownsCurrentController(_0xb52035){const _0x5196ea=_0x146bdc;if(typeof navigator==='undefined')return![];const _0x2f1fc6=navigator[_0x5196ea(0x1a7)]?.[_0x5196ea(0x1ba)];if(!_0x2f1fc6)return console[_0x5196ea(0x1aa)](LOG_PREFIX2+_0x5196ea(0x251)),![];return ownsServiceWorker(_0x2f1fc6[_0x5196ea(0x1df)],_0xb52035);}async function detectBlockingServiceWorker(_0xbccda1){const _0x2a6d65=_0x146bdc;if(!navigator[_0x2a6d65(0x1a7)])return null;try{const _0x25cbc5=await navigator[_0x2a6d65(0x1a7)][_0x2a6d65(0x236)]('/');console[_0x2a6d65(0x1aa)](LOG_PREFIX2+_0x2a6d65(0x224),_0x25cbc5?.[_0x2a6d65(0x24a)]?.['scriptURL']??_0x2a6d65(0x257));const _0x413910=_0x25cbc5?.[_0x2a6d65(0x24a)]?.['scriptURL'];if(!_0x413910)return null;if(ownsServiceWorker(_0x413910,_0xbccda1))return null;return _0x413910;}catch(_0xff67a9){return console[_0x2a6d65(0x1ee)](LOG_PREFIX2+_0x2a6d65(0x22d),_0xff67a9),null;}}async function resolveWorker(){const _0x512667=_0x146bdc,_0x1db6fa=registration??await navigator['serviceWorker']?.[_0x512667(0x236)]('/'),_0x4206cb=_0x1db6fa?.[_0x512667(0x24a)]??_0x1db6fa?.[_0x512667(0x215)]??_0x1db6fa?.[_0x512667(0x1ca)]??null;return console[_0x512667(0x1aa)](LOG_PREFIX2+_0x512667(0x180),_0x4206cb?.[_0x512667(0x1df)]??_0x512667(0x257),_0x512667(0x1cd)+(_0x4206cb?.[_0x512667(0x1a8)]??_0x512667(0x172))),_0x4206cb;}function buildWorkerConfiguration(_0x15f8ac){const _0x2c9eec=_0x146bdc,_0x988472=getEnhancementUrl();return console[_0x2c9eec(0x1aa)](LOG_PREFIX2+_0x2c9eec(0x233)+_0x988472),{'enhancementUrl':_0x988472,'callbackBypass':_0x15f8ac[_0x2c9eec(0x261)],'overlayPath':_0x15f8ac[_0x2c9eec(0x1ac)],'overlayEnableViteHmr':_0x15f8ac[_0x2c9eec(0x205)][_0x2c9eec(0x253)],'runtimeScriptPath':_0x15f8ac[_0x2c9eec(0x179)],'swPath':_0x15f8ac['swPath'],'securityMode':_0x15f8ac[_0x2c9eec(0x190)],'backendUrl':_0x15f8ac[_0x2c9eec(0x1a3)]};}var LOG_PREFIX3='[Enhance\x20Runtime]',initialized=![],options=null,Enhance={'init'(_0x6c2f83){const _0x42d9ee=_0x146bdc,_0x1863a0=Date['now']();console[_0x42d9ee(0x1aa)](LOG_PREFIX3+'\x20init()\x20called\x20at\x20'+_0x1863a0),console[_0x42d9ee(0x1aa)](LOG_PREFIX3+_0x42d9ee(0x174)+window['location'][_0x42d9ee(0x21f)]),console['log'](LOG_PREFIX3+_0x42d9ee(0x173)+document[_0x42d9ee(0x1a2)]),console[_0x42d9ee(0x1aa)](LOG_PREFIX3+'\x20Raw\x20options:',JSON[_0x42d9ee(0x222)](_0x6c2f83,null,0x2));if(initialized)return console[_0x42d9ee(0x1e6)](LOG_PREFIX3+_0x42d9ee(0x194)),createController();initialized=!![],console[_0x42d9ee(0x1aa)](LOG_PREFIX3+_0x42d9ee(0x24c)),options=normalizeOptions(_0x6c2f83),console[_0x42d9ee(0x1aa)](LOG_PREFIX3+_0x42d9ee(0x17d),JSON['stringify'](options,null,0x2));const _0x567bbd=parseUrlParams();console[_0x42d9ee(0x1aa)](LOG_PREFIX3+_0x42d9ee(0x232),JSON[_0x42d9ee(0x222)](_0x567bbd,null,0x2));if(_0x567bbd['explicitDisable'])return cleanUrlParam(_0x42d9ee(0x17b)),console['log'](LOG_PREFIX3+_0x42d9ee(0x21c)),createController();if(_0x567bbd[_0x42d9ee(0x177)])return console['log'](LOG_PREFIX3+_0x42d9ee(0x1b8)),console[_0x42d9ee(0x1aa)](LOG_PREFIX3+_0x42d9ee(0x18b)+_0x567bbd[_0x42d9ee(0x1e0)]),console[_0x42d9ee(0x1aa)](LOG_PREFIX3+_0x42d9ee(0x1a0)+_0x567bbd[_0x42d9ee(0x1fc)]),state['enabled']=!![],console[_0x42d9ee(0x1aa)](LOG_PREFIX3+_0x42d9ee(0x21d)),void loadOverlay({'overlayPath':options[_0x42d9ee(0x1ac)],'enableViteHmr':options[_0x42d9ee(0x205)]['enableViteHmr'],'options':options,'onToggle':handleToggle}),console[_0x42d9ee(0x1aa)](LOG_PREFIX3+_0x42d9ee(0x227)),void registerServiceWorker(options),console[_0x42d9ee(0x1aa)](LOG_PREFIX3+_0x42d9ee(0x19c)),createController();return console[_0x42d9ee(0x1aa)](LOG_PREFIX3+'\x20Normal\x20mode\x20-\x20no\x20enhancement\x20params'),console[_0x42d9ee(0x1aa)](LOG_PREFIX3+_0x42d9ee(0x21a)),void unregisterServiceWorker(options[_0x42d9ee(0x164)]),console[_0x42d9ee(0x1aa)](LOG_PREFIX3+_0x42d9ee(0x235)),createController();}};function createController(){return{'enable'(){const _0xee9c59=_0x375c;if(!options)return;state['enabled']=!![],void loadOverlay({'overlayPath':options[_0xee9c59(0x1ac)],'enableViteHmr':options['overlay'][_0xee9c59(0x253)],'options':options,'onToggle':handleToggle}),void registerServiceWorker(options),void sendConfiguration(),updateOverlay();},'disable'(){const _0xce9f=_0x375c;if(!options)return;state['enabled']=![],state[_0xce9f(0x24e)]=![],updateOverlay(),void unregisterServiceWorker(options[_0xce9f(0x164)]);},'status'(){const _0x197a4b=_0x375c;return{'enabled':state[_0x197a4b(0x185)],'controlled':state['controlled']};}};}function handleToggle(){const _0x436f14=_0x146bdc,_0x567472=createController();state[_0x436f14(0x185)]?_0x567472[_0x436f14(0x18e)]():_0x567472[_0x436f14(0x254)]();}function _0x375c(_0x4a8986,_0x1e811d){const _0x9fdd80=_0x9fdd();return _0x375c=function(_0x375c59,_0xd4ae91){_0x375c59=_0x375c59-0x164;let _0x32f9e2=_0x9fdd80[_0x375c59];return _0x32f9e2;},_0x375c(_0x4a8986,_0x1e811d);}function parseUrlParams(){const _0x21a435=_0x146bdc,_0x431e6e=new URL(window[_0x21a435(0x186)]['href']),_0x58781a=_0x431e6e['searchParams']['get'](_0x21a435(0x17b))?.[_0x21a435(0x25a)](),_0x228eb5=_0x431e6e['searchParams'][_0x21a435(0x211)](_0x21a435(0x1e0)),_0x2ebae3=_0x431e6e[_0x21a435(0x226)]['get'](_0x21a435(0x238));return{'hasEnhancement':Boolean(_0x228eb5||_0x2ebae3),'explicitDisable':_0x58781a==='0'||_0x58781a==='false'||_0x58781a===_0x21a435(0x229),'enhancementUrl':_0x228eb5,'enhancementId':_0x2ebae3};}function cleanUrlParam(_0x304556){const _0x3e247b=_0x146bdc,_0x5806d7=new URL(window[_0x3e247b(0x186)][_0x3e247b(0x21f)]);_0x5806d7[_0x3e247b(0x226)][_0x3e247b(0x188)](_0x304556)&&(_0x5806d7[_0x3e247b(0x226)][_0x3e247b(0x1e1)](_0x304556),window['history'][_0x3e247b(0x206)](null,document['title'],_0x5806d7[_0x3e247b(0x20a)]()));}var package_default={'name':_0x146bdc(0x1f0),'version':_0x146bdc(0x1c4),'type':_0x146bdc(0x1b6),'description':_0x146bdc(0x1e5),'license':_0x146bdc(0x1f1),'main':_0x146bdc(0x223),'module':_0x146bdc(0x252),'types':'./dist/index.d.ts','exports':{'.':{'types':_0x146bdc(0x199),'import':_0x146bdc(0x252),'require':_0x146bdc(0x223)},'./vite':{'types':_0x146bdc(0x21b),'import':'./dist/vite/index.js'}},'files':[_0x146bdc(0x19a),_0x146bdc(0x1e9),_0x146bdc(0x24f)],'bin':{'enhance-sandbox':_0x146bdc(0x19b)},'scripts':{'typecheck':'tsc\x20--noEmit','dev':_0x146bdc(0x20b),'dev:staging':_0x146bdc(0x1fe),'build':_0x146bdc(0x239),'build:release':_0x146bdc(0x167),'version':'pnpm\x20version\x20patch\x20--no-git-tag-version'},'dependencies':{'commander':'^11.1.0','zod':_0x146bdc(0x181)},'devDependencies':{'@types/node':_0x146bdc(0x25c),'javascript-obfuscator':_0x146bdc(0x228),'tsup':_0x146bdc(0x20c),'vite':_0x146bdc(0x1ea)},'publishConfig':{'access':_0x146bdc(0x17a)}},DEFAULT_SERVICE_WORKER_PATH=_0x146bdc(0x16a),DEFAULT_RUNTIME_PATH='/assets/enhance-runtime.js',DIST_SERVICE_WORKER_PATH=_0x146bdc(0x1b9),DIST_RUNTIME_PATH=_0x146bdc(0x1c5),PACKAGE_VERSION=typeof package_default[_0x146bdc(0x197)]===_0x146bdc(0x25f)?package_default[_0x146bdc(0x197)]:_0x146bdc(0x1bd);function normalizeAssetPath(_0x18f25a){const _0x436171=_0x146bdc;if(!_0x18f25a)return _0x18f25a;if(_0x18f25a['startsWith'](_0x436171(0x193))||_0x18f25a[_0x436171(0x1d8)](_0x436171(0x220)))return _0x18f25a;const _0xb7cb82=_0x18f25a[_0x436171(0x262)](/^\.\//,'');return _0xb7cb82[_0x436171(0x1d8)]('/')?_0xb7cb82:'/'+_0xb7cb82;}var defaultSwPath=normalizeAssetPath(DEFAULT_SERVICE_WORKER_PATH),defaultRuntimePath=normalizeAssetPath(DEFAULT_RUNTIME_PATH),Enhance2={'init'(_0x58abdb){const _0x103b79=_0x146bdc;return Enhance[_0x103b79(0x22f)](_0x58abdb);},'serviceWorkerURL'(){return defaultSwPath;},'runtimeURL'(){return defaultRuntimePath;},'assetManifest'(){return getAssetManifest();}};function getAssetManifest(){return{'version':PACKAGE_VERSION,'serviceWorker':serviceWorkerURL(),'runtime':runtimeURL(),'serviceWorkerDigest':null,'runtimeDigest':null};}function serviceWorkerURL(){const _0x3e382f=_0x146bdc;return Enhance2[_0x3e382f(0x212)]();}function runtimeURL(){const _0x4f3555=_0x146bdc;return Enhance2[_0x4f3555(0x234)]();}import{promises as _0x24f58a}from'fs';import{createHash}from'crypto';import{dirname,join}from'path';import{fileURLToPath}from'url';var distDir=dirname(fileURLToPath(new URL(_0x146bdc(0x17f),import.meta['url'])));async function syncAssets(_0x32359a){const _0x1c8603=_0x146bdc,_0x48fca7=[{'sourcePath':DIST_SERVICE_WORKER_PATH,'manifestPath':normalizeAssetPath(DEFAULT_SERVICE_WORKER_PATH),'override':_0x32359a[_0x1c8603(0x202)]?'./'+_0x32359a[_0x1c8603(0x202)]:void 0x0},{'sourcePath':DIST_RUNTIME_PATH,'manifestPath':normalizeAssetPath(DEFAULT_RUNTIME_PATH)}],_0x2b2164=[];for(const _0x2b80b7 of _0x48fca7){const _0x4b2896=cleanRelativePath(_0x2b80b7[_0x1c8603(0x1d3)]??_0x2b80b7[_0x1c8603(0x19f)]),_0x5c96a6=join(distDir,cleanRelativePath(_0x2b80b7[_0x1c8603(0x1d2)])),_0x38a9b8=join(_0x32359a[_0x1c8603(0x216)],_0x4b2896),[_0x4f19a9,_0x47a4cb]=await Promise[_0x1c8603(0x20e)]([readDigest(_0x5c96a6),readDigest(_0x38a9b8)]);if(_0x4f19a9&&_0x47a4cb&&_0x4f19a9===_0x47a4cb){_0x2b2164['push']({'sourcePath':_0x5c96a6,'destinationPath':_0x38a9b8,'relativeDestination':_0x4b2896,'status':_0x1c8603(0x1b4)});continue;}await _0x24f58a['mkdir'](dirname(_0x38a9b8),{'recursive':!![]}),await _0x24f58a[_0x1c8603(0x1f7)](_0x5c96a6,_0x38a9b8),_0x2b2164[_0x1c8603(0x1c1)]({'sourcePath':_0x5c96a6,'destinationPath':_0x38a9b8,'relativeDestination':_0x4b2896,'status':_0x1c8603(0x1b3)});}return _0x2b2164;}function cleanRelativePath(_0x4316fb){return _0x4316fb['replace'](/^[./]+/,'');}async function readDigest(_0x1c88c4){const _0x2cac38=_0x146bdc;try{const _0x25564=await _0x24f58a['readFile'](_0x1c88c4);return createHash(_0x2cac38(0x176))[_0x2cac38(0x165)](_0x25564)['digest']('base64');}catch(_0xd65dbf){if(_0xd65dbf[_0x2cac38(0x1db)]===_0x2cac38(0x263))return null;throw _0xd65dbf;}}var program=new Command();program[_0x146bdc(0x1f4)](_0x146bdc(0x230))[_0x146bdc(0x1d1)]('Enhance\x20sandbox\x20utility\x20CLI')[_0x146bdc(0x197)]('0.0.0'),program[_0x146bdc(0x219)](_0x146bdc(0x1ef))['description'](_0x146bdc(0x249))[_0x146bdc(0x1c6)](()=>{const _0x5d752e=_0x146bdc,_0x533200=getAssetManifest();process[_0x5d752e(0x23f)][_0x5d752e(0x23c)](JSON['stringify'](_0x533200,null,0x2)+'\x0a');}),program[_0x146bdc(0x219)]('prepare-sw')[_0x146bdc(0x1d1)](_0x146bdc(0x1d7))[_0x146bdc(0x1f3)]('--public-dir\x20<path>',_0x146bdc(0x1e8))[_0x146bdc(0x203)](_0x146bdc(0x22c),_0x146bdc(0x1e3))[_0x146bdc(0x1c6)](async _0x4202c8=>{const _0x3d6fa8=_0x146bdc,_0x5966db=resolve(process[_0x3d6fa8(0x243)](),_0x4202c8['publicDir']),_0x391a55=await syncAssets({'publicDir':_0x5966db,'swFilename':_0x4202c8[_0x3d6fa8(0x242)]});for(const _0x5248ea of _0x391a55){const _0x401505=relative(process['cwd'](),_0x5248ea[_0x3d6fa8(0x1f5)]);_0x5248ea[_0x3d6fa8(0x1b7)]==='skipped'?process[_0x3d6fa8(0x23f)][_0x3d6fa8(0x23c)](_0x3d6fa8(0x198)+_0x5248ea['relativeDestination']+_0x3d6fa8(0x1a1)+_0x401505+']\x0a'):process[_0x3d6fa8(0x23f)][_0x3d6fa8(0x23c)](_0x3d6fa8(0x1c0)+_0x5248ea[_0x3d6fa8(0x1cc)]+_0x3d6fa8(0x171)+_0x401505+'\x0a');}}),program[_0x146bdc(0x1e7)]();
package/dist/index.d.ts CHANGED
@@ -1,105 +1,56 @@
1
- import { z } from 'zod';
2
-
3
- interface WorkerHmrConfiguration {
4
- protocols?: string[];
5
- pathHints?: string[];
6
- }
7
-
8
- declare const optionsSchema: z.ZodObject<{
9
- sandboxBaseURL: z.ZodOptional<z.ZodString>;
10
- callbackBypass: z.ZodArray<z.ZodString, "many">;
11
- assetHosts: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
12
- overlay: z.ZodOptional<z.ZodObject<{
13
- enabled: z.ZodOptional<z.ZodBoolean>;
14
- position: z.ZodOptional<z.ZodEnum<["top-left", "top-right", "bottom-left", "bottom-right"]>>;
15
- enableViteHmr: z.ZodOptional<z.ZodBoolean>;
16
- }, "strip", z.ZodTypeAny, {
17
- enabled?: boolean | undefined;
18
- position?: "top-left" | "top-right" | "bottom-left" | "bottom-right" | undefined;
19
- enableViteHmr?: boolean | undefined;
20
- }, {
21
- enabled?: boolean | undefined;
22
- position?: "top-left" | "top-right" | "bottom-left" | "bottom-right" | undefined;
23
- enableViteHmr?: boolean | undefined;
24
- }>>;
25
- hmr: z.ZodOptional<z.ZodObject<{
26
- protocols: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
27
- pathHints: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
28
- }, "strip", z.ZodTypeAny, {
29
- protocols?: string[] | undefined;
30
- pathHints?: string[] | undefined;
31
- }, {
32
- protocols?: string[] | undefined;
33
- pathHints?: string[] | undefined;
34
- }>>;
35
- logLevel: z.ZodOptional<z.ZodEnum<["silent", "info", "debug"]>>;
36
- swPath: z.ZodOptional<z.ZodString>;
37
- overlayPath: z.ZodOptional<z.ZodString>;
38
- runtimeScriptPath: z.ZodOptional<z.ZodString>;
39
- storageKeysOverride: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
40
- security: z.ZodOptional<z.ZodEnum<["permissive", "custom"]>>;
41
- }, "strip", z.ZodTypeAny, {
1
+ type RawOptions = {
42
2
  callbackBypass: string[];
43
- sandboxBaseURL?: string | undefined;
44
- assetHosts?: string[] | undefined;
45
- overlay?: {
46
- enabled?: boolean | undefined;
47
- position?: "top-left" | "top-right" | "bottom-left" | "bottom-right" | undefined;
48
- enableViteHmr?: boolean | undefined;
49
- } | undefined;
50
- hmr?: {
51
- protocols?: string[] | undefined;
52
- pathHints?: string[] | undefined;
53
- } | undefined;
54
- logLevel?: "silent" | "info" | "debug" | undefined;
55
- swPath?: string | undefined;
56
- overlayPath?: string | undefined;
57
- runtimeScriptPath?: string | undefined;
58
- storageKeysOverride?: Record<string, string> | undefined;
59
- security?: "custom" | "permissive" | undefined;
60
- }, {
61
- callbackBypass: string[];
62
- sandboxBaseURL?: string | undefined;
63
- assetHosts?: string[] | undefined;
64
- overlay?: {
65
- enabled?: boolean | undefined;
66
- position?: "top-left" | "top-right" | "bottom-left" | "bottom-right" | undefined;
67
- enableViteHmr?: boolean | undefined;
68
- } | undefined;
69
- hmr?: {
70
- protocols?: string[] | undefined;
71
- pathHints?: string[] | undefined;
72
- } | undefined;
73
- logLevel?: "silent" | "info" | "debug" | undefined;
74
- swPath?: string | undefined;
75
- overlayPath?: string | undefined;
76
- runtimeScriptPath?: string | undefined;
77
- storageKeysOverride?: Record<string, string> | undefined;
78
- security?: "custom" | "permissive" | undefined;
79
- }>;
80
- type RawOptions = z.input<typeof optionsSchema>;
81
- declare global {
82
- interface Window {
83
- __enhanceSandboxHmr?: WorkerHmrConfiguration | (() => WorkerHmrConfiguration | undefined);
84
- }
85
- }
3
+ __development?: {
4
+ enableOverlayHmr?: boolean;
5
+ overlayPath?: string;
6
+ security?: 'permissive' | 'custom';
7
+ backendUrl?: string;
8
+ };
9
+ };
86
10
 
87
- interface EnhanceInitOptions extends RawOptions {
11
+ type OverlayPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
12
+ type SecurityMode = 'permissive' | 'custom';
13
+ interface OverlayState {
14
+ enhancementUrl: string;
15
+ enabled: boolean;
16
+ controlled: boolean;
17
+ overlayPosition: OverlayPosition;
18
+ securityMode: SecurityMode;
19
+ backendBaseUrl?: string;
20
+ }
21
+ interface OverlayController {
22
+ update(state: OverlayState): void;
23
+ onToggle(handler: () => void): void;
24
+ destroy(): void;
88
25
  }
89
26
  interface EnhanceStatus {
90
27
  enabled: boolean;
91
28
  controlled: boolean;
92
- version: string;
93
- sandboxHits: number;
94
- sandboxFallbacks: number;
95
29
  }
96
30
  interface EnhanceController {
97
- enable(token?: string): void;
31
+ enable(): void;
98
32
  disable(): void;
99
33
  status(): EnhanceStatus;
100
34
  }
35
+ declare global {
36
+ interface Window {
37
+ __enhanceOverlay?: OverlayController;
38
+ __viteHMRLoaded?: Set<string>;
39
+ __enhanceReactRefreshInstalledOrigins?: Set<string>;
40
+ __vite_plugin_react_preamble_installed__?: boolean;
41
+ $RefreshReg$?: (type: unknown, id?: string) => void;
42
+ $RefreshSig$?: () => (type: unknown) => unknown;
43
+ enhancePreview?: EnhanceController;
44
+ }
45
+ }
46
+
47
+ /**
48
+ * Main entry point - the only public API.
49
+ */
50
+ declare const Enhance$1: {
51
+ init(rawOptions: RawOptions): EnhanceController;
52
+ };
101
53
 
102
- type EnhanceOptions = EnhanceInitOptions;
103
54
  interface EnhanceAssetManifest {
104
55
  serviceWorker: string;
105
56
  runtime: string;
@@ -108,7 +59,7 @@ interface EnhanceAssetManifest {
108
59
  runtimeDigest: string | null;
109
60
  }
110
61
  declare const Enhance: {
111
- init(options: EnhanceInitOptions): EnhanceController;
62
+ init(options: Parameters<typeof Enhance$1.init>[0]): EnhanceController;
112
63
  serviceWorkerURL(): string;
113
64
  runtimeURL(): string;
114
65
  assetManifest(): EnhanceAssetManifest;
@@ -118,4 +69,4 @@ declare function resolveServiceWorkerPath(): string;
118
69
  declare function serviceWorkerURL(): string;
119
70
  declare function runtimeURL(): string;
120
71
 
121
- export { Enhance, type EnhanceAssetManifest, type EnhanceController, type EnhanceOptions, type EnhanceStatus, getAssetManifest, resolveServiceWorkerPath, runtimeURL, serviceWorkerURL };
72
+ export { Enhance, type EnhanceAssetManifest, type EnhanceController, type RawOptions as EnhanceOptions, type EnhanceStatus, getAssetManifest, resolveServiceWorkerPath, runtimeURL, serviceWorkerURL };