@univer-cli/resource-library 1.0.3 → 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.
Files changed (2) hide show
  1. package/dist/index.mjs +1 -1
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- const _0x36f18f=_0x41d8;function _0x41d8(_0x4be193,_0x39f98e){_0x4be193=_0x4be193-0x162;const _0x51e577=_0x51e5();let _0x41d846=_0x51e577[_0x4be193];return _0x41d846;}(function(_0x49d687,_0x29a772){const _0x463381=_0x41d8,_0x3b6137=_0x49d687();while(!![]){try{const _0x549d89=-parseInt(_0x463381(0x173))/0x1*(parseInt(_0x463381(0x200))/0x2)+parseInt(_0x463381(0x174))/0x3*(-parseInt(_0x463381(0x1d9))/0x4)+-parseInt(_0x463381(0x1bb))/0x5*(parseInt(_0x463381(0x1d3))/0x6)+parseInt(_0x463381(0x207))/0x7*(-parseInt(_0x463381(0x20f))/0x8)+parseInt(_0x463381(0x19e))/0x9*(-parseInt(_0x463381(0x206))/0xa)+-parseInt(_0x463381(0x176))/0xb*(parseInt(_0x463381(0x1f1))/0xc)+parseInt(_0x463381(0x204))/0xd;if(_0x549d89===_0x29a772)break;else _0x3b6137['push'](_0x3b6137['shift']());}catch(_0x5d41f7){_0x3b6137['push'](_0x3b6137['shift']());}}}(_0x51e5,0x90759));import{randomUUID as _0x48d2ba}from'node:crypto';import{mkdir as _0x2d6fe0,readFile as _0x500d43,readdir as _0x55d9f4,rename as _0x61a7d4,rm as _0x2f55c9,stat as _0x3baf01,unlink as _0x107d1e,writeFile as _0x5100ca}from'node:fs/promises';import{dirname as _0x7834fb,isAbsolute as _0x89782b,join as _0x1d1f2a,parse as _0x16efce,resolve as _0x1b334b}from'node:path';import{readFileSync as _0x44365f}from'node:fs';var h=class extends Error{[_0x36f18f(0x21f)];['handle'];constructor(_0x5cbbf2,_0x54f72e,_0x2f0ac0,_0x315d9d){const _0x3448b1=_0x36f18f;super(_0x54f72e,_0x315d9d),this[_0x3448b1(0x21f)]=_0x5cbbf2,this[_0x3448b1(0x217)]=_0x2f0ac0,this[_0x3448b1(0x18a)]=_0x3448b1(0x1a0);}};function g(_0x1bc98c){return _0x1bc98c instanceof h;}var _=/^[A-Za-z0-9._-]+$/u,v=0xff,y=0x4;function b(_0x1ea9d0){const _0xef1cb2=_0x36f18f;return _[_0xef1cb2(0x1e7)](_0x1ea9d0)&&_0x1ea9d0!=='.'&&_0x1ea9d0!=='..';}function x(_0x49e2e4){const _0x390fc9=_0x36f18f;if(!b(_0x49e2e4)||_0x49e2e4[_0x390fc9(0x1b6)]('-')||_0x49e2e4[_0x390fc9(0x213)]('--')||_0x49e2e4['length']>v)throw new h(_0x390fc9(0x21d),'Invalid\x20registry\x20ID\x20\x22'+_0x49e2e4+_0x390fc9(0x1ca));}function S(_0x1a761c){const _0x30ec52=_0x36f18f;if(!b(_0x1a761c)||_0x1a761c[_0x30ec52(0x1ce)]+y>v)throw new h(_0x30ec52(0x16a),'Invalid\x20resource\x20ID\x20\x22'+_0x1a761c+_0x30ec52(0x194));}function C(_0x278607){const _0x332180=_0x36f18f;let _0x25695c=_0x278607['split']('/');if(_0x25695c[_0x332180(0x1ce)]!==0x2||_0x25695c[0x0]===''||_0x25695c[0x1]==='')throw new h(_0x332180(0x1fc),_0x332180(0x1a2)+_0x278607+_0x332180(0x182),_0x278607);let _0x731cf3=_0x25695c[0x0],_0x2568dd=_0x25695c[0x1];return x(_0x731cf3),S(_0x2568dd),{'registryId':_0x731cf3,'resourceId':_0x2568dd};}function _0x51e5(){const _0x194c27=['884948rbfNwy','resourceIndex','sort','keywords','input','resource-invalid-svg','Resource\x20server\x20returned\x20HTTP\x20','fetch','localeCompare','some','aborted','\x20must\x20be\x20a\x20finite\x20number.','manifest.registrations','read','test','source','registries','string','\x22;\x20try\x20resources\x20find\x20<query>.','catch','listRegistries','].id','message','\x20must\x20be\x20a\x20non-empty\x20string.','120OlhGwl','.description','toLowerCase','searchText','registryId','Failed\x20to\x20download\x20\x22','Resource\x20export\x20filename\x20exceeds\x20','done','root','resource-download-too-large','groupId','resource-invalid-handle','\x22\x20is\x20not\x20an\x20SVG\x20document.','abort','registrationIndex','60266czGQei','.svg','.tmp','Resource\x20download\x20timed\x20out\x20after\x20','50604268FnciwX','decode','30QoFxrF','217QZZbDN','Resource\x20response\x20is\x20not\x20valid\x20UTF-8.','order','.id','resource-download-invalid-redirect','\x20ms.','https:','resource-download-invalid-utf8','268304qFyszS','url','export','content-length','includes','manual','endsWith','boolean','handle','\x20must\x20be\x20a\x20boolean.','Resource\x20URL\x20must\x20use\x20HTTPS.','maxRedirects','resource-download-http','.source','resource-invalid-registry-id','destination','code','.intrinsicSize','.groupId','registrations','isFinite','resource-download-invalid-svg','write','Resource\x20search\x20needs\x20at\x20least\x20one\x20non-empty\x20query.','label','.source.type\x20must\x20be\x20\x22url\x22.','cache','.payload.colorEditable','size','getReader','pid','Duplicate\x20resource\x20handle\x20\x22','Resource\x20exceeds\x20the\x20maximum\x20size\x20of\x20','location','resource-invalid-resource-id','.tagIds\x20references\x20unknown\x20tag\x20\x22',']\x20must\x20be\x20a\x20string.','registryById','status','byteLength','signal','resource-download-failed','storagePolicy','13zJqIuz','9oUZjHS','options','734635DViaCT','globalIndex','registry','resource-cache-root-invalid','maxBytes','Resource\x20request\x20followed\x20too\x20many\x20redirects;\x20maximum\x20','cancel','width','isInteger','isArray','resource-manifest-invalid','download','\x22;\x20expected\x20<registryId>/<resourceId>.','registrations\x20must\x20not\x20be\x20empty.','body','.source.value\x20must\x20be\x20a\x20URL.','set','.source.value','filter','resource-registry-not-found','name','headers','.groupId\x20references\x20unknown\x20group\x20\x22','downloader','fetchImpl','.intrinsicSize.width','resource-download-insecure-redirect','].input.tags','\x20bytes.','\x20contains\x20no\x20usable\x20localized\x20text.','\x22:\x20expected\x20filesystem-safe\x20characters.','Duplicate\x20registry\x20ID\x20\x22','description','\x20must\x20be\x20an\x20object.','get','.payload','Resource\x20server\x20returned\x20an\x20invalid\x20redirect\x20URL.','Resource\x20cache\x20root\x20must\x20be\x20an\x20absolute,\x20dedicated\x20directory\x20below\x20the\x20filesystem\x20root;\x20received\x20\x22','payload','protocol','1598157LTygsw','map','ResourceLibraryError','timeoutMs','Invalid\x20resource\x20handle\x20\x22','\x20without\x20a\x20Location\x20header.','resource','slice','height','defaultLocale','resource-not-found','Duplicate\x20','].input.defaultLocale','byteCount','queries','find','Invalid\x20resource\x20manifest:\x20','manifestPath','ENOENT','value','utf8','join','].input.resources[','Resource\x20request\x20redirected\x20to\x20a\x20non-HTTPS\x20URL.','startsWith','].input.resources','resource-download-timeout','resource-download-too-many-redirects','path','13110pgwVfb','colorEditable','].input.registryId','.name','registrations[','Duplicate\x20export\x20filename\x20\x22','output','.resource-','\x20ID\x20\x22','.keywords','catalog','Resource\x20response\x20is\x20not\x20an\x20SVG\x20document.','type','has','Unknown\x20resource\x20\x22','\x22:\x20expected\x20an\x20addressable\x20filesystem-safe\x20component\x20without\x20\x22--\x22.','utf-8','NFKC','entries','length','.source.value\x20must\x20use\x20HTTPS.','resources','.intrinsicSize\x20must\x20be\x20positive.','push','12gSdqUy','normalize','clear','manifest','number','resource-manifest-read-failed'];_0x51e5=function(){return _0x194c27;};return _0x51e5();}function ee(_0x419039,_0x219a36){return x(_0x419039),S(_0x219a36),_0x419039+'/'+_0x219a36;}function w(_0x368c65){const _0x5be645=_0x36f18f;let {registryId:_0x171761,resourceId:_0x214a6b}=C(_0x368c65),_0x514009=_0x171761+'--'+_0x214a6b+_0x5be645(0x201);if(_0x514009[_0x5be645(0x1ce)]>v)throw new h('resource-export-filename-too-long',_0x5be645(0x1f7)+v+'\x20bytes.',_0x368c65);return _0x514009;}function T(_0x107191){const _0x4268db=_0x36f18f;return new h(_0x4268db(0x180),_0x4268db(0x1ae)+_0x107191);}function E(_0x3be043,_0x3533a4){const _0x2975d2=_0x36f18f;if(typeof _0x3be043!='object'||!_0x3be043||Array['isArray'](_0x3be043))throw T(_0x3533a4+_0x2975d2(0x197));return _0x3be043;}function D(_0x4af69f,_0x416372,_0xdd96fb=!0x1){const _0x2654eb=_0x36f18f;if(_0xdd96fb&&_0x4af69f===void 0x0)return[];if(!Array[_0x2654eb(0x17f)](_0x4af69f))throw T(_0x416372+'\x20must\x20be\x20an\x20array.');return _0x4af69f;}function O(_0x4f5fba,_0x28fcee){const _0x118947=_0x36f18f;if(typeof _0x4f5fba!=_0x118947(0x1ea)||_0x4f5fba==='')throw T(_0x28fcee+_0x118947(0x1f0));return _0x4f5fba;}function k(_0x3aebf7,_0x3b5fee,_0x36481b=!0x1){const _0x40c577=_0x36f18f;return D(_0x3aebf7,_0x3b5fee,_0x36481b)[_0x40c577(0x19f)]((_0x330e0b,_0x3bfa57)=>O(_0x330e0b,_0x3b5fee+'['+_0x3bfa57+']'));}function A(_0x3fc875,_0x5b3b20){const _0x15fcdd=_0x36f18f;return D(_0x3fc875,_0x5b3b20,!0x0)['map']((_0x2bb7ed,_0x2f8825)=>{const _0x76afd4=_0x41d8;if(typeof _0x2bb7ed!=_0x76afd4(0x1ea))throw T(_0x5b3b20+'['+_0x2f8825+_0x76afd4(0x16c));return _0x2bb7ed;})[_0x15fcdd(0x188)](_0x15a0e4=>_0x15a0e4!=='');}function j(_0x4d1d0a,_0xcbd907){const _0x2cc513=_0x36f18f;if(typeof _0x4d1d0a!=_0x2cc513(0x1d7)||!Number[_0x2cc513(0x223)](_0x4d1d0a))throw T(_0xcbd907+_0x2cc513(0x1e4));return _0x4d1d0a;}function M(_0x3bf806,_0x568919){const _0x3cd1c0=_0x36f18f;if(typeof _0x3bf806!=_0x3cd1c0(0x216))throw T(_0x568919+_0x3cd1c0(0x218));return _0x3bf806;}function N(_0x47f1c4,_0x3cfd26,_0x3ff26e){const _0x25daf9=_0x36f18f;if(typeof _0x47f1c4=='string'&&_0x47f1c4!=='')return _0x47f1c4;let _0x3fe0a9=E(_0x47f1c4,_0x3cfd26),_0x16d299=_0x3ff26e===void 0x0?void 0x0:_0x3fe0a9[_0x3ff26e];if(typeof _0x16d299=='string'&&_0x16d299!=='')return _0x16d299;let _0x34bb5a=_0x3fe0a9['en-US'];if(typeof _0x34bb5a=='string'&&_0x34bb5a!=='')return _0x34bb5a;let _0x53dc11=Object['values'](_0x3fe0a9)[_0x25daf9(0x1ad)](_0x2ba21e=>typeof _0x2ba21e==_0x25daf9(0x1ea)&&_0x2ba21e!=='');if(_0x53dc11!==void 0x0)return _0x53dc11;throw T(_0x3cfd26+_0x25daf9(0x193));}function P(_0x412e7d,_0x47281b,_0x1386ee){const _0x1b5357=_0x36f18f;try{_0x1386ee===_0x1b5357(0x178)?x(_0x412e7d):S(_0x412e7d);}catch(_0x5d6709){throw T(_0x47281b+':\x20'+(_0x5d6709 instanceof Error?_0x5d6709['message']:String(_0x5d6709)));}}function F(_0x3c2b32,_0x12ec64,_0x254091){const _0x5a4964=_0x36f18f;let _0x752f9e=new Map();for(let [_0x364b3f,_0x201f79]of D(_0x3c2b32,_0x12ec64,!0x0)[_0x5a4964(0x1cd)]()){let _0x2ace26=E(_0x201f79,_0x12ec64+'['+_0x364b3f+']'),_0x10b2d6=O(_0x2ace26['id'],_0x12ec64+'['+_0x364b3f+'].id');if(P(_0x10b2d6,_0x12ec64+'['+_0x364b3f+_0x5a4964(0x1ee),_0x5a4964(0x1a4)),_0x752f9e[_0x5a4964(0x1c8)](_0x10b2d6))throw T(_0x5a4964(0x1a9)+_0x12ec64+_0x5a4964(0x1c3)+_0x10b2d6+'\x22.');_0x752f9e[_0x5a4964(0x186)](_0x10b2d6,N(_0x2ace26['label'],_0x12ec64+'['+_0x364b3f+'].label',_0x254091));}return _0x752f9e;}function I(_0xa22260,_0x48427e){const _0x3d1f54=_0x36f18f;let _0x1e3eca=E(_0xa22260['intrinsicSize'],_0x48427e+_0x3d1f54(0x220)),_0x46fb72=j(_0x1e3eca[_0x3d1f54(0x17d)],_0x48427e+_0x3d1f54(0x18f)),_0x472c44=j(_0x1e3eca[_0x3d1f54(0x1a6)],_0x48427e+'.intrinsicSize.height');if(_0x46fb72<=0x0||_0x472c44<=0x0)throw T(_0x48427e+_0x3d1f54(0x1d1));return{'width':_0x46fb72,'height':_0x472c44};}function L(_0x1768d0,_0x47193d){const _0x371580=_0x36f18f;if(_0x1768d0[_0x371580(0x1c7)]!=='image')throw T(_0x47193d+'.type\x20must\x20be\x20\x22image\x22.');if(_0x1768d0[_0x371580(0x172)]!=='reference')throw T(_0x47193d+'.storagePolicy\x20must\x20be\x20\x22reference\x22.');let _0x36693d=E(_0x1768d0[_0x371580(0x1e8)],_0x47193d+_0x371580(0x21c));if(_0x36693d[_0x371580(0x1c7)]!=='url')throw T(_0x47193d+_0x371580(0x228));let _0x9a9f07=O(_0x36693d[_0x371580(0x1b1)],_0x47193d+_0x371580(0x187)),_0x4c3b56;try{_0x4c3b56=new URL(_0x9a9f07);}catch{throw T(_0x47193d+_0x371580(0x185));}if(_0x4c3b56[_0x371580(0x19d)]!==_0x371580(0x20d))throw T(_0x47193d+_0x371580(0x1cf));return _0x9a9f07;}function R(_0x591e6c){const _0x34d54b=_0x36f18f;return _0x591e6c[_0x34d54b(0x1d4)](_0x34d54b(0x1cc))[_0x34d54b(0x1f3)]()['trim']()['replace'](/\s+/gu,'\x20');}function z(_0xca1229){const _0x4431b0=_0x36f18f;let _0x70309f=E(_0xca1229,_0x4431b0(0x1d6)),_0x296ba2=new Map(),_0x21e039=new Map(),_0x5baa3b=[],_0x4f4867=[],_0x20fba0=new Set(),_0xc6d78c=0x0;for(let [_0x25114e,_0x26b6f1]of D(_0x70309f[_0x4431b0(0x222)],_0x4431b0(0x1e5))[_0x4431b0(0x1cd)]()){let _0x4928e8=E(E(_0x26b6f1,'registrations['+_0x25114e+']')[_0x4431b0(0x1dd)],'registrations['+_0x25114e+'].input'),_0x4b0992=O(_0x4928e8['registryId'],_0x4431b0(0x1bf)+_0x25114e+_0x4431b0(0x1bd));if(P(_0x4b0992,_0x4431b0(0x1bf)+_0x25114e+_0x4431b0(0x1bd),'registry'),_0x296ba2[_0x4431b0(0x1c8)](_0x4b0992))throw T(_0x4431b0(0x195)+_0x4b0992+'\x22.');let _0x19ce9e=_0x4928e8[_0x4431b0(0x1a7)]===void 0x0?void 0x0:O(_0x4928e8[_0x4431b0(0x1a7)],'registrations['+_0x25114e+_0x4431b0(0x1aa)),_0x278ef5=F(_0x4928e8['groups'],_0x4431b0(0x1bf)+_0x25114e+'].input.groups',_0x19ce9e),_0x3a67da=F(_0x4928e8['tags'],_0x4431b0(0x1bf)+_0x25114e+_0x4431b0(0x191),_0x19ce9e),_0x20ae99=[];for(let [_0x238456,_0x2329a3]of D(_0x4928e8[_0x4431b0(0x1d0)],_0x4431b0(0x1bf)+_0x25114e+_0x4431b0(0x1b7))[_0x4431b0(0x1cd)]()){let _0x7513c2='registrations['+_0x25114e+_0x4431b0(0x1b4)+_0x238456+']',_0x2ba02b=E(_0x2329a3,_0x7513c2),_0x42bbde=O(_0x2ba02b['id'],_0x7513c2+_0x4431b0(0x20a));P(_0x42bbde,_0x7513c2+'.id',_0x4431b0(0x1a4));let _0x30af76=ee(_0x4b0992,_0x42bbde);if(_0x21e039[_0x4431b0(0x1c8)](_0x30af76))throw T(_0x4431b0(0x167)+_0x30af76+'\x22.');let _0x2bb0cb;try{_0x2bb0cb=w(_0x30af76);}catch(_0x39ad3b){throw T(_0x7513c2+':\x20'+(_0x39ad3b instanceof Error?_0x39ad3b[_0x4431b0(0x1ef)]:String(_0x39ad3b)));}if(_0x20fba0[_0x4431b0(0x1c8)](_0x2bb0cb))throw T(_0x4431b0(0x1c0)+_0x2bb0cb+'\x22.');_0x20fba0['add'](_0x2bb0cb);let _0x3bdf2c=_0x2ba02b[_0x4431b0(0x1fb)]===void 0x0?void 0x0:O(_0x2ba02b['groupId'],_0x7513c2+_0x4431b0(0x221));if(_0x3bdf2c!==void 0x0&&!_0x278ef5[_0x4431b0(0x1c8)](_0x3bdf2c))throw T(_0x7513c2+_0x4431b0(0x18c)+_0x3bdf2c+'\x22.');let _0x18f306=k(_0x2ba02b['tagIds'],_0x7513c2+'.tagIds',!0x0);for(let _0x5ef4f4 of _0x18f306)if(!_0x3a67da[_0x4431b0(0x1c8)](_0x5ef4f4))throw T(_0x7513c2+_0x4431b0(0x16b)+_0x5ef4f4+'\x22.');let _0x951fb7=A(_0x2ba02b[_0x4431b0(0x1dc)],_0x7513c2+_0x4431b0(0x1c4)),_0x4b47d4=N(_0x2ba02b[_0x4431b0(0x18a)],_0x7513c2+_0x4431b0(0x1be),_0x19ce9e),_0x59274f=_0x2ba02b[_0x4431b0(0x196)]===void 0x0?void 0x0:N(_0x2ba02b[_0x4431b0(0x196)],_0x7513c2+_0x4431b0(0x1f2),_0x19ce9e),_0x490a75=_0x3bdf2c===void 0x0?null:{'id':_0x3bdf2c,'label':_0x278ef5[_0x4431b0(0x198)](_0x3bdf2c)},_0x46ab7d=_0x18f306[_0x4431b0(0x19f)](_0x3979d9=>({'id':_0x3979d9,'label':_0x3a67da[_0x4431b0(0x198)](_0x3979d9)})),_0x2ef5f1=E(_0x2ba02b[_0x4431b0(0x19c)],_0x7513c2+_0x4431b0(0x199)),_0x2d51a4=_0x2ba02b[_0x4431b0(0x209)]===void 0x0?null:j(_0x2ba02b['order'],_0x7513c2+'.order'),_0x203826=M(_0x2ef5f1['colorEditable'],_0x7513c2+_0x4431b0(0x163)),_0x3e851d={'handle':_0x30af76,'registryId':_0x4b0992,'id':_0x42bbde,'name':_0x4b47d4,..._0x59274f===void 0x0?{}:{'description':_0x59274f},'group':_0x490a75,'tags':_0x46ab7d,'keywords':_0x951fb7,'order':_0x2d51a4,'intrinsicSize':I(_0x2ef5f1,_0x7513c2+_0x4431b0(0x199)),'colorEditable':_0x203826,'sourceUrl':L(_0x2ef5f1,_0x7513c2+_0x4431b0(0x199)),'registrationIndex':_0x25114e,'resourceIndex':_0x238456,'globalIndex':_0xc6d78c,'searchText':R([_0x4b47d4,_0x59274f,_0x490a75?.[_0x4431b0(0x227)],..._0x46ab7d[_0x4431b0(0x19f)](_0x2e081d=>_0x2e081d['label']),..._0x951fb7][_0x4431b0(0x188)](_0x4afdba=>_0x4afdba!==void 0x0)[_0x4431b0(0x1b3)]('\x20'))};_0xc6d78c++,_0x20ae99[_0x4431b0(0x1d2)](_0x3e851d),_0x4f4867[_0x4431b0(0x1d2)](_0x3e851d),_0x21e039[_0x4431b0(0x186)](_0x30af76,_0x3e851d);}let _0x4faf81={'id':_0x4b0992,'groups':_0x278ef5,'tags':_0x3a67da,'resources':_0x20ae99};_0x5baa3b[_0x4431b0(0x1d2)](_0x4faf81),_0x296ba2[_0x4431b0(0x186)](_0x4b0992,_0x4faf81);}if(_0x5baa3b[_0x4431b0(0x1ce)]===0x0)throw T(_0x4431b0(0x183));return{'registries':_0x5baa3b,'registryById':_0x296ba2,'resourceByHandle':_0x21e039,'resources':_0x4f4867};}function B(_0x2a4e05,_0xb55f8c){const _0x1637fc=_0x36f18f;C(_0xb55f8c);let _0x1c77ce=_0x2a4e05['resourceByHandle']['get'](_0xb55f8c);if(_0x1c77ce===void 0x0)throw new h(_0x1637fc(0x1a8),_0x1637fc(0x1c9)+_0xb55f8c+_0x1637fc(0x1eb),_0xb55f8c);return _0x1c77ce;}function te(_0x2a2afd){const _0x1cc255=_0x36f18f;return _0x2a2afd[_0x1cc255(0x1e9)][_0x1cc255(0x19f)](_0x46cf07=>({'id':_0x46cf07['id'],'resourceCount':_0x46cf07[_0x1cc255(0x1d0)]['length'],'groupCount':_0x46cf07['groups']['size'],'tagCount':_0x46cf07['tags'][_0x1cc255(0x164)],'colorEditableCount':_0x46cf07[_0x1cc255(0x1d0)][_0x1cc255(0x188)](_0x377f45=>_0x377f45[_0x1cc255(0x1bc)])['length']}));}function ne(_0x27804c){const _0x11804d=_0x36f18f;return{'handle':_0x27804c[_0x11804d(0x217)],'registryId':_0x27804c['registryId'],'id':_0x27804c['id'],'name':_0x27804c[_0x11804d(0x18a)],'group':_0x27804c['group'],'tags':_0x27804c['tags'],'keywords':_0x27804c[_0x11804d(0x1dc)],'order':_0x27804c['order'],'intrinsicSize':_0x27804c['intrinsicSize'],'colorEditable':_0x27804c[_0x11804d(0x1bc)]};}function re(_0x83345d,_0x3dc1bb){const _0x54e606=_0x36f18f;let _0x5d5b70=(_0x83345d[_0x54e606(0x209)]??_0x83345d['globalIndex'])-(_0x3dc1bb[_0x54e606(0x209)]??_0x3dc1bb[_0x54e606(0x177)]);if(_0x5d5b70!==0x0)return _0x5d5b70;let _0x5aedff=_0x83345d[_0x54e606(0x1ff)]-_0x3dc1bb[_0x54e606(0x1ff)];if(_0x5aedff!==0x0)return _0x5aedff;let _0x2a316d=_0x83345d[_0x54e606(0x1da)]-_0x3dc1bb[_0x54e606(0x1da)];return _0x2a316d===0x0?_0x83345d[_0x54e606(0x217)][_0x54e606(0x1e1)](_0x3dc1bb['handle']):_0x2a316d;}function ie(_0x579b1a,_0x40a63b){const _0x319477=_0x36f18f;let _0xfa9b46=_0x40a63b[_0x319477(0x1ac)][_0x319477(0x19f)](R)[_0x319477(0x188)](_0x4c0e93=>_0x4c0e93!=='');if(_0xfa9b46[_0x319477(0x1ce)]===0x0)throw new h('resource-query-empty',_0x319477(0x226));let _0x2330b8=new Set(_0x40a63b[_0x319477(0x1e9)]??[]);for(let _0x10cc2a of _0x2330b8)if(!_0x579b1a[_0x319477(0x16d)][_0x319477(0x1c8)](_0x10cc2a))throw new h(_0x319477(0x189),'Unknown\x20resource\x20registry\x20\x22'+_0x10cc2a+'\x22.');let _0x59159b=_0x40a63b['limit']??_0x579b1a[_0x319477(0x1d0)][_0x319477(0x1ce)];if(!Number[_0x319477(0x17e)](_0x59159b)||_0x59159b<0x1)throw new h('resource-limit-invalid','Resource\x20search\x20limit\x20must\x20be\x20a\x20positive\x20integer;\x20received\x20\x22'+_0x59159b+'\x22.');let _0x480b3e=_0x579b1a[_0x319477(0x1d0)][_0x319477(0x188)](_0x3d218=>_0x2330b8['size']===0x0||_0x2330b8[_0x319477(0x1c8)](_0x3d218[_0x319477(0x1f5)]))['filter'](_0x1e463b=>_0xfa9b46[_0x319477(0x1e2)](_0x46a47d=>_0x1e463b[_0x319477(0x1f4)][_0x319477(0x213)](_0x46a47d)))[_0x319477(0x1db)](re);return{'resources':_0x480b3e[_0x319477(0x1a5)](0x0,_0x59159b)[_0x319477(0x19f)](ne),'total':_0x480b3e[_0x319477(0x1ce)]};}function V(_0x4cb385){const _0x382ea1=_0x36f18f;return/^\s*(?:<\?xml[^>]*>\s*)?(?:<!--[^]*?-->\s*)*<svg(?:\s|>)/iu[_0x382ea1(0x1e7)](_0x4cb385);}function H(_0x5975bf,_0x52b214){const _0x5dc24c=_0x36f18f;return g(_0x52b214)?{'handle':_0x5975bf,'code':_0x52b214['code'],'message':_0x52b214[_0x5dc24c(0x1ef)]}:{'handle':_0x5975bf,'code':'resource-export-failed','message':_0x52b214 instanceof Error?_0x52b214[_0x5dc24c(0x1ef)]:String(_0x52b214)};}var U=class{[_0x36f18f(0x175)];[_0x36f18f(0x1c5)];constructor(_0x5ce4d6){const _0x3dba2e=_0x36f18f;this[_0x3dba2e(0x175)]=_0x5ce4d6,this['catalog']=z(_0x5ce4d6[_0x3dba2e(0x1d6)]);}get['cacheLocation'](){const _0x5da755=_0x36f18f;return this[_0x5da755(0x175)][_0x5da755(0x162)][_0x5da755(0x169)];}[_0x36f18f(0x1ed)](){const _0x465e00=_0x36f18f;return te(this[_0x465e00(0x1c5)]);}[_0x36f18f(0x1ad)](_0x19989c){const _0x3f94dc=_0x36f18f;return ie(this[_0x3f94dc(0x1c5)],_0x19989c);}async['read'](_0x3c39bf){const _0x3cb25c=_0x36f18f;let _0x36cd1e=B(this[_0x3cb25c(0x1c5)],_0x3c39bf['handle']),_0x40ca64=await this[_0x3cb25c(0x175)][_0x3cb25c(0x162)][_0x3cb25c(0x1e6)](_0x3c39bf[_0x3cb25c(0x217)]);if(_0x40ca64!==void 0x0&&V(_0x40ca64))return{'handle':_0x3c39bf['handle'],'svg':_0x40ca64};let _0x3cbfa5;try{_0x3cbfa5=await this[_0x3cb25c(0x175)][_0x3cb25c(0x18d)]['download'](_0x36cd1e['sourceUrl']);}catch(_0x600a82){throw g(_0x600a82)?_0x600a82:new h(_0x3cb25c(0x171),_0x3cb25c(0x1f6)+_0x3c39bf['handle']+'\x22:\x20'+(_0x600a82 instanceof Error?_0x600a82[_0x3cb25c(0x1ef)]:String(_0x600a82)),_0x3c39bf['handle'],{'cause':_0x600a82});}if(!V(_0x3cbfa5))throw new h(_0x3cb25c(0x1de),'Downloaded\x20resource\x20\x22'+_0x3c39bf[_0x3cb25c(0x217)]+_0x3cb25c(0x1fd),_0x3c39bf[_0x3cb25c(0x217)]);return await this['options'][_0x3cb25c(0x162)][_0x3cb25c(0x225)](_0x3c39bf[_0x3cb25c(0x217)],_0x3cbfa5),{'handle':_0x3c39bf[_0x3cb25c(0x217)],'svg':_0x3cbfa5};}async[_0x36f18f(0x211)](_0xaa133a){const _0x44a456=_0x36f18f;let _0x927834=[],_0x428a99=[];for(let _0x2649d5 of _0xaa133a['handles'])try{let {svg:_0x5b931b}=await this[_0x44a456(0x1e6)]({'handle':_0x2649d5}),_0xf602d8=await this[_0x44a456(0x175)][_0x44a456(0x1c1)][_0x44a456(0x225)](_0xaa133a[_0x44a456(0x21e)],w(_0x2649d5),_0x5b931b);_0x927834['push']({'handle':_0x2649d5,'path':_0xf602d8});}catch(_0x5f2d1f){_0x428a99['push'](H(_0x2649d5,_0x5f2d1f));}return{'exported':_0x927834,'failed':_0x428a99};}async['clearCache'](){const _0x5abe78=_0x36f18f;return await this['options'][_0x5abe78(0x162)][_0x5abe78(0x1d5)]();}};function W(_0x5ccae1){return new U(_0x5ccae1);}function G(_0x571a4e){return _0x571a4e instanceof Error&&'code'in _0x571a4e;}function K(_0x1861a3){const _0x40c7a1=_0x36f18f;let _0x1048d6=_0x1b334b(_0x1861a3);if(!_0x89782b(_0x1861a3)||_0x1048d6===_0x16efce(_0x1048d6)[_0x40c7a1(0x1f9)])throw new h(_0x40c7a1(0x179),_0x40c7a1(0x19b)+_0x1861a3+'\x22.');return _0x1048d6;}async function q(_0x98ee93){const _0x316117=_0x36f18f;let _0x24f4a0;try{_0x24f4a0=await _0x55d9f4(_0x98ee93,{'withFileTypes':!0x0});}catch(_0x41356b){if(G(_0x41356b)&&_0x41356b[_0x316117(0x21f)]===_0x316117(0x1b0))return{'resourceCount':0x0,'byteCount':0x0};throw _0x41356b;}let _0x216aa9=0x0,_0x516abc=0x0;for(let _0x52f85b of _0x24f4a0){let _0x74b5b0=_0x1d1f2a(_0x98ee93,_0x52f85b[_0x316117(0x18a)]);if(_0x52f85b['isDirectory']()){let _0x2325bb=await q(_0x74b5b0);_0x216aa9+=_0x2325bb['resourceCount'],_0x516abc+=_0x2325bb[_0x316117(0x1ab)];}else{if(_0x52f85b['isFile']()&&_0x52f85b[_0x316117(0x18a)][_0x316117(0x215)](_0x316117(0x201))){let _0x403423=await _0x3baf01(_0x74b5b0);_0x216aa9++,_0x516abc+=_0x403423[_0x316117(0x164)];}}}return{'resourceCount':_0x216aa9,'byteCount':_0x516abc};}var J=class{[_0x36f18f(0x169)];constructor(_0x421be4){const _0x3cdb84=_0x36f18f;this[_0x3cdb84(0x169)]=K(_0x421be4);}[_0x36f18f(0x1ba)](_0x8e7fd0){const _0x1c7b4d=_0x36f18f;let {registryId:_0x2fba69,resourceId:_0x23a7c2}=C(_0x8e7fd0);return _0x1d1f2a(this[_0x1c7b4d(0x169)],_0x2fba69,_0x23a7c2+_0x1c7b4d(0x201));}async[_0x36f18f(0x1e6)](_0x3223eb){const _0x1ec978=_0x36f18f;try{return await _0x500d43(this[_0x1ec978(0x1ba)](_0x3223eb),_0x1ec978(0x1b2));}catch(_0x5b20ca){if(G(_0x5b20ca)&&_0x5b20ca[_0x1ec978(0x21f)]===_0x1ec978(0x1b0))return;throw _0x5b20ca;}}async[_0x36f18f(0x225)](_0x11f8a1,_0x5c9899){const _0x16f48c=_0x36f18f;let _0x199bdb=this['path'](_0x11f8a1);await _0x2d6fe0(_0x7834fb(_0x199bdb),{'recursive':!0x0});let _0x120c4a=_0x1d1f2a(_0x7834fb(_0x199bdb),_0x16f48c(0x1c2)+process[_0x16f48c(0x166)]+'-'+_0x48d2ba()+_0x16f48c(0x202));try{await _0x5100ca(_0x120c4a,_0x5c9899,{'encoding':_0x16f48c(0x1b2),'mode':0x180}),await _0x61a7d4(_0x120c4a,_0x199bdb);}catch(_0x4052c1){throw await _0x107d1e(_0x120c4a)[_0x16f48c(0x1ec)](()=>void 0x0),_0x4052c1;}}async['clear'](){const _0x2b8a9c=_0x36f18f;let _0x3e1aff=await q(this[_0x2b8a9c(0x169)]);return await _0x2f55c9(this[_0x2b8a9c(0x169)],{'force':!0x0,'recursive':!0x0}),{'path':this['location'],..._0x3e1aff};}},Y=class{async[_0x36f18f(0x225)](_0x4931ed,_0x22b3ad,_0x267656){const _0x32e17a=_0x36f18f;await _0x2d6fe0(_0x4931ed,{'recursive':!0x0});let _0x193205=_0x1d1f2a(_0x4931ed,_0x22b3ad);return await _0x5100ca(_0x193205,_0x267656,_0x32e17a(0x1b2)),_0x193205;}},X=0x7530,ae=0xa00000,oe=0xa,se=new Set([0x12d,0x12e,0x12f,0x133,0x134]);function Z(_0x463497){const _0x56cc00=_0x36f18f;return new h(_0x56cc00(0x1fa),_0x56cc00(0x168)+_0x463497+_0x56cc00(0x192));}async function ce(_0x4435a1,_0x5efe9b){const _0x1c8533=_0x36f18f;let _0x29ee66=Number(_0x4435a1[_0x1c8533(0x18b)][_0x1c8533(0x198)](_0x1c8533(0x212)));if(Number['isFinite'](_0x29ee66)&&_0x29ee66>_0x5efe9b)throw Z(_0x5efe9b);if(_0x4435a1['body']===null){let _0x23861e=await _0x4435a1['text']();if(Buffer[_0x1c8533(0x16f)](_0x23861e)>_0x5efe9b)throw Z(_0x5efe9b);return _0x23861e;}let _0x275326=_0x4435a1[_0x1c8533(0x184)][_0x1c8533(0x165)](),_0x198467=[],_0x51e7b2=0x0;try{for(;;){let _0x2c746b=await _0x275326['read']();if(_0x2c746b[_0x1c8533(0x1f8)])break;if(_0x51e7b2+=_0x2c746b[_0x1c8533(0x1b1)][_0x1c8533(0x16f)],_0x51e7b2>_0x5efe9b)throw await _0x275326[_0x1c8533(0x17c)]()[_0x1c8533(0x1ec)](()=>void 0x0),Z(_0x5efe9b);_0x198467[_0x1c8533(0x1d2)](_0x2c746b[_0x1c8533(0x1b1)]);}}finally{_0x275326['releaseLock']();}try{return new TextDecoder(_0x1c8533(0x1cb),{'fatal':!0x0})[_0x1c8533(0x205)](Buffer['concat'](_0x198467,_0x51e7b2));}catch{throw new h(_0x1c8533(0x20e),_0x1c8533(0x208));}}var Q=class{[_0x36f18f(0x18e)];['timeoutMs'];[_0x36f18f(0x17a)];['maxRedirects'];constructor(_0x4aceda={}){const _0x3e705e=_0x36f18f;this['fetchImpl']=_0x4aceda[_0x3e705e(0x1e0)]??fetch,this[_0x3e705e(0x1a1)]=_0x4aceda[_0x3e705e(0x1a1)]??X,this[_0x3e705e(0x17a)]=_0x4aceda[_0x3e705e(0x17a)]??ae,this[_0x3e705e(0x21a)]=_0x4aceda[_0x3e705e(0x21a)]??oe;}async[_0x36f18f(0x181)](_0xe027c2){const _0x21cf7a=_0x36f18f;let _0x3c83bf=new URL(_0xe027c2);if(_0x3c83bf[_0x21cf7a(0x19d)]!==_0x21cf7a(0x20d))throw new h('resource-download-insecure',_0x21cf7a(0x219));let _0x3fa88b=new AbortController(),_0x54c566=setTimeout(()=>_0x3fa88b[_0x21cf7a(0x1fe)](),this[_0x21cf7a(0x1a1)]);try{let _0x3f62a4=_0x3c83bf;for(let _0x3333f4=0x0;;_0x3333f4++){let _0x3fe1d4=await this['fetchImpl'](_0x3f62a4,{'redirect':_0x21cf7a(0x214),'signal':_0x3fa88b[_0x21cf7a(0x170)]});if(se[_0x21cf7a(0x1c8)](_0x3fe1d4[_0x21cf7a(0x16e)])){if(_0x3333f4>=this['maxRedirects'])throw new h(_0x21cf7a(0x1b9),_0x21cf7a(0x17b)+this[_0x21cf7a(0x21a)]+'.');let _0x368801=_0x3fe1d4[_0x21cf7a(0x18b)][_0x21cf7a(0x198)](_0x21cf7a(0x169));if(_0x368801===null)throw new h(_0x21cf7a(0x20b),_0x21cf7a(0x1df)+_0x3fe1d4[_0x21cf7a(0x16e)]+_0x21cf7a(0x1a3));let _0x12a789;try{_0x12a789=new URL(_0x368801,_0x3f62a4);}catch{throw new h('resource-download-invalid-redirect',_0x21cf7a(0x19a));}if(_0x12a789[_0x21cf7a(0x19d)]!==_0x21cf7a(0x20d))throw new h('resource-download-insecure-redirect',_0x21cf7a(0x1b5));_0x3f62a4=_0x12a789;continue;}if(!_0x3fe1d4['ok'])throw new h(_0x21cf7a(0x21b),_0x21cf7a(0x1df)+_0x3fe1d4['status']+'.');if(_0x3fe1d4['url']!==''&&new URL(_0x3fe1d4[_0x21cf7a(0x210)])[_0x21cf7a(0x19d)]!==_0x21cf7a(0x20d))throw new h(_0x21cf7a(0x190),_0x21cf7a(0x1b5));let _0x4337e6=await ce(_0x3fe1d4,this['maxBytes']);if(!V(_0x4337e6))throw new h(_0x21cf7a(0x224),_0x21cf7a(0x1c6));return _0x4337e6;}}catch(_0x51250c){throw _0x3fa88b[_0x21cf7a(0x170)][_0x21cf7a(0x1e3)]?new h(_0x21cf7a(0x1b8),_0x21cf7a(0x203)+this['timeoutMs']+_0x21cf7a(0x20c)):_0x51250c;}finally{clearTimeout(_0x54c566);}}};function $(_0x2c545b){const _0x41ec4f=_0x36f18f;try{return JSON['parse'](_0x44365f(_0x2c545b,'utf8'));}catch(_0x1c6102){throw new h(_0x41ec4f(0x1d8),'Cannot\x20read\x20resource\x20manifest\x20at\x20'+_0x2c545b+':\x20'+(_0x1c6102 instanceof Error?_0x1c6102[_0x41ec4f(0x1ef)]:String(_0x1c6102)),void 0x0,{'cause':_0x1c6102});}}function le(_0x2a935f){const _0x20a913=_0x36f18f;let _0x131375;return()=>(_0x131375??=W({'manifest':$(_0x2a935f[_0x20a913(0x1af)]),'cache':new J(_0x2a935f['cacheRoot']),'downloader':new Q(_0x2a935f[_0x20a913(0x18d)]),'output':new Y()}),_0x131375);}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};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@univer-cli/resource-library",
3
3
  "type": "module",
4
- "version": "1.0.3",
4
+ "version": "1.0.4",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
7
7
  "types": "./dist/index.d.ts",