@frak-labs/components 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -4
- package/dist/bundle/components.js +17 -0
- package/package.json +2 -2
- package/dist/components.js +0 -1
package/README.md
CHANGED
|
@@ -5,7 +5,8 @@ Those components are meant to be used to interact with the [Frak Wallet](https:/
|
|
|
5
5
|
They are built as [Web Components](https://developer.mozilla.org/en-US/docs/Web/API/Web_components), so you can use them in any web project, no matter the framework you are using.
|
|
6
6
|
|
|
7
7
|
Checkout our documentation for more information's about the usage:
|
|
8
|
-
- [
|
|
8
|
+
- [Components](https://docs.frak.id/components)
|
|
9
|
+
- [Share Button usage](https://docs.frak.id/components/share-button)
|
|
9
10
|
|
|
10
11
|
To have more info about how does it works under the hood, you can check [this](https://docs.frak.id/wallet-sdk/under-the-hood)
|
|
11
12
|
|
|
@@ -14,7 +15,21 @@ To have more info about how does it works under the hood, you can check [this](h
|
|
|
14
15
|
Add the following script tag to your HTML file:
|
|
15
16
|
|
|
16
17
|
```html
|
|
17
|
-
<script src="https://cdn.jsdelivr.net/npm/@frak-labs/components@latest/dist/components.js" defer="defer"></script>
|
|
18
|
+
<script src="https://cdn.jsdelivr.net/npm/@frak-labs/components@latest/dist/bundle/components.js" defer="defer"></script>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Quick start
|
|
22
|
+
|
|
23
|
+
Add a minimal configuration:
|
|
24
|
+
|
|
25
|
+
```javascript
|
|
26
|
+
window.FrakSetup = {
|
|
27
|
+
config: {
|
|
28
|
+
metadata: {
|
|
29
|
+
name: "Your App Name",
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
};
|
|
18
33
|
```
|
|
19
34
|
|
|
20
35
|
## Sample usage
|
|
@@ -28,11 +43,11 @@ Sample code to use share button:
|
|
|
28
43
|
Button with custom text:
|
|
29
44
|
|
|
30
45
|
```html
|
|
31
|
-
<frak-button-share text="Share
|
|
46
|
+
<frak-button-share text="Share and earn!"></frak-button-share>
|
|
32
47
|
```
|
|
33
48
|
|
|
34
49
|
Button with custom class:
|
|
35
50
|
|
|
36
51
|
```html
|
|
37
|
-
<frak-button-share classname="button"></frak-button-share>
|
|
52
|
+
<frak-button-share classname="button button-primary"></frak-button-share>
|
|
38
53
|
```
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";var FrakComponents=(()=>{var Ho=Object.create;var Ee=Object.defineProperty;var Lo=Object.getOwnPropertyDescriptor;var Uo=Object.getOwnPropertyNames;var Do=Object.getPrototypeOf,No=Object.prototype.hasOwnProperty;var Gt=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var B=(e,t)=>()=>(e&&(t=e(e=0)),t);var Xt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Oo=(e,t)=>{for(var r in t)Ee(e,r,{get:t[r],enumerable:!0})},Yt=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Uo(t))!No.call(e,n)&&n!==r&&Ee(e,n,{get:()=>t[n],enumerable:!(o=Lo(t,n))||o.enumerable});return e};var Fe=(e,t,r)=>(r=e!=null?Ho(Do(e)):{},Yt(t||!e||!e.__esModule?Ee(r,"default",{value:e,enumerable:!0}):r,e)),zo=e=>Yt(Ee({},"__esModule",{value:!0}),e);var ot=Xt((se,rt)=>{"use strict";(function(e,t){if(typeof se=="object"&&typeof rt=="object")rt.exports=t();else if(typeof define=="function"&&define.amd)define([],t);else{var r=t();for(var o in r)(typeof se=="object"?se:e)[o]=r[o]}})(se,()=>(()=>{"use strict";var e={48:function(r,o,n){var a=this&&this.__awaiter||function(u,_,i,p){return new(i||(i=Promise))(function(b,T){function g(m){try{P(p.next(m))}catch(y){T(y)}}function E(m){try{P(p.throw(m))}catch(y){T(y)}}function P(m){var y;m.done?b(m.value):(y=m.value,y instanceof i?y:new i(function(F){F(y)})).then(g,E)}P((p=p.apply(u,_||[])).next())})},c=this&&this.__generator||function(u,_){var i,p,b,T,g={label:0,sent:function(){if(1&b[0])throw b[1];return b[1]},trys:[],ops:[]};return T={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(T[Symbol.iterator]=function(){return this}),T;function E(P){return function(m){return function(y){if(i)throw new TypeError("Generator is already executing.");for(;T&&(T=0,y[0]&&(g=0)),g;)try{if(i=1,p&&(b=2&y[0]?p.return:y[0]?p.throw||((b=p.return)&&b.call(p),0):p.next)&&!(b=b.call(p,y[1])).done)return b;switch(p=0,b&&(y=[2&y[0],b.value]),y[0]){case 0:case 1:b=y;break;case 4:return g.label++,{value:y[1],done:!1};case 5:g.label++,p=y[1],y=[0];continue;case 7:y=g.ops.pop(),g.trys.pop();continue;default:if(!((b=(b=g.trys).length>0&&b[b.length-1])||y[0]!==6&&y[0]!==2)){g=0;continue}if(y[0]===3&&(!b||y[1]>b[0]&&y[1]<b[3])){g.label=y[1];break}if(y[0]===6&&g.label<b[1]){g.label=b[1],b=y;break}if(b&&g.label<b[2]){g.label=b[2],g.ops.push(y);break}b[2]&&g.ops.pop(),g.trys.pop();continue}y=_.call(u,g)}catch(F){y=[6,F],p=0}finally{i=b=0}if(5&y[0])throw y[1];return{value:y[0]?y[1]:void 0,done:!0}}([P,m])}}};Object.defineProperty(o,"__esModule",{value:!0}),o.decompressFromUTF16=o.compressToUTF16=o.decompressFromBase64=o.compressToBase64=void 0;var f=n(304),l=n(134),x=new f.CompressorImpl,d=new l.DecompressorImpl,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",h={};o.compressToBase64=function(u){return a(this,void 0,void 0,function(){var _;return c(this,function(i){switch(i.label){case 0:return u===null?[2,""]:[4,x.compress(u,6,function(p){return s.charAt(p)})];case 1:switch((_=i.sent()).length%4){default:case 0:return[2,_];case 1:return[2,_+"==="];case 2:return[2,_+"=="];case 3:return[2,_+"="]}return[2]}})})},o.decompressFromBase64=function(u){return a(this,void 0,void 0,function(){return c(this,function(_){switch(_.label){case 0:return u===null?[2,""]:u===""?[2,null]:[4,d.decompress(u.length,32,function(i){return function(p,b){if(!h[p]){h[p]={};for(var T=0;T<p.length;T++)h[p][p.charAt(T)]=T}return h[p][b]}(s,u.charAt(i))})];case 1:return[2,_.sent()]}})})},o.compressToUTF16=function(u){return a(this,void 0,void 0,function(){return c(this,function(_){switch(_.label){case 0:return u===null?[2,""]:[4,x.compress(u,15,function(i){return String.fromCharCode(i+32)})];case 1:return[2,_.sent()+" "]}})})},o.decompressFromUTF16=function(u){return a(this,void 0,void 0,function(){return c(this,function(_){switch(_.label){case 0:return u===null?[2,""]:u===""?[2,null]:[4,d.decompress(u.length,16384,function(i){return u.charCodeAt(i)-32})];case 1:return[2,_.sent()]}})})}},304:function(r,o,n){var a=this&&this.__awaiter||function(d,s,h,u){return new(h||(h=Promise))(function(_,i){function p(g){try{T(u.next(g))}catch(E){i(E)}}function b(g){try{T(u.throw(g))}catch(E){i(E)}}function T(g){var E;g.done?_(g.value):(E=g.value,E instanceof h?E:new h(function(P){P(E)})).then(p,b)}T((u=u.apply(d,s||[])).next())})},c=this&&this.__generator||function(d,s){var h,u,_,i,p={label:0,sent:function(){if(1&_[0])throw _[1];return _[1]},trys:[],ops:[]};return i={next:b(0),throw:b(1),return:b(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function b(T){return function(g){return function(E){if(h)throw new TypeError("Generator is already executing.");for(;i&&(i=0,E[0]&&(p=0)),p;)try{if(h=1,u&&(_=2&E[0]?u.return:E[0]?u.throw||((_=u.return)&&_.call(u),0):u.next)&&!(_=_.call(u,E[1])).done)return _;switch(u=0,_&&(E=[2&E[0],_.value]),E[0]){case 0:case 1:_=E;break;case 4:return p.label++,{value:E[1],done:!1};case 5:p.label++,u=E[1],E=[0];continue;case 7:E=p.ops.pop(),p.trys.pop();continue;default:if(!((_=(_=p.trys).length>0&&_[_.length-1])||E[0]!==6&&E[0]!==2)){p=0;continue}if(E[0]===3&&(!_||E[1]>_[0]&&E[1]<_[3])){p.label=E[1];break}if(E[0]===6&&p.label<_[1]){p.label=_[1],_=E;break}if(_&&p.label<_[2]){p.label=_[2],p.ops.push(E);break}_[2]&&p.ops.pop(),p.trys.pop();continue}E=s.call(d,p)}catch(P){E=[6,P],u=0}finally{h=_=0}if(5&E[0])throw E[1];return{value:E[0]?E[1]:void 0,done:!0}}([T,g])}}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompressorImpl=void 0;var f=n(658),l=[0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15],x=function(){function d(){}return d.writeValueToData=function(s,h,u,_,i){if(u%4!=0||s.dataPosition+u>_-1)for(var p=0;p<u;p++)s.dataVal=s.dataVal<<1|1&h,s.dataPosition==_-1?(s.dataPosition=0,s.data.push(i(s.dataVal)),s.dataVal=0):s.dataPosition++,h>>=1;else s.dataVal<<=u,s.dataVal|=function(b,T){for(var g=0,E=0;E<T;++E)g<<=4,g|=l[15&b],b>>=4;return g}(h,u/4),s.dataPosition+=u},d.writeWToDataVal=function(s,h,u){s.dictionaryToCreate.has(s.w)?(s.w.charCodeAt(0)<256?(d.writeValueToData(s,0,s.numBits,h,u),d.writeValueToData(s,s.w.charCodeAt(0),8,h,u)):(d.writeValueToData(s,1,s.numBits,h,u),d.writeValueToData(s,s.w.charCodeAt(0),16,h,u)),s.enlargeIn--,s.enlargeIn==0&&(s.enlargeIn=Math.pow(2,s.numBits),s.numBits++),s.dictionaryToCreate.delete(s.w)):d.writeValueToData(s,s.dictionary.get(s.w),s.numBits,h,u),s.enlargeIn--,s.enlargeIn==0&&(s.enlargeIn=Math.pow(2,s.numBits),s.numBits++)},d.loopIteration=function(s,h,u,_,i){var p=s.charAt(h);i.dictionary.has(p)||(i.dictionary.set(p,i.dictSize++),i.dictionaryToCreate.set(p,!0));var b=i.w+p;i.dictionary.has(b)?i.w=b:(this.writeWToDataVal(i,u,_),i.dictionary.set(b,i.dictSize++),i.w=String(p))},d.prototype.compress=function(s,h,u){var _=this;return new Promise(function(i){return a(_,void 0,void 0,function(){var p,b;return c(this,function(T){switch(T.label){case 0:if(s==null)return i(""),[2];p={data:[],dataPosition:0,dataVal:0,dictionary:new Map,dictionaryToCreate:new Map,dictSize:3,enlargeIn:2,numBits:2,w:""},b=0,T.label=1;case 1:return b<s.length?(d.loopIteration(s,b,h,u,p),b%1e4!=0?[3,3]:[4,(0,f.wait)()]):[3,4];case 2:T.sent(),T.label=3;case 3:return b+=1,[3,1];case 4:return p.w!==""&&d.writeWToDataVal(p,h,u),d.writeValueToData(p,2,p.numBits,h,u),p.dataVal<<=h-p.dataPosition,p.data.push(u(p.dataVal)),i(p.data.join("")),[2]}})})})},d}();o.CompressorImpl=x},134:function(r,o,n){var a=this&&this.__awaiter||function(x,d,s,h){return new(s||(s=Promise))(function(u,_){function i(T){try{b(h.next(T))}catch(g){_(g)}}function p(T){try{b(h.throw(T))}catch(g){_(g)}}function b(T){var g;T.done?u(T.value):(g=T.value,g instanceof s?g:new s(function(E){E(g)})).then(i,p)}b((h=h.apply(x,d||[])).next())})},c=this&&this.__generator||function(x,d){var s,h,u,_,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return _={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(_[Symbol.iterator]=function(){return this}),_;function p(b){return function(T){return function(g){if(s)throw new TypeError("Generator is already executing.");for(;_&&(_=0,g[0]&&(i=0)),i;)try{if(s=1,h&&(u=2&g[0]?h.return:g[0]?h.throw||((u=h.return)&&u.call(h),0):h.next)&&!(u=u.call(h,g[1])).done)return u;switch(h=0,u&&(g=[2&g[0],u.value]),g[0]){case 0:case 1:u=g;break;case 4:return i.label++,{value:g[1],done:!1};case 5:i.label++,h=g[1],g=[0];continue;case 7:g=i.ops.pop(),i.trys.pop();continue;default:if(!((u=(u=i.trys).length>0&&u[u.length-1])||g[0]!==6&&g[0]!==2)){i=0;continue}if(g[0]===3&&(!u||g[1]>u[0]&&g[1]<u[3])){i.label=g[1];break}if(g[0]===6&&i.label<u[1]){i.label=u[1],u=g;break}if(u&&i.label<u[2]){i.label=u[2],i.ops.push(g);break}u[2]&&i.ops.pop(),i.trys.pop();continue}g=d.call(x,i)}catch(E){g=[6,E],h=0}finally{s=u=0}if(5&g[0])throw g[1];return{value:g[0]?g[1]:void 0,done:!0}}([b,T])}}};Object.defineProperty(o,"__esModule",{value:!0}),o.DecompressorImpl=void 0;var f=n(658),l=function(){function x(){}return x.prototype.decompress=function(d,s,h){var u=this;return new Promise(function(_){return a(u,void 0,void 0,function(){var i,p,b;return c(this,function(T){switch(T.label){case 0:for(i={bits:0,c:null,dataIndex:1,dataPosition:s,dataVal:h(0),dictionary:new Map,dictSize:4,enlargeIn:4,entry:"",maxPower:Math.pow(2,2),numBits:3,power:1,resb:null,result:[],w:null},p=0;p<3;p+=1)i.dictionary.set(p,p);for(;i.power!=i.maxPower;)i.resb=i.dataVal&i.dataPosition,i.dataPosition>>=1,i.dataPosition==0&&(i.dataPosition=s,i.dataVal=h(i.dataIndex++)),i.bits|=(i.resb>0?1:0)*i.power,i.power<<=1;switch(i.bits){case 0:for(i.bits=0,i.maxPower=Math.pow(2,8),i.power=1;i.power!=i.maxPower;)i.resb=i.dataVal&i.dataPosition,i.dataPosition>>=1,i.dataPosition==0&&(i.dataPosition=s,i.dataVal=h(i.dataIndex++)),i.bits|=(i.resb>0?1:0)*i.power,i.power<<=1;i.c=String.fromCharCode(i.bits);break;case 1:for(i.bits=0,i.maxPower=Math.pow(2,16),i.power=1;i.power!==i.maxPower;)i.resb=i.dataVal&i.dataPosition,i.dataPosition>>=1,i.dataPosition===0&&(i.dataPosition=s,i.dataVal=h(i.dataIndex++)),i.bits|=(i.resb>0?1:0)*i.power,i.power<<=1;i.c=String.fromCharCode(i.bits);break;case 2:return _(""),[2]}i.dictionary[3]=i.c,i.w=i.c,i.result.push(i.c),b=1,T.label=1;case 1:return b%2e4!=0?[3,3]:[4,(0,f.wait)()];case 2:T.sent(),T.label=3;case 3:if(i.dataIndex>d)return _(""),[2];for(i.bits=0,i.maxPower=Math.pow(2,i.numBits),i.power=1;i.power!=i.maxPower;)i.resb=i.dataVal&i.dataPosition,i.dataPosition>>=1,i.dataPosition==0&&(i.dataPosition=s,i.dataVal=h(i.dataIndex++)),i.bits|=(i.resb>0?1:0)*i.power,i.power<<=1;switch(i.c=i.bits){case 0:for(i.bits=0,i.maxPower=Math.pow(2,8),i.power=1;i.power!==i.maxPower;)i.resb=i.dataVal&i.dataPosition,i.dataPosition>>=1,i.dataPosition==0&&(i.dataPosition=s,i.dataVal=h(i.dataIndex++)),i.bits|=(i.resb>0?1:0)*i.power,i.power<<=1;i.dictionary[i.dictSize++]=String.fromCharCode(i.bits),i.c=i.dictSize-1,i.enlargeIn--;break;case 1:for(i.bits=0,i.maxPower=Math.pow(2,16),i.power=1;i.power!==i.maxPower;)i.resb=i.dataVal&i.dataPosition,i.dataPosition>>=1,i.dataPosition==0&&(i.dataPosition=s,i.dataVal=h(i.dataIndex++)),i.bits|=(i.resb>0?1:0)*i.power,i.power<<=1;i.dictionary[i.dictSize++]=String.fromCharCode(i.bits),i.c=i.dictSize-1,i.enlargeIn--;break;case 2:return _(i.result.join("")),[2]}if(i.enlargeIn==0&&(i.enlargeIn=Math.pow(2,i.numBits),i.numBits++),i.dictionary[i.c])i.entry=i.dictionary[i.c];else{if(i.c!==i.dictSize)return _(null),[2];i.entry=i.w+i.w.charAt(0)}return i.result.push(i.entry),i.dictionary[i.dictSize++]=i.w+i.entry.charAt(0),i.enlargeIn--,i.w=i.entry,i.enlargeIn==0&&(i.enlargeIn=Math.pow(2,i.numBits),i.numBits++),b++,[3,1];case 4:return[2]}})})})},x}();o.DecompressorImpl=l},658:function(r,o){var n=this&&this.__awaiter||function(c,f,l,x){return new(l||(l=Promise))(function(d,s){function h(i){try{_(x.next(i))}catch(p){s(p)}}function u(i){try{_(x.throw(i))}catch(p){s(p)}}function _(i){var p;i.done?d(i.value):(p=i.value,p instanceof l?p:new l(function(b){b(p)})).then(h,u)}_((x=x.apply(c,f||[])).next())})},a=this&&this.__generator||function(c,f){var l,x,d,s,h={label:0,sent:function(){if(1&d[0])throw d[1];return d[1]},trys:[],ops:[]};return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(_){return function(i){return function(p){if(l)throw new TypeError("Generator is already executing.");for(;s&&(s=0,p[0]&&(h=0)),h;)try{if(l=1,x&&(d=2&p[0]?x.return:p[0]?x.throw||((d=x.return)&&d.call(x),0):x.next)&&!(d=d.call(x,p[1])).done)return d;switch(x=0,d&&(p=[2&p[0],d.value]),p[0]){case 0:case 1:d=p;break;case 4:return h.label++,{value:p[1],done:!1};case 5:h.label++,x=p[1],p=[0];continue;case 7:p=h.ops.pop(),h.trys.pop();continue;default:if(!((d=(d=h.trys).length>0&&d[d.length-1])||p[0]!==6&&p[0]!==2)){h=0;continue}if(p[0]===3&&(!d||p[1]>d[0]&&p[1]<d[3])){h.label=p[1];break}if(p[0]===6&&h.label<d[1]){h.label=d[1],d=p;break}if(d&&h.label<d[2]){h.label=d[2],h.ops.push(p);break}d[2]&&h.ops.pop(),h.trys.pop();continue}p=f.call(c,h)}catch(b){p=[6,b],x=0}finally{l=d=0}if(5&p[0])throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}([_,i])}}};Object.defineProperty(o,"__esModule",{value:!0}),o.wait=void 0,o.wait=function(){return n(this,void 0,void 0,function(){return a(this,function(c){return[2,new Promise(function(f){setTimeout(f,0)})]})})}}},t={};return function r(o){var n=t[o];if(n!==void 0)return n.exports;var a=t[o]={exports:{}};return e[o].call(a.exports,a,a.exports,r),a.exports}(48)})())});var nt=Xt(($n,Ce)=>{"use strict";(function(){"use strict";var e="input is invalid type",t=typeof window=="object",r=t?window:{};r.JS_SHA256_NO_WINDOW&&(t=!1);var o=!t&&typeof self=="object",n=!r.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;n?r=global:o&&(r=self);var a=!r.JS_SHA256_NO_COMMON_JS&&typeof Ce=="object"&&Ce.exports,c=typeof define=="function"&&define.amd,f=!r.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",l="0123456789abcdef".split(""),x=[-2147483648,8388608,32768,128],d=[24,16,8,0],s=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],h=["hex","array","digest","arrayBuffer"],u=[];(r.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(m){return Object.prototype.toString.call(m)==="[object Array]"}),f&&(r.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(m){return typeof m=="object"&&m.buffer&&m.buffer.constructor===ArrayBuffer});var _=function(m,y){return function(F){return new g(y,!0).update(F)[m]()}},i=function(m){var y=_("hex",m);n&&(y=p(y,m)),y.create=function(){return new g(m)},y.update=function(I){return y.create().update(I)};for(var F=0;F<h.length;++F){var S=h[F];y[S]=_(S,m)}return y},p=function(m,y){var F=Gt("crypto"),S=Gt("buffer").Buffer,I=y?"sha224":"sha256",w;S.from&&!r.JS_SHA256_NO_BUFFER_FROM?w=S.from:w=function(v){return new S(v)};var C=function(v){if(typeof v=="string")return F.createHash(I).update(v,"utf8").digest("hex");if(v==null)throw new Error(e);return v.constructor===ArrayBuffer&&(v=new Uint8Array(v)),Array.isArray(v)||ArrayBuffer.isView(v)||v.constructor===S?F.createHash(I).update(w(v)).digest("hex"):m(v)};return C},b=function(m,y){return function(F,S){return new E(F,y,!0).update(S)[m]()}},T=function(m){var y=b("hex",m);y.create=function(I){return new E(I,m)},y.update=function(I,w){return y.create(I).update(w)};for(var F=0;F<h.length;++F){var S=h[F];y[S]=b(S,m)}return y};function g(m,y){y?(u[0]=u[16]=u[1]=u[2]=u[3]=u[4]=u[5]=u[6]=u[7]=u[8]=u[9]=u[10]=u[11]=u[12]=u[13]=u[14]=u[15]=0,this.blocks=u):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],m?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=m}g.prototype.update=function(m){if(!this.finalized){var y,F=typeof m;if(F!=="string"){if(F==="object"){if(m===null)throw new Error(e);if(f&&m.constructor===ArrayBuffer)m=new Uint8Array(m);else if(!Array.isArray(m)&&(!f||!ArrayBuffer.isView(m)))throw new Error(e)}else throw new Error(e);y=!0}for(var S,I=0,w,C=m.length,v=this.blocks;I<C;){if(this.hashed&&(this.hashed=!1,v[0]=this.block,this.block=v[16]=v[1]=v[2]=v[3]=v[4]=v[5]=v[6]=v[7]=v[8]=v[9]=v[10]=v[11]=v[12]=v[13]=v[14]=v[15]=0),y)for(w=this.start;I<C&&w<64;++I)v[w>>>2]|=m[I]<<d[w++&3];else for(w=this.start;I<C&&w<64;++I)S=m.charCodeAt(I),S<128?v[w>>>2]|=S<<d[w++&3]:S<2048?(v[w>>>2]|=(192|S>>>6)<<d[w++&3],v[w>>>2]|=(128|S&63)<<d[w++&3]):S<55296||S>=57344?(v[w>>>2]|=(224|S>>>12)<<d[w++&3],v[w>>>2]|=(128|S>>>6&63)<<d[w++&3],v[w>>>2]|=(128|S&63)<<d[w++&3]):(S=65536+((S&1023)<<10|m.charCodeAt(++I)&1023),v[w>>>2]|=(240|S>>>18)<<d[w++&3],v[w>>>2]|=(128|S>>>12&63)<<d[w++&3],v[w>>>2]|=(128|S>>>6&63)<<d[w++&3],v[w>>>2]|=(128|S&63)<<d[w++&3]);this.lastByteIndex=w,this.bytes+=w-this.start,w>=64?(this.block=v[16],this.start=w-64,this.hash(),this.hashed=!0):this.start=w}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},g.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var m=this.blocks,y=this.lastByteIndex;m[16]=this.block,m[y>>>2]|=x[y&3],this.block=m[16],y>=56&&(this.hashed||this.hash(),m[0]=this.block,m[16]=m[1]=m[2]=m[3]=m[4]=m[5]=m[6]=m[7]=m[8]=m[9]=m[10]=m[11]=m[12]=m[13]=m[14]=m[15]=0),m[14]=this.hBytes<<3|this.bytes>>>29,m[15]=this.bytes<<3,this.hash()}},g.prototype.hash=function(){var m=this.h0,y=this.h1,F=this.h2,S=this.h3,I=this.h4,w=this.h5,C=this.h6,v=this.h7,A=this.blocks,R,N,O,q,k,K,J,ae,et,tt,Te;for(R=16;R<64;++R)k=A[R-15],N=(k>>>7|k<<25)^(k>>>18|k<<14)^k>>>3,k=A[R-2],O=(k>>>17|k<<15)^(k>>>19|k<<13)^k>>>10,A[R]=A[R-16]+N+A[R-7]+O<<0;for(Te=y&F,R=0;R<64;R+=4)this.first?(this.is224?(ae=300032,k=A[0]-1413257819,v=k-150054599<<0,S=k+24177077<<0):(ae=704751109,k=A[0]-210244248,v=k-1521486534<<0,S=k+143694565<<0),this.first=!1):(N=(m>>>2|m<<30)^(m>>>13|m<<19)^(m>>>22|m<<10),O=(I>>>6|I<<26)^(I>>>11|I<<21)^(I>>>25|I<<7),ae=m&y,q=ae^m&F^Te,J=I&w^~I&C,k=v+O+J+s[R]+A[R],K=N+q,v=S+k<<0,S=k+K<<0),N=(S>>>2|S<<30)^(S>>>13|S<<19)^(S>>>22|S<<10),O=(v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7),et=S&m,q=et^S&y^ae,J=v&I^~v&w,k=C+O+J+s[R+1]+A[R+1],K=N+q,C=F+k<<0,F=k+K<<0,N=(F>>>2|F<<30)^(F>>>13|F<<19)^(F>>>22|F<<10),O=(C>>>6|C<<26)^(C>>>11|C<<21)^(C>>>25|C<<7),tt=F&S,q=tt^F&m^et,J=C&v^~C&I,k=w+O+J+s[R+2]+A[R+2],K=N+q,w=y+k<<0,y=k+K<<0,N=(y>>>2|y<<30)^(y>>>13|y<<19)^(y>>>22|y<<10),O=(w>>>6|w<<26)^(w>>>11|w<<21)^(w>>>25|w<<7),Te=y&F,q=Te^y&S^tt,J=w&C^~w&v,k=I+O+J+s[R+3]+A[R+3],K=N+q,I=m+k<<0,m=k+K<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+m<<0,this.h1=this.h1+y<<0,this.h2=this.h2+F<<0,this.h3=this.h3+S<<0,this.h4=this.h4+I<<0,this.h5=this.h5+w<<0,this.h6=this.h6+C<<0,this.h7=this.h7+v<<0},g.prototype.hex=function(){this.finalize();var m=this.h0,y=this.h1,F=this.h2,S=this.h3,I=this.h4,w=this.h5,C=this.h6,v=this.h7,A=l[m>>>28&15]+l[m>>>24&15]+l[m>>>20&15]+l[m>>>16&15]+l[m>>>12&15]+l[m>>>8&15]+l[m>>>4&15]+l[m&15]+l[y>>>28&15]+l[y>>>24&15]+l[y>>>20&15]+l[y>>>16&15]+l[y>>>12&15]+l[y>>>8&15]+l[y>>>4&15]+l[y&15]+l[F>>>28&15]+l[F>>>24&15]+l[F>>>20&15]+l[F>>>16&15]+l[F>>>12&15]+l[F>>>8&15]+l[F>>>4&15]+l[F&15]+l[S>>>28&15]+l[S>>>24&15]+l[S>>>20&15]+l[S>>>16&15]+l[S>>>12&15]+l[S>>>8&15]+l[S>>>4&15]+l[S&15]+l[I>>>28&15]+l[I>>>24&15]+l[I>>>20&15]+l[I>>>16&15]+l[I>>>12&15]+l[I>>>8&15]+l[I>>>4&15]+l[I&15]+l[w>>>28&15]+l[w>>>24&15]+l[w>>>20&15]+l[w>>>16&15]+l[w>>>12&15]+l[w>>>8&15]+l[w>>>4&15]+l[w&15]+l[C>>>28&15]+l[C>>>24&15]+l[C>>>20&15]+l[C>>>16&15]+l[C>>>12&15]+l[C>>>8&15]+l[C>>>4&15]+l[C&15];return this.is224||(A+=l[v>>>28&15]+l[v>>>24&15]+l[v>>>20&15]+l[v>>>16&15]+l[v>>>12&15]+l[v>>>8&15]+l[v>>>4&15]+l[v&15]),A},g.prototype.toString=g.prototype.hex,g.prototype.digest=function(){this.finalize();var m=this.h0,y=this.h1,F=this.h2,S=this.h3,I=this.h4,w=this.h5,C=this.h6,v=this.h7,A=[m>>>24&255,m>>>16&255,m>>>8&255,m&255,y>>>24&255,y>>>16&255,y>>>8&255,y&255,F>>>24&255,F>>>16&255,F>>>8&255,F&255,S>>>24&255,S>>>16&255,S>>>8&255,S&255,I>>>24&255,I>>>16&255,I>>>8&255,I&255,w>>>24&255,w>>>16&255,w>>>8&255,w&255,C>>>24&255,C>>>16&255,C>>>8&255,C&255];return this.is224||A.push(v>>>24&255,v>>>16&255,v>>>8&255,v&255),A},g.prototype.array=g.prototype.digest,g.prototype.arrayBuffer=function(){this.finalize();var m=new ArrayBuffer(this.is224?28:32),y=new DataView(m);return y.setUint32(0,this.h0),y.setUint32(4,this.h1),y.setUint32(8,this.h2),y.setUint32(12,this.h3),y.setUint32(16,this.h4),y.setUint32(20,this.h5),y.setUint32(24,this.h6),this.is224||y.setUint32(28,this.h7),m};function E(m,y,F){var S,I=typeof m;if(I==="string"){var w=[],C=m.length,v=0,A;for(S=0;S<C;++S)A=m.charCodeAt(S),A<128?w[v++]=A:A<2048?(w[v++]=192|A>>>6,w[v++]=128|A&63):A<55296||A>=57344?(w[v++]=224|A>>>12,w[v++]=128|A>>>6&63,w[v++]=128|A&63):(A=65536+((A&1023)<<10|m.charCodeAt(++S)&1023),w[v++]=240|A>>>18,w[v++]=128|A>>>12&63,w[v++]=128|A>>>6&63,w[v++]=128|A&63);m=w}else if(I==="object"){if(m===null)throw new Error(e);if(f&&m.constructor===ArrayBuffer)m=new Uint8Array(m);else if(!Array.isArray(m)&&(!f||!ArrayBuffer.isView(m)))throw new Error(e)}else throw new Error(e);m.length>64&&(m=new g(y,!0).update(m).array());var R=[],N=[];for(S=0;S<64;++S){var O=m[S]||0;R[S]=92^O,N[S]=54^O}g.call(this,y,F),this.update(N),this.oKeyPad=R,this.inner=!0,this.sharedMemory=F}E.prototype=new g,E.prototype.finalize=function(){if(g.prototype.finalize.call(this),this.inner){this.inner=!1;var m=this.array();g.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(m),g.prototype.finalize.call(this)}};var P=i();P.sha256=P,P.sha224=i(!0),P.sha256.hmac=T(),P.sha224.hmac=T(!0),a?Ce.exports=P:(r.sha256=P.sha256,r.sha224=P.sha224,c&&define(function(){return P}))})()});function oe(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}var Pe=B(()=>{"use strict"});function ut(e){return oe(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}var sr=B(()=>{"use strict";Pe()});var pt,cr=B(()=>{"use strict";pt="2.21.54"});function lr(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?lr(e.cause,t):t?null:e}var ft,z,ue=B(()=>{"use strict";cr();ft={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:r})=>t?`${e??"https://viem.sh"}${t}${r?`#${r}`:""}`:void 0,version:`viem@${pt}`},z=class e extends Error{constructor(t,r={}){let o=r.cause instanceof e?r.cause.details:r.cause?.message?r.cause.message:r.details,n=r.cause instanceof e&&r.cause.docsPath||r.docsPath,a=ft.getDocsUrl?.({...r,docsPath:n}),c=[t||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...o?[`Details: ${o}`]:[],...ft.version?[`Version: ${ft.version}`]:[]].join(`
|
|
2
|
+
`);super(c,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=o,this.docsPath=n,this.metaMessages=r.metaMessages,this.name=r.name??this.name,this.shortMessage=t,this.version=pt}walk(t){return lr(this,t)}}});var pe,ur=B(()=>{"use strict";ue();pe=class extends z{constructor({size:t,targetSize:r,type:o}){super(`${o.charAt(0).toUpperCase()}${o.slice(1).toLowerCase()} size (${t}) exceeds padding size (${r}).`,{name:"SizeExceedsPaddingSizeError"})}}});function V(e,{dir:t,size:r=32}={}){return typeof e=="string"?pr(e,{dir:t,size:r}):fr(e,{dir:t,size:r})}function pr(e,{dir:t,size:r=32}={}){if(r===null)return e;let o=e.replace("0x","");if(o.length>r*2)throw new pe({size:Math.ceil(o.length/2),targetSize:r,type:"hex"});return`0x${o[t==="right"?"padEnd":"padStart"](r*2,"0")}`}function fr(e,{dir:t,size:r=32}={}){if(r===null)return e;if(e.length>r)throw new pe({size:e.length,targetSize:r,type:"bytes"});let o=new Uint8Array(r);for(let n=0;n<r;n++){let a=t==="right";o[a?n:r-n-1]=e[a?n:e.length-n-1]}return o}var Re=B(()=>{"use strict";ur()});var Be,He,dt=B(()=>{"use strict";ue();Be=class extends z{constructor({max:t,min:r,signed:o,size:n,value:a}){super(`Number "${a}" is not in safe ${n?`${n*8}-bit ${o?"signed":"unsigned"} `:""}integer range ${t?`(${r} to ${t})`:`(above ${r})`}`,{name:"IntegerOutOfRangeError"})}},He=class extends z{constructor({givenSize:t,maxSize:r}){super(`Size cannot exceed ${r} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}}});function Y(e,{size:t}){if(ut(e)>t)throw new He({givenSize:ut(e),maxSize:t})}var mt=B(()=>{"use strict";dt();sr()});function G(e,t={}){return typeof e=="number"||typeof e=="bigint"?Le(e,t):typeof e=="string"?mr(e,t):typeof e=="boolean"?dr(e,t):fe(e,t)}function dr(e,t={}){let r=`0x${Number(e)}`;return typeof t.size=="number"?(Y(r,{size:t.size}),V(r,{size:t.size})):r}function fe(e,t={}){let r="";for(let n=0;n<e.length;n++)r+=jo[e[n]];let o=`0x${r}`;return typeof t.size=="number"?(Y(o,{size:t.size}),V(o,{dir:"right",size:t.size})):o}function Le(e,t={}){let{signed:r,size:o}=t,n=BigInt(e),a;o?r?a=(1n<<BigInt(o)*8n-1n)-1n:a=2n**(BigInt(o)*8n)-1n:typeof e=="number"&&(a=BigInt(Number.MAX_SAFE_INTEGER));let c=typeof a=="bigint"&&r?-a-1n:0;if(a&&n>a||n<c){let l=typeof e=="bigint"?"n":"";throw new Be({max:a?`${a}${l}`:void 0,min:`${c}${l}`,signed:r,size:o,value:`${e}${l}`})}let f=`0x${(r&&n<0?(1n<<BigInt(o*8))+BigInt(n):n).toString(16)}`;return o?V(f,{size:o}):f}function mr(e,t={}){let r=qo.encode(e);return fe(r,t)}var jo,qo,Ue=B(()=>{"use strict";dt();Re();mt();jo=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));qo=new TextEncoder});function ht(e,t={}){return typeof e=="number"||typeof e=="bigint"?yr(e,t):typeof e=="boolean"?xr(e,t):oe(e)?de(e,t):De(e,t)}function xr(e,t={}){let r=new Uint8Array(1);return r[0]=Number(e),typeof t.size=="number"?(Y(r,{size:t.size}),V(r,{size:t.size})):r}function hr(e){if(e>=W.zero&&e<=W.nine)return e-W.zero;if(e>=W.A&&e<=W.F)return e-(W.A-10);if(e>=W.a&&e<=W.f)return e-(W.a-10)}function de(e,t={}){let r=e;t.size&&(Y(r,{size:t.size}),r=V(r,{dir:"right",size:t.size}));let o=r.slice(2);o.length%2&&(o=`0${o}`);let n=o.length/2,a=new Uint8Array(n);for(let c=0,f=0;c<n;c++){let l=hr(o.charCodeAt(f++)),x=hr(o.charCodeAt(f++));if(l===void 0||x===void 0)throw new z(`Invalid byte sequence ("${o[f-2]}${o[f-1]}" in "${o}").`);a[c]=l*16+x}return a}function yr(e,t){let r=Le(e,t);return de(r)}function De(e,t={}){let r=Ko.encode(e);return typeof t.size=="number"?(Y(r,{size:t.size}),V(r,{dir:"right",size:t.size})):r}var Ko,W,Ne=B(()=>{"use strict";ue();Pe();Re();mt();Ue();Ko=new TextEncoder;W={zero:48,nine:57,A:65,F:70,a:97,f:102}});function xt(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Jo(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function me(e,...t){if(!Jo(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function yt(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function _r(e,t){me(e);let r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}var _t=B(()=>{"use strict"});function Go(e,t=!1){return t?{h:Number(e&Oe),l:Number(e>>gr&Oe)}:{h:Number(e>>gr&Oe)|0,l:Number(e&Oe)|0}}function br(e,t=!1){let r=new Uint32Array(e.length),o=new Uint32Array(e.length);for(let n=0;n<e.length;n++){let{h:a,l:c}=Go(e[n],t);[r[n],o[n]]=[a,c]}return[r,o]}var Oe,gr,wr,vr,Sr,Tr,Er=B(()=>{"use strict";Oe=BigInt(4294967295),gr=BigInt(32);wr=(e,t,r)=>e<<r|t>>>32-r,vr=(e,t,r)=>t<<r|e>>>32-r,Sr=(e,t,r)=>t<<r-32|e>>>64-r,Tr=(e,t,r)=>e<<r-32|t>>>64-r});function bt(e){for(let t=0;t<e.length;t++)e[t]=Xo(e[t])}function Yo(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function Ve(e){return typeof e=="string"&&(e=Yo(e)),me(e),e}function Ir(e){let t=o=>e().update(Ve(o)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function Cr(e){let t=(o,n)=>e(n).update(Ve(o)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=o=>e(o),t}var Fr,gt,Xo,ze,Ar=B(()=>{"use strict";_t();Fr=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),gt=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,Xo=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255;ze=class{clone(){return this._cloneInto()}}});function an(e,t=24){let r=new Uint32Array(10);for(let o=24-t;o<24;o++){for(let c=0;c<10;c++)r[c]=e[c]^e[c+10]^e[c+20]^e[c+30]^e[c+40];for(let c=0;c<10;c+=2){let f=(c+8)%10,l=(c+2)%10,x=r[l],d=r[l+1],s=kr(x,d,1)^r[f],h=Mr(x,d,1)^r[f+1];for(let u=0;u<50;u+=10)e[c+u]^=s,e[c+u+1]^=h}let n=e[2],a=e[3];for(let c=0;c<24;c++){let f=Rr[c],l=kr(n,a,f),x=Mr(n,a,f),d=Pr[c];n=e[d],a=e[d+1],e[d]=l,e[d+1]=x}for(let c=0;c<50;c+=10){for(let f=0;f<10;f++)r[f]=e[c+f];for(let f=0;f<10;f++)e[c+f]^=~r[(f+2)%10]&r[(f+4)%10]}e[0]^=on[o],e[1]^=nn[o]}r.fill(0)}var Pr,Rr,Br,Zo,he,Qo,en,tn,rn,on,nn,kr,Mr,$e,X,Zi,Qi,ea,ta,ra,Hr,oa,na,Lr,ia,aa,Ur=B(()=>{"use strict";_t();Er();Ar();Pr=[],Rr=[],Br=[],Zo=BigInt(0),he=BigInt(1),Qo=BigInt(2),en=BigInt(7),tn=BigInt(256),rn=BigInt(113);for(let e=0,t=he,r=1,o=0;e<24;e++){[r,o]=[o,(2*r+3*o)%5],Pr.push(2*(5*o+r)),Rr.push((e+1)*(e+2)/2%64);let n=Zo;for(let a=0;a<7;a++)t=(t<<he^(t>>en)*rn)%tn,t&Qo&&(n^=he<<(he<<BigInt(a))-he);Br.push(n)}[on,nn]=br(Br,!0),kr=(e,t,r)=>r>32?Sr(e,t,r):wr(e,t,r),Mr=(e,t,r)=>r>32?Tr(e,t,r):vr(e,t,r);$e=class e extends ze{constructor(t,r,o,n=!1,a=24){if(super(),this.blockLen=t,this.suffix=r,this.outputLen=o,this.enableXOF=n,this.rounds=a,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,xt(o),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Fr(this.state)}keccak(){gt||bt(this.state32),an(this.state32,this.rounds),gt||bt(this.state32),this.posOut=0,this.pos=0}update(t){yt(this);let{blockLen:r,state:o}=this;t=Ve(t);let n=t.length;for(let a=0;a<n;){let c=Math.min(r-this.pos,n-a);for(let f=0;f<c;f++)o[this.pos++]^=t[a++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:r,pos:o,blockLen:n}=this;t[o]^=r,r&128&&o===n-1&&this.keccak(),t[n-1]^=128,this.keccak()}writeInto(t){yt(this,!1),me(t),this.finish();let r=this.state,{blockLen:o}=this;for(let n=0,a=t.length;n<a;){this.posOut>=o&&this.keccak();let c=Math.min(o-this.posOut,a-n);t.set(r.subarray(this.posOut,this.posOut+c),n),this.posOut+=c,n+=c}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return xt(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(_r(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){let{blockLen:r,suffix:o,outputLen:n,rounds:a,enableXOF:c}=this;return t||(t=new e(r,o,n,c,a)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=a,t.suffix=o,t.outputLen=n,t.enableXOF=c,t.destroyed=this.destroyed,t}},X=(e,t,r)=>Ir(()=>new $e(t,e,r)),Zi=X(6,144,224/8),Qi=X(6,136,256/8),ea=X(6,104,384/8),ta=X(6,72,512/8),ra=X(1,144,224/8),Hr=X(1,136,256/8),oa=X(1,104,384/8),na=X(1,72,512/8),Lr=(e,t,r)=>Cr((o={})=>new $e(t,e,o.dkLen===void 0?r:o.dkLen,!0)),ia=Lr(31,168,128/8),aa=Lr(31,136,256/8)});function xe(e,t){let r=t||"hex",o=Hr(oe(e,{strict:!1})?ht(e):e);return r==="bytes"?o:G(o)}var wt=B(()=>{"use strict";Ur();Pe();Ne();Ue()});var ye,Dr=B(()=>{"use strict";ue();ye=class extends z{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}});var ne,vt=B(()=>{"use strict";ne=class extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){let r=super.get(t);return super.has(t)&&r!==void 0&&(this.delete(t),super.set(t,r)),r}set(t,r){if(super.set(t,r),this.maxSize&&this.size>this.maxSize){let o=this.keys().next().value;o&&this.delete(o)}return this}}});function Nr(e,t){if(St.has(`${e}.${t}`))return St.get(`${e}.${t}`);let r=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),o=xe(De(r),"bytes"),n=(t?r.substring(`${t}0x`.length):r).split("");for(let c=0;c<40;c+=2)o[c>>1]>>4>=8&&n[c]&&(n[c]=n[c].toUpperCase()),(o[c>>1]&15)>=8&&n[c+1]&&(n[c+1]=n[c+1].toUpperCase());let a=`0x${n.join("")}`;return St.set(`${e}.${t}`,a),a}var St,Or=B(()=>{"use strict";Ne();wt();vt();St=new ne(8192)});function Et(e,t){let{strict:r=!0}=t??{},o=`${e}.${r}`;if(Tt.has(o))return Tt.get(o);let n=sn.test(e)?e.toLowerCase()===e?!0:r?Nr(e)===e:!0:!1;return Tt.set(o,n),n}var sn,Tt,zr=B(()=>{"use strict";vt();Or();sn=/^0x[a-fA-F0-9]{40}$/,Tt=new ne(8192)});function We(e){return`0x${e.reduce((t,r)=>t+r.replace("0x",""),"")}`}var Vr=B(()=>{"use strict"});function Ft(e,t){if(!Et(e,{strict:!1}))throw new ye({address:e});if(!Et(t,{strict:!1}))throw new ye({address:t});return e.toLowerCase()===t.toLowerCase()}var $r=B(()=>{"use strict";Dr();zr()});var Hn={};Oo(Hn,{ButtonShare:()=>Qe});function Zt(e){document.readyState==="complete"||document.readyState==="interactive"?setTimeout(e,1):document.addEventListener?document.addEventListener("DOMContentLoaded",e):document.attachEvent("onreadystatechange",()=>{document.readyState==="complete"&&e()})}var U=class extends Error{constructor(r,o,n){super(o);this.code=r;this.data=n}};var Ie=class extends U{constructor(t){super(D.internalError,t)}};var D={parseError:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internalError:-32603,serverError:-32e3,clientNotConnected:-32001,configError:-32002,corruptedResponse:-32003,clientAborted:-32004,walletNotConnected:-32005,serverErrorForInteractionDelegation:-32006};var $=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((t,r)=>{this._resolve=t,this._reject=r})}get promise(){return this._promise}resolve=t=>{this._resolve?.(t)};reject=t=>{this._reject?.(t)}};var Vo=(e="button[data-frak-share-button], #nexus-share-button > button")=>document.querySelectorAll(e),$o=(e,t)=>{if(e){t?.removeAttribute("disabled");return}t?.setAttribute("disabled","")},Qt=e=>t=>{let r=Array.from(Vo(t?.metadata?.buttonShare));for(let o of r)$o(e,o)},er=Qt(!0),tr=Qt(!1);var rr=Fe(ot(),1),it=Fe(nt(),1);async function ce(e){let t=(0,it.sha256)(JSON.stringify(e)),r={...e,validationHash:t},o=await at(r),n=(0,it.sha256)(o);return{compressed:o,compressedHash:n}}async function at(e){return(0,rr.compressToBase64)(JSON.stringify(e))}var or=Fe(ot(),1),st=Fe(nt(),1);async function le(e){if(!(e?.compressed&&e?.compressedHash))throw new U(D.corruptedResponse,"Missing compressed data");let t=await ct(e.compressed);if(!t)throw new U(D.corruptedResponse,"Invalid compressed data");if(!t?.validationHash)throw new U(D.corruptedResponse,"Missing validation hash");if((0,st.sha256)(e.compressed)!==e.compressedHash)throw new U(D.corruptedResponse,"Invalid compressed hash");let{validationHash:o,...n}=t;if((0,st.sha256)(JSON.stringify(n))!==t.validationHash)throw new U(D.corruptedResponse,"Invalid data validation hash");return t}async function ct(e){let t=await(0,or.decompressFromBase64)(e);try{return JSON.parse(t)}catch(r){return console.error("Invalid compressed data",{e:r,decompressed:t}),null}}var re="nexus-wallet-backup";function nr(){let e=new Map;return{createChannel:t=>{let r=Math.random().toString(36).substring(7);return e.set(r,t),r},getRpcResolver:t=>e.get(t),removeChannel:t=>e.delete(t),destroy:()=>e.clear()}}var Ae={id:"nexus-wallet",name:"nexus-wallet",allow:"publickey-credentials-get *; clipboard-write; web-share *",style:{width:"0",height:"0",border:"0",position:"absolute",zIndex:1e3,top:"-1000px",left:"-1000px"}};function ke({walletBaseUrl:e,config:t}){tr(t);let r=document.querySelector("#nexus-wallet");r&&r.remove();let o=document.createElement("iframe");return o.id=Ae.id,o.name=Ae.name,o.allow=Ae.allow,o.style.zIndex=Ae.style.zIndex.toString(),lt({iframe:o,isVisible:!1}),document.body.appendChild(o),new Promise(n=>{o?.addEventListener("load",()=>n(o)),o.src=`${e??t?.walletUrl??"https://wallet.frak.id"}/listener`})}function lt({iframe:e,isVisible:t}){if(!t){e.style.width="0",e.style.height="0",e.style.border="0",e.style.position="fixed",e.style.top="-1000px",e.style.left="-1000px";return}e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="100%",e.style.pointerEvents="auto"}function ir({iframe:e}){let t=new $;return{handleEvent:async o=>{switch(o.iframeLifecycle){case"connected":t.resolve(!0);break;case"do-backup":o.data.backup?localStorage.setItem(re,o.data.backup):localStorage.removeItem(re);break;case"remove-backup":localStorage.removeItem(re);break;case"show":case"hide":lt({iframe:e,isVisible:o.iframeLifecycle==="show"});break}},isConnected:t.promise}}function ar({nexusWalletUrl:e,iframe:t,channelManager:r,iframeLifecycleManager:o}){if(typeof window>"u")throw new U(D.configError,"iframe client should be used in the browser");if(!t.contentWindow)throw new U(D.configError,"The iframe does not have a product window");let n=t.contentWindow,a=async l=>{if(!(l.origin&&URL.canParse(l.origin))||new URL(l.origin).origin.toLowerCase()!==new URL(e).origin.toLowerCase())return;if("iframeLifecycle"in l.data){await o.handleEvent(l.data);return}if("clientLifecycle"in l.data){console.error("Client lifecycle event received on the client side, dismissing it");return}let x=l.data.id,d=r.getRpcResolver(x);d&&await d(l.data)};return window.addEventListener("message",a),{sendEvent:l=>{n.postMessage(l,{targetOrigin:e})},cleanup:()=>{window.removeEventListener("message",a)}}}function Me({config:e,iframe:t}){let r=nr(),o=ir({iframe:t}),n=ar({nexusWalletUrl:e?.walletUrl??"https://wallet.frak.id",iframe:t,channelManager:r,iframeLifecycleManager:o}),a=async x=>{if(!await o.isConnected)throw new U(D.clientNotConnected,"The iframe provider isn't connected yet");let s=new $,h=r.createChannel(async _=>{let i=await le(_.data);i.error?s.reject(new U(i.error.code,i.error.message,i.error?.data)):s.resolve(i.result),r.removeChannel(h)}),u=await ce(x);return n.sendEvent({id:h,topic:x.method,data:u}),s.promise},c=async(x,d)=>{if(!await o.isConnected)throw new U(D.clientNotConnected,"The iframe provider isn't connected yet");let h=r.createChannel(async _=>{let i=await le(_.data);if(i.result)d(i.result);else throw new Ie("No valid result in the response")}),u=await ce(x);n.sendEvent({id:h,topic:x.method,data:u})},f=async()=>{r.destroy(),n.cleanup(),t.remove()},l=Wo({config:e,messageHandler:n,lifecycleManager:o});return{config:e,waitForConnection:o.isConnected,waitForSetup:l,request:a,listenerRequest:c,destroy:f}}async function Wo({config:e,messageHandler:t,lifecycleManager:r}){await r.isConnected,er(e);let o=async()=>{let a=e.metadata.css;a&&t.sendEvent({clientLifecycle:"modal-css",data:{cssLink:a}})},n=async()=>{if(typeof window>"u")return;let a=window.localStorage.getItem(re);a&&t.sendEvent({clientLifecycle:"restore-backup",data:{backup:a}})};await Promise.all([o(),n()])}Ne();Ue();Vr();$r();wt();Re();var It="fCtx";function cn(e){return btoa(Array.from(e,t=>String.fromCharCode(t)).join("")).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function ln(e){let t=e.length%4;return Uint8Array.from(atob(e.replace(/-/g,"+").replace(/_/g,"/").padEnd(e.length+(t===0?0:4-t),"=")),r=>r.charCodeAt(0))}function Wr(e){if(e?.r)try{let t=de(e.r);return cn(t)}catch(t){console.error("Error compressing Frak context",{e:t,context:e})}}function jr(e){if(!(!e||e.length===0))try{let t=ln(e);return{r:fe(t,{size:20})}}catch(t){console.error("Error decompressing Frak context",{e:t,context:e})}}function qr({url:e}){if(!e)return null;let r=new URL(e).searchParams.get(It);return r?jr(r):null}function Kr({url:e,context:t}){if(!e)return null;let r=qr({url:e}),o=r?{...r,...t}:t;if(!o.r)return null;let n=Wr(o);if(!n)return null;let a=new URL(e);return a.searchParams.set(It,n),a.toString()}function Jr(e){let t=new URL(e);return t.searchParams.delete(It),t.toString()}function un({url:e,context:t}){if(!window.location?.href||typeof window>"u"){console.error("No window found, can't update context");return}let r=e??window.location.href,o;t!==null?o=Kr({url:r,context:t}):o=Jr(r),o&&window.history.replaceState(null,"",o.toString())}var Z={compress:Wr,decompress:jr,parse:qr,update:Kr,remove:Jr,replaceUrl:un};var je={dapp:1,press:2,webshop:3,referral:30,purchase:31},Va=Object.entries(je).reduce((e,[t,r])=>(e[t]=BigInt(1)<<BigInt(r),e),{});var Ct={press:{openArticle:"0xc0a24ffb",readArticle:"0xd5bd0fbe"},dapp:{proofVerifiableStorageUpdate:"0x2ab2aeef",callableVerifiableStorageUpdate:"0xa07da986"},webshop:{open:"0xb311798f"},referral:{referred:"0x010cc3b9",createLink:"0xb2c0f17c"},purchase:{started:"0xd87e90c3",completed:"0x8403aeb4",unsafeCompleted:"0x4d5b14e0"}};function At(e,t){if(!t)return e.request({method:"frak_listenToWalletStatus"}).then(n=>(Gr(n.interactionToken),n));let r=new $,o=!1;return e.listenerRequest({method:"frak_listenToWalletStatus"},n=>{t(n),Gr(n.interactionToken),o||(r.resolve(n),o=!0)}).then(()=>r.promise)}function Gr(e){typeof window>"u"||(e?window.sessionStorage.setItem("frak-wallet-interaction-token",e):window.sessionStorage.removeItem("frak.interaction-token"))}function Xr({domain:e}){let t=e??window.location.host;return xe(G(t))}async function kt(e,{productId:t,interaction:r,validation:o}){let n=t??Xr(e.config);return await e.request({method:"frak_sendInteraction",params:[n,r,o]})}async function _e(e,{steps:t,metadata:r}){return await e.request({method:"frak_displayModal",params:[t,e.config.metadata.name,r]})}function Mt(e,{metadata:t,login:r,openSession:o}){return qe(e,{steps:{login:r??{},openSession:o??{}},metadata:t})}function qe(e,t){function r(c){return qe(e,{...t,steps:{...t.steps,sendTransaction:c}})}function o(c){return qe(e,{...t,steps:{...t.steps,final:{...c,action:{key:"reward"}}}})}function n(c,f){return qe(e,{...t,steps:{...t.steps,final:{...f,action:{key:"sharing",options:c}}}})}async function a(){return await _e(e,t)}return{params:t,sendTx:r,reward:o,sharing:n,display:a}}function pn(){let e=We([Ct.referral.createLink,"0x"]);return{handlerTypeDenominator:G(je.referral),interactionData:e}}function fn({referrer:e}){let t=We([Ct.referral.referred,V(e,{size:32})]);return{handlerTypeDenominator:G(je.referral),interactionData:t}}var Pt={createLink:pn,referred:fn};async function Yr(e,{walletStatus:t,frakContext:r,modalConfig:o,productId:n,options:a}){let c=!1;async function f(){if(!c)return c=!0,mn(e,{modalConfig:o,walletStatus:t})}async function l(x){let d=Pt.referred({referrer:x});await kt(e,{productId:n,interaction:d})}try{let{status:x,currentWallet:d}=await dn({initialWalletStatus:t,getFreshWalletStatus:f,pushReferralInteraction:l,frakContext:r});return Z.replaceUrl({url:window.location?.href,context:a?.alwaysAppendUrl?{r:d}:null}),x}catch(x){return console.log("Error processing referral",{error:x}),Z.replaceUrl({url:window.location?.href,context:a?.alwaysAppendUrl?{r:t?.wallet}:null}),hn(x)}}async function dn({initialWalletStatus:e,getFreshWalletStatus:t,pushReferralInteraction:r,frakContext:o}){let n=e?.wallet;return o?.r?(n||(n=await t()),n&&Ft(o.r,n)?{status:"self-referral",currentWallet:n}:(e?.interactionSession||(n=await t()),await r(o.r),{status:"success",currentWallet:n})):{status:"no-referrer",currentWallet:n}}async function mn(e,{modalConfig:t,walletStatus:r}){return r?.interactionSession?r.wallet??void 0:t?(await _e(e,t))?.login?.wallet??void 0:void 0}function hn(e){if(e instanceof U)switch(e.code){case D.walletNotConnected:return"no-wallet";case D.serverErrorForInteractionDelegation:return"no-session";default:return"error"}return"error"}async function Rt(e,{productId:t,modalConfig:r,options:o}={}){let n=Z.parse({url:window.location.href}),a=await At(e);try{return await Yr(e,{walletStatus:a,frakContext:n,modalConfig:r,productId:t,options:o})}catch(c){return c}}var Zr="frakClientReady",Ke;function xn(){let e=new CustomEvent(Zr);window.dispatchEvent(e)}function Bt(e,t){(e==="add"?window.addEventListener:window.removeEventListener)(Zr,t,!1)}async function Qr(){if(!window?.FrakSetup.config){console.error("window.FrakSetup.config not found");return}let e=await ke({config:window.FrakSetup.config});if(!e){console.error("Failed to create iframe");return}let t=Me({config:window.FrakSetup.config,iframe:e});if(!await t.waitForConnection){console.error("Failed to connect to Frak client");return}return window.FrakSetup.client=t,xn(),t}function eo(e){Ke=Mt(e,window.FrakSetup?.modalConfig??{})}async function to(e){if(!Ke){console.error("modalBuilderSteps not found");return}let t=await Rt(e,{modalConfig:Ke.reward().params});console.log("referral",t)}function ro(){return Ke}var we,M,so,yn,Q,oo,co,Ht,lo,Dt,Lt,Ut,_n,be={},uo=[],gn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Nt=Array.isArray;function j(e,t){for(var r in t)e[r]=t[r];return e}function Ot(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function ee(e,t,r){var o,n,a,c={};for(a in t)a=="key"?o=t[a]:a=="ref"?n=t[a]:c[a]=t[a];if(arguments.length>2&&(c.children=arguments.length>3?we.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(a in e.defaultProps)c[a]===void 0&&(c[a]=e.defaultProps[a]);return ge(e,c,o,n,null)}function ge(e,t,r,o,n){var a={type:e,props:t,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:n??++so,__i:-1,__u:0};return n==null&&M.vnode!=null&&M.vnode(a),a}function te(e){return e.children}function Ge(e,t){this.props=e,this.context=t}function ie(e,t){if(t==null)return e.__?ie(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?ie(e):null}function po(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return po(e)}}function no(e){(!e.__d&&(e.__d=!0)&&Q.push(e)&&!Xe.__r++||oo!==M.debounceRendering)&&((oo=M.debounceRendering)||co)(Xe)}function Xe(){var e,t,r,o,n,a,c,f;for(Q.sort(Ht);e=Q.shift();)e.__d&&(t=Q.length,o=void 0,a=(n=(r=e).__v).__e,c=[],f=[],r.__P&&((o=j({},n)).__v=n.__v+1,M.vnode&&M.vnode(o),zt(r.__P,o,n,r.__n,r.__P.namespaceURI,32&n.__u?[a]:null,c,a??ie(n),!!(32&n.__u),f),o.__v=n.__v,o.__.__k[o.__i]=o,ho(c,o,f),o.__e!=a&&po(o)),Q.length>t&&Q.sort(Ht));Xe.__r=0}function fo(e,t,r,o,n,a,c,f,l,x,d){var s,h,u,_,i,p,b=o&&o.__k||uo,T=t.length;for(l=bn(r,t,b,l),s=0;s<T;s++)(u=r.__k[s])!=null&&(h=u.__i===-1?be:b[u.__i]||be,u.__i=s,p=zt(e,u,h,n,a,c,f,l,x,d),_=u.__e,u.ref&&h.ref!=u.ref&&(h.ref&&Vt(h.ref,null,u),d.push(u.ref,u.__c||_,u)),i==null&&_!=null&&(i=_),4&u.__u||h.__k===u.__k?l=mo(u,l,e):typeof u.type=="function"&&p!==void 0?l=p:_&&(l=_.nextSibling),u.__u&=-7);return r.__e=i,l}function bn(e,t,r,o){var n,a,c,f,l,x=t.length,d=r.length,s=d,h=0;for(e.__k=[],n=0;n<x;n++)(a=t[n])!=null&&typeof a!="boolean"&&typeof a!="function"?(f=n+h,(a=e.__k[n]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?ge(null,a,null,null,null):Nt(a)?ge(te,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?ge(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=e,a.__b=e.__b+1,c=null,(l=a.__i=wn(a,r,f,s))!==-1&&(s--,(c=r[l])&&(c.__u|=2)),c==null||c.__v===null?(l==-1&&h--,typeof a.type!="function"&&(a.__u|=4)):l!==f&&(l==f-1?h--:l==f+1?h++:(l>f?h--:h++,a.__u|=4))):a=e.__k[n]=null;if(s)for(n=0;n<d;n++)(c=r[n])!=null&&!(2&c.__u)&&(c.__e==o&&(o=ie(c)),xo(c,c));return o}function mo(e,t,r){var o,n;if(typeof e.type=="function"){for(o=e.__k,n=0;o&&n<o.length;n++)o[n]&&(o[n].__=e,t=mo(o[n],t,r));return t}e.__e!=t&&(t&&e.type&&!r.contains(t)&&(t=ie(e)),r.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType===8);return t}function wn(e,t,r,o){var n=e.key,a=e.type,c=r-1,f=r+1,l=t[r];if(l===null||l&&n==l.key&&a===l.type&&!(2&l.__u))return r;if((typeof a!="function"||a===te||n)&&o>(l!=null&&!(2&l.__u)?1:0))for(;c>=0||f<t.length;){if(c>=0){if((l=t[c])&&!(2&l.__u)&&n==l.key&&a===l.type)return c;c--}if(f<t.length){if((l=t[f])&&!(2&l.__u)&&n==l.key&&a===l.type)return f;f++}}return-1}function io(e,t,r){t[0]==="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||gn.test(t)?r:r+"px"}function Je(e,t,r,o,n){var a;e:if(t==="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(t in o)r&&t in r||io(e.style,t,"");if(r)for(t in r)o&&r[t]===o[t]||io(e.style,t,r[t])}else if(t[0]==="o"&&t[1]==="n")a=t!==(t=t.replace(lo,"$1")),t=t.toLowerCase()in e||t==="onFocusOut"||t==="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=r,r?o?r.u=o.u:(r.u=Dt,e.addEventListener(t,a?Ut:Lt,a)):e.removeEventListener(t,a?Ut:Lt,a);else{if(n=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function ao(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.t==null)t.t=Dt++;else if(t.t<r.u)return;return r(M.event?M.event(t):t)}}}function zt(e,t,r,o,n,a,c,f,l,x){var d,s,h,u,_,i,p,b,T,g,E,P,m,y,F,S,I,w=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),a=[f=t.__e=r.__e]),(d=M.__b)&&d(t);e:if(typeof w=="function")try{if(b=t.props,T="prototype"in w&&w.prototype.render,g=(d=w.contextType)&&o[d.__c],E=d?g?g.props.value:d.__:o,r.__c?p=(s=t.__c=r.__c).__=s.__E:(T?t.__c=s=new w(b,E):(t.__c=s=new Ge(b,E),s.constructor=w,s.render=Sn),g&&g.sub(s),s.props=b,s.state||(s.state={}),s.context=E,s.__n=o,h=s.__d=!0,s.__h=[],s._sb=[]),T&&s.__s==null&&(s.__s=s.state),T&&w.getDerivedStateFromProps!=null&&(s.__s==s.state&&(s.__s=j({},s.__s)),j(s.__s,w.getDerivedStateFromProps(b,s.__s))),u=s.props,_=s.state,s.__v=t,h)T&&w.getDerivedStateFromProps==null&&s.componentWillMount!=null&&s.componentWillMount(),T&&s.componentDidMount!=null&&s.__h.push(s.componentDidMount);else{if(T&&w.getDerivedStateFromProps==null&&b!==u&&s.componentWillReceiveProps!=null&&s.componentWillReceiveProps(b,E),!s.__e&&(s.shouldComponentUpdate!=null&&s.shouldComponentUpdate(b,s.__s,E)===!1||t.__v===r.__v)){for(t.__v!==r.__v&&(s.props=b,s.state=s.__s,s.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(C){C&&(C.__=t)}),P=0;P<s._sb.length;P++)s.__h.push(s._sb[P]);s._sb=[],s.__h.length&&c.push(s);break e}s.componentWillUpdate!=null&&s.componentWillUpdate(b,s.__s,E),T&&s.componentDidUpdate!=null&&s.__h.push(function(){s.componentDidUpdate(u,_,i)})}if(s.context=E,s.props=b,s.__P=e,s.__e=!1,m=M.__r,y=0,T){for(s.state=s.__s,s.__d=!1,m&&m(t),d=s.render(s.props,s.state,s.context),F=0;F<s._sb.length;F++)s.__h.push(s._sb[F]);s._sb=[]}else do s.__d=!1,m&&m(t),d=s.render(s.props,s.state,s.context),s.state=s.__s;while(s.__d&&++y<25);s.state=s.__s,s.getChildContext!=null&&(o=j(j({},o),s.getChildContext())),T&&!h&&s.getSnapshotBeforeUpdate!=null&&(i=s.getSnapshotBeforeUpdate(u,_)),f=fo(e,Nt(S=d!=null&&d.type===te&&d.key==null?d.props.children:d)?S:[S],t,r,o,n,a,c,f,l,x),s.base=t.__e,t.__u&=-161,s.__h.length&&c.push(s),p&&(s.__E=s.__=null)}catch(C){if(t.__v=null,l||a!=null)if(C.then){for(t.__u|=l?160:128;f&&f.nodeType===8&&f.nextSibling;)f=f.nextSibling;a[a.indexOf(f)]=null,t.__e=f}else for(I=a.length;I--;)Ot(a[I]);else t.__e=r.__e,t.__k=r.__k;M.__e(C,t,r)}else a==null&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):f=t.__e=vn(r.__e,t,r,o,n,a,c,l,x);return(d=M.diffed)&&d(t),128&t.__u?void 0:f}function ho(e,t,r){for(var o=0;o<r.length;o++)Vt(r[o],r[++o],r[++o]);M.__c&&M.__c(t,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(a){a.call(n)})}catch(a){M.__e(a,n.__v)}})}function vn(e,t,r,o,n,a,c,f,l){var x,d,s,h,u,_,i,p=r.props,b=t.props,T=t.type;if(T==="svg"?n="http://www.w3.org/2000/svg":T==="math"?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),a!=null){for(x=0;x<a.length;x++)if((u=a[x])&&"setAttribute"in u==!!T&&(T?u.localName===T:u.nodeType===3)){e=u,a[x]=null;break}}if(e==null){if(T===null)return document.createTextNode(b);e=document.createElementNS(n,T,b.is&&b),f&&(M.__m&&M.__m(t,a),f=!1),a=null}if(T===null)p===b||f&&e.data===b||(e.data=b);else{if(a=a&&we.call(e.childNodes),p=r.props||be,!f&&a!=null)for(p={},x=0;x<e.attributes.length;x++)p[(u=e.attributes[x]).name]=u.value;for(x in p)if(u=p[x],x!="children"){if(x=="dangerouslySetInnerHTML")s=u;else if(!(x in b)){if(x=="value"&&"defaultValue"in b||x=="checked"&&"defaultChecked"in b)continue;Je(e,x,null,u,n)}}for(x in b)u=b[x],x=="children"?h=u:x=="dangerouslySetInnerHTML"?d=u:x=="value"?_=u:x=="checked"?i=u:f&&typeof u!="function"||p[x]===u||Je(e,x,u,p[x],n);if(d)f||s&&(d.__html===s.__html||d.__html===e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(s&&(e.innerHTML=""),fo(e,Nt(h)?h:[h],t,r,o,T==="foreignObject"?"http://www.w3.org/1999/xhtml":n,a,c,a?a[0]:r.__k&&ie(r,0),f,l),a!=null)for(x=a.length;x--;)Ot(a[x]);f||(x="value",T==="progress"&&_==null?e.removeAttribute("value"):_!==void 0&&(_!==e[x]||T==="progress"&&!_||T==="option"&&_!==p[x])&&Je(e,x,_,p[x],n),x="checked",i!==void 0&&i!==e[x]&&Je(e,x,i,p[x],n))}return e}function Vt(e,t,r){try{if(typeof e=="function"){var o=typeof e.__u=="function";o&&e.__u(),o&&t==null||(e.__u=e(t))}else e.current=t}catch(n){M.__e(n,r)}}function xo(e,t,r){var o,n;if(M.unmount&&M.unmount(e),(o=e.ref)&&(o.current&&o.current!==e.__e||Vt(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(a){M.__e(a,t)}o.base=o.__P=null}if(o=e.__k)for(n=0;n<o.length;n++)o[n]&&xo(o[n],t,r||typeof e.type!="function");r||Ot(e.__e),e.__c=e.__=e.__e=void 0}function Sn(e,t,r){return this.constructor(e,r)}function ve(e,t,r){var o,n,a,c;t===document&&(t=document.documentElement),M.__&&M.__(e,t),n=(o=typeof r=="function")?null:r&&r.__k||t.__k,a=[],c=[],zt(t,e=(!o&&r||t).__k=ee(te,null,[e]),n||be,be,t.namespaceURI,!o&&r?[r]:n?null:t.firstChild?we.call(t.childNodes):null,a,!o&&r?r:n?n.__e:t.firstChild,o,c),ho(a,e,c)}function $t(e,t){ve(e,t,$t)}function Wt(e,t,r){var o,n,a,c,f=j({},e.props);for(a in e.type&&e.type.defaultProps&&(c=e.type.defaultProps),t)a=="key"?o=t[a]:a=="ref"?n=t[a]:f[a]=t[a]===void 0&&c!==void 0?c[a]:t[a];return arguments.length>2&&(f.children=arguments.length>3?we.call(arguments,2):r),ge(e.type,f,o||e.key,n||e.ref,null)}we=uo.slice,M={__e:function(e,t,r,o){for(var n,a,c;t=t.__;)if((n=t.__c)&&!n.__)try{if((a=n.constructor)&&a.getDerivedStateFromError!=null&&(n.setState(a.getDerivedStateFromError(e)),c=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(e,o||{}),c=n.__d),c)return n.__E=n}catch(f){e=f}throw e}},so=0,yn=function(e){return e!=null&&e.constructor==null},Ge.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=j({},this.state),typeof e=="function"&&(e=e(j({},r),this.props)),e&&j(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),no(this))},Ge.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),no(this))},Ge.prototype.render=te,Q=[],co=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ht=function(e,t){return e.__v.__b-t.__v.__b},Xe.__r=0,lo=/(PointerCapture)$|Capture$/i,Dt=0,Lt=ao(!1),Ut=ao(!0),_n=0;function jt(){return(jt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e}).apply(this,arguments)}var Tn=["context","children"];function En(e){this.getChildContext=function(){return e.context};var t=e.children,r=function(o,n){if(o==null)return{};var a,c,f={},l=Object.keys(o);for(c=0;c<l.length;c++)n.indexOf(a=l[c])>=0||(f[a]=o[a]);return f}(e,Tn);return Wt(t,r)}function Fn(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=ee(En,jt({},this._props,{context:e.detail.context}),function t(r,o){if(r.nodeType===3)return r.data;if(r.nodeType!==1)return null;var n=[],a={},c=0,f=r.attributes,l=r.childNodes;for(c=f.length;c--;)f[c].name!=="slot"&&(a[f[c].name]=f[c].value,a[_o(f[c].name)]=f[c].value);for(c=l.length;c--;){var x=t(l[c],null),d=l[c].slot;d?a[d]=ee(yo,{name:d},x):n[c]=x}var s=o?ee(yo,null,n):n;return ee(o||r.nodeName.toLowerCase(),a,s)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?$t:ve)(this._vdom,this._root)}function _o(e){return e.replace(/-(\w)/g,function(t,r){return r?r.toUpperCase():""})}function In(e,t,r){if(this._vdom){var o={};o[e]=r=r??void 0,o[_o(e)]=r,this._vdom=Wt(this._vdom,o),ve(this._vdom,this._root)}}function Cn(){ve(this._vdom=null,this._root)}function yo(e,t){var r=this;return ee("slot",jt({},e,{ref:function(o){o?(r.ref=o,r._listener||(r._listener=function(n){n.stopPropagation(),n.detail.context=t},o.addEventListener("_preact",r._listener))):r.ref.removeEventListener("_preact",r._listener)}}))}function go(e,t,r,o){function n(){var a=Reflect.construct(HTMLElement,[],n);return a._vdomComponent=e,a._root=o&&o.shadow?a.attachShadow({mode:o.mode||"open"}):a,a}return(n.prototype=Object.create(HTMLElement.prototype)).constructor=n,n.prototype.connectedCallback=Fn,n.prototype.attributeChangedCallback=In,n.prototype.disconnectedCallback=Cn,r=r||e.observedAttributes||Object.keys(e.propTypes||{}),n.observedAttributes=r,r.forEach(function(a){Object.defineProperty(n.prototype,a,{get:function(){return this._vdom.props[a]},set:function(c){this._vdom?this.attributeChangedCallback(a,null,c):(this._props||(this._props={}),this._props[a]=c,this.connectedCallback());var f=typeof c;c!=null&&f!=="string"&&f!=="boolean"&&f!=="number"||this.setAttribute(a,c)}})}),customElements.define(t||e.tagName||e.displayName||e.name,n)}var Se,H,qt,bo,Ze=0,Co=[],L=M,wo=L.__b,vo=L.__r,So=L.diffed,To=L.__c,Eo=L.unmount,Fo=L.__;function Jt(e,t){L.__h&&L.__h(H,e,Ze||t),Ze=0;var r=H.__H||(H.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Ao(e){return Ze=1,An(Ro,e)}function An(e,t,r){var o=Jt(Se++,2);if(o.t=e,!o.__c&&(o.__=[r?r(t):Ro(void 0,t),function(f){var l=o.__N?o.__N[0]:o.__[0],x=o.t(l,f);l!==x&&(o.__N=[x,o.__[1]],o.__c.setState({}))}],o.__c=H,!H.u)){var n=function(f,l,x){if(!o.__c.__H)return!0;var d=o.__c.__H.__.filter(function(h){return!!h.__c});if(d.every(function(h){return!h.__N}))return!a||a.call(this,f,l,x);var s=o.__c.props!==f;return d.forEach(function(h){if(h.__N){var u=h.__[0];h.__=h.__N,h.__N=void 0,u!==h.__[0]&&(s=!0)}}),a&&a.call(this,f,l,x)||s};H.u=!0;var a=H.shouldComponentUpdate,c=H.componentWillUpdate;H.componentWillUpdate=function(f,l,x){if(this.__e){var d=a;a=void 0,n(f,l,x),a=d}c&&c.call(this,f,l,x)},H.shouldComponentUpdate=n}return o.__N||o.__}function ko(e,t){var r=Jt(Se++,3);!L.__s&&Po(r.__H,t)&&(r.__=e,r.i=t,H.__H.__h.push(r))}function kn(e,t){var r=Jt(Se++,7);return Po(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Mo(e,t){return Ze=8,kn(function(){return e},t)}function Mn(){for(var e;e=Co.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Ye),e.__H.__h.forEach(Kt),e.__H.__h=[]}catch(t){e.__H.__h=[],L.__e(t,e.__v)}}L.__b=function(e){H=null,wo&&wo(e)},L.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Fo&&Fo(e,t)},L.__r=function(e){vo&&vo(e),Se=0;var t=(H=e.__c).__H;t&&(qt===H?(t.__h=[],H.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.i=r.__N=void 0})):(t.__h.forEach(Ye),t.__h.forEach(Kt),t.__h=[],Se=0)),qt=H},L.diffed=function(e){So&&So(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Co.push(t)!==1&&bo===L.requestAnimationFrame||((bo=L.requestAnimationFrame)||Pn)(Mn)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.i=void 0})),qt=H=null},L.__c=function(e,t){t.some(function(r){try{r.__h.forEach(Ye),r.__h=r.__h.filter(function(o){return!o.__||Kt(o)})}catch(o){t.some(function(n){n.__h&&(n.__h=[])}),t=[],L.__e(o,r.__v)}}),To&&To(e,t)},L.unmount=function(e){Eo&&Eo(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(o){try{Ye(o)}catch(n){t=n}}),r.__H=void 0,t&&L.__e(t,r.__v))};var Io=typeof requestAnimationFrame=="function";function Pn(e){var t,r=function(){clearTimeout(o),Io&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(r,100);Io&&(t=requestAnimationFrame(r))}function Ye(e){var t=H,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),H=t}function Kt(e){var t=H;e.__c=e.__(),H=t}function Po(e,t){return!e||e.length!==t.length||t.some(function(r,o){return r!==e[o]})}function Ro(e,t){return typeof t=="function"?t(e):t}var Rn=0,Bs=Array.isArray;function Bo(e,t,r,o,n,a){t||(t={});var c,f,l=t;"ref"in t&&(c=t.ref,delete t.ref);var x={type:e,props:l,key:r,ref:c,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Rn,__i:-1,__u:0,__source:n,__self:a};if(typeof e=="function"&&(c=e.defaultProps))for(f in c)l[f]===void 0&&(l[f]=c[f]);return M.vnode&&M.vnode(x),x}function Bn(){let e=ro();if(!e){console.error("modalBuilderSteps not found");return}e.sharing(window.FrakSetup?.modalShareConfig??{}).display()}function Qe({text:e="Share and earn!",classname:t=""}){let[r,o]=Ao(!0),n=Mo(()=>{o(!1)},[]);return ko(()=>(Bt("add",n),()=>Bt("remove",n)),[n]),Bo("button",{type:"button",class:t,disabled:r,onClick:Bn,children:e})}customElements.get("frak-button-share")||go(Qe,"frak-button-share",["text"],{shadow:!1});Zt(async function(){let t=await Qr();if(!t){console.error("Failed to create Frak client");return}eo(t),to(t)});return zo(Hn);})();
|
|
3
|
+
/*! Bundled license information:
|
|
4
|
+
|
|
5
|
+
js-sha256/src/sha256.js:
|
|
6
|
+
(**
|
|
7
|
+
* [js-sha256]{@link https://github.com/emn178/js-sha256}
|
|
8
|
+
*
|
|
9
|
+
* @version 0.11.0
|
|
10
|
+
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
|
11
|
+
* @copyright Chen, Yi-Cyuan 2014-2024
|
|
12
|
+
* @license MIT
|
|
13
|
+
*)
|
|
14
|
+
|
|
15
|
+
@noble/hashes/esm/utils.js:
|
|
16
|
+
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
17
|
+
*/
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"url": "https://twitter.com/QNivelais"
|
|
12
12
|
}
|
|
13
13
|
],
|
|
14
|
-
"version": "0.0.
|
|
14
|
+
"version": "0.0.4",
|
|
15
15
|
"description": "Frak Wallet components, helping any person to interact with the Frak wallet.",
|
|
16
16
|
"repository": {
|
|
17
17
|
"url": "https://github.com/frak-id/wallet",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"build:watch": "tsup --watch"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"preact": "^10.25.
|
|
47
|
+
"preact": "^10.25.1",
|
|
48
48
|
"preact-custom-element": "^4.3.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
package/dist/components.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var FrakComponents=(()=>{var K=Object.defineProperty;var Ke=Object.getOwnPropertyDescriptor;var Ge=Object.getOwnPropertyNames;var Je=Object.prototype.hasOwnProperty;var Ze=(t,e)=>{for(var n in e)K(t,n,{get:e[n],enumerable:!0})},Qe=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let _ of Ge(e))!Je.call(t,_)&&_!==n&&K(t,_,{get:()=>e[_],enumerable:!(r=Ke(e,_))||r.enumerable});return t};var Xe=t=>Qe(K({},"__esModule",{value:!0}),t);var gt={};Ze(gt,{ButtonShare:()=>V});async function se(t,e){return document.getElementById(t)?Promise.resolve(!0):new Promise((n,r)=>{let _=document.createElement("script");_.id=t,_.src=e,_.async=!0,_.onload=()=>n(!0),_.onerror=()=>r(new Error(`Script load error for ${e}`)),document.head.appendChild(_)})}function ce(t){document.readyState==="complete"||document.readyState==="interactive"?setTimeout(t,1):document.addEventListener?document.addEventListener("DOMContentLoaded",t):document.attachEvent("onreadystatechange",()=>{document.readyState==="complete"&&t()})}var fe="frakClientReady";function Ye(){let t=new CustomEvent(fe);window.dispatchEvent(t)}function G(t,e){(t==="add"?window.addEventListener:window.removeEventListener)(fe,e,!1)}async function pe(){if(!window?.FrakSetup.config){console.error("window.FrakSetup.config not found");return}let t=await window.NexusSDK.createIframe({walletBaseUrl:window.FrakSetup.config.walletUrl??"https://wallet.frak.id"});if(!t){console.error("Failed to create iframe");return}let e=window.NexusSDK.createIFrameNexusClient({config:window.FrakSetup.config,iframe:t});if(!await e.waitForConnection){console.error("Failed to connect to Frak client");return}return window.FrakSetup.client=e,Ye(),e}function de(t){if(!window.FrakSetup.modalConfig){console.error("window.FrakSetup.modalConfig not found");return}window.FrakSetup.modalBuilderSteps=window.NexusSDK.modalBuilder(t,window.FrakSetup.modalConfig)}async function he(t){let e=await window.NexusSDK.referralInteraction(t,{modalConfig:window.FrakSetup.modalBuilderSteps?.reward().params,options:{alwaysAppendUrl:!0}});console.log("referral",e)}var L,d,we,et,S,me,be,J,ke,X,Z,Q,tt,A={},Ce=[],nt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Y=Array.isArray;function C(t,e){for(var n in e)t[n]=e[n];return t}function ee(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function E(t,e,n){var r,_,o,a={};for(o in e)o=="key"?r=e[o]:o=="ref"?_=e[o]:a[o]=e[o];if(arguments.length>2&&(a.children=arguments.length>3?L.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(o in t.defaultProps)a[o]===void 0&&(a[o]=t.defaultProps[o]);return D(t,a,r,_,null)}function D(t,e,n,r,_){var o={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:_??++we,__i:-1,__u:0};return _==null&&d.vnode!=null&&d.vnode(o),o}function F(t){return t.children}function O(t,e){this.props=t,this.context=e}function H(t,e){if(e==null)return t.__?H(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?H(t):null}function xe(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return xe(t)}}function ve(t){(!t.__d&&(t.__d=!0)&&S.push(t)&&!I.__r++||me!==d.debounceRendering)&&((me=d.debounceRendering)||be)(I)}function I(){var t,e,n,r,_,o,a,u;for(S.sort(J);t=S.shift();)t.__d&&(e=S.length,r=void 0,o=(_=(n=t).__v).__e,a=[],u=[],n.__P&&((r=C({},_)).__v=_.__v+1,d.vnode&&d.vnode(r),te(n.__P,r,_,n.__n,n.__P.namespaceURI,32&_.__u?[o]:null,a,o??H(_),!!(32&_.__u),u),r.__v=_.__v,r.__.__k[r.__i]=r,Fe(a,r,u),r.__e!=o&&xe(r)),S.length>e&&S.sort(J));I.__r=0}function Se(t,e,n,r,_,o,a,u,l,s,f){var i,p,c,g,b,w,h=r&&r.__k||Ce,m=e.length;for(l=rt(n,e,h,l),i=0;i<m;i++)(c=n.__k[i])!=null&&(p=c.__i===-1?A:h[c.__i]||A,c.__i=i,w=te(t,c,p,_,o,a,u,l,s,f),g=c.__e,c.ref&&p.ref!=c.ref&&(p.ref&&ne(p.ref,null,c),f.push(c.ref,c.__c||g,c)),b==null&&g!=null&&(b=g),4&c.__u||p.__k===c.__k?l=Ee(c,l,t):typeof c.type=="function"&&w!==void 0?l=w:g&&(l=g.nextSibling),c.__u&=-7);return n.__e=b,l}function rt(t,e,n,r){var _,o,a,u,l,s=e.length,f=n.length,i=f,p=0;for(t.__k=[],_=0;_<s;_++)(o=e[_])!=null&&typeof o!="boolean"&&typeof o!="function"?(u=_+p,(o=t.__k[_]=typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?D(null,o,null,null,null):Y(o)?D(F,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?D(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=t,o.__b=t.__b+1,a=null,(l=o.__i=ot(o,n,u,i))!==-1&&(i--,(a=n[l])&&(a.__u|=2)),a==null||a.__v===null?(l==-1&&p--,typeof o.type!="function"&&(o.__u|=4)):l!==u&&(l==u-1?p--:l==u+1?p++:(l>u?p--:p++,o.__u|=4))):o=t.__k[_]=null;if(i)for(_=0;_<f;_++)(a=n[_])!=null&&!(2&a.__u)&&(a.__e==r&&(r=H(a)),He(a,a));return r}function Ee(t,e,n){var r,_;if(typeof t.type=="function"){for(r=t.__k,_=0;r&&_<r.length;_++)r[_]&&(r[_].__=t,e=Ee(r[_],e,n));return e}t.__e!=e&&(e&&t.type&&!n.contains(e)&&(e=H(t)),n.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType===8);return e}function ot(t,e,n,r){var _=t.key,o=t.type,a=n-1,u=n+1,l=e[n];if(l===null||l&&_==l.key&&o===l.type&&!(2&l.__u))return n;if((typeof o!="function"||o===F||_)&&r>(l!=null&&!(2&l.__u)?1:0))for(;a>=0||u<e.length;){if(a>=0){if((l=e[a])&&!(2&l.__u)&&_==l.key&&o===l.type)return a;a--}if(u<e.length){if((l=e[u])&&!(2&l.__u)&&_==l.key&&o===l.type)return u;u++}}return-1}function ye(t,e,n){e[0]==="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||nt.test(e)?n:n+"px"}function R(t,e,n,r,_){var o;e:if(e==="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||ye(t.style,e,"");if(n)for(e in n)r&&n[e]===r[e]||ye(t.style,e,n[e])}else if(e[0]==="o"&&e[1]==="n")o=e!==(e=e.replace(ke,"$1")),e=e.toLowerCase()in t||e==="onFocusOut"||e==="onFocusIn"?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=n,n?r?n.u=r.u:(n.u=X,t.addEventListener(e,o?Q:Z,o)):t.removeEventListener(e,o?Q:Z,o);else{if(_=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!=="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function ge(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=X++;else if(e.t<n.u)return;return n(d.event?d.event(e):e)}}}function te(t,e,n,r,_,o,a,u,l,s){var f,i,p,c,g,b,w,h,m,P,x,j,N,le,B,q,z,k=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),o=[u=e.__e=n.__e]),(f=d.__b)&&f(e);e:if(typeof k=="function")try{if(h=e.props,m="prototype"in k&&k.prototype.render,P=(f=k.contextType)&&r[f.__c],x=f?P?P.props.value:f.__:r,n.__c?w=(i=e.__c=n.__c).__=i.__E:(m?e.__c=i=new k(h,x):(e.__c=i=new O(h,x),i.constructor=k,i.render=it),P&&P.sub(i),i.props=h,i.state||(i.state={}),i.context=x,i.__n=r,p=i.__d=!0,i.__h=[],i._sb=[]),m&&i.__s==null&&(i.__s=i.state),m&&k.getDerivedStateFromProps!=null&&(i.__s==i.state&&(i.__s=C({},i.__s)),C(i.__s,k.getDerivedStateFromProps(h,i.__s))),c=i.props,g=i.state,i.__v=e,p)m&&k.getDerivedStateFromProps==null&&i.componentWillMount!=null&&i.componentWillMount(),m&&i.componentDidMount!=null&&i.__h.push(i.componentDidMount);else{if(m&&k.getDerivedStateFromProps==null&&h!==c&&i.componentWillReceiveProps!=null&&i.componentWillReceiveProps(h,x),!i.__e&&(i.shouldComponentUpdate!=null&&i.shouldComponentUpdate(h,i.__s,x)===!1||e.__v===n.__v)){for(e.__v!==n.__v&&(i.props=h,i.state=i.__s,i.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(T){T&&(T.__=e)}),j=0;j<i._sb.length;j++)i.__h.push(i._sb[j]);i._sb=[],i.__h.length&&a.push(i);break e}i.componentWillUpdate!=null&&i.componentWillUpdate(h,i.__s,x),m&&i.componentDidUpdate!=null&&i.__h.push(function(){i.componentDidUpdate(c,g,b)})}if(i.context=x,i.props=h,i.__P=t,i.__e=!1,N=d.__r,le=0,m){for(i.state=i.__s,i.__d=!1,N&&N(e),f=i.render(i.props,i.state,i.context),B=0;B<i._sb.length;B++)i.__h.push(i._sb[B]);i._sb=[]}else do i.__d=!1,N&&N(e),f=i.render(i.props,i.state,i.context),i.state=i.__s;while(i.__d&&++le<25);i.state=i.__s,i.getChildContext!=null&&(r=C(C({},r),i.getChildContext())),m&&!p&&i.getSnapshotBeforeUpdate!=null&&(b=i.getSnapshotBeforeUpdate(c,g)),u=Se(t,Y(q=f!=null&&f.type===F&&f.key==null?f.props.children:f)?q:[q],e,n,r,_,o,a,u,l,s),i.base=e.__e,e.__u&=-161,i.__h.length&&a.push(i),w&&(i.__E=i.__=null)}catch(T){if(e.__v=null,l||o!=null)if(T.then){for(e.__u|=l?160:128;u&&u.nodeType===8&&u.nextSibling;)u=u.nextSibling;o[o.indexOf(u)]=null,e.__e=u}else for(z=o.length;z--;)ee(o[z]);else e.__e=n.__e,e.__k=n.__k;d.__e(T,e,n)}else o==null&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):u=e.__e=_t(n.__e,e,n,r,_,o,a,l,s);return(f=d.diffed)&&f(e),128&e.__u?void 0:u}function Fe(t,e,n){for(var r=0;r<n.length;r++)ne(n[r],n[++r],n[++r]);d.__c&&d.__c(e,t),t.some(function(_){try{t=_.__h,_.__h=[],t.some(function(o){o.call(_)})}catch(o){d.__e(o,_.__v)}})}function _t(t,e,n,r,_,o,a,u,l){var s,f,i,p,c,g,b,w=n.props,h=e.props,m=e.type;if(m==="svg"?_="http://www.w3.org/2000/svg":m==="math"?_="http://www.w3.org/1998/Math/MathML":_||(_="http://www.w3.org/1999/xhtml"),o!=null){for(s=0;s<o.length;s++)if((c=o[s])&&"setAttribute"in c==!!m&&(m?c.localName===m:c.nodeType===3)){t=c,o[s]=null;break}}if(t==null){if(m===null)return document.createTextNode(h);t=document.createElementNS(_,m,h.is&&h),u&&(d.__m&&d.__m(e,o),u=!1),o=null}if(m===null)w===h||u&&t.data===h||(t.data=h);else{if(o=o&&L.call(t.childNodes),w=n.props||A,!u&&o!=null)for(w={},s=0;s<t.attributes.length;s++)w[(c=t.attributes[s]).name]=c.value;for(s in w)if(c=w[s],s!="children"){if(s=="dangerouslySetInnerHTML")i=c;else if(!(s in h)){if(s=="value"&&"defaultValue"in h||s=="checked"&&"defaultChecked"in h)continue;R(t,s,null,c,_)}}for(s in h)c=h[s],s=="children"?p=c:s=="dangerouslySetInnerHTML"?f=c:s=="value"?g=c:s=="checked"?b=c:u&&typeof c!="function"||w[s]===c||R(t,s,c,w[s],_);if(f)u||i&&(f.__html===i.__html||f.__html===t.innerHTML)||(t.innerHTML=f.__html),e.__k=[];else if(i&&(t.innerHTML=""),Se(t,Y(p)?p:[p],e,n,r,m==="foreignObject"?"http://www.w3.org/1999/xhtml":_,o,a,o?o[0]:n.__k&&H(n,0),u,l),o!=null)for(s=o.length;s--;)ee(o[s]);u||(s="value",m==="progress"&&g==null?t.removeAttribute("value"):g!==void 0&&(g!==t[s]||m==="progress"&&!g||m==="option"&&g!==w[s])&&R(t,s,g,w[s],_),s="checked",b!==void 0&&b!==t[s]&&R(t,s,b,w[s],_))}return t}function ne(t,e,n){try{if(typeof t=="function"){var r=typeof t.__u=="function";r&&t.__u(),r&&e==null||(t.__u=t(e))}else t.current=e}catch(_){d.__e(_,n)}}function He(t,e,n){var r,_;if(d.unmount&&d.unmount(t),(r=t.ref)&&(r.current&&r.current!==t.__e||ne(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){d.__e(o,e)}r.base=r.__P=null}if(r=t.__k)for(_=0;_<r.length;_++)r[_]&&He(r[_],e,n||typeof t.type!="function");n||ee(t.__e),t.__c=t.__=t.__e=void 0}function it(t,e,n){return this.constructor(t,n)}function U(t,e,n){var r,_,o,a;e===document&&(e=document.documentElement),d.__&&d.__(t,e),_=(r=typeof n=="function")?null:n&&n.__k||e.__k,o=[],a=[],te(e,t=(!r&&n||e).__k=E(F,null,[t]),_||A,A,e.namespaceURI,!r&&n?[n]:_?null:e.firstChild?L.call(e.childNodes):null,o,!r&&n?n:_?_.__e:e.firstChild,r,a),Fe(o,t,a)}function re(t,e){U(t,e,re)}function oe(t,e,n){var r,_,o,a,u=C({},t.props);for(o in t.type&&t.type.defaultProps&&(a=t.type.defaultProps),e)o=="key"?r=e[o]:o=="ref"?_=e[o]:u[o]=e[o]===void 0&&a!==void 0?a[o]:e[o];return arguments.length>2&&(u.children=arguments.length>3?L.call(arguments,2):n),D(t.type,u,r||t.key,_||t.ref,null)}L=Ce.slice,d={__e:function(t,e,n,r){for(var _,o,a;e=e.__;)if((_=e.__c)&&!_.__)try{if((o=_.constructor)&&o.getDerivedStateFromError!=null&&(_.setState(o.getDerivedStateFromError(t)),a=_.__d),_.componentDidCatch!=null&&(_.componentDidCatch(t,r||{}),a=_.__d),a)return _.__E=_}catch(u){t=u}throw t}},we=0,et=function(t){return t!=null&&t.constructor==null},O.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=C({},this.state),typeof t=="function"&&(t=t(C({},n),this.props)),t&&C(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),ve(this))},O.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),ve(this))},O.prototype.render=F,S=[],be=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,J=function(t,e){return t.__v.__b-e.__v.__b},I.__r=0,ke=/(PointerCapture)$|Capture$/i,X=0,Z=ge(!1),Q=ge(!0),tt=0;function _e(){return(_e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}var at=["context","children"];function ut(t){this.getChildContext=function(){return t.context};var e=t.children,n=function(r,_){if(r==null)return{};var o,a,u={},l=Object.keys(r);for(a=0;a<l.length;a++)_.indexOf(o=l[a])>=0||(u[o]=r[o]);return u}(t,at);return oe(e,n)}function lt(){var t=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(t),this._vdom=E(ut,_e({},this._props,{context:t.detail.context}),function e(n,r){if(n.nodeType===3)return n.data;if(n.nodeType!==1)return null;var _=[],o={},a=0,u=n.attributes,l=n.childNodes;for(a=u.length;a--;)u[a].name!=="slot"&&(o[u[a].name]=u[a].value,o[Ne(u[a].name)]=u[a].value);for(a=l.length;a--;){var s=e(l[a],null),f=l[a].slot;f?o[f]=E(Pe,{name:f},s):_[a]=s}var i=r?E(Pe,null,_):_;return E(r||n.nodeName.toLowerCase(),o,i)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?re:U)(this._vdom,this._root)}function Ne(t){return t.replace(/-(\w)/g,function(e,n){return n?n.toUpperCase():""})}function st(t,e,n){if(this._vdom){var r={};r[t]=n=n??void 0,r[Ne(t)]=n,this._vdom=oe(this._vdom,r),U(this._vdom,this._root)}}function ct(){U(this._vdom=null,this._root)}function Pe(t,e){var n=this;return E("slot",_e({},t,{ref:function(r){r?(n.ref=r,n._listener||(n._listener=function(_){_.stopPropagation(),_.detail.context=e},r.addEventListener("_preact",n._listener))):n.ref.removeEventListener("_preact",n._listener)}}))}function Te(t,e,n,r){function _(){var o=Reflect.construct(HTMLElement,[],_);return o._vdomComponent=t,o._root=r&&r.shadow?o.attachShadow({mode:r.mode||"open"}):o,o}return(_.prototype=Object.create(HTMLElement.prototype)).constructor=_,_.prototype.connectedCallback=lt,_.prototype.attributeChangedCallback=st,_.prototype.disconnectedCallback=ct,n=n||t.observedAttributes||Object.keys(t.propTypes||{}),_.observedAttributes=n,n.forEach(function(o){Object.defineProperty(_.prototype,o,{get:function(){return this._vdom.props[o]},set:function(a){this._vdom?this.attributeChangedCallback(o,null,a):(this._props||(this._props={}),this._props[o]=a,this.connectedCallback());var u=typeof a;a!=null&&u!=="string"&&u!=="boolean"&&u!=="number"||this.setAttribute(o,a)}})}),customElements.define(e||t.tagName||t.displayName||t.name,_)}var M,v,ie,De,$=0,Oe=[],y=d,Ae=y.__b,Le=y.__r,Ue=y.diffed,Me=y.__c,je=y.unmount,Be=y.__;function ue(t,e){y.__h&&y.__h(v,t,$||e),$=0;var n=v.__H||(v.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function Ie(t){return $=1,ft(qe,t)}function ft(t,e,n){var r=ue(M++,2);if(r.t=t,!r.__c&&(r.__=[n?n(e):qe(void 0,e),function(u){var l=r.__N?r.__N[0]:r.__[0],s=r.t(l,u);l!==s&&(r.__N=[s,r.__[1]],r.__c.setState({}))}],r.__c=v,!v.u)){var _=function(u,l,s){if(!r.__c.__H)return!0;var f=r.__c.__H.__.filter(function(p){return!!p.__c});if(f.every(function(p){return!p.__N}))return!o||o.call(this,u,l,s);var i=r.__c.props!==u;return f.forEach(function(p){if(p.__N){var c=p.__[0];p.__=p.__N,p.__N=void 0,c!==p.__[0]&&(i=!0)}}),o&&o.call(this,u,l,s)||i};v.u=!0;var o=v.shouldComponentUpdate,a=v.componentWillUpdate;v.componentWillUpdate=function(u,l,s){if(this.__e){var f=o;o=void 0,_(u,l,s),o=f}a&&a.call(this,u,l,s)},v.shouldComponentUpdate=_}return r.__N||r.__}function We(t,e){var n=ue(M++,3);!y.__s&&Ve(n.__H,e)&&(n.__=t,n.i=e,v.__H.__h.push(n))}function pt(t,e){var n=ue(M++,7);return Ve(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function $e(t,e){return $=8,pt(function(){return t},e)}function dt(){for(var t;t=Oe.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(W),t.__H.__h.forEach(ae),t.__H.__h=[]}catch(e){t.__H.__h=[],y.__e(e,t.__v)}}y.__b=function(t){v=null,Ae&&Ae(t)},y.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Be&&Be(t,e)},y.__r=function(t){Le&&Le(t),M=0;var e=(v=t.__c).__H;e&&(ie===v?(e.__h=[],v.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(e.__h.forEach(W),e.__h.forEach(ae),e.__h=[],M=0)),ie=v},y.diffed=function(t){Ue&&Ue(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Oe.push(e)!==1&&De===y.requestAnimationFrame||((De=y.requestAnimationFrame)||ht)(dt)),e.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),ie=v=null},y.__c=function(t,e){e.some(function(n){try{n.__h.forEach(W),n.__h=n.__h.filter(function(r){return!r.__||ae(r)})}catch(r){e.some(function(_){_.__h&&(_.__h=[])}),e=[],y.__e(r,n.__v)}}),Me&&Me(t,e)},y.unmount=function(t){je&&je(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{W(r)}catch(_){e=_}}),n.__H=void 0,e&&y.__e(e,n.__v))};var Re=typeof requestAnimationFrame=="function";function ht(t){var e,n=function(){clearTimeout(r),Re&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,100);Re&&(e=requestAnimationFrame(n))}function W(t){var e=v,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),v=e}function ae(t){var e=v;t.__c=t.__(),v=e}function Ve(t,e){return!t||t.length!==e.length||e.some(function(n,r){return n!==t[r]})}function qe(t,e){return typeof e=="function"?e(t):e}var mt=0,Nt=Array.isArray;function ze(t,e,n,r,_,o){e||(e={});var a,u,l=e;"ref"in e&&(a=e.ref,delete e.ref);var s={type:t,props:l,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--mt,__i:-1,__u:0,__source:_,__self:o};if(typeof t=="function"&&(a=t.defaultProps))for(u in a)l[u]===void 0&&(l[u]=a[u]);return d.vnode&&d.vnode(s),s}function vt(){if(!window.FrakSetup.modalShareConfig){console.error("window.FrakSetup.modalShareConfig not found");return}window.FrakSetup.modalBuilderSteps.sharing(window.FrakSetup.modalShareConfig).display()}function V({text:t="Share and earn!",classname:e=""}){let[n,r]=Ie(!0),_=$e(()=>{r(!1)},[]);return We(()=>(G("add",_),()=>G("remove",_)),[_]),ze("button",{type:"button",class:e,disabled:n,onClick:vt,children:t})}customElements.get("frak-button-share")||Te(V,"frak-button-share",["text"],{shadow:!1});var yt=se("frak-sdk","https://cdn.jsdelivr.net/npm/@frak-labs/nexus-sdk@latest/dist/bundle/bundle.js");ce(async function(){await yt;let e=await pe();if(!e){console.error("Failed to create Frak client");return}de(e),he(e)});return Xe(gt);})();
|