@univer-cli/resource-library 1.6.1 → 1.6.2
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 _0x9717c2=_0x4ed8;(function(_0xeaea9f,_0x136e52){const _0x2f67c5=_0x4ed8,_0x1a14cf=_0xeaea9f();while(!![]){try{const _0x1c1cc1=-parseInt(_0x2f67c5(0x284))/0x1*(parseInt(_0x2f67c5(0x26f))/0x2)+parseInt(_0x2f67c5(0x27f))/0x3*(parseInt(_0x2f67c5(0x1f7))/0x4)+parseInt(_0x2f67c5(0x1d2))/0x5*(parseInt(_0x2f67c5(0x25f))/0x6)+-parseInt(_0x2f67c5(0x1f1))/0x7+parseInt(_0x2f67c5(0x225))/0x8*(-parseInt(_0x2f67c5(0x23f))/0x9)+parseInt(_0x2f67c5(0x214))/0xa*(parseInt(_0x2f67c5(0x1e4))/0xb)+parseInt(_0x2f67c5(0x235))/0xc;if(_0x1c1cc1===_0x136e52)break;else _0x1a14cf['push'](_0x1a14cf['shift']());}catch(_0x91262c){_0x1a14cf['push'](_0x1a14cf['shift']());}}}(_0x52e4,0xebfa3));import{randomUUID as _0x1ab1d6}from'node:crypto';import{mkdir as _0x3fc9b7,readFile as _0x33964c,readdir as _0x6e7aef,rename as _0x548896,rm as _0x23a888,stat as _0x1d27be,unlink as _0x1e4748,writeFile as _0x117ea0}from'node:fs/promises';import{dirname as _0x50e1fe,isAbsolute as _0x1ba7ef,join as _0x4a2b5a,parse as _0x55e14d,resolve as _0x5cd530}from'node:path';import{readFileSync as _0x4ca26e}from'node:fs';var h=class extends Error{[_0x9717c2(0x242)];[_0x9717c2(0x224)];constructor(_0x5a12b5,_0x5d3df0,_0x40ac56,_0x2b7eb9){const _0x4d9fea=_0x9717c2;super(_0x5d3df0,_0x2b7eb9),this[_0x4d9fea(0x242)]=_0x5a12b5,this[_0x4d9fea(0x224)]=_0x40ac56,this['name']=_0x4d9fea(0x23e);}};function g(_0x56a20f){return _0x56a20f instanceof h;}var _=/^[A-Za-z0-9._-]+$/u,v=0xff,y=0x4;function b(_0x336412){return _['test'](_0x336412)&&_0x336412!=='.'&&_0x336412!=='..';}function x(_0x363b44){const _0x49bf4e=_0x9717c2;if(!b(_0x363b44)||_0x363b44[_0x49bf4e(0x1e1)]('-')||_0x363b44['includes']('--')||_0x363b44[_0x49bf4e(0x1d7)]>v)throw new h(_0x49bf4e(0x1ee),_0x49bf4e(0x251)+_0x363b44+_0x49bf4e(0x1f0));}function S(_0xb545c9){const _0x1d8f45=_0x9717c2;if(!b(_0xb545c9)||_0xb545c9[_0x1d8f45(0x1d7)]+y>v)throw new h('resource-invalid-resource-id',_0x1d8f45(0x26e)+_0xb545c9+_0x1d8f45(0x226));}function C(_0x4800bf){const _0x39ed3b=_0x9717c2;let _0x5b5a8d=_0x4800bf[_0x39ed3b(0x21c)]('/');if(_0x5b5a8d[_0x39ed3b(0x1d7)]!==0x2||_0x5b5a8d[0x0]===''||_0x5b5a8d[0x1]==='')throw new h(_0x39ed3b(0x27d),'Invalid\x20resource\x20handle\x20\x22'+_0x4800bf+_0x39ed3b(0x229),_0x4800bf);let _0x56ead4=_0x5b5a8d[0x0],_0x35b95e=_0x5b5a8d[0x1];return x(_0x56ead4),S(_0x35b95e),{'registryId':_0x56ead4,'resourceId':_0x35b95e};}function ee(_0x52151a,_0x101520){return x(_0x52151a),S(_0x101520),_0x52151a+'/'+_0x101520;}function w(_0x46f9e6){const _0x5009fa=_0x9717c2;let {registryId:_0x155142,resourceId:_0x103c9d}=C(_0x46f9e6),_0x9ce061=_0x155142+'--'+_0x103c9d+_0x5009fa(0x1dd);if(_0x9ce061[_0x5009fa(0x1d7)]>v)throw new h(_0x5009fa(0x246),_0x5009fa(0x1e7)+v+'\x20bytes.',_0x46f9e6);return _0x9ce061;}function T(_0x5f067e){const _0x201dd0=_0x9717c2;return new h(_0x201dd0(0x21f),'Invalid\x20resource\x20manifest:\x20'+_0x5f067e);}function E(_0x2706b3,_0x368810){const _0x169c73=_0x9717c2;if(typeof _0x2706b3!=_0x169c73(0x27a)||!_0x2706b3||Array[_0x169c73(0x22f)](_0x2706b3))throw T(_0x368810+_0x169c73(0x1f5));return _0x2706b3;}function D(_0x461a80,_0x5b58ba,_0x26c923=!0x1){const _0x5f1818=_0x9717c2;if(_0x26c923&&_0x461a80===void 0x0)return[];if(!Array['isArray'](_0x461a80))throw T(_0x5b58ba+_0x5f1818(0x233));return _0x461a80;}function O(_0x553899,_0x2be073){const _0x30030d=_0x9717c2;if(typeof _0x553899!=_0x30030d(0x26c)||_0x553899==='')throw T(_0x2be073+_0x30030d(0x219));return _0x553899;}function k(_0x67a76,_0x233441,_0xe37093=!0x1){const _0x3f7bfd=_0x9717c2;return D(_0x67a76,_0x233441,_0xe37093)[_0x3f7bfd(0x20c)]((_0x496e96,_0x584d8e)=>O(_0x496e96,_0x233441+'['+_0x584d8e+']'));}function A(_0x3edaee,_0x41b5dd){const _0x4156af=_0x9717c2;return D(_0x3edaee,_0x41b5dd,!0x0)[_0x4156af(0x20c)]((_0x592a24,_0x6e295d)=>{const _0x3e01af=_0x4156af;if(typeof _0x592a24!=_0x3e01af(0x26c))throw T(_0x41b5dd+'['+_0x6e295d+_0x3e01af(0x231));return _0x592a24;})['filter'](_0x800de1=>_0x800de1!=='');}function j(_0x473096,_0x21d126){const _0x1a4efd=_0x9717c2;if(typeof _0x473096!=_0x1a4efd(0x25c)||!Number[_0x1a4efd(0x1f6)](_0x473096))throw T(_0x21d126+_0x1a4efd(0x256));return _0x473096;}function M(_0x5b89db,_0x12ecc9){const _0x56787c=_0x9717c2;if(typeof _0x5b89db!='boolean')throw T(_0x12ecc9+_0x56787c(0x258));return _0x5b89db;}function N(_0x5c86c5,_0x25fa78,_0x3ecba4){const _0xbc4227=_0x9717c2;if(typeof _0x5c86c5==_0xbc4227(0x26c)&&_0x5c86c5!=='')return _0x5c86c5;let _0x3172f9=E(_0x5c86c5,_0x25fa78),_0x43c44b=_0x3ecba4===void 0x0?void 0x0:_0x3172f9[_0x3ecba4];if(typeof _0x43c44b==_0xbc4227(0x26c)&&_0x43c44b!=='')return _0x43c44b;let _0x51aa6f=_0x3172f9['en-US'];if(typeof _0x51aa6f=='string'&&_0x51aa6f!=='')return _0x51aa6f;let _0x3d21d0=Object[_0xbc4227(0x25a)](_0x3172f9)['find'](_0x379377=>typeof _0x379377==_0xbc4227(0x26c)&&_0x379377!=='');if(_0x3d21d0!==void 0x0)return _0x3d21d0;throw T(_0x25fa78+_0xbc4227(0x227));}function P(_0x544e57,_0x48975f,_0x5de375){const _0x1476fd=_0x9717c2;try{_0x5de375===_0x1476fd(0x25b)?x(_0x544e57):S(_0x544e57);}catch(_0x3f06ef){throw T(_0x48975f+':\x20'+(_0x3f06ef instanceof Error?_0x3f06ef[_0x1476fd(0x238)]:String(_0x3f06ef)));}}function F(_0x16d123,_0x6885a0,_0x2b46b1){const _0x2e1041=_0x9717c2;let _0x223c44=new Map();for(let [_0x288c50,_0x3e620a]of D(_0x16d123,_0x6885a0,!0x0)[_0x2e1041(0x260)]()){let _0x57f67e=E(_0x3e620a,_0x6885a0+'['+_0x288c50+']'),_0x5c9cad=O(_0x57f67e['id'],_0x6885a0+'['+_0x288c50+_0x2e1041(0x24c));if(P(_0x5c9cad,_0x6885a0+'['+_0x288c50+_0x2e1041(0x24c),_0x2e1041(0x243)),_0x223c44[_0x2e1041(0x1f3)](_0x5c9cad))throw T(_0x2e1041(0x216)+_0x6885a0+_0x2e1041(0x22d)+_0x5c9cad+'\x22.');_0x223c44[_0x2e1041(0x1fe)](_0x5c9cad,N(_0x57f67e[_0x2e1041(0x215)],_0x6885a0+'['+_0x288c50+_0x2e1041(0x1ec),_0x2b46b1));}return _0x223c44;}function I(_0x3317a8,_0x2d7e07){const _0x178471=_0x9717c2;let _0x1bca1d=E(_0x3317a8[_0x178471(0x27e)],_0x2d7e07+_0x178471(0x24a)),_0x4cbf7f=j(_0x1bca1d[_0x178471(0x285)],_0x2d7e07+'.intrinsicSize.width'),_0x26ce33=j(_0x1bca1d['height'],_0x2d7e07+_0x178471(0x23b));if(_0x4cbf7f<=0x0||_0x26ce33<=0x0)throw T(_0x2d7e07+_0x178471(0x283));return{'width':_0x4cbf7f,'height':_0x26ce33};}function L(_0x717195,_0x29ff4d){const _0x10d914=_0x9717c2;if(_0x717195['type']!==_0x10d914(0x1c3))throw T(_0x29ff4d+'.type\x20must\x20be\x20\x22image\x22.');if(_0x717195[_0x10d914(0x1c8)]!==_0x10d914(0x279))throw T(_0x29ff4d+_0x10d914(0x1de));let _0x5ef15f=E(_0x717195[_0x10d914(0x24f)],_0x29ff4d+_0x10d914(0x1f4));if(_0x5ef15f[_0x10d914(0x26b)]!==_0x10d914(0x250))throw T(_0x29ff4d+_0x10d914(0x22b));let _0x38fc07=O(_0x5ef15f[_0x10d914(0x278)],_0x29ff4d+_0x10d914(0x1cb)),_0x37e751;try{_0x37e751=new URL(_0x38fc07);}catch{throw T(_0x29ff4d+_0x10d914(0x1fa));}if(_0x37e751[_0x10d914(0x264)]!==_0x10d914(0x222))throw T(_0x29ff4d+_0x10d914(0x267));return _0x38fc07;}function R(_0xfc75f7){const _0x56c9f7=_0x9717c2;return _0xfc75f7[_0x56c9f7(0x1eb)](_0x56c9f7(0x1d0))[_0x56c9f7(0x20e)]()[_0x56c9f7(0x274)]()['replace'](/\s+/gu,'\x20');}function z(_0x2b1d59){const _0x3c6da3=_0x9717c2;let _0x462aaa=E(_0x2b1d59,'manifest'),_0x4022a2=new Map(),_0x5f3bdc=new Map(),_0x45bd55=[],_0x539c8d=[],_0x5f38ac=new Set(),_0x303405=0x0;for(let [_0xcd307f,_0x3fd15c]of D(_0x462aaa[_0x3c6da3(0x1f2)],_0x3c6da3(0x20b))[_0x3c6da3(0x260)]()){let _0xc8e4e4=E(E(_0x3fd15c,_0x3c6da3(0x236)+_0xcd307f+']')['input'],_0x3c6da3(0x236)+_0xcd307f+_0x3c6da3(0x269)),_0x4bfb85=O(_0xc8e4e4[_0x3c6da3(0x275)],'registrations['+_0xcd307f+_0x3c6da3(0x21b));if(P(_0x4bfb85,_0x3c6da3(0x236)+_0xcd307f+_0x3c6da3(0x21b),_0x3c6da3(0x25b)),_0x4022a2['has'](_0x4bfb85))throw T('Duplicate\x20registry\x20ID\x20\x22'+_0x4bfb85+'\x22.');let _0x266851=_0xc8e4e4[_0x3c6da3(0x1c1)]===void 0x0?void 0x0:O(_0xc8e4e4[_0x3c6da3(0x1c1)],_0x3c6da3(0x236)+_0xcd307f+'].input.defaultLocale'),_0x42a14d=F(_0xc8e4e4[_0x3c6da3(0x20a)],_0x3c6da3(0x236)+_0xcd307f+_0x3c6da3(0x1c2),_0x266851),_0x16007b=F(_0xc8e4e4[_0x3c6da3(0x1ff)],_0x3c6da3(0x236)+_0xcd307f+'].input.tags',_0x266851),_0xae710=[];for(let [_0x36570d,_0x53110e]of D(_0xc8e4e4[_0x3c6da3(0x1d9)],_0x3c6da3(0x236)+_0xcd307f+_0x3c6da3(0x1e3))[_0x3c6da3(0x260)]()){let _0x28e3f9=_0x3c6da3(0x236)+_0xcd307f+'].input.resources['+_0x36570d+']',_0xa52b7b=E(_0x53110e,_0x28e3f9),_0x16e71e=O(_0xa52b7b['id'],_0x28e3f9+_0x3c6da3(0x26d));P(_0x16e71e,_0x28e3f9+_0x3c6da3(0x26d),_0x3c6da3(0x243));let _0x5eab47=ee(_0x4bfb85,_0x16e71e);if(_0x5f3bdc[_0x3c6da3(0x1f3)](_0x5eab47))throw T('Duplicate\x20resource\x20handle\x20\x22'+_0x5eab47+'\x22.');let _0x2a809c;try{_0x2a809c=w(_0x5eab47);}catch(_0x450968){throw T(_0x28e3f9+':\x20'+(_0x450968 instanceof Error?_0x450968['message']:String(_0x450968)));}if(_0x5f38ac['has'](_0x2a809c))throw T(_0x3c6da3(0x272)+_0x2a809c+'\x22.');_0x5f38ac['add'](_0x2a809c);let _0x560370=_0xa52b7b[_0x3c6da3(0x1d4)]===void 0x0?void 0x0:O(_0xa52b7b[_0x3c6da3(0x1d4)],_0x28e3f9+'.groupId');if(_0x560370!==void 0x0&&!_0x42a14d[_0x3c6da3(0x1f3)](_0x560370))throw T(_0x28e3f9+_0x3c6da3(0x248)+_0x560370+'\x22.');let _0x46bb58=k(_0xa52b7b[_0x3c6da3(0x221)],_0x28e3f9+'.tagIds',!0x0);for(let _0x3ce9f0 of _0x46bb58)if(!_0x16007b[_0x3c6da3(0x1f3)](_0x3ce9f0))throw T(_0x28e3f9+'.tagIds\x20references\x20unknown\x20tag\x20\x22'+_0x3ce9f0+'\x22.');let _0x24ffa7=A(_0xa52b7b[_0x3c6da3(0x1ea)],_0x28e3f9+_0x3c6da3(0x207)),_0x3a6c0c=N(_0xa52b7b[_0x3c6da3(0x252)],_0x28e3f9+_0x3c6da3(0x217),_0x266851),_0x31c223=_0xa52b7b['description']===void 0x0?void 0x0:N(_0xa52b7b[_0x3c6da3(0x220)],_0x28e3f9+'.description',_0x266851),_0x4b0248=_0x560370===void 0x0?null:{'id':_0x560370,'label':_0x42a14d[_0x3c6da3(0x271)](_0x560370)},_0x3cc7eb=_0x46bb58[_0x3c6da3(0x20c)](_0x411b8e=>({'id':_0x411b8e,'label':_0x16007b[_0x3c6da3(0x271)](_0x411b8e)})),_0x58a4b4=E(_0xa52b7b[_0x3c6da3(0x1c6)],_0x28e3f9+'.payload'),_0x20a3e0=_0xa52b7b[_0x3c6da3(0x244)]===void 0x0?null:j(_0xa52b7b[_0x3c6da3(0x244)],_0x28e3f9+'.order'),_0x486092=M(_0x58a4b4[_0x3c6da3(0x1fd)],_0x28e3f9+_0x3c6da3(0x1d8)),_0xcabf0b={'handle':_0x5eab47,'registryId':_0x4bfb85,'id':_0x16e71e,'name':_0x3a6c0c,..._0x31c223===void 0x0?{}:{'description':_0x31c223},'group':_0x4b0248,'tags':_0x3cc7eb,'keywords':_0x24ffa7,'order':_0x20a3e0,'intrinsicSize':I(_0x58a4b4,_0x28e3f9+_0x3c6da3(0x26a)),'colorEditable':_0x486092,'sourceUrl':L(_0x58a4b4,_0x28e3f9+_0x3c6da3(0x26a)),'registrationIndex':_0xcd307f,'resourceIndex':_0x36570d,'globalIndex':_0x303405,'searchText':R([_0x3a6c0c,_0x31c223,_0x4b0248?.[_0x3c6da3(0x215)],..._0x3cc7eb[_0x3c6da3(0x20c)](_0x2f4865=>_0x2f4865['label']),..._0x24ffa7][_0x3c6da3(0x249)](_0x49cd90=>_0x49cd90!==void 0x0)[_0x3c6da3(0x280)]('\x20'))};_0x303405++,_0xae710[_0x3c6da3(0x23c)](_0xcabf0b),_0x539c8d[_0x3c6da3(0x23c)](_0xcabf0b),_0x5f3bdc['set'](_0x5eab47,_0xcabf0b);}let _0x259895={'id':_0x4bfb85,'groups':_0x42a14d,'tags':_0x16007b,'resources':_0xae710};_0x45bd55[_0x3c6da3(0x23c)](_0x259895),_0x4022a2[_0x3c6da3(0x1fe)](_0x4bfb85,_0x259895);}if(_0x45bd55[_0x3c6da3(0x1d7)]===0x0)throw T(_0x3c6da3(0x1c7));return{'registries':_0x45bd55,'registryById':_0x4022a2,'resourceByHandle':_0x5f3bdc,'resources':_0x539c8d};}function _0x4ed8(_0x3a83b9,_0xf4a837){_0x3a83b9=_0x3a83b9-0x1bf;const _0x52e466=_0x52e4();let _0x4ed893=_0x52e466[_0x3a83b9];return _0x4ed893;}function B(_0x126910,_0x315195){const _0x5e6af7=_0x9717c2;C(_0x315195);let _0x3d3d46=_0x126910[_0x5e6af7(0x1bf)]['get'](_0x315195);if(_0x3d3d46===void 0x0)throw new h(_0x5e6af7(0x24b),_0x5e6af7(0x1cd)+_0x315195+_0x5e6af7(0x208),_0x315195);return _0x3d3d46;}function te(_0x547d0a){const _0x312f33=_0x9717c2;return _0x547d0a[_0x312f33(0x27b)]['map'](_0x241b66=>({'id':_0x241b66['id'],'resourceCount':_0x241b66[_0x312f33(0x1d9)]['length'],'groupCount':_0x241b66[_0x312f33(0x20a)][_0x312f33(0x1dc)],'tagCount':_0x241b66[_0x312f33(0x1ff)][_0x312f33(0x1dc)],'colorEditableCount':_0x241b66[_0x312f33(0x1d9)][_0x312f33(0x249)](_0x4bc2b2=>_0x4bc2b2[_0x312f33(0x1fd)])[_0x312f33(0x1d7)]}));}function ne(_0x40c129){const _0x1d5e31=_0x9717c2;return{'handle':_0x40c129[_0x1d5e31(0x224)],'registryId':_0x40c129[_0x1d5e31(0x275)],'id':_0x40c129['id'],'name':_0x40c129['name'],'group':_0x40c129[_0x1d5e31(0x22e)],'tags':_0x40c129['tags'],'keywords':_0x40c129[_0x1d5e31(0x1ea)],'order':_0x40c129[_0x1d5e31(0x244)],'intrinsicSize':_0x40c129[_0x1d5e31(0x27e)],'colorEditable':_0x40c129[_0x1d5e31(0x1fd)]};}function re(_0x5733e3,_0x359239){const _0x5d2c59=_0x9717c2;let _0x641a6b=(_0x5733e3[_0x5d2c59(0x244)]??_0x5733e3[_0x5d2c59(0x1c4)])-(_0x359239[_0x5d2c59(0x244)]??_0x359239[_0x5d2c59(0x1c4)]);if(_0x641a6b!==0x0)return _0x641a6b;let _0x40b7fd=_0x5733e3['registrationIndex']-_0x359239['registrationIndex'];if(_0x40b7fd!==0x0)return _0x40b7fd;let _0x25d033=_0x5733e3[_0x5d2c59(0x1e9)]-_0x359239[_0x5d2c59(0x1e9)];return _0x25d033===0x0?_0x5733e3[_0x5d2c59(0x224)][_0x5d2c59(0x277)](_0x359239[_0x5d2c59(0x224)]):_0x25d033;}function ie(_0x65fb9e,_0x493e1c){const _0x58c782=_0x9717c2;let _0x9ba221=_0x493e1c['queries']['map'](R)[_0x58c782(0x249)](_0x46adf4=>_0x46adf4!=='');if(_0x9ba221[_0x58c782(0x1d7)]===0x0)throw new h(_0x58c782(0x266),_0x58c782(0x1e2));let _0x5ae933=new Set(_0x493e1c['registries']??[]);for(let _0x323dd8 of _0x5ae933)if(!_0x65fb9e[_0x58c782(0x1f8)][_0x58c782(0x1f3)](_0x323dd8))throw new h(_0x58c782(0x1cc),'Unknown\x20resource\x20registry\x20\x22'+_0x323dd8+'\x22.');let _0x17979b=_0x493e1c[_0x58c782(0x1ca)]??_0x65fb9e[_0x58c782(0x1d9)][_0x58c782(0x1d7)];if(!Number[_0x58c782(0x1ed)](_0x17979b)||_0x17979b<0x1)throw new h(_0x58c782(0x213),'Resource\x20search\x20limit\x20must\x20be\x20a\x20positive\x20integer;\x20received\x20\x22'+_0x17979b+'\x22.');let _0x6b0f05=_0x65fb9e[_0x58c782(0x1d9)][_0x58c782(0x249)](_0x258dcd=>_0x5ae933[_0x58c782(0x1dc)]===0x0||_0x5ae933[_0x58c782(0x1f3)](_0x258dcd[_0x58c782(0x275)]))[_0x58c782(0x249)](_0x4ddcc0=>_0x9ba221['some'](_0x5dc5b8=>_0x4ddcc0[_0x58c782(0x228)]['includes'](_0x5dc5b8)))['sort'](re);return{'resources':_0x6b0f05[_0x58c782(0x232)](0x0,_0x17979b)['map'](ne),'total':_0x6b0f05[_0x58c782(0x1d7)]};}function V(_0xa8ddb0){const _0x35a4aa=_0x9717c2;return/^\s*(?:<\?xml[^>]*>\s*)?(?:<!--[^]*?-->\s*)*<svg(?:\s|>)/iu[_0x35a4aa(0x27c)](_0xa8ddb0);}function H(_0x9878ac,_0x440d45){const _0x5cf3c1=_0x9717c2;return g(_0x440d45)?{'handle':_0x9878ac,'code':_0x440d45[_0x5cf3c1(0x242)],'message':_0x440d45[_0x5cf3c1(0x238)]}:{'handle':_0x9878ac,'code':_0x5cf3c1(0x23d),'message':_0x440d45 instanceof Error?_0x440d45['message']:String(_0x440d45)};}var U=class{['options'];[_0x9717c2(0x1db)];constructor(_0x4e8717){const _0x139c9d=_0x9717c2;this['options']=_0x4e8717,this[_0x139c9d(0x1db)]=z(_0x4e8717[_0x139c9d(0x211)]);}get[_0x9717c2(0x247)](){const _0x54ea3c=_0x9717c2;return this[_0x54ea3c(0x24d)][_0x54ea3c(0x21d)][_0x54ea3c(0x22c)];}['listRegistries'](){return te(this['catalog']);}[_0x9717c2(0x281)](_0x370bd5){return ie(this['catalog'],_0x370bd5);}async['read'](_0x100619){const _0x3027b9=_0x9717c2;let _0x557b00=B(this['catalog'],_0x100619[_0x3027b9(0x224)]),_0x4833a6=await this['options'][_0x3027b9(0x21d)][_0x3027b9(0x237)](_0x100619['handle']);if(_0x4833a6!==void 0x0&&V(_0x4833a6))return{'handle':_0x100619['handle'],'svg':_0x4833a6};let _0xb5eba5;try{_0xb5eba5=await this['options'][_0x3027b9(0x1f9)][_0x3027b9(0x1c5)](_0x557b00['sourceUrl']);}catch(_0xaa454e){throw g(_0xaa454e)?_0xaa454e:new h('resource-download-failed','Failed\x20to\x20download\x20\x22'+_0x100619[_0x3027b9(0x224)]+'\x22:\x20'+(_0xaa454e instanceof Error?_0xaa454e[_0x3027b9(0x238)]:String(_0xaa454e)),_0x100619[_0x3027b9(0x224)],{'cause':_0xaa454e});}if(!V(_0xb5eba5))throw new h('resource-invalid-svg',_0x3027b9(0x22a)+_0x100619['handle']+_0x3027b9(0x1d5),_0x100619['handle']);return await this[_0x3027b9(0x24d)][_0x3027b9(0x21d)]['write'](_0x100619[_0x3027b9(0x224)],_0xb5eba5),{'handle':_0x100619[_0x3027b9(0x224)],'svg':_0xb5eba5};}async[_0x9717c2(0x1fc)](_0x1ad53d){const _0xa2ab69=_0x9717c2;let _0x13aac1=[],_0x1fcfae=[];for(let _0x2d274f of _0x1ad53d['handles'])try{let {svg:_0x4160f5}=await this[_0xa2ab69(0x237)]({'handle':_0x2d274f}),_0x4fcacc=await this[_0xa2ab69(0x24d)][_0xa2ab69(0x1e5)]['write'](_0x1ad53d[_0xa2ab69(0x240)],w(_0x2d274f),_0x4160f5);_0x13aac1[_0xa2ab69(0x23c)]({'handle':_0x2d274f,'path':_0x4fcacc});}catch(_0x139906){_0x1fcfae['push'](H(_0x2d274f,_0x139906));}return{'exported':_0x13aac1,'failed':_0x1fcfae};}async[_0x9717c2(0x205)](){const _0x2d5622=_0x9717c2;return await this[_0x2d5622(0x24d)][_0x2d5622(0x21d)][_0x2d5622(0x239)]();}};function W(_0x2c84d1){return new U(_0x2c84d1);}function _0x52e4(){const _0x4f10c5=['groupId','\x22\x20is\x20not\x20an\x20SVG\x20document.','signal','length','.payload.colorEditable','resources','resource-manifest-read-failed','catalog','size','.svg','.storagePolicy\x20must\x20be\x20\x22reference\x22.','resource-download-timeout','path','startsWith','Resource\x20search\x20needs\x20at\x20least\x20one\x20non-empty\x20query.','].input.resources','22rthesX','output','Resource\x20request\x20redirected\x20to\x20a\x20non-HTTPS\x20URL.','Resource\x20export\x20filename\x20exceeds\x20','resource-cache-root-invalid','resourceIndex','keywords','normalize','].label','isInteger','resource-invalid-registry-id','utf8','\x22:\x20expected\x20an\x20addressable\x20filesystem-safe\x20component\x20without\x20\x22--\x22.','4029186mFgVeI','registrations','has','.source','\x20must\x20be\x20an\x20object.','isFinite','48104PBYpij','registryById','downloader','.source.value\x20must\x20be\x20a\x20URL.','getReader','export','colorEditable','set','tags','Resource\x20response\x20is\x20not\x20valid\x20UTF-8.','Resource\x20exceeds\x20the\x20maximum\x20size\x20of\x20','Resource\x20request\x20followed\x20too\x20many\x20redirects;\x20maximum\x20','text','done','clearCache','decode','.keywords','\x22;\x20try\x20resources\x20find\x20<query>.','fetchImpl','groups','manifest.registrations','map','catch','toLowerCase','body','Cannot\x20read\x20resource\x20manifest\x20at\x20','manifest','Resource\x20cache\x20root\x20must\x20be\x20an\x20absolute,\x20dedicated\x20directory\x20below\x20the\x20filesystem\x20root;\x20received\x20\x22','resource-limit-invalid','2952310BTQtwN','label','Duplicate\x20','.name','\x20bytes.','\x20must\x20be\x20a\x20non-empty\x20string.','maxRedirects','].input.registryId','split','cache','Resource\x20server\x20returned\x20an\x20invalid\x20redirect\x20URL.','resource-manifest-invalid','description','tagIds','https:','resource-download-invalid-svg','handle','7672VPetZs','\x22:\x20expected\x20filesystem-safe\x20characters.','\x20contains\x20no\x20usable\x20localized\x20text.','searchText','\x22;\x20expected\x20<registryId>/<resourceId>.','Downloaded\x20resource\x20\x22','.source.type\x20must\x20be\x20\x22url\x22.','location','\x20ID\x20\x22','group','isArray','\x20without\x20a\x20Location\x20header.',']\x20must\x20be\x20a\x20string.','slice','\x20must\x20be\x20an\x20array.','manual','22863624euLkec','registrations[','read','message','clear','headers','.intrinsicSize.height','push','resource-export-failed','ResourceLibraryError','7155QMtArr','destination','abort','code','resource','order','pid','resource-export-filename-too-long','cacheLocation','.groupId\x20references\x20unknown\x20group\x20\x22','filter','.intrinsicSize','resource-not-found','].id','options','fetch','source','url','Invalid\x20registry\x20ID\x20\x22','name','maxBytes','resource-download-too-many-redirects','Resource\x20download\x20timed\x20out\x20after\x20','\x20must\x20be\x20a\x20finite\x20number.','resource-download-too-large','\x20must\x20be\x20a\x20boolean.','utf-8','values','registry','number','content-length','ENOENT','6lLrilk','entries','byteLength','manifestPath','timeoutMs','protocol','resource-download-insecure-redirect','resource-query-empty','.source.value\x20must\x20use\x20HTTPS.','byteCount','].input','.payload','type','string','.id','Invalid\x20resource\x20ID\x20\x22','1698GLrvCA','aborted','get','Duplicate\x20export\x20filename\x20\x22','isFile','trim','registryId','resource-download-invalid-utf8','localeCompare','value','reference','object','registries','test','resource-invalid-handle','intrinsicSize','237XntFOj','join','find','resource-download-insecure','.intrinsicSize\x20must\x20be\x20positive.','1345ZeLMak','width','resourceByHandle','root','defaultLocale','].input.groups','image','globalIndex','download','payload','registrations\x20must\x20not\x20be\x20empty.','storagePolicy','status','limit','.source.value','resource-registry-not-found','Unknown\x20resource\x20\x22','resource-download-invalid-redirect','Resource\x20response\x20is\x20not\x20an\x20SVG\x20document.','NFKC','parse','3265qzooIA','write'];_0x52e4=function(){return _0x4f10c5;};return _0x52e4();}function G(_0x518be5){const _0x588822=_0x9717c2;return _0x518be5 instanceof Error&&_0x588822(0x242)in _0x518be5;}function K(_0x2cf6a4){const _0x44b2e6=_0x9717c2;let _0x12d931=_0x5cd530(_0x2cf6a4);if(!_0x1ba7ef(_0x2cf6a4)||_0x12d931===_0x55e14d(_0x12d931)[_0x44b2e6(0x1c0)])throw new h(_0x44b2e6(0x1e8),_0x44b2e6(0x212)+_0x2cf6a4+'\x22.');return _0x12d931;}async function q(_0x425abe){const _0x46b453=_0x9717c2;let _0x2714ce;try{_0x2714ce=await _0x6e7aef(_0x425abe,{'withFileTypes':!0x0});}catch(_0x1b5b9f){if(G(_0x1b5b9f)&&_0x1b5b9f[_0x46b453(0x242)]===_0x46b453(0x25e))return{'resourceCount':0x0,'byteCount':0x0};throw _0x1b5b9f;}let _0x283b1e=0x0,_0x48717f=0x0;for(let _0x12fde6 of _0x2714ce){let _0x9176a2=_0x4a2b5a(_0x425abe,_0x12fde6[_0x46b453(0x252)]);if(_0x12fde6['isDirectory']()){let _0x1ed607=await q(_0x9176a2);_0x283b1e+=_0x1ed607['resourceCount'],_0x48717f+=_0x1ed607[_0x46b453(0x268)];}else{if(_0x12fde6[_0x46b453(0x273)]()&&_0x12fde6[_0x46b453(0x252)]['endsWith'](_0x46b453(0x1dd))){let _0x1adfb5=await _0x1d27be(_0x9176a2);_0x283b1e++,_0x48717f+=_0x1adfb5[_0x46b453(0x1dc)];}}}return{'resourceCount':_0x283b1e,'byteCount':_0x48717f};}var J=class{[_0x9717c2(0x22c)];constructor(_0xa79183){const _0x5f182d=_0x9717c2;this[_0x5f182d(0x22c)]=K(_0xa79183);}[_0x9717c2(0x1e0)](_0x45dd67){const _0x8ef494=_0x9717c2;let {registryId:_0x31e557,resourceId:_0x5e4486}=C(_0x45dd67);return _0x4a2b5a(this[_0x8ef494(0x22c)],_0x31e557,_0x5e4486+_0x8ef494(0x1dd));}async['read'](_0x113ceb){const _0xbe587e=_0x9717c2;try{return await _0x33964c(this[_0xbe587e(0x1e0)](_0x113ceb),_0xbe587e(0x1ef));}catch(_0x3c97fa){if(G(_0x3c97fa)&&_0x3c97fa['code']===_0xbe587e(0x25e))return;throw _0x3c97fa;}}async[_0x9717c2(0x1d3)](_0x46828f,_0x369bc7){const _0x1e34df=_0x9717c2;let _0x322026=this['path'](_0x46828f);await _0x3fc9b7(_0x50e1fe(_0x322026),{'recursive':!0x0});let _0x172bdc=_0x4a2b5a(_0x50e1fe(_0x322026),'.resource-'+process[_0x1e34df(0x245)]+'-'+_0x1ab1d6()+'.tmp');try{await _0x117ea0(_0x172bdc,_0x369bc7,{'encoding':_0x1e34df(0x1ef),'mode':0x180}),await _0x548896(_0x172bdc,_0x322026);}catch(_0x1ae92){throw await _0x1e4748(_0x172bdc)[_0x1e34df(0x20d)](()=>void 0x0),_0x1ae92;}}async[_0x9717c2(0x239)](){const _0x4cde29=_0x9717c2;let _0x1cbed6=await q(this['location']);return await _0x23a888(this[_0x4cde29(0x22c)],{'force':!0x0,'recursive':!0x0}),{'path':this[_0x4cde29(0x22c)],..._0x1cbed6};}},Y=class{async[_0x9717c2(0x1d3)](_0x125da8,_0x4dd50a,_0x3e2c69){const _0x546a22=_0x9717c2;await _0x3fc9b7(_0x125da8,{'recursive':!0x0});let _0x262ab6=_0x4a2b5a(_0x125da8,_0x4dd50a);return await _0x117ea0(_0x262ab6,_0x3e2c69,_0x546a22(0x1ef)),_0x262ab6;}},X=0x7530,ae=0xa00000,oe=0xa,se=new Set([0x12d,0x12e,0x12f,0x133,0x134]);function Z(_0x5167d2){const _0x31bd62=_0x9717c2;return new h(_0x31bd62(0x257),_0x31bd62(0x201)+_0x5167d2+_0x31bd62(0x218));}async function ce(_0x10aa36,_0x499d56){const _0x574fba=_0x9717c2;let _0x22339c=Number(_0x10aa36[_0x574fba(0x23a)][_0x574fba(0x271)](_0x574fba(0x25d)));if(Number[_0x574fba(0x1f6)](_0x22339c)&&_0x22339c>_0x499d56)throw Z(_0x499d56);if(_0x10aa36['body']===null){let _0x2a2c86=await _0x10aa36[_0x574fba(0x203)]();if(Buffer[_0x574fba(0x261)](_0x2a2c86)>_0x499d56)throw Z(_0x499d56);return _0x2a2c86;}let _0x1703a7=_0x10aa36[_0x574fba(0x20f)][_0x574fba(0x1fb)](),_0x42955e=[],_0x32e26e=0x0;try{for(;;){let _0x46ff32=await _0x1703a7[_0x574fba(0x237)]();if(_0x46ff32[_0x574fba(0x204)])break;if(_0x32e26e+=_0x46ff32[_0x574fba(0x278)][_0x574fba(0x261)],_0x32e26e>_0x499d56)throw await _0x1703a7['cancel']()['catch'](()=>void 0x0),Z(_0x499d56);_0x42955e['push'](_0x46ff32[_0x574fba(0x278)]);}}finally{_0x1703a7['releaseLock']();}try{return new TextDecoder(_0x574fba(0x259),{'fatal':!0x0})[_0x574fba(0x206)](Buffer['concat'](_0x42955e,_0x32e26e));}catch{throw new h(_0x574fba(0x276),_0x574fba(0x200));}}var Q=class{['fetchImpl'];[_0x9717c2(0x263)];[_0x9717c2(0x253)];['maxRedirects'];constructor(_0x51e3b8={}){const _0x16a2b7=_0x9717c2;this['fetchImpl']=_0x51e3b8[_0x16a2b7(0x24e)]??fetch,this[_0x16a2b7(0x263)]=_0x51e3b8['timeoutMs']??X,this['maxBytes']=_0x51e3b8['maxBytes']??ae,this[_0x16a2b7(0x21a)]=_0x51e3b8[_0x16a2b7(0x21a)]??oe;}async[_0x9717c2(0x1c5)](_0x4025c2){const _0x2b1e01=_0x9717c2;let _0x216af0=new URL(_0x4025c2);if(_0x216af0[_0x2b1e01(0x264)]!=='https:')throw new h(_0x2b1e01(0x282),'Resource\x20URL\x20must\x20use\x20HTTPS.');let _0x3f5630=new AbortController(),_0x1001db=setTimeout(()=>_0x3f5630[_0x2b1e01(0x241)](),this[_0x2b1e01(0x263)]);try{let _0x23407f=_0x216af0;for(let _0xbf5017=0x0;;_0xbf5017++){let _0x433821=await this[_0x2b1e01(0x209)](_0x23407f,{'redirect':_0x2b1e01(0x234),'signal':_0x3f5630[_0x2b1e01(0x1d6)]});if(se[_0x2b1e01(0x1f3)](_0x433821[_0x2b1e01(0x1c9)])){if(_0xbf5017>=this[_0x2b1e01(0x21a)])throw new h(_0x2b1e01(0x254),_0x2b1e01(0x202)+this[_0x2b1e01(0x21a)]+'.');let _0x4bc6b0=_0x433821[_0x2b1e01(0x23a)][_0x2b1e01(0x271)](_0x2b1e01(0x22c));if(_0x4bc6b0===null)throw new h(_0x2b1e01(0x1ce),'Resource\x20server\x20returned\x20HTTP\x20'+_0x433821[_0x2b1e01(0x1c9)]+_0x2b1e01(0x230));let _0x2b6cf2;try{_0x2b6cf2=new URL(_0x4bc6b0,_0x23407f);}catch{throw new h('resource-download-invalid-redirect',_0x2b1e01(0x21e));}if(_0x2b6cf2[_0x2b1e01(0x264)]!==_0x2b1e01(0x222))throw new h(_0x2b1e01(0x265),_0x2b1e01(0x1e6));_0x23407f=_0x2b6cf2;continue;}if(!_0x433821['ok'])throw new h('resource-download-http','Resource\x20server\x20returned\x20HTTP\x20'+_0x433821['status']+'.');if(_0x433821[_0x2b1e01(0x250)]!==''&&new URL(_0x433821[_0x2b1e01(0x250)])['protocol']!==_0x2b1e01(0x222))throw new h(_0x2b1e01(0x265),'Resource\x20request\x20redirected\x20to\x20a\x20non-HTTPS\x20URL.');let _0x19e031=await ce(_0x433821,this[_0x2b1e01(0x253)]);if(!V(_0x19e031))throw new h(_0x2b1e01(0x223),_0x2b1e01(0x1cf));return _0x19e031;}}catch(_0x5999c2){throw _0x3f5630[_0x2b1e01(0x1d6)][_0x2b1e01(0x270)]?new h(_0x2b1e01(0x1df),_0x2b1e01(0x255)+this[_0x2b1e01(0x263)]+'\x20ms.'):_0x5999c2;}finally{clearTimeout(_0x1001db);}}};function $(_0x381057){const _0x16ddb2=_0x9717c2;try{return JSON[_0x16ddb2(0x1d1)](_0x4ca26e(_0x381057,_0x16ddb2(0x1ef)));}catch(_0x460f35){throw new h(_0x16ddb2(0x1da),_0x16ddb2(0x210)+_0x381057+':\x20'+(_0x460f35 instanceof Error?_0x460f35[_0x16ddb2(0x238)]:String(_0x460f35)),void 0x0,{'cause':_0x460f35});}}function le(_0x50068a){const _0xf8986=_0x9717c2;let _0x169498;return()=>(_0x169498??=W({'manifest':$(_0x50068a[_0xf8986(0x262)]),'cache':new J(_0x50068a['cacheRoot']),'downloader':new Q(_0x50068a[_0xf8986(0x1f9)]),'output':new Y()}),_0x169498);}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
|
+
const _0x21b277=_0x1cb0;(function(_0x198d6f,_0x46a218){const _0x2c7861=_0x1cb0,_0x3a5490=_0x198d6f();while(!![]){try{const _0x585a5f=-parseInt(_0x2c7861(0x163))/0x1*(-parseInt(_0x2c7861(0x11e))/0x2)+parseInt(_0x2c7861(0x15a))/0x3+parseInt(_0x2c7861(0x1b0))/0x4+parseInt(_0x2c7861(0x1bd))/0x5*(-parseInt(_0x2c7861(0x178))/0x6)+-parseInt(_0x2c7861(0x1e8))/0x7*(-parseInt(_0x2c7861(0x197))/0x8)+-parseInt(_0x2c7861(0x171))/0x9*(-parseInt(_0x2c7861(0x179))/0xa)+-parseInt(_0x2c7861(0x124))/0xb*(parseInt(_0x2c7861(0x14e))/0xc);if(_0x585a5f===_0x46a218)break;else _0x3a5490['push'](_0x3a5490['shift']());}catch(_0x572525){_0x3a5490['push'](_0x3a5490['shift']());}}}(_0x48ca,0xd1394));import{randomUUID as _0x568d4c}from'node:crypto';import{mkdir as _0x229735,readFile as _0x327b2b,readdir as _0x23a838,rename as _0x18e241,rm as _0x3a1ba3,stat as _0x338b48,unlink as _0xb6b66e,writeFile as _0x5bca69}from'node:fs/promises';import{dirname as _0x3a2a08,isAbsolute as _0x37d03e,join as _0x594d1b,parse as _0x26b40e,resolve as _0x395d44}from'node:path';import{readFileSync as _0x1fcc03}from'node:fs';var h=class extends Error{[_0x21b277(0x1af)];[_0x21b277(0x15b)];constructor(_0x743bdf,_0x29b91d,_0x562aa3,_0x2f0347){const _0x181a5c=_0x21b277;super(_0x29b91d,_0x2f0347),this[_0x181a5c(0x1af)]=_0x743bdf,this[_0x181a5c(0x15b)]=_0x562aa3,this[_0x181a5c(0x127)]=_0x181a5c(0x1de);}};function g(_0x1a8121){return _0x1a8121 instanceof h;}var _=/^[A-Za-z0-9._-]+$/u,v=0xff,y=0x4;function b(_0x3ffe41){const _0xa9e824=_0x21b277;return _[_0xa9e824(0x15f)](_0x3ffe41)&&_0x3ffe41!=='.'&&_0x3ffe41!=='..';}function x(_0x35f9dc){const _0x5c7ba9=_0x21b277;if(!b(_0x35f9dc)||_0x35f9dc[_0x5c7ba9(0x19f)]('-')||_0x35f9dc[_0x5c7ba9(0x1e5)]('--')||_0x35f9dc[_0x5c7ba9(0x1b4)]>v)throw new h(_0x5c7ba9(0x143),_0x5c7ba9(0x166)+_0x35f9dc+'\x22:\x20expected\x20an\x20addressable\x20filesystem-safe\x20component\x20without\x20\x22--\x22.');}function S(_0x41072c){const _0x38ff78=_0x21b277;if(!b(_0x41072c)||_0x41072c[_0x38ff78(0x1b4)]+y>v)throw new h(_0x38ff78(0x1c5),_0x38ff78(0x151)+_0x41072c+_0x38ff78(0x1e1));}function _0x1cb0(_0x24f1aa,_0x514f49){_0x24f1aa=_0x24f1aa-0x11d;const _0x48ca62=_0x48ca();let _0x1cb0d5=_0x48ca62[_0x24f1aa];return _0x1cb0d5;}function C(_0x435b92){const _0x295b7f=_0x21b277;let _0x11120b=_0x435b92['split']('/');if(_0x11120b[_0x295b7f(0x1b4)]!==0x2||_0x11120b[0x0]===''||_0x11120b[0x1]==='')throw new h(_0x295b7f(0x17a),_0x295b7f(0x16a)+_0x435b92+'\x22;\x20expected\x20<registryId>/<resourceId>.',_0x435b92);let _0x1af40e=_0x11120b[0x0],_0x307032=_0x11120b[0x1];return x(_0x1af40e),S(_0x307032),{'registryId':_0x1af40e,'resourceId':_0x307032};}function ee(_0x463b1d,_0x5c0b96){return x(_0x463b1d),S(_0x5c0b96),_0x463b1d+'/'+_0x5c0b96;}function w(_0x519380){const _0x288ce1=_0x21b277;let {registryId:_0x701a12,resourceId:_0x1789fa}=C(_0x519380),_0x4ef26c=_0x701a12+'--'+_0x1789fa+_0x288ce1(0x1b2);if(_0x4ef26c[_0x288ce1(0x1b4)]>v)throw new h(_0x288ce1(0x1ea),_0x288ce1(0x1df)+v+'\x20bytes.',_0x519380);return _0x4ef26c;}function T(_0xf6e894){const _0x56dd67=_0x21b277;return new h(_0x56dd67(0x1e7),_0x56dd67(0x1a4)+_0xf6e894);}function _0x48ca(){const _0xae9f23=['Cannot\x20read\x20resource\x20manifest\x20at\x20','tags','group','resource-download-too-many-redirects','aborted','3381507haxQPG','handle','reference','cancel','type','test','globalIndex','utf8','\x20ID\x20\x22','1xmRXNk','resource-manifest-read-failed','resource-limit-invalid','Invalid\x20registry\x20ID\x20\x22','maxBytes','body','listRegistries','Invalid\x20resource\x20handle\x20\x22','en-US','location','resource-download-invalid-utf8','.description','cache','map','9EnIfOP','catch','set','has','\x20bytes.','isFinite','].input.registryId','2311734jQmoVj','1386020Hdlzgi','resource-invalid-handle','isArray','\x20without\x20a\x20Location\x20header.','\x20must\x20be\x20a\x20boolean.','.id','resource-invalid-svg','message','headers','.payload','intrinsicSize','\x20must\x20be\x20an\x20array.','cacheLocation','byteLength','registrations[','image','queries','\x20must\x20be\x20a\x20finite\x20number.','resources','registryById','\x22:\x20','Resource\x20request\x20redirected\x20to\x20a\x20non-HTTPS\x20URL.','.intrinsicSize.width','source','byteCount','\x20must\x20be\x20a\x20non-empty\x20string.','replace','utf-8','Duplicate\x20resource\x20handle\x20\x22','Resource\x20URL\x20must\x20use\x20HTTPS.','223480riTCjO','downloader','Resource\x20server\x20returned\x20HTTP\x20','description','manifest.registrations','registrationIndex','colorEditable','.name','startsWith','resource-download-insecure','Duplicate\x20','decode','.intrinsicSize.height','Invalid\x20resource\x20manifest:\x20','resource-download-invalid-svg','export','slice','catalog','\x20must\x20be\x20an\x20object.','Duplicate\x20registry\x20ID\x20\x22','.intrinsicSize\x20must\x20be\x20positive.','filter','https:','clear','code','1271904btNaOI',']\x20must\x20be\x20a\x20string.','.svg','resource-download-invalid-redirect','length','fetch','write','NFKC','].input.resources[','maxRedirects','.type\x20must\x20be\x20\x22image\x22.','text','keywords','20JSbpGW','width','output','order','status','value','done','resource','resource-invalid-resource-id','isInteger','\x20contains\x20no\x20usable\x20localized\x20text.','searchText','values','].input','size','Resource\x20search\x20needs\x20at\x20least\x20one\x20non-empty\x20query.','isFile','label','abort','.resource-','protocol','Resource\x20cache\x20root\x20must\x20be\x20an\x20absolute,\x20dedicated\x20directory\x20below\x20the\x20filesystem\x20root;\x20received\x20\x22','concat','toLowerCase','number','Resource\x20response\x20is\x20not\x20valid\x20UTF-8.','entries','.source','download','boolean','manifest','string','resource-not-found','ResourceLibraryError','Resource\x20export\x20filename\x20exceeds\x20','object','\x22:\x20expected\x20filesystem-safe\x20characters.','read','.source.type\x20must\x20be\x20\x22url\x22.','.storagePolicy\x20must\x20be\x20\x22reference\x22.','includes','resourceByHandle','resource-manifest-invalid','7DPHbAs','join','resource-export-filename-too-long','.tmp','pid','manual','isDirectory','.groupId\x20references\x20unknown\x20group\x20\x22','2986004kTfcPV','normalize','resourceCount','resourceIndex','Resource\x20exceeds\x20the\x20maximum\x20size\x20of\x20','resource-export-failed','33CqwZcu','].input.tags','options','name','.source.value\x20must\x20use\x20HTTPS.','groupId','handles','resource-registry-not-found','ENOENT','input','tagIds','registries','.groupId','Failed\x20to\x20download\x20\x22','timeoutMs','].input.groups','.source.value\x20must\x20be\x20a\x20URL.','registry','push','height','].input.resources','registryId','trim','clearCache','some','groups','Resource\x20search\x20limit\x20must\x20be\x20a\x20positive\x20integer;\x20received\x20\x22','.keywords','defaultLocale','get','signal','resource-invalid-registry-id','\x20ms.','registrations\x20must\x20not\x20be\x20empty.','.tagIds','fetchImpl','Resource\x20server\x20returned\x20an\x20invalid\x20redirect\x20URL.','.tagIds\x20references\x20unknown\x20tag\x20\x22','path','find','].id','Unknown\x20resource\x20\x22','2826192ZumIkT','url','Duplicate\x20export\x20filename\x20\x22','Invalid\x20resource\x20ID\x20\x22','Unknown\x20resource\x20registry\x20\x22','root','getReader'];_0x48ca=function(){return _0xae9f23;};return _0x48ca();}function E(_0xa85802,_0x2716c8){const _0x2eb61f=_0x21b277;if(typeof _0xa85802!=_0x2eb61f(0x1e0)||!_0xa85802||Array[_0x2eb61f(0x17b)](_0xa85802))throw T(_0x2716c8+_0x2eb61f(0x1a9));return _0xa85802;}function D(_0x90c69f,_0x2bf337,_0x10a850=!0x1){const _0x25a3a8=_0x21b277;if(_0x10a850&&_0x90c69f===void 0x0)return[];if(!Array[_0x25a3a8(0x17b)](_0x90c69f))throw T(_0x2bf337+_0x25a3a8(0x184));return _0x90c69f;}function O(_0x10a338,_0x35149b){const _0x52f34d=_0x21b277;if(typeof _0x10a338!=_0x52f34d(0x1dc)||_0x10a338==='')throw T(_0x35149b+_0x52f34d(0x192));return _0x10a338;}function k(_0x3af8b2,_0x11d466,_0x2e6057=!0x1){const _0x5e5601=_0x21b277;return D(_0x3af8b2,_0x11d466,_0x2e6057)[_0x5e5601(0x170)]((_0x1db9d4,_0x261e5e)=>O(_0x1db9d4,_0x11d466+'['+_0x261e5e+']'));}function A(_0x34d2f3,_0x538845){const _0x24afec=_0x21b277;return D(_0x34d2f3,_0x538845,!0x0)[_0x24afec(0x170)]((_0x1a54d9,_0x23c37b)=>{const _0x577a02=_0x24afec;if(typeof _0x1a54d9!='string')throw T(_0x538845+'['+_0x23c37b+_0x577a02(0x1b1));return _0x1a54d9;})[_0x24afec(0x1ac)](_0xa4cf8f=>_0xa4cf8f!=='');}function j(_0x1f1eda,_0x91c572){const _0x58ebb7=_0x21b277;if(typeof _0x1f1eda!=_0x58ebb7(0x1d5)||!Number[_0x58ebb7(0x176)](_0x1f1eda))throw T(_0x91c572+_0x58ebb7(0x18a));return _0x1f1eda;}function M(_0x4a2db0,_0x23d608){const _0x2f3b77=_0x21b277;if(typeof _0x4a2db0!=_0x2f3b77(0x1da))throw T(_0x23d608+_0x2f3b77(0x17d));return _0x4a2db0;}function N(_0x404e53,_0x130f90,_0x4db35b){const _0x5c2a97=_0x21b277;if(typeof _0x404e53=='string'&&_0x404e53!=='')return _0x404e53;let _0x49253c=E(_0x404e53,_0x130f90),_0x1ee734=_0x4db35b===void 0x0?void 0x0:_0x49253c[_0x4db35b];if(typeof _0x1ee734==_0x5c2a97(0x1dc)&&_0x1ee734!=='')return _0x1ee734;let _0x236fd4=_0x49253c[_0x5c2a97(0x16b)];if(typeof _0x236fd4==_0x5c2a97(0x1dc)&&_0x236fd4!=='')return _0x236fd4;let _0x2fb988=Object[_0x5c2a97(0x1c9)](_0x49253c)[_0x5c2a97(0x14b)](_0x3be431=>typeof _0x3be431=='string'&&_0x3be431!=='');if(_0x2fb988!==void 0x0)return _0x2fb988;throw T(_0x130f90+_0x5c2a97(0x1c7));}function P(_0x1835d2,_0x105db4,_0x5a657f){const _0x2757b1=_0x21b277;try{_0x5a657f==='registry'?x(_0x1835d2):S(_0x1835d2);}catch(_0x2edfc3){throw T(_0x105db4+':\x20'+(_0x2edfc3 instanceof Error?_0x2edfc3[_0x2757b1(0x180)]:String(_0x2edfc3)));}}function F(_0x45ebb4,_0x404e27,_0xfc89c8){const _0x173b93=_0x21b277;let _0x5655c7=new Map();for(let [_0x1c090d,_0x346c82]of D(_0x45ebb4,_0x404e27,!0x0)[_0x173b93(0x1d7)]()){let _0xf00ba=E(_0x346c82,_0x404e27+'['+_0x1c090d+']'),_0x493705=O(_0xf00ba['id'],_0x404e27+'['+_0x1c090d+_0x173b93(0x14c));if(P(_0x493705,_0x404e27+'['+_0x1c090d+_0x173b93(0x14c),'resource'),_0x5655c7[_0x173b93(0x174)](_0x493705))throw T(_0x173b93(0x1a1)+_0x404e27+_0x173b93(0x162)+_0x493705+'\x22.');_0x5655c7[_0x173b93(0x173)](_0x493705,N(_0xf00ba['label'],_0x404e27+'['+_0x1c090d+'].label',_0xfc89c8));}return _0x5655c7;}function I(_0x3dfcec,_0xf18a94){const _0x3b4255=_0x21b277;let _0x4a43ec=E(_0x3dfcec[_0x3b4255(0x183)],_0xf18a94+'.intrinsicSize'),_0x29c8b5=j(_0x4a43ec[_0x3b4255(0x1be)],_0xf18a94+_0x3b4255(0x18f)),_0x584875=j(_0x4a43ec[_0x3b4255(0x137)],_0xf18a94+_0x3b4255(0x1a3));if(_0x29c8b5<=0x0||_0x584875<=0x0)throw T(_0xf18a94+_0x3b4255(0x1ab));return{'width':_0x29c8b5,'height':_0x584875};}function L(_0x24d6e9,_0x382cab){const _0xc8815e=_0x21b277;if(_0x24d6e9['type']!==_0xc8815e(0x188))throw T(_0x382cab+_0xc8815e(0x1ba));if(_0x24d6e9['storagePolicy']!==_0xc8815e(0x15c))throw T(_0x382cab+_0xc8815e(0x1e4));let _0x2da962=E(_0x24d6e9[_0xc8815e(0x190)],_0x382cab+_0xc8815e(0x1d8));if(_0x2da962[_0xc8815e(0x15e)]!==_0xc8815e(0x14f))throw T(_0x382cab+_0xc8815e(0x1e3));let _0x53a96d=O(_0x2da962['value'],_0x382cab+'.source.value'),_0x2bac46;try{_0x2bac46=new URL(_0x53a96d);}catch{throw T(_0x382cab+_0xc8815e(0x134));}if(_0x2bac46[_0xc8815e(0x1d1)]!==_0xc8815e(0x1ad))throw T(_0x382cab+_0xc8815e(0x128));return _0x53a96d;}function R(_0x404cb5){const _0x47dfe8=_0x21b277;return _0x404cb5[_0x47dfe8(0x11f)](_0x47dfe8(0x1b7))[_0x47dfe8(0x1d4)]()[_0x47dfe8(0x13a)]()[_0x47dfe8(0x193)](/\s+/gu,'\x20');}function z(_0x44ca81){const _0x65c4cc=_0x21b277;let _0x3c878b=E(_0x44ca81,_0x65c4cc(0x1db)),_0x23a565=new Map(),_0x2d82e7=new Map(),_0x3f0d03=[],_0x1178fc=[],_0x1d15e5=new Set(),_0x4061d1=0x0;for(let [_0x5d626d,_0x1dadf6]of D(_0x3c878b['registrations'],_0x65c4cc(0x19b))['entries']()){let _0x39337b=E(E(_0x1dadf6,'registrations['+_0x5d626d+']')[_0x65c4cc(0x12d)],'registrations['+_0x5d626d+_0x65c4cc(0x1ca)),_0x15041c=O(_0x39337b[_0x65c4cc(0x139)],'registrations['+_0x5d626d+'].input.registryId');if(P(_0x15041c,_0x65c4cc(0x187)+_0x5d626d+_0x65c4cc(0x177),_0x65c4cc(0x135)),_0x23a565[_0x65c4cc(0x174)](_0x15041c))throw T(_0x65c4cc(0x1aa)+_0x15041c+'\x22.');let _0x253bee=_0x39337b[_0x65c4cc(0x140)]===void 0x0?void 0x0:O(_0x39337b['defaultLocale'],_0x65c4cc(0x187)+_0x5d626d+'].input.defaultLocale'),_0x5894d6=F(_0x39337b[_0x65c4cc(0x13d)],'registrations['+_0x5d626d+_0x65c4cc(0x133),_0x253bee),_0x59c40e=F(_0x39337b[_0x65c4cc(0x156)],_0x65c4cc(0x187)+_0x5d626d+_0x65c4cc(0x125),_0x253bee),_0x39e26c=[];for(let [_0x2b42eb,_0x4167c7]of D(_0x39337b[_0x65c4cc(0x18b)],_0x65c4cc(0x187)+_0x5d626d+_0x65c4cc(0x138))[_0x65c4cc(0x1d7)]()){let _0x2d8247=_0x65c4cc(0x187)+_0x5d626d+_0x65c4cc(0x1b8)+_0x2b42eb+']',_0x1b7479=E(_0x4167c7,_0x2d8247),_0x2aa883=O(_0x1b7479['id'],_0x2d8247+_0x65c4cc(0x17e));P(_0x2aa883,_0x2d8247+_0x65c4cc(0x17e),_0x65c4cc(0x1c4));let _0x3a2a73=ee(_0x15041c,_0x2aa883);if(_0x2d82e7['has'](_0x3a2a73))throw T(_0x65c4cc(0x195)+_0x3a2a73+'\x22.');let _0x27e414;try{_0x27e414=w(_0x3a2a73);}catch(_0xcc406e){throw T(_0x2d8247+':\x20'+(_0xcc406e instanceof Error?_0xcc406e[_0x65c4cc(0x180)]:String(_0xcc406e)));}if(_0x1d15e5[_0x65c4cc(0x174)](_0x27e414))throw T(_0x65c4cc(0x150)+_0x27e414+'\x22.');_0x1d15e5['add'](_0x27e414);let _0x30727f=_0x1b7479['groupId']===void 0x0?void 0x0:O(_0x1b7479[_0x65c4cc(0x129)],_0x2d8247+_0x65c4cc(0x130));if(_0x30727f!==void 0x0&&!_0x5894d6[_0x65c4cc(0x174)](_0x30727f))throw T(_0x2d8247+_0x65c4cc(0x11d)+_0x30727f+'\x22.');let _0x5c72a5=k(_0x1b7479[_0x65c4cc(0x12e)],_0x2d8247+_0x65c4cc(0x146),!0x0);for(let _0x2c1eae of _0x5c72a5)if(!_0x59c40e[_0x65c4cc(0x174)](_0x2c1eae))throw T(_0x2d8247+_0x65c4cc(0x149)+_0x2c1eae+'\x22.');let _0x534f67=A(_0x1b7479[_0x65c4cc(0x1bc)],_0x2d8247+_0x65c4cc(0x13f)),_0x3e4953=N(_0x1b7479[_0x65c4cc(0x127)],_0x2d8247+_0x65c4cc(0x19e),_0x253bee),_0x169b76=_0x1b7479['description']===void 0x0?void 0x0:N(_0x1b7479[_0x65c4cc(0x19a)],_0x2d8247+_0x65c4cc(0x16e),_0x253bee),_0x1dd320=_0x30727f===void 0x0?null:{'id':_0x30727f,'label':_0x5894d6[_0x65c4cc(0x141)](_0x30727f)},_0x450ae6=_0x5c72a5[_0x65c4cc(0x170)](_0x4e1a6e=>({'id':_0x4e1a6e,'label':_0x59c40e[_0x65c4cc(0x141)](_0x4e1a6e)})),_0x20716d=E(_0x1b7479['payload'],_0x2d8247+_0x65c4cc(0x182)),_0x7cdc4c=_0x1b7479['order']===void 0x0?null:j(_0x1b7479['order'],_0x2d8247+'.order'),_0x1c737c=M(_0x20716d[_0x65c4cc(0x19d)],_0x2d8247+'.payload.colorEditable'),_0x1450e3={'handle':_0x3a2a73,'registryId':_0x15041c,'id':_0x2aa883,'name':_0x3e4953,..._0x169b76===void 0x0?{}:{'description':_0x169b76},'group':_0x1dd320,'tags':_0x450ae6,'keywords':_0x534f67,'order':_0x7cdc4c,'intrinsicSize':I(_0x20716d,_0x2d8247+_0x65c4cc(0x182)),'colorEditable':_0x1c737c,'sourceUrl':L(_0x20716d,_0x2d8247+_0x65c4cc(0x182)),'registrationIndex':_0x5d626d,'resourceIndex':_0x2b42eb,'globalIndex':_0x4061d1,'searchText':R([_0x3e4953,_0x169b76,_0x1dd320?.[_0x65c4cc(0x1ce)],..._0x450ae6[_0x65c4cc(0x170)](_0x531e85=>_0x531e85[_0x65c4cc(0x1ce)]),..._0x534f67][_0x65c4cc(0x1ac)](_0x38c307=>_0x38c307!==void 0x0)[_0x65c4cc(0x1e9)]('\x20'))};_0x4061d1++,_0x39e26c['push'](_0x1450e3),_0x1178fc[_0x65c4cc(0x136)](_0x1450e3),_0x2d82e7[_0x65c4cc(0x173)](_0x3a2a73,_0x1450e3);}let _0x330842={'id':_0x15041c,'groups':_0x5894d6,'tags':_0x59c40e,'resources':_0x39e26c};_0x3f0d03['push'](_0x330842),_0x23a565[_0x65c4cc(0x173)](_0x15041c,_0x330842);}if(_0x3f0d03['length']===0x0)throw T(_0x65c4cc(0x145));return{'registries':_0x3f0d03,'registryById':_0x23a565,'resourceByHandle':_0x2d82e7,'resources':_0x1178fc};}function B(_0x35669d,_0x5dd396){const _0x391b24=_0x21b277;C(_0x5dd396);let _0x59a809=_0x35669d[_0x391b24(0x1e6)]['get'](_0x5dd396);if(_0x59a809===void 0x0)throw new h(_0x391b24(0x1dd),_0x391b24(0x14d)+_0x5dd396+'\x22;\x20try\x20resources\x20find\x20<query>.',_0x5dd396);return _0x59a809;}function te(_0x23ce7a){const _0x23277e=_0x21b277;return _0x23ce7a[_0x23277e(0x12f)]['map'](_0x14b5c6=>({'id':_0x14b5c6['id'],'resourceCount':_0x14b5c6[_0x23277e(0x18b)][_0x23277e(0x1b4)],'groupCount':_0x14b5c6[_0x23277e(0x13d)]['size'],'tagCount':_0x14b5c6[_0x23277e(0x156)]['size'],'colorEditableCount':_0x14b5c6['resources'][_0x23277e(0x1ac)](_0x37f80d=>_0x37f80d['colorEditable'])[_0x23277e(0x1b4)]}));}function ne(_0x3fc505){const _0x500361=_0x21b277;return{'handle':_0x3fc505[_0x500361(0x15b)],'registryId':_0x3fc505[_0x500361(0x139)],'id':_0x3fc505['id'],'name':_0x3fc505[_0x500361(0x127)],'group':_0x3fc505[_0x500361(0x157)],'tags':_0x3fc505['tags'],'keywords':_0x3fc505[_0x500361(0x1bc)],'order':_0x3fc505['order'],'intrinsicSize':_0x3fc505[_0x500361(0x183)],'colorEditable':_0x3fc505[_0x500361(0x19d)]};}function re(_0xc9217f,_0x6f6f55){const _0x2d1d1b=_0x21b277;let _0x5562a3=(_0xc9217f[_0x2d1d1b(0x1c0)]??_0xc9217f['globalIndex'])-(_0x6f6f55[_0x2d1d1b(0x1c0)]??_0x6f6f55[_0x2d1d1b(0x160)]);if(_0x5562a3!==0x0)return _0x5562a3;let _0x4a619a=_0xc9217f['registrationIndex']-_0x6f6f55[_0x2d1d1b(0x19c)];if(_0x4a619a!==0x0)return _0x4a619a;let _0x3bf6c0=_0xc9217f['resourceIndex']-_0x6f6f55[_0x2d1d1b(0x121)];return _0x3bf6c0===0x0?_0xc9217f[_0x2d1d1b(0x15b)]['localeCompare'](_0x6f6f55[_0x2d1d1b(0x15b)]):_0x3bf6c0;}function ie(_0x3db298,_0xac730a){const _0x39f72e=_0x21b277;let _0x4ce6f4=_0xac730a[_0x39f72e(0x189)][_0x39f72e(0x170)](R)[_0x39f72e(0x1ac)](_0x170cb5=>_0x170cb5!=='');if(_0x4ce6f4['length']===0x0)throw new h('resource-query-empty',_0x39f72e(0x1cc));let _0x1df9d2=new Set(_0xac730a[_0x39f72e(0x12f)]??[]);for(let _0x165643 of _0x1df9d2)if(!_0x3db298[_0x39f72e(0x18c)]['has'](_0x165643))throw new h(_0x39f72e(0x12b),_0x39f72e(0x152)+_0x165643+'\x22.');let _0x1b498a=_0xac730a['limit']??_0x3db298[_0x39f72e(0x18b)][_0x39f72e(0x1b4)];if(!Number[_0x39f72e(0x1c6)](_0x1b498a)||_0x1b498a<0x1)throw new h(_0x39f72e(0x165),_0x39f72e(0x13e)+_0x1b498a+'\x22.');let _0x42372b=_0x3db298[_0x39f72e(0x18b)]['filter'](_0x4e0b28=>_0x1df9d2[_0x39f72e(0x1cb)]===0x0||_0x1df9d2[_0x39f72e(0x174)](_0x4e0b28[_0x39f72e(0x139)]))['filter'](_0x47df9d=>_0x4ce6f4[_0x39f72e(0x13c)](_0x501ab4=>_0x47df9d[_0x39f72e(0x1c8)]['includes'](_0x501ab4)))['sort'](re);return{'resources':_0x42372b[_0x39f72e(0x1a7)](0x0,_0x1b498a)[_0x39f72e(0x170)](ne),'total':_0x42372b['length']};}function V(_0x3247af){const _0x146d28=_0x21b277;return/^\s*(?:<\?xml[^>]*>\s*)?(?:<!--[^]*?-->\s*)*<svg(?:\s|>)/iu[_0x146d28(0x15f)](_0x3247af);}function H(_0x51adf4,_0x4562c2){const _0x4addd2=_0x21b277;return g(_0x4562c2)?{'handle':_0x51adf4,'code':_0x4562c2[_0x4addd2(0x1af)],'message':_0x4562c2[_0x4addd2(0x180)]}:{'handle':_0x51adf4,'code':_0x4addd2(0x123),'message':_0x4562c2 instanceof Error?_0x4562c2[_0x4addd2(0x180)]:String(_0x4562c2)};}var U=class{[_0x21b277(0x126)];[_0x21b277(0x1a8)];constructor(_0x3b461e){const _0x14b952=_0x21b277;this[_0x14b952(0x126)]=_0x3b461e,this[_0x14b952(0x1a8)]=z(_0x3b461e[_0x14b952(0x1db)]);}get[_0x21b277(0x185)](){const _0x37cce5=_0x21b277;return this['options'][_0x37cce5(0x16f)][_0x37cce5(0x16c)];}[_0x21b277(0x169)](){const _0x4699a=_0x21b277;return te(this[_0x4699a(0x1a8)]);}['find'](_0x1e76e2){return ie(this['catalog'],_0x1e76e2);}async['read'](_0x3a3322){const _0x200bf6=_0x21b277;let _0x401e3e=B(this['catalog'],_0x3a3322[_0x200bf6(0x15b)]),_0x498013=await this[_0x200bf6(0x126)][_0x200bf6(0x16f)][_0x200bf6(0x1e2)](_0x3a3322[_0x200bf6(0x15b)]);if(_0x498013!==void 0x0&&V(_0x498013))return{'handle':_0x3a3322[_0x200bf6(0x15b)],'svg':_0x498013};let _0x5e5967;try{_0x5e5967=await this[_0x200bf6(0x126)][_0x200bf6(0x198)][_0x200bf6(0x1d9)](_0x401e3e['sourceUrl']);}catch(_0x4df8fb){throw g(_0x4df8fb)?_0x4df8fb:new h('resource-download-failed',_0x200bf6(0x131)+_0x3a3322['handle']+_0x200bf6(0x18d)+(_0x4df8fb instanceof Error?_0x4df8fb[_0x200bf6(0x180)]:String(_0x4df8fb)),_0x3a3322[_0x200bf6(0x15b)],{'cause':_0x4df8fb});}if(!V(_0x5e5967))throw new h(_0x200bf6(0x17f),'Downloaded\x20resource\x20\x22'+_0x3a3322[_0x200bf6(0x15b)]+'\x22\x20is\x20not\x20an\x20SVG\x20document.',_0x3a3322['handle']);return await this[_0x200bf6(0x126)][_0x200bf6(0x16f)]['write'](_0x3a3322[_0x200bf6(0x15b)],_0x5e5967),{'handle':_0x3a3322[_0x200bf6(0x15b)],'svg':_0x5e5967};}async[_0x21b277(0x1a6)](_0x37fa4a){const _0x28ae5f=_0x21b277;let _0x81d449=[],_0x4150bf=[];for(let _0x413c21 of _0x37fa4a[_0x28ae5f(0x12a)])try{let {svg:_0xa76e99}=await this['read']({'handle':_0x413c21}),_0x2b0c87=await this['options'][_0x28ae5f(0x1bf)][_0x28ae5f(0x1b6)](_0x37fa4a['destination'],w(_0x413c21),_0xa76e99);_0x81d449[_0x28ae5f(0x136)]({'handle':_0x413c21,'path':_0x2b0c87});}catch(_0x3b2d86){_0x4150bf[_0x28ae5f(0x136)](H(_0x413c21,_0x3b2d86));}return{'exported':_0x81d449,'failed':_0x4150bf};}async[_0x21b277(0x13b)](){const _0x2fbf2f=_0x21b277;return await this[_0x2fbf2f(0x126)][_0x2fbf2f(0x16f)][_0x2fbf2f(0x1ae)]();}};function W(_0x589368){return new U(_0x589368);}function G(_0x33eb6f){return _0x33eb6f instanceof Error&&'code'in _0x33eb6f;}function K(_0x543def){const _0x9ad95=_0x21b277;let _0x32f0bc=_0x395d44(_0x543def);if(!_0x37d03e(_0x543def)||_0x32f0bc===_0x26b40e(_0x32f0bc)[_0x9ad95(0x153)])throw new h('resource-cache-root-invalid',_0x9ad95(0x1d2)+_0x543def+'\x22.');return _0x32f0bc;}async function q(_0x9a0f73){const _0x2281bd=_0x21b277;let _0x632cf0;try{_0x632cf0=await _0x23a838(_0x9a0f73,{'withFileTypes':!0x0});}catch(_0x12a781){if(G(_0x12a781)&&_0x12a781[_0x2281bd(0x1af)]===_0x2281bd(0x12c))return{'resourceCount':0x0,'byteCount':0x0};throw _0x12a781;}let _0x21042f=0x0,_0x79df33=0x0;for(let _0x261dbb of _0x632cf0){let _0x55ba84=_0x594d1b(_0x9a0f73,_0x261dbb['name']);if(_0x261dbb[_0x2281bd(0x1ee)]()){let _0x2c7a14=await q(_0x55ba84);_0x21042f+=_0x2c7a14[_0x2281bd(0x120)],_0x79df33+=_0x2c7a14[_0x2281bd(0x191)];}else{if(_0x261dbb[_0x2281bd(0x1cd)]()&&_0x261dbb[_0x2281bd(0x127)]['endsWith'](_0x2281bd(0x1b2))){let _0x534893=await _0x338b48(_0x55ba84);_0x21042f++,_0x79df33+=_0x534893[_0x2281bd(0x1cb)];}}}return{'resourceCount':_0x21042f,'byteCount':_0x79df33};}var J=class{[_0x21b277(0x16c)];constructor(_0x21b49e){this['location']=K(_0x21b49e);}[_0x21b277(0x14a)](_0x45fbe9){const _0x7c6ed7=_0x21b277;let {registryId:_0x15de7b,resourceId:_0x1999fe}=C(_0x45fbe9);return _0x594d1b(this[_0x7c6ed7(0x16c)],_0x15de7b,_0x1999fe+_0x7c6ed7(0x1b2));}async[_0x21b277(0x1e2)](_0x307a2e){const _0x44ae2c=_0x21b277;try{return await _0x327b2b(this['path'](_0x307a2e),_0x44ae2c(0x161));}catch(_0x1a06b7){if(G(_0x1a06b7)&&_0x1a06b7[_0x44ae2c(0x1af)]===_0x44ae2c(0x12c))return;throw _0x1a06b7;}}async[_0x21b277(0x1b6)](_0x47e4f0,_0x1ce930){const _0x403efe=_0x21b277;let _0x4534fd=this[_0x403efe(0x14a)](_0x47e4f0);await _0x229735(_0x3a2a08(_0x4534fd),{'recursive':!0x0});let _0x37bf04=_0x594d1b(_0x3a2a08(_0x4534fd),_0x403efe(0x1d0)+process[_0x403efe(0x1ec)]+'-'+_0x568d4c()+_0x403efe(0x1eb));try{await _0x5bca69(_0x37bf04,_0x1ce930,{'encoding':_0x403efe(0x161),'mode':0x180}),await _0x18e241(_0x37bf04,_0x4534fd);}catch(_0x287ee6){throw await _0xb6b66e(_0x37bf04)[_0x403efe(0x172)](()=>void 0x0),_0x287ee6;}}async['clear'](){const _0x1b6b24=_0x21b277;let _0x466bed=await q(this[_0x1b6b24(0x16c)]);return await _0x3a1ba3(this[_0x1b6b24(0x16c)],{'force':!0x0,'recursive':!0x0}),{'path':this['location'],..._0x466bed};}},Y=class{async[_0x21b277(0x1b6)](_0x345079,_0x46821d,_0x500335){const _0x4c125d=_0x21b277;await _0x229735(_0x345079,{'recursive':!0x0});let _0x1c6594=_0x594d1b(_0x345079,_0x46821d);return await _0x5bca69(_0x1c6594,_0x500335,_0x4c125d(0x161)),_0x1c6594;}},X=0x7530,ae=0xa00000,oe=0xa,se=new Set([0x12d,0x12e,0x12f,0x133,0x134]);function Z(_0x53a11e){const _0x782de5=_0x21b277;return new h('resource-download-too-large',_0x782de5(0x122)+_0x53a11e+_0x782de5(0x175));}async function ce(_0x1d77e5,_0x49392e){const _0x48362a=_0x21b277;let _0x4b87b3=Number(_0x1d77e5[_0x48362a(0x181)]['get']('content-length'));if(Number['isFinite'](_0x4b87b3)&&_0x4b87b3>_0x49392e)throw Z(_0x49392e);if(_0x1d77e5[_0x48362a(0x168)]===null){let _0x2d827d=await _0x1d77e5[_0x48362a(0x1bb)]();if(Buffer[_0x48362a(0x186)](_0x2d827d)>_0x49392e)throw Z(_0x49392e);return _0x2d827d;}let _0x2c9438=_0x1d77e5[_0x48362a(0x168)][_0x48362a(0x154)](),_0x505acd=[],_0xbea7a4=0x0;try{for(;;){let _0x473e8f=await _0x2c9438[_0x48362a(0x1e2)]();if(_0x473e8f[_0x48362a(0x1c3)])break;if(_0xbea7a4+=_0x473e8f[_0x48362a(0x1c2)][_0x48362a(0x186)],_0xbea7a4>_0x49392e)throw await _0x2c9438[_0x48362a(0x15d)]()['catch'](()=>void 0x0),Z(_0x49392e);_0x505acd['push'](_0x473e8f[_0x48362a(0x1c2)]);}}finally{_0x2c9438['releaseLock']();}try{return new TextDecoder(_0x48362a(0x194),{'fatal':!0x0})[_0x48362a(0x1a2)](Buffer[_0x48362a(0x1d3)](_0x505acd,_0xbea7a4));}catch{throw new h(_0x48362a(0x16d),_0x48362a(0x1d6));}}var Q=class{[_0x21b277(0x147)];['timeoutMs'];[_0x21b277(0x167)];['maxRedirects'];constructor(_0x490091={}){const _0x215b9d=_0x21b277;this[_0x215b9d(0x147)]=_0x490091[_0x215b9d(0x1b5)]??fetch,this[_0x215b9d(0x132)]=_0x490091[_0x215b9d(0x132)]??X,this[_0x215b9d(0x167)]=_0x490091[_0x215b9d(0x167)]??ae,this['maxRedirects']=_0x490091[_0x215b9d(0x1b9)]??oe;}async[_0x21b277(0x1d9)](_0x158e63){const _0x10bd92=_0x21b277;let _0x5cbb2f=new URL(_0x158e63);if(_0x5cbb2f[_0x10bd92(0x1d1)]!=='https:')throw new h(_0x10bd92(0x1a0),_0x10bd92(0x196));let _0x4d122f=new AbortController(),_0x28ebed=setTimeout(()=>_0x4d122f[_0x10bd92(0x1cf)](),this[_0x10bd92(0x132)]);try{let _0x201315=_0x5cbb2f;for(let _0x5575f4=0x0;;_0x5575f4++){let _0x22af4e=await this[_0x10bd92(0x147)](_0x201315,{'redirect':_0x10bd92(0x1ed),'signal':_0x4d122f[_0x10bd92(0x142)]});if(se[_0x10bd92(0x174)](_0x22af4e[_0x10bd92(0x1c1)])){if(_0x5575f4>=this[_0x10bd92(0x1b9)])throw new h(_0x10bd92(0x158),'Resource\x20request\x20followed\x20too\x20many\x20redirects;\x20maximum\x20'+this[_0x10bd92(0x1b9)]+'.');let _0x7a9937=_0x22af4e['headers'][_0x10bd92(0x141)](_0x10bd92(0x16c));if(_0x7a9937===null)throw new h(_0x10bd92(0x1b3),_0x10bd92(0x199)+_0x22af4e[_0x10bd92(0x1c1)]+_0x10bd92(0x17c));let _0x11af56;try{_0x11af56=new URL(_0x7a9937,_0x201315);}catch{throw new h('resource-download-invalid-redirect',_0x10bd92(0x148));}if(_0x11af56['protocol']!==_0x10bd92(0x1ad))throw new h('resource-download-insecure-redirect',_0x10bd92(0x18e));_0x201315=_0x11af56;continue;}if(!_0x22af4e['ok'])throw new h('resource-download-http',_0x10bd92(0x199)+_0x22af4e['status']+'.');if(_0x22af4e[_0x10bd92(0x14f)]!==''&&new URL(_0x22af4e['url'])[_0x10bd92(0x1d1)]!==_0x10bd92(0x1ad))throw new h('resource-download-insecure-redirect','Resource\x20request\x20redirected\x20to\x20a\x20non-HTTPS\x20URL.');let _0x52b4d2=await ce(_0x22af4e,this[_0x10bd92(0x167)]);if(!V(_0x52b4d2))throw new h(_0x10bd92(0x1a5),'Resource\x20response\x20is\x20not\x20an\x20SVG\x20document.');return _0x52b4d2;}}catch(_0x22c394){throw _0x4d122f[_0x10bd92(0x142)][_0x10bd92(0x159)]?new h('resource-download-timeout','Resource\x20download\x20timed\x20out\x20after\x20'+this[_0x10bd92(0x132)]+_0x10bd92(0x144)):_0x22c394;}finally{clearTimeout(_0x28ebed);}}};function $(_0x239c11){const _0x441ac9=_0x21b277;try{return JSON['parse'](_0x1fcc03(_0x239c11,'utf8'));}catch(_0x6e539b){throw new h(_0x441ac9(0x164),_0x441ac9(0x155)+_0x239c11+':\x20'+(_0x6e539b instanceof Error?_0x6e539b['message']:String(_0x6e539b)),void 0x0,{'cause':_0x6e539b});}}function le(_0x32f136){const _0x26d202=_0x21b277;let _0x1f1509;return()=>(_0x1f1509??=W({'manifest':$(_0x32f136['manifestPath']),'cache':new J(_0x32f136['cacheRoot']),'downloader':new Q(_0x32f136[_0x26d202(0x198)]),'output':new Y()}),_0x1f1509);}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};
|