@enhance-eng/sandbox 0.3.10 → 0.3.17-dev.7469ea2

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 _0x1cff22=_0x2488;(function(_0x173588,_0x3e5202){const _0x1a222b=_0x2488,_0xe2401d=_0x173588();while(!![]){try{const _0x1421f5=-parseInt(_0x1a222b(0x1fa))/0x1*(parseInt(_0x1a222b(0x1e3))/0x2)+parseInt(_0x1a222b(0x20f))/0x3*(parseInt(_0x1a222b(0x1bc))/0x4)+parseInt(_0x1a222b(0x1b4))/0x5*(-parseInt(_0x1a222b(0x193))/0x6)+parseInt(_0x1a222b(0x143))/0x7*(-parseInt(_0x1a222b(0x1b7))/0x8)+-parseInt(_0x1a222b(0x131))/0x9+-parseInt(_0x1a222b(0x1b8))/0xa*(parseInt(_0x1a222b(0x216))/0xb)+parseInt(_0x1a222b(0x180))/0xc*(parseInt(_0x1a222b(0x128))/0xd);if(_0x1421f5===_0x3e5202)break;else _0xe2401d['push'](_0xe2401d['shift']());}catch(_0x1d8326){_0xe2401d['push'](_0xe2401d['shift']());}}}(_0x34e8,0x80b8f));import{Command}from'commander';import{resolve,relative}from'path';var DEFAULT_OVERLAY_PATH=typeof __ENHANCE_DEFAULT_OVERLAY_PATH__!==_0x1cff22(0x1d7)?__ENHANCE_DEFAULT_OVERLAY_PATH__:_0x1cff22(0x1a9),DEFAULT_BACKEND_URL=typeof __ENHANCE_DEFAULT_BACKEND_URL__!=='undefined'?__ENHANCE_DEFAULT_BACKEND_URL__:_0x1cff22(0x1b3),DEFAULT_OVERLAY_HMR=typeof __ENHANCE_OVERLAY_ENABLE_HMR__!==_0x1cff22(0x1d7)?__ENHANCE_OVERLAY_ENABLE_HMR__:![];console[_0x1cff22(0x214)]('[Enhance\x20Config]\x20Build-time\x20defaults:',{'overlayPath':DEFAULT_OVERLAY_PATH,'backendUrl':DEFAULT_BACKEND_URL,'overlayHmr':DEFAULT_OVERLAY_HMR});function normalizeOptions(_0xa824e4){const _0x14d9c5=_0x1cff22,_0x428757=_0xa824e4[_0x14d9c5(0x1b1)]??{};return{'callbackBypass':_0xa824e4[_0x14d9c5(0x168)]??[],'overlay':{'enabled':!![],'position':'bottom-right','enableViteHmr':_0x428757[_0x14d9c5(0x217)]??DEFAULT_OVERLAY_HMR},'logLevel':'info','swPath':'/sw-enhance.js','overlayPath':_0x428757[_0x14d9c5(0x215)]??DEFAULT_OVERLAY_PATH,'runtimeScriptPath':'/assets/enhance-runtime.js','security':_0x428757['security']??_0x14d9c5(0x1e6),'backendUrl':_0x428757['backendUrl']??DEFAULT_BACKEND_URL};}var state={'enabled':![],'controlled':![],'appError':null};function getEnhancementUrl(){const _0x4a3802=_0x1cff22;try{const _0xb990dc=new URLSearchParams(window[_0x4a3802(0x1bb)]['search']);return _0xb990dc[_0x4a3802(0x1ff)](_0x4a3802(0x13b))?.[_0x4a3802(0x186)]()||'';}catch{return'';}}var LOG_PREFIX=_0x1cff22(0x1c7),overlayController=null,overlayLoadPromise=null,toggleHandler=null,currentOptions=null;async function loadOverlay(_0xaa8c1){const _0x1ce702=_0x1cff22;console[_0x1ce702(0x214)](LOG_PREFIX+_0x1ce702(0x1f5)),console[_0x1ce702(0x214)](LOG_PREFIX+_0x1ce702(0x130)+_0xaa8c1[_0x1ce702(0x215)]),console[_0x1ce702(0x214)](LOG_PREFIX+_0x1ce702(0x12a)+_0xaa8c1[_0x1ce702(0x1f7)]),currentOptions=_0xaa8c1[_0x1ce702(0x1cb)],toggleHandler=_0xaa8c1['onToggle'];if(overlayController){console[_0x1ce702(0x214)](LOG_PREFIX+'\x20Controller\x20already\x20exists\x20-\x20updating\x20overlay'),updateOverlay();return;}if(overlayLoadPromise)return console['log'](LOG_PREFIX+_0x1ce702(0x19f)),overlayLoadPromise;console[_0x1ce702(0x214)](LOG_PREFIX+_0x1ce702(0x1f3)),overlayLoadPromise=doLoadOverlay(_0xaa8c1);try{await overlayLoadPromise,console[_0x1ce702(0x214)](LOG_PREFIX+_0x1ce702(0x21f));}catch(_0x119194){console['error'](LOG_PREFIX+_0x1ce702(0x1b9),_0x119194);}finally{overlayLoadPromise=null;}}async function doLoadOverlay(_0x3a4f69){const _0x40cab7=_0x1cff22;console[_0x40cab7(0x214)](LOG_PREFIX+_0x40cab7(0x1ab));if(typeof window===_0x40cab7(0x1d7)){console[_0x40cab7(0x214)](LOG_PREFIX+_0x40cab7(0x17d));return;}if(window[_0x40cab7(0x1a3)]){console[_0x40cab7(0x214)](LOG_PREFIX+_0x40cab7(0x13d)),overlayController=window['__enhanceOverlay'];return;}console[_0x40cab7(0x214)](LOG_PREFIX+_0x40cab7(0x1f9));try{_0x3a4f69[_0x40cab7(0x1f7)]&&(console[_0x40cab7(0x214)](LOG_PREFIX+_0x40cab7(0x176)),await setupRemoteHMR(_0x3a4f69[_0x40cab7(0x215)]));console[_0x40cab7(0x214)](LOG_PREFIX+'\x20Importing\x20overlay\x20module\x20from:\x20'+_0x3a4f69[_0x40cab7(0x215)]);const _0x11fd44=Date['now'](),_0x29d818=await import(_0x3a4f69[_0x40cab7(0x215)]);console[_0x40cab7(0x214)](LOG_PREFIX+_0x40cab7(0x173)+(Date[_0x40cab7(0x17f)]()-_0x11fd44)+'ms'),console[_0x40cab7(0x214)](LOG_PREFIX+_0x40cab7(0x16c),Object[_0x40cab7(0x139)](_0x29d818));if(typeof _0x29d818?.[_0x40cab7(0x15c)]!==_0x40cab7(0x1c4)){console[_0x40cab7(0x1eb)](LOG_PREFIX+_0x40cab7(0x189)),console[_0x40cab7(0x1eb)](LOG_PREFIX+_0x40cab7(0x1a8),Object[_0x40cab7(0x139)](_0x29d818));return;}console[_0x40cab7(0x214)](LOG_PREFIX+_0x40cab7(0x19e));const _0x13d096=_0x29d818['createOverlay']();console[_0x40cab7(0x214)](LOG_PREFIX+_0x40cab7(0x13c),_0x13d096),overlayController=_0x13d096,window[_0x40cab7(0x1a3)]=_0x13d096,_0x13d096['onToggle'](_0x3a4f69[_0x40cab7(0x1fc)]),console[_0x40cab7(0x214)](LOG_PREFIX+_0x40cab7(0x1c3)),console[_0x40cab7(0x214)](LOG_PREFIX+_0x40cab7(0x1ac)),updateOverlay();}catch(_0x5b730d){console[_0x40cab7(0x1eb)](LOG_PREFIX+_0x40cab7(0x179),_0x5b730d);}}function updateOverlay(){const _0x1d7303=_0x1cff22;console[_0x1d7303(0x214)](LOG_PREFIX+'\x20updateOverlay()\x20called'),console[_0x1d7303(0x214)](LOG_PREFIX+_0x1d7303(0x206)+!!overlayController),console[_0x1d7303(0x214)](LOG_PREFIX+_0x1d7303(0x1cf)+!!currentOptions);if(!overlayController||!currentOptions){console[_0x1d7303(0x214)](LOG_PREFIX+'\x20Missing\x20controller\x20or\x20options\x20-\x20skipping\x20update');return;}const _0x24fd63=composeOverlayState(currentOptions);console[_0x1d7303(0x214)](LOG_PREFIX+'\x20Updating\x20overlay\x20with\x20state:',JSON[_0x1d7303(0x175)](_0x24fd63,null,0x2)),overlayController['update'](_0x24fd63),console['log'](LOG_PREFIX+'\x20Overlay\x20update\x20complete');}function composeOverlayState(_0x181c94){const _0x2895a4=_0x1cff22,_0x50c61e=getEnhancementUrl();return console[_0x2895a4(0x214)](LOG_PREFIX+_0x2895a4(0x17e)+_0x50c61e),console[_0x2895a4(0x214)](LOG_PREFIX+_0x2895a4(0x156)+state[_0x2895a4(0x200)]),console[_0x2895a4(0x214)](LOG_PREFIX+_0x2895a4(0x221)+state['controlled']),{'enhancementUrl':_0x50c61e,'enabled':state[_0x2895a4(0x200)],'controlled':state[_0x2895a4(0x138)],'overlayPosition':_0x181c94[_0x2895a4(0x133)][_0x2895a4(0x1dc)],'securityMode':_0x181c94['security'],'backendBaseUrl':_0x181c94[_0x2895a4(0x172)],'appError':state['appError']};}async function setupRemoteHMR(_0x4a830b){const _0xed8f92=_0x1cff22;console[_0xed8f92(0x214)](LOG_PREFIX+_0xed8f92(0x1a6)+_0x4a830b);if(typeof window===_0xed8f92(0x1d7))return;try{const _0x5c9af0=new URL(_0x4a830b,window[_0xed8f92(0x1bb)][_0xed8f92(0x1d9)]),_0x1d6008=_0x5c9af0[_0xed8f92(0x1d9)];console[_0xed8f92(0x214)](LOG_PREFIX+_0xed8f92(0x147)+_0x1d6008+_0xed8f92(0x20b)+window[_0xed8f92(0x1bb)]['origin']);if(_0x1d6008===window[_0xed8f92(0x1bb)][_0xed8f92(0x1d9)]){console['log'](LOG_PREFIX+_0xed8f92(0x174));return;}console[_0xed8f92(0x214)](LOG_PREFIX+_0xed8f92(0x191)),await ensureReactRefreshPreamble(_0x1d6008),await ensureViteClient(_0x1d6008),console['log'](LOG_PREFIX+'\x20HMR\x20setup\x20complete');}catch(_0x48e685){console[_0xed8f92(0x202)](LOG_PREFIX+_0xed8f92(0x148),_0x48e685);}}async function ensureReactRefreshPreamble(_0x3b07be){const _0x1250d6=_0x1cff22;window[_0x1250d6(0x14b)]??=new Set();if(window[_0x1250d6(0x14b)][_0x1250d6(0x1ba)](_0x3b07be)){console['log'](LOG_PREFIX+_0x1250d6(0x1bf)+_0x3b07be);return;}console[_0x1250d6(0x214)](LOG_PREFIX+_0x1250d6(0x192)+_0x3b07be+_0x1250d6(0x166));const _0xbd938d=await import(_0x3b07be+'/@react-refresh'),_0x4e3956=_0xbd938d&&typeof _0xbd938d==='object'&&_0x1250d6(0x1c6)in _0xbd938d?_0xbd938d[_0x1250d6(0x1c6)]:_0xbd938d;if(!isRefreshRuntime(_0x4e3956)){console[_0x1250d6(0x202)](LOG_PREFIX+_0x1250d6(0x224));return;}_0x4e3956[_0x1250d6(0x1c1)](window),window[_0x1250d6(0x127)]=()=>{},window[_0x1250d6(0x12b)]=()=>_0x3ddce2=>_0x3ddce2,window['__vite_plugin_react_preamble_installed__']=!![],window['__enhanceReactRefreshInstalledOrigins']['add'](_0x3b07be),console['log'](LOG_PREFIX+_0x1250d6(0x207)+_0x3b07be);}async function ensureViteClient(_0x2ac89){const _0x517fb1=_0x1cff22;window[_0x517fb1(0x1f1)]??=new Set();if(window['__viteHMRLoaded'][_0x517fb1(0x1ba)](_0x2ac89)){console['log'](LOG_PREFIX+_0x517fb1(0x177)+_0x2ac89);return;}console[_0x517fb1(0x214)](LOG_PREFIX+'\x20Loading\x20Vite\x20HMR\x20client\x20from\x20'+_0x2ac89+_0x517fb1(0x166)),await import(_0x2ac89+'/@vite/client'),window['__viteHMRLoaded']['add'](_0x2ac89),console['log'](LOG_PREFIX+_0x517fb1(0x14e)+_0x2ac89);}function isRefreshRuntime(_0x13850d){const _0x492f65=_0x1cff22;return typeof _0x13850d==='object'&&_0x13850d!==null&&_0x492f65(0x1c1)in _0x13850d&&typeof _0x13850d[_0x492f65(0x1c1)]===_0x492f65(0x1c4);}var WORKER_MESSAGE_CONFIG=_0x1cff22(0x18c),WORKER_MESSAGE_DISABLE=_0x1cff22(0x204),LOG_PREFIX2='[Enhance\x20SW-Client]',registration=null,currentOptions2=null;async function registerServiceWorker(_0x350c45){const _0x16aede=_0x1cff22;console[_0x16aede(0x214)](LOG_PREFIX2+_0x16aede(0x1d2)),console[_0x16aede(0x214)](LOG_PREFIX2+_0x16aede(0x1e1)+_0x350c45[_0x16aede(0x178)]);if(!('serviceWorker'in navigator)){console[_0x16aede(0x202)](LOG_PREFIX2+_0x16aede(0x155));return;}console[_0x16aede(0x214)](LOG_PREFIX2+_0x16aede(0x14d));const _0x4ea79b=navigator[_0x16aede(0x1e4)][_0x16aede(0x201)];console[_0x16aede(0x214)](LOG_PREFIX2+_0x16aede(0x167),_0x4ea79b?.[_0x16aede(0x1e5)]??_0x16aede(0x196)),console[_0x16aede(0x214)](LOG_PREFIX2+'\x20Controller\x20state:',_0x4ea79b?.[_0x16aede(0x1c8)]??'N/A');const _0x508d8b=!!_0x4ea79b;currentOptions2=_0x350c45,console[_0x16aede(0x214)](LOG_PREFIX2+'\x20Checking\x20for\x20blocking\x20service\x20worker...');const _0x43961f=await detectBlockingServiceWorker(_0x350c45[_0x16aede(0x178)]);if(_0x43961f){console[_0x16aede(0x1eb)](LOG_PREFIX2+_0x16aede(0x187)+_0x43961f),console['error'](LOG_PREFIX2+_0x16aede(0x1e9));return;}console['log'](LOG_PREFIX2+_0x16aede(0x20c));try{console[_0x16aede(0x214)](LOG_PREFIX2+'\x20Registering\x20SW\x20at\x20'+_0x350c45[_0x16aede(0x178)]+_0x16aede(0x14c)),registration=await navigator['serviceWorker'][_0x16aede(0x16b)](_0x350c45[_0x16aede(0x178)],{'scope':'/'}),console[_0x16aede(0x214)](LOG_PREFIX2+_0x16aede(0x1db),{'scope':registration['scope'],'active':registration[_0x16aede(0x1f0)]?.[_0x16aede(0x1e5)],'waiting':registration['waiting']?.[_0x16aede(0x1e5)],'installing':registration[_0x16aede(0x1cc)]?.[_0x16aede(0x1e5)]}),console['log'](LOG_PREFIX2+_0x16aede(0x15b));const _0x2d3e40=await navigator['serviceWorker'][_0x16aede(0x16d)];console[_0x16aede(0x214)](LOG_PREFIX2+_0x16aede(0x142),_0x2d3e40[_0x16aede(0x1f0)]?.['scriptURL']);const _0x281c6f=ownsCurrentController(_0x350c45[_0x16aede(0x178)]);state[_0x16aede(0x138)]=_0x281c6f,console['log'](LOG_PREFIX2+_0x16aede(0x1fe)+_0x281c6f),console['log'](LOG_PREFIX2+_0x16aede(0x1ea),navigator['serviceWorker'][_0x16aede(0x201)]?.[_0x16aede(0x1e5)]??_0x16aede(0x196));if(!_0x508d8b&&!navigator[_0x16aede(0x1e4)][_0x16aede(0x201)]){console['log'](LOG_PREFIX2+_0x16aede(0x19a)),window[_0x16aede(0x1bb)][_0x16aede(0x185)]();return;}console[_0x16aede(0x214)](LOG_PREFIX2+'\x20Sending\x20customer\x20configuration...'),await sendConfiguration();if(state[_0x16aede(0x200)]){const _0x3d956b=document[_0x16aede(0x197)]('[data-enhance-runtime-bootstrap]')!==null;console['log'](LOG_PREFIX2+_0x16aede(0x18e)+_0x3d956b);if(!_0x3d956b){console[_0x16aede(0x214)](LOG_PREFIX2+'\x20Page\x20not\x20enhanced\x20by\x20SW\x20-\x20reloading\x20to\x20apply\x20enhancement'),window[_0x16aede(0x1bb)][_0x16aede(0x185)]();return;}}console[_0x16aede(0x214)](LOG_PREFIX2+_0x16aede(0x1dd)),updateOverlay(),console[_0x16aede(0x214)](LOG_PREFIX2+'\x20registerServiceWorker()\x20complete');}catch(_0x20a5f5){console[_0x16aede(0x1eb)](LOG_PREFIX2+_0x16aede(0x160),_0x20a5f5);}}async function sendConfiguration(){const _0x356548=_0x1cff22;console[_0x356548(0x214)](LOG_PREFIX2+'\x20sendConfiguration()\x20called'),console[_0x356548(0x214)](LOG_PREFIX2+_0x356548(0x12f)+state['enabled']+_0x356548(0x171)+!!currentOptions2);if(!state[_0x356548(0x200)]||!currentOptions2){console[_0x356548(0x214)](LOG_PREFIX2+_0x356548(0x137));return;}const _0x266e10=await resolveWorker();if(!_0x266e10){console[_0x356548(0x202)](LOG_PREFIX2+'\x20No\x20service\x20worker\x20active\x20to\x20configure');return;}const _0x164315={'callbackBypass':currentOptions2['callbackBypass'],'securityMode':currentOptions2[_0x356548(0x1ae)]};console['log'](LOG_PREFIX2+_0x356548(0x14a),JSON['stringify'](_0x164315,null,0x2)),_0x266e10['postMessage']({'type':WORKER_MESSAGE_CONFIG,'config':_0x164315}),console['log'](LOG_PREFIX2+'\x20Config\x20sent\x20to\x20SW');}async function unregisterServiceWorker(_0x4cd52e){const _0x37e319=_0x1cff22;console[_0x37e319(0x214)](LOG_PREFIX2+_0x37e319(0x209));if(!(_0x37e319(0x1e4)in navigator)){console[_0x37e319(0x214)](LOG_PREFIX2+'\x20No\x20serviceWorker\x20support\x20-\x20nothing\x20to\x20unregister');return;}try{const _0x447571=registration??await navigator['serviceWorker'][_0x37e319(0x208)]('/');if(!_0x447571){console[_0x37e319(0x214)](LOG_PREFIX2+_0x37e319(0x17c));return;}console[_0x37e319(0x214)](LOG_PREFIX2+'\x20Found\x20registration:',{'scope':_0x447571[_0x37e319(0x15f)],'active':_0x447571[_0x37e319(0x1f0)]?.[_0x37e319(0x1e5)],'waiting':_0x447571[_0x37e319(0x1ef)]?.[_0x37e319(0x1e5)],'installing':_0x447571[_0x37e319(0x1cc)]?.[_0x37e319(0x1e5)]});const _0x54458b=[_0x447571[_0x37e319(0x1f0)]?.[_0x37e319(0x1e5)],_0x447571[_0x37e319(0x1ef)]?.[_0x37e319(0x1e5)],_0x447571['installing']?.[_0x37e319(0x1e5)]],_0x5ab2e4=_0x54458b[_0x37e319(0x1ca)](_0x5d9b4b=>_0x5d9b4b&&ownsServiceWorker(_0x5d9b4b,_0x4cd52e));if(!_0x5ab2e4){console[_0x37e319(0x214)](LOG_PREFIX2+'\x20Registration\x20is\x20not\x20ours\x20-\x20not\x20unregistering');return;}_0x447571[_0x37e319(0x1f0)]&&(console['log'](LOG_PREFIX2+_0x37e319(0x1d1)),_0x447571['active'][_0x37e319(0x13a)]({'type':WORKER_MESSAGE_DISABLE})),console[_0x37e319(0x214)](LOG_PREFIX2+_0x37e319(0x158)),await _0x447571[_0x37e319(0x162)](),registration=null,currentOptions2=null,console[_0x37e319(0x214)](LOG_PREFIX2+'\x20SW\x20unregistered\x20successfully');}catch(_0x35560f){console['error'](LOG_PREFIX2+_0x37e319(0x15a),_0x35560f);}}function ownsServiceWorker(_0x425bfb,_0x2003aa){const _0x383a39=_0x1cff22,_0x360aca=typeof window!=='undefined'?window[_0x383a39(0x1bb)][_0x383a39(0x1d9)]:'',_0xdd6186=new URL(_0x2003aa,_0x360aca||void 0x0)[_0x383a39(0x1d0)],_0x29153b=_0x425bfb===_0xdd6186||_0x425bfb[_0x383a39(0x13f)]('sw-enhance');return console[_0x383a39(0x214)](LOG_PREFIX2+_0x383a39(0x19c)+_0x425bfb+',\x20expected='+_0xdd6186+_0x383a39(0x1e2)+_0x29153b),_0x29153b;}function _0x2488(_0x2ca8e8,_0x182fea){_0x2ca8e8=_0x2ca8e8-0x127;const _0x34e80a=_0x34e8();let _0x2488f5=_0x34e80a[_0x2ca8e8];return _0x2488f5;}function ownsCurrentController(_0x5cb7aa){const _0x7b4b4d=_0x1cff22;if(typeof navigator===_0x7b4b4d(0x1d7))return![];const _0x29fc41=navigator['serviceWorker']?.['controller'];if(!_0x29fc41)return console[_0x7b4b4d(0x214)](LOG_PREFIX2+_0x7b4b4d(0x132)),![];return ownsServiceWorker(_0x29fc41['scriptURL'],_0x5cb7aa);}async function detectBlockingServiceWorker(_0x1fafed){const _0x2b1219=_0x1cff22;if(!navigator[_0x2b1219(0x1e4)])return null;try{const _0x215817=await navigator[_0x2b1219(0x1e4)][_0x2b1219(0x208)]('/');console[_0x2b1219(0x214)](LOG_PREFIX2+_0x2b1219(0x144),_0x215817?.[_0x2b1219(0x1f0)]?.[_0x2b1219(0x1e5)]??_0x2b1219(0x196));const _0x4c77fa=_0x215817?.['active']?.['scriptURL'];if(!_0x4c77fa)return null;if(ownsServiceWorker(_0x4c77fa,_0x1fafed))return null;return _0x4c77fa;}catch(_0x790177){return console[_0x2b1219(0x1eb)](LOG_PREFIX2+_0x2b1219(0x15e),_0x790177),null;}}async function resolveWorker(){const _0x535336=_0x1cff22,_0x2a09c3=registration??await navigator[_0x535336(0x1e4)]?.[_0x535336(0x208)]('/'),_0x287483=_0x2a09c3?.['active']??_0x2a09c3?.[_0x535336(0x1ef)]??_0x2a09c3?.[_0x535336(0x1cc)]??null;return console[_0x535336(0x214)](LOG_PREFIX2+_0x535336(0x1a5),_0x287483?.['scriptURL']??'none','state:\x20'+(_0x287483?.[_0x535336(0x1c8)]??_0x535336(0x151))),_0x287483;}var LOG_PREFIX3='[Enhance\x20Runtime]';function isInitialized(){const _0x3a5091=_0x1cff22;return typeof window!==_0x3a5091(0x1d7)&&window[_0x3a5091(0x203)]===!![];}function setInitialized(_0x4622f0){const _0x57f854=_0x1cff22;typeof window!==_0x57f854(0x1d7)&&(window[_0x57f854(0x203)]=_0x4622f0);}function getOptions(){const _0x2ab8ee=_0x1cff22;return typeof window!==_0x2ab8ee(0x1d7)?window['__enhanceOptions']??null:null;}function setOptions(_0x338925){const _0x5b1176=_0x1cff22;typeof window!=='undefined'&&(window[_0x5b1176(0x169)]=_0x338925);}var Enhance={'init'(_0x4e9ffb={}){const _0x1ce6c3=_0x1cff22,_0x232091=Date[_0x1ce6c3(0x17f)]();console[_0x1ce6c3(0x214)](LOG_PREFIX3+_0x1ce6c3(0x14f)+_0x232091),console[_0x1ce6c3(0x214)](LOG_PREFIX3+'\x20Current\x20URL:\x20'+window['location'][_0x1ce6c3(0x1d0)]),console[_0x1ce6c3(0x214)](LOG_PREFIX3+_0x1ce6c3(0x136)+document['readyState']),console[_0x1ce6c3(0x214)](LOG_PREFIX3+'\x20Raw\x20options:',JSON[_0x1ce6c3(0x175)](_0x4e9ffb,null,0x2));if(isInitialized())return console[_0x1ce6c3(0x202)](LOG_PREFIX3+_0x1ce6c3(0x220)),window[_0x1ce6c3(0x1ec)]??createController();setInitialized(!![]),console[_0x1ce6c3(0x214)](LOG_PREFIX3+_0x1ce6c3(0x183));const _0x4a00ec=normalizeOptions(_0x4e9ffb);setOptions(_0x4a00ec),console['log'](LOG_PREFIX3+_0x1ce6c3(0x20e),JSON['stringify'](_0x4a00ec,null,0x2));const _0x4dab00=parseUrlParams();console[_0x1ce6c3(0x214)](LOG_PREFIX3+_0x1ce6c3(0x223),JSON[_0x1ce6c3(0x175)](_0x4dab00,null,0x2));if(_0x4dab00[_0x1ce6c3(0x140)])return cleanUrlParam(_0x1ce6c3(0x1f2)),console[_0x1ce6c3(0x214)](LOG_PREFIX3+_0x1ce6c3(0x19d)),createController();if(_0x4dab00['hasEnhancement'])return console[_0x1ce6c3(0x214)](LOG_PREFIX3+_0x1ce6c3(0x1b5)),console[_0x1ce6c3(0x214)](LOG_PREFIX3+_0x1ce6c3(0x150)+_0x4dab00[_0x1ce6c3(0x13b)]),console[_0x1ce6c3(0x214)](LOG_PREFIX3+_0x1ce6c3(0x1ed)+_0x4dab00[_0x1ce6c3(0x1d4)]),state['enabled']=!![],console['log'](LOG_PREFIX3+_0x1ce6c3(0x21c)),void loadOverlay({'overlayPath':_0x4a00ec[_0x1ce6c3(0x215)],'enableViteHmr':_0x4a00ec['overlay'][_0x1ce6c3(0x1f7)],'options':_0x4a00ec,'onToggle':handleToggle}),console[_0x1ce6c3(0x214)](LOG_PREFIX3+'\x20Starting\x20SW\x20registration\x20(async)...'),void registerServiceWorker(_0x4a00ec),console[_0x1ce6c3(0x214)](LOG_PREFIX3+_0x1ce6c3(0x16f)),createController();return console[_0x1ce6c3(0x214)](LOG_PREFIX3+_0x1ce6c3(0x17b)),console['log'](LOG_PREFIX3+_0x1ce6c3(0x15d)),void unregisterServiceWorker(_0x4a00ec[_0x1ce6c3(0x178)]),console[_0x1ce6c3(0x214)](LOG_PREFIX3+_0x1ce6c3(0x1bd)),import.meta.hot&&(console[_0x1ce6c3(0x214)](LOG_PREFIX3+_0x1ce6c3(0x145)),import.meta.hot['on']('vite:error',_0x1db26b=>{const _0x3bfd0c=_0x1ce6c3;console[_0x3bfd0c(0x214)](LOG_PREFIX3+'\x20Vite\x20error\x20detected:',_0x1db26b),state[_0x3bfd0c(0x141)]={'message':_0x1db26b['err']['message']},updateOverlay();}),import.meta.hot['on'](_0x1ce6c3(0x1ad),()=>{const _0x536fc8=_0x1ce6c3;state[_0x536fc8(0x141)]&&(console[_0x536fc8(0x214)](LOG_PREFIX3+_0x536fc8(0x1c2)),state[_0x536fc8(0x141)]=null,updateOverlay());})),createController();}};function createController(){const _0x3c6285={'enable'(){const _0x536700=_0x2488,_0x101777=getOptions();if(!_0x101777)return;state[_0x536700(0x200)]=!![],void loadOverlay({'overlayPath':_0x101777[_0x536700(0x215)],'enableViteHmr':_0x101777[_0x536700(0x133)][_0x536700(0x1f7)],'options':_0x101777,'onToggle':handleToggle}),void registerServiceWorker(_0x101777),void sendConfiguration(),updateOverlay();},'disable'(){const _0x2d8bfe=_0x2488,_0x136043=getOptions();if(!_0x136043)return;state[_0x2d8bfe(0x200)]=![],state[_0x2d8bfe(0x138)]=![],updateOverlay(),void unregisterServiceWorker(_0x136043[_0x2d8bfe(0x178)]);},'status'(){const _0x3e8d2a=_0x2488;return{'enabled':state[_0x3e8d2a(0x200)],'controlled':state['controlled']};}};return typeof window!=='undefined'&&(window['__enhanceController']=_0x3c6285),_0x3c6285;}function handleToggle(){const _0x1759bc=_0x1cff22,_0x574da4=createController();state[_0x1759bc(0x200)]?_0x574da4[_0x1759bc(0x12d)]():_0x574da4[_0x1759bc(0x1a7)]();}function parseUrlParams(){const _0x142101=_0x1cff22,_0x5cc288=new URL(window[_0x142101(0x1bb)][_0x142101(0x1d0)]),_0x2befc9=_0x5cc288[_0x142101(0x1f6)]['get']('enhance')?.[_0x142101(0x1e7)](),_0x40fbad=_0x5cc288['searchParams'][_0x142101(0x1ff)]('enhancementUrl'),_0x21ba3a=_0x5cc288[_0x142101(0x1f6)][_0x142101(0x1ff)](_0x142101(0x1d6));return{'hasEnhancement':Boolean(_0x40fbad||_0x21ba3a),'explicitDisable':_0x2befc9==='0'||_0x2befc9===_0x142101(0x1de)||_0x2befc9===_0x142101(0x170),'enhancementUrl':_0x40fbad,'enhancementId':_0x21ba3a};}function cleanUrlParam(_0x487c87){const _0x51405d=_0x1cff22,_0x438a04=new URL(window[_0x51405d(0x1bb)][_0x51405d(0x1d0)]);_0x438a04['searchParams'][_0x51405d(0x1ba)](_0x487c87)&&(_0x438a04[_0x51405d(0x1f6)]['delete'](_0x487c87),window[_0x51405d(0x17a)][_0x51405d(0x1e0)](null,document[_0x51405d(0x18d)],_0x438a04[_0x51405d(0x1ce)]()));}function _0x34e8(){const _0x1b8f6d=['replace','toString','\x20currentOptions\x20exists:\x20','href','\x20Sending\x20DISABLE\x20message\x20to\x20SW...','\x20registerServiceWorker()\x20called','Copy\x20the\x20service\x20worker\x20and\x20overlay\x20bundle\x20into\x20a\x20public\x20directory','enhancementId','base64','enhancement','undefined','Print\x20the\x20current\x20asset\x20manifest','origin','push','\x20Registration\x20returned:','position','\x20Updating\x20overlay...','false','copied','replaceState','\x20swPath:\x20',',\x20owns=','58nQIoPs','serviceWorker','scriptURL','permissive','toLowerCase','version','\x20Enhancement\x20features\x20will\x20NOT\x20work\x20until\x20it\x20is\x20unregistered','\x20Current\x20controller\x20after\x20ready:','error','__enhanceController','\x20enhancementId:\x20','runtimeURL','waiting','active','__viteHMRLoaded','enhance','\x20Starting\x20fresh\x20overlay\x20load...','--public-dir\x20<path>','\x20loadOverlay()\x20called','searchParams','enableViteHmr','string','\x20No\x20cached\x20controller\x20-\x20will\x20import\x20module','9244FPHUkE','ENHANCE_OVERLAY_PATH=https://overlay.localhost:8099/src/index.tsx\x20ENHANCE_BACKEND_URL=https://overlay.localhost:8099\x20tsup','onToggle','all','\x20Page\x20controlled\x20by\x20our\x20SW:\x20','get','enabled','controller','warn','__enhanceInitialized','enhance:disable','manifestPath','\x20overlayController\x20exists:\x20','\x20React\x20Refresh\x20runtime\x20installed\x20for\x20','getRegistration','\x20unregisterServiceWorker()\x20called','ENHANCE_OVERLAY_PATH=https://overlay.localhost:8099/src/index.tsx\x20ENHANCE_BACKEND_URL=https://overlay.localhost:8099\x20tsup\x20--watch',',\x20page\x20origin:\x20','\x20No\x20blocking\x20SW\x20found','https://','\x20Normalized\x20options:','17373cMyarQ','^11.1.0','description','0.3.17','mkdir','log','overlayPath','451ZYehAv','enableOverlayHmr','Enhance\x20preview\x20bootstrap\x20and\x20tooling\x20package.','ENHANCE_OVERLAY_PATH=https://overlay.localhost:8099/src/index.tsx\x20ENHANCE_BACKEND_URL=https://enhance-api-dev.enhancelabs.workers.dev\x20tsup','\x20→\x20','^7.2.4','\x20Starting\x20overlay\x20load\x20(async)...','publicDir','cwd','\x20loadOverlay()\x20complete','\x20Already\x20initialized\x20(window.__enhanceInitialized=true)\x20-\x20returning\x20existing\x20controller','\x20composeOverlayState\x20-\x20state.controlled:\x20','--filename\x20<name>','\x20URL\x20params\x20parsed:','\x20Invalid\x20React\x20Refresh\x20runtime','$RefreshReg$','13ohHDYK','write','\x20enableViteHmr:\x20','$RefreshSig$','ENHANCE_OVERLAY_PATH=https://assets.enhancelabs.ai/overlay.js\x20ENHANCE_BACKEND_URL=https://api.enhancelabs.ai\x20OBFUSCATE=1\x20RELEASE=1\x20tsup','disable','destinationPath','\x20state.enabled:\x20','\x20overlayPath:\x20','602460KzWDZM','\x20No\x20current\x20controller','overlay','copyFile','bun\x20version\x20patch\x20--no-git-tag-version','\x20Document\x20readyState:\x20','\x20Skipping\x20-\x20not\x20enabled\x20or\x20no\x20options','controlled','keys','postMessage','enhancementUrl','\x20Controller\x20created:','\x20Found\x20cached\x20overlay\x20controller\x20on\x20window.__enhanceOverlay\x20-\x20skipping\x20reinit','./dev/vite/index.js','includes','explicitDisable','appError','\x20SW\x20ready!\x20Active:','7ZgLrjf','\x20detectBlocking\x20-\x20existing\x20registration:','\x20Setting\x20up\x20Vite\x20HMR\x20error\x20listeners','action','\x20Overlay\x20origin:\x20','\x20Failed\x20to\x20prepare\x20remote\x20HMR\x20(non-fatal):','0.0.0','\x20Sending\x20customer\x20config\x20to\x20SW:','__enhanceReactRefreshInstalledOrigins','\x20with\x20scope\x20\x27/\x27...','\x20Service\x20workers\x20supported','\x20Vite\x20HMR\x20client\x20loaded\x20for\x20','\x20init()\x20called\x20at\x20','\x20enhancementUrl:\x20','N/A','Override\x20the\x20service\x20worker\x20output\x20filename\x20(defaults\x20to\x20sw-enhance.js)','/sw-enhance.js','code','\x20Service\x20workers\x20NOT\x20supported\x20in\x20this\x20browser','\x20composeOverlayState\x20-\x20state.enabled:\x20','^24.10.1','\x20Unregistering\x20SW...','enhance-sandbox','\x20Failed\x20to\x20unregister\x20service\x20worker:','\x20Waiting\x20for\x20navigator.serviceWorker.ready...','createOverlay','\x20Unregistering\x20any\x20existing\x20SW...','\x20detectBlocking\x20error:','scope','\x20Failed\x20to\x20register\x20service\x20worker:','override','unregister','assets/enhance-runtime.js','./dev/cli.js','init','...','\x20Current\x20controller:','callbackBypass','__enhanceOptions','./dev/index.d.ts','register','\x20Module\x20exports:','ready','Copied\x20','\x20init()\x20complete\x20-\x20enhancement\x20mode','off',',\x20currentOptions:\x20','backendUrl','\x20Module\x20imported\x20in\x20','\x20Same\x20origin\x20-\x20skipping\x20HMR\x20setup','stringify','\x20Setting\x20up\x20remote\x20HMR...','\x20Vite\x20client\x20already\x20loaded\x20for\x20','swPath','\x20Failed\x20to\x20import/create\x20overlay:','history','\x20Normal\x20mode\x20-\x20no\x20enhancement\x20params','\x20No\x20registration\x20found\x20-\x20nothing\x20to\x20unregister','\x20No\x20window\x20object\x20-\x20skipping','\x20composeOverlayState\x20-\x20enhancementUrl:\x20','now','16196244DcdoBB','ENHANCE_OVERLAY_PATH=https://overlay.localhost:8099/src/index.tsx\x20ENHANCE_BACKEND_URL=https://enhance-api-dev.enhancelabs.workers.dev\x20tsup\x20--watch','digest','\x20First\x20initialization','option','reload','trim','\x20BLOCKING\x20SW\x20detected:\x20','MIT','\x20Module\x20missing\x20createOverlay\x20export!','tsc\x20--noEmit','relativeDestination','enhance:configure','title','\x20Enhancement\x20detection:\x20wasEnhanced=','filename','./dev/index.js','\x20Cross-origin\x20overlay\x20-\x20setting\x20up\x20HMR...','\x20Installing\x20React\x20Refresh\x20runtime\x20from\x20','6CBuLrT','../dist/index.js','sha256','none','querySelector','/assets/enhance-runtime.js','update','\x20Page\x20was\x20not\x20controlled\x20-\x20SW\x20just\x20activated.\x20Reloading\x20to\x20enable\x20enhancement...','swFilename','\x20ownsServiceWorker?\x20scriptURL=','\x20Explicit\x20disable\x20via\x20URL\x20param\x20-\x20exiting','\x20Calling\x20createOverlay()...','\x20Load\x20already\x20in\x20progress\x20-\x20waiting...','dev/','serviceWorkerURL','ENOENT','__enhanceOverlay','startsWith','\x20resolveWorker:','\x20setupRemoteHMR()\x20for\x20','enable','\x20Available\x20exports:','https://assets.enhancelabs.ai/overlay.js','@enhance-eng/sandbox','\x20doLoadOverlay()\x20starting...','\x20Calling\x20updateOverlay()...','vite:beforeUpdate','security','Skipped\x20','ENHANCE_OVERLAY_PATH=https://assets.enhancelabs.ai/overlay.js\x20ENHANCE_BACKEND_URL=https://api.enhancelabs.ai\x20tsup','__development','Directory\x20to\x20copy\x20the\x20service\x20worker\x20into','https://api.enhancelabs.ai','667865YpRBaA','\x20Enhancement\x20mode\x20ENABLED','manifest','2307640YJuDyT','137420ldcHdf','\x20loadOverlay()\x20failed:','has','location','344LPuYuu','\x20init()\x20complete\x20-\x20normal\x20mode','http://','\x20React\x20Refresh\x20already\x20installed\x20for\x20','module','injectIntoGlobalHook','\x20Vite\x20update\x20pending\x20-\x20clearing\x20error','\x20Overlay\x20controller\x20initialized\x20and\x20cached','function','public','default','[Enhance\x20Overlay]','state','prepare-sw','some','options','installing'];_0x34e8=function(){return _0x1b8f6d;};return _0x34e8();}var package_default={'name':_0x1cff22(0x1aa),'version':_0x1cff22(0x212),'type':_0x1cff22(0x1c0),'description':_0x1cff22(0x218),'license':_0x1cff22(0x188),'main':'./dev/index.js','module':'./dev/index.js','types':_0x1cff22(0x16a),'exports':{'.':{'types':_0x1cff22(0x16a),'import':_0x1cff22(0x190)},'./vite':{'types':'./dev/vite/index.d.ts','import':_0x1cff22(0x13e)}},'files':[_0x1cff22(0x1a0)],'bin':{'enhance-sandbox':_0x1cff22(0x164)},'scripts':{'typecheck':_0x1cff22(0x18a),'dev':_0x1cff22(0x20a),'dev:build':_0x1cff22(0x1fb),'dev:staging':_0x1cff22(0x181),'dev:staging:build':_0x1cff22(0x219),'build':_0x1cff22(0x1b0),'build:release':_0x1cff22(0x12c),'version':_0x1cff22(0x135)},'dependencies':{'commander':_0x1cff22(0x210),'zod':'^3.22.4'},'devDependencies':{'@types/node':_0x1cff22(0x157),'javascript-obfuscator':'^4.1.1','tsup':'^8.5.1','vite':_0x1cff22(0x21b)},'publishConfig':{'access':_0x1cff22(0x1c5)}},DEFAULT_SERVICE_WORKER_PATH=_0x1cff22(0x153),DEFAULT_RUNTIME_PATH=_0x1cff22(0x198),DIST_SERVICE_WORKER_PATH='sw-enhance.js',DIST_RUNTIME_PATH=_0x1cff22(0x163),PACKAGE_VERSION=typeof package_default[_0x1cff22(0x1e8)]===_0x1cff22(0x1f8)?package_default[_0x1cff22(0x1e8)]:_0x1cff22(0x149);function normalizeAssetPath(_0x167d01){const _0xe8b3fc=_0x1cff22;if(!_0x167d01)return _0x167d01;if(_0x167d01['startsWith'](_0xe8b3fc(0x1be))||_0x167d01[_0xe8b3fc(0x1a4)](_0xe8b3fc(0x20d)))return _0x167d01;const _0x46c9b3=_0x167d01[_0xe8b3fc(0x1cd)](/^\.\//,'');return _0x46c9b3['startsWith']('/')?_0x46c9b3:'/'+_0x46c9b3;}var defaultSwPath=normalizeAssetPath(DEFAULT_SERVICE_WORKER_PATH),defaultRuntimePath=normalizeAssetPath(DEFAULT_RUNTIME_PATH),Enhance2={'init'(_0x24d981){const _0x3dca12=_0x1cff22;return Enhance[_0x3dca12(0x165)](_0x24d981);},'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 _0x2982a7=_0x1cff22;return Enhance2[_0x2982a7(0x1a1)]();}function runtimeURL(){const _0x398198=_0x1cff22;return Enhance2[_0x398198(0x1ee)]();}import{promises as _0x1ddebc}from'fs';import{createHash}from'crypto';import{dirname,join}from'path';import{fileURLToPath}from'url';var distDir=dirname(fileURLToPath(new URL(_0x1cff22(0x194),import.meta.url)));async function syncAssets(_0x58ffbe){const _0x47aee3=_0x1cff22,_0x445e51=[{'sourcePath':DIST_SERVICE_WORKER_PATH,'manifestPath':normalizeAssetPath(DEFAULT_SERVICE_WORKER_PATH),'override':_0x58ffbe[_0x47aee3(0x19b)]?'./'+_0x58ffbe[_0x47aee3(0x19b)]:void 0x0},{'sourcePath':DIST_RUNTIME_PATH,'manifestPath':normalizeAssetPath(DEFAULT_RUNTIME_PATH)}],_0x3c7cc4=[];for(const _0x20b364 of _0x445e51){const _0xebc6ec=cleanRelativePath(_0x20b364[_0x47aee3(0x161)]??_0x20b364[_0x47aee3(0x205)]),_0x3179ad=join(distDir,cleanRelativePath(_0x20b364['sourcePath'])),_0x1bbbc1=join(_0x58ffbe[_0x47aee3(0x21d)],_0xebc6ec),[_0x1aed2e,_0x5bff9d]=await Promise[_0x47aee3(0x1fd)]([readDigest(_0x3179ad),readDigest(_0x1bbbc1)]);if(_0x1aed2e&&_0x5bff9d&&_0x1aed2e===_0x5bff9d){_0x3c7cc4[_0x47aee3(0x1da)]({'sourcePath':_0x3179ad,'destinationPath':_0x1bbbc1,'relativeDestination':_0xebc6ec,'status':'skipped'});continue;}await _0x1ddebc[_0x47aee3(0x213)](dirname(_0x1bbbc1),{'recursive':!![]}),await _0x1ddebc[_0x47aee3(0x134)](_0x3179ad,_0x1bbbc1),_0x3c7cc4['push']({'sourcePath':_0x3179ad,'destinationPath':_0x1bbbc1,'relativeDestination':_0xebc6ec,'status':_0x47aee3(0x1df)});}return _0x3c7cc4;}function cleanRelativePath(_0x5d1e01){return _0x5d1e01['replace'](/^[./]+/,'');}async function readDigest(_0x2ceed3){const _0x360c0b=_0x1cff22;try{const _0x337346=await _0x1ddebc['readFile'](_0x2ceed3);return createHash(_0x360c0b(0x195))[_0x360c0b(0x199)](_0x337346)[_0x360c0b(0x182)](_0x360c0b(0x1d5));}catch(_0x355f2b){if(_0x355f2b[_0x360c0b(0x154)]===_0x360c0b(0x1a2))return null;throw _0x355f2b;}}var program=new Command();program['name'](_0x1cff22(0x159))['description']('Enhance\x20sandbox\x20utility\x20CLI')[_0x1cff22(0x1e8)]('0.0.0'),program['command'](_0x1cff22(0x1b6))['description'](_0x1cff22(0x1d8))[_0x1cff22(0x146)](()=>{const _0x5016ef=_0x1cff22,_0x436aa7=getAssetManifest();process['stdout']['write'](JSON[_0x5016ef(0x175)](_0x436aa7,null,0x2)+'\x0a');}),program['command'](_0x1cff22(0x1c9))[_0x1cff22(0x211)](_0x1cff22(0x1d3))['requiredOption'](_0x1cff22(0x1f4),_0x1cff22(0x1b2))[_0x1cff22(0x184)](_0x1cff22(0x222),_0x1cff22(0x152))['action'](async _0x28032a=>{const _0x5afafd=_0x1cff22,_0x49deb1=resolve(process['cwd'](),_0x28032a[_0x5afafd(0x21d)]),_0x4726a0=await syncAssets({'publicDir':_0x49deb1,'swFilename':_0x28032a[_0x5afafd(0x18f)]});for(const _0x1d5721 of _0x4726a0){const _0x4bb7ca=relative(process[_0x5afafd(0x21e)](),_0x1d5721[_0x5afafd(0x12e)]);_0x1d5721['status']==='skipped'?process['stdout'][_0x5afafd(0x129)](_0x5afafd(0x1af)+_0x1d5721['relativeDestination']+'\x20(already\x20current)\x20['+_0x4bb7ca+']\x0a'):process['stdout'][_0x5afafd(0x129)](_0x5afafd(0x16e)+_0x1d5721[_0x5afafd(0x18b)]+_0x5afafd(0x21a)+_0x4bb7ca+'\x0a');}}),program['parseAsync']();
package/dist/index.d.ts CHANGED
@@ -1,105 +1,87 @@
1
- import { z } from 'zod';
1
+ type SecurityMode$1 = "permissive" | "custom";
2
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, {
42
- 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
- }, {
3
+ type RawOptions = {
4
+ callbackBypass?: string[];
5
+ __development?: {
6
+ enableOverlayHmr?: boolean;
7
+ overlayPath?: string;
8
+ security?: "permissive" | "custom";
9
+ backendUrl?: string;
10
+ };
11
+ };
12
+ type NormalizedOptions = {
61
13
  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
- }
14
+ overlay: {
15
+ enabled: true;
16
+ position: "bottom-right";
17
+ enableViteHmr: boolean;
18
+ };
19
+ logLevel: "info";
20
+ swPath: "/sw-enhance.js";
21
+ overlayPath: string;
22
+ runtimeScriptPath: "/assets/enhance-runtime.js";
23
+ security: SecurityMode$1;
24
+ backendUrl: string;
25
+ };
86
26
 
87
- interface EnhanceInitOptions extends RawOptions {
27
+ type OverlayPosition = "top-left" | "top-right" | "bottom-left" | "bottom-right";
28
+ type SecurityMode = "permissive" | "custom";
29
+ interface OverlayState {
30
+ enhancementUrl: string;
31
+ enabled: boolean;
32
+ controlled: boolean;
33
+ overlayPosition: OverlayPosition;
34
+ securityMode: SecurityMode;
35
+ backendBaseUrl?: string;
36
+ appError: {
37
+ message: string;
38
+ } | null;
39
+ /** Debug flag to force "Working" state */
40
+ forceWorking?: boolean;
41
+ }
42
+ interface OverlayController {
43
+ update(state: OverlayState): void;
44
+ onToggle(handler: () => void): void;
45
+ destroy(): void;
46
+ open(): void;
47
+ close(): void;
48
+ isOpen(): boolean;
88
49
  }
89
50
  interface EnhanceStatus {
90
51
  enabled: boolean;
91
52
  controlled: boolean;
92
- version: string;
93
- sandboxHits: number;
94
- sandboxFallbacks: number;
95
53
  }
96
54
  interface EnhanceController {
97
- enable(token?: string): void;
55
+ enable(): void;
98
56
  disable(): void;
99
57
  status(): EnhanceStatus;
100
58
  }
59
+ declare global {
60
+ interface Window {
61
+ __enhanceOverlay?: OverlayController;
62
+ __viteHMRLoaded?: Set<string>;
63
+ __enhanceReactRefreshInstalledOrigins?: Set<string>;
64
+ __vite_plugin_react_preamble_installed__?: boolean;
65
+ $RefreshReg$?: (type: unknown, id?: string) => void;
66
+ $RefreshSig$?: () => (type: unknown) => unknown;
67
+ enhancePreview?: EnhanceController;
68
+ }
69
+ }
70
+
71
+ declare global {
72
+ interface Window {
73
+ __enhanceInitialized?: boolean;
74
+ __enhanceOptions?: NormalizedOptions;
75
+ __enhanceController?: EnhanceController;
76
+ }
77
+ }
78
+ /**
79
+ * Main entry point - the only public API.
80
+ */
81
+ declare const Enhance$1: {
82
+ init(rawOptions?: RawOptions): EnhanceController;
83
+ };
101
84
 
102
- type EnhanceOptions = EnhanceInitOptions;
103
85
  interface EnhanceAssetManifest {
104
86
  serviceWorker: string;
105
87
  runtime: string;
@@ -108,7 +90,7 @@ interface EnhanceAssetManifest {
108
90
  runtimeDigest: string | null;
109
91
  }
110
92
  declare const Enhance: {
111
- init(options: EnhanceInitOptions): EnhanceController;
93
+ init(options: Parameters<typeof Enhance$1.init>[0]): EnhanceController;
112
94
  serviceWorkerURL(): string;
113
95
  runtimeURL(): string;
114
96
  assetManifest(): EnhanceAssetManifest;
@@ -118,4 +100,4 @@ declare function resolveServiceWorkerPath(): string;
118
100
  declare function serviceWorkerURL(): string;
119
101
  declare function runtimeURL(): string;
120
102
 
121
- export { Enhance, type EnhanceAssetManifest, type EnhanceController, type EnhanceOptions, type EnhanceStatus, getAssetManifest, resolveServiceWorkerPath, runtimeURL, serviceWorkerURL };
103
+ export { Enhance, type EnhanceAssetManifest, type EnhanceController, type RawOptions as EnhanceOptions, type EnhanceStatus, getAssetManifest, resolveServiceWorkerPath, runtimeURL, serviceWorkerURL };