@picoxr/web-cli-core
Version:
Core Library to generate, build and sign TWA projects
1 lines • 21.5 kB
JavaScript
'use strict';const _0x549764=_0x439e;(function(_0x3c2db3,_0x1a4b92){const _0x4e0a63=_0x439e,_0x26f7a0=_0x3c2db3();while(!![]){try{const _0x3cad27=parseInt(_0x4e0a63(0x213))/0x1*(parseInt(_0x4e0a63(0x20f))/0x2)+parseInt(_0x4e0a63(0x235))/0x3*(-parseInt(_0x4e0a63(0x218))/0x4)+-parseInt(_0x4e0a63(0x1e1))/0x5+-parseInt(_0x4e0a63(0x1f5))/0x6*(-parseInt(_0x4e0a63(0x238))/0x7)+-parseInt(_0x4e0a63(0x25d))/0x8+parseInt(_0x4e0a63(0x209))/0x9+parseInt(_0x4e0a63(0x22e))/0xa*(parseInt(_0x4e0a63(0x219))/0xb);if(_0x3cad27===_0x1a4b92)break;else _0x26f7a0['push'](_0x26f7a0['shift']());}catch(_0x4d6fee){_0x26f7a0['push'](_0x26f7a0['shift']());}}}(_0x1f96,0x29f4e));Object['defineProperty'](exports,_0x549764(0x1d6),{'value':!![]}),exports[_0x549764(0x1d5)]=exports[_0x549764(0x234)]=exports[_0x549764(0x1f9)]=exports[_0x549764(0x20e)]=exports[_0x549764(0x23e)]=void 0x0;const fs=require('fs'),FetchUtils_1_1=require('./FetchUtils-1'),util_1=require(_0x549764(0x1ec)),Color=require('color'),Log_1=require('./Log'),ShortcutInfo_1=require(_0x549764(0x231)),GeneratorTagUtils_1=require(_0x549764(0x265)),MIN_ICON_SIZE=0x68,SIX_TO_FIVE_ICON_SIZE=0xea,MAX_ICON_SIZE=0x200,SHORT_NAME_MAX_SIZE=0xc,MIN_NOTIFICATION_ICON_SIZE=0x30,DISPLAY_MODE_VALUES=[_0x549764(0x1dc),_0x549764(0x1db),_0x549764(0x211)];function _0x439e(_0x5ca890,_0x1f99dc){const _0x1f9601=_0x1f96();return _0x439e=function(_0x439e8b,_0x4489af){_0x439e8b=_0x439e8b-0x1d2;let _0x3fc4e1=_0x1f9601[_0x439e8b];return _0x3fc4e1;},_0x439e(_0x5ca890,_0x1f99dc);}exports['DisplayModes']=[...DISPLAY_MODE_VALUES];function asDisplayMode(_0x397ae6){const _0x1a0eed=_0x549764;return DISPLAY_MODE_VALUES[_0x1a0eed(0x21a)](_0x397ae6)?_0x397ae6:null;}exports[_0x549764(0x20e)]=asDisplayMode;function _0x1f96(){const _0x401ce6=['11MaJiih','includes','PICOXR_SERVER_RRGION','appVersionName','map','fromShortcutJson','join','landscape-primary','navigationColor','./android.keystore','signingKey','text/json','verifyShareTarget','log','deflate','startUrl','binary','accept','fromFile','fingerprints','iconUrl\x20cannot\x20be\x20empty','2909650bZAXjv','packageId','action','./ShortcutInfo','landscape','application/octet-stream','asOrientation','84003TCuePm','name','getNewFieldValue','1183jpagqi','getShortcuts','maskableIcons','text','icons','backgroundColor','DisplayModes','Skipping\x20shortcut[','portrait-primary','indexOf','saveToFile','cliVersion','href','display','content-encoding','Responded\x20with\x20status\x20','isArray','features','cliName','iconUrl','search','encrypt','navigationDividerColor','assign','customtabs','validateNotEmpty','additionalTrustedOrigins','navigationColorDark','orientation','monochromeIconUrl','monochrome','#00000000','short_name','background_color','splashScreenFadeOutDuration','merge','maskableIconUrl','84488kotkzy','Failed\x20to\x20download\x20Web\x20Manifest\x20','application/json','ConsoleLog','files','fetchUtils','navigationDividerColorDark','decompressResponseBuffer','./GeneratorTagUtils','src','fromWebManifestJson','android','enableSiteSettingsShortcut','length','findSuitableIcon','hex','generateShortcuts','generatorTagUtils','TwaManifest','__esModule','landscape-secondary','webManifestUrl','toJson','maskable','fullscreen','standalone','headers','unknown','params','getNewIconUrl','1532635CyrvAQ','status','fullScopeUrl','data','toString','env','scope','share_target','generatorTag','isMetaQuest','themeColor','./util','fallbackType','retainedBundles','My\x20TWA','push','content-type','start_url','#FFFFFF','launcherName','546jcDQFK','promises','minSdkVersion','monochromeIcons','Orientations','theme_color','gzip','generatePackageId','isChromeOSOnly','get','from','webManifest','natural','default','portrait','pathname','any','shortcuts','region','fromLocalManifestJson','2884680GttAWN','substring','setCliInfos','serviceAccountJsonFile','findSixToFiveIcon','asDisplayMode','2ZLdLkY','fromWebManifest','minimal-ui','writeFile','58085mVkwYa','host','fetch','warn','generatorApp','28KXXXQY'];_0x1f96=function(){return _0x401ce6;};return _0x1f96();}const ORIENTATION_VALUES=[_0x549764(0x202),_0x549764(0x205),_0x549764(0x201),_0x549764(0x232),_0x549764(0x203),_0x549764(0x240),'portrait-secondary',_0x549764(0x220),_0x549764(0x1d7)];exports['Orientations']=[...ORIENTATION_VALUES];function asOrientation(_0x3dbe12){const _0x4746c4=_0x549764;if(!_0x3dbe12)return null;return ORIENTATION_VALUES[_0x4746c4(0x21a)](_0x3dbe12)?_0x3dbe12:null;}exports[_0x549764(0x234)]=asOrientation;const DEFAULT_SPLASHSCREEN_FADEOUT_DURATION=0x12c,DEFAULT_APP_NAME=_0x549764(0x1ef),DEFAULT_DISPLAY_MODE=_0x549764(0x211),DEFAULT_THEME_COLOR=_0x549764(0x1f3),DEFAULT_NAVIGATION_COLOR='#000000',DEFAULT_NAVIGATION_DIVIDER_COLOR=_0x549764(0x257),DEFAULT_BACKGROUND_COLOR=_0x549764(0x1f3),DEFAULT_APP_VERSION_CODE=0x1,DEFAULT_APP_VERSION_NAME=DEFAULT_APP_VERSION_CODE[_0x549764(0x1e5)](),DEFAULT_MIN_SDK_VERSION=0x13,DEFAULT_SIGNING_KEY_PATH=_0x549764(0x222),DEFAULT_SIGNING_KEY_ALIAS=_0x549764(0x268),DEFAULT_ENABLE_NOTIFICATIONS=!![],DEFAULT_GENERATOR_APP_NAME=_0x549764(0x1de),DEFAULT_GENERATOR_TAG_NAME=_0x549764(0x1de),DEFAULT_ORIENTATION=_0x549764(0x202);class TwaManifest{constructor(_0x39ddef){const _0x5190da=_0x549764;var _0x210123,_0x4d6eec,_0x4eb82f;this['packageId']=_0x39ddef[_0x5190da(0x22f)],this[_0x5190da(0x214)]=_0x39ddef[_0x5190da(0x214)],this[_0x5190da(0x236)]=_0x39ddef[_0x5190da(0x236)],this[_0x5190da(0x1f4)]=_0x39ddef[_0x5190da(0x1f4)]||_0x39ddef[_0x5190da(0x236)],this[_0x5190da(0x245)]=asDisplayMode(_0x39ddef[_0x5190da(0x245)])||DEFAULT_DISPLAY_MODE,this[_0x5190da(0x1eb)]=new Color(_0x39ddef['themeColor']),this[_0x5190da(0x221)]=new Color(_0x39ddef[_0x5190da(0x221)]),this[_0x5190da(0x253)]=new Color((_0x210123=_0x39ddef[_0x5190da(0x253)])!==null&&_0x210123!==void 0x0?_0x210123:DEFAULT_NAVIGATION_COLOR),this[_0x5190da(0x24e)]=new Color((_0x4d6eec=_0x39ddef[_0x5190da(0x24e)])!==null&&_0x4d6eec!==void 0x0?_0x4d6eec:DEFAULT_NAVIGATION_DIVIDER_COLOR),this['navigationDividerColorDark']=new Color((_0x4eb82f=_0x39ddef[_0x5190da(0x263)])!==null&&_0x4eb82f!==void 0x0?_0x4eb82f:DEFAULT_NAVIGATION_COLOR),this[_0x5190da(0x23d)]=new Color(_0x39ddef[_0x5190da(0x23d)]),this['enableNotifications']=_0x39ddef['enableNotifications'],this['startUrl']=_0x39ddef[_0x5190da(0x228)],this['iconUrl']=_0x39ddef[_0x5190da(0x24b)],this['icons']=_0x39ddef[_0x5190da(0x23c)]||null,this[_0x5190da(0x25c)]=_0x39ddef[_0x5190da(0x25c)],this[_0x5190da(0x255)]=_0x39ddef[_0x5190da(0x255)],this['splashScreenFadeOutDuration']=_0x39ddef[_0x5190da(0x25a)],this[_0x5190da(0x223)]=_0x39ddef[_0x5190da(0x223)],this[_0x5190da(0x21c)]=_0x39ddef['appVersion'],this['appVersionCode']=_0x39ddef['appVersionCode']||DEFAULT_APP_VERSION_CODE,this[_0x5190da(0x206)]=[],this[_0x5190da(0x217)]=_0x39ddef['generatorApp']||DEFAULT_GENERATOR_APP_NAME,this[_0x5190da(0x1e9)]=_0x39ddef['generatorTag']||DEFAULT_GENERATOR_TAG_NAME,this['webManifestUrl']=_0x39ddef[_0x5190da(0x1d8)]?new URL(_0x39ddef['webManifestUrl']):undefined,this[_0x5190da(0x1ed)]=_0x39ddef['fallbackType']||_0x5190da(0x250),this[_0x5190da(0x249)]=_0x39ddef[_0x5190da(0x249)]||{},this['alphaDependencies']=_0x39ddef['alphaDependencies']||{'enabled':![]},this[_0x5190da(0x269)]=_0x39ddef[_0x5190da(0x269)]!=undefined?_0x39ddef[_0x5190da(0x269)]:!![],this['isChromeOSOnly']=_0x39ddef['isChromeOSOnly']!=undefined?_0x39ddef[_0x5190da(0x1fd)]:![],this[_0x5190da(0x1ea)]=_0x39ddef[_0x5190da(0x1ea)]!=undefined?_0x39ddef[_0x5190da(0x1ea)]:![],this[_0x5190da(0x1e3)]=_0x39ddef[_0x5190da(0x1e3)]?new URL(_0x39ddef[_0x5190da(0x1e3)]):undefined,this[_0x5190da(0x1f7)]=_0x39ddef[_0x5190da(0x1f7)]||DEFAULT_MIN_SDK_VERSION,this['shareTarget']=_0x39ddef['shareTarget'],this['orientation']=_0x39ddef[_0x5190da(0x254)]||DEFAULT_ORIENTATION,this[_0x5190da(0x22c)]=_0x39ddef['fingerprints']||[],this['serviceAccountJsonFile']=_0x39ddef[_0x5190da(0x20c)],this[_0x5190da(0x252)]=_0x39ddef[_0x5190da(0x252)]||[],this[_0x5190da(0x1ee)]=_0x39ddef[_0x5190da(0x1ee)]||[],this[_0x5190da(0x200)]=_0x39ddef[_0x5190da(0x200)]||{},this[_0x5190da(0x24a)]='',this[_0x5190da(0x243)]='',this[_0x5190da(0x207)]=_0x39ddef[_0x5190da(0x207)]||'';}[_0x549764(0x1d9)](){const _0x3012ad=_0x549764;return Object[_0x3012ad(0x24f)]({},this,{'themeColor':this[_0x3012ad(0x1eb)]['hex'](),'navigationColor':this[_0x3012ad(0x221)]['hex'](),'navigationColorDark':this[_0x3012ad(0x253)][_0x3012ad(0x1d2)](),'navigationDividerColor':this['navigationDividerColor'][_0x3012ad(0x1d2)](),'navigationDividerColorDark':this[_0x3012ad(0x263)][_0x3012ad(0x1d2)](),'backgroundColor':this[_0x3012ad(0x23d)]['hex'](),'appVersion':this[_0x3012ad(0x21c)],'webManifestUrl':this[_0x3012ad(0x1d8)]?this[_0x3012ad(0x1d8)][_0x3012ad(0x1e5)]():undefined,'fullScopeUrl':this[_0x3012ad(0x1e3)]?this[_0x3012ad(0x1e3)][_0x3012ad(0x1e5)]():undefined,'webManifest':this['webManifest'],'region':process[_0x3012ad(0x1e6)][_0x3012ad(0x21b)]||''});}async[_0x549764(0x242)](_0x58b08b){const _0x3f2d11=_0x549764,_0x5002fc=this[_0x3f2d11(0x1d9)]();await fs[_0x3f2d11(0x1f6)][_0x3f2d11(0x212)](_0x58b08b,JSON['stringify'](_0x5002fc,null,0x2));}['setCliInfo'](_0x2aa679,_0x196196){const _0x461c35=_0x549764;this[_0x461c35(0x24a)]=_0x2aa679,this[_0x461c35(0x243)]=_0x196196;}['validate'](){const _0x2867dd=_0x549764;let _0x32acbd;_0x32acbd=(0x0,util_1[_0x2867dd(0x251)])(this[_0x2867dd(0x214)],'host');if(_0x32acbd!=null)return _0x32acbd;_0x32acbd=(0x0,util_1['validateNotEmpty'])(this[_0x2867dd(0x236)],_0x2867dd(0x236));if(_0x32acbd!=null)return _0x32acbd;_0x32acbd=(0x0,util_1[_0x2867dd(0x251)])(this[_0x2867dd(0x228)],_0x2867dd(0x228));if(_0x32acbd!=null)return _0x32acbd;if(!this[_0x2867dd(0x24b)])return _0x2867dd(0x22d);_0x32acbd=(0x0,util_1['validateNotEmpty'])(this['iconUrl'],_0x2867dd(0x24b));if(_0x32acbd!=null)return _0x32acbd;return _0x32acbd;}[_0x549764(0x1d3)](){const _0x4fd914=_0x549764;return'['+this[_0x4fd914(0x206)][_0x4fd914(0x21d)]((_0x18c876,_0x5f2a68)=>_0x18c876[_0x4fd914(0x1e5)](_0x5f2a68))[_0x4fd914(0x21f)](',')+']';}static[_0x549764(0x267)](_0x4adc17,_0x42a624){const _0x405e2a=_0x549764;var _0x9d1b72;let _0x5090a7=(0x0,util_1[_0x405e2a(0x20d)])(_0x42a624[_0x405e2a(0x23c)],SIX_TO_FIVE_ICON_SIZE);const _0xea87cd=null,_0x143713=Boolean(_0x5090a7);!_0x143713&&(_0x5090a7=(0x0,util_1['findSuitableIcon'])(_0x42a624[_0x405e2a(0x23c)],'maskable',MIN_ICON_SIZE)||(0x0,util_1[_0x405e2a(0x26b)])(_0x42a624[_0x405e2a(0x23c)],'any',0x1));const _0xd5539=(0x0,util_1[_0x405e2a(0x26b)])(_0x42a624['icons'],_0x405e2a(0x256),MIN_NOTIFICATION_ICON_SIZE),_0x4cf478=new URL(_0x42a624[_0x405e2a(0x1f2)],_0x4adc17),_0x4f34fc=new URL(_0x42a624[_0x405e2a(0x1f2)]||'/',_0x4adc17),_0x49cd6a=new URL(_0x42a624[_0x405e2a(0x1e7)]||'.',_0x4f34fc);function _0x295d3c(_0x403e62){const _0x128f06=_0x405e2a;return _0x403e62?new URL(_0x403e62[_0x128f06(0x266)],_0x4adc17)[_0x128f06(0x1e5)]():undefined;}const _0x1ddee2=_0x4f34fc[_0x405e2a(0x204)]+_0x4f34fc[_0x405e2a(0x24c)],_0x2ec20e=(0x0,util_1['generatePackageId'])((_0x42a624===null||_0x42a624===void 0x0?void 0x0:_0x42a624['id'])||'',_0x42a624['start_url']||'',_0x4adc17[_0x405e2a(0x244)])||'',_0xd26a67=new TwaManifest({'packageId':_0x2ec20e,'host':_0x4cf478['host'],'name':_0x42a624['name']||_0x42a624[_0x405e2a(0x258)]||DEFAULT_APP_NAME,'launcherName':_0x42a624[_0x405e2a(0x258)]||((_0x9d1b72=_0x42a624[_0x405e2a(0x236)])===null||_0x9d1b72===void 0x0?void 0x0:_0x9d1b72[_0x405e2a(0x20a)](0x0,SHORT_NAME_MAX_SIZE))||DEFAULT_APP_NAME,'display':asDisplayMode(_0x42a624[_0x405e2a(0x245)])||DEFAULT_DISPLAY_MODE,'themeColor':_0x42a624[_0x405e2a(0x1fa)]||DEFAULT_THEME_COLOR,'navigationColor':DEFAULT_NAVIGATION_COLOR,'navigationColorDark':DEFAULT_NAVIGATION_COLOR,'navigationDividerColor':DEFAULT_NAVIGATION_DIVIDER_COLOR,'navigationDividerColorDark':DEFAULT_NAVIGATION_DIVIDER_COLOR,'backgroundColor':_0x42a624[_0x405e2a(0x259)]||DEFAULT_BACKGROUND_COLOR,'startUrl':_0x1ddee2,'iconUrl':_0x295d3c(_0x5090a7),'icons':_0x5090a7!==null?{'icon':{'icon':_0x5090a7,'useOriginalIcon':_0x143713}}:null,'maskableIconUrl':_0x295d3c(_0xea87cd),'monochromeIconUrl':_0x295d3c(_0xd5539),'appVersion':DEFAULT_APP_VERSION_NAME,'generatorTag':GeneratorTagUtils_1[_0x405e2a(0x1d4)][_0x405e2a(0x24d)](_0x2ec20e),'signingKey':{'path':DEFAULT_SIGNING_KEY_PATH,'alias':DEFAULT_SIGNING_KEY_ALIAS},'splashScreenFadeOutDuration':DEFAULT_SPLASHSCREEN_FADEOUT_DURATION,'enableNotifications':DEFAULT_ENABLE_NOTIFICATIONS,'webManifestUrl':_0x4adc17[_0x405e2a(0x1e5)](),'features':{},'shareTarget':TwaManifest['verifyShareTarget'](_0x4adc17,_0x42a624[_0x405e2a(0x1e8)]),'orientation':asOrientation(_0x42a624[_0x405e2a(0x254)])||DEFAULT_ORIENTATION,'fullScopeUrl':_0x49cd6a['toString'](),'webManifest':_0x42a624,'region':process['env']['PICOXR_SERVER_RRGION']||''});return _0xd26a67;}static[_0x549764(0x208)](_0x290cef){const _0x392d74=_0x549764;var _0x3f3602;let _0x545b99=(0x0,util_1[_0x392d74(0x20d)])(_0x290cef['icons'],SIX_TO_FIVE_ICON_SIZE);const _0xdfed02=null,_0x19927a=Boolean(_0x545b99);!_0x19927a&&(_0x545b99=(0x0,util_1['findSuitableIcon'])(_0x290cef[_0x392d74(0x23c)],_0x392d74(0x1da),MIN_ICON_SIZE)||(0x0,util_1[_0x392d74(0x26b)])(_0x290cef[_0x392d74(0x23c)],_0x392d74(0x205),0x1));const _0x142dcb=(0x0,util_1[_0x392d74(0x26b)])(_0x290cef['icons'],_0x392d74(0x256),MIN_NOTIFICATION_ICON_SIZE),_0x5ebb36=new URL(_0x290cef[_0x392d74(0x1f2)]),_0x298d49=new URL(_0x290cef['start_url']||'/',_0x5ebb36),_0x4f451c=_0x298d49[_0x392d74(0x204)]+_0x298d49[_0x392d74(0x24c)],_0x1f1c1f=new URL(_0x290cef['scope']||'.',_0x5ebb36);function _0xeaae6e(_0x312503){const _0x41ab70=_0x392d74;return _0x312503?_0x312503[_0x41ab70(0x266)]:undefined;}const _0x5720d9=(0x0,util_1[_0x392d74(0x1fc)])((_0x290cef===null||_0x290cef===void 0x0?void 0x0:_0x290cef['id'])||'',_0x290cef['start_url'],_0x290cef[_0x392d74(0x1f2)])||'',_0x511625=new TwaManifest({'packageId':_0x5720d9,'host':_0x5ebb36[_0x392d74(0x214)],'name':_0x290cef[_0x392d74(0x236)]||_0x290cef['short_name']||DEFAULT_APP_NAME,'launcherName':_0x290cef['short_name']||((_0x3f3602=_0x290cef[_0x392d74(0x236)])===null||_0x3f3602===void 0x0?void 0x0:_0x3f3602[_0x392d74(0x20a)](0x0,SHORT_NAME_MAX_SIZE))||DEFAULT_APP_NAME,'display':asDisplayMode(_0x290cef[_0x392d74(0x245)])||DEFAULT_DISPLAY_MODE,'themeColor':_0x290cef[_0x392d74(0x1fa)]||DEFAULT_THEME_COLOR,'navigationColor':DEFAULT_NAVIGATION_COLOR,'navigationColorDark':DEFAULT_NAVIGATION_COLOR,'navigationDividerColor':DEFAULT_NAVIGATION_DIVIDER_COLOR,'navigationDividerColorDark':DEFAULT_NAVIGATION_DIVIDER_COLOR,'backgroundColor':_0x290cef[_0x392d74(0x259)]||DEFAULT_BACKGROUND_COLOR,'startUrl':_0x4f451c,'iconUrl':_0xeaae6e(_0x545b99),'icons':_0x545b99!==null?{'icon':{'icon':_0x545b99,'useOriginalIcon':_0x19927a}}:null,'maskableIconUrl':_0xeaae6e(_0xdfed02),'monochromeIconUrl':_0xeaae6e(_0x142dcb),'appVersion':DEFAULT_APP_VERSION_NAME,'generatorTag':GeneratorTagUtils_1['generatorTagUtils'][_0x392d74(0x24d)](_0x5720d9),'signingKey':{'path':DEFAULT_SIGNING_KEY_PATH,'alias':DEFAULT_SIGNING_KEY_ALIAS},'splashScreenFadeOutDuration':DEFAULT_SPLASHSCREEN_FADEOUT_DURATION,'enableNotifications':DEFAULT_ENABLE_NOTIFICATIONS,'webManifestUrl':undefined,'features':{},'shareTarget':TwaManifest[_0x392d74(0x225)](new URL(_0x290cef['start_url']||'/'),_0x290cef[_0x392d74(0x1e8)]),'orientation':asOrientation(_0x290cef[_0x392d74(0x254)])||DEFAULT_ORIENTATION,'fullScopeUrl':_0x1f1c1f['toString'](),'webManifest':_0x290cef,'region':process['env'][_0x392d74(0x21b)]||''});return _0x511625;}[_0x549764(0x20b)](_0x11374e,_0x25849d){const _0x59a0fc=_0x549764;this[_0x59a0fc(0x24a)]=_0x11374e,this[_0x59a0fc(0x243)]=_0x25849d;}static[_0x549764(0x225)](_0x4dc9b0,_0x2932e4){const _0x4f1fb2=_0x549764;var _0x22b9d8;if(!(_0x2932e4===null||_0x2932e4===void 0x0?void 0x0:_0x2932e4[_0x4f1fb2(0x230)]))return undefined;if((_0x22b9d8=_0x2932e4===null||_0x2932e4===void 0x0?void 0x0:_0x2932e4['params'])===null||_0x22b9d8===void 0x0?void 0x0:_0x22b9d8[_0x4f1fb2(0x261)]){const _0x26a0d3=Array[_0x4f1fb2(0x248)](_0x2932e4[_0x4f1fb2(0x1df)][_0x4f1fb2(0x261)])?_0x2932e4[_0x4f1fb2(0x1df)][_0x4f1fb2(0x261)]:_0x2932e4[_0x4f1fb2(0x1df)]['files']?[_0x2932e4[_0x4f1fb2(0x1df)][_0x4f1fb2(0x261)]]:[];for(const _0x43e05a of _0x26a0d3){if(!_0x43e05a[_0x4f1fb2(0x22a)])return undefined;}}return{..._0x2932e4,'action':new URL(_0x2932e4['action'],_0x4dc9b0)[_0x4f1fb2(0x1e5)]()};}static async[_0x549764(0x210)](_0x597d07){const _0x54b244=_0x549764,_0x4d349b=await FetchUtils_1_1[_0x54b244(0x262)][_0x54b244(0x215)](_0x597d07,{'encoding':'binary'});if(_0x4d349b[_0x54b244(0x1e2)]!==0xc8)throw new Error(_0x54b244(0x25e)+_0x597d07+'.'+(_0x54b244(0x247)+_0x4d349b[_0x54b244(0x1e2)]));const _0x39c050=_0x4d349b['headers'][_0x54b244(0x1fe)]?_0x4d349b[_0x54b244(0x1dd)][_0x54b244(0x1fe)]('content-type'):_0x4d349b[_0x54b244(0x1dd)][_0x54b244(0x1f1)];if(_0x39c050&&_0x39c050[_0x54b244(0x241)](_0x54b244(0x224))===-0x1&&_0x39c050[_0x54b244(0x241)]('application/manifest+json')===-0x1&&_0x39c050[_0x54b244(0x241)](_0x54b244(0x25f))===-0x1&&_0x39c050[_0x54b244(0x241)](_0x54b244(0x233))===-0x1)throw new Error('Manifest\x20file\x20with\x20ContentType\x20'+_0x39c050+'\x20is\x20not\x20a\x20legal\x20JSON\x20file,\x20please\x20reconfigure');let _0x1af55d;_0x4d349b[_0x54b244(0x23b)]?_0x1af55d=await _0x4d349b[_0x54b244(0x23b)]():[_0x54b244(0x1fb),_0x54b244(0x227),'br'][_0x54b244(0x21a)](_0x4d349b[_0x54b244(0x1dd)][_0x54b244(0x246)])?_0x1af55d=FetchUtils_1_1[_0x54b244(0x262)][_0x54b244(0x264)](Buffer[_0x54b244(0x1ff)](_0x4d349b[_0x54b244(0x1e4)],_0x54b244(0x229)),_0x4d349b[_0x54b244(0x1dd)]['content-encoding'])[_0x54b244(0x1e5)]():_0x1af55d=Buffer[_0x54b244(0x1ff)](_0x4d349b[_0x54b244(0x1e4)],_0x54b244(0x229))[_0x54b244(0x1e5)]();const _0x1b646f=JSON['parse'](_0x1af55d['trim']()),_0x1f42a7=new URL(_0x597d07);return TwaManifest[_0x54b244(0x267)](_0x1f42a7,_0x1b646f);}static async[_0x549764(0x22b)](_0x4ee81d){const _0x343306=_0x549764,_0x22da4d=JSON['parse']((await fs[_0x343306(0x1f6)]['readFile'](_0x4ee81d))[_0x343306(0x1e5)]());return new TwaManifest(_0x22da4d);}static[_0x549764(0x237)](_0x2883ca,_0x3da900,_0x580135,_0x13fbda){const _0x1ed7f8=_0x549764;if(_0x3da900[_0x1ed7f8(0x21a)](_0x2883ca))return _0x580135;return _0x13fbda||_0x580135;}static[_0x549764(0x239)](_0x10beae,_0x1fd027){const _0x528d98=_0x549764,_0x31c24a=[];for(let _0x3b7b99=0x0;_0x3b7b99<(_0x1fd027[_0x528d98(0x206)]||[])[_0x528d98(0x26a)];_0x3b7b99++){const _0x34992a=_0x1fd027[_0x528d98(0x206)][_0x3b7b99];try{const _0x38ec3e=ShortcutInfo_1['ShortcutInfo'][_0x528d98(0x21e)](_0x10beae,_0x34992a);_0x38ec3e!=null&&_0x31c24a[_0x528d98(0x1f0)](_0x38ec3e);}catch(_0x5f049d){TwaManifest['log'][_0x528d98(0x216)](_0x528d98(0x23f)+_0x3b7b99+']\x20for\x20'+_0x5f049d+'.');}if(_0x31c24a[_0x528d98(0x26a)]===0x4)break;}return _0x31c24a;}static[_0x549764(0x1e0)](_0x12ea30,_0x219609,_0x5b2a70,_0x5d1762,_0x19b114,_0x23613e,_0xc35ab0){const _0x12299e=_0x549764;function _0x48aad4(_0x4093c2){const _0x4d6a30=_0x439e;return _0x4093c2?new URL(_0x4093c2[_0x4d6a30(0x266)],_0xc35ab0)[_0x4d6a30(0x1e5)]():undefined;}return _0x12ea30[_0x12299e(0x21a)](_0x219609)?_0x5b2a70:_0x48aad4((0x0,util_1['findSuitableIcon'])(_0x5d1762,_0x19b114,_0x23613e));}static async[_0x549764(0x25b)](_0x3cf49e,_0x2801ff,_0x3b2b6a,_0x54df54){const _0x40d91d=_0x549764;var _0x3e3634,_0x3b5238;let _0x5f10b0=_0x54df54[_0x40d91d(0x206)];!_0x3cf49e['includes']('shortcuts')&&(_0x5f10b0=this['getShortcuts'](_0x2801ff,_0x3b2b6a));const _0x594fe7=_0x54df54[_0x40d91d(0x1d9)](),_0x3c9ecc=this['getNewIconUrl'](_0x3cf49e,_0x40d91d(0x23c),_0x594fe7[_0x40d91d(0x24b)],_0x3b2b6a[_0x40d91d(0x23c)],_0x40d91d(0x205),MIN_ICON_SIZE,_0x2801ff),_0x5483a8=this[_0x40d91d(0x1e0)](_0x3cf49e,_0x40d91d(0x23a),_0x594fe7[_0x40d91d(0x24b)],_0x3b2b6a[_0x40d91d(0x23c)],_0x40d91d(0x1da),MIN_ICON_SIZE,_0x2801ff),_0x2aeffc=this[_0x40d91d(0x1e0)](_0x3cf49e,_0x40d91d(0x1f8),_0x594fe7[_0x40d91d(0x24b)],_0x3b2b6a['icons'],_0x40d91d(0x256),MIN_NOTIFICATION_ICON_SIZE,_0x2801ff),_0x2b1399=new URL(_0x3b2b6a[_0x40d91d(0x1f2)]||'/',_0x2801ff),_0xf2773f=new URL(_0x3b2b6a['scope']||'.',_0x2801ff),_0x330a83=new TwaManifest({..._0x594fe7,'name':this['getNewFieldValue'](_0x40d91d(0x236),_0x3cf49e,_0x54df54['name'],_0x3b2b6a[_0x40d91d(0x236)]||_0x3b2b6a[_0x40d91d(0x258)]),'launcherName':this[_0x40d91d(0x237)]('short_name',_0x3cf49e,_0x54df54[_0x40d91d(0x1f4)],_0x3b2b6a[_0x40d91d(0x258)]||((_0x3e3634=_0x3b2b6a['name'])===null||_0x3e3634===void 0x0?void 0x0:_0x3e3634['substring'](0x0,SHORT_NAME_MAX_SIZE))),'display':this['getNewFieldValue'](_0x40d91d(0x245),_0x3cf49e,_0x54df54[_0x40d91d(0x245)],asDisplayMode(_0x3b2b6a[_0x40d91d(0x245)])),'fullScopeUrl':this[_0x40d91d(0x237)]('fullScopeUrl',_0x3cf49e,(_0x3b5238=_0x54df54[_0x40d91d(0x1e3)])===null||_0x3b5238===void 0x0?void 0x0:_0x3b5238[_0x40d91d(0x1e5)](),_0xf2773f[_0x40d91d(0x1e5)]()),'themeColor':this[_0x40d91d(0x237)](_0x40d91d(0x1eb),_0x3cf49e,_0x54df54[_0x40d91d(0x1eb)][_0x40d91d(0x1d2)](),_0x3b2b6a[_0x40d91d(0x1fa)]),'backgroundColor':this['getNewFieldValue'](_0x40d91d(0x23d),_0x3cf49e,_0x54df54[_0x40d91d(0x23d)][_0x40d91d(0x1d2)](),_0x3b2b6a[_0x40d91d(0x259)]),'startUrl':this[_0x40d91d(0x237)](_0x40d91d(0x228),_0x3cf49e,_0x54df54[_0x40d91d(0x228)],_0x2b1399[_0x40d91d(0x204)]+_0x2b1399[_0x40d91d(0x24c)]),'iconUrl':_0x3c9ecc||_0x594fe7[_0x40d91d(0x24b)],'maskableIconUrl':_0x5483a8||_0x594fe7['maskableIconUrl'],'monochromeIconUrl':_0x2aeffc||_0x594fe7[_0x40d91d(0x255)],'shortcuts':_0x5f10b0});return _0x330a83;}}exports[_0x549764(0x1d5)]=TwaManifest,TwaManifest[_0x549764(0x226)]=new Log_1[(_0x549764(0x260))]('twa-manifest');