@univer-cli/resource-library 1.0.2 → 1.0.4
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/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x3f92f0=_0x4e73;(function(_0x54f979,_0x274d35){const _0x2f58d1=_0x4e73,_0x5d2de9=_0x54f979();while(!![]){try{const _0x17e0e1=parseInt(_0x2f58d1(0x10f))/0x1+-parseInt(_0x2f58d1(0xde))/0x2*(parseInt(_0x2f58d1(0xc6))/0x3)+-parseInt(_0x2f58d1(0x161))/0x4*(parseInt(_0x2f58d1(0x145))/0x5)+parseInt(_0x2f58d1(0xd4))/0x6+parseInt(_0x2f58d1(0x111))/0x7*(parseInt(_0x2f58d1(0x14d))/0x8)+parseInt(_0x2f58d1(0x16c))/0x9*(parseInt(_0x2f58d1(0xeb))/0xa)+-parseInt(_0x2f58d1(0x15c))/0xb;if(_0x17e0e1===_0x274d35)break;else _0x5d2de9['push'](_0x5d2de9['shift']());}catch(_0x5a74dd){_0x5d2de9['push'](_0x5d2de9['shift']());}}}(_0x2d3e,0x5b0cc));import{randomUUID as _0x107d76}from'node:crypto';import{mkdir as _0x4b17cb,readFile as _0x34d870,readdir as _0x2f77cd,rename as _0x5ab312,rm as _0x56af72,stat as _0x4ba3bd,unlink as _0x534074,writeFile as _0x4cdfd2}from'node:fs/promises';function _0x2d3e(){const _0x2dbb25=['byteCount','utf8','root','\x20contains\x20no\x20usable\x20localized\x20text.','timeoutMs','Duplicate\x20registry\x20ID\x20\x22','.type\x20must\x20be\x20\x22image\x22.','.payload.colorEditable','entries','resourceIndex','utf-8','].input.groups','listRegistries','].label','].input.registryId','replace','intrinsicSize','isDirectory','\x22;\x20expected\x20<registryId>/<resourceId>.','toLowerCase','source','cacheRoot','.source.value\x20must\x20be\x20a\x20URL.','Resource\x20exceeds\x20the\x20maximum\x20size\x20of\x20','resource-download-too-many-redirects','744528LeLVyS','resource-export-failed','1542177cgxpOX','keywords','Resource\x20response\x20is\x20not\x20valid\x20UTF-8.','destination','includes','isFinite','.source','test','].input.resources','registries','storagePolicy','group','clearCache','Invalid\x20resource\x20ID\x20\x22','label','map','\x20must\x20be\x20a\x20finite\x20number.','headers','limit','.order','signal','].input.tags','en-US','Failed\x20to\x20download\x20\x22','split','has','handles','aborted','some','path','resource-download-failed','name','decode','globalIndex','manifest','Cannot\x20read\x20resource\x20manifest\x20at\x20','write','type','.groupId','push','Unknown\x20resource\x20\x22','maxBytes','.groupId\x20references\x20unknown\x20group\x20\x22','\x20without\x20a\x20Location\x20header.','.source.value','registrations[','Resource\x20URL\x20must\x20use\x20HTTPS.','text','\x20bytes.','registryById','\x20must\x20be\x20an\x20array.','ResourceLibraryError','5ncbiRv','clear','size','resource-download-insecure-redirect','handle','read','pid','resource-query-empty','16dSKgsg','output','width','find','resource-invalid-svg','resource-download-insecure','\x22\x20is\x20not\x20an\x20SVG\x20document.','searchText','body','\x20ms.','resource-invalid-resource-id','\x22:\x20expected\x20an\x20addressable\x20filesystem-safe\x20component\x20without\x20\x22--\x22.','trim','filter','Invalid\x20resource\x20handle\x20\x22','7143774VpCnHD','resource-download-http','catch','Resource\x20download\x20timed\x20out\x20after\x20','Resource\x20cache\x20root\x20must\x20be\x20an\x20absolute,\x20dedicated\x20directory\x20below\x20the\x20filesystem\x20root;\x20received\x20\x22','2316744tCYIkt','maxRedirects','protocol','\x20ID\x20\x22','resource-download-timeout','value','content-length','.source.value\x20must\x20use\x20HTTPS.','resource-invalid-registry-id','Resource\x20export\x20filename\x20exceeds\x20','.description','136062qGzHvg','code','.intrinsicSize.height','Downloaded\x20resource\x20\x22','done','image','download','resource-download-invalid-svg','registrations\x20must\x20not\x20be\x20empty.','string','resource-manifest-invalid','.id','.source.type\x20must\x20be\x20\x22url\x22.','].input.resources[','fetch','getReader','resource','set','get','manifest.registrations','.intrinsicSize.width','isInteger','options','location','export','fetchImpl','resource-registry-not-found','join','https:','resource-download-invalid-utf8','cache','boolean','manual','\x20must\x20be\x20an\x20object.','6033tWufZH','order','registry','resourceByHandle','.payload','.intrinsicSize\x20must\x20be\x20positive.','.tagIds','normalize','defaultLocale','Resource\x20server\x20returned\x20HTTP\x20','colorEditable','isArray','Invalid\x20resource\x20manifest:\x20','Resource\x20request\x20redirected\x20to\x20a\x20non-HTTPS\x20URL.','4374510ZOKVmC','.tmp','resource-invalid-handle','isFile','tags','catalog','Resource\x20request\x20followed\x20too\x20many\x20redirects;\x20maximum\x20','Resource\x20server\x20returned\x20an\x20invalid\x20redirect\x20URL.','resource-download-too-large','status','326cFVLCz','.resource-','resource-cache-root-invalid','message','resourceCount','cacheLocation','description','length','registrationIndex','.svg','ENOENT','].id','resource-manifest-read-failed','10eCfjIc','registryId','queries','cancel','parse','url','startsWith','resource-download-invalid-redirect','Unknown\x20resource\x20registry\x20\x22','resources','tagIds'];_0x2d3e=function(){return _0x2dbb25;};return _0x2d3e();}import{dirname as _0x4a23b9,isAbsolute as _0x1f49fc,join as _0x3f572f,parse as _0x123e1d,resolve as _0x3b7b1d}from'node:path';import{readFileSync as _0x536353}from'node:fs';var h=class extends Error{[_0x3f92f0(0x16d)];[_0x3f92f0(0x149)];constructor(_0x4b3b24,_0x41f367,_0x360d7a,_0x1637fd){const _0x30b811=_0x3f92f0;super(_0x41f367,_0x1637fd),this[_0x30b811(0x16d)]=_0x4b3b24,this[_0x30b811(0x149)]=_0x360d7a,this['name']=_0x30b811(0x144);}};function g(_0x3c7128){return _0x3c7128 instanceof h;}var _=/^[A-Za-z0-9._-]+$/u,v=0xff,y=0x4;function b(_0x5a3dfb){const _0x326aec=_0x3f92f0;return _[_0x326aec(0x118)](_0x5a3dfb)&&_0x5a3dfb!=='.'&&_0x5a3dfb!=='..';}function x(_0xbbcb9e){const _0x5182cb=_0x3f92f0;if(!b(_0xbbcb9e)||_0xbbcb9e[_0x5182cb(0xf1)]('-')||_0xbbcb9e['includes']('--')||_0xbbcb9e[_0x5182cb(0xe5)]>v)throw new h(_0x5182cb(0x169),'Invalid\x20registry\x20ID\x20\x22'+_0xbbcb9e+_0x5182cb(0x158));}function S(_0x18a211){const _0x1bf3af=_0x3f92f0;if(!b(_0x18a211)||_0x18a211['length']+y>v)throw new h(_0x1bf3af(0x157),_0x1bf3af(0x11e)+_0x18a211+'\x22:\x20expected\x20filesystem-safe\x20characters.');}function C(_0x3ebae8){const _0xc891b7=_0x3f92f0;let _0x1e8c28=_0x3ebae8[_0xc891b7(0x129)]('/');if(_0x1e8c28[_0xc891b7(0xe5)]!==0x2||_0x1e8c28[0x0]===''||_0x1e8c28[0x1]==='')throw new h(_0xc891b7(0xd6),_0xc891b7(0x15b)+_0x3ebae8+_0xc891b7(0x108),_0x3ebae8);let _0x356e2a=_0x1e8c28[0x0],_0x465791=_0x1e8c28[0x1];return x(_0x356e2a),S(_0x465791),{'registryId':_0x356e2a,'resourceId':_0x465791};}function ee(_0x4fc680,_0x3e3925){return x(_0x4fc680),S(_0x3e3925),_0x4fc680+'/'+_0x3e3925;}function w(_0x45a14a){const _0xc17152=_0x3f92f0;let {registryId:_0x40a41c,resourceId:_0x59e060}=C(_0x45a14a),_0x3bfe45=_0x40a41c+'--'+_0x59e060+_0xc17152(0xe7);if(_0x3bfe45[_0xc17152(0xe5)]>v)throw new h('resource-export-filename-too-long',_0xc17152(0x16a)+v+'\x20bytes.',_0x45a14a);return _0x3bfe45;}function T(_0x5326cd){const _0xd5f530=_0x3f92f0;return new h(_0xd5f530(0x176),_0xd5f530(0xd2)+_0x5326cd);}function E(_0x4cb784,_0x452bdd){const _0x15a0c2=_0x3f92f0;if(typeof _0x4cb784!='object'||!_0x4cb784||Array[_0x15a0c2(0xd1)](_0x4cb784))throw T(_0x452bdd+_0x15a0c2(0xc5));return _0x4cb784;}function D(_0x2e921f,_0x23d63f,_0x451329=!0x1){const _0x4970a9=_0x3f92f0;if(_0x451329&&_0x2e921f===void 0x0)return[];if(!Array[_0x4970a9(0xd1)](_0x2e921f))throw T(_0x23d63f+_0x4970a9(0x143));return _0x2e921f;}function O(_0x1f08b0,_0x55a8c4){const _0x39bef8=_0x3f92f0;if(typeof _0x1f08b0!=_0x39bef8(0x175)||_0x1f08b0==='')throw T(_0x55a8c4+'\x20must\x20be\x20a\x20non-empty\x20string.');return _0x1f08b0;}function k(_0x59bec4,_0x1f08b3,_0x2380da=!0x1){const _0x5bd75c=_0x3f92f0;return D(_0x59bec4,_0x1f08b3,_0x2380da)[_0x5bd75c(0x120)]((_0x1ffa62,_0x186223)=>O(_0x1ffa62,_0x1f08b3+'['+_0x186223+']'));}function A(_0xd30961,_0x3d17da){const _0x3fc332=_0x3f92f0;return D(_0xd30961,_0x3d17da,!0x0)[_0x3fc332(0x120)]((_0x398ea0,_0x356b7a)=>{const _0x34eb66=_0x3fc332;if(typeof _0x398ea0!=_0x34eb66(0x175))throw T(_0x3d17da+'['+_0x356b7a+']\x20must\x20be\x20a\x20string.');return _0x398ea0;})[_0x3fc332(0x15a)](_0x4c394b=>_0x4c394b!=='');}function j(_0x28f666,_0x4f6124){const _0x9dc5c8=_0x3f92f0;if(typeof _0x28f666!='number'||!Number[_0x9dc5c8(0x116)](_0x28f666))throw T(_0x4f6124+_0x9dc5c8(0x121));return _0x28f666;}function M(_0x630aa1,_0x59d9b8){const _0x4485ef=_0x3f92f0;if(typeof _0x630aa1!=_0x4485ef(0xc3))throw T(_0x59d9b8+'\x20must\x20be\x20a\x20boolean.');return _0x630aa1;}function N(_0x22de5a,_0x535ec1,_0x4fe51f){const _0x1909f7=_0x3f92f0;if(typeof _0x22de5a==_0x1909f7(0x175)&&_0x22de5a!=='')return _0x22de5a;let _0x5d4dea=E(_0x22de5a,_0x535ec1),_0x10de2f=_0x4fe51f===void 0x0?void 0x0:_0x5d4dea[_0x4fe51f];if(typeof _0x10de2f==_0x1909f7(0x175)&&_0x10de2f!=='')return _0x10de2f;let _0xa715ff=_0x5d4dea[_0x1909f7(0x127)];if(typeof _0xa715ff=='string'&&_0xa715ff!=='')return _0xa715ff;let _0x1a3fb4=Object['values'](_0x5d4dea)[_0x1909f7(0x150)](_0x4e56a8=>typeof _0x4e56a8=='string'&&_0x4e56a8!=='');if(_0x1a3fb4!==void 0x0)return _0x1a3fb4;throw T(_0x535ec1+_0x1909f7(0xf9));}function P(_0x733e9f,_0x337d65,_0xd2bb66){const _0x307ddf=_0x3f92f0;try{_0xd2bb66===_0x307ddf(0xc8)?x(_0x733e9f):S(_0x733e9f);}catch(_0x5894c2){throw T(_0x337d65+':\x20'+(_0x5894c2 instanceof Error?_0x5894c2[_0x307ddf(0xe1)]:String(_0x5894c2)));}}function F(_0x23d4f6,_0x5b5ac1,_0x36932f){const _0x300143=_0x3f92f0;let _0x4358a7=new Map();for(let [_0x1eee78,_0x2db4bf]of D(_0x23d4f6,_0x5b5ac1,!0x0)[_0x300143(0xfe)]()){let _0x1c975a=E(_0x2db4bf,_0x5b5ac1+'['+_0x1eee78+']'),_0xa3cebb=O(_0x1c975a['id'],_0x5b5ac1+'['+_0x1eee78+_0x300143(0xe9));if(P(_0xa3cebb,_0x5b5ac1+'['+_0x1eee78+'].id','resource'),_0x4358a7[_0x300143(0x12a)](_0xa3cebb))throw T('Duplicate\x20'+_0x5b5ac1+_0x300143(0x164)+_0xa3cebb+'\x22.');_0x4358a7['set'](_0xa3cebb,N(_0x1c975a['label'],_0x5b5ac1+'['+_0x1eee78+_0x300143(0x103),_0x36932f));}return _0x4358a7;}function I(_0x3f450d,_0x311b9c){const _0x4b2586=_0x3f92f0;let _0x466211=E(_0x3f450d[_0x4b2586(0x106)],_0x311b9c+'.intrinsicSize'),_0x18c894=j(_0x466211[_0x4b2586(0x14f)],_0x311b9c+_0x4b2586(0x180)),_0x480a84=j(_0x466211['height'],_0x311b9c+_0x4b2586(0x16e));if(_0x18c894<=0x0||_0x480a84<=0x0)throw T(_0x311b9c+_0x4b2586(0xcb));return{'width':_0x18c894,'height':_0x480a84};}function L(_0x5d0a5c,_0x55b40c){const _0xde957=_0x3f92f0;if(_0x5d0a5c[_0xde957(0x136)]!==_0xde957(0x171))throw T(_0x55b40c+_0xde957(0xfc));if(_0x5d0a5c[_0xde957(0x11b)]!=='reference')throw T(_0x55b40c+'.storagePolicy\x20must\x20be\x20\x22reference\x22.');let _0x1e876a=E(_0x5d0a5c[_0xde957(0x10a)],_0x55b40c+_0xde957(0x117));if(_0x1e876a[_0xde957(0x136)]!==_0xde957(0xf0))throw T(_0x55b40c+_0xde957(0x178));let _0x508e20=O(_0x1e876a['value'],_0x55b40c+_0xde957(0x13d)),_0x885651;try{_0x885651=new URL(_0x508e20);}catch{throw T(_0x55b40c+_0xde957(0x10c));}if(_0x885651[_0xde957(0x163)]!==_0xde957(0xc0))throw T(_0x55b40c+_0xde957(0x168));return _0x508e20;}function R(_0xda69f3){const _0x47a860=_0x3f92f0;return _0xda69f3[_0x47a860(0xcd)]('NFKC')[_0x47a860(0x109)]()[_0x47a860(0x159)]()[_0x47a860(0x105)](/\s+/gu,'\x20');}function z(_0x41e0f3){const _0x3beda6=_0x3f92f0;let _0x2b0983=E(_0x41e0f3,_0x3beda6(0x133)),_0x48805c=new Map(),_0x9bab84=new Map(),_0x35169e=[],_0x599098=[],_0x577277=new Set(),_0x281462=0x0;for(let [_0x1e71ae,_0x438b13]of D(_0x2b0983['registrations'],_0x3beda6(0x17f))['entries']()){let _0x247b42=E(E(_0x438b13,'registrations['+_0x1e71ae+']')['input'],_0x3beda6(0x13e)+_0x1e71ae+'].input'),_0x11d243=O(_0x247b42['registryId'],'registrations['+_0x1e71ae+'].input.registryId');if(P(_0x11d243,_0x3beda6(0x13e)+_0x1e71ae+_0x3beda6(0x104),'registry'),_0x48805c[_0x3beda6(0x12a)](_0x11d243))throw T(_0x3beda6(0xfb)+_0x11d243+'\x22.');let _0x3be7b5=_0x247b42[_0x3beda6(0xce)]===void 0x0?void 0x0:O(_0x247b42['defaultLocale'],_0x3beda6(0x13e)+_0x1e71ae+'].input.defaultLocale'),_0x27a8cb=F(_0x247b42['groups'],_0x3beda6(0x13e)+_0x1e71ae+_0x3beda6(0x101),_0x3be7b5),_0x6d2f57=F(_0x247b42[_0x3beda6(0xd8)],'registrations['+_0x1e71ae+_0x3beda6(0x126),_0x3be7b5),_0x21449a=[];for(let [_0x497200,_0x4943a6]of D(_0x247b42['resources'],'registrations['+_0x1e71ae+_0x3beda6(0x119))[_0x3beda6(0xfe)]()){let _0x2f8d82=_0x3beda6(0x13e)+_0x1e71ae+_0x3beda6(0x179)+_0x497200+']',_0x6be24f=E(_0x4943a6,_0x2f8d82),_0x3d9a2b=O(_0x6be24f['id'],_0x2f8d82+_0x3beda6(0x177));P(_0x3d9a2b,_0x2f8d82+_0x3beda6(0x177),_0x3beda6(0x17c));let _0x1c7372=ee(_0x11d243,_0x3d9a2b);if(_0x9bab84['has'](_0x1c7372))throw T('Duplicate\x20resource\x20handle\x20\x22'+_0x1c7372+'\x22.');let _0x31e968;try{_0x31e968=w(_0x1c7372);}catch(_0x2fd1b1){throw T(_0x2f8d82+':\x20'+(_0x2fd1b1 instanceof Error?_0x2fd1b1[_0x3beda6(0xe1)]:String(_0x2fd1b1)));}if(_0x577277[_0x3beda6(0x12a)](_0x31e968))throw T('Duplicate\x20export\x20filename\x20\x22'+_0x31e968+'\x22.');_0x577277['add'](_0x31e968);let _0x1f78a4=_0x6be24f['groupId']===void 0x0?void 0x0:O(_0x6be24f['groupId'],_0x2f8d82+_0x3beda6(0x137));if(_0x1f78a4!==void 0x0&&!_0x27a8cb[_0x3beda6(0x12a)](_0x1f78a4))throw T(_0x2f8d82+_0x3beda6(0x13b)+_0x1f78a4+'\x22.');let _0xb9a6f6=k(_0x6be24f[_0x3beda6(0xf5)],_0x2f8d82+_0x3beda6(0xcc),!0x0);for(let _0x28613e of _0xb9a6f6)if(!_0x6d2f57[_0x3beda6(0x12a)](_0x28613e))throw T(_0x2f8d82+'.tagIds\x20references\x20unknown\x20tag\x20\x22'+_0x28613e+'\x22.');let _0x86a427=A(_0x6be24f[_0x3beda6(0x112)],_0x2f8d82+'.keywords'),_0x49dd4c=N(_0x6be24f[_0x3beda6(0x130)],_0x2f8d82+'.name',_0x3be7b5),_0x2433c9=_0x6be24f[_0x3beda6(0xe4)]===void 0x0?void 0x0:N(_0x6be24f[_0x3beda6(0xe4)],_0x2f8d82+_0x3beda6(0x16b),_0x3be7b5),_0x1edbb2=_0x1f78a4===void 0x0?null:{'id':_0x1f78a4,'label':_0x27a8cb[_0x3beda6(0x17e)](_0x1f78a4)},_0x555308=_0xb9a6f6[_0x3beda6(0x120)](_0x2b334b=>({'id':_0x2b334b,'label':_0x6d2f57['get'](_0x2b334b)})),_0x4d054b=E(_0x6be24f['payload'],_0x2f8d82+'.payload'),_0xb3339c=_0x6be24f[_0x3beda6(0xc7)]===void 0x0?null:j(_0x6be24f[_0x3beda6(0xc7)],_0x2f8d82+_0x3beda6(0x124)),_0x28fea9=M(_0x4d054b[_0x3beda6(0xd0)],_0x2f8d82+_0x3beda6(0xfd)),_0x294e2d={'handle':_0x1c7372,'registryId':_0x11d243,'id':_0x3d9a2b,'name':_0x49dd4c,..._0x2433c9===void 0x0?{}:{'description':_0x2433c9},'group':_0x1edbb2,'tags':_0x555308,'keywords':_0x86a427,'order':_0xb3339c,'intrinsicSize':I(_0x4d054b,_0x2f8d82+_0x3beda6(0xca)),'colorEditable':_0x28fea9,'sourceUrl':L(_0x4d054b,_0x2f8d82+'.payload'),'registrationIndex':_0x1e71ae,'resourceIndex':_0x497200,'globalIndex':_0x281462,'searchText':R([_0x49dd4c,_0x2433c9,_0x1edbb2?.[_0x3beda6(0x11f)],..._0x555308[_0x3beda6(0x120)](_0x47efef=>_0x47efef[_0x3beda6(0x11f)]),..._0x86a427][_0x3beda6(0x15a)](_0x3ff654=>_0x3ff654!==void 0x0)[_0x3beda6(0xbf)]('\x20'))};_0x281462++,_0x21449a[_0x3beda6(0x138)](_0x294e2d),_0x599098[_0x3beda6(0x138)](_0x294e2d),_0x9bab84['set'](_0x1c7372,_0x294e2d);}let _0x563840={'id':_0x11d243,'groups':_0x27a8cb,'tags':_0x6d2f57,'resources':_0x21449a};_0x35169e[_0x3beda6(0x138)](_0x563840),_0x48805c[_0x3beda6(0x17d)](_0x11d243,_0x563840);}if(_0x35169e[_0x3beda6(0xe5)]===0x0)throw T(_0x3beda6(0x174));return{'registries':_0x35169e,'registryById':_0x48805c,'resourceByHandle':_0x9bab84,'resources':_0x599098};}function B(_0x161149,_0x137931){const _0x5e9ffe=_0x3f92f0;C(_0x137931);let _0x5a7b23=_0x161149[_0x5e9ffe(0xc9)][_0x5e9ffe(0x17e)](_0x137931);if(_0x5a7b23===void 0x0)throw new h('resource-not-found',_0x5e9ffe(0x139)+_0x137931+'\x22;\x20try\x20resources\x20find\x20<query>.',_0x137931);return _0x5a7b23;}function te(_0x5b1220){const _0x11dbf8=_0x3f92f0;return _0x5b1220[_0x11dbf8(0x11a)][_0x11dbf8(0x120)](_0x50a88b=>({'id':_0x50a88b['id'],'resourceCount':_0x50a88b[_0x11dbf8(0xf4)][_0x11dbf8(0xe5)],'groupCount':_0x50a88b['groups']['size'],'tagCount':_0x50a88b['tags']['size'],'colorEditableCount':_0x50a88b['resources'][_0x11dbf8(0x15a)](_0x32f6b0=>_0x32f6b0[_0x11dbf8(0xd0)])[_0x11dbf8(0xe5)]}));}function ne(_0xb333cc){const _0xd446e8=_0x3f92f0;return{'handle':_0xb333cc[_0xd446e8(0x149)],'registryId':_0xb333cc[_0xd446e8(0xec)],'id':_0xb333cc['id'],'name':_0xb333cc['name'],'group':_0xb333cc[_0xd446e8(0x11c)],'tags':_0xb333cc[_0xd446e8(0xd8)],'keywords':_0xb333cc[_0xd446e8(0x112)],'order':_0xb333cc[_0xd446e8(0xc7)],'intrinsicSize':_0xb333cc[_0xd446e8(0x106)],'colorEditable':_0xb333cc[_0xd446e8(0xd0)]};}function re(_0x49ada4,_0x490460){const _0x48038f=_0x3f92f0;let _0x3a5bcf=(_0x49ada4[_0x48038f(0xc7)]??_0x49ada4[_0x48038f(0x132)])-(_0x490460[_0x48038f(0xc7)]??_0x490460[_0x48038f(0x132)]);if(_0x3a5bcf!==0x0)return _0x3a5bcf;let _0x4a4e64=_0x49ada4[_0x48038f(0xe6)]-_0x490460['registrationIndex'];if(_0x4a4e64!==0x0)return _0x4a4e64;let _0x3306eb=_0x49ada4[_0x48038f(0xff)]-_0x490460[_0x48038f(0xff)];return _0x3306eb===0x0?_0x49ada4[_0x48038f(0x149)]['localeCompare'](_0x490460[_0x48038f(0x149)]):_0x3306eb;}function ie(_0x518371,_0x5521fd){const _0x36157d=_0x3f92f0;let _0x3c84e9=_0x5521fd[_0x36157d(0xed)][_0x36157d(0x120)](R)[_0x36157d(0x15a)](_0x2bf552=>_0x2bf552!=='');if(_0x3c84e9[_0x36157d(0xe5)]===0x0)throw new h(_0x36157d(0x14c),'Resource\x20search\x20needs\x20at\x20least\x20one\x20non-empty\x20query.');let _0x438ff7=new Set(_0x5521fd['registries']??[]);for(let _0xdb5510 of _0x438ff7)if(!_0x518371[_0x36157d(0x142)]['has'](_0xdb5510))throw new h(_0x36157d(0x186),_0x36157d(0xf3)+_0xdb5510+'\x22.');let _0x54b763=_0x5521fd[_0x36157d(0x123)]??_0x518371[_0x36157d(0xf4)][_0x36157d(0xe5)];if(!Number[_0x36157d(0x181)](_0x54b763)||_0x54b763<0x1)throw new h('resource-limit-invalid','Resource\x20search\x20limit\x20must\x20be\x20a\x20positive\x20integer;\x20received\x20\x22'+_0x54b763+'\x22.');let _0x25682a=_0x518371[_0x36157d(0xf4)]['filter'](_0xb893cc=>_0x438ff7[_0x36157d(0x147)]===0x0||_0x438ff7[_0x36157d(0x12a)](_0xb893cc[_0x36157d(0xec)]))['filter'](_0xe12e1d=>_0x3c84e9[_0x36157d(0x12d)](_0x2c9f70=>_0xe12e1d[_0x36157d(0x154)][_0x36157d(0x115)](_0x2c9f70)))['sort'](re);return{'resources':_0x25682a['slice'](0x0,_0x54b763)[_0x36157d(0x120)](ne),'total':_0x25682a[_0x36157d(0xe5)]};}function V(_0x1a7bfa){const _0x56798c=_0x3f92f0;return/^\s*(?:<\?xml[^>]*>\s*)?(?:<!--[^]*?-->\s*)*<svg(?:\s|>)/iu[_0x56798c(0x118)](_0x1a7bfa);}function H(_0x2e51c0,_0x4d3aa4){const _0x362052=_0x3f92f0;return g(_0x4d3aa4)?{'handle':_0x2e51c0,'code':_0x4d3aa4[_0x362052(0x16d)],'message':_0x4d3aa4[_0x362052(0xe1)]}:{'handle':_0x2e51c0,'code':_0x362052(0x110),'message':_0x4d3aa4 instanceof Error?_0x4d3aa4[_0x362052(0xe1)]:String(_0x4d3aa4)};}var U=class{[_0x3f92f0(0x182)];[_0x3f92f0(0xd9)];constructor(_0x3244e9){const _0x92fe1b=_0x3f92f0;this[_0x92fe1b(0x182)]=_0x3244e9,this[_0x92fe1b(0xd9)]=z(_0x3244e9['manifest']);}get[_0x3f92f0(0xe3)](){const _0x44faa6=_0x3f92f0;return this['options']['cache'][_0x44faa6(0x183)];}[_0x3f92f0(0x102)](){const _0x263110=_0x3f92f0;return te(this[_0x263110(0xd9)]);}[_0x3f92f0(0x150)](_0x146dd6){const _0x3aaadc=_0x3f92f0;return ie(this[_0x3aaadc(0xd9)],_0x146dd6);}async[_0x3f92f0(0x14a)](_0x21eaec){const _0x42f80e=_0x3f92f0;let _0x113e4e=B(this['catalog'],_0x21eaec[_0x42f80e(0x149)]),_0x30a0a2=await this['options'][_0x42f80e(0xc2)][_0x42f80e(0x14a)](_0x21eaec['handle']);if(_0x30a0a2!==void 0x0&&V(_0x30a0a2))return{'handle':_0x21eaec[_0x42f80e(0x149)],'svg':_0x30a0a2};let _0x14c50e;try{_0x14c50e=await this[_0x42f80e(0x182)]['downloader'][_0x42f80e(0x172)](_0x113e4e['sourceUrl']);}catch(_0x2f0c24){throw g(_0x2f0c24)?_0x2f0c24:new h(_0x42f80e(0x12f),_0x42f80e(0x128)+_0x21eaec[_0x42f80e(0x149)]+'\x22:\x20'+(_0x2f0c24 instanceof Error?_0x2f0c24[_0x42f80e(0xe1)]:String(_0x2f0c24)),_0x21eaec[_0x42f80e(0x149)],{'cause':_0x2f0c24});}if(!V(_0x14c50e))throw new h(_0x42f80e(0x151),_0x42f80e(0x16f)+_0x21eaec['handle']+_0x42f80e(0x153),_0x21eaec[_0x42f80e(0x149)]);return await this[_0x42f80e(0x182)][_0x42f80e(0xc2)]['write'](_0x21eaec['handle'],_0x14c50e),{'handle':_0x21eaec[_0x42f80e(0x149)],'svg':_0x14c50e};}async[_0x3f92f0(0x184)](_0x184ed5){const _0x3c942f=_0x3f92f0;let _0x1a3d09=[],_0x50e33a=[];for(let _0x18c744 of _0x184ed5[_0x3c942f(0x12b)])try{let {svg:_0x15d564}=await this[_0x3c942f(0x14a)]({'handle':_0x18c744}),_0x39445b=await this[_0x3c942f(0x182)][_0x3c942f(0x14e)][_0x3c942f(0x135)](_0x184ed5[_0x3c942f(0x114)],w(_0x18c744),_0x15d564);_0x1a3d09[_0x3c942f(0x138)]({'handle':_0x18c744,'path':_0x39445b});}catch(_0x5752fc){_0x50e33a[_0x3c942f(0x138)](H(_0x18c744,_0x5752fc));}return{'exported':_0x1a3d09,'failed':_0x50e33a};}async[_0x3f92f0(0x11d)](){const _0x59a75d=_0x3f92f0;return await this[_0x59a75d(0x182)]['cache'][_0x59a75d(0x146)]();}};function W(_0x450b34){return new U(_0x450b34);}function G(_0x2899ed){const _0x4b9725=_0x3f92f0;return _0x2899ed instanceof Error&&_0x4b9725(0x16d)in _0x2899ed;}function K(_0x5a5ed3){const _0x290656=_0x3f92f0;let _0x508e6f=_0x3b7b1d(_0x5a5ed3);if(!_0x1f49fc(_0x5a5ed3)||_0x508e6f===_0x123e1d(_0x508e6f)[_0x290656(0xf8)])throw new h(_0x290656(0xe0),_0x290656(0x160)+_0x5a5ed3+'\x22.');return _0x508e6f;}async function q(_0x2c2094){const _0x33b3e3=_0x3f92f0;let _0x15b2f6;try{_0x15b2f6=await _0x2f77cd(_0x2c2094,{'withFileTypes':!0x0});}catch(_0x435e94){if(G(_0x435e94)&&_0x435e94[_0x33b3e3(0x16d)]===_0x33b3e3(0xe8))return{'resourceCount':0x0,'byteCount':0x0};throw _0x435e94;}let _0x14be52=0x0,_0x4a8be2=0x0;for(let _0xcbac22 of _0x15b2f6){let _0x5675c1=_0x3f572f(_0x2c2094,_0xcbac22[_0x33b3e3(0x130)]);if(_0xcbac22[_0x33b3e3(0x107)]()){let _0x1da3ed=await q(_0x5675c1);_0x14be52+=_0x1da3ed[_0x33b3e3(0xe2)],_0x4a8be2+=_0x1da3ed[_0x33b3e3(0xf6)];}else{if(_0xcbac22[_0x33b3e3(0xd7)]()&&_0xcbac22[_0x33b3e3(0x130)]['endsWith'](_0x33b3e3(0xe7))){let _0xadeb09=await _0x4ba3bd(_0x5675c1);_0x14be52++,_0x4a8be2+=_0xadeb09[_0x33b3e3(0x147)];}}}return{'resourceCount':_0x14be52,'byteCount':_0x4a8be2};}var J=class{[_0x3f92f0(0x183)];constructor(_0x219b02){const _0x2d4117=_0x3f92f0;this[_0x2d4117(0x183)]=K(_0x219b02);}[_0x3f92f0(0x12e)](_0x1f5ccc){const _0x734d10=_0x3f92f0;let {registryId:_0x1ad64d,resourceId:_0x455b9a}=C(_0x1f5ccc);return _0x3f572f(this[_0x734d10(0x183)],_0x1ad64d,_0x455b9a+_0x734d10(0xe7));}async[_0x3f92f0(0x14a)](_0x2a489f){const _0x4f66cb=_0x3f92f0;try{return await _0x34d870(this[_0x4f66cb(0x12e)](_0x2a489f),_0x4f66cb(0xf7));}catch(_0x20a515){if(G(_0x20a515)&&_0x20a515[_0x4f66cb(0x16d)]===_0x4f66cb(0xe8))return;throw _0x20a515;}}async['write'](_0x3ab2a1,_0x4e0435){const _0x285134=_0x3f92f0;let _0x468ca6=this[_0x285134(0x12e)](_0x3ab2a1);await _0x4b17cb(_0x4a23b9(_0x468ca6),{'recursive':!0x0});let _0x97b269=_0x3f572f(_0x4a23b9(_0x468ca6),_0x285134(0xdf)+process[_0x285134(0x14b)]+'-'+_0x107d76()+_0x285134(0xd5));try{await _0x4cdfd2(_0x97b269,_0x4e0435,{'encoding':_0x285134(0xf7),'mode':0x180}),await _0x5ab312(_0x97b269,_0x468ca6);}catch(_0x7f8536){throw await _0x534074(_0x97b269)[_0x285134(0x15e)](()=>void 0x0),_0x7f8536;}}async[_0x3f92f0(0x146)](){const _0x4c0944=_0x3f92f0;let _0x37daa8=await q(this['location']);return await _0x56af72(this[_0x4c0944(0x183)],{'force':!0x0,'recursive':!0x0}),{'path':this['location'],..._0x37daa8};}},Y=class{async['write'](_0x113906,_0xff4907,_0x423f39){const _0x240277=_0x3f92f0;await _0x4b17cb(_0x113906,{'recursive':!0x0});let _0x3247c2=_0x3f572f(_0x113906,_0xff4907);return await _0x4cdfd2(_0x3247c2,_0x423f39,_0x240277(0xf7)),_0x3247c2;}},X=0x7530,ae=0xa00000,oe=0xa,se=new Set([0x12d,0x12e,0x12f,0x133,0x134]);function Z(_0x3ce255){const _0x543656=_0x3f92f0;return new h(_0x543656(0xdc),_0x543656(0x10d)+_0x3ce255+_0x543656(0x141));}async function ce(_0x180719,_0x516af0){const _0x14379e=_0x3f92f0;let _0x549780=Number(_0x180719['headers']['get'](_0x14379e(0x167)));if(Number[_0x14379e(0x116)](_0x549780)&&_0x549780>_0x516af0)throw Z(_0x516af0);if(_0x180719[_0x14379e(0x155)]===null){let _0x35ae2c=await _0x180719[_0x14379e(0x140)]();if(Buffer['byteLength'](_0x35ae2c)>_0x516af0)throw Z(_0x516af0);return _0x35ae2c;}let _0x4d7eba=_0x180719[_0x14379e(0x155)][_0x14379e(0x17b)](),_0x3be087=[],_0x27bb7a=0x0;try{for(;;){let _0x3e6e8d=await _0x4d7eba[_0x14379e(0x14a)]();if(_0x3e6e8d[_0x14379e(0x170)])break;if(_0x27bb7a+=_0x3e6e8d[_0x14379e(0x166)]['byteLength'],_0x27bb7a>_0x516af0)throw await _0x4d7eba[_0x14379e(0xee)]()[_0x14379e(0x15e)](()=>void 0x0),Z(_0x516af0);_0x3be087['push'](_0x3e6e8d[_0x14379e(0x166)]);}}finally{_0x4d7eba['releaseLock']();}try{return new TextDecoder(_0x14379e(0x100),{'fatal':!0x0})[_0x14379e(0x131)](Buffer['concat'](_0x3be087,_0x27bb7a));}catch{throw new h(_0x14379e(0xc1),_0x14379e(0x113));}}var Q=class{[_0x3f92f0(0x185)];[_0x3f92f0(0xfa)];['maxBytes'];[_0x3f92f0(0x162)];constructor(_0x5100bc={}){const _0x26bb00=_0x3f92f0;this[_0x26bb00(0x185)]=_0x5100bc[_0x26bb00(0x17a)]??fetch,this[_0x26bb00(0xfa)]=_0x5100bc['timeoutMs']??X,this['maxBytes']=_0x5100bc[_0x26bb00(0x13a)]??ae,this[_0x26bb00(0x162)]=_0x5100bc[_0x26bb00(0x162)]??oe;}async[_0x3f92f0(0x172)](_0x30af96){const _0x5f61b3=_0x3f92f0;let _0x3e92dd=new URL(_0x30af96);if(_0x3e92dd['protocol']!==_0x5f61b3(0xc0))throw new h(_0x5f61b3(0x152),_0x5f61b3(0x13f));let _0x4699a6=new AbortController(),_0x369d41=setTimeout(()=>_0x4699a6['abort'](),this[_0x5f61b3(0xfa)]);try{let _0x2629b4=_0x3e92dd;for(let _0x26f7e1=0x0;;_0x26f7e1++){let _0x542b91=await this[_0x5f61b3(0x185)](_0x2629b4,{'redirect':_0x5f61b3(0xc4),'signal':_0x4699a6[_0x5f61b3(0x125)]});if(se[_0x5f61b3(0x12a)](_0x542b91[_0x5f61b3(0xdd)])){if(_0x26f7e1>=this[_0x5f61b3(0x162)])throw new h(_0x5f61b3(0x10e),_0x5f61b3(0xda)+this[_0x5f61b3(0x162)]+'.');let _0x4c47cc=_0x542b91[_0x5f61b3(0x122)][_0x5f61b3(0x17e)](_0x5f61b3(0x183));if(_0x4c47cc===null)throw new h(_0x5f61b3(0xf2),_0x5f61b3(0xcf)+_0x542b91[_0x5f61b3(0xdd)]+_0x5f61b3(0x13c));let _0x20068a;try{_0x20068a=new URL(_0x4c47cc,_0x2629b4);}catch{throw new h('resource-download-invalid-redirect',_0x5f61b3(0xdb));}if(_0x20068a[_0x5f61b3(0x163)]!==_0x5f61b3(0xc0))throw new h(_0x5f61b3(0x148),_0x5f61b3(0xd3));_0x2629b4=_0x20068a;continue;}if(!_0x542b91['ok'])throw new h(_0x5f61b3(0x15d),_0x5f61b3(0xcf)+_0x542b91[_0x5f61b3(0xdd)]+'.');if(_0x542b91[_0x5f61b3(0xf0)]!==''&&new URL(_0x542b91[_0x5f61b3(0xf0)])[_0x5f61b3(0x163)]!==_0x5f61b3(0xc0))throw new h(_0x5f61b3(0x148),_0x5f61b3(0xd3));let _0x1032c7=await ce(_0x542b91,this[_0x5f61b3(0x13a)]);if(!V(_0x1032c7))throw new h(_0x5f61b3(0x173),'Resource\x20response\x20is\x20not\x20an\x20SVG\x20document.');return _0x1032c7;}}catch(_0x1f909f){throw _0x4699a6[_0x5f61b3(0x125)][_0x5f61b3(0x12c)]?new h(_0x5f61b3(0x165),_0x5f61b3(0x15f)+this[_0x5f61b3(0xfa)]+_0x5f61b3(0x156)):_0x1f909f;}finally{clearTimeout(_0x369d41);}}};function $(_0x2d2ba3){const _0x43192e=_0x3f92f0;try{return JSON[_0x43192e(0xef)](_0x536353(_0x2d2ba3,_0x43192e(0xf7)));}catch(_0x4b923d){throw new h(_0x43192e(0xea),_0x43192e(0x134)+_0x2d2ba3+':\x20'+(_0x4b923d instanceof Error?_0x4b923d[_0x43192e(0xe1)]:String(_0x4b923d)),void 0x0,{'cause':_0x4b923d});}}function _0x4e73(_0x2fe384,_0x3baf2b){_0x2fe384=_0x2fe384-0xbf;const _0x2d3ef0=_0x2d3e();let _0x4e730e=_0x2d3ef0[_0x2fe384];return _0x4e730e;}function le(_0x4afebd){const _0x53fa61=_0x3f92f0;let _0x4697e8;return()=>(_0x4697e8??=W({'manifest':$(_0x4afebd['manifestPath']),'cache':new J(_0x4afebd[_0x53fa61(0x10b)]),'downloader':new Q(_0x4afebd['downloader']),'output':new Y()}),_0x4697e8);}export{J as FilesystemResourceCache,Y as FilesystemResourceOutput,Q as HttpsResourceDownloader,h as ResourceLibraryError,le as createNodeResourceLibraryFactory,W as createResourceLibrary,g as isResourceLibraryError,$ as loadResourceManifestFromPath,K as validateResourceCacheRoot};
|
|
1
|
+
function _0x5e2d(_0x31bec8,_0x43ad2f){_0x31bec8=_0x31bec8-0x1c0;const _0x3fd518=_0x3fd5();let _0x5e2da9=_0x3fd518[_0x31bec8];return _0x5e2da9;}const _0x56d352=_0x5e2d;(function(_0x274019,_0x167050){const _0x426bc3=_0x5e2d,_0x2fa30b=_0x274019();while(!![]){try{const _0x245c19=parseInt(_0x426bc3(0x1f9))/0x1+parseInt(_0x426bc3(0x22d))/0x2*(-parseInt(_0x426bc3(0x24b))/0x3)+-parseInt(_0x426bc3(0x22f))/0x4*(parseInt(_0x426bc3(0x20c))/0x5)+-parseInt(_0x426bc3(0x22e))/0x6+-parseInt(_0x426bc3(0x1e4))/0x7*(parseInt(_0x426bc3(0x263))/0x8)+-parseInt(_0x426bc3(0x274))/0x9+parseInt(_0x426bc3(0x204))/0xa*(parseInt(_0x426bc3(0x283))/0xb);if(_0x245c19===_0x167050)break;else _0x2fa30b['push'](_0x2fa30b['shift']());}catch(_0x364b2b){_0x2fa30b['push'](_0x2fa30b['shift']());}}}(_0x3fd5,0x81e4b));import{randomUUID as _0x2f1947}from'node:crypto';import{mkdir as _0x33a883,readFile as _0x1c1262,readdir as _0x1ac791,rename as _0x33016c,rm as _0x5794c0,stat as _0x4c0366,unlink as _0x3290be,writeFile as _0x6d388f}from'node:fs/promises';import{dirname as _0xad7fe4,isAbsolute as _0x54a8fd,join as _0x2509a7,parse as _0x5f224a,resolve as _0x2f48e4}from'node:path';import{readFileSync as _0x377eb4}from'node:fs';var h=class extends Error{[_0x56d352(0x247)];[_0x56d352(0x284)];constructor(_0x5844a9,_0x6a302c,_0x3fa1ff,_0x2b94ac){const _0x5e7a5a=_0x56d352;super(_0x6a302c,_0x2b94ac),this[_0x5e7a5a(0x247)]=_0x5844a9,this['handle']=_0x3fa1ff,this[_0x5e7a5a(0x282)]=_0x5e7a5a(0x27b);}};function g(_0x5bfc3c){return _0x5bfc3c instanceof h;}var _=/^[A-Za-z0-9._-]+$/u,v=0xff,y=0x4;function _0x3fd5(){const _0x577506=['\x20ms.','\x20must\x20be\x20a\x20boolean.','Cannot\x20read\x20resource\x20manifest\x20at\x20','4679325smWmmJ','tags','.payload','cacheRoot','.resource-','join','signal','ResourceLibraryError','label','Failed\x20to\x20download\x20\x22','registrations[','has','resource-manifest-invalid','values','name','944592oHRVxM','handle','Duplicate\x20','path','registrationIndex','\x22\x20is\x20not\x20an\x20SVG\x20document.','manual','Resource\x20request\x20redirected\x20to\x20a\x20non-HTTPS\x20URL.','resource-download-insecure','manifest','NFKC','test','storagePolicy','isFinite','source','body','Downloaded\x20resource\x20\x22','pid','normalize','byteLength','entries','abort','groupId','sort','resource-download-invalid-utf8','clearCache','cancel','destination','download','Resource\x20request\x20followed\x20too\x20many\x20redirects;\x20maximum\x20','maxRedirects','cacheLocation','.storagePolicy\x20must\x20be\x20\x22reference\x22.','timeoutMs','\x20must\x20be\x20a\x20finite\x20number.','.intrinsicSize.width','Invalid\x20resource\x20ID\x20\x22','registrations','.order','catch','].input.resources','sourceUrl','\x22;\x20expected\x20<registryId>/<resourceId>.','Duplicate\x20export\x20filename\x20\x22','\x20must\x20be\x20an\x20object.','fetchImpl','downloader','manifest.registrations','.source.value\x20must\x20use\x20HTTPS.',']\x20must\x20be\x20a\x20string.','resource-download-invalid-redirect','type','value','4239193fqqZYj','cache','concat','].input.defaultLocale','isInteger','resource-download-too-many-redirects','image','handles','Invalid\x20resource\x20manifest:\x20','includes','registryId','protocol','resources','order','].label','listRegistries','boolean','Invalid\x20registry\x20ID\x20\x22','write','registries','resource-invalid-svg','323259Jmtodk','colorEditable','keywords','headers','resource-download-failed','.tagIds','.source.value','location','Resource\x20response\x20is\x20not\x20an\x20SVG\x20document.','read','utf-8','350AaVVPl','Unknown\x20resource\x20registry\x20\x22','clear','].input.groups','.intrinsicSize','set','description','].input.registryId','10525tLYaoq','.source.type\x20must\x20be\x20\x22url\x22.','url','.source.value\x20must\x20be\x20a\x20URL.','output','get','aborted','\x20without\x20a\x20Location\x20header.','.svg','.payload.colorEditable','resourceByHandle','resource-cache-root-invalid','byteCount','push','resource-download-invalid-svg','input','reference','.groupId','defaultLocale','.name','tagIds','.description','resource-download-insecure-redirect','resource-download-too-large','Resource\x20exceeds\x20the\x20maximum\x20size\x20of\x20','queries','Duplicate\x20registry\x20ID\x20\x22','number','resource-manifest-read-failed','searchText','manifestPath','resource','\x20must\x20be\x20a\x20non-empty\x20string.','4huUGyI','2178738jbrOSq','1220vyZwPn','.tagIds\x20references\x20unknown\x20tag\x20\x22','getReader','Resource\x20cache\x20root\x20must\x20be\x20an\x20absolute,\x20dedicated\x20directory\x20below\x20the\x20filesystem\x20root;\x20received\x20\x22','catalog','isFile','globalIndex','.intrinsicSize\x20must\x20be\x20positive.','toLowerCase','find','Resource\x20server\x20returned\x20HTTP\x20','map','isArray','].id','ENOENT','add','resource-limit-invalid','endsWith','.groupId\x20references\x20unknown\x20group\x20\x22','resource-registry-not-found','message','resource-download-http','\x22:\x20expected\x20filesystem-safe\x20characters.','options','code','\x20must\x20be\x20an\x20array.','status','resource-invalid-registry-id','999096ypvkkm','.source','payload','content-length','some','utf8','].input.resources[','Resource\x20search\x20needs\x20at\x20least\x20one\x20non-empty\x20query.','Duplicate\x20resource\x20handle\x20\x22','Resource\x20download\x20timed\x20out\x20after\x20','registry','filter','size','en-US','resourceIndex','root','resource-invalid-handle','intrinsicSize','Resource\x20search\x20limit\x20must\x20be\x20a\x20positive\x20integer;\x20received\x20\x22','localeCompare','split','\x20bytes.','length','\x22;\x20try\x20resources\x20find\x20<query>.','8yzYINd','.id','resource-invalid-resource-id','parse','startsWith','export','maxBytes','groups','isDirectory','slice','Resource\x20server\x20returned\x20an\x20invalid\x20redirect\x20URL.','string','https:','registrations\x20must\x20not\x20be\x20empty.'];_0x3fd5=function(){return _0x577506;};return _0x3fd5();}function b(_0x548cb0){const _0x4db43c=_0x56d352;return _[_0x4db43c(0x28e)](_0x548cb0)&&_0x548cb0!=='.'&&_0x548cb0!=='..';}function x(_0x12c4d5){const _0x25030c=_0x56d352;if(!b(_0x12c4d5)||_0x12c4d5[_0x25030c(0x267)]('-')||_0x12c4d5[_0x25030c(0x1ed)]('--')||_0x12c4d5['length']>v)throw new h(_0x25030c(0x24a),_0x25030c(0x1f5)+_0x12c4d5+'\x22:\x20expected\x20an\x20addressable\x20filesystem-safe\x20component\x20without\x20\x22--\x22.');}function S(_0x1f2358){const _0x157eab=_0x56d352;if(!b(_0x1f2358)||_0x1f2358[_0x157eab(0x261)]+y>v)throw new h(_0x157eab(0x265),_0x157eab(0x1d3)+_0x1f2358+_0x157eab(0x245));}function C(_0x53d7ca){const _0x2d8451=_0x56d352;let _0x415ed7=_0x53d7ca[_0x2d8451(0x25f)]('/');if(_0x415ed7[_0x2d8451(0x261)]!==0x2||_0x415ed7[0x0]===''||_0x415ed7[0x1]==='')throw new h(_0x2d8451(0x25b),'Invalid\x20resource\x20handle\x20\x22'+_0x53d7ca+_0x2d8451(0x1d9),_0x53d7ca);let _0x379285=_0x415ed7[0x0],_0x4dfff8=_0x415ed7[0x1];return x(_0x379285),S(_0x4dfff8),{'registryId':_0x379285,'resourceId':_0x4dfff8};}function ee(_0x31420e,_0x23742e){return x(_0x31420e),S(_0x23742e),_0x31420e+'/'+_0x23742e;}function w(_0x3d8cf7){const _0x332975=_0x56d352;let {registryId:_0x4099c8,resourceId:_0x1fe501}=C(_0x3d8cf7),_0x535fa5=_0x4099c8+'--'+_0x1fe501+_0x332975(0x214);if(_0x535fa5[_0x332975(0x261)]>v)throw new h('resource-export-filename-too-long','Resource\x20export\x20filename\x20exceeds\x20'+v+_0x332975(0x260),_0x3d8cf7);return _0x535fa5;}function T(_0x395972){const _0x48c3b7=_0x56d352;return new h(_0x48c3b7(0x280),_0x48c3b7(0x1ec)+_0x395972);}function E(_0x4da8b2,_0x37cbe1){const _0x571f2a=_0x56d352;if(typeof _0x4da8b2!='object'||!_0x4da8b2||Array[_0x571f2a(0x23b)](_0x4da8b2))throw T(_0x37cbe1+_0x571f2a(0x1db));return _0x4da8b2;}function D(_0x3f462e,_0x2eae1b,_0x4788cb=!0x1){const _0x111212=_0x56d352;if(_0x4788cb&&_0x3f462e===void 0x0)return[];if(!Array[_0x111212(0x23b)](_0x3f462e))throw T(_0x2eae1b+_0x111212(0x248));return _0x3f462e;}function O(_0x54d290,_0x513483){const _0x1c4008=_0x56d352;if(typeof _0x54d290!='string'||_0x54d290==='')throw T(_0x513483+_0x1c4008(0x22c));return _0x54d290;}function k(_0x108ff9,_0xbd4bfb,_0x33fa65=!0x1){const _0x4e5f20=_0x56d352;return D(_0x108ff9,_0xbd4bfb,_0x33fa65)[_0x4e5f20(0x23a)]((_0x8bd25a,_0x4fbafd)=>O(_0x8bd25a,_0xbd4bfb+'['+_0x4fbafd+']'));}function A(_0x276678,_0x49710d){const _0x48cde3=_0x56d352;return D(_0x276678,_0x49710d,!0x0)[_0x48cde3(0x23a)]((_0x690068,_0x58e663)=>{const _0x5b706f=_0x48cde3;if(typeof _0x690068!=_0x5b706f(0x26e))throw T(_0x49710d+'['+_0x58e663+_0x5b706f(0x1e0));return _0x690068;})[_0x48cde3(0x256)](_0x50aad5=>_0x50aad5!=='');}function j(_0x41455e,_0x3ad99e){const _0x58524f=_0x56d352;if(typeof _0x41455e!=_0x58524f(0x227)||!Number['isFinite'](_0x41455e))throw T(_0x3ad99e+_0x58524f(0x1d1));return _0x41455e;}function M(_0x426542,_0x447a30){const _0x508341=_0x56d352;if(typeof _0x426542!=_0x508341(0x1f4))throw T(_0x447a30+_0x508341(0x272));return _0x426542;}function N(_0x3f847f,_0x2fe6a5,_0x38da7c){const _0x42a2e9=_0x56d352;if(typeof _0x3f847f==_0x42a2e9(0x26e)&&_0x3f847f!=='')return _0x3f847f;let _0x4d739b=E(_0x3f847f,_0x2fe6a5),_0x3c6b64=_0x38da7c===void 0x0?void 0x0:_0x4d739b[_0x38da7c];if(typeof _0x3c6b64==_0x42a2e9(0x26e)&&_0x3c6b64!=='')return _0x3c6b64;let _0x26c061=_0x4d739b[_0x42a2e9(0x258)];if(typeof _0x26c061==_0x42a2e9(0x26e)&&_0x26c061!=='')return _0x26c061;let _0x456e57=Object[_0x42a2e9(0x281)](_0x4d739b)['find'](_0x1074c0=>typeof _0x1074c0==_0x42a2e9(0x26e)&&_0x1074c0!=='');if(_0x456e57!==void 0x0)return _0x456e57;throw T(_0x2fe6a5+'\x20contains\x20no\x20usable\x20localized\x20text.');}function P(_0x2a8add,_0x247719,_0x3828a5){const _0x5c134c=_0x56d352;try{_0x3828a5===_0x5c134c(0x255)?x(_0x2a8add):S(_0x2a8add);}catch(_0x25b88c){throw T(_0x247719+':\x20'+(_0x25b88c instanceof Error?_0x25b88c[_0x5c134c(0x243)]:String(_0x25b88c)));}}function F(_0x200217,_0x599153,_0x1014df){const _0x38ce76=_0x56d352;let _0x587bbc=new Map();for(let [_0x3006ce,_0x2c36f2]of D(_0x200217,_0x599153,!0x0)[_0x38ce76(0x1c3)]()){let _0x2a4140=E(_0x2c36f2,_0x599153+'['+_0x3006ce+']'),_0x3ff0cd=O(_0x2a4140['id'],_0x599153+'['+_0x3006ce+_0x38ce76(0x23c));if(P(_0x3ff0cd,_0x599153+'['+_0x3006ce+'].id',_0x38ce76(0x22b)),_0x587bbc[_0x38ce76(0x27f)](_0x3ff0cd))throw T(_0x38ce76(0x285)+_0x599153+'\x20ID\x20\x22'+_0x3ff0cd+'\x22.');_0x587bbc[_0x38ce76(0x209)](_0x3ff0cd,N(_0x2a4140[_0x38ce76(0x27c)],_0x599153+'['+_0x3006ce+_0x38ce76(0x1f2),_0x1014df));}return _0x587bbc;}function I(_0x1d5a29,_0x5d46df){const _0x43584f=_0x56d352;let _0x5e4d8d=E(_0x1d5a29[_0x43584f(0x25c)],_0x5d46df+_0x43584f(0x208)),_0x2255b3=j(_0x5e4d8d['width'],_0x5d46df+_0x43584f(0x1d2)),_0x44a76a=j(_0x5e4d8d['height'],_0x5d46df+'.intrinsicSize.height');if(_0x2255b3<=0x0||_0x44a76a<=0x0)throw T(_0x5d46df+_0x43584f(0x236));return{'width':_0x2255b3,'height':_0x44a76a};}function L(_0x1cf446,_0x1b6585){const _0x2052b3=_0x56d352;if(_0x1cf446[_0x2052b3(0x1e2)]!==_0x2052b3(0x1ea))throw T(_0x1b6585+'.type\x20must\x20be\x20\x22image\x22.');if(_0x1cf446[_0x2052b3(0x28f)]!==_0x2052b3(0x21c))throw T(_0x1b6585+_0x2052b3(0x1cf));let _0x5bcdb1=E(_0x1cf446[_0x2052b3(0x291)],_0x1b6585+_0x2052b3(0x24c));if(_0x5bcdb1['type']!==_0x2052b3(0x20e))throw T(_0x1b6585+_0x2052b3(0x20d));let _0x13e6a0=O(_0x5bcdb1[_0x2052b3(0x1e3)],_0x1b6585+_0x2052b3(0x1ff)),_0x4adaf9;try{_0x4adaf9=new URL(_0x13e6a0);}catch{throw T(_0x1b6585+_0x2052b3(0x20f));}if(_0x4adaf9[_0x2052b3(0x1ef)]!==_0x2052b3(0x26f))throw T(_0x1b6585+_0x2052b3(0x1df));return _0x13e6a0;}function R(_0x518dce){const _0x451090=_0x56d352;return _0x518dce[_0x451090(0x1c1)](_0x451090(0x28d))[_0x451090(0x237)]()['trim']()['replace'](/\s+/gu,'\x20');}function z(_0x5ab5a1){const _0x3f93b4=_0x56d352;let _0x135c2b=E(_0x5ab5a1,_0x3f93b4(0x28c)),_0x26c6f5=new Map(),_0x1f1bb0=new Map(),_0xb9fb67=[],_0x2757b1=[],_0x584451=new Set(),_0x21e4d1=0x0;for(let [_0x267e80,_0x5718d2]of D(_0x135c2b[_0x3f93b4(0x1d4)],_0x3f93b4(0x1de))['entries']()){let _0x33cd7e=E(E(_0x5718d2,_0x3f93b4(0x27e)+_0x267e80+']')[_0x3f93b4(0x21b)],_0x3f93b4(0x27e)+_0x267e80+'].input'),_0x55a612=O(_0x33cd7e[_0x3f93b4(0x1ee)],'registrations['+_0x267e80+_0x3f93b4(0x20b));if(P(_0x55a612,_0x3f93b4(0x27e)+_0x267e80+_0x3f93b4(0x20b),_0x3f93b4(0x255)),_0x26c6f5[_0x3f93b4(0x27f)](_0x55a612))throw T(_0x3f93b4(0x226)+_0x55a612+'\x22.');let _0x50d95d=_0x33cd7e[_0x3f93b4(0x21e)]===void 0x0?void 0x0:O(_0x33cd7e[_0x3f93b4(0x21e)],_0x3f93b4(0x27e)+_0x267e80+_0x3f93b4(0x1e7)),_0x33b026=F(_0x33cd7e['groups'],_0x3f93b4(0x27e)+_0x267e80+_0x3f93b4(0x207),_0x50d95d),_0x59d9df=F(_0x33cd7e['tags'],_0x3f93b4(0x27e)+_0x267e80+'].input.tags',_0x50d95d),_0x5ebfc5=[];for(let [_0x56625e,_0x3f03fe]of D(_0x33cd7e[_0x3f93b4(0x1f0)],'registrations['+_0x267e80+_0x3f93b4(0x1d7))[_0x3f93b4(0x1c3)]()){let _0x53020c=_0x3f93b4(0x27e)+_0x267e80+_0x3f93b4(0x251)+_0x56625e+']',_0x23da6a=E(_0x3f03fe,_0x53020c),_0x5a14e6=O(_0x23da6a['id'],_0x53020c+'.id');P(_0x5a14e6,_0x53020c+_0x3f93b4(0x264),'resource');let _0x464393=ee(_0x55a612,_0x5a14e6);if(_0x1f1bb0[_0x3f93b4(0x27f)](_0x464393))throw T(_0x3f93b4(0x253)+_0x464393+'\x22.');let _0x57d223;try{_0x57d223=w(_0x464393);}catch(_0x3c891e){throw T(_0x53020c+':\x20'+(_0x3c891e instanceof Error?_0x3c891e[_0x3f93b4(0x243)]:String(_0x3c891e)));}if(_0x584451[_0x3f93b4(0x27f)](_0x57d223))throw T(_0x3f93b4(0x1da)+_0x57d223+'\x22.');_0x584451[_0x3f93b4(0x23e)](_0x57d223);let _0x4f2b1f=_0x23da6a[_0x3f93b4(0x1c5)]===void 0x0?void 0x0:O(_0x23da6a[_0x3f93b4(0x1c5)],_0x53020c+_0x3f93b4(0x21d));if(_0x4f2b1f!==void 0x0&&!_0x33b026[_0x3f93b4(0x27f)](_0x4f2b1f))throw T(_0x53020c+_0x3f93b4(0x241)+_0x4f2b1f+'\x22.');let _0x581c43=k(_0x23da6a[_0x3f93b4(0x220)],_0x53020c+_0x3f93b4(0x1fe),!0x0);for(let _0x511748 of _0x581c43)if(!_0x59d9df[_0x3f93b4(0x27f)](_0x511748))throw T(_0x53020c+_0x3f93b4(0x230)+_0x511748+'\x22.');let _0x287bfb=A(_0x23da6a[_0x3f93b4(0x1fb)],_0x53020c+'.keywords'),_0x59e9d6=N(_0x23da6a[_0x3f93b4(0x282)],_0x53020c+_0x3f93b4(0x21f),_0x50d95d),_0x508292=_0x23da6a[_0x3f93b4(0x20a)]===void 0x0?void 0x0:N(_0x23da6a['description'],_0x53020c+_0x3f93b4(0x221),_0x50d95d),_0x4e16ed=_0x4f2b1f===void 0x0?null:{'id':_0x4f2b1f,'label':_0x33b026['get'](_0x4f2b1f)},_0x2f20cb=_0x581c43[_0x3f93b4(0x23a)](_0x1f42b6=>({'id':_0x1f42b6,'label':_0x59d9df[_0x3f93b4(0x211)](_0x1f42b6)})),_0x31ab2f=E(_0x23da6a[_0x3f93b4(0x24d)],_0x53020c+_0x3f93b4(0x276)),_0x863e90=_0x23da6a['order']===void 0x0?null:j(_0x23da6a['order'],_0x53020c+_0x3f93b4(0x1d5)),_0x22c3a9=M(_0x31ab2f[_0x3f93b4(0x1fa)],_0x53020c+_0x3f93b4(0x215)),_0x4e1006={'handle':_0x464393,'registryId':_0x55a612,'id':_0x5a14e6,'name':_0x59e9d6,..._0x508292===void 0x0?{}:{'description':_0x508292},'group':_0x4e16ed,'tags':_0x2f20cb,'keywords':_0x287bfb,'order':_0x863e90,'intrinsicSize':I(_0x31ab2f,_0x53020c+_0x3f93b4(0x276)),'colorEditable':_0x22c3a9,'sourceUrl':L(_0x31ab2f,_0x53020c+'.payload'),'registrationIndex':_0x267e80,'resourceIndex':_0x56625e,'globalIndex':_0x21e4d1,'searchText':R([_0x59e9d6,_0x508292,_0x4e16ed?.[_0x3f93b4(0x27c)],..._0x2f20cb[_0x3f93b4(0x23a)](_0x44b395=>_0x44b395[_0x3f93b4(0x27c)]),..._0x287bfb]['filter'](_0x5747b8=>_0x5747b8!==void 0x0)[_0x3f93b4(0x279)]('\x20'))};_0x21e4d1++,_0x5ebfc5[_0x3f93b4(0x219)](_0x4e1006),_0x2757b1[_0x3f93b4(0x219)](_0x4e1006),_0x1f1bb0['set'](_0x464393,_0x4e1006);}let _0x120c47={'id':_0x55a612,'groups':_0x33b026,'tags':_0x59d9df,'resources':_0x5ebfc5};_0xb9fb67[_0x3f93b4(0x219)](_0x120c47),_0x26c6f5['set'](_0x55a612,_0x120c47);}if(_0xb9fb67[_0x3f93b4(0x261)]===0x0)throw T(_0x3f93b4(0x270));return{'registries':_0xb9fb67,'registryById':_0x26c6f5,'resourceByHandle':_0x1f1bb0,'resources':_0x2757b1};}function B(_0x34f758,_0x3b3c4e){const _0x453964=_0x56d352;C(_0x3b3c4e);let _0x58c252=_0x34f758[_0x453964(0x216)]['get'](_0x3b3c4e);if(_0x58c252===void 0x0)throw new h('resource-not-found','Unknown\x20resource\x20\x22'+_0x3b3c4e+_0x453964(0x262),_0x3b3c4e);return _0x58c252;}function te(_0x113506){const _0x51a1dd=_0x56d352;return _0x113506[_0x51a1dd(0x1f7)][_0x51a1dd(0x23a)](_0x4848a5=>({'id':_0x4848a5['id'],'resourceCount':_0x4848a5[_0x51a1dd(0x1f0)][_0x51a1dd(0x261)],'groupCount':_0x4848a5[_0x51a1dd(0x26a)][_0x51a1dd(0x257)],'tagCount':_0x4848a5['tags'][_0x51a1dd(0x257)],'colorEditableCount':_0x4848a5[_0x51a1dd(0x1f0)][_0x51a1dd(0x256)](_0x320882=>_0x320882[_0x51a1dd(0x1fa)])[_0x51a1dd(0x261)]}));}function ne(_0x198a51){const _0x339f05=_0x56d352;return{'handle':_0x198a51[_0x339f05(0x284)],'registryId':_0x198a51['registryId'],'id':_0x198a51['id'],'name':_0x198a51[_0x339f05(0x282)],'group':_0x198a51['group'],'tags':_0x198a51[_0x339f05(0x275)],'keywords':_0x198a51[_0x339f05(0x1fb)],'order':_0x198a51[_0x339f05(0x1f1)],'intrinsicSize':_0x198a51[_0x339f05(0x25c)],'colorEditable':_0x198a51[_0x339f05(0x1fa)]};}function re(_0x1b49cd,_0x24271c){const _0x3182e3=_0x56d352;let _0x416b13=(_0x1b49cd['order']??_0x1b49cd['globalIndex'])-(_0x24271c[_0x3182e3(0x1f1)]??_0x24271c[_0x3182e3(0x235)]);if(_0x416b13!==0x0)return _0x416b13;let _0x44335a=_0x1b49cd[_0x3182e3(0x287)]-_0x24271c[_0x3182e3(0x287)];if(_0x44335a!==0x0)return _0x44335a;let _0x55a604=_0x1b49cd[_0x3182e3(0x259)]-_0x24271c[_0x3182e3(0x259)];return _0x55a604===0x0?_0x1b49cd[_0x3182e3(0x284)][_0x3182e3(0x25e)](_0x24271c[_0x3182e3(0x284)]):_0x55a604;}function ie(_0x3831d6,_0x45c595){const _0xab4bfd=_0x56d352;let _0x46b083=_0x45c595[_0xab4bfd(0x225)][_0xab4bfd(0x23a)](R)[_0xab4bfd(0x256)](_0x5f23c5=>_0x5f23c5!=='');if(_0x46b083[_0xab4bfd(0x261)]===0x0)throw new h('resource-query-empty',_0xab4bfd(0x252));let _0x5e2c73=new Set(_0x45c595[_0xab4bfd(0x1f7)]??[]);for(let _0x421629 of _0x5e2c73)if(!_0x3831d6['registryById']['has'](_0x421629))throw new h(_0xab4bfd(0x242),_0xab4bfd(0x205)+_0x421629+'\x22.');let _0x3a45c4=_0x45c595['limit']??_0x3831d6[_0xab4bfd(0x1f0)]['length'];if(!Number[_0xab4bfd(0x1e8)](_0x3a45c4)||_0x3a45c4<0x1)throw new h(_0xab4bfd(0x23f),_0xab4bfd(0x25d)+_0x3a45c4+'\x22.');let _0x300d39=_0x3831d6[_0xab4bfd(0x1f0)]['filter'](_0x28cb90=>_0x5e2c73[_0xab4bfd(0x257)]===0x0||_0x5e2c73[_0xab4bfd(0x27f)](_0x28cb90[_0xab4bfd(0x1ee)]))[_0xab4bfd(0x256)](_0x37f9dd=>_0x46b083[_0xab4bfd(0x24f)](_0x2d0158=>_0x37f9dd[_0xab4bfd(0x229)]['includes'](_0x2d0158)))[_0xab4bfd(0x1c6)](re);return{'resources':_0x300d39[_0xab4bfd(0x26c)](0x0,_0x3a45c4)[_0xab4bfd(0x23a)](ne),'total':_0x300d39[_0xab4bfd(0x261)]};}function V(_0x11e7a8){const _0x4c45ac=_0x56d352;return/^\s*(?:<\?xml[^>]*>\s*)?(?:<!--[^]*?-->\s*)*<svg(?:\s|>)/iu[_0x4c45ac(0x28e)](_0x11e7a8);}function H(_0x24120,_0x3603f7){const _0x4eef75=_0x56d352;return g(_0x3603f7)?{'handle':_0x24120,'code':_0x3603f7[_0x4eef75(0x247)],'message':_0x3603f7[_0x4eef75(0x243)]}:{'handle':_0x24120,'code':'resource-export-failed','message':_0x3603f7 instanceof Error?_0x3603f7[_0x4eef75(0x243)]:String(_0x3603f7)};}var U=class{[_0x56d352(0x246)];[_0x56d352(0x233)];constructor(_0x3c0452){const _0x482ced=_0x56d352;this[_0x482ced(0x246)]=_0x3c0452,this[_0x482ced(0x233)]=z(_0x3c0452[_0x482ced(0x28c)]);}get[_0x56d352(0x1ce)](){const _0x3f2e2f=_0x56d352;return this['options']['cache'][_0x3f2e2f(0x200)];}[_0x56d352(0x1f3)](){return te(this['catalog']);}[_0x56d352(0x238)](_0x228188){return ie(this['catalog'],_0x228188);}async[_0x56d352(0x202)](_0x2c2204){const _0x5dd172=_0x56d352;let _0xf9e748=B(this['catalog'],_0x2c2204[_0x5dd172(0x284)]),_0x265037=await this[_0x5dd172(0x246)][_0x5dd172(0x1e5)][_0x5dd172(0x202)](_0x2c2204[_0x5dd172(0x284)]);if(_0x265037!==void 0x0&&V(_0x265037))return{'handle':_0x2c2204['handle'],'svg':_0x265037};let _0x5f06b9;try{_0x5f06b9=await this[_0x5dd172(0x246)][_0x5dd172(0x1dd)][_0x5dd172(0x1cb)](_0xf9e748[_0x5dd172(0x1d8)]);}catch(_0x49e249){throw g(_0x49e249)?_0x49e249:new h(_0x5dd172(0x1fd),_0x5dd172(0x27d)+_0x2c2204[_0x5dd172(0x284)]+'\x22:\x20'+(_0x49e249 instanceof Error?_0x49e249[_0x5dd172(0x243)]:String(_0x49e249)),_0x2c2204[_0x5dd172(0x284)],{'cause':_0x49e249});}if(!V(_0x5f06b9))throw new h(_0x5dd172(0x1f8),_0x5dd172(0x293)+_0x2c2204[_0x5dd172(0x284)]+_0x5dd172(0x288),_0x2c2204[_0x5dd172(0x284)]);return await this[_0x5dd172(0x246)]['cache']['write'](_0x2c2204['handle'],_0x5f06b9),{'handle':_0x2c2204['handle'],'svg':_0x5f06b9};}async[_0x56d352(0x268)](_0x475cc6){const _0x20cdb8=_0x56d352;let _0x51c999=[],_0x122b97=[];for(let _0x27f589 of _0x475cc6[_0x20cdb8(0x1eb)])try{let {svg:_0x26c811}=await this[_0x20cdb8(0x202)]({'handle':_0x27f589}),_0x554ab5=await this[_0x20cdb8(0x246)][_0x20cdb8(0x210)]['write'](_0x475cc6[_0x20cdb8(0x1ca)],w(_0x27f589),_0x26c811);_0x51c999[_0x20cdb8(0x219)]({'handle':_0x27f589,'path':_0x554ab5});}catch(_0x51c55e){_0x122b97['push'](H(_0x27f589,_0x51c55e));}return{'exported':_0x51c999,'failed':_0x122b97};}async[_0x56d352(0x1c8)](){const _0x57716d=_0x56d352;return await this[_0x57716d(0x246)][_0x57716d(0x1e5)][_0x57716d(0x206)]();}};function W(_0x1aab36){return new U(_0x1aab36);}function G(_0x1aea0a){const _0x34407e=_0x56d352;return _0x1aea0a instanceof Error&&_0x34407e(0x247)in _0x1aea0a;}function K(_0x2f3514){const _0x5bc34c=_0x56d352;let _0x3ad108=_0x2f48e4(_0x2f3514);if(!_0x54a8fd(_0x2f3514)||_0x3ad108===_0x5f224a(_0x3ad108)[_0x5bc34c(0x25a)])throw new h(_0x5bc34c(0x217),_0x5bc34c(0x232)+_0x2f3514+'\x22.');return _0x3ad108;}async function q(_0x311045){const _0x47b39c=_0x56d352;let _0x13ce47;try{_0x13ce47=await _0x1ac791(_0x311045,{'withFileTypes':!0x0});}catch(_0x170b8e){if(G(_0x170b8e)&&_0x170b8e[_0x47b39c(0x247)]===_0x47b39c(0x23d))return{'resourceCount':0x0,'byteCount':0x0};throw _0x170b8e;}let _0x1d62a4=0x0,_0x29eeab=0x0;for(let _0x5e8962 of _0x13ce47){let _0x3d94f1=_0x2509a7(_0x311045,_0x5e8962[_0x47b39c(0x282)]);if(_0x5e8962[_0x47b39c(0x26b)]()){let _0x34e139=await q(_0x3d94f1);_0x1d62a4+=_0x34e139['resourceCount'],_0x29eeab+=_0x34e139[_0x47b39c(0x218)];}else{if(_0x5e8962[_0x47b39c(0x234)]()&&_0x5e8962[_0x47b39c(0x282)][_0x47b39c(0x240)](_0x47b39c(0x214))){let _0x4456ba=await _0x4c0366(_0x3d94f1);_0x1d62a4++,_0x29eeab+=_0x4456ba['size'];}}}return{'resourceCount':_0x1d62a4,'byteCount':_0x29eeab};}var J=class{['location'];constructor(_0x54f583){this['location']=K(_0x54f583);}[_0x56d352(0x286)](_0x3536cd){const _0x4dcbfe=_0x56d352;let {registryId:_0x127635,resourceId:_0x41b4d4}=C(_0x3536cd);return _0x2509a7(this[_0x4dcbfe(0x200)],_0x127635,_0x41b4d4+_0x4dcbfe(0x214));}async[_0x56d352(0x202)](_0x2be305){const _0x3d7212=_0x56d352;try{return await _0x1c1262(this[_0x3d7212(0x286)](_0x2be305),'utf8');}catch(_0xfe656c){if(G(_0xfe656c)&&_0xfe656c[_0x3d7212(0x247)]===_0x3d7212(0x23d))return;throw _0xfe656c;}}async['write'](_0x36a06a,_0x5a51a8){const _0xdbcbe7=_0x56d352;let _0x4a74f9=this[_0xdbcbe7(0x286)](_0x36a06a);await _0x33a883(_0xad7fe4(_0x4a74f9),{'recursive':!0x0});let _0x351cfd=_0x2509a7(_0xad7fe4(_0x4a74f9),_0xdbcbe7(0x278)+process[_0xdbcbe7(0x1c0)]+'-'+_0x2f1947()+'.tmp');try{await _0x6d388f(_0x351cfd,_0x5a51a8,{'encoding':_0xdbcbe7(0x250),'mode':0x180}),await _0x33016c(_0x351cfd,_0x4a74f9);}catch(_0x46be01){throw await _0x3290be(_0x351cfd)[_0xdbcbe7(0x1d6)](()=>void 0x0),_0x46be01;}}async['clear'](){const _0x2697c2=_0x56d352;let _0x435242=await q(this['location']);return await _0x5794c0(this[_0x2697c2(0x200)],{'force':!0x0,'recursive':!0x0}),{'path':this['location'],..._0x435242};}},Y=class{async[_0x56d352(0x1f6)](_0x52e7f3,_0x121e65,_0x563bf9){const _0xbd8e91=_0x56d352;await _0x33a883(_0x52e7f3,{'recursive':!0x0});let _0x41ff54=_0x2509a7(_0x52e7f3,_0x121e65);return await _0x6d388f(_0x41ff54,_0x563bf9,_0xbd8e91(0x250)),_0x41ff54;}},X=0x7530,ae=0xa00000,oe=0xa,se=new Set([0x12d,0x12e,0x12f,0x133,0x134]);function Z(_0x5e6f14){const _0x483e80=_0x56d352;return new h(_0x483e80(0x223),_0x483e80(0x224)+_0x5e6f14+_0x483e80(0x260));}async function ce(_0x44daad,_0x10bd6c){const _0xaf0708=_0x56d352;let _0x99eb04=Number(_0x44daad[_0xaf0708(0x1fc)]['get'](_0xaf0708(0x24e)));if(Number[_0xaf0708(0x290)](_0x99eb04)&&_0x99eb04>_0x10bd6c)throw Z(_0x10bd6c);if(_0x44daad['body']===null){let _0x5f3425=await _0x44daad['text']();if(Buffer[_0xaf0708(0x1c2)](_0x5f3425)>_0x10bd6c)throw Z(_0x10bd6c);return _0x5f3425;}let _0x3987c4=_0x44daad[_0xaf0708(0x292)][_0xaf0708(0x231)](),_0xd77241=[],_0x2d5a82=0x0;try{for(;;){let _0x185732=await _0x3987c4[_0xaf0708(0x202)]();if(_0x185732['done'])break;if(_0x2d5a82+=_0x185732['value'][_0xaf0708(0x1c2)],_0x2d5a82>_0x10bd6c)throw await _0x3987c4[_0xaf0708(0x1c9)]()[_0xaf0708(0x1d6)](()=>void 0x0),Z(_0x10bd6c);_0xd77241[_0xaf0708(0x219)](_0x185732[_0xaf0708(0x1e3)]);}}finally{_0x3987c4['releaseLock']();}try{return new TextDecoder(_0xaf0708(0x203),{'fatal':!0x0})['decode'](Buffer[_0xaf0708(0x1e6)](_0xd77241,_0x2d5a82));}catch{throw new h(_0xaf0708(0x1c7),'Resource\x20response\x20is\x20not\x20valid\x20UTF-8.');}}var Q=class{[_0x56d352(0x1dc)];[_0x56d352(0x1d0)];[_0x56d352(0x269)];[_0x56d352(0x1cd)];constructor(_0x5c7af8={}){const _0x3d1fbf=_0x56d352;this[_0x3d1fbf(0x1dc)]=_0x5c7af8['fetch']??fetch,this['timeoutMs']=_0x5c7af8[_0x3d1fbf(0x1d0)]??X,this[_0x3d1fbf(0x269)]=_0x5c7af8[_0x3d1fbf(0x269)]??ae,this['maxRedirects']=_0x5c7af8['maxRedirects']??oe;}async['download'](_0x52e23d){const _0x170068=_0x56d352;let _0x4e6c35=new URL(_0x52e23d);if(_0x4e6c35[_0x170068(0x1ef)]!==_0x170068(0x26f))throw new h(_0x170068(0x28b),'Resource\x20URL\x20must\x20use\x20HTTPS.');let _0x30b1ba=new AbortController(),_0x37fcf5=setTimeout(()=>_0x30b1ba[_0x170068(0x1c4)](),this[_0x170068(0x1d0)]);try{let _0x58302f=_0x4e6c35;for(let _0x5b455f=0x0;;_0x5b455f++){let _0x39094a=await this[_0x170068(0x1dc)](_0x58302f,{'redirect':_0x170068(0x289),'signal':_0x30b1ba[_0x170068(0x27a)]});if(se[_0x170068(0x27f)](_0x39094a[_0x170068(0x249)])){if(_0x5b455f>=this[_0x170068(0x1cd)])throw new h(_0x170068(0x1e9),_0x170068(0x1cc)+this[_0x170068(0x1cd)]+'.');let _0x19a746=_0x39094a[_0x170068(0x1fc)][_0x170068(0x211)]('location');if(_0x19a746===null)throw new h(_0x170068(0x1e1),_0x170068(0x239)+_0x39094a[_0x170068(0x249)]+_0x170068(0x213));let _0x57e8df;try{_0x57e8df=new URL(_0x19a746,_0x58302f);}catch{throw new h(_0x170068(0x1e1),_0x170068(0x26d));}if(_0x57e8df['protocol']!==_0x170068(0x26f))throw new h(_0x170068(0x222),_0x170068(0x28a));_0x58302f=_0x57e8df;continue;}if(!_0x39094a['ok'])throw new h(_0x170068(0x244),'Resource\x20server\x20returned\x20HTTP\x20'+_0x39094a[_0x170068(0x249)]+'.');if(_0x39094a[_0x170068(0x20e)]!==''&&new URL(_0x39094a[_0x170068(0x20e)])['protocol']!==_0x170068(0x26f))throw new h('resource-download-insecure-redirect','Resource\x20request\x20redirected\x20to\x20a\x20non-HTTPS\x20URL.');let _0x722d6d=await ce(_0x39094a,this[_0x170068(0x269)]);if(!V(_0x722d6d))throw new h(_0x170068(0x21a),_0x170068(0x201));return _0x722d6d;}}catch(_0x44c73d){throw _0x30b1ba[_0x170068(0x27a)][_0x170068(0x212)]?new h('resource-download-timeout',_0x170068(0x254)+this['timeoutMs']+_0x170068(0x271)):_0x44c73d;}finally{clearTimeout(_0x37fcf5);}}};function $(_0x1bc3d5){const _0x2d5d8e=_0x56d352;try{return JSON[_0x2d5d8e(0x266)](_0x377eb4(_0x1bc3d5,_0x2d5d8e(0x250)));}catch(_0x4f89e1){throw new h(_0x2d5d8e(0x228),_0x2d5d8e(0x273)+_0x1bc3d5+':\x20'+(_0x4f89e1 instanceof Error?_0x4f89e1[_0x2d5d8e(0x243)]:String(_0x4f89e1)),void 0x0,{'cause':_0x4f89e1});}}function le(_0x113567){const _0x426908=_0x56d352;let _0x408a47;return()=>(_0x408a47??=W({'manifest':$(_0x113567[_0x426908(0x22a)]),'cache':new J(_0x113567[_0x426908(0x277)]),'downloader':new Q(_0x113567[_0x426908(0x1dd)]),'output':new Y()}),_0x408a47);}export{J as FilesystemResourceCache,Y as FilesystemResourceOutput,Q as HttpsResourceDownloader,h as ResourceLibraryError,le as createNodeResourceLibraryFactory,W as createResourceLibrary,g as isResourceLibraryError,$ as loadResourceManifestFromPath,K as validateResourceCacheRoot};
|