@eluvio/elv-client-js 4.0.51 → 4.0.53
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/ElvClient-min.js +10 -11
- package/dist/ElvClient-node-min.js +10 -10
- package/dist/ElvFrameClient-min.js +4 -4
- package/dist/ElvPermissionsClient-min.js +1 -1
- package/dist/ElvWalletClient-min.js +9 -10
- package/dist/ElvWalletClient-node-min.js +10 -10
- package/dist/src/ElvClient.js +306 -441
- package/dist/src/FrameClient.js +2 -2
- package/dist/src/HttpClient.js +1 -10
- package/dist/src/UserProfileClient.js +88 -206
- package/dist/src/Utils.js +0 -10
- package/dist/src/Validation.js +1 -1
- package/dist/src/client/ContentAccess.js +405 -574
- package/package.json +1 -1
- package/src/Utils.js +18 -0
- package/src/client/ContentAccess.js +25 -0
- package/dist/src/client/LiveConf.js +0 -330
- package/dist/src/client/LiveStream.js +0 -1785
|
@@ -41,7 +41,7 @@ var n=r(47),o=r(48),i=r(49);function a(){return s.TYPED_ARRAY_SUPPORT?2147483647
|
|
|
41
41
|
* @copyright Chen, Yi-Cyuan 2015-2018
|
|
42
42
|
* @license MIT
|
|
43
43
|
*/!function(){"use strict";var u="input is invalid type",s="object"===("undefined"==typeof window?"undefined":a(window)),c=s?window:{};c.JS_SHA3_NO_WINDOW&&(s=!1);var l=!s&&"object"===("undefined"==typeof self?"undefined":a(self));!c.JS_SHA3_NO_NODE_JS&&"object"===(void 0===t?"undefined":a(t))&&t.versions&&t.versions.node?c=n:l&&(c=self);var f=!c.JS_SHA3_NO_COMMON_JS&&"object"===a(o)&&o.exports,h=r(19),p=!c.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,d="0123456789abcdef".split(""),v=[4,1024,262144,67108864],m=[0,8,16,24],y=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],g=[224,256,384,512],b=[128,256],w=["hex","buffer","arrayBuffer","array","digest"],_={128:168,256:136};!c.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!p||!c.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"===a(t)&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var k=function(t,e,r){return function(n){return new B(t,e,t).update(n)[r]()}},E=function(t,e,r){return function(n,o){return new B(t,e,o).update(n)[r]()}},x=function(t,e,r){return function(e,n,o,i){return j["cshake"+t].update(e,n,o,i)[r]()}},A=function(t,e,r){return function(e,n,o,i){return j["kmac"+t].update(e,n,o,i)[r]()}},O=function(t,e,r,n){for(var o=0;o<w.length;++o){var i=w[o];t[i]=e(r,n,i)}return t},S=function(t,e){var r=k(t,e,"hex");return r.create=function(){return new B(t,e,t)},r.update=function(t){return r.create().update(t)},O(r,k,t,e)},P=[{name:"keccak",padding:[1,256,65536,16777216],bits:g,createMethod:S},{name:"sha3",padding:[6,1536,393216,100663296],bits:g,createMethod:S},{name:"shake",padding:[31,7936,2031616,520093696],bits:b,createMethod:function(t,e){var r=E(t,e,"hex");return r.create=function(r){return new B(t,e,r)},r.update=function(t,e){return r.create(e).update(t)},O(r,E,t,e)}},{name:"cshake",padding:v,bits:b,createMethod:function(t,e){var r=_[t],n=x(t,0,"hex");return n.create=function(n,o,i){return o||i?new B(t,e,n).bytepad([o,i],r):j["shake"+t].create(n)},n.update=function(t,e,r,o){return n.create(e,r,o).update(t)},O(n,x,t,e)}},{name:"kmac",padding:v,bits:b,createMethod:function(t,e){var r=_[t],n=A(t,0,"hex");return n.create=function(n,o,i){return new F(t,e,o).bytepad(["KMAC",i],r).bytepad([n],r)},n.update=function(t,e,r,o){return n.create(t,r,o).update(e)},O(n,A,t,e)}}],j={},T=[],R=0;R<P.length;++R)for(var N=P[R],I=N.bits,L=0;L<I.length;++L){var C=N.name+"_"+I[L];if(T.push(C),j[C]=N.createMethod(I[L],N.padding),"sha3"!==N.name){var M=N.name+I[L];T.push(M),j[M]=j[C]}}function B(t,e,r){this.blocks=[],this.s=[],this.padding=e,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(t<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function F(t,e,r){B.call(this,t,e,r)}B.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var e,r=a(t);if("string"!==r){if("object"!==r)throw new Error(u);if(null===t)throw new Error(u);if(p&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||p&&ArrayBuffer.isView(t)))throw new Error(u);e=!0}for(var n,o,i=this.blocks,s=this.byteCount,c=t.length,l=this.blockCount,f=0,h=this.s;f<c;){if(this.reset)for(this.reset=!1,i[0]=this.block,n=1;n<l+1;++n)i[n]=0;if(e)for(n=this.start;f<c&&n<s;++f)i[n>>2]|=t[f]<<m[3&n++];else for(n=this.start;f<c&&n<s;++f)(o=t.charCodeAt(f))<128?i[n>>2]|=o<<m[3&n++]:o<2048?(i[n>>2]|=(192|o>>6)<<m[3&n++],i[n>>2]|=(128|63&o)<<m[3&n++]):o<55296||o>=57344?(i[n>>2]|=(224|o>>12)<<m[3&n++],i[n>>2]|=(128|o>>6&63)<<m[3&n++],i[n>>2]|=(128|63&o)<<m[3&n++]):(o=65536+((1023&o)<<10|1023&t.charCodeAt(++f)),i[n>>2]|=(240|o>>18)<<m[3&n++],i[n>>2]|=(128|o>>12&63)<<m[3&n++],i[n>>2]|=(128|o>>6&63)<<m[3&n++],i[n>>2]|=(128|63&o)<<m[3&n++]);if(this.lastByteIndex=n,n>=s){for(this.start=n-s,this.block=i[l],n=0;n<l;++n)h[n]^=i[n];D(h),this.reset=!0}else this.start=n}return this},B.prototype.encode=function(t,e){var r=255&t,n=1,o=[r];for(r=255&(t>>=8);r>0;)o.unshift(r),r=255&(t>>=8),++n;return e?o.push(n):o.unshift(n),this.update(o),o.length},B.prototype.encodeString=function(t){var e,r=a(t);if("string"!==r){if("object"!==r)throw new Error(u);if(null===t)throw new Error(u);if(p&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||p&&ArrayBuffer.isView(t)))throw new Error(u);e=!0}var n=0,o=t.length;if(e)n=o;else for(var i=0;i<t.length;++i){var s=t.charCodeAt(i);s<128?n+=1:s<2048?n+=2:s<55296||s>=57344?n+=3:(s=65536+((1023&s)<<10|1023&t.charCodeAt(++i)),n+=4)}return n+=this.encode(8*n),this.update(t),n},B.prototype.bytepad=function(t,e){for(var r=this.encode(e),n=0;n<t.length;++n)r+=this.encodeString(t[n]);var o=e-r%e,i=[];return i.length=o,this.update(i),this},B.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex,r=this.blockCount,n=this.s;if(t[e>>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e<r+1;++e)t[e]=0;for(t[r-1]|=2147483648,e=0;e<r;++e)n[e]^=t[e];D(n)}},B.prototype.toString=B.prototype.hex=function(){this.finalize();for(var t,e=this.blockCount,r=this.s,n=this.outputBlocks,o=this.extraBytes,i=0,a=0,u="";a<n;){for(i=0;i<e&&a<n;++i,++a)t=r[i],u+=d[t>>4&15]+d[15&t]+d[t>>12&15]+d[t>>8&15]+d[t>>20&15]+d[t>>16&15]+d[t>>28&15]+d[t>>24&15];a%e==0&&(D(r),i=0)}return o&&(t=r[i],u+=d[t>>4&15]+d[15&t],o>1&&(u+=d[t>>12&15]+d[t>>8&15]),o>2&&(u+=d[t>>20&15]+d[t>>16&15])),u},B.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,o=this.extraBytes,i=0,a=0,u=this.outputBits>>3;t=o?new ArrayBuffer(n+1<<2):new ArrayBuffer(u);for(var s=new Uint32Array(t);a<n;){for(i=0;i<e&&a<n;++i,++a)s[a]=r[i];a%e==0&&D(r)}return o&&(s[i]=r[i],t=t.slice(0,u)),t},B.prototype.buffer=B.prototype.arrayBuffer,B.prototype.digest=B.prototype.array=function(){this.finalize();for(var t,e,r=this.blockCount,n=this.s,o=this.outputBlocks,i=this.extraBytes,a=0,u=0,s=[];u<o;){for(a=0;a<r&&u<o;++a,++u)t=u<<2,e=n[a],s[t]=255&e,s[t+1]=e>>8&255,s[t+2]=e>>16&255,s[t+3]=e>>24&255;u%r==0&&D(n)}return i&&(t=u<<2,e=n[a],s[t]=255&e,i>1&&(s[t+1]=e>>8&255),i>2&&(s[t+2]=e>>16&255)),s},F.prototype=new B,F.prototype.finalize=function(){return this.encode(this.outputBits,!0),B.prototype.finalize.call(this)};var D=function(t){var e,r,n,o,i,a,u,s,c,l,f,h,p,d,v,m,g,b,w,_,k,E,x,A,O,S,P,j,T,R,N,I,L,C,M,B,F,D,U,z,G,q,H,K,W,Q,V,J,Y,Z,X,$,tt,et,rt,nt,ot,it,at,ut,st,ct,lt;for(n=0;n<48;n+=2)o=t[0]^t[10]^t[20]^t[30]^t[40],i=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],s=t[4]^t[14]^t[24]^t[34]^t[44],c=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],f=t[7]^t[17]^t[27]^t[37]^t[47],e=(h=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=o^(s<<1|c>>>31),r=i^(c<<1|s>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(l<<1|f>>>31),r=u^(f<<1|l>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=s^(h<<1|p>>>31),r=c^(p<<1|h>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=l^(o<<1|i>>>31),r=f^(i<<1|o>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,d=t[0],v=t[1],Q=t[11]<<4|t[10]>>>28,V=t[10]<<4|t[11]>>>28,j=t[20]<<3|t[21]>>>29,T=t[21]<<3|t[20]>>>29,ut=t[31]<<9|t[30]>>>23,st=t[30]<<9|t[31]>>>23,q=t[40]<<18|t[41]>>>14,H=t[41]<<18|t[40]>>>14,C=t[2]<<1|t[3]>>>31,M=t[3]<<1|t[2]>>>31,m=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,Y=t[23]<<10|t[22]>>>22,R=t[33]<<13|t[32]>>>19,N=t[32]<<13|t[33]>>>19,ct=t[42]<<2|t[43]>>>30,lt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,B=t[14]<<6|t[15]>>>26,F=t[15]<<6|t[14]>>>26,b=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,Z=t[34]<<15|t[35]>>>17,X=t[35]<<15|t[34]>>>17,I=t[45]<<29|t[44]>>>3,L=t[44]<<29|t[45]>>>3,A=t[6]<<28|t[7]>>>4,O=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,ot=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,U=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,k=t[37]<<21|t[36]>>>11,$=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,K=t[8]<<27|t[9]>>>5,W=t[9]<<27|t[8]>>>5,S=t[18]<<20|t[19]>>>12,P=t[19]<<20|t[18]>>>12,it=t[29]<<7|t[28]>>>25,at=t[28]<<7|t[29]>>>25,z=t[38]<<8|t[39]>>>24,G=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,x=t[49]<<14|t[48]>>>18,t[0]=d^~m&b,t[1]=v^~g&w,t[10]=A^~S&j,t[11]=O^~P&T,t[20]=C^~B&D,t[21]=M^~F&U,t[30]=K^~Q&J,t[31]=W^~V&Y,t[40]=et^~nt&it,t[41]=rt^~ot&at,t[2]=m^~b&_,t[3]=g^~w&k,t[12]=S^~j&R,t[13]=P^~T&N,t[22]=B^~D&z,t[23]=F^~U&G,t[32]=Q^~J&Z,t[33]=V^~Y&X,t[42]=nt^~it&ut,t[43]=ot^~at&st,t[4]=b^~_&E,t[5]=w^~k&x,t[14]=j^~R&I,t[15]=T^~N&L,t[24]=D^~z&q,t[25]=U^~G&H,t[34]=J^~Z&$,t[35]=Y^~X&tt,t[44]=it^~ut&ct,t[45]=at^~st<,t[6]=_^~E&d,t[7]=k^~x&v,t[16]=R^~I&A,t[17]=N^~L&O,t[26]=z^~q&C,t[27]=G^~H&M,t[36]=Z^~$&K,t[37]=X^~tt&W,t[46]=ut^~ct&et,t[47]=st^~lt&rt,t[8]=E^~d&m,t[9]=x^~v&g,t[18]=I^~A&S,t[19]=L^~O&P,t[28]=q^~C&B,t[29]=H^~M&F,t[38]=$^~K&Q,t[39]=tt^~W&V,t[48]=ct^~et&nt,t[49]=lt^~rt&ot,t[0]^=y[n],t[1]^=y[n+1]};if(f)o.exports=j;else{for(R=0;R<T.length;++R)c[T[R]]=j[T[R]];h&&(void 0===(i=function(){return j}.call(e,r,e,o))||(o.exports=i))}}()}).call(this,r(18),r(8),r(9)(t))},function(t,e,r){"use strict";r.d(e,"a",(function(){return n}));var n="random/5.7.0"},function(t,e,r){var n=r(22),o=r(23),i=r(24),a=r(42),u=r(43);function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function c(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?s(Object(r),!0).forEach((function(e){i(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var l=r(44),f=r(45),h=f.ValidatePresence,p=f.ValidatePermission,d=function(){"use strict";function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{offline:!1};a(this,t),this.client=e,this.subjectNames={},this.drafts={},this.offline=r.offline}var e,r,i,s,f,d,v,m,y,g,b,w,_,k,E;return u(t,[{key:"FormatDate",value:function(t){if(t){if(isNaN(new Date(t)))throw Error("Invalid start time: ".concat(t));return new Date(t).toISOString()}}},{key:"FormatProfile",value:function(t){var e=this;p(t.default_permission);var r={};return t.start&&(r.start=this.FormatDate(t.start)),t.end&&(r.end=this.FormatDate(t.end)),["assets","offerings"].forEach((function(n){var o=t[n]||{};r[n]={default_permission:o.default_permission||o.default_permissions||"no-access"},o.custom_permissions&&(r[n].custom_permissions={},Object.keys(o.custom_permissions).forEach((function(t){var i=o.custom_permissions[t],a={permission:p(i.permission)};i.start&&(a.start=e.FormatDate(i.start)),i.end&&(a.end=e.FormatDate(i.end)),r[n].custom_permissions[t]=c(c({},i),a)})))})),r}},{key:"FormatPermission",value:(E=o(n.mark((function t(e){var r,o,i,a,u,s,c,f,h,p,d,v;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=e.policyId,o=e.policyWriteToken,i=e.permission,a=i.subject.type.startsWith("oauth")?"oauth":"fabric",t.t0=i.subject.type,t.next="otp"===t.t0?5:"otp_subject"===t.t0?8:"group"===t.t0||"oauth_group"===t.t0?13:"user"===t.t0||"oauth_user"===t.t0?16:19;break;case 5:return u="ntp",s=i.subject.id,t.abrupt("break",20);case 8:return u="ntp_subject",s=i.subject.id,c=s,f=i.subject.otp_id,t.abrupt("break",20);case 13:return u="group",s="oauth"===a?i.subject.oauth_id:this.client.utils.HashToAddress(i.subject.id),t.abrupt("break",20);case 16:return u="user",s="oauth"===a?i.subject.oauth_id:this.client.utils.HashToAddress(i.subject.id),t.abrupt("break",20);case 19:throw Error("Unknown subject type: "+i.subject.type);case 20:if(h=i.subject.oauth_id||i.subject.id,p=this.subjectNames[h],c=c||p||i.subject.id,p||"fabric"!==a){t.next=74;break}if("group"!==u){t.next=36;break}return t.next=27,this.client.ContentSpaceId();case 27:return d=t.sent.replace("ispc","ilib"),t.next=30,this.client.ContentObjectMetadata({libraryId:d,objectId:this.client.utils.AddressToObjectId(s),metadataSubtree:l("public","name")});case 30:if(t.t1=t.sent,t.t1){t.next=33;break}t.t1=s;case 33:c=t.t1,t.next=74;break;case 36:if("user"!==u){t.next=56;break}return t.t4=this.client,t.next=40,this.client.ContentObjectLibraryId({objectId:r});case 40:return t.t5=t.sent,t.t6=r,t.t7=o,t.t8=l("auth_policy_settings","fabric_users",s),t.t9={libraryId:t.t5,objectId:t.t6,writeToken:t.t7,metadataSubtree:t.t8},t.next=47,t.t4.ContentObjectMetadata.call(t.t4,t.t9);case 47:if(t.t3=t.sent,t.t3){t.next=50;break}t.t3={};case 50:if(t.t2=t.t3.name,t.t2){t.next=53;break}t.t2=s;case 53:c=t.t2,t.next=74;break;case 56:if("ntp"!==u){t.next=74;break}return t.t12=this.client,t.next=60,this.client.ContentObjectLibraryId({objectId:r});case 60:return t.t13=t.sent,t.t14=r,t.t15=o,t.t16=l("auth_policy_settings","ntp_instances",s),t.t17={libraryId:t.t13,objectId:t.t14,writeToken:t.t15,metadataSubtree:t.t16},t.next=67,t.t12.ContentObjectMetadata.call(t.t12,t.t17);case 67:if(t.t11=t.sent,t.t11){t.next=70;break}t.t11={};case 70:if(t.t10=t.t11.name,t.t10){t.next=73;break}t.t10=s;case 73:c=t.t10;case 74:return this.subjectNames[h]=c,v={profileName:i.profile,subjectSource:a,subjectType:u,subjectId:s,subjectName:c},f&&(v.subjectNTPId=f),i.start&&(v.start=i.start),i.end&&(v.end=i.end),t.abrupt("return",v);case 80:case"end":return t.stop()}}),t,this)}))),function(t){return E.apply(this,arguments)})},{key:"OpenOfflineDraft",value:(k=o(n.mark((function t(e){var r,o,i,a;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.policyId,o=e.policyLibraryId,i=e.policyWriteToken,null!=o){t.next=5;break}return t.next=4,this.client.ContentObjectLibraryId({objectId:r});case 4:o=t.sent;case 5:return t.next=7,this.client.ContentObjectMetadata({libraryId:o,objectId:r,writeToken:i});case 7:a=t.sent,this.drafts[r]={meta:a,policyLibraryId:o,policyWriteToken:i};case 9:case"end":return t.stop()}}),t,this)}))),function(t){return k.apply(this,arguments)})},{key:"CloseOfflineDraft",value:(_=o(n.mark((function t(e){var r;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.policyId,null!=this.drafts[r]){t.next=3;break}throw Error("No draft open for policyId: "+r);case 3:return t.next=5,this.client.ReplaceMetadata({libraryId:this.drafts[r].policyLibraryId,objectId:r,writeToken:this.drafts[r].policyWriteToken,metadata:this.drafts[r].meta});case 5:this.drafts[r]=null;case 6:case"end":return t.stop()}}),t,this)}))),function(t){return _.apply(this,arguments)})},{key:"PolicyItems",value:(w=o(n.mark((function t(e){var r,o;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.policyId,o=e.policyWriteToken,t.t1=this.client,t.next=4,this.client.ContentObjectLibraryId({objectId:r});case 4:return t.t2=t.sent,t.t3=r,t.t4=o,t.t5=["*/display_title"],t.t6={libraryId:t.t2,objectId:t.t3,writeToken:t.t4,metadataSubtree:"auth_policy_spec",select:t.t5},t.next=11,t.t1.ContentObjectMetadata.call(t.t1,t.t6);case 11:if(t.t0=t.sent,t.t0){t.next=14;break}t.t0={};case 14:return t.abrupt("return",t.t0);case 15:case"end":return t.stop()}}),t,this)}))),function(t){return w.apply(this,arguments)})},{key:"ItemPolicy",value:(b=o(n.mark((function t(e){var r,o,i,a,u;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.policyId,o=e.policyWriteToken,i=e.itemId,t.next=3,this.ItemProfiles({policyId:r,policyWriteToken:o,itemId:i});case 3:return a=t.sent,t.next=6,this.ItemPermissions({policyId:r,policyWriteToken:o,itemId:i});case 6:if(u=t.sent,a&&u){t.next=9;break}return t.abrupt("return");case 9:return t.abrupt("return",{profiles:a,permissions:u});case 10:case"end":return t.stop()}}),t,this)}))),function(t){return b.apply(this,arguments)})},{key:"CreateItemPolicy",value:(g=o(n.mark((function t(e){var r,o,i,a,u,s,c,f,p,d=this;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.policyId,o=e.policyWriteToken,i=e.itemId,a=e.profiles,u=void 0===a?{}:a,h("policyId",r),h("policyWriteToken",o),h("itemId",i),h("profiles",u),t.t1=this.client,t.next=8,this.client.ContentObjectLibraryId({objectId:i});case 8:return t.t2=t.sent,t.t3=i,t.t4=["public/name","public/asset_metadata/title","public/asset_metadata/display_title"],t.t5={libraryId:t.t2,objectId:t.t3,select:t.t4},t.next=14,t.t1.ContentObjectMetadata.call(t.t1,t.t5);case 14:if(t.t0=t.sent,t.t0){t.next=17;break}t.t0={};case 17:return s=t.t0,c=(s.public||{}).asset_metadata||{},f=c.display_title||c.title||(s.public||{}).name,p={display_title:f,permissions:[],profiles:{}},Object.keys(u).forEach((function(t){p.profiles[t]=d.FormatProfile(u[t])})),t.t6=this.client,t.next=25,this.client.ContentObjectLibraryId({objectId:r});case 25:return t.t7=t.sent,t.t8=r,t.t9=o,t.t10=l("auth_policy_spec",i),t.t11=p,t.t12={libraryId:t.t7,objectId:t.t8,writeToken:t.t9,metadataSubtree:t.t10,metadata:t.t11},t.next=33,t.t6.ReplaceMetadata.call(t.t6,t.t12);case 33:case"end":return t.stop()}}),t,this)}))),function(t){return g.apply(this,arguments)})},{key:"RemoveItemPolicy",value:(y=o(n.mark((function t(e){var r,o,i;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.policyId,o=e.policyWriteToken,i=e.itemId,h("policyId",r),h("policyWriteToken",o),h("itemId",i),t.t0=this.client,t.next=7,this.client.ContentObjectLibraryId({objectId:r});case 7:return t.t1=t.sent,t.t2=r,t.t3=o,t.t4=l("auth_policy_spec",i),t.t5={libraryId:t.t1,objectId:t.t2,writeToken:t.t3,metadataSubtree:t.t4},t.next=14,t.t0.DeleteMetadata.call(t.t0,t.t5);case 14:case"end":return t.stop()}}),t,this)}))),function(t){return y.apply(this,arguments)})},{key:"ItemProfiles",value:(m=o(n.mark((function t(e){var r,o,i,a;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.policyId,o=e.policyWriteToken,i=e.itemId,a=e.profileName,t.t0=this.client,t.next=4,this.client.ContentObjectLibraryId({objectId:r});case 4:return t.t1=t.sent,t.t2=r,t.t3=o,t.t4=l("auth_policy_spec",i,"profiles",a||""),t.t5={libraryId:t.t1,objectId:t.t2,writeToken:t.t3,metadataSubtree:t.t4},t.next=11,t.t0.ContentObjectMetadata.call(t.t0,t.t5);case 11:return t.abrupt("return",t.sent);case 12:case"end":return t.stop()}}),t,this)}))),function(t){return m.apply(this,arguments)})},{key:"SetProfile",value:(v=o(n.mark((function t(e){var r,o,i,a,u;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.policyId,o=e.policyWriteToken,i=e.itemId,a=e.profileName,u=e.profileSpec,h("policyId",r),h("policyWriteToken",o),h("itemId",i),h("profileName",a),h("profileSpec",u),t.t0=this.client,t.next=9,this.client.ContentObjectLibraryId({objectId:r});case 9:return t.t1=t.sent,t.t2=r,t.t3=o,t.t4=l("auth_policy_spec",i,"profiles",a),t.t5=this.FormatProfile(u),t.t6={libraryId:t.t1,objectId:t.t2,writeToken:t.t3,metadataSubtree:t.t4,metadata:t.t5},t.next=17,t.t0.ReplaceMetadata.call(t.t0,t.t6);case 17:case"end":return t.stop()}}),t,this)}))),function(t){return v.apply(this,arguments)})},{key:"RemoveProfile",value:(d=o(n.mark((function t(e){var r,o,i,a;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.policyId,o=e.policyWriteToken,i=e.itemId,a=e.profileName,h("policyId",r),h("policyWriteToken",o),h("itemId",i),h("profileName",a),t.t0=this.client,t.next=8,this.client.ContentObjectLibraryId({objectId:r});case 8:return t.t1=t.sent,t.t2=r,t.t3=o,t.t4=l("auth_policy_spec",i,"profiles",a),t.t5={libraryId:t.t1,objectId:t.t2,writeToken:t.t3,metadataSubtree:t.t4},t.next=15,t.t0.DeleteMetadata.call(t.t0,t.t5);case 15:case"end":return t.stop()}}),t,this)}))),function(t){return d.apply(this,arguments)})},{key:"ItemPermissions",value:(f=o(n.mark((function t(e){var r,i,a,u,s,c=this;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.policyId,i=e.policyWriteToken,a=e.itemId,t.next=3,this.client.ContentObjectLibraryId({objectId:r});case 3:return u=t.sent,t.next=6,this.client.ContentObjectMetadata({libraryId:u,objectId:r,writeToken:i,metadataSubtree:l("auth_policy_spec",a,"permissions")});case 6:if(t.t0=t.sent,t.t0){t.next=9;break}t.t0=[];case 9:return s=t.t0,t.next=12,Promise.all(s.map(function(){var t=o(n.mark((function t(e){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,c.FormatPermission({policyId:r,policyWriteToken:i,permission:e});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 12:return t.abrupt("return",t.sent);case 13:case"end":return t.stop()}}),t,this)}))),function(t){return f.apply(this,arguments)})},{key:"SetPermission",value:(s=o(n.mark((function t(e){var r,o,i,a,u,s,c,f,p,d,v,m,y,g,b,w,_,k,E,x,A;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.policyId,o=e.policyWriteToken,i=e.itemId,a=e.subjectSource,u=void 0===a?"fabric":a,s=e.subjectType,c=void 0===s?"group":s,f=e.subjectName,p=e.subjectId,d=e.subjectNTPId,v=e.profileName,m=e.start,y=e.end,h("policyId",r),h("policyWriteToken",o),h("itemId",i),h("subjectType",c),h("subjectSource",u),h("subjectId",p),h("profileName",v),m=this.FormatDate(m),y=this.FormatDate(y),g=this.offline&&null!=this.drafts[r],b=null,g){t.next=16;break}return t.next=15,this.client.ContentObjectLibraryId({objectId:r});case 15:b=t.sent;case 16:if("fabric"===u&&("group"===c?p.startsWith("igrp")||(p="igrp".concat(this.client.utils.AddressToHash(p))):"user"===c&&(p.startsWith("iusr")||(p="iusr".concat(this.client.utils.AddressToHash(p))))),!g){t.next=21;break}w=this.drafts[r].meta.auth_policy_spec[i],t.next=24;break;case 21:return t.next=23,this.client.ContentObjectMetadata({libraryId:b,objectId:r,writeToken:o,metadataSubtree:l("auth_policy_spec",i)});case 23:w=t.sent;case 24:if(w){t.next=26;break}throw Error("Unable to add permissions to uninitialized item");case 26:if(w.profiles[v]){t.next=28;break}throw Error("Profile '".concat(v,"' does not exist"));case 28:if((_=w.permissions.findIndex((function(t){return"fabric"===u?t.subject.id===p:t.subject.oauth_id===p})))<0&&(_=w.permissions.length),k={profile:v},m&&(k.start=m),y&&(k.end=y),"fabric"!==u){t.next=53;break}if("group"!==c){t.next=38;break}E={id:p,type:"group"},t.next=51;break;case 38:if("user"!==c){t.next=42;break}E={id:p,type:"user"},t.next=51;break;case 42:if("ntp"!==c){t.next=46;break}E={id:p,type:"otp"},t.next=51;break;case 46:if("ntp_subject"!==c){t.next=50;break}E={id:p,otp_id:d,type:"otp_subject"},t.next=51;break;case 50:throw Error("Invalid subject type: ".concat(c));case 51:t.next=66;break;case 53:if("oauth"!==u){t.next=65;break}if("group"!==c){t.next=58;break}E={id:f,oauth_id:p,type:"oauth_group"},t.next=63;break;case 58:if("user"!==c){t.next=62;break}E={id:f,oauth_id:p,type:"oauth_user"},t.next=63;break;case 62:throw Error("Invalid subject type: ".concat(c));case 63:t.next=66;break;case 65:throw Error("Invalid subject source: ".concat(u));case 66:if(k.subject=E,w.permissions[_]=k,g){t.next=71;break}return t.next=71,this.client.ReplaceMetadata({libraryId:b,objectId:r,writeToken:o,metadataSubtree:l("auth_policy_spec",i,"permissions"),metadata:w.permissions});case 71:if("fabric"!==u||"user"!==c){t.next=85;break}if(x={address:this.client.utils.HashToAddress(p),name:f},!g){t.next=77;break}this.drafts[r].meta.auth_policy_settings.fabric_users[this.client.utils.HashToAddress(p)]=x,t.next=83;break;case 77:return t.next=79,this.client.ContentObjectMetadata({libraryId:b,objectId:r,writeToken:o,metadataSubtree:l("auth_policy_settings","fabric_users",this.client.utils.HashToAddress(p))});case 79:if(t.sent){t.next=83;break}return t.next=83,this.client.ReplaceMetadata({libraryId:b,objectId:r,writeToken:o,metadataSubtree:l("auth_policy_settings","fabric_users",this.client.utils.HashToAddress(p)),metadata:x});case 83:t.next=97;break;case 85:if("fabric"!==u||"ntp"!==c){t.next=97;break}if(A={address:p,ntpId:p,name:f,type:"ntpInstance"},!g){t.next=91;break}this.drafts[r].meta.auth_policy_settings.ntp_instances[p]=A,t.next=97;break;case 91:return t.next=93,this.client.ContentObjectMetadata({libraryId:b,objectId:r,writeToken:o,metadataSubtree:l("auth_policy_settings","ntp_instances",p)});case 93:if(t.sent){t.next=97;break}return t.next=97,this.client.ReplaceMetadata({libraryId:b,objectId:r,writeToken:o,metadataSubtree:l("auth_policy_settings","ntp_instances",p),metadata:A});case 97:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"RemovePermission",value:(i=o(n.mark((function t(e){var r,i,a,u,s,c,f,p=this;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.policyId,i=e.policyWriteToken,a=e.itemId,u=e.subjectId,h("policyId",r),h("policyWriteToken",i),h("itemId",a),h("subjectId",u),t.next=7,this.client.ContentObjectLibraryId({objectId:r});case 7:return s=t.sent,t.next=10,this.client.ContentObjectMetadata({libraryId:s,objectId:r,writeToken:i,metadataSubtree:l("auth_policy_spec",a,"permissions")});case 10:if(c=t.sent){t.next=13;break}return t.abrupt("return");case 13:if(!u.startsWith("0x")){t.next=23;break}return f=this.client.utils.AddressToObjectId(u),t.next=17,this.client.AccessType({id:f});case 17:if(t.t0=t.sent,"group"!==t.t0){t.next=22;break}u="igrp".concat(this.client.utils.AddressToHash(u)),t.next=23;break;case 22:u="iusr".concat(this.client.utils.AddressToHash(u));case 23:return t.next=25,Promise.all(c.map(function(){var t=o(n.mark((function t(e,o){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.subject.id!==u&&e.subject.oauth_id!==u){t.next=3;break}return t.next=3,p.client.DeleteMetadata({libraryId:s,objectId:r,writeToken:i,metadataSubtree:l("auth_policy_spec",a,"permissions",o.toString())});case 3:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}()));case 25:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"SubjectPermissions",value:(r=o(n.mark((function t(e){var r,i,a,u,s,f,p,d,v,m,y,g,b=this;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.policyId,i=e.policyWriteToken,a=e.subjectId,h("policyId",r),h("subjectId",a),!a.startsWith("0x")){t.next=13;break}return u=this.client.utils.AddressToObjectId(a),t.next=7,this.client.AccessType({id:u});case 7:if(t.t0=t.sent,"group"!==t.t0){t.next=12;break}a="igrp".concat(this.client.utils.AddressToHash(a)),t.next=13;break;case 12:a="iusr".concat(this.client.utils.AddressToHash(a));case 13:return t.next=15,this.client.ContentObjectLibraryId({objectId:r});case 15:return s=t.sent,t.next=18,this.client.ContentObjectMetadata({libraryId:s,objectId:r,writeToken:i,metadataSubtree:l("auth_policy_spec")});case 18:f=t.sent,p={},d=0,v=Object.keys(f);case 21:if(!(d<v.length)){t.next=31;break}return m=v[d],y=f[m].permissions||[],t.next=26,Promise.all(y.filter((function(t){return(t.subject||{}).oauth_id===a||(t.subject||{}).id===a})).map(function(){var t=o(n.mark((function t(e){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,b.FormatPermission({policyId:r,policyWriteToken:i,permission:e});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 26:(g=t.sent).length>0&&(p[m]=c(c({},f[m]),{},{permissions:g}));case 28:d++,t.next=21;break;case 31:return t.abrupt("return",p);case 32:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"RemoveSubjectPermissions",value:(e=o(n.mark((function t(e){var r,i,a,u,s=this;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.policyId,i=e.policyWriteToken,a=e.subjectId,h("policyId",r),h("policyWriteToken",i),h("subjectId",a),t.next=6,this.SubjectPermissions({policyId:r,policyWriteToken:i,subjectId:a});case 6:return u=t.sent,t.next=9,this.client.utils.LimitedMap(5,Object.keys(u),function(){var t=o(n.mark((function t(e){return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.RemovePermission({policyId:r,policyWriteToken:i,subjectId:a,itemId:e});case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}());case 9:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})}]),t}();t.exports=d},,,function(t,e,r){var n=r(16).default;function o(){"use strict";
|
|
44
|
-
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t.exports=o=function(){return e},t.exports.__esModule=!0,t.exports.default=t.exports;var e={},r=Object.prototype,i=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},u="function"==typeof Symbol?Symbol:{},s=u.iterator||"@@iterator",c=u.asyncIterator||"@@asyncIterator",l=u.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,i=Object.create(o.prototype),u=new P(n||[]);return a(i,"_invoke",{value:x(t,r,u)}),i}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var d={};function v(){}function m(){}function y(){}var g={};f(g,s,(function(){return this}));var b=Object.getPrototypeOf,w=b&&b(b(j([])));w&&w!==r&&i.call(w,s)&&(g=w);var _=y.prototype=v.prototype=Object.create(g);function k(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){var r;a(this,"_invoke",{value:function(o,a){function u(){return new e((function(r,u){!function r(o,a,u,s){var c=p(t[o],t,a);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==n(f)&&i.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,u,s)}),(function(t){r("throw",t,u,s)})):e.resolve(f).then((function(t){l.value=t,u(l)}),(function(t){return r("throw",t,u,s)}))}s(c.arg)}(o,a,r,u)}))}return r=r?r.then(u,u):u()}})}function x(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return T()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=A(a,r);if(u){if(u===d)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=p(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===d)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function A(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,A(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=p(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,d;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,d):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function j(t){if(t){var e=t[s];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,n=function e(){for(;++r<t.length;)if(i.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return n.next=n}}return{next:T}}function T(){return{value:void 0,done:!0}}return m.prototype=y,a(_,"constructor",{value:y,configurable:!0}),a(y,"constructor",{value:m,configurable:!0}),m.displayName=f(y,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,f(t,l,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},k(E.prototype),f(E.prototype,c,(function(){return this})),e.AsyncIterator=E,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new E(h(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},k(_),f(_,l,"Generator"),f(_,s,(function(){return this})),f(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=j,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var u=i.call(o,"catchLoc"),s=i.call(o,"finallyLoc");if(u&&s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:j(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var n=r(16).default;t.exports=function(t,e){if("object"!==n(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var n=r(25);function o(t,e){for(var r=0;r<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,n(o.key),o)}}t.exports=function(t,e,r){return e&&o(t.prototype,e),r&&o(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var n,o,i;function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}i=function(){function t(t){var e=[];if(0===t.length)return"";if("string"!=typeof t[0])throw new TypeError("Url must be a string. Received "+t[0]);if(t[0].match(/^[^/:]+:\/*$/)&&t.length>1){var r=t.shift();t[0]=r+t[0]}t[0].match(/^file:\/\/\//)?t[0]=t[0].replace(/^([^/:]+):\/*/,"$1:///"):t[0]=t[0].replace(/^([^/:]+):\/*/,"$1://");for(var n=0;n<t.length;n++){var o=t[n];if("string"!=typeof o)throw new TypeError("Url must be a string. Received "+o);""!==o&&(n>0&&(o=o.replace(/^[\/]+/,"")),o=n<t.length-1?o.replace(/[\/]+$/,""):o.replace(/[\/]+$/,"/"),e.push(o))}var i=e.join("/"),a=(i=i.replace(/\/(\?|&|#[^!])/g,"$1")).split("?");return i=a.shift()+(a.length>0?"?":"")+a.join("&")}return function(){return t("object"===a(arguments[0])?arguments[0]:[].slice.call(arguments))}},t.exports?t.exports=i():void 0===(o="function"==typeof(n=i)?n.call(e,r,e,t):n)||(t.exports=o)},function(t,e,r){var n=r(46);e.ValidatePresence=function(t,e){if(!e)throw Error("".concat(t," not specified"))},e.ValidateLibrary=function(t){if(!t)throw Error("Library ID not specified");if(!t.toString().startsWith("i"))throw Error("Invalid library ID: ".concat(t))},e.ValidateObject=function(t){if(!t)throw Error("Object ID not specified");if(!t.toString().startsWith("i"))throw Error("Invalid object ID: ".concat(t))},e.ValidateVersion=function(t){if(!t)throw Error("Version hash not specified");if(!t.toString().startsWith("h"))throw Error("Invalid version hash: ".concat(t))},e.ValidateWriteToken=function(t){if(!t)throw Error("Write token not specified");if(!t.toString().startsWith("t"))throw Error("Invalid write token: ".concat(t))},e.ValidatePartHash=function(t){if(!t)throw Error("Part hash not specified");if(!(t.toString().startsWith("hqp_")||t.toString().startsWith("hqpe")||t.toString().startsWith("hqt_")||t.toString().startsWith("hqte")||t.toString().startsWith("hql_")||t.toString().startsWith("hqle")))throw Error("Invalid part hash: ".concat(t))},e.ValidateParameters=function(t){var r=t.libraryId,n=t.objectId,o=t.versionHash;o?e.ValidateVersion(o):(e.ValidateLibrary(r),e.ValidateObject(n))},e.ValidateAddress=function(t){if(!t)throw Error("Address not specified");if(!/^(0x)?[0-9a-f]{40}$/i.test(t.toLowerCase()))throw Error("Invalid address: ".concat(t));return n.FormatAddress(t)},e.ValidatePermission=function(t){if(t&&"full-access"!==t&&"no-access"!==t)throw Error("Invalid profile permission: ".concat(t));return t},e.ValidateDate=function(t){if(t){if(isNaN(new Date(t)))throw Error("Invalid date: ".concat(t));return new Date(t).getTime()}}},function(t,e,r){(function(e,n){var o=r(50),i=r(22),a=r(23),u=r(24),s=r(54);function c(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function l(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?c(Object(r),!0).forEach((function(e){u(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}void 0===globalThis.Buffer&&(globalThis.Buffer=r(17).Buffer);var f,h,p,d=r(58),v=r(61).default,m=r(62),y=r(66),g=r(67),b=r(78).utils,w=b.keccak256,_=b.getAddress,k={name:"Utils",nullAddress:"0x0000000000000000000000000000000000000000",weiPerEther:new v("1000000000000000000"),ToBigNumber:function(t){return new v(t)},WeiToEther:function(t){return k.ToBigNumber(t).div(k.weiPerEther)},EtherToWei:function(t){return k.ToBigNumber(t).times(k.weiPerEther)},FormatAddress:function(t){return t&&"string"==typeof t?((t=t.trim()).startsWith("0x")||(t="0x"+t),t.toLowerCase()):""},FormatSignature:function(t){return t=t.replace("0x",""),"ES256K_"+d.encode(e.from(t,"hex"))},DecodeVersionHash:function(t){if(!t.startsWith("hq__")&&!t.startsWith("tq__"))throw new Error('Invalid version hash: "'.concat(t,'"'));t=t.slice(4);var r=k.FromB58(t),n=r.slice(0,32),o=n.toString("hex");r=r.slice(32);for(var i=0;r[i]>=128;)i++;i++;var a=r.slice(0,i),u=m.decode(a);return r=r.slice(i),{digest:o,size:u,objectId:"iq__"+k.B58(r),partHash:"hqp_"+k.B58(e.concat([n,a]))}},DecodeSignedToken:function(t){var r=k.FromB58(t.slice(6)),n="0x".concat(r.slice(0,65).toString("hex")),o=JSON.parse(e.from(g.inflateRaw(r.slice(65))).toString("utf-8"));return o.adr=k.FormatAddress("0x".concat(e.from(o.adr,"base64").toString("hex"))),{payload:o,signature:n}},DecodeWriteToken:function(t){if(t.length<4)throw new Error('Invalid write token: ["'.concat(t,'"] (unknown prefix)'));var e;if(t.startsWith("tqw__")?(e="tq__",t=t.slice(5)):(e=t.slice(0,4),t=t.slice(4)),0===t.length)throw new Error('Invalid write token: ["'.concat(t,'"] (too short)'));switch(e){case"tqw_":case"tq__":case"tqpw":case"tqp_":case"tlro":break;default:throw new Error('Invalid write token: ["'.concat(t,'"] (unknown prefix)'))}var r,n,o,i,a,u=k.FromB58(t);function s(t,e){var r,n,o=m.decode(u,0),i=m.decode.bytes;return n=t?0===(r=u.slice(i+1,o+i)).length?"":e+k.B58(r):"0x"+(r=u.slice(i,o+i)).toString("hex"),u=u.slice(o+i),n}switch(e){case"tqw_":case"tqpw":r="0x"+u.toString("hex");break;case"tlro":case"tq__":n=s(!0,"iq__"),o=s(!0,"inod"),r=s(!1,"");break;case"tqp_":if(u.length<3)throw new Error('Invalid write token: ["'.concat(t,'"] (token truncated)'));i=u[0],a=u[1],u=u.slice(2),r=s(!1,"");break;default:throw new Error('Invalid write token: ["'.concat(t,'"] (unknown prefix)'))}return{tokenType:e,tokenId:r,objectId:n,nodeId:o,scheme:i,flags:a}},AddressToHash:function(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t=t.replace(r?"0x04":"0x",""),d.encode(e.from(t,"hex"))},AddressToSpaceId:function(t){return"ispc"+k.AddressToHash(t)},AddressToNodeId:function(t){return"inod"+k.AddressToHash(t)},AddressToLibraryId:function(t){return"ilib"+k.AddressToHash(t)},AddressToObjectId:function(t){return"iq__"+k.AddressToHash(t)},HashToAddress:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t=e?t:t.substr(4),k.FormatAddress((e?"0x04":"0x")+d.decode(t).toString("hex"))},EqualAddress:function(t,e){return!(!t||!e)&&k.FormatAddress(t)===k.FormatAddress(e)},EqualHash:function(t,e){return!(!t||!e)&&(!(t.length<=4||e.length<=4)&&k.HashToAddress(t)===k.HashToAddress(e))},ValidAddress:function(t){try{return _(t),!0}catch(t){return!1}},ValidHash:function(t){return k.ValidAddress(k.HashToAddress(t))},ToBytes32:function(t){return"0x"+t.split("").map((function(t){return t.charCodeAt(0).toString(16)})).join("").slice(0,64).padEnd(64,"0")},BufferToArrayBuffer:function(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)},B64:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf-8";return e.from(t,r).toString("base64")},FromB64:function(t){return e.from(t,"base64").toString("utf-8")},FromB64URL:function(t){var e=(t=t.replace(/-/g,"+").replace(/_/g,"/")).length%4;if(e){if(1===e)throw new Error("InvalidLengthError: Input base64url string is the wrong length to determine padding");t+=new Array(5-e).join("=")}return k.FromB64(t)},B58:function(t){return d.encode(e.from(t))},FromB58:function(t){return d.decode(t)},FromB58ToStr:function(t){return(new TextDecoder).decode(k.FromB58(t))},DecodeAuthorizationToken:function(t){var e=(t=decodeURIComponent(t)).split("."),r=s(e,2),n=r[0],o=r[1];return l(l({},n=JSON.parse(k.FromB64(n))),{},{signature:o})},LimitedMap:(p=a(i.mark((function t(e,r,n){var u,s,c,l,f;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=0,s=!1,c=function(){var t=a(i.mark((function t(){var e;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!s){t.next=5;break}return t.next=3,new Promise((function(t){return setTimeout(t,10)}));case 3:t.next=0;break;case 5:return s=!0,e=u,u+=1,s=!1,t.abrupt("return",e);case 10:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),l=[],f=0,t.abrupt("return",new Promise((function(t,u){o(Array(e||1)).forEach(a(i.mark((function e(){var o;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f+=1,e.next=3,c();case 3:o=e.sent;case 4:if(!(o<r.length)){e.next=19;break}return e.prev=5,e.next=8,n(r[o],o);case 8:l[o]=e.sent,e.next=14;break;case 11:e.prev=11,e.t0=e.catch(5),u(e.t0);case 14:return e.next=16,c();case 16:o=e.sent,e.next=4;break;case 19:0==(f-=1)&&t(l);case 21:case"end":return e.stop()}}),e,null,[[5,11]])}))))})));case 6:case"end":return t.stop()}}),t)}))),function(t,e,r){return p.apply(this,arguments)}),ResponseToJson:(h=a(i.mark((function t(e){return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",k.ResponseToFormat("json",e));case 1:case"end":return t.stop()}}),t)}))),function(t){return h.apply(this,arguments)}),ResponseToFormat:(f=a(i.mark((function t(e,r){return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r;case 2:r=t.sent,t.t0=e.toLowerCase(),t.next="json"===t.t0?6:"text"===t.t0?9:"blob"===t.t0?12:"arraybuffer"===t.t0?15:"formdata"===t.t0?18:"buffer"===t.t0?21:24;break;case 6:return t.next=8,r.json();case 8:return t.abrupt("return",t.sent);case 9:return t.next=11,r.text();case 11:return t.abrupt("return",t.sent);case 12:return t.next=14,r.blob();case 14:return t.abrupt("return",t.sent);case 15:return t.next=17,r.arrayBuffer();case 17:return t.abrupt("return",t.sent);case 18:return t.next=20,r.formData();case 20:return t.abrupt("return",t.sent);case 21:return t.next=23,r.buffer();case 23:return t.abrupt("return",t.sent);case 24:return t.abrupt("return",r);case 25:case"end":return t.stop()}}),t)}))),function(t,e){return f.apply(this,arguments)}),ResizeImage:function(t){var e=t.imageUrl,r=t.height;return!e||e&&!e.startsWith("http")?e:(e=y(e).removeSearch("height").removeSearch("header-x_image_height"),r&&!isNaN(parseInt(r))&&e.addSearch("height",parseInt(r)),e.toString())},SafeTraverse:function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];if(!t)return t;1===r.length&&Array.isArray(r[0])&&(r=r[0]);for(var o=t,i=0;i<r.length;i++)if(void 0===(o=o[r[i]]))return;return o},IsCloneable:function(t){if(Object(t)!==t)return!0;switch({}.toString.call(t).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(t).every((function(e){return k.IsCloneable(t[e])}));case"Map":return o(t.keys()).every(k.IsCloneable)&&o(t.values()).every(k.IsCloneable);case"Set":return o(t.keys()).every(k.IsCloneable);default:return!1}},MakeClonable:function(t){if(k.IsCloneable(t))return t;if(e.isBuffer(t))return k.BufferToArrayBuffer(t);switch({}.toString.call(t).slice(8,-1)){case"Response":case"Function":return;case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return t;case"Array":return t.map((function(t){return k.MakeClonable(t)}));case"Set":return new Set(Array.from(t.keys()).map((function(t){return k.MakeClonable(t)})));case"Map":var r=new Map;return Array.from(t.keys()).forEach((function(e){var n=k.MakeClonable(t.get(e));n&&r.set(e,n)})),r;case"Error":return t.message;case"Object":var n={};return Object.keys(t).map((function(e){var r=k.MakeClonable(t[e]);r&&(n[e]=r)})),n;default:return JSON.parse(JSON.stringify(t))}},PublicKeyToAddress:function(t){var r=new Uint8Array(e.from(t.replace("0x04",""),"hex")),n="0x"+w(r).slice(26);return k.FormatAddress(n)},PLATFORM_NODE:"node",PLATFORM_WEB:"web",PLATFORM_REACT_NATIVE:"react-native",Platform:function(){return"undefined"!=typeof navigator&&"ReactNative"===navigator.product?k.PLATFORM_REACT_NATIVE:void 0!==n&&void 0!==n.versions&&void 0!==n.versions.node?k.PLATFORM_NODE:k.PLATFORM_WEB}};t.exports=k}).call(this,r(17).Buffer,r(18))},function(t,e,r){"use strict";e.byteLength=function(t){var e=c(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=c(t),a=n[0],u=n[1],s=new i(function(t,e,r){return 3*(e+r)/4-r}(0,a,u)),l=0,f=u>0?a-4:a;for(r=0;r<f;r+=4)e=o[t.charCodeAt(r)]<<18|o[t.charCodeAt(r+1)]<<12|o[t.charCodeAt(r+2)]<<6|o[t.charCodeAt(r+3)],s[l++]=e>>16&255,s[l++]=e>>8&255,s[l++]=255&e;2===u&&(e=o[t.charCodeAt(r)]<<2|o[t.charCodeAt(r+1)]>>4,s[l++]=255&e);1===u&&(e=o[t.charCodeAt(r)]<<10|o[t.charCodeAt(r+1)]<<4|o[t.charCodeAt(r+2)]>>2,s[l++]=e>>8&255,s[l++]=255&e);return s},e.fromByteArray=function(t){for(var e,r=t.length,o=r%3,i=[],a=0,u=r-o;a<u;a+=16383)i.push(l(t,a,a+16383>u?u:a+16383));1===o?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===o&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return i.join("")};for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,s=a.length;u<s;++u)n[u]=a[u],o[a.charCodeAt(u)]=u;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function l(t,e,r){for(var o,i,a=[],u=e;u<r;u+=3)o=(t[u]<<16&16711680)+(t[u+1]<<8&65280)+(255&t[u+2]),a.push(n[(i=o)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(t,e){
|
|
44
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t.exports=o=function(){return e},t.exports.__esModule=!0,t.exports.default=t.exports;var e={},r=Object.prototype,i=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},u="function"==typeof Symbol?Symbol:{},s=u.iterator||"@@iterator",c=u.asyncIterator||"@@asyncIterator",l=u.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,i=Object.create(o.prototype),u=new P(n||[]);return a(i,"_invoke",{value:x(t,r,u)}),i}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var d={};function v(){}function m(){}function y(){}var g={};f(g,s,(function(){return this}));var b=Object.getPrototypeOf,w=b&&b(b(j([])));w&&w!==r&&i.call(w,s)&&(g=w);var _=y.prototype=v.prototype=Object.create(g);function k(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){var r;a(this,"_invoke",{value:function(o,a){function u(){return new e((function(r,u){!function r(o,a,u,s){var c=p(t[o],t,a);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==n(f)&&i.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,u,s)}),(function(t){r("throw",t,u,s)})):e.resolve(f).then((function(t){l.value=t,u(l)}),(function(t){return r("throw",t,u,s)}))}s(c.arg)}(o,a,r,u)}))}return r=r?r.then(u,u):u()}})}function x(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return T()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=A(a,r);if(u){if(u===d)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=p(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===d)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function A(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,A(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=p(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,d;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,d):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function j(t){if(t){var e=t[s];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,n=function e(){for(;++r<t.length;)if(i.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return n.next=n}}return{next:T}}function T(){return{value:void 0,done:!0}}return m.prototype=y,a(_,"constructor",{value:y,configurable:!0}),a(y,"constructor",{value:m,configurable:!0}),m.displayName=f(y,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,f(t,l,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},k(E.prototype),f(E.prototype,c,(function(){return this})),e.AsyncIterator=E,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new E(h(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},k(_),f(_,l,"Generator"),f(_,s,(function(){return this})),f(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=j,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var u=i.call(o,"catchLoc"),s=i.call(o,"finallyLoc");if(u&&s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:j(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var n=r(16).default;t.exports=function(t,e){if("object"!==n(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var n=r(25);function o(t,e){for(var r=0;r<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,n(o.key),o)}}t.exports=function(t,e,r){return e&&o(t.prototype,e),r&&o(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var n,o,i;function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}i=function(){function t(t){var e=[];if(0===t.length)return"";if("string"!=typeof t[0])throw new TypeError("Url must be a string. Received "+t[0]);if(t[0].match(/^[^/:]+:\/*$/)&&t.length>1){var r=t.shift();t[0]=r+t[0]}t[0].match(/^file:\/\/\//)?t[0]=t[0].replace(/^([^/:]+):\/*/,"$1:///"):t[0]=t[0].replace(/^([^/:]+):\/*/,"$1://");for(var n=0;n<t.length;n++){var o=t[n];if("string"!=typeof o)throw new TypeError("Url must be a string. Received "+o);""!==o&&(n>0&&(o=o.replace(/^[\/]+/,"")),o=n<t.length-1?o.replace(/[\/]+$/,""):o.replace(/[\/]+$/,"/"),e.push(o))}var i=e.join("/"),a=(i=i.replace(/\/(\?|&|#[^!])/g,"$1")).split("?");return i=a.shift()+(a.length>0?"?":"")+a.join("&")}return function(){return t("object"===a(arguments[0])?arguments[0]:[].slice.call(arguments))}},t.exports?t.exports=i():void 0===(o="function"==typeof(n=i)?n.call(e,r,e,t):n)||(t.exports=o)},function(t,e,r){var n=r(46);e.ValidatePresence=function(t,e){if(!e)throw Error("".concat(t," not specified"))},e.ValidateLibrary=function(t){if(!t)throw Error("Library ID not specified");if(!t.toString().startsWith("i"))throw Error("Invalid library ID: ".concat(t))},e.ValidateObject=function(t){if(!t)throw Error("Object ID not specified");if(!t.toString().startsWith("i"))throw Error("Invalid object ID: ".concat(t))},e.ValidateVersion=function(t){if(!t)throw Error("Version hash not specified");if(!t.toString().startsWith("h"))throw Error("Invalid version hash: ".concat(t))},e.ValidateWriteToken=function(t){if(!t)throw Error("Write token not specified");if(!t.toString().startsWith("t"))throw Error("Invalid write token: ".concat(t))},e.ValidatePartHash=function(t){if(!t)throw Error("Part hash not specified");if(!t.toString().startsWith("hqp_")&&!t.toString().startsWith("hqpe"))throw Error("Invalid part hash: ".concat(t))},e.ValidateParameters=function(t){var r=t.libraryId,n=t.objectId,o=t.versionHash;o?e.ValidateVersion(o):(e.ValidateLibrary(r),e.ValidateObject(n))},e.ValidateAddress=function(t){if(!t)throw Error("Address not specified");if(!/^(0x)?[0-9a-f]{40}$/i.test(t.toLowerCase()))throw Error("Invalid address: ".concat(t));return n.FormatAddress(t)},e.ValidatePermission=function(t){if(t&&"full-access"!==t&&"no-access"!==t)throw Error("Invalid profile permission: ".concat(t));return t},e.ValidateDate=function(t){if(t){if(isNaN(new Date(t)))throw Error("Invalid date: ".concat(t));return new Date(t).getTime()}}},function(t,e,r){(function(e,n){var o=r(50),i=r(22),a=r(23),u=r(24),s=r(54);function c(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function l(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?c(Object(r),!0).forEach((function(e){u(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}void 0===globalThis.Buffer&&(globalThis.Buffer=r(17).Buffer);var f,h,p,d=r(58),v=r(61).default,m=r(62),y=r(66),g=r(67),b=r(78).utils,w=b.keccak256,_=b.getAddress,k={name:"Utils",nullAddress:"0x0000000000000000000000000000000000000000",weiPerEther:new v("1000000000000000000"),ToBigNumber:function(t){return new v(t)},WeiToEther:function(t){return k.ToBigNumber(t).div(k.weiPerEther)},EtherToWei:function(t){return k.ToBigNumber(t).times(k.weiPerEther)},FormatAddress:function(t){return t&&"string"==typeof t?((t=t.trim()).startsWith("0x")||(t="0x"+t),t.toLowerCase()):""},FormatSignature:function(t){return t=t.replace("0x",""),"ES256K_"+d.encode(e.from(t,"hex"))},DecodeVersionHash:function(t){if(!t.startsWith("hq__")&&!t.startsWith("tq__"))throw new Error('Invalid version hash: "'.concat(t,'"'));t=t.slice(4);var r=k.FromB58(t),n=r.slice(0,32),o=n.toString("hex");r=r.slice(32);for(var i=0;r[i]>=128;)i++;i++;var a=r.slice(0,i),u=m.decode(a);return r=r.slice(i),{digest:o,size:u,objectId:"iq__"+k.B58(r),partHash:"hqp_"+k.B58(e.concat([n,a]))}},DecodeSignedToken:function(t){var r=k.FromB58(t.slice(6)),n="0x".concat(r.slice(0,65).toString("hex")),o=JSON.parse(e.from(g.inflateRaw(r.slice(65))).toString("utf-8"));return o.adr=k.FormatAddress("0x".concat(e.from(o.adr,"base64").toString("hex"))),{payload:o,signature:n}},DecodeWriteToken:function(t){if(t.length<4)throw new Error('Invalid write token: ["'.concat(t,'"] (unknown prefix)'));var e;if(t.startsWith("tqw__")?(e="tq__",t=t.slice(5)):(e=t.slice(0,4),t=t.slice(4)),0===t.length)throw new Error('Invalid write token: ["'.concat(t,'"] (too short)'));switch(e){case"tqw_":case"tq__":case"tqpw":case"tqp_":case"tlro":break;default:throw new Error('Invalid write token: ["'.concat(t,'"] (unknown prefix)'))}var r,n,o,i,a,u=k.FromB58(t);function s(t,e){var r,n,o=m.decode(u,0),i=m.decode.bytes;return n=t?0===(r=u.slice(i+1,o+i)).length?"":e+k.B58(r):"0x"+(r=u.slice(i,o+i)).toString("hex"),u=u.slice(o+i),n}switch(e){case"tqw_":case"tqpw":r="0x"+u.toString("hex");break;case"tlro":case"tq__":n=s(!0,"iq__"),o=s(!0,"inod"),r=s(!1,"");break;case"tqp_":if(u.length<3)throw new Error('Invalid write token: ["'.concat(t,'"] (token truncated)'));i=u[0],a=u[1],u=u.slice(2),r=s(!1,"");break;default:throw new Error('Invalid write token: ["'.concat(t,'"] (unknown prefix)'))}return{tokenType:e,tokenId:r,objectId:n,nodeId:o,scheme:i,flags:a}},AddressToHash:function(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t=t.replace(r?"0x04":"0x",""),d.encode(e.from(t,"hex"))},AddressToSpaceId:function(t){return"ispc"+k.AddressToHash(t)},AddressToLibraryId:function(t){return"ilib"+k.AddressToHash(t)},AddressToObjectId:function(t){return"iq__"+k.AddressToHash(t)},HashToAddress:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t=e?t:t.substr(4),k.FormatAddress((e?"0x04":"0x")+d.decode(t).toString("hex"))},EqualAddress:function(t,e){return!(!t||!e)&&k.FormatAddress(t)===k.FormatAddress(e)},EqualHash:function(t,e){return!(!t||!e)&&(!(t.length<=4||e.length<=4)&&k.HashToAddress(t)===k.HashToAddress(e))},ValidAddress:function(t){try{return _(t),!0}catch(t){return!1}},ValidHash:function(t){return k.ValidAddress(k.HashToAddress(t))},ToBytes32:function(t){return"0x"+t.split("").map((function(t){return t.charCodeAt(0).toString(16)})).join("").slice(0,64).padEnd(64,"0")},BufferToArrayBuffer:function(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)},B64:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf-8";return e.from(t,r).toString("base64")},FromB64:function(t){return e.from(t,"base64").toString("utf-8")},FromB64URL:function(t){var e=(t=t.replace(/-/g,"+").replace(/_/g,"/")).length%4;if(e){if(1===e)throw new Error("InvalidLengthError: Input base64url string is the wrong length to determine padding");t+=new Array(5-e).join("=")}return k.FromB64(t)},B58:function(t){return d.encode(e.from(t))},FromB58:function(t){return d.decode(t)},FromB58ToStr:function(t){return(new TextDecoder).decode(k.FromB58(t))},DecodeAuthorizationToken:function(t){var e=(t=decodeURIComponent(t)).split("."),r=s(e,2),n=r[0],o=r[1];return l(l({},n=JSON.parse(k.FromB64(n))),{},{signature:o})},LimitedMap:(p=a(i.mark((function t(e,r,n){var u,s,c,l,f;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=0,s=!1,c=function(){var t=a(i.mark((function t(){var e;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!s){t.next=5;break}return t.next=3,new Promise((function(t){return setTimeout(t,10)}));case 3:t.next=0;break;case 5:return s=!0,e=u,u+=1,s=!1,t.abrupt("return",e);case 10:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),l=[],f=0,t.abrupt("return",new Promise((function(t,u){o(Array(e||1)).forEach(a(i.mark((function e(){var o;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f+=1,e.next=3,c();case 3:o=e.sent;case 4:if(!(o<r.length)){e.next=19;break}return e.prev=5,e.next=8,n(r[o],o);case 8:l[o]=e.sent,e.next=14;break;case 11:e.prev=11,e.t0=e.catch(5),u(e.t0);case 14:return e.next=16,c();case 16:o=e.sent,e.next=4;break;case 19:0==(f-=1)&&t(l);case 21:case"end":return e.stop()}}),e,null,[[5,11]])}))))})));case 6:case"end":return t.stop()}}),t)}))),function(t,e,r){return p.apply(this,arguments)}),ResponseToJson:(h=a(i.mark((function t(e){return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",k.ResponseToFormat("json",e));case 1:case"end":return t.stop()}}),t)}))),function(t){return h.apply(this,arguments)}),ResponseToFormat:(f=a(i.mark((function t(e,r){return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r;case 2:r=t.sent,t.t0=e.toLowerCase(),t.next="json"===t.t0?6:"text"===t.t0?9:"blob"===t.t0?12:"arraybuffer"===t.t0?15:"formdata"===t.t0?18:"buffer"===t.t0?21:24;break;case 6:return t.next=8,r.json();case 8:return t.abrupt("return",t.sent);case 9:return t.next=11,r.text();case 11:return t.abrupt("return",t.sent);case 12:return t.next=14,r.blob();case 14:return t.abrupt("return",t.sent);case 15:return t.next=17,r.arrayBuffer();case 17:return t.abrupt("return",t.sent);case 18:return t.next=20,r.formData();case 20:return t.abrupt("return",t.sent);case 21:return t.next=23,r.buffer();case 23:return t.abrupt("return",t.sent);case 24:return t.abrupt("return",r);case 25:case"end":return t.stop()}}),t)}))),function(t,e){return f.apply(this,arguments)}),ResizeImage:function(t){var e=t.imageUrl,r=t.height;return!e||e&&!e.startsWith("http")?e:(e=y(e).removeSearch("height").removeSearch("header-x_image_height"),r&&!isNaN(parseInt(r))&&e.addSearch("height",parseInt(r)),e.toString())},SafeTraverse:function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];if(!t)return t;1===r.length&&Array.isArray(r[0])&&(r=r[0]);for(var o=t,i=0;i<r.length;i++)if(void 0===(o=o[r[i]]))return;return o},IsCloneable:function(t){if(Object(t)!==t)return!0;switch({}.toString.call(t).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(t).every((function(e){return k.IsCloneable(t[e])}));case"Map":return o(t.keys()).every(k.IsCloneable)&&o(t.values()).every(k.IsCloneable);case"Set":return o(t.keys()).every(k.IsCloneable);default:return!1}},MakeClonable:function(t){if(k.IsCloneable(t))return t;if(e.isBuffer(t))return k.BufferToArrayBuffer(t);switch({}.toString.call(t).slice(8,-1)){case"Response":case"Function":return;case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return t;case"Array":return t.map((function(t){return k.MakeClonable(t)}));case"Set":return new Set(Array.from(t.keys()).map((function(t){return k.MakeClonable(t)})));case"Map":var r=new Map;return Array.from(t.keys()).forEach((function(e){var n=k.MakeClonable(t.get(e));n&&r.set(e,n)})),r;case"Error":return t.message;case"Object":var n={};return Object.keys(t).map((function(e){var r=k.MakeClonable(t[e]);r&&(n[e]=r)})),n;default:return JSON.parse(JSON.stringify(t))}},PublicKeyToAddress:function(t){var r=new Uint8Array(e.from(t.replace("0x04",""),"hex")),n="0x"+w(r).slice(26);return k.FormatAddress(n)},PLATFORM_NODE:"node",PLATFORM_WEB:"web",PLATFORM_REACT_NATIVE:"react-native",Platform:function(){return"undefined"!=typeof navigator&&"ReactNative"===navigator.product?k.PLATFORM_REACT_NATIVE:void 0!==n&&void 0!==n.versions&&void 0!==n.versions.node?k.PLATFORM_NODE:k.PLATFORM_WEB}};t.exports=k}).call(this,r(17).Buffer,r(18))},function(t,e,r){"use strict";e.byteLength=function(t){var e=c(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=c(t),a=n[0],u=n[1],s=new i(function(t,e,r){return 3*(e+r)/4-r}(0,a,u)),l=0,f=u>0?a-4:a;for(r=0;r<f;r+=4)e=o[t.charCodeAt(r)]<<18|o[t.charCodeAt(r+1)]<<12|o[t.charCodeAt(r+2)]<<6|o[t.charCodeAt(r+3)],s[l++]=e>>16&255,s[l++]=e>>8&255,s[l++]=255&e;2===u&&(e=o[t.charCodeAt(r)]<<2|o[t.charCodeAt(r+1)]>>4,s[l++]=255&e);1===u&&(e=o[t.charCodeAt(r)]<<10|o[t.charCodeAt(r+1)]<<4|o[t.charCodeAt(r+2)]>>2,s[l++]=e>>8&255,s[l++]=255&e);return s},e.fromByteArray=function(t){for(var e,r=t.length,o=r%3,i=[],a=0,u=r-o;a<u;a+=16383)i.push(l(t,a,a+16383>u?u:a+16383));1===o?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===o&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return i.join("")};for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,s=a.length;u<s;++u)n[u]=a[u],o[a.charCodeAt(u)]=u;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function l(t,e,r){for(var o,i,a=[],u=e;u<r;u+=3)o=(t[u]<<16&16711680)+(t[u+1]<<8&65280)+(255&t[u+2]),a.push(n[(i=o)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(t,e){
|
|
45
45
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
46
46
|
e.read=function(t,e,r,n,o){var i,a,u=8*o-n-1,s=(1<<u)-1,c=s>>1,l=-7,f=r?o-1:0,h=r?-1:1,p=t[e+f];for(f+=h,i=p&(1<<-l)-1,p>>=-l,l+=u;l>0;i=256*i+t[e+f],f+=h,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=n;l>0;a=256*a+t[e+f],f+=h,l-=8);if(0===i)i=1-c;else{if(i===s)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),i-=c}return(p?-1:1)*a*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var a,u,s,c=8*i-o-1,l=(1<<c)-1,f=l>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,d=n?1:-1,v=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-a))<1&&(a--,s*=2),(e+=a+f>=1?h/s:h*Math.pow(2,1-f))*s>=2&&(a++,s/=2),a+f>=l?(u=0,a=l):a+f>=1?(u=(e*s-1)*Math.pow(2,o),a+=f):(u=e*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;t[r+p]=255&u,p+=d,u/=256,o-=8);for(a=a<<o|u,c+=o;c>0;t[r+p]=255&a,p+=d,a/=256,c-=8);t[r+p-d]|=128*v}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){var n=r(51),o=r(52),i=r(27),a=r(53);t.exports=function(t){return n(t)||o(t)||i(t)||a()},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var n=r(26);t.exports=function(t){if(Array.isArray(t))return n(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var n=r(55),o=r(56),i=r(27),a=r(57);t.exports=function(t,e){return n(t)||o(t,e)||i(t,e)||a()},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t){if(Array.isArray(t))return t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],s=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);s=!0);}catch(t){c=!0,o=t}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var n=r(59);t.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},function(t,e,r){"use strict";var n=r(60).Buffer;t.exports=function(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var o=0;o<t.length;o++){var i=t.charAt(o),a=i.charCodeAt(0);if(255!==e[a])throw new TypeError(i+" is ambiguous");e[a]=o}var u=t.length,s=t.charAt(0),c=Math.log(u)/Math.log(256),l=Math.log(256)/Math.log(u);function f(t){if("string"!=typeof t)throw new TypeError("Expected String");if(0===t.length)return n.alloc(0);for(var r=0,o=0,i=0;t[r]===s;)o++,r++;for(var a=(t.length-r)*c+1>>>0,l=new Uint8Array(a);t[r];){var f=e[t.charCodeAt(r)];if(255===f)return;for(var h=0,p=a-1;(0!==f||h<i)&&-1!==p;p--,h++)f+=u*l[p]>>>0,l[p]=f%256>>>0,f=f/256>>>0;if(0!==f)throw new Error("Non-zero carry");i=h,r++}for(var d=a-i;d!==a&&0===l[d];)d++;var v=n.allocUnsafe(o+(a-d));v.fill(0,0,o);for(var m=o;d!==a;)v[m++]=l[d++];return v}return{encode:function(e){if((Array.isArray(e)||e instanceof Uint8Array)&&(e=n.from(e)),!n.isBuffer(e))throw new TypeError("Expected Buffer");if(0===e.length)return"";for(var r=0,o=0,i=0,a=e.length;i!==a&&0===e[i];)i++,r++;for(var c=(a-i)*l+1>>>0,f=new Uint8Array(c);i!==a;){for(var h=e[i],p=0,d=c-1;(0!==h||p<o)&&-1!==d;d--,p++)h+=256*f[d]>>>0,f[d]=h%u>>>0,h=h/u>>>0;if(0!==h)throw new Error("Non-zero carry");o=p,i++}for(var v=c-o;v!==c&&0===f[v];)v++;for(var m=s.repeat(r);v<c;++v)m+=t.charAt(f[v]);return m},decodeUnsafe:f,decode:function(t){var e=f(t);if(e)return e;throw new Error("Non-base"+u+" character")}}}},function(t,e,r){
|
|
47
47
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|