@dodoex/wallet-web3 0.0.29-5 → 0.0.29-6
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/__node-resolve_empty-1bb86108.js +1 -0
- package/dist/__tslib-6f859a10.js +1 -0
- package/dist/_commonjs-dynamic-modules-7cfc9805.js +1 -0
- package/dist/blocto-6fdd2522.js +7 -0
- package/dist/bn-3c1372bb.js +1 -0
- package/dist/browser-ponyfill-e86d50ae.js +1 -0
- package/dist/cjs/__node-resolve_empty-b9b68f61.cjs +1 -0
- package/dist/cjs/__tslib-5e95569a.cjs +1 -0
- package/dist/cjs/_commonjs-dynamic-modules-f09a98c7.cjs +1 -0
- package/dist/cjs/blocto-a9a7429a.cjs +7 -0
- package/dist/cjs/bn-f79633bb.cjs +1 -0
- package/dist/cjs/browser-ponyfill-262b9a1d.cjs +1 -0
- package/dist/cjs/ethers-2e33277b.cjs +1 -0
- package/dist/cjs/hash-282034e6.cjs +1 -0
- package/dist/cjs/id-ce261f66.cjs +1 -0
- package/dist/cjs/index-040d72a4.cjs +1 -0
- package/dist/cjs/index-269c7834.cjs +1 -0
- package/dist/cjs/index-46767b56.cjs +9 -0
- package/dist/cjs/index-6286567d.cjs +66 -0
- package/dist/cjs/index-70269942.cjs +1 -0
- package/dist/cjs/index-839d2b51.cjs +1 -0
- package/dist/cjs/index-8bbd780e.cjs +1 -0
- package/dist/cjs/index-92dad595.cjs +1 -0
- package/dist/cjs/index-a7b876c9.cjs +1 -0
- package/dist/cjs/index-b300045d.cjs +15 -0
- package/dist/cjs/index-b7400738.cjs +1 -0
- package/dist/cjs/index-c59c8727.cjs +72 -0
- package/dist/cjs/index-cf3bf3b5.cjs +3 -0
- package/dist/cjs/index-d72d2161.cjs +6 -0
- package/dist/cjs/index-de2a5091.cjs +1 -0
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.es-eeb7e818.cjs +9 -0
- package/dist/cjs/inherits_browser-f88a000a.cjs +1 -0
- package/dist/cjs/interface-770bfae7.cjs +1 -0
- package/dist/cjs/portis-b2b50bfb.cjs +24 -0
- package/dist/cjs/provider-b83497b2.cjs +1 -0
- package/dist/cjs/rainbow-10b0c861.cjs +1 -0
- package/dist/cjs/typed-data-63d8e9ee.cjs +1 -0
- package/dist/cjs/uAuth-b8c6a947.cjs +1 -0
- package/dist/cjs/walletConnect-be645a80.cjs +1 -0
- package/dist/cjs/walletLink-3f05b2ee.cjs +1 -0
- package/dist/ethers-e9ea7b62.js +1 -0
- package/dist/hash-a9ebd52a.js +1 -0
- package/dist/id-4394eafb.js +1 -0
- package/dist/index-3e230de4.js +1 -0
- package/dist/index-4f115893.js +1 -0
- package/dist/index-5a901c0e.js +2 -0
- package/dist/index-5ef7c2c6.js +6 -0
- package/dist/index-6be6f872.js +1 -0
- package/dist/index-71412a35.js +1 -0
- package/dist/index-71e104e3.js +1 -0
- package/dist/index-853c105c.js +15 -0
- package/dist/index-9cb93da4.js +1 -0
- package/dist/index-9e75afb9.js +1 -0
- package/dist/index-aa70a2b2.js +66 -0
- package/dist/index-b12d1c2b.js +1 -0
- package/dist/index-bef3992a.js +9 -0
- package/dist/index-f4e58da8.js +72 -0
- package/dist/index-faabf409.js +1 -0
- package/dist/index.es-c2f702fd.js +9 -0
- package/dist/index.js +1 -1
- package/dist/inherits_browser-06ba108b.js +1 -0
- package/dist/interface-e24b9dc3.js +1 -0
- package/dist/portis-7a5843d0.js +24 -0
- package/dist/provider-3276289c.js +1 -0
- package/dist/rainbow-028e417a.js +1 -0
- package/dist/typed-data-4ee2951a.js +1 -0
- package/dist/uAuth-1775a01d.js +1 -0
- package/dist/walletConnect-4d5928fe.js +1 -0
- package/dist/walletLink-4295f7ca.js +1 -0
- package/package.json +1 -1
- package/dist/blocto-ec220500.js +0 -1
- package/dist/cjs/blocto-06e9f41b.cjs +0 -1
- package/dist/cjs/index-10e8c244.cjs +0 -1
- package/dist/cjs/index-65ef3d76.cjs +0 -1
- package/dist/cjs/index-6f1e3af6.cjs +0 -1
- package/dist/cjs/index-8983bb88.cjs +0 -1
- package/dist/cjs/index-ae695e20.cjs +0 -1
- package/dist/cjs/index-ba62c069.cjs +0 -1
- package/dist/cjs/index-c149be38.cjs +0 -1
- package/dist/cjs/portis-2054bb58.cjs +0 -1
- package/dist/cjs/provider-037fd0ed.cjs +0 -1
- package/dist/cjs/rainbow-2ad12dd2.cjs +0 -1
- package/dist/cjs/uAuth-7e65d2cc.cjs +0 -1
- package/dist/cjs/walletConnect-ade9514f.cjs +0 -1
- package/dist/cjs/walletLink-b6336fc1.cjs +0 -1
- package/dist/index-17319257.js +0 -1
- package/dist/index-27e5c5a9.js +0 -1
- package/dist/index-2806301c.js +0 -1
- package/dist/index-3ea85737.js +0 -1
- package/dist/index-890a1073.js +0 -1
- package/dist/index-9149aa90.js +0 -1
- package/dist/index-ea777add.js +0 -1
- package/dist/portis-8eca7dbf.js +0 -1
- package/dist/provider-a0690f64.js +0 -1
- package/dist/rainbow-9004d140.js +0 -1
- package/dist/uAuth-c2aa6d14.js +0 -1
- package/dist/walletConnect-3f4192dd.js +0 -1
- package/dist/walletLink-b8912567.js +0 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";function r(r){return r&&"object"==typeof r&&"default"in r?r:{default:r}}var e=r(require("buffer")),t={exports:{}};
|
|
2
|
+
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
3
|
+
!function(r,t){var n=e.default,o=n.Buffer;function f(r,e){for(var t in r)e[t]=r[t]}function u(r,e,t){return o(r,e,t)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?r.exports=n:(f(n,t),t.Buffer=u),u.prototype=Object.create(o.prototype),f(o,u),u.from=function(r,e,t){if("number"==typeof r)throw new TypeError("Argument must not be a number");return o(r,e,t)},u.alloc=function(r,e,t){if("number"!=typeof r)throw new TypeError("Argument must be a number");var n=o(r);return void 0!==e?"string"==typeof t?n.fill(e,t):n.fill(e):n.fill(0),n},u.allocUnsafe=function(r){if("number"!=typeof r)throw new TypeError("Argument must be a number");return o(r)},u.allocUnsafeSlow=function(r){if("number"!=typeof r)throw new TypeError("Argument must be a number");return n.SlowBuffer(r)}}(t,t.exports),exports.safeBuffer=t;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";var e=require("./index-46767b56.cjs"),t=require("./index-a7b876c9.cjs"),n=require("./browser-ponyfill-262b9a1d.cjs"),s=require("react"),i=require("react-dom"),o=require("./interface-770bfae7.cjs");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function a(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}require("@ethersproject/address"),require("@ethersproject/providers"),require("zustand"),require("events"),require("@ethersproject/constants"),require("@ethersproject/contracts"),require("@ethersproject/properties"),require("@ethersproject/transactions"),require("@ethersproject/bytes"),require("./hash-282034e6.cjs"),require("./inherits_browser-f88a000a.cjs"),require("./id-ce261f66.cjs"),require("./__node-resolve_empty-b9b68f61.cjs");var c,l=r(s),d=a(s),u=r(i),h={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"},p=u.default;if("production"===process.env.NODE_ENV)c=p.createRoot,p.hydrateRoot;else{var f=p.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;c=function(e,t){f.usingClientEntryPoint=!0;try{return p.createRoot(e,t)}finally{f.usingClientEntryPoint=!1}}}var m,g,w=Object.defineProperty,k=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable,E=(e,t,n)=>t in e?w(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,C=(e,t)=>{for(var n in t||(t={}))y.call(t,n)&&E(e,n,t[n]);if(k)for(var n of k(t))b.call(t,n)&&E(e,n,t[n]);return e},S=(e,t)=>{var n={};for(var s in e)y.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(null!=e&&k)for(var s of k(e))t.indexOf(s)<0&&b.call(e,s)&&(n[s]=e[s]);return n};(e=>{const t=class{constructor(e,n,s,i){if(this.version=e,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version value out of range");if(i<-1||i>7)throw new RangeError("Mask value out of range");this.size=4*e+17;let r=[];for(let e=0;e<this.size;e++)r.push(!1);for(let e=0;e<this.size;e++)this.modules.push(r.slice()),this.isFunction.push(r.slice());this.drawFunctionPatterns();const a=this.addEccAndInterleave(s);if(this.drawCodewords(a),-1==i){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);const n=this.getPenaltyScore();n<e&&(i=t,e=n),this.applyMask(t)}}o(0<=i&&i<=7),this.mask=i,this.applyMask(i),this.drawFormatBits(i),this.isFunction=[]}static encodeText(n,s){const i=e.QrSegment.makeSegments(n);return t.encodeSegments(i,s)}static encodeBinary(n,s){const i=e.QrSegment.makeBytes(n);return t.encodeSegments([i],s)}static encodeSegments(e,n,i=1,r=40,c=-1,l=!0){if(!(t.MIN_VERSION<=i&&i<=r&&r<=t.MAX_VERSION)||c<-1||c>7)throw new RangeError("Invalid value");let d,u;for(d=i;;d++){const s=8*t.getNumDataCodewords(d,n),i=a.getTotalBits(e,d);if(i<=s){u=i;break}if(d>=r)throw new RangeError("Data too long")}for(const e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])l&&u<=8*t.getNumDataCodewords(d,e)&&(n=e);let h=[];for(const t of e){s(t.mode.modeBits,4,h),s(t.numChars,t.mode.numCharCountBits(d),h);for(const e of t.getData())h.push(e)}o(h.length==u);const p=8*t.getNumDataCodewords(d,n);o(h.length<=p),s(0,Math.min(4,p-h.length),h),s(0,(8-h.length%8)%8,h),o(h.length%8==0);for(let e=236;h.length<p;e^=253)s(e,8,h);let f=[];for(;8*f.length<h.length;)f.push(0);return h.forEach(((e,t)=>f[t>>>3]|=e<<7-(7&t))),new t(d,n,f,c)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let s=0;s<t;s++)0==n&&0==s||0==n&&s==t-1||n==t-1&&0==s||this.drawAlignmentPattern(e[n],e[s]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){const t=this.errorCorrectionLevel.formatBits<<3|e;let n=t;for(let e=0;e<10;e++)n=n<<1^1335*(n>>>9);const s=21522^(t<<10|n);o(s>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,i(s,e));this.setFunctionModule(8,7,i(s,6)),this.setFunctionModule(8,8,i(s,7)),this.setFunctionModule(7,8,i(s,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,i(s,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,i(s,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,i(s,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^7973*(e>>>11);const t=this.version<<12|e;o(t>>>18==0);for(let e=0;e<18;e++){const n=i(t,e),s=this.size-11+e%3,o=Math.floor(e/3);this.setFunctionModule(s,o,n),this.setFunctionModule(o,s,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let s=-4;s<=4;s++){const i=Math.max(Math.abs(s),Math.abs(n)),o=e+s,r=t+n;0<=o&&o<this.size&&0<=r&&r<this.size&&this.setFunctionModule(o,r,2!=i&&4!=i)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let s=-2;s<=2;s++)this.setFunctionModule(e+s,t+n,1!=Math.max(Math.abs(s),Math.abs(n)))}setFunctionModule(e,t,n){this.modules[t][e]=n,this.isFunction[t][e]=!0}addEccAndInterleave(e){const n=this.version,s=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(n,s))throw new RangeError("Invalid argument");const i=t.NUM_ERROR_CORRECTION_BLOCKS[s.ordinal][n],r=t.ECC_CODEWORDS_PER_BLOCK[s.ordinal][n],a=Math.floor(t.getNumRawDataModules(n)/8),c=i-a%i,l=Math.floor(a/i);let d=[];const u=t.reedSolomonComputeDivisor(r);for(let n=0,s=0;n<i;n++){let i=e.slice(s,s+l-r+(n<c?0:1));s+=i.length;const o=t.reedSolomonComputeRemainder(i,u);n<c&&i.push(0),d.push(i.concat(o))}let h=[];for(let e=0;e<d[0].length;e++)d.forEach(((t,n)=>{(e!=l-r||n>=c)&&h.push(t[e])}));return o(h.length==a),h}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let n=0;for(let t=this.size-1;t>=1;t-=2){6==t&&(t=5);for(let s=0;s<this.size;s++)for(let o=0;o<2;o++){const r=t-o,a=0==(t+1&2)?this.size-1-s:s;!this.isFunction[a][r]&&n<8*e.length&&(this.modules[a][r]=i(e[n>>>3],7-(7&n)),n++)}}o(n==8*e.length)}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let s;switch(e){case 0:s=(n+t)%2==0;break;case 1:s=t%2==0;break;case 2:s=n%3==0;break;case 3:s=(n+t)%3==0;break;case 4:s=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:s=n*t%2+n*t%3==0;break;case 6:s=(n*t%2+n*t%3)%2==0;break;case 7:s=((n+t)%2+n*t%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[t][n]&&s&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let n=0;n<this.size;n++){let s=!1,i=0,o=[0,0,0,0,0,0,0];for(let r=0;r<this.size;r++)this.modules[n][r]==s?(i++,5==i?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,o),s||(e+=this.finderPenaltyCountPatterns(o)*t.PENALTY_N3),s=this.modules[n][r],i=1);e+=this.finderPenaltyTerminateAndCount(s,i,o)*t.PENALTY_N3}for(let n=0;n<this.size;n++){let s=!1,i=0,o=[0,0,0,0,0,0,0];for(let r=0;r<this.size;r++)this.modules[r][n]==s?(i++,5==i?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,o),s||(e+=this.finderPenaltyCountPatterns(o)*t.PENALTY_N3),s=this.modules[r][n],i=1);e+=this.finderPenaltyTerminateAndCount(s,i,o)*t.PENALTY_N3}for(let n=0;n<this.size-1;n++)for(let s=0;s<this.size-1;s++){const i=this.modules[n][s];i==this.modules[n][s+1]&&i==this.modules[n+1][s]&&i==this.modules[n+1][s+1]&&(e+=t.PENALTY_N2)}let n=0;for(const e of this.modules)n=e.reduce(((e,t)=>e+(t?1:0)),n);const s=this.size*this.size,i=Math.ceil(Math.abs(20*n-10*s)/s)-1;return o(0<=i&&i<=9),e+=i*t.PENALTY_N4,o(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(1==this.version)return[];{const e=Math.floor(this.version/7)+2,t=32==this.version?26:2*Math.ceil((4*this.version+4)/(2*e-2));let n=[6];for(let s=this.size-7;n.length<e;s-=t)n.splice(1,0,s);return n}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version number out of range");let n=(16*e+128)*e+64;if(e>=2){const t=Math.floor(e/7)+2;n-=(25*t-10)*t-55,e>=7&&(n-=36)}return o(208<=n&&n<=29648),n}static getNumDataCodewords(e,n){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw new RangeError("Degree out of range");let n=[];for(let t=0;t<e-1;t++)n.push(0);n.push(1);let s=1;for(let i=0;i<e;i++){for(let e=0;e<n.length;e++)n[e]=t.reedSolomonMultiply(n[e],s),e+1<n.length&&(n[e]^=n[e+1]);s=t.reedSolomonMultiply(s,2)}return n}static reedSolomonComputeRemainder(e,n){let s=n.map((e=>0));for(const i of e){const e=i^s.shift();s.push(0),n.forEach(((n,i)=>s[i]^=t.reedSolomonMultiply(n,e)))}return s}static reedSolomonMultiply(e,t){if(e>>>8!=0||t>>>8!=0)throw new RangeError("Byte out of range");let n=0;for(let s=7;s>=0;s--)n=n<<1^285*(n>>>7),n^=(t>>>s&1)*e;return o(n>>>8==0),n}finderPenaltyCountPatterns(e){const t=e[1];o(t<=3*this.size);const n=t>0&&e[2]==t&&e[3]==3*t&&e[4]==t&&e[5]==t;return(n&&e[0]>=4*t&&e[6]>=t?1:0)+(n&&e[6]>=4*t&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){0==t[0]&&(e+=this.size),t.pop(),t.unshift(e)}};let n=t;function s(e,t,n){if(t<0||t>31||e>>>t!=0)throw new RangeError("Value out of range");for(let s=t-1;s>=0;s--)n.push(e>>>s&1)}function i(e,t){return 0!=(e>>>t&1)}function o(e){if(!e)throw new Error("Assertion error")}n.MIN_VERSION=1,n.MAX_VERSION=40,n.PENALTY_N1=3,n.PENALTY_N2=3,n.PENALTY_N3=40,n.PENALTY_N4=10,n.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],n.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=n;const r=class{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw new RangeError("Invalid argument");this.bitData=n.slice()}static makeBytes(e){let t=[];for(const n of e)s(n,8,t);return new r(r.Mode.BYTE,e.length,t)}static makeNumeric(e){if(!r.isNumeric(e))throw new RangeError("String contains non-numeric characters");let t=[];for(let n=0;n<e.length;){const i=Math.min(e.length-n,3);s(parseInt(e.substr(n,i),10),3*i+1,t),n+=i}return new r(r.Mode.NUMERIC,e.length,t)}static makeAlphanumeric(e){if(!r.isAlphanumeric(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");let t,n=[];for(t=0;t+2<=e.length;t+=2){let i=45*r.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t));i+=r.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t+1)),s(i,11,n)}return t<e.length&&s(r.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t)),6,n),new r(r.Mode.ALPHANUMERIC,e.length,n)}static makeSegments(e){return""==e?[]:r.isNumeric(e)?[r.makeNumeric(e)]:r.isAlphanumeric(e)?[r.makeAlphanumeric(e)]:[r.makeBytes(r.toUtf8ByteArray(e))]}static makeEci(e){let t=[];if(e<0)throw new RangeError("ECI assignment value out of range");if(e<128)s(e,8,t);else if(e<16384)s(2,2,t),s(e,14,t);else{if(!(e<1e6))throw new RangeError("ECI assignment value out of range");s(6,3,t),s(e,21,t)}return new r(r.Mode.ECI,0,t)}static isNumeric(e){return r.NUMERIC_REGEX.test(e)}static isAlphanumeric(e){return r.ALPHANUMERIC_REGEX.test(e)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let n=0;for(const s of e){const e=s.mode.numCharCountBits(t);if(s.numChars>=1<<e)return 1/0;n+=4+e+s.bitData.length}return n}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)"%"!=e.charAt(n)?t.push(e.charCodeAt(n)):(t.push(parseInt(e.substr(n+1,2),16)),n+=2);return t}};let a=r;a.NUMERIC_REGEX=/^[0-9]*$/,a.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,a.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",e.QrSegment=a})(m||(m={})),(e=>{const t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};let n=t;n.LOW=new t(0,1),n.MEDIUM=new t(1,0),n.QUARTILE=new t(2,3),n.HIGH=new t(3,2),e.Ecc=n})((g=m||(m={})).QrCode||(g.QrCode={})),(e=>{(e=>{const t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};let n=t;n.NUMERIC=new t(1,[10,12,14]),n.ALPHANUMERIC=new t(2,[9,11,13]),n.BYTE=new t(4,[8,16,16]),n.KANJI=new t(8,[8,10,12]),n.ECI=new t(7,[0,0,0]),e.Mode=n})(e.QrSegment||(e.QrSegment={}))})(m||(m={}));var v=m,x={L:v.QrCode.Ecc.LOW,M:v.QrCode.Ecc.MEDIUM,Q:v.QrCode.Ecc.QUARTILE,H:v.QrCode.Ecc.HIGH},A=128,I="L",O="#FFFFFF",R="#000000",N=!1,T=4,_=.1;
|
|
2
|
+
/**
|
|
3
|
+
* @license qrcode.react
|
|
4
|
+
* Copyright (c) Paul O'Shannessy
|
|
5
|
+
* SPDX-License-Identifier: ISC
|
|
6
|
+
*/function M(e){const t=e,{value:n,size:s=A,level:i=I,bgColor:o=O,fgColor:r=R,includeMargin:a=N,imageSettings:c}=t,d=S(t,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let u=v.QrCode.encodeText(n,x[i]).getModules();const h=a?T:0,p=u.length+2*h,f=function(e,t,n,s){if(null==s)return null;const i=n?T:0,o=e.length+2*i,r=Math.floor(t*_),a=o/t,c=(s.width||r)*a,l=(s.height||r)*a,d=null==s.x?e.length/2-c/2:s.x*a,u=null==s.y?e.length/2-l/2:s.y*a;let h=null;if(s.excavate){let e=Math.floor(d),t=Math.floor(u);h={x:e,y:t,w:Math.ceil(c+d-e),h:Math.ceil(l+u-t)}}return{x:d,y:u,h:l,w:c,excavation:h}}(u,s,a,c);let m=null;var g,w;null!=c&&null!=f&&(null!=f.excavation&&(g=u,w=f.excavation,u=g.slice().map(((e,t)=>t<w.y||t>=w.y+w.h?e:e.map(((e,t)=>(t<w.x||t>=w.x+w.w)&&e))))),m=l.default.createElement("image",{xlinkHref:c.src,height:f.h,width:f.w,x:f.x+h,y:f.y+h,preserveAspectRatio:"none"}));const k=function(e,t=0){const n=[];return e.forEach((function(e,s){let i=null;e.forEach((function(o,r){if(!o&&null!==i)return n.push(`M${i+t} ${s+t}h${r-i}v1H${i+t}z`),void(i=null);if(r!==e.length-1)o&&null===i&&(i=r);else{if(!o)return;null===i?n.push(`M${r+t},${s+t} h1v1H${r+t}z`):n.push(`M${i+t},${s+t} h${r+1-i}v1H${i+t}z`)}}))})),n.join("")}(u,h);return l.default.createElement("svg",C({height:s,width:s,viewBox:`0 0 ${p} ${p}`},d),l.default.createElement("path",{fill:o,d:`M0,0 h${p}v${p}H0z`,shapeRendering:"crispEdges"}),l.default.createElement("path",{fill:r,d:k,shapeRendering:"crispEdges"}),m)}!function(){try{(new Path2D).addPath(new Path2D)}catch(e){return!1}}();var B="\n.pointer-events-auto {\n pointer-events: auto;\n}\n\n.fixed {\n position: fixed;\n}\n\n.absolute {\n position: absolute;\n}\n\n.relative {\n position: relative;\n}\n\n.bottom-0 {\n bottom: 0px;\n}\n\n.left-0 {\n left: 0px;\n}\n\n.top-0 {\n top: 0px;\n}\n\n.top-2\\/4 {\n top: 50%;\n}\n\n.m-auto {\n margin: auto;\n}\n\n.mx-\\[4px\\] {\n margin-left: 4px;\n margin-right: 4px;\n}\n\n.mb-4 {\n margin-bottom: 1rem;\n}\n\n.mb-6 {\n margin-bottom: 1.5rem;\n}\n\n.ml-1 {\n margin-left: 0.25rem;\n}\n\n.mt-6 {\n margin-top: 1.5rem;\n}\n\n.mt-\\[35px\\] {\n margin-top: 35px;\n}\n\n.flex {\n display: flex;\n}\n\n.grid {\n display: grid;\n}\n\n.h-\\[200px\\] {\n height: 200px;\n}\n\n.h-\\[24px\\] {\n height: 24px;\n}\n\n.h-\\[40px\\] {\n height: 40px;\n}\n\n.h-\\[52px\\] {\n height: 52px;\n}\n\n.h-full {\n height: 100%;\n}\n\n.w-\\[150px\\] {\n width: 150px;\n}\n\n.w-\\[200px\\] {\n width: 200px;\n}\n\n.w-\\[20px\\] {\n width: 20px;\n}\n\n.w-\\[24px\\] {\n width: 24px;\n}\n\n.w-\\[343px\\] {\n width: 343px;\n}\n\n.w-\\[60px\\] {\n width: 60px;\n}\n\n.w-\\[75px\\] {\n width: 75px;\n}\n\n.w-full {\n width: 100%;\n}\n\n.translate-y-\\[-50\\%\\] {\n --tw-translate-y: -50%;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.cursor-pointer {\n cursor: pointer;\n}\n\n.grid-flow-col {\n grid-auto-flow: column;\n}\n\n.grid-cols-2 {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n}\n\n.items-center {\n align-items: center;\n}\n\n.justify-end {\n justify-content: flex-end;\n}\n\n.justify-center {\n justify-content: center;\n}\n\n.justify-between {\n justify-content: space-between;\n}\n\n.gap-x-4 {\n -moz-column-gap: 1rem;\n column-gap: 1rem;\n}\n\n.gap-y-2 {\n row-gap: 0.5rem;\n}\n\n.rounded {\n border-radius: 0.25rem;\n}\n\n.rounded-2xl {\n border-radius: 1rem;\n}\n\n.rounded-lg {\n border-radius: 0.5rem;\n}\n\n.rounded-t-2xl {\n border-top-left-radius: 1rem;\n border-top-right-radius: 1rem;\n}\n\n.border {\n border-width: 1px;\n}\n\n.border-b {\n border-bottom-width: 1px;\n}\n\n.border-gray-300 {\n --tw-border-opacity: 1;\n border-color: rgb(209 213 219 / var(--tw-border-opacity));\n}\n\n.bg-black\\/\\[\\.80\\] {\n background-color: rgb(0 0 0 / .80);\n}\n\n.bg-white {\n --tw-bg-opacity: 1;\n background-color: rgb(255 255 255 / var(--tw-bg-opacity));\n}\n\n.p-\\[12px\\] {\n padding: 12px;\n}\n\n.px-4 {\n padding-left: 1rem;\n padding-right: 1rem;\n}\n\n.px-6 {\n padding-left: 1.5rem;\n padding-right: 1.5rem;\n}\n\n.py-3 {\n padding-top: 0.75rem;\n padding-bottom: 0.75rem;\n}\n\n.py-4 {\n padding-top: 1rem;\n padding-bottom: 1rem;\n}\n\n.pb-6 {\n padding-bottom: 1.5rem;\n}\n\n.pt-\\[20px\\] {\n padding-top: 20px;\n}\n\n.text-center {\n text-align: center;\n}\n\n.text-base {\n font-size: 1rem;\n line-height: 1.5rem;\n}\n\n.font-medium {\n font-weight: 500;\n}\n\n.text-\\[\\#1E2329\\] {\n --tw-text-opacity: 1;\n color: rgb(30 35 41 / var(--tw-text-opacity));\n}\n\n.text-\\[\\#929AA5\\] {\n --tw-text-opacity: 1;\n color: rgb(146 154 165 / var(--tw-text-opacity));\n}\n\n.shadow-inner {\n --tw-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);\n --tw-shadow-colored: inset 0 2px 4px 0 var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n\n.duration-300 {\n transition-duration: 300ms;\n}\n\n.ease-in-out {\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n.will-change-auto {\n will-change: auto;\n}\n\n.will-change-transform {\n will-change: transform;\n}\n\n.body3 {\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 20px;\n}\n\n.subtitle1 {\n font-size: 20px;\n font-style: normal;\n font-weight: 600;\n line-height: 28px;\n}\n\n.subtitle3 {\n font-size: 16px;\n font-style: normal;\n font-weight: 500;\n line-height: 24px;\n /* 150% */\n}\n\n.caption2 {\n font-size: 12px;\n font-style: normal;\n font-weight: 400;\n line-height: 16px;\n}\n\n.t-black {\n color: #0b0e11;\n}\n\n.t-brand {\n color: #c99400;\n}\n\n.t-primary {\n color: #202630;\n}\n\n.t-secondary {\n color: #474d57;\n}\n\n.bg-primary {\n background: #fcd535;\n}\n\n@media (min-width: 768px) {\n .md\\:subtitle1 {\n font-size: 20px;\n font-style: normal;\n font-weight: 600;\n line-height: 28px;\n }\n\n .md\\:w-\\[400px\\] {\n width: 400px;\n }\n\n .md\\:font-semibold {\n font-weight: 600;\n }\n}\n\n@media (min-width: 1024px) {\n .lg\\:p-8 {\n padding: 2rem;\n }\n\n .lg\\:pt-6 {\n padding-top: 1.5rem;\n }\n\n .lg\\:text-xl {\n font-size: 1.25rem;\n line-height: 1.75rem;\n }\n}\n\n*, :before, :after {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / .5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n}\n:root {\n --animation-duration: 300ms;\n}\n\n\n@keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n@keyframes fadeOut {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n}\n\n.animated {\n animation-duration: var(--animation-duration);\n animation-fill-mode: both;\n}\n\n.fadeIn {\n animation-name: fadeIn;\n}\n\n.fadeOut {\n animation-name: fadeOut;\n}\n\n#binanceW3W-wrapper {\n -webkit-user-select: none;\n align-items: center;\n display: flex;\n height: 100%;\n justify-content: center;\n left: 0;\n pointer-events: none;\n position: fixed;\n top: 0;\n user-select: none;\n width: 100%;\n z-index: 99999999999999;\n}\n",P=s.createContext({}),D="binanceW3W-wrapper",j="binanceW3W-style-sheet",L="binanceW3W-qrcode-modal",F="https://app.appsflyer.com/com.binance.dev?pid=https%3A%2F%2Fwww.binance.com%2Fen&c=https%3A%2F%2Fwww.binance.com%2Fen",z="https://app.appsflyer.com/id1436799971?pid=https%3A%2F%2Fwww.binance.com%2Fen&c=https%3A%2F%2Fwww.binance.com%2Fen",U="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNTYiIHZpZXdCb3g9IjAgMCA1NiA1NiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3QgeD0iMiIgeT0iMiIgd2lkdGg9IjUyIiBoZWlnaHQ9IjUyIiByeD0iMTAiIGZpbGw9IiMxNDE1MUEiIHN0cm9rZT0id2hpdGUiIHN0cm9rZS13aWR0aD0iNCIvPgo8cGF0aCBkPSJNMTIgMjhMMTUuNjEyOSAyNC4zODcxTDE5LjIyNTggMjhMMTUuNjEyOSAzMS42MTI5TDEyIDI4WiIgZmlsbD0iI0YwQjkwQiIvPgo8cGF0aCBkPSJNMTguMTkzNSAyMS44MDY1TDI4IDEyTDM3LjgwNjUgMjEuODA2NUwzNC4xOTM2IDI1LjQxOTRMMjggMTkuMjI1OEwyMS44MDY1IDI1LjQxOTRMMTguMTkzNSAyMS44MDY1WiIgZmlsbD0iI0YwQjkwQiIvPgo8cGF0aCBkPSJNMjQuMzg3MSAyOEwyOCAyNC4zODcxTDMxLjYxMjkgMjhMMjggMzEuNjEyOUwyNC4zODcxIDI4WiIgZmlsbD0iI0YwQjkwQiIvPgo8cGF0aCBkPSJNMjEuODA2NSAzMC41ODA2TDE4LjE5MzUgMzQuMTkzNUwyOCA0NEwzNy44MDY1IDM0LjE5MzVMMzQuMTkzNiAzMC41ODA2TDI4IDM2Ljc3NDJMMjEuODA2NSAzMC41ODA2WiIgZmlsbD0iI0YwQjkwQiIvPgo8cGF0aCBkPSJNMzYuNzc0MiAyOEw0MC4zODcxIDI0LjM4NzFMNDQgMjhMNDAuMzg3MSAzMS42MTI5TDM2Ljc3NDIgMjhaIiBmaWxsPSIjRjBCOTBCIi8+Cjwvc3ZnPgo=",H=()=>{let[e,n]=s.useState(),[i,o]=s.useState(!1);return s.useEffect((()=>{let e=t.z0(),s=t.X0();n(e),o(s)}),[]),{isMobile:e,isAndroid:i}},q={en:{"sdk-download-android":"Download for Android","sdk-connect":"Connect","sdk-download-ios":"Download for iOS","sdk-install":"Install","sdk-modal-instruct-1":"1. Open Binance app","sdk-modal-instruct-2":"2. Tap {{icon}} on Home Screen","sdk-modal-title":"Connect With Binance","sdk-no-app":"Don’t have the Binance app yet?"},ar:{"sdk-download-android":"تنزيل لنظام Android","sdk-connect":"اتصال","sdk-download-ios":"تنزيل لنظام iOS","sdk-install":"تثبيت","sdk-modal-instruct-1":"1. افتح تطبيق Binance","sdk-modal-instruct-2":"2. اضغط {{icon}} على الشاشة الرئيسية","sdk-modal-title":"الربط مع Binance (بينانس)","sdk-no-app":"ليس لديك تطبيق Binance حتّى الآن؟"},"bg-BG":{"sdk-download-android":"Изтегляне за Android","sdk-connect":"Свържи","sdk-download-ios":"Изтегляне за iOS","sdk-install":"Инсталиране","sdk-modal-instruct-1":"1. Отворете приложението Binance","sdk-modal-instruct-2":"2. Докоснете {{icon}} на началния екран","sdk-modal-title":"Свържете се с Binance","sdk-no-app":"Все още нямате приложението Binance?"},"zh-CN":{"sdk-download-android":"下载安卓版","sdk-connect":"关联","sdk-download-ios":"下载iOS版","sdk-install":"安装","sdk-modal-instruct-1":"1.打开币安App","sdk-modal-instruct-2":"2.点击主屏幕的{{icon}}","sdk-modal-title":"关联币安","sdk-no-app":"尚未安装币安App?"},"zh-TW":{"sdk-download-android":"Android 下載","sdk-connect":"連接","sdk-download-ios":"iOS 下載","sdk-install":"安裝","sdk-modal-instruct-1":"1. 開啟幣安 App","sdk-modal-instruct-2":"2. 在首頁畫面上點擊 {{icon}}","sdk-modal-title":"與幣安連接","sdk-no-app":"還沒有幣安 App 嗎?"},"cs-CZ":{"sdk-download-android":"Stáhnout pro Android","sdk-connect":"Připojit","sdk-download-ios":"Stáhnout pro iOS","sdk-install":"Instalovat","sdk-modal-instruct-1":"1. Otevřete aplikaci Binance","sdk-modal-instruct-2":"2. Klepněte na {{icon}} na domovské obrazovce","sdk-modal-title":"Připojit platformu Binance","sdk-no-app":"Ještě nemáte aplikaci Binance?"},"fr-FR":{"sdk-download-android":"Télécharger pour Android","sdk-connect":"Se connecter","sdk-download-ios":"Télécharger pour iOS","sdk-install":"Installer","sdk-modal-instruct-1":"1. Ouvrez l’application de Binance","sdk-modal-instruct-2":"2. Appuyez sur {{icon}} sur l’écran d’accueil","sdk-modal-title":"Se connecter à Binance","sdk-no-app":"Vous n’avez pas encore l’application de Binance ?"},"de-DE":{"sdk-download-android":"Für Android herunterladen","sdk-connect":"Verbinden","sdk-download-ios":"Für iOS herunterladen","sdk-install":"Installieren","sdk-modal-instruct-1":"1. Binance-App öffnen","sdk-modal-instruct-2":"2. Tippe auf dem Startbildschirm auf {{icon}}","sdk-modal-title":"Mit Binance verknüpfen","sdk-no-app":"Du hast die Binance-App noch nicht?"},"el-GR":{"sdk-download-android":"Λήψη για Android","sdk-connect":"Συνδεθείτε","sdk-download-ios":"Λήψη για iOS","sdk-install":"Εγκατάσταση","sdk-modal-instruct-1":"1. Ανοίξτε την εφαρμογή Binance","sdk-modal-instruct-2":"2. Πατήστε {{icon}} στην αρχική οθόνη","sdk-modal-title":"Συνδεθείτε με την Binance","sdk-no-app":"Δεν έχετε ακόμα την εφαρμογή Binance;"},"id-ID":{"sdk-download-android":"Unduh untuk Android","sdk-connect":"Terhubung","sdk-download-ios":"Unduh untuk iOS","sdk-install":"Instal","sdk-modal-instruct-1":"1. Buka aplikasi Binance","sdk-modal-instruct-2":"2. Ketuk {{icon}} di Layar Beranda","sdk-modal-title":"Hubungkan dengan Binance","sdk-no-app":"Belum punya aplikasi Binance?"},"it-IT":{"sdk-download-android":"Scarica per Android","sdk-connect":"Collega","sdk-download-ios":"Scarica per iOS","sdk-install":"Installa","sdk-modal-instruct-1":"1. Apri l'app Binance","sdk-modal-instruct-2":"2. Tocca {{icon}} nella homepage","sdk-modal-title":"Collega con Binance","sdk-no-app":"Non hai ancora l'app Binance?"},"kk-KZ":{"sdk-download-android":"Android үшін жүктеп алу","sdk-connect":"Қосылу","sdk-download-ios":"iOS үшін жүктеп алу","sdk-install":"Орнату","sdk-modal-instruct-1":"1. Binance қолданбасын ашыңыз","sdk-modal-instruct-2":"2. Басты экрандағы {{icon}} белгішесін түртіңіз","sdk-modal-title":"Binance платформасымен байланыстыру","sdk-no-app":"Сізде әлі Binance қолданбасы жоқ па?"},"lv-LV":{"sdk-download-android":"Lejupielādēt Android ierīcei","sdk-connect":"Savienot","sdk-download-ios":"Lejupielādēt iOS ierīcei","sdk-install":"Instalēt","sdk-modal-instruct-1":"1. Atver Binance lietotni","sdk-modal-instruct-2":"2. Pieskaries pie {{icon}} sākuma ekrānā","sdk-modal-title":"Savieno ar Binance","sdk-no-app":"Vai tev vēl nav Binance lietotnes?"},"pl-PL":{"sdk-download-android":"Pobierz na Androida","sdk-connect":"Połącz","sdk-download-ios":"Pobierz na iOS","sdk-install":"Zainstaluj","sdk-modal-instruct-1":"1. Otwórz Aplikację Binance","sdk-modal-instruct-2":"2. Kliknij {{icon}} na ekranie głównym","sdk-modal-title":"Połącz z Binance","sdk-no-app":"Nie masz jeszcze aplikacji Binance?"},"pt-BR":{"sdk-download-android":"Baixar para Android","sdk-connect":"Conecte","sdk-download-ios":"Baixar para iOS","sdk-install":"Instalar","sdk-modal-instruct-1":"1. Abra o Aplicativo da Binance","sdk-modal-instruct-2":"2. Toque em {{icon}} na Tela Inicial","sdk-modal-title":"Conectar com a Binance","sdk-no-app":"Ainda não tem o aplicativo da Binance?"},"pt-PT":{"sdk-download-android":"Transferir para Android","sdk-connect":"Associar","sdk-download-ios":"Transferir para iOS","sdk-install":"Instalar","sdk-modal-instruct-1":"1. Abre a aplicação Binance","sdk-modal-instruct-2":"2. Toca em {{icon}} no Ecrã Inicial","sdk-modal-title":"Associa com a Binance","sdk-no-app":"Ainda não tens a aplicação Binance?"},"ro-RO":{"sdk-download-android":"Descărcați pentru Android","sdk-connect":"Conectare","sdk-download-ios":"Descărcați pentru iOS","sdk-install":"Instalați","sdk-modal-instruct-1":"1. Deschideți aplicația Binance","sdk-modal-instruct-2":"2. Atingeți {{icon}} pe ecranul de pornire","sdk-modal-title":"Conectați-vă cu Binance","sdk-no-app":"Nu aveți încă aplicația Binance?"},"ru-RU":{"sdk-download-android":"Скачать для Android","sdk-connect":"Подключить","sdk-download-ios":"Скачать для iOS","sdk-install":"Установить","sdk-modal-instruct-1":"1. Откройте приложение Binance","sdk-modal-instruct-2":"2. Нажмите {{icon}} на главном экране","sdk-modal-title":"Подключить кошелек Binance","sdk-no-app":"У вас еще нет приложения Binance?"},"sk-SK":{"sdk-download-android":"Stiahnuť pre Android","sdk-connect":"Pripojiť","sdk-download-ios":"Stiahnuť pre iOS","sdk-install":"Nainštalovať","sdk-modal-instruct-1":"1. Otvorte aplikáciu Binance","sdk-modal-instruct-2":"2. Klepnite na ikonu {{icon}} na domovskej obrazovke","sdk-modal-title":"Spojte sa s Binance","sdk-no-app":"Ešte nemáte aplikáciu Binance?"},"sl-SI":{"sdk-download-android":"Prenos za Android","sdk-connect":"Poveži","sdk-download-ios":"Prenos za iOS","sdk-install":"Namesti","sdk-modal-instruct-1":"1. Odprite aplikacijo Binance","sdk-modal-instruct-2":"2. Tapnite {{icon}} na začetnem zaslonu","sdk-modal-title":"Povežite se s platformo Binance","sdk-no-app":"Še nimate aplikacije Binance?"},"es-LA":{"sdk-download-android":"Descargar para Android","sdk-connect":"Conecta","sdk-download-ios":"Descargar para iOS","sdk-install":"Instala","sdk-modal-instruct-1":"1. Abre la aplicación de Binance","sdk-modal-instruct-2":"2. Toca {{icon}} en la pantalla de inicio","sdk-modal-title":"Conectar con Binance","sdk-no-app":"¿Aún no tienes la aplicación de Binance?"},"es-ES":{"sdk-download-android":"Descargar para Android","sdk-connect":"Conectar","sdk-download-ios":"Descargar para iOS","sdk-install":"Instalar","sdk-modal-instruct-1":"1. Open Binance app","sdk-modal-instruct-2":"2. Pulsa en {{icon}} en la página principal","sdk-modal-title":"Connect With Binance","sdk-no-app":"¿Aún no tienes la aplicación de Binance?"},"sv-SE":{"sdk-download-android":"Ladda ned för Android","sdk-connect":"Anslut","sdk-download-ios":"Ladda ned för iOS","sdk-install":"Installera","sdk-modal-instruct-1":"1. Öppna Binance-appen","sdk-modal-instruct-2":"2. Tryck på {{icon}} på startskärmen","sdk-modal-title":"Anslut med Binance","sdk-no-app":"Har du inte Binance-appen ännu?"},"tr-TR":{"sdk-download-android":"Android için indir","sdk-connect":"Bağlan","sdk-download-ios":"iOS için indir","sdk-install":"Yükle","sdk-modal-instruct-1":"1. Binance Uygulamasını Açın","sdk-modal-instruct-2":"2. Ana Ekranda {{icon}} simgesine dokunun","sdk-modal-title":"Binance ile Bağlanın","sdk-no-app":"Henüz Binance uygulamanız yok mu?"},"uk-UA":{"sdk-download-android":"Завантажити для Android","sdk-connect":"Підключитись","sdk-download-ios":"Завантажити для iOS","sdk-install":"Встановити","sdk-modal-instruct-1":"1. Відкрийте застосунок Binance","sdk-modal-instruct-2":"2. Торкніться {{icon}} на головному екрані","sdk-modal-title":"Підключіться до Binance","sdk-no-app":"Ще не маєте застосунку Binance?"},"vi-VN":{"sdk-download-android":"Tải xuống cho Android","sdk-connect":"Kết nối","sdk-download-ios":"Tải xuống cho iOS","sdk-install":"Cài đặt","sdk-modal-instruct-1":"1. Mở ứng dụng Binance","sdk-modal-instruct-2":"2. Nhấn vào {{icon}} trên Màn hình chính","sdk-modal-title":"Kết nối với Binance","sdk-no-app":"Bạn chưa có ứng dụng Binance?"},"da-DK":{"sdk-download-android":"Download til Android","sdk-connect":"Forbind","sdk-download-ios":"Download til iOS","sdk-install":"Installer","sdk-modal-instruct-1":"1. Åbn Binance-appen","sdk-modal-instruct-2":"2. Tryk på {{icon}} på startskærmen","sdk-modal-title":"Forbind til Binance","sdk-no-app":"Har du ikke Binance-appen endnu?"},"my-MM":{"sdk-download-android":"အန်းဒရွိုက်အတွက် ဒေါင်းလုဒ်လုပ်မည်","sdk-connect":"ချိတ်ဆက်မည်","sdk-download-ios":"iOS အတွက် ဒေါင်းလုဒ်လုပ်မည်","sdk-install":"ထည့်သွင်းမည်","sdk-modal-instruct-1":"1. Open Binance app","sdk-modal-instruct-2":"ပင်မမျက်နှာပြင်မှ {{icon}} ကိုနှိပ်ပါ။","sdk-modal-title":"Connect With Binance","sdk-no-app":"Binance App မရှိသေးဘူးလား။"},"lo-LA":{"sdk-download-android":"ດາວໂຫຼດສໍາລັບ Android","sdk-connect":"ເຊື່ອມຕໍ່","sdk-download-ios":"ດາວໂຫຼດສໍາລັບ iOS","sdk-install":"ຕິດຕັ້ງ","sdk-modal-instruct-1":"1. ເປີດແອັບ Binance","sdk-modal-instruct-2":"2. ແຕະ {{icon}} ໃນໜ້າຈໍຫຼັກ","sdk-modal-title":"ເຊື່ອມຕໍ່ກັບ Binance","sdk-no-app":"ຍັງບໍ່ມີແອັບ Binance ເທື່ອບໍ?"},"si-LK":{"sdk-download-android":"Android සඳහා බාගත කරන්න","sdk-connect":"සම්බන්ධ කරන්න","sdk-download-ios":"iOS සඳහා බාගත කරන්න","sdk-install":"ස්ථාපනය කරන්න","sdk-modal-instruct-1":"1. Binance යෙදුම විවෘත කරන්න","sdk-modal-instruct-2":"2. මුල් තිරයේ {{icon}} මත තට්ටු කරන්න","sdk-modal-title":"Binance සමග සම්බන්ධ වන්න","sdk-no-app":"තවමත් Binance යෙදුම නැති ද?"}},V=["en","ar","bg-BG","zh-CN","zh-TW","cs-CZ","fr-FR","de-DE","el-GR","id-ID","it-IT","kk-KZ","lv-LV","pl-PL","pt-BR","pt-PT","ro-RO","ru-RU","sk-SK","sl-SI","es-LA","es-ES","sv-SE","tr-TR","uk-UA","vi-VN","da-DK","my-MM","lo-LA","si-LK"].reduce(((e,t)=>(e[t]=q[t],e)),{}),W=V,$=()=>{let{lng:e}=s.useContext(P);return s.useCallback(((t,n)=>W?.[e]?.[t]||W?.en?.[t]||n?.default||t),[e])},J=({size:e=24,color:t="currentColor",className:n,children:s,...i})=>l.default.createElement("svg",{width:e,height:e,fill:t,className:n,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...i},s),Q=e=>l.default.createElement(J,{size:24,...e},l.default.createElement("path",{d:"M21.7725 18.7033C21.4062 19.5418 20.9727 20.3136 20.4704 21.0232C19.7857 21.9906 19.2251 22.6602 18.7931 23.032C18.1233 23.6424 17.4058 23.955 16.6374 23.9728C16.0857 23.9728 15.4205 23.8172 14.6461 23.5017C13.8692 23.1876 13.1552 23.032 12.5024 23.032C11.8177 23.032 11.0834 23.1876 10.2979 23.5017C9.51127 23.8172 8.87756 23.9816 8.39305 23.9979C7.65619 24.0291 6.92173 23.7076 6.1886 23.032C5.72069 22.6276 5.13542 21.9343 4.43429 20.9521C3.68203 19.9033 3.06358 18.687 2.57906 17.3004C2.06017 15.8026 1.80005 14.3523 1.80005 12.9482C1.80005 11.3398 2.15076 9.95259 2.85324 8.79011C3.40532 7.85636 4.13979 7.11979 5.05903 6.57906C5.97827 6.03834 6.97151 5.76279 8.04114 5.74516C8.62641 5.74516 9.39391 5.92456 10.3477 6.27715C11.2988 6.63091 11.9095 6.81032 12.1772 6.81032C12.3774 6.81032 13.0558 6.60054 14.2058 6.18233C15.2934 5.79449 16.2113 5.63391 16.9633 5.69716C19.0009 5.86012 20.5317 6.6561 21.5497 8.09013C19.7274 9.18432 18.826 10.7169 18.8439 12.6829C18.8603 14.2142 19.4209 15.4886 20.5227 16.5004C21.022 16.97 21.5796 17.333 22.2001 17.5907C22.0655 17.9774 21.9235 18.3477 21.7725 18.7033ZM17.0993 0.480137C17.0993 1.68041 16.6568 2.8011 15.7748 3.8384C14.7104 5.07155 13.4229 5.78412 12.0268 5.67168C12.009 5.52769 11.9987 5.37614 11.9987 5.21688C11.9987 4.06462 12.5049 2.83147 13.4038 1.82321C13.8526 1.3127 14.4234 0.888228 15.1155 0.549615C15.8062 0.216055 16.4595 0.031589 17.0739 0C17.0918 0.160458 17.0993 0.320926 17.0993 0.480121V0.480137Z",fill:"#1E2329"})),K=e=>l.default.createElement(J,{size:24,...e},l.default.createElement("path",{d:"M13.5589 11.0874L4.08203 1.59644H4.17441C4.98558 1.59644 5.68614 1.89129 6.81073 2.4993L16.7488 7.88083L13.5589 11.0874Z",fill:"#202630"}),l.default.createElement("path",{d:"M12.6373 12.008L2.90218 21.7203C2.66236 21.3329 2.49658 20.7063 2.49658 19.8034V4.19354C2.49658 3.29078 2.66236 2.66403 2.90218 2.2771L12.6373 12.008Z",fill:"#202630"}),l.default.createElement("path",{d:"M13.5589 12.9124L16.7488 16.1187L6.81073 21.5001C5.68614 22.1083 4.98548 22.4036 4.17441 22.4036H4.08203L13.5589 12.9124Z",fill:"#202630"}),l.default.createElement("path",{d:"M17.9437 8.52563L14.4775 12.0091L17.9437 15.4738L20.0456 14.3309C20.8199 13.9069 22 13.1329 22 12.0091C22 10.8662 20.8199 10.0922 20.0456 9.66821L17.9437 8.52563Z",fill:"#202630"})),G=e=>l.default.createElement(J,{size:24,...e},l.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.5 4H10.5V7H7.5V10H4.5V7V4H7.5ZM14.5 4H17.5H20.5V7V10H17.5V7H14.5V4ZM10.5 20V17H7.5V14H4.5V17V20H7.5H10.5ZM17.5 20H14.5V17H17.5V14H20.5V17V20H17.5ZM16.5 10.5H8.5V13.5H16.5V10.5Z",fill:"#202630"})),Y=({value:e,...t})=>{let n=Z(e).map((e=>"string"==typeof e?e:l.default.cloneElement(t[e.key],{key:e.key})));return l.default.createElement(l.default.Fragment,null,n)},Z=e=>{let t,n=/{{(.*?)}}/g,s=0,i=[];for(;null!==(t=n.exec(e));)t.index!==s&&i.push(e.substring(s,t.index)),i.push({key:t[1]}),s=n.lastIndex;return s!==e.length&&i.push(e.substring(s)),i},X=()=>{let e=$();return l.default.createElement(l.default.Fragment,null,l.default.createElement(ee,{t:e}),l.default.createElement(te,{t:e}),l.default.createElement(ne,null))},ee=({t:e})=>l.default.createElement("div",{style:{borderBottom:"1px solid #EAECEF"},className:"grid justify-center gap-y-2 pb-6 body3 t-black border-b border-gray-300"},l.default.createElement("div",null,e("sdk-modal-instruct-1",{default:"1. Open Binance app"})),l.default.createElement("div",{className:"flex items-center"},l.default.createElement(Y,{value:e("sdk-modal-instruct-2",{default:"2. Tap {{icon}} on Home"}),icon:l.default.createElement(G,{className:"w-[24px] h-[24px] mx-[4px]"})}))),te=({t:e})=>l.default.createElement("div",{className:"py-4 body3 t-secondary text-center"},e("sdk-no-app",{default:"Don't have Binance app yet?"})),ne=()=>l.default.createElement("div",{className:"grid grid-cols-2 gap-x-4"},l.default.createElement(se,{type:"iOS"}),l.default.createElement(se,{type:"Android"})),se=({type:e})=>{let t=$();return l.default.createElement("div",{style:{border:"1px solid #EAECEF"},className:"p-[12px] rounded-lg grid cursor-pointer t-secondary grid-flow-col items-center gap-x-4 w-[150px]",onClick:()=>{window.open("Android"===e?F:z,"_blank")}},"Android"===e?l.default.createElement(K,{className:"w-[24px] h-[24px] m-auto"}):l.default.createElement(Q,{className:"w-[24px] h-[24px] m-auto"}),l.default.createElement("div",{className:"w-[75px] caption2 t-secondary"},t(`sdk-download-${e.toLowerCase()}`,{default:`Download for ${e}`})))},ie=e=>l.default.createElement(J,{...e},l.default.createElement("path",{d:"M6.69708 4.57538L4.57576 6.6967L9.87906 12L4.57576 17.3033L6.69708 19.4246L12.0004 14.1213L17.3037 19.4246L19.425 17.3033L14.1217 12L19.425 6.6967L17.3037 4.57538L12.0004 9.87868L6.69708 4.57538Z",fill:"currentColor"})),oe=({onClose:e})=>{let t=$();return l.default.createElement("div",{className:"flex items-center justify-between"},l.default.createElement("p",{className:"text-base font-medium text-[#1E2329] lg:text-xl md:font-semibold md:subtitle1"},t("sdk-modal-title",{default:"Connect with Binance"})),l.default.createElement("div",{className:"cursor-pointer text-[#929AA5]",onClick:e},l.default.createElement(ie,null)))},re=({id:e,onClose:t,onConnect:n})=>{let s=$();return l.default.createElement("div",{id:e,className:"animated fadeIn pointer-events-auto fixed top-0 left-0 h-full w-full bg-black/[.80] duration-300 ease-in-out will-change-auto"},l.default.createElement("div",{className:"absolute bottom-0 m-auto w-full rounded-t-2xl bg-white px-4 pb-6 shadow-inner duration-300 ease-in-out will-change-transform md:w-[400px]"},l.default.createElement(ae,{onClose:t}),l.default.createElement("div",{className:"mt-6 mb-4 flex justify-center"},l.default.createElement("img",{className:"w-[60px]",src:U})),l.default.createElement("div",{className:"subtitle1 text-center mb-6 t-primary"},s("sdk-modal-title",{default:"Connect with Binance"})),l.default.createElement("button",{onClick:n,style:{borderColor:"transparent"},className:"w-full rounded h-[40px] flex justify-center items-center bg-primary t-primary subtitle3 mb-4"},s("sdk-connect",{default:"Connect"})),l.default.createElement("div",{className:"text-center py-3"},l.default.createElement("span",null,s("sdk-no-app",{default:"Don’t have Binance app yet?"})),l.default.createElement("a",{target:"_blank",href:"https://www.binance.com/en/download",className:"t-brand ml-1"},s("sdk-install",{default:"Install"})))))},ae=({onClose:e})=>l.default.createElement("div",{className:"flex items-center justify-end h-[52px]"},l.default.createElement("div",{className:"cursor-pointer text-[#929AA5]",onClick:e},l.default.createElement(ie,{className:"w-[20px]"}))),ce=e=>{let t=document.createElement("a");t.href=e,document.body.appendChild(t),((e,t)=>{let n="visibilitychange",s=setTimeout((()=>{document.hidden||e()}),t),i=()=>{document.hidden&&(clearTimeout(s),document.removeEventListener(n,i))};document.addEventListener(n,i,!1)})((()=>{window.location.href="https://www.binance.com/en/download"}),1e3),t.click(),document.body.removeChild(t)};var le=function(e){let{toBinance:n}=(e=>{let{isAndroid:n,isMobile:s}=H();return{toBinance:()=>{let i=t.Z0(n,e);if(s){if(!n){let e=document.createElement("a");e.href=i,document.body.appendChild(e),e.click(),document.body.removeChild(e)}n&&ce(i)}}}})(e.url);return l.default.createElement("div",null,l.default.createElement("div",{className:"mt-[35px] flex justify-center"},l.default.createElement("div",{className:"w-[200px] h-[200px] mb-4",onClick:n},e.url&&l.default.createElement(M,{value:e.url,width:"100%",height:"100%",level:"M",imageSettings:{src:U,height:32,width:32,excavate:!1}}))))},de=({onClose:e,isReady:n})=>{let{isMobile:i}=H(),[o,r]=s.useState(""),[a,c]=s.useState(!1);s.useEffect((()=>{n.then(r).catch((()=>c(!0)))}),[n]);let d={url:o,error:a};return!1===i?l.default.createElement("div",{id:L,className:"animated fadeIn pointer-events-auto fixed top-0 left-0 h-full w-full bg-black/[.80] duration-300 ease-in-out will-change-auto"},l.default.createElement("div",{className:"relative top-2/4 m-auto w-[343px] translate-y-[-50%] rounded-2xl bg-white px-6 pt-[20px] pb-6 shadow-inner duration-300 ease-in-out will-change-transform md:w-[400px] lg:p-8 lg:pt-6"},l.default.createElement(oe,{onClose:e}),l.default.createElement(le,{...d}),l.default.createElement(X,null))):i?l.default.createElement(re,{onConnect:()=>{t.Ae(o)},onClose:e,id:L}):void 0},ue={order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag","path","subdomain"],lookupQuerystring:function(){let e=window.location.search.match(/lng=([^&]*)/);return e&&e[1]},lookupCookie:function(){let e=document.cookie.match(/i18next=([^;]*)/);return e&&e[1]},lookupLocalStorage:function(){return localStorage.getItem("i18nextLng")},lookupSessionStorage:function(){return sessionStorage.getItem("i18nextLng")},lookupFromNavigator:function(){return navigator.language},lookupFromHtmlTag:function(){return document.documentElement.lang},lookupFromPath:function(){let e=window.location.pathname.match(/\/([^/]*)/);return e&&e[1]},lookupFromSubdomain:function(){let e=window.location.hostname.match(/^(.+)\./);return e&&e[1]}},he=()=>{for(let e of ue.order)try{let t=ue["lookup"+e.charAt(0).toUpperCase()+e.slice(1)]();if(t)return t}catch(t){console.error(`Error detecting language with method: ${e}`,t);continue}return"en"};function pe(){let e=window.document,t=e.getElementById(L);t&&(t.className=t.className.replace("fadeIn","fadeOut"),setTimeout((()=>{let t=e.getElementById(D);t&&e.body.removeChild(t)}),300))}function fe(e){return()=>{pe(),e&&e()}}async function me({isReady:e,cb:t,lng:n}){!function(){let e=window.document,t=e.getElementById(j);t&&e.head.removeChild(t);let n=e.createElement("style");n.setAttribute("id",j),n.innerHTML=B,e.head.appendChild(n)}();let s=function(){let e=window.document,t=e.createElement("div");return t.setAttribute("id",D),e.body.appendChild(t),t}(),i=c(s);await e;let o=n??he();i.render(d.createElement(P.Provider,{value:{lng:o}},d.createElement(de,{isReady:e,onClose:fe(t)})))}var ge=e=>{},we=()=>{};var ke={open:function({cb:e,lng:n}){let s=new Promise(((e,t)=>{ge=e,we=t}));t.Sx()||me({isReady:s,cb:e,lng:n})},close:function(){t.Sx()||pe()},ready:function(e){ge(e)},fail:function(){console.log("relay failed...."),we()}},ye=ke,be=typeof window<"u"?window.WebSocket:function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")},Ee=class extends t.e0{constructor(e){super(),this.opts=e,this.socket=null,this.nextSocket=null,this.subscriptions=e.subscriptions||[],this.qs=`env=browser&protocol=wc&version=${e.version}`}qs;urls=[];socket;nextSocket;queue=[];subscriptions=[];retryIndex=0;set readyState(e){}get readyState(){return this.socket?this.socket.readyState:-1}set connecting(e){}get connecting(){return 0===this.readyState}set connected(e){}get connected(){return 1===this.readyState}set retryFailed(e){}get retryFailed(){return this.retryIndex>0&&this.retryIndex>=this.urls.length}open(e){if(!Array.isArray(e)||0===e.length)throw new Error("Missing or invalid WebSocket url");this.urls=e,this.retryIndex=0,this.socketCreate()}close(){this._socketClose()}send(e,t,n){if(!t||"string"!=typeof t)throw new Error("Missing or invalid topic field");this.socketSend({topic:t,type:"pub",payload:e,silent:!!n})}subscribe(e){this.socketSend({topic:e,type:"sub",payload:"",silent:!0})}socketCreate(){if(this.nextSocket)return;let e=this.getWsUrl();if(!e)return this.events.emit("error",new Error("Retry limit reached. Can't connect to any url."),e);if(this.nextSocket=new be(e),!this.nextSocket)throw new Error("Failed to create socket");this.nextSocket.onmessage=e=>this.socketReceive(e),this.nextSocket.onopen=()=>this.socketOpen(),this.nextSocket.onerror=t=>this.socketError(t,e),this.nextSocket.onclose=e=>{this.nextSocket=null,this.socketCreate()}}getWsUrl(){return this.retryIndex>=this.urls.length?"":`${this.urls[this.retryIndex++]}?${this.qs}`}socketOpen(){this._socketClose(),this.socket=this.nextSocket,this.nextSocket=null,this.queueSubscriptions(),this.pushQueue(),this.events.emit("open",this.urls[this.retryIndex-1])}_socketClose(){this.socket&&(this.socket.onclose=()=>{},this.socket.close(),this.events.emit("close"))}socketSend(e){let t=JSON.stringify(e);this.socket&&1===this.socket.readyState?this.socket.send(t):this.setToQueue(e)}socketReceive(e){let t;try{t=JSON.parse(e.data)}catch{return}this.socketSend({topic:t.topic,type:"ack",payload:"",silent:!0}),this.socket&&1===this.socket.readyState&&this.events.emit("message",t)}socketError(e,t){this.events.emit("error",e,t)}queueSubscriptions(){this.subscriptions.forEach((e=>this.queue.push({topic:e,type:"sub",payload:"",silent:!0}))),this.subscriptions=this.opts.subscriptions||[]}setToQueue(e){this.queue.push(e)}pushQueue(){this.queue.forEach((e=>this.socketSend(e))),this.queue=[]}};function Ce(e){let t=Date.now();return new Promise(((n,s)=>{try{let s=new be(e);s.onopen=()=>{s.close(),n({ttl:Date.now()-t,url:e})},s.onerror=()=>{n({ttl:0,url:e})}}catch{s({ttl:0,url:e})}}))}var Se=(e=>(e[e.DisconnectAtWallet=0]="DisconnectAtWallet",e[e.DisconnectAtClient=1]="DisconnectAtClient",e[e.NetworkError=2]="NetworkError",e))(Se||{});function ve(e,t){return function(){return e.apply(t,arguments)}}const{toString:xe}=Object.prototype,{getPrototypeOf:Ae}=Object,Ie=(Oe=Object.create(null),e=>{const t=xe.call(e);return Oe[t]||(Oe[t]=t.slice(8,-1).toLowerCase())});var Oe;const Re=e=>(e=e.toLowerCase(),t=>Ie(t)===e),Ne=e=>t=>typeof t===e,{isArray:Te}=Array,_e=Ne("undefined");const Me=Re("ArrayBuffer");const Be=Ne("string"),Pe=Ne("function"),De=Ne("number"),je=e=>null!==e&&"object"==typeof e,Le=e=>{if("object"!==Ie(e))return!1;const t=Ae(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},Fe=Re("Date"),ze=Re("File"),Ue=Re("Blob"),He=Re("FileList"),qe=Re("URLSearchParams");function Ve(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let s,i;if("object"!=typeof e&&(e=[e]),Te(e))for(s=0,i=e.length;s<i;s++)t.call(null,e[s],s,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let r;for(s=0;s<o;s++)r=i[s],t.call(null,e[r],r,e)}}function We(e,t){t=t.toLowerCase();const n=Object.keys(e);let s,i=n.length;for(;i-- >0;)if(s=n[i],t===s.toLowerCase())return s;return null}const $e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Je=e=>!_e(e)&&e!==$e;const Qe=(Ke="undefined"!=typeof Uint8Array&&Ae(Uint8Array),e=>Ke&&e instanceof Ke);var Ke;const Ge=Re("HTMLFormElement"),Ye=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Ze=Re("RegExp"),Xe=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),s={};Ve(n,((n,i)=>{let o;!1!==(o=t(n,i,e))&&(s[i]=o||n)})),Object.defineProperties(e,s)},et="abcdefghijklmnopqrstuvwxyz",tt="0123456789",nt={DIGIT:tt,ALPHA:et,ALPHA_DIGIT:et+et.toUpperCase()+tt};const st=Re("AsyncFunction");var it={isArray:Te,isArrayBuffer:Me,isBuffer:function(e){return null!==e&&!_e(e)&&null!==e.constructor&&!_e(e.constructor)&&Pe(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||Pe(e.append)&&("formdata"===(t=Ie(e))||"object"===t&&Pe(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Me(e.buffer),t},isString:Be,isNumber:De,isBoolean:e=>!0===e||!1===e,isObject:je,isPlainObject:Le,isUndefined:_e,isDate:Fe,isFile:ze,isBlob:Ue,isRegExp:Ze,isFunction:Pe,isStream:e=>je(e)&&Pe(e.pipe),isURLSearchParams:qe,isTypedArray:Qe,isFileList:He,forEach:Ve,merge:function e(){const{caseless:t}=Je(this)&&this||{},n={},s=(s,i)=>{const o=t&&We(n,i)||i;Le(n[o])&&Le(s)?n[o]=e(n[o],s):Le(s)?n[o]=e({},s):Te(s)?n[o]=s.slice():n[o]=s};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&Ve(arguments[e],s);return n},extend:(e,t,n,{allOwnKeys:s}={})=>(Ve(t,((t,s)=>{n&&Pe(t)?e[s]=ve(t,n):e[s]=t}),{allOwnKeys:s}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,s)=>{e.prototype=Object.create(t.prototype,s),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,s)=>{let i,o,r;const a={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)r=i[o],s&&!s(r,e,t)||a[r]||(t[r]=e[r],a[r]=!0);e=!1!==n&&Ae(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:Ie,kindOfTest:Re,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const s=e.indexOf(t,n);return-1!==s&&s===n},toArray:e=>{if(!e)return null;if(Te(e))return e;let t=e.length;if(!De(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=n.next())&&!s.done;){const n=s.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const s=[];for(;null!==(n=e.exec(t));)s.push(n);return s},isHTMLForm:Ge,hasOwnProperty:Ye,hasOwnProp:Ye,reduceDescriptors:Xe,freezeMethods:e=>{Xe(e,((t,n)=>{if(Pe(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const s=e[n];Pe(s)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},s=e=>{e.forEach((e=>{n[e]=!0}))};return Te(e)?s(e):s(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:We,global:$e,isContextDefined:Je,ALPHABET:nt,generateString:(e=16,t=nt.ALPHA_DIGIT)=>{let n="";const{length:s}=t;for(;e--;)n+=t[Math.random()*s|0];return n},isSpecCompliantForm:function(e){return!!(e&&Pe(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,s)=>{if(je(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[s]=e;const i=Te(e)?[]:{};return Ve(e,((e,t)=>{const o=n(e,s+1);!_e(o)&&(i[t]=o)})),t[s]=void 0,i}}return e};return n(e,0)},isAsyncFn:st,isThenable:e=>e&&(je(e)||Pe(e))&&Pe(e.then)&&Pe(e.catch)};function ot(e,t,n,s,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),s&&(this.request=s),i&&(this.response=i)}it.inherits(ot,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:it.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const rt=ot.prototype,at={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{at[e]={value:e}})),Object.defineProperties(ot,at),Object.defineProperty(rt,"isAxiosError",{value:!0}),ot.from=(e,t,n,s,i,o)=>{const r=Object.create(rt);return it.toFlatObject(e,r,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),ot.call(r,e.message,t,n,s,i),r.cause=e,r.name=e.name,o&&Object.assign(r,o),r};function ct(e){return it.isPlainObject(e)||it.isArray(e)}function lt(e){return it.endsWith(e,"[]")?e.slice(0,-2):e}function dt(e,t,n){return e?e.concat(t).map((function(e,t){return e=lt(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const ut=it.toFlatObject(it,{},null,(function(e){return/^is[A-Z]/.test(e)}));function ht(e,t,n){if(!it.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const s=(n=it.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!it.isUndefined(t[e])}))).metaTokens,i=n.visitor||l,o=n.dots,r=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&it.isSpecCompliantForm(t);if(!it.isFunction(i))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(it.isDate(e))return e.toISOString();if(!a&&it.isBlob(e))throw new ot("Blob is not supported. Use a Buffer instead.");return it.isArrayBuffer(e)||it.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,i){let a=e;if(e&&!i&&"object"==typeof e)if(it.endsWith(n,"{}"))n=s?n:n.slice(0,-2),e=JSON.stringify(e);else if(it.isArray(e)&&function(e){return it.isArray(e)&&!e.some(ct)}(e)||(it.isFileList(e)||it.endsWith(n,"[]"))&&(a=it.toArray(e)))return n=lt(n),a.forEach((function(e,s){!it.isUndefined(e)&&null!==e&&t.append(!0===r?dt([n],s,o):null===r?n:n+"[]",c(e))})),!1;return!!ct(e)||(t.append(dt(i,n,o),c(e)),!1)}const d=[],u=Object.assign(ut,{defaultVisitor:l,convertValue:c,isVisitable:ct});if(!it.isObject(e))throw new TypeError("data must be an object");return function e(n,s){if(!it.isUndefined(n)){if(-1!==d.indexOf(n))throw Error("Circular reference detected in "+s.join("."));d.push(n),it.forEach(n,(function(n,o){!0===(!(it.isUndefined(n)||null===n)&&i.call(t,n,it.isString(o)?o.trim():o,s,u))&&e(n,s?s.concat(o):[o])})),d.pop()}}(e),t}function pt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function ft(e,t){this._pairs=[],e&&ht(e,this,t)}const mt=ft.prototype;function gt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function wt(e,t,n){if(!t)return e;const s=n&&n.encode||gt,i=n&&n.serialize;let o;if(o=i?i(t,n):it.isURLSearchParams(t)?t.toString():new ft(t,n).toString(s),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}mt.append=function(e,t){this._pairs.push([e,t])},mt.toString=function(e){const t=e?function(t){return e.call(this,t,pt)}:pt;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var kt=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){it.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},yt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},bt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ft,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const Et="undefined"!=typeof window&&"undefined"!=typeof document,Ct=(St="undefined"!=typeof navigator&&navigator.product,Et&&["ReactNative","NativeScript","NS"].indexOf(St)<0);var St;const vt="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts;var xt={...Object.freeze({__proto__:null,hasBrowserEnv:Et,hasStandardBrowserWebWorkerEnv:vt,hasStandardBrowserEnv:Ct}),...bt};function At(e){function t(e,n,s,i){let o=e[i++];const r=Number.isFinite(+o),a=i>=e.length;if(o=!o&&it.isArray(s)?s.length:o,a)return it.hasOwnProp(s,o)?s[o]=[s[o],n]:s[o]=n,!r;s[o]&&it.isObject(s[o])||(s[o]=[]);return t(e,n,s[o],i)&&it.isArray(s[o])&&(s[o]=function(e){const t={},n=Object.keys(e);let s;const i=n.length;let o;for(s=0;s<i;s++)o=n[s],t[o]=e[o];return t}(s[o])),!r}if(it.isFormData(e)&&it.isFunction(e.entries)){const n={};return it.forEachEntry(e,((e,s)=>{t(function(e){return it.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),s,n,0)})),n}return null}const It={transitional:yt,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",s=n.indexOf("application/json")>-1,i=it.isObject(e);i&&it.isHTMLForm(e)&&(e=new FormData(e));if(it.isFormData(e))return s&&s?JSON.stringify(At(e)):e;if(it.isArrayBuffer(e)||it.isBuffer(e)||it.isStream(e)||it.isFile(e)||it.isBlob(e))return e;if(it.isArrayBufferView(e))return e.buffer;if(it.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return ht(e,new xt.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,s){return xt.isNode&&it.isBuffer(e)?(this.append(t,e.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((o=it.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return ht(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||s?(t.setContentType("application/json",!1),function(e,t,n){if(it.isString(e))try{return(t||JSON.parse)(e),it.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||It.transitional,n=t&&t.forcedJSONParsing,s="json"===this.responseType;if(e&&it.isString(e)&&(n&&!this.responseType||s)){const n=!(t&&t.silentJSONParsing)&&s;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw ot.from(e,ot.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:xt.classes.FormData,Blob:xt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};it.forEach(["delete","get","head","post","put","patch"],(e=>{It.headers[e]={}}));var Ot=It;const Rt=it.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const Nt=Symbol("internals");function Tt(e){return e&&String(e).trim().toLowerCase()}function _t(e){return!1===e||null==e?e:it.isArray(e)?e.map(_t):String(e)}function Mt(e,t,n,s,i){return it.isFunction(s)?s.call(this,t,n):(i&&(t=n),it.isString(t)?it.isString(s)?-1!==t.indexOf(s):it.isRegExp(s)?s.test(t):void 0:void 0)}class Bt{constructor(e){e&&this.set(e)}set(e,t,n){const s=this;function i(e,t,n){const i=Tt(t);if(!i)throw new Error("header name must be a non-empty string");const o=it.findKey(s,i);(!o||void 0===s[o]||!0===n||void 0===n&&!1!==s[o])&&(s[o||t]=_t(e))}const o=(e,t)=>it.forEach(e,((e,n)=>i(e,n,t)));return it.isPlainObject(e)||e instanceof this.constructor?o(e,t):it.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?o((e=>{const t={};let n,s,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),s=e.substring(i+1).trim(),!n||t[n]&&Rt[n]||("set-cookie"===n?t[n]?t[n].push(s):t[n]=[s]:t[n]=t[n]?t[n]+", "+s:s)})),t})(e),t):null!=e&&i(t,e,n),this}get(e,t){if(e=Tt(e)){const n=it.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=n.exec(e);)t[s[1]]=s[2];return t}(e);if(it.isFunction(t))return t.call(this,e,n);if(it.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Tt(e)){const n=it.findKey(this,e);return!(!n||void 0===this[n]||t&&!Mt(0,this[n],n,t))}return!1}delete(e,t){const n=this;let s=!1;function i(e){if(e=Tt(e)){const i=it.findKey(n,e);!i||t&&!Mt(0,n[i],i,t)||(delete n[i],s=!0)}}return it.isArray(e)?e.forEach(i):i(e),s}clear(e){const t=Object.keys(this);let n=t.length,s=!1;for(;n--;){const i=t[n];e&&!Mt(0,this[i],i,e,!0)||(delete this[i],s=!0)}return s}normalize(e){const t=this,n={};return it.forEach(this,((s,i)=>{const o=it.findKey(n,i);if(o)return t[o]=_t(s),void delete t[i];const r=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(i):String(i).trim();r!==i&&delete t[i],t[r]=_t(s),n[r]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return it.forEach(this,((n,s)=>{null!=n&&!1!==n&&(t[s]=e&&it.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[Nt]=this[Nt]={accessors:{}}).accessors,n=this.prototype;function s(e){const s=Tt(e);t[s]||(!function(e,t){const n=it.toCamelCase(" "+t);["get","set","has"].forEach((s=>{Object.defineProperty(e,s+n,{value:function(e,n,i){return this[s].call(this,t,e,n,i)},configurable:!0})}))}(n,e),t[s]=!0)}return it.isArray(e)?e.forEach(s):s(e),this}}Bt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),it.reduceDescriptors(Bt.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),it.freezeMethods(Bt);var Pt=Bt;function Dt(e,t){const n=this||Ot,s=t||n,i=Pt.from(s.headers);let o=s.data;return it.forEach(e,(function(e){o=e.call(n,o,i.normalize(),t?t.status:void 0)})),i.normalize(),o}function jt(e){return!(!e||!e.__CANCEL__)}function Lt(e,t,n){ot.call(this,null==e?"canceled":e,ot.ERR_CANCELED,t,n),this.name="CanceledError"}it.inherits(Lt,ot,{__CANCEL__:!0});var Ft=xt.hasStandardBrowserEnv?{write(e,t,n,s,i,o){const r=[e+"="+encodeURIComponent(t)];it.isNumber(n)&&r.push("expires="+new Date(n).toGMTString()),it.isString(s)&&r.push("path="+s),it.isString(i)&&r.push("domain="+i),!0===o&&r.push("secure"),document.cookie=r.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function zt(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var Ut=xt.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function s(n){let s=n;return e&&(t.setAttribute("href",s),s=t.href),t.setAttribute("href",s),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=s(window.location.href),function(e){const t=it.isString(e)?s(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0};function Ht(e,t){let n=0;const s=function(e,t){e=e||10;const n=new Array(e),s=new Array(e);let i,o=0,r=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=s[r];i||(i=c),n[o]=a,s[o]=c;let d=r,u=0;for(;d!==o;)u+=n[d++],d%=e;if(o=(o+1)%e,o===r&&(r=(r+1)%e),c-i<t)return;const h=l&&c-l;return h?Math.round(1e3*u/h):void 0}}(50,250);return i=>{const o=i.loaded,r=i.lengthComputable?i.total:void 0,a=o-n,c=s(a);n=o;const l={loaded:o,total:r,progress:r?o/r:void 0,bytes:a,rate:c||void 0,estimated:c&&r&&o<=r?(r-o)/c:void 0,event:i};l[t?"download":"upload"]=!0,e(l)}}const qt={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let s=e.data;const i=Pt.from(e.headers).normalize();let o,r,{responseType:a,withXSRFToken:c}=e;function l(){e.cancelToken&&e.cancelToken.unsubscribe(o),e.signal&&e.signal.removeEventListener("abort",o)}if(it.isFormData(s))if(xt.hasStandardBrowserEnv||xt.hasStandardBrowserWebWorkerEnv)i.setContentType(!1);else if(!1!==(r=i.getContentType())){const[e,...t]=r?r.split(";").map((e=>e.trim())).filter(Boolean):[];i.setContentType([e||"multipart/form-data",...t].join("; "))}let d=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(t+":"+n))}const u=zt(e.baseURL,e.url);function h(){if(!d)return;const s=Pt.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders());!function(e,t,n){const s=n.config.validateStatus;n.status&&s&&!s(n.status)?t(new ot("Request failed with status code "+n.status,[ot.ERR_BAD_REQUEST,ot.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),l()}),(function(e){n(e),l()}),{data:a&&"text"!==a&&"json"!==a?d.response:d.responseText,status:d.status,statusText:d.statusText,headers:s,config:e,request:d}),d=null}if(d.open(e.method.toUpperCase(),wt(u,e.params,e.paramsSerializer),!0),d.timeout=e.timeout,"onloadend"in d?d.onloadend=h:d.onreadystatechange=function(){d&&4===d.readyState&&(0!==d.status||d.responseURL&&0===d.responseURL.indexOf("file:"))&&setTimeout(h)},d.onabort=function(){d&&(n(new ot("Request aborted",ot.ECONNABORTED,e,d)),d=null)},d.onerror=function(){n(new ot("Network Error",ot.ERR_NETWORK,e,d)),d=null},d.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const s=e.transitional||yt;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new ot(t,s.clarifyTimeoutError?ot.ETIMEDOUT:ot.ECONNABORTED,e,d)),d=null},xt.hasStandardBrowserEnv&&(c&&it.isFunction(c)&&(c=c(e)),c||!1!==c&&Ut(u))){const t=e.xsrfHeaderName&&e.xsrfCookieName&&Ft.read(e.xsrfCookieName);t&&i.set(e.xsrfHeaderName,t)}void 0===s&&i.setContentType(null),"setRequestHeader"in d&&it.forEach(i.toJSON(),(function(e,t){d.setRequestHeader(t,e)})),it.isUndefined(e.withCredentials)||(d.withCredentials=!!e.withCredentials),a&&"json"!==a&&(d.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&d.addEventListener("progress",Ht(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&d.upload&&d.upload.addEventListener("progress",Ht(e.onUploadProgress)),(e.cancelToken||e.signal)&&(o=t=>{d&&(n(!t||t.type?new Lt(null,e,d):t),d.abort(),d=null)},e.cancelToken&&e.cancelToken.subscribe(o),e.signal&&(e.signal.aborted?o():e.signal.addEventListener("abort",o)));const p=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(u);p&&-1===xt.protocols.indexOf(p)?n(new ot("Unsupported protocol "+p+":",ot.ERR_BAD_REQUEST,e)):d.send(s||null)}))}};it.forEach(qt,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Vt=e=>`- ${e}`,Wt=e=>it.isFunction(e)||null===e||!1===e;var $t={getAdapter:e=>{e=it.isArray(e)?e:[e];const{length:t}=e;let n,s;const i={};for(let o=0;o<t;o++){let t;if(n=e[o],s=n,!Wt(n)&&(s=qt[(t=String(n)).toLowerCase()],void 0===s))throw new ot(`Unknown adapter '${t}'`);if(s)break;i[t||"#"+o]=s}if(!s){const e=Object.entries(i).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new ot("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(Vt).join("\n"):" "+Vt(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return s},adapters:qt};function Jt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Lt(null,e)}function Qt(e){Jt(e),e.headers=Pt.from(e.headers),e.data=Dt.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return $t.getAdapter(e.adapter||Ot.adapter)(e).then((function(t){return Jt(e),t.data=Dt.call(e,e.transformResponse,t),t.headers=Pt.from(t.headers),t}),(function(t){return jt(t)||(Jt(e),t&&t.response&&(t.response.data=Dt.call(e,e.transformResponse,t.response),t.response.headers=Pt.from(t.response.headers))),Promise.reject(t)}))}const Kt=e=>e instanceof Pt?e.toJSON():e;function Gt(e,t){t=t||{};const n={};function s(e,t,n){return it.isPlainObject(e)&&it.isPlainObject(t)?it.merge.call({caseless:n},e,t):it.isPlainObject(t)?it.merge({},t):it.isArray(t)?t.slice():t}function i(e,t,n){return it.isUndefined(t)?it.isUndefined(e)?void 0:s(void 0,e,n):s(e,t,n)}function o(e,t){if(!it.isUndefined(t))return s(void 0,t)}function r(e,t){return it.isUndefined(t)?it.isUndefined(e)?void 0:s(void 0,e):s(void 0,t)}function a(n,i,o){return o in t?s(n,i):o in e?s(void 0,n):void 0}const c={url:o,method:o,data:o,baseURL:r,transformRequest:r,transformResponse:r,paramsSerializer:r,timeout:r,timeoutMessage:r,withCredentials:r,withXSRFToken:r,adapter:r,responseType:r,xsrfCookieName:r,xsrfHeaderName:r,onUploadProgress:r,onDownloadProgress:r,decompress:r,maxContentLength:r,maxBodyLength:r,beforeRedirect:r,transport:r,httpAgent:r,httpsAgent:r,cancelToken:r,socketPath:r,responseEncoding:r,validateStatus:a,headers:(e,t)=>i(Kt(e),Kt(t),!0)};return it.forEach(Object.keys(Object.assign({},e,t)),(function(s){const o=c[s]||i,r=o(e[s],t[s],s);it.isUndefined(r)&&o!==a||(n[s]=r)})),n}const Yt="1.6.2",Zt={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Zt[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Xt={};Zt.transitional=function(e,t,n){function s(e,t){return"[Axios v1.6.2] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,o)=>{if(!1===e)throw new ot(s(i," has been removed"+(t?" in "+t:"")),ot.ERR_DEPRECATED);return t&&!Xt[i]&&(Xt[i]=!0,console.warn(s(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,o)}};var en={assertOptions:function(e,t,n){if("object"!=typeof e)throw new ot("options must be an object",ot.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let i=s.length;for(;i-- >0;){const o=s[i],r=t[o];if(r){const t=e[o],n=void 0===t||r(t,o,e);if(!0!==n)throw new ot("option "+o+" must be "+n,ot.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new ot("Unknown option "+o,ot.ERR_BAD_OPTION)}},validators:Zt};const tn=en.validators;class nn{constructor(e){this.defaults=e,this.interceptors={request:new kt,response:new kt}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Gt(this.defaults,t);const{transitional:n,paramsSerializer:s,headers:i}=t;void 0!==n&&en.assertOptions(n,{silentJSONParsing:tn.transitional(tn.boolean),forcedJSONParsing:tn.transitional(tn.boolean),clarifyTimeoutError:tn.transitional(tn.boolean)},!1),null!=s&&(it.isFunction(s)?t.paramsSerializer={serialize:s}:en.assertOptions(s,{encode:tn.function,serialize:tn.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&it.merge(i.common,i[t.method]);i&&it.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=Pt.concat(o,i);const r=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,r.unshift(e.fulfilled,e.rejected))}));const c=[];let l;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let d,u=0;if(!a){const e=[Qt.bind(this),void 0];for(e.unshift.apply(e,r),e.push.apply(e,c),d=e.length,l=Promise.resolve(t);u<d;)l=l.then(e[u++],e[u++]);return l}d=r.length;let h=t;for(u=0;u<d;){const e=r[u++],t=r[u++];try{h=e(h)}catch(e){t.call(this,e);break}}try{l=Qt.call(this,h)}catch(e){return Promise.reject(e)}for(u=0,d=c.length;u<d;)l=l.then(c[u++],c[u++]);return l}getUri(e){return wt(zt((e=Gt(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}it.forEach(["delete","get","head","options"],(function(e){nn.prototype[e]=function(t,n){return this.request(Gt(n||{},{method:e,url:t,data:(n||{}).data}))}})),it.forEach(["post","put","patch"],(function(e){function t(t){return function(n,s,i){return this.request(Gt(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:s}))}}nn.prototype[e]=t(),nn.prototype[e+"Form"]=t(!0)}));var sn=nn;class on{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const s=new Promise((e=>{n.subscribe(e),t=e})).then(e);return s.cancel=function(){n.unsubscribe(t)},s},e((function(e,s,i){n.reason||(n.reason=new Lt(e,s,i),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new on((function(t){e=t})),cancel:e}}}var rn=on;const an={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(an).forEach((([e,t])=>{an[t]=e}));var cn=an;const ln=function e(t){const n=new sn(t),s=ve(sn.prototype.request,n);return it.extend(s,sn.prototype,n,{allOwnKeys:!0}),it.extend(s,n,null,{allOwnKeys:!0}),s.create=function(n){return e(Gt(t,n))},s}(Ot);ln.Axios=sn,ln.CanceledError=Lt,ln.CancelToken=rn,ln.isCancel=jt,ln.VERSION=Yt,ln.toFormData=ht,ln.AxiosError=ot,ln.Cancel=ln.CanceledError,ln.all=function(e){return Promise.all(e)},ln.spread=function(e){return function(t){return e.apply(null,t)}},ln.isAxiosError=function(e){return it.isObject(e)&&!0===e.isAxiosError},ln.mergeConfig=Gt,ln.AxiosHeaders=Pt,ln.formToJSON=e=>At(it.isHTMLForm(e)?new FormData(e):e),ln.getAdapter=$t.getAdapter,ln.HttpStatusCode=cn,ln.default=ln;var dn=ln,un="connect-session",hn="connect-domains",pn=["https://rpc.ankr.com/bsc","https://binance.nodereal.io","https://bscrpc.com","https://bsc-dataseed2.ninicoin.io"],fn=class extends t.e0{pending=!1;callbacks=new Map;clientMeta;relay;_key=null;_clientId="";_peerId="";_peerMeta=null;_handshakeId=0;_handshakeTopic="";_connected=!1;_accounts=[];_chainId="0x0";set key(e){if(!e)return;let n=t.Dx(e);this._key=n}get key(){return this._key?t.Jx(this._key,!0):""}set clientId(e){e&&(this._clientId=e)}get clientId(){let e=this._clientId;return e||(e=this._clientId=t.bx()),this._clientId}set peerId(e){e&&(this._peerId=e)}get peerId(){return this._peerId}set peerMeta(e){this._peerMeta=e}get peerMeta(){return this._peerMeta}set handshakeTopic(e){e&&(this._handshakeTopic=e)}get handshakeTopic(){return this._handshakeTopic}set handshakeId(e){e&&(this._handshakeId=e)}get handshakeId(){return this._handshakeId}get uri(){return`wc:${this.handshakeTopic}@1?bridge=${this.relay}&key=${this.key}&scene=bid`}set chainId(e){this._chainId=e}get chainId(){return this._chainId}set accounts(e){this._accounts=e}get accounts(){return this._accounts}set connected(e){}get connected(){return this._connected}get session(){return{connected:this.connected,accounts:this.accounts,chainId:this.chainId,relay:this.relay,key:this.key,clientId:this.clientId,clientMeta:this.clientMeta,peerId:this.peerId,peerMeta:this.peerMeta,handshakeId:this.handshakeId,handshakeTopic:this.handshakeTopic}}set session(e){e&&(this._connected=e.connected,this.accounts=e.accounts,this.chainId=e.chainId,this.relay=e.relay,this.key=e.key,this.clientId=e.clientId,this.clientMeta=e.clientMeta,this.peerId=e.peerId,this.peerMeta=e.peerMeta,this.handshakeId=e.handshakeId,this.handshakeTopic=e.handshakeTopic)}},mn=class extends fn{getStorageSession(){try{return t.Qx(un)}catch{}return null}setStorageSession(){t.xe(un,this.session)}removeStorageSession(){t.Yx(un)}manageStorageSession(){this._connected?this.setStorageSession():this.removeStorageSession()}};var gn=Promise.resolve([]);if(!t.Sx()){let e=t.Qx(hn);gn=Promise.resolve(e),(!e||0===e.length)&&(gn=async function(){let e=await async function(){let e=await Promise.race(pn.map((e=>dn.request({url:e,method:"POST",data:{jsonrpc:"2.0",id:Date.now(),method:"eth_call",params:[{to:"0x76054B318785b588A3164B2A6eA5476F7cBA51e0",data:"0x97b5f450"},"latest"]}})))),n=new o.Interface(["function apiDomains() view returns (string)"]);return t.decode(n.decodeFunctionResult("apiDomains",e.data.result)[0]).split(",")}(),n=await Promise.all(e.map((e=>Ce(`wss://nbstream.${e.split(".").slice(1).join(".")}/wallet-connector`))));return function(e){return e.filter((e=>e.ttl>0)).sort(((e,t)=>e.ttl-t.ttl)).map((e=>e.url))}(n)}().then((e=>(console.log("🚀 ~ file: relay.ts:63 ~ .then ~ domains:",e),t.xe(hn,e),e))).catch((()=>[])))}function wn(){t.Yx(hn)}var kn=class extends mn{transport;lng;constructor(){super(),this.clientMeta=t.te();let e=this.getStorageSession();e&&(this.session=e),this.handshakeId&&this.subscribeToSessionResponse(this.handshakeId),this.initTransport(),this.subscribeInternalEvent()}async request(e){if(!this.connected)throw new t.f0(t.ue.PROVIDER_NOT_READY.code,t.ue.PROVIDER_NOT_READY.message);if(t._x.indexOf(e.method)<0)throw new t.f0(t.le.METHOD_NOT_SUPPORT.code,t.le.METHOD_NOT_SUPPORT.message);switch(e.method){case"eth_requestAccounts":case"eth_accounts":return this.accounts;case"eth_chainId":return t.Px(this.chainId);case"eth_signTransaction":case"eth_sendTransaction":case"eth_sign":case"personal_sign":case"eth_signTypedData":case"eth_signTypedData_v1":case"eth_signTypedData_v2":case"eth_signTypedData_v3":case"eth_signTypedData_v4":case"wallet_switchEthereumChain":case"wallet_watchAsset":return new Promise(((n,s)=>{e.id||(e.id=t.s0()),this.callbacks.set(`response-${e.id}`,((e,i)=>{e?s(function(e){return-32050===e.code||-32e3===e.code||1e3===e.code?new t.f0(t.le.REJECT_ERR.code,t.le.REJECT_ERR.message):-32603===e.code?new t.f0(t.pe.INTERNAL_ERR.code,t.pe.INTERNAL_ERR.message):-32600===e.code||-32602===e.code?new t.f0(t.le.INVALID_PARAM.code,t.le.INVALID_PARAM.message):e}(e)):i?n(i.result):s(new t.f0(t.le.MISSING_RESPONSE.code,t.le.MISSING_RESPONSE.message))})),this.sendRequest(e),this.events.emit("call_request_sent")}))}}killSession(){if(!this.connected)return;let e={id:t.s0(),method:"wc_sessionUpdate",params:[{approved:!1,chainId:null,networkId:null,accounts:null}]};this.sendRequest(e),this.handleSessionDisconnect(Se.DisconnectAtClient)}async connect({chainId:e,lng:t}={}){return this.lng=t,this.connected?{chainId:this.chainId,accounts:this.accounts}:new Promise(((t,n)=>{this.on("modal_closed",(e=>{n(e)})),this.on("session_error",(e=>{n(e)})),this.on("connect",(e=>{t(e)})),this.createSession(e)}))}createSession(e){try{if(this.connected)throw new t.f0(t.ue.CONNECTED.code,t.ue.CONNECTED.message);if(this.pending||this._handshakeTopic)throw new t.f0(t.ue.CONNECTING.code,t.ue.CONNECTING.message);this.pending=!0,this._key=t.$0(),this.handshakeId=t.s0(),this.handshakeTopic=t.bx();let n={id:this.handshakeId,method:"wc_sessionRequest",params:[{peerId:this.clientId,peerMeta:this.clientMeta,chainId:e?Number(e):null}]};this.sendRequest(n,this.handshakeTopic),this.subscribeToSessionResponse(this.handshakeId),this.events.emit("display_uri")}catch(e){this.pending=!1;let n=`response-${this.handshakeId}`;this.callbacks.get(n)&&this.callbacks.delete(n);let s=e.message,i=e instanceof t.f0?e:new t.f0(t.pe.INTERNAL_ERR.code,`${t.pe.INTERNAL_ERR.message}: ${s}`);throw this.handleRejectSessionConnection(i),t.be.error(`[binance-w3w] create connection failed: ${s}`),i}}async initTransport(){this.transport=new Ee({version:1,subscriptions:[this.clientId]}),this.transport.on("message",(e=>this.setIncomingMessages(e))),this.transport.on("open",(e=>{this.events.emit("transport_open",e)})),this.transport.on("close",(()=>{this.events.emit("transport_close")})),this.transport.on("error",((e,t)=>{this.events.emit("transport_error",e,t)}));try{if(this.session.relay)this.transport.open([this.session.relay]);else{let e=await async function(){let e=await gn;return 0===e.length&&e.push("wss://nbstream.binance.com/wallet-connector"),e}();this.transport.open(e)}}catch(e){wn();let n=e.message,s=new t.f0(t.pe.INTERNAL_ERR.code,`${t.pe.INTERNAL_ERR.message}: ${n}`);throw this.handleRejectSessionConnection(s),s}}setIncomingMessages(e){if(![this.clientId,this.handshakeTopic].includes(e.topic))return;let n;try{n=JSON.parse(e.payload)}catch{return}let s=this.decrypt(n);if(!s)return;if("method"in s&&s.method)return void this.events.emit(s.method,null,s);let i=s.id,o=`response-${i}`,r=this.callbacks.get(o);if(r){if("error"in s&&s.error){r(new t.f0(s.error.code,s.error.message),null)}else"result"in s&&s.result&&r(null,s);this.callbacks.delete(o)}else t.be.error(`[binance-w3w] callback id: ${i} not found`)}encrypt(e){let n=this._key;return n?t.Gx(e,n):null}decrypt(e){let n=this._key;return n?t.Wx(e,n):null}sendRequest(e,n){let s=t.rx(e.method,e.params,e.id),i=this.encrypt(s),o=n||this.peerId,r=JSON.stringify(i);this.transport.send(r,o,!0)}subscribeInternalEvent(){this.on("display_uri",(()=>{ye.open({cb:()=>{this.events.emit("modal_closed",new t.f0(t.ue.CLOSE_MODAL.code,t.ue.CLOSE_MODAL.message))},lng:this.lng}),this.transport.connected?ye.ready(this.uri):this.transport.retryFailed&&ye.fail()})),this.on("transport_open",(e=>{this.relay=e,ye.ready(this.uri)})),this.on("transport_error",((e,n)=>{n?function(e){let n=t.Qx(hn);if(!n)return;let s=n.filter((t=>t!==e));t.xe(hn,s)}(function(e){let t=e.indexOf("?");return t>-1?e.slice(0,t):e}(n)):(wn(),ye.fail())})),this.on("modal_closed",(()=>{let e=`response-${this.handshakeId}`;this.callbacks.get(e)&&this.callbacks.delete(e),this.clearConnectionStatus()})),this.on("connect",(()=>{this.pending=!1,ye.close()})),this.on("call_request_sent",(()=>{t.Ae()})),this.on("wc_sessionUpdate",((e,t)=>{e?this.handleSessionResponse():t.params&&Array.isArray(t.params)?this.handleSessionResponse(t.params[0]):t.error&&this.handleSessionResponse()}))}subscribeToSessionResponse(e){this.callbacks.set(`response-${e}`,((e,t)=>{e?this.handleSessionResponse():t&&(t.result?this.handleSessionResponse(t.result):(t.error&&t.error.message,this.handleSessionResponse()))}))}handleSessionResponse(e){e?e.approved?(this._connected?(e.chainId&&this.setChainId(e.chainId),e.accounts&&this.setAddress(e.accounts)):(this._connected=!0,e.chainId&&this.setChainId(e.chainId),e.accounts&&this.setAddress(e.accounts),e.peerId&&!this.peerId&&(this.peerId=e.peerId),e.peerMeta&&!this.peerMeta&&(this.peerMeta=e.peerMeta),this.events.emit("connect",{chainId:this.chainId,accounts:this.accounts})),this.manageStorageSession()):this.connected?this.handleSessionDisconnect(Se.DisconnectAtWallet):this.handleRejectSessionConnection(new t.f0(t.ue.REJECT_SESSION.code,t.ue.REJECT_SESSION.message)):this.handleRejectSessionConnection(new t.f0(t.ue.REJECT_SESSION.code,t.ue.REJECT_SESSION.message))}handleRejectSessionConnection(e){ye.close(),this.clearConnectionStatus(),this.events.emit("session_error",e)}handleSessionDisconnect(e){this._connected||ye.close(),this.events.emit("disconnect",e),this.clearConnectionStatus()}clearConnectionStatus(){this._connected&&(this._connected=!1),this._handshakeId&&(this._handshakeId=0),this._handshakeTopic&&(this._handshakeTopic=""),this._peerId&&(this._peerId=""),this._clientId&&(this._clientId=""),this.pending&&(this.pending=!1),this.callbacks.clear(),this._peerMeta=null,this._accounts=[],this._chainId="0x0",this.offConnectEvents(),this.removeStorageSession(),this.transport.close()}offConnectEvents(){this.removeListener("connect")}setChainId(e){let n=t.Px(e);"0x0"!==n?(typeof this.chainId<"u"&&this.chainId!==n&&this.events.emit("chainChanged",n),this.chainId=n):this.chainId=n}setAddress(e=[]){let t=e.filter((e=>"string"==typeof e)).map((e=>e.toLowerCase())).filter(Boolean);JSON.stringify(this.accounts)!==JSON.stringify(t)&&this.events.emit("accountsChanged",t),this.accounts=t}},yn=class extends t.e0{accounts=[];coreConnection;constructor(){super(),this.register()}get chainId(){return this.coreConnection?this.coreConnection.chainId:"0x0"}get connected(){return!!this.coreConnection&&this.coreConnection.connected}get connecting(){return!!this.coreConnection&&this.coreConnection.pending}async open({requestChainId:e,lng:t}){if(this.register(),this.coreConnection.connected)return;let{accounts:n}=await this.coreConnection.connect({chainId:e,lng:t});this.accounts=n}async request(e){return this.connected||await this.open({}),this.coreConnection.request(e)}disconnect(){this.connected&&(this.coreConnection.killSession(),this.onClose(Se.DisconnectAtClient))}register(){if(this.coreConnection)return this.coreConnection;this.coreConnection=new kn,this.accounts=this.coreConnection.accounts,this.subscribeEvents()}subscribeEvents(){this.coreConnection.on("chainChanged",(e=>{this.events.emit("chainChanged",e)})),this.coreConnection.on("accountsChanged",(e=>{this.accounts=e,this.events.emit("accountsChanged",e)})),this.coreConnection.on("disconnect",(e=>{this.onClose(e)}))}onClose(e){this.coreConnection=null,this.events.emit("disconnect",e)}},bn=e=>{if(t.we()){let e=typeof window<"u"?window.ethereum:void 0;if(e)return e.setLng=()=>{},e.disconnect=()=>{},e}return new class{events=new t.u;signClient;rpc;httpClient;optsChainId;lng;constructor(e){this.rpc={infuraId:e?.infuraId,custom:e?.rpc},this.optsChainId=e?.chainId||56,this.lng=e?.lng||"en",this.signClient=new yn,this.registerEventListeners(),this.httpClient=this.setHttpProvider(this.optsChainId)}get connected(){return this.signClient.connected}get connector(){return this.signClient}get accounts(){return this.signClient.accounts}get chainId(){return t.be.debug("provider get chainId",this.signClient.chainId),this.signClient.chainId}get rpcUrl(){return this.httpClient.url||""}async request(e){switch(t.be.debug("ethereum-provider request",e),e.method){case"eth_requestAccounts":return await this.connect(),this.accounts;case"eth_chainId":return this.chainId;case"eth_accounts":return this.accounts}let n=t.rx(e.method,e.params||[]);if(t._x.includes(e.method))return this.signClient.request(n);if(typeof this.httpClient>"u")throw new Error(`Cannot request JSON-RPC method (${e.method}) without provided rpc url`);let s=await this.httpClient.request(n);if(t.l0(s))return s.result;throw new Error(s.error.message)}async signMessage(e){return t.be.debug("signMessage",e),this.accounts.length||await this.enable(),await this.request({method:"personal_sign",params:[t.Cx(e),this.accounts[0]]})}sendAsync(e,t){this.request(e).then((e=>t(null,e))).catch((e=>t(e,void 0)))}setLng(e){this.lng=e}async enable(e){return await this.connect(e),this.accounts}async connect(e){this.connected?t.be.info("already connected"):await this.signClient.open({requestChainId:e?.toString()??this.optsChainId.toString(),lng:this.lng})}disconnect(){this.connected&&this.signClient.disconnect()}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}removeListener(e,t){this.events.removeListener(e,t)}off(e,t){this.events.off(e,t)}get isWalletConnect(){return!0}registerEventListeners(){this.signClient.on("accountsChanged",(e=>{this.events.emit("accountsChanged",e)})),this.signClient.on("chainChanged",(e=>{this.httpClient=this.setHttpProvider(e),this.events.emit("chainChanged",e)})),this.signClient.on("disconnect",(()=>{this.events.emit("disconnect")}))}setHttpProvider(e){let s=t.Ox(e,this.rpc);if(!(typeof s>"u"))return new class{constructor(e){if(this.url=e,!t.ux(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e}events=new t.u;isAvailable=!1;registering=!1;get connected(){return this.isAvailable}get connecting(){return this.registering}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async request(e){t.be.debug("HttpClient ~ request ~ payload:",e),this.isAvailable||await this.register();try{let s=t.vx(e),i=await(await n.c(this.url,{...h,body:s})).json(),o="string"==typeof i?t.Ux(i):i;return t.be.debug("HttpClient ~ request ~ result:",o),o}catch(t){return this.formatError(e.id,t)}}formatError(e,n){let s=this.parseError(n),i=s.message||s.toString();return t.nx(e,i)}async register(e=this.url){if(!t.ux(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering)return new Promise(((e,t)=>{this.events.once("register_error",(e=>{t(e)})),this.events.once("open",(()=>{if(typeof this.isAvailable>"u")return t(new Error("HTTP connection is missing or invalid"));e()}))}));this.url=e,this.registering=!0;try{let s=t.vx({id:1,jsonrpc:"2.0",method:"test",params:[]});await n.c(e,{...h,body:s}),this.onOpen()}catch(e){let t=this.parseError(e);throw this.events.emit("register_error",t),this.onClose(),t}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("open")}parseError(e,n=this.url){return t.cx(e,n,"HTTP")}}(s)}}(e)};exports.isInBinance=t.we,exports.default=function(t,n){return e.__awaiter(this,void 0,void 0,(function*(){const s=yield bn({chainId:t.chainId,rpc:t.rpc});yield s.enable(),s.on("connect",n.connect),s.on("disconnect",n.disconnect),s.on("accountsChanged",n.accountsChanged),s.on("chainChanged",n.chainChanged),s.on("message",n.message);return e.convertWeb3Provider(s)}))};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("./index-46767b56.cjs"),t=require("./browser-ponyfill-262b9a1d.cjs"),s=require("./ethers-2e33277b.cjs"),a=require("@ethersproject/abstract-signer"),r=require("@ethersproject/providers"),n=require("@ethersproject/contracts"),o=require("./id-ce261f66.cjs"),i=require("@ethersproject/constants"),d=require("events");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function l(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(s){if("default"!==s){var a=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,a.get?a:{enumerable:!0,get:function(){return e[s]}})}})),t.default=e,Object.freeze(t)}require("zustand"),require("@ethersproject/address"),require("@ethersproject/properties"),require("@ethersproject/transactions"),require("@ethersproject/bytes"),require("@ethersproject/abstract-provider"),require("./typed-data-63d8e9ee.cjs"),require("./__node-resolve_empty-b9b68f61.cjs"),require("./hash-282034e6.cjs"),require("./inherits_browser-f88a000a.cjs"),require("@ethersproject/json-wallets"),require("./interface-770bfae7.cjs"),require("./index-92dad595.cjs"),require("./index-b7400738.cjs");var u=l(r),f=l(i),h=c(d),g={},p={},m={},_={},E={},v={name:"@safe-global/safe-apps-sdk",version:"7.10.1",description:"SDK developed to integrate third-party apps with Safe app.",main:"dist/src/index.js",typings:"dist/src/index.d.ts",_files:["dist/**/*","src/**/*","CHANGELOG.md","README.md"],keywords:["Safe","sdk","apps"],scripts:{test:"jest","format-dist":"sed -i '' 's/\"files\":/\"_files\":/' dist/package.json",build:"yarn rimraf dist && tsc && yarn format-dist"},author:"Safe (https://safe.global)",license:"MIT",dependencies:{"@safe-global/safe-gateway-typescript-sdk":"^3.5.3",ethers:"^5.7.2"},devDependencies:{rimraf:"^3.0.2"},repository:{type:"git",url:"git+https://github.com/safe-global/safe-apps-sdk.git"},bugs:{url:"https://github.com/safe-global/safe-apps-sdk/issues"},homepage:"https://github.com/safe-global/safe-apps-sdk#readme",publishConfig:{access:"public"}},y=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(E,"__esModule",{value:!0}),E.getSDKVersion=void 0;const T=y(v);E.getSDKVersion=()=>T.default.version.split("-")[0];var w={};Object.defineProperty(w,"__esModule",{value:!0}),w.generateRequestId=void 0;const b=e=>e.toString(16).padStart(2,"0");w.generateRequestId=()=>"undefined"!=typeof window?(e=>{const t=new Uint8Array((e||40)/2);return window.crypto.getRandomValues(t),Array.from(t,b).join("")})(10):(new Date).getTime().toString(36),Object.defineProperty(_,"__esModule",{value:!0}),_.MessageFormatter=void 0;const S=E,I=w;class A{}_.MessageFormatter=A,A.makeRequest=(e,t)=>({id:(0,I.generateRequestId)(),method:e,params:t,env:{sdkVersion:(0,S.getSDKVersion)()}}),A.makeResponse=(e,t,s)=>({id:e,success:!0,version:s,data:t}),A.makeErrorResponse=(e,t,s)=>({id:e,success:!1,error:t,version:s});var P={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.RestrictedMethods=e.Methods=void 0,(t=e.Methods||(e.Methods={})).sendTransactions="sendTransactions",t.rpcCall="rpcCall",t.getChainInfo="getChainInfo",t.getSafeInfo="getSafeInfo",t.getTxBySafeTxHash="getTxBySafeTxHash",t.getSafeBalances="getSafeBalances",t.signMessage="signMessage",t.signTypedMessage="signTypedMessage",t.getEnvironmentInfo="getEnvironmentInfo",t.getOffChainSignature="getOffChainSignature",t.requestAddressBook="requestAddressBook",t.wallet_getPermissions="wallet_getPermissions",t.wallet_requestPermissions="wallet_requestPermissions",(e.RestrictedMethods||(e.RestrictedMethods={})).requestAddressBook="requestAddressBook"}(P),function(t){var s=e.commonjsGlobal&&e.commonjsGlobal.__createBinding||(Object.create?function(e,t,s,a){void 0===a&&(a=s);var r=Object.getOwnPropertyDescriptor(t,s);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,a,r)}:function(e,t,s,a){void 0===a&&(a=s),e[a]=t[s]}),a=e.commonjsGlobal&&e.commonjsGlobal.__exportStar||function(e,t){for(var a in e)"default"===a||Object.prototype.hasOwnProperty.call(t,a)||s(t,e,a)};Object.defineProperty(t,"__esModule",{value:!0});const r=_;t.default=class{constructor(e=null,t=!1){this.allowedOrigins=null,this.callbacks=new Map,this.debugMode=!1,this.isServer="undefined"==typeof window,this.isValidMessage=({origin:e,data:t,source:s})=>{const a=!t,r=!this.isServer&&s===window.parent,n=(void 0!==t.version&&parseInt(t.version.split(".")[0]))>=1;let o=!0;return Array.isArray(this.allowedOrigins)&&(o=void 0!==this.allowedOrigins.find((t=>t.test(e)))),!a&&r&&n&&o},this.logIncomingMessage=e=>{console.info(`Safe Apps SDK v1: A message was received from origin ${e.origin}. `,e.data)},this.onParentMessage=e=>{this.isValidMessage(e)&&(this.debugMode&&this.logIncomingMessage(e),this.handleIncomingMessage(e.data))},this.handleIncomingMessage=e=>{const{id:t}=e,s=this.callbacks.get(t);s&&(s(e),this.callbacks.delete(t))},this.send=(e,t)=>{const s=r.MessageFormatter.makeRequest(e,t);if(this.isServer)throw new Error("Window doesn't exist");return window.parent.postMessage(s,"*"),new Promise(((e,t)=>{this.callbacks.set(s.id,(s=>{s.success?e(s):t(new Error(s.error))}))}))},this.allowedOrigins=e,this.debugMode=t,this.isServer||window.addEventListener("message",this.onParentMessage)}},a(P,t)}(m);var O={},C={},M={};Object.defineProperty(M,"__esModule",{value:!0}),M.isObjectEIP712TypedData=void 0;M.isObjectEIP712TypedData=e=>"object"==typeof e&&null!=e&&"domain"in e&&"types"in e&&"message"in e;var j={};Object.defineProperty(j,"__esModule",{value:!0});var R={},N={},L={},D={},x=e.commonjsGlobal&&e.commonjsGlobal.__awaiter||function(e,t,s,a){return new(s||(s=Promise))((function(r,n){function o(e){try{d(a.next(e))}catch(e){n(e)}}function i(e){try{d(a.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?r(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,i)}d((a=a.apply(e,t||[])).next())}))},G=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(D,"__esModule",{value:!0}),D.fetchData=D.stringifyQuery=D.insertParams=void 0;const H=G(t.browserPonyfill.exports);D.insertParams=function(e,t){return t?Object.keys(t).reduce(((e,s)=>function(e,t,s){return e.replace(new RegExp(`\\{${t}\\}`,"g"),s)}(e,s,String(t[s]))),e):e},D.stringifyQuery=function(e){if(!e)return"";const t=new URLSearchParams;Object.keys(e).forEach((s=>{null!=e[s]&&t.append(s,String(e[s]))}));const s=t.toString();return s?`?${s}`:""},D.fetchData=function(e,t){return x(this,void 0,void 0,(function*(){let s;null!=t&&(s={method:"POST",body:"string"==typeof t?t:JSON.stringify(t),headers:{"Content-Type":"application/json"}});const a=yield(0,H.default)(e,s);let r;try{r=yield a.json()}catch(e){if(a.headers&&"0"!==a.headers.get("content-length"))throw new Error(`Invalid response content: ${a.statusText}`)}if(!a.ok){const e="object"==typeof(n=r)&&null!==n&&"code"in n&&"message"in n?`${r.code}: ${r.message}`:a.statusText;throw new Error(e)}var n;return r}))},Object.defineProperty(L,"__esModule",{value:!0}),L.getEndpoint=L.postEndpoint=void 0;const B=D;function q(e,t,s,a){return`${e}${(0,B.insertParams)(t,s)}${(0,B.stringifyQuery)(a)}`}L.postEndpoint=function(e,t,s){const a=q(e,t,null==s?void 0:s.path,null==s?void 0:s.query);return(0,B.fetchData)(a,null==s?void 0:s.body)},L.getEndpoint=function(e,t,s,a){if(a)return(0,B.fetchData)(a);const r=q(e,t,null==s?void 0:s.path,null==s?void 0:s.query);return(0,B.fetchData)(r)};var k={};Object.defineProperty(k,"__esModule",{value:!0}),k.DEFAULT_BASE_URL=void 0,k.DEFAULT_BASE_URL="https://safe-client.safe.global";var U={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.ImplementationVersionState=void 0,(t=e.ImplementationVersionState||(e.ImplementationVersionState={})).UP_TO_DATE="UP_TO_DATE",t.OUTDATED="OUTDATED",t.UNKNOWN="UNKNOWN"}(U);var $={};!function(e){var t,s;Object.defineProperty(e,"__esModule",{value:!0}),e.SafeAppSocialPlatforms=e.SafeAppFeatures=e.SafeAppAccessPolicyTypes=void 0,(t=e.SafeAppAccessPolicyTypes||(e.SafeAppAccessPolicyTypes={})).NoRestrictions="NO_RESTRICTIONS",t.DomainAllowlist="DOMAIN_ALLOWLIST",(e.SafeAppFeatures||(e.SafeAppFeatures={})).BATCHED_TRANSACTIONS="BATCHED_TRANSACTIONS",(s=e.SafeAppSocialPlatforms||(e.SafeAppSocialPlatforms={})).TWITTER="TWITTER",s.GITHUB="GITHUB",s.DISCORD="DISCORD"}($);var F={};!function(e){var t,s,a,r,n,o,i,d,c,l;Object.defineProperty(e,"__esModule",{value:!0}),e.LabelValue=e.DetailedExecutionInfoType=e.TransactionListItemType=e.ConflictType=e.TransactionInfoType=e.SettingsInfoType=e.TransactionTokenType=e.TransferDirection=e.TransactionStatus=e.Operation=void 0,(t=e.Operation||(e.Operation={}))[t.CALL=0]="CALL",t[t.DELEGATE=1]="DELEGATE",(s=e.TransactionStatus||(e.TransactionStatus={})).AWAITING_CONFIRMATIONS="AWAITING_CONFIRMATIONS",s.AWAITING_EXECUTION="AWAITING_EXECUTION",s.CANCELLED="CANCELLED",s.FAILED="FAILED",s.SUCCESS="SUCCESS",(a=e.TransferDirection||(e.TransferDirection={})).INCOMING="INCOMING",a.OUTGOING="OUTGOING",a.UNKNOWN="UNKNOWN",(r=e.TransactionTokenType||(e.TransactionTokenType={})).ERC20="ERC20",r.ERC721="ERC721",r.NATIVE_COIN="NATIVE_COIN",(n=e.SettingsInfoType||(e.SettingsInfoType={})).SET_FALLBACK_HANDLER="SET_FALLBACK_HANDLER",n.ADD_OWNER="ADD_OWNER",n.REMOVE_OWNER="REMOVE_OWNER",n.SWAP_OWNER="SWAP_OWNER",n.CHANGE_THRESHOLD="CHANGE_THRESHOLD",n.CHANGE_IMPLEMENTATION="CHANGE_IMPLEMENTATION",n.ENABLE_MODULE="ENABLE_MODULE",n.DISABLE_MODULE="DISABLE_MODULE",n.SET_GUARD="SET_GUARD",n.DELETE_GUARD="DELETE_GUARD",(o=e.TransactionInfoType||(e.TransactionInfoType={})).TRANSFER="Transfer",o.SETTINGS_CHANGE="SettingsChange",o.CUSTOM="Custom",o.CREATION="Creation",(i=e.ConflictType||(e.ConflictType={})).NONE="None",i.HAS_NEXT="HasNext",i.END="End",(d=e.TransactionListItemType||(e.TransactionListItemType={})).TRANSACTION="TRANSACTION",d.LABEL="LABEL",d.CONFLICT_HEADER="CONFLICT_HEADER",d.DATE_LABEL="DATE_LABEL",(c=e.DetailedExecutionInfoType||(e.DetailedExecutionInfoType={})).MULTISIG="MULTISIG",c.MODULE="MODULE",(l=e.LabelValue||(e.LabelValue={})).Queued="Queued",l.Next="Next"}(F);var W={};!function(e){var t,s,a;Object.defineProperty(e,"__esModule",{value:!0}),e.FEATURES=e.GAS_PRICE_TYPE=e.RPC_AUTHENTICATION=void 0,(t=e.RPC_AUTHENTICATION||(e.RPC_AUTHENTICATION={})).API_KEY_PATH="API_KEY_PATH",t.NO_AUTHENTICATION="NO_AUTHENTICATION",t.UNKNOWN="UNKNOWN",(s=e.GAS_PRICE_TYPE||(e.GAS_PRICE_TYPE={})).ORACLE="ORACLE",s.FIXED="FIXED",s.UNKNOWN="UNKNOWN",(a=e.FEATURES||(e.FEATURES={})).ERC721="ERC721",a.SAFE_APPS="SAFE_APPS",a.CONTRACT_INTERACTION="CONTRACT_INTERACTION",a.DOMAIN_LOOKUP="DOMAIN_LOOKUP",a.SPENDING_LIMIT="SPENDING_LIMIT",a.EIP1559="EIP1559",a.SAFE_TX_GAS_OPTIONAL="SAFE_TX_GAS_OPTIONAL",a.TX_SIMULATION="TX_SIMULATION",a.EIP1271="EIP1271"}(W);var V={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.TokenType=void 0,(t=e.TokenType||(e.TokenType={})).ERC20="ERC20",t.ERC721="ERC721",t.NATIVE_TOKEN="NATIVE_TOKEN"}(V);var K={};Object.defineProperty(K,"__esModule",{value:!0});var Q={};Object.defineProperty(Q,"__esModule",{value:!0});var X={};!function(e){var t,s;Object.defineProperty(e,"__esModule",{value:!0}),e.SafeMessageStatus=e.SafeMessageListItemType=void 0,(t=e.SafeMessageListItemType||(e.SafeMessageListItemType={})).DATE_LABEL="DATE_LABEL",t.MESSAGE="MESSAGE",(s=e.SafeMessageStatus||(e.SafeMessageStatus={})).NEEDS_CONFIRMATION="NEEDS_CONFIRMATION",s.CONFIRMED="CONFIRMED"}(X),function(t){var s=e.commonjsGlobal&&e.commonjsGlobal.__createBinding||(Object.create?function(e,t,s,a){void 0===a&&(a=s);var r=Object.getOwnPropertyDescriptor(t,s);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,a,r)}:function(e,t,s,a){void 0===a&&(a=s),e[a]=t[s]}),a=e.commonjsGlobal&&e.commonjsGlobal.__exportStar||function(e,t){for(var a in e)"default"===a||Object.prototype.hasOwnProperty.call(t,a)||s(t,e,a)};Object.defineProperty(t,"__esModule",{value:!0}),t.confirmSafeMessage=t.proposeSafeMessage=t.getSafeMessage=t.getSafeMessages=t.getDecodedData=t.getMasterCopies=t.getSafeApps=t.getChainConfig=t.getChainsConfig=t.proposeTransaction=t.postSafeGasEstimation=t.getTransactionDetails=t.getTransactionQueue=t.getTransactionHistory=t.getCollectiblesPage=t.getCollectibles=t.getOwnedSafes=t.getFiatCurrencies=t.getBalances=t.getMultisigTransactions=t.getModuleTransactions=t.getIncomingTransfers=t.getSafeInfo=t.setBaseUrl=void 0;const r=L,n=k;a(U,t),a($,t),a(F,t),a(W,t),a(V,t),a(K,t),a(Q,t),a(X,t);let o=n.DEFAULT_BASE_URL;t.setBaseUrl=e=>{o=e},t.getSafeInfo=function(e,t){return(0,r.getEndpoint)(o,"/v1/chains/{chainId}/safes/{address}",{path:{chainId:e,address:t}})},t.getIncomingTransfers=function(e,t,s,a){return(0,r.getEndpoint)(o,"/v1/chains/{chainId}/safes/{address}/incoming-transfers/",{path:{chainId:e,address:t},query:s},a)},t.getModuleTransactions=function(e,t,s,a){return(0,r.getEndpoint)(o,"/v1/chains/{chainId}/safes/{address}/module-transactions/",{path:{chainId:e,address:t},query:s},a)},t.getMultisigTransactions=function(e,t,s,a){return(0,r.getEndpoint)(o,"/v1/chains/{chainId}/safes/{address}/multisig-transactions/",{path:{chainId:e,address:t},query:s},a)},t.getBalances=function(e,t,s="usd",a={}){return(0,r.getEndpoint)(o,"/v1/chains/{chainId}/safes/{address}/balances/{currency}",{path:{chainId:e,address:t,currency:s},query:a})},t.getFiatCurrencies=function(){return(0,r.getEndpoint)(o,"/v1/balances/supported-fiat-codes")},t.getOwnedSafes=function(e,t){return(0,r.getEndpoint)(o,"/v1/chains/{chainId}/owners/{address}/safes",{path:{chainId:e,address:t}})},t.getCollectibles=function(e,t,s={}){return(0,r.getEndpoint)(o,"/v1/chains/{chainId}/safes/{address}/collectibles",{path:{chainId:e,address:t},query:s})},t.getCollectiblesPage=function(e,t,s={},a){return(0,r.getEndpoint)(o,"/v2/chains/{chainId}/safes/{address}/collectibles",{path:{chainId:e,address:t},query:s},a)},t.getTransactionHistory=function(e,t,s){return(0,r.getEndpoint)(o,"/v1/chains/{chainId}/safes/{safe_address}/transactions/history",{path:{chainId:e,safe_address:t},query:{}},s)},t.getTransactionQueue=function(e,t,s,a){return(0,r.getEndpoint)(o,"/v1/chains/{chainId}/safes/{safe_address}/transactions/queued",{path:{chainId:e,safe_address:t},query:{trusted:a}},s)},t.getTransactionDetails=function(e,t){return(0,r.getEndpoint)(o,"/v1/chains/{chainId}/transactions/{transactionId}",{path:{chainId:e,transactionId:t}})},t.postSafeGasEstimation=function(e,t,s){return(0,r.postEndpoint)(o,"/v2/chains/{chainId}/safes/{safe_address}/multisig-transactions/estimations",{path:{chainId:e,safe_address:t},body:s})},t.proposeTransaction=function(e,t,s){return(0,r.postEndpoint)(o,"/v1/chains/{chainId}/transactions/{safe_address}/propose",{path:{chainId:e,safe_address:t},body:s})},t.getChainsConfig=function(e){return(0,r.getEndpoint)(o,"/v1/chains",{query:e})},t.getChainConfig=function(e){return(0,r.getEndpoint)(o,"/v1/chains/{chainId}",{path:{chainId:e}})},t.getSafeApps=function(e,t={}){return(0,r.getEndpoint)(o,"/v1/chains/{chainId}/safe-apps",{path:{chainId:e},query:t})},t.getMasterCopies=function(e){return(0,r.getEndpoint)(o,"/v1/chains/{chainId}/about/master-copies",{path:{chainId:e}})},t.getDecodedData=function(e,t){return(0,r.postEndpoint)(o,"/v1/chains/{chainId}/data-decoder",{path:{chainId:e},body:{data:t}})},t.getSafeMessages=function(e,t,s){return(0,r.getEndpoint)(o,"/v1/chains/{chainId}/safes/{safe_address}/messages",{path:{chainId:e,safe_address:t},query:{}},s)},t.getSafeMessage=function(e,t){return(0,r.getEndpoint)(o,"/v1/chains/{chainId}/messages/{message_hash}",{path:{chainId:e,message_hash:t}})},t.proposeSafeMessage=function(e,t,s){return(0,r.postEndpoint)(o,"/v1/chains/{chainId}/safes/{safe_address}/messages",{path:{chainId:e,safe_address:t},body:s})},t.confirmSafeMessage=function(e,t,s){return(0,r.postEndpoint)(o,"/v1/chains/{chainId}/messages/{message_hash}/signatures",{path:{chainId:e,message_hash:t},body:s})}}(N),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TransferDirection=e.TransactionStatus=e.TokenType=e.Operation=void 0;var t=N;Object.defineProperty(e,"Operation",{enumerable:!0,get:function(){return t.Operation}}),Object.defineProperty(e,"TokenType",{enumerable:!0,get:function(){return t.TokenType}}),Object.defineProperty(e,"TransactionStatus",{enumerable:!0,get:function(){return t.TransactionStatus}}),Object.defineProperty(e,"TransferDirection",{enumerable:!0,get:function(){return t.TransferDirection}})}(R);var Y={};Object.defineProperty(Y,"__esModule",{value:!0}),function(t){var s=e.commonjsGlobal&&e.commonjsGlobal.__createBinding||(Object.create?function(e,t,s,a){void 0===a&&(a=s);var r=Object.getOwnPropertyDescriptor(t,s);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,a,r)}:function(e,t,s,a){void 0===a&&(a=s),e[a]=t[s]}),a=e.commonjsGlobal&&e.commonjsGlobal.__exportStar||function(e,t){for(var a in e)"default"===a||Object.prototype.hasOwnProperty.call(t,a)||s(t,e,a)};Object.defineProperty(t,"__esModule",{value:!0}),a(M,t),a(j,t),a(R,t),a(Y,t)}(C),Object.defineProperty(O,"__esModule",{value:!0}),O.TXs=void 0;const J=P,z=C;O.TXs=class{constructor(e){this.communicator=e}async getBySafeTxHash(e){if(!e)throw new Error("Invalid safeTxHash");return(await this.communicator.send(J.Methods.getTxBySafeTxHash,{safeTxHash:e})).data}async signMessage(e){const t={message:e};return(await this.communicator.send(J.Methods.signMessage,t)).data}async signTypedMessage(e){if(!(0,z.isObjectEIP712TypedData)(e))throw new Error("Invalid typed data");return(await this.communicator.send(J.Methods.signTypedMessage,{typedData:e})).data}async send({txs:e,params:t}){if(!e||!e.length)throw new Error("No transactions were passed");const s={txs:e,params:t};return(await this.communicator.send(J.Methods.sendTransactions,s)).data}};var Z={},ee={};Object.defineProperty(ee,"__esModule",{value:!0}),ee.RPC_CALLS=void 0,ee.RPC_CALLS={eth_call:"eth_call",eth_gasPrice:"eth_gasPrice",eth_getLogs:"eth_getLogs",eth_getBalance:"eth_getBalance",eth_getCode:"eth_getCode",eth_getBlockByHash:"eth_getBlockByHash",eth_getBlockByNumber:"eth_getBlockByNumber",eth_getStorageAt:"eth_getStorageAt",eth_getTransactionByHash:"eth_getTransactionByHash",eth_getTransactionReceipt:"eth_getTransactionReceipt",eth_getTransactionCount:"eth_getTransactionCount",eth_estimateGas:"eth_estimateGas",safe_setSettings:"safe_setSettings"},Object.defineProperty(Z,"__esModule",{value:!0}),Z.Eth=void 0;const te=ee,se=P,ae={defaultBlockParam:(e="latest")=>e,returnFullTxObjectParam:(e=!1)=>e,blockNumberToHex:e=>Number.isInteger(e)?`0x${e.toString(16)}`:e};Z.Eth=class{constructor(e){this.communicator=e,this.call=this.buildRequest({call:te.RPC_CALLS.eth_call,formatters:[null,ae.defaultBlockParam]}),this.getBalance=this.buildRequest({call:te.RPC_CALLS.eth_getBalance,formatters:[null,ae.defaultBlockParam]}),this.getCode=this.buildRequest({call:te.RPC_CALLS.eth_getCode,formatters:[null,ae.defaultBlockParam]}),this.getStorageAt=this.buildRequest({call:te.RPC_CALLS.eth_getStorageAt,formatters:[null,ae.blockNumberToHex,ae.defaultBlockParam]}),this.getPastLogs=this.buildRequest({call:te.RPC_CALLS.eth_getLogs}),this.getBlockByHash=this.buildRequest({call:te.RPC_CALLS.eth_getBlockByHash,formatters:[null,ae.returnFullTxObjectParam]}),this.getBlockByNumber=this.buildRequest({call:te.RPC_CALLS.eth_getBlockByNumber,formatters:[ae.blockNumberToHex,ae.returnFullTxObjectParam]}),this.getTransactionByHash=this.buildRequest({call:te.RPC_CALLS.eth_getTransactionByHash}),this.getTransactionReceipt=this.buildRequest({call:te.RPC_CALLS.eth_getTransactionReceipt}),this.getTransactionCount=this.buildRequest({call:te.RPC_CALLS.eth_getTransactionCount,formatters:[null,ae.defaultBlockParam]}),this.getGasPrice=this.buildRequest({call:te.RPC_CALLS.eth_gasPrice}),this.getEstimateGas=e=>this.buildRequest({call:te.RPC_CALLS.eth_estimateGas})([e]),this.setSafeSettings=this.buildRequest({call:te.RPC_CALLS.safe_setSettings})}buildRequest(e){const{call:t,formatters:s}=e;return async e=>{s&&Array.isArray(e)&&s.forEach(((t,s)=>{t&&(e[s]=t(e[s]))}));const a={call:t,params:e||[]};return(await this.communicator.send(se.Methods.rpcCall,a)).data}}};var re={};try{const e=window;null==e._ethers&&(e._ethers=s.ethers)}catch(e){}var ne=Object.freeze({__proto__:null,ethers:s.ethers,Signer:a.Signer,Wallet:s.Wallet,VoidSigner:a.VoidSigner,getDefaultProvider:r.getDefaultProvider,providers:u,BaseContract:n.BaseContract,Contract:n.Contract,ContractFactory:n.ContractFactory,BigNumber:o.BigNumber,FixedNumber:s.FixedNumber,constants:f,get errors(){return o.ErrorCode},logger:s.logger,utils:s.utils,wordlists:s.wordlists,version:s.version,Wordlist:s.Wordlist}),oe=e.getAugmentedNamespace(ne),ie={};Object.defineProperty(ie,"__esModule",{value:!0}),ie.MAGIC_VALUE_BYTES=ie.MAGIC_VALUE=ie.EIP_1271_BYTES_INTERFACE=ie.EIP_1271_INTERFACE=void 0;const de=oe;ie.MAGIC_VALUE="0x1626ba7e";ie.MAGIC_VALUE_BYTES="0x20c13b0b";const ce=new de.ethers.utils.Interface(["function isValidSignature(bytes32 _dataHash, bytes calldata _signature) external view"]);ie.EIP_1271_INTERFACE=ce;const le=new de.ethers.utils.Interface(["function isValidSignature(bytes calldata _data, bytes calldata _signature) public view"]);ie.EIP_1271_BYTES_INTERFACE=le;var ue={},fe={},he={};Object.defineProperty(he,"__esModule",{value:!0}),he.PermissionsError=he.PERMISSIONS_REQUEST_REJECTED=void 0,he.PERMISSIONS_REQUEST_REJECTED=4001;class ge extends Error{constructor(e,t,s){super(e),this.code=t,this.data=s,Object.setPrototypeOf(this,ge.prototype)}}he.PermissionsError=ge,Object.defineProperty(fe,"__esModule",{value:!0}),fe.Wallet=void 0;const pe=P,me=he;fe.Wallet=class{constructor(e){this.communicator=e}async getPermissions(){return(await this.communicator.send(pe.Methods.wallet_getPermissions,void 0)).data}async requestPermissions(e){if(!this.isPermissionRequestValid(e))throw new me.PermissionsError("Permissions request is invalid",me.PERMISSIONS_REQUEST_REJECTED);try{return(await this.communicator.send(pe.Methods.wallet_requestPermissions,e)).data}catch(e){throw new me.PermissionsError("Permissions rejected",me.PERMISSIONS_REQUEST_REJECTED)}}isPermissionRequestValid(e){return e.every((e=>"object"==typeof e&&Object.keys(e).every((e=>!!Object.values(pe.RestrictedMethods).includes(e)))))}},Object.defineProperty(ue,"__esModule",{value:!0});const _e=fe,Ee=he,ve=(e,t)=>t.some((t=>t.parentCapability===e));ue.default=()=>(e,t,s)=>{const a=s.value;return s.value=async function(){const e=new _e.Wallet(this.communicator);let s=await e.getPermissions();if(ve(t,s)||(s=await e.requestPermissions([{[t]:{}}])),!ve(t,s))throw new Ee.PermissionsError("Permissions rejected",Ee.PERMISSIONS_REQUEST_REJECTED);return a.apply(this)},s};var ye=e.commonjsGlobal&&e.commonjsGlobal.__decorate||function(e,t,s,a){var r,n=arguments.length,o=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,s):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,s,a);else for(var i=e.length-1;i>=0;i--)(r=e[i])&&(o=(n<3?r(o):n>3?r(t,s,o):r(t,s))||o);return n>3&&o&&Object.defineProperty(t,s,o),o},Te=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(re,"__esModule",{value:!0}),re.Safe=void 0;const we=oe,be=ie,Se=P,Ie=ee,Ae=C,Pe=Te(ue);class Oe{constructor(e){this.communicator=e}async getChainInfo(){return(await this.communicator.send(Se.Methods.getChainInfo,void 0)).data}async getInfo(){return(await this.communicator.send(Se.Methods.getSafeInfo,void 0)).data}async experimental_getBalances({currency:e="usd"}={}){return(await this.communicator.send(Se.Methods.getSafeBalances,{currency:e})).data}async check1271Signature(e,t="0x"){const s=await this.getInfo(),a=be.EIP_1271_INTERFACE.encodeFunctionData("isValidSignature",[e,t]),r={call:Ie.RPC_CALLS.eth_call,params:[{to:s.safeAddress,data:a},"latest"]};try{return(await this.communicator.send(Se.Methods.rpcCall,r)).data.slice(0,10).toLowerCase()===be.MAGIC_VALUE}catch(e){return!1}}async check1271SignatureBytes(e,t="0x"){const s=await this.getInfo(),a=we.ethers.utils.arrayify(e),r=be.EIP_1271_BYTES_INTERFACE.encodeFunctionData("isValidSignature",[a,t]),n={call:Ie.RPC_CALLS.eth_call,params:[{to:s.safeAddress,data:r},"latest"]};try{return(await this.communicator.send(Se.Methods.rpcCall,n)).data.slice(0,10).toLowerCase()===be.MAGIC_VALUE_BYTES}catch(e){return!1}}calculateMessageHash(e){return we.ethers.utils.hashMessage(e)}calculateTypedMessageHash(e){return we.ethers.utils._TypedDataEncoder.hash(e.domain,e.types,e.message)}async getOffChainSignature(e){return(await this.communicator.send(Se.Methods.getOffChainSignature,e)).data}async isMessageSigned(e,t="0x"){let s;if("string"==typeof e&&(s=async()=>{const s=this.calculateMessageHash(e);return await this.isMessageHashSigned(s,t)}),(0,Ae.isObjectEIP712TypedData)(e)&&(s=async()=>{const s=this.calculateTypedMessageHash(e);return await this.isMessageHashSigned(s,t)}),s){return await s()}throw new Error("Invalid message type")}async isMessageHashSigned(e,t="0x"){const s=[this.check1271Signature.bind(this),this.check1271SignatureBytes.bind(this)];for(const a of s){if(await a(e,t))return!0}return!1}async getEnvironmentInfo(){return(await this.communicator.send(Se.Methods.getEnvironmentInfo,void 0)).data}async requestAddressBook(){return(await this.communicator.send(Se.Methods.requestAddressBook,void 0)).data}}ye([(0,Pe.default)()],Oe.prototype,"requestAddressBook",null),re.Safe=Oe;var Ce=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(p,"__esModule",{value:!0});const Me=Ce(m),je=O,Re=Z,Ne=re,Le=fe;p.default=class{constructor(e={}){const{allowedDomains:t=null,debug:s=!1}=e;this.communicator=new Me.default(t,s),this.eth=new Re.Eth(this.communicator),this.txs=new je.TXs(this.communicator),this.safe=new Ne.Safe(this.communicator),this.wallet=new Le.Wallet(this.communicator)}},function(t){var s=e.commonjsGlobal&&e.commonjsGlobal.__createBinding||(Object.create?function(e,t,s,a){void 0===a&&(a=s);var r=Object.getOwnPropertyDescriptor(t,s);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,a,r)}:function(e,t,s,a){void 0===a&&(a=s),e[a]=t[s]}),a=e.commonjsGlobal&&e.commonjsGlobal.__exportStar||function(e,t){for(var a in e)"default"===a||Object.prototype.hasOwnProperty.call(t,a)||s(t,e,a)},r=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getSDKVersion=void 0;const n=r(p);t.default=n.default,a(p,t),a(C,t),a(P,t),a(_,t);var o=E;Object.defineProperty(t,"getSDKVersion",{enumerable:!0,get:function(){return o.getSDKVersion}})}(g);var De=e.getDefaultExportFromCjs(g),xe={},Ge={},He={};Object.defineProperty(He,"__esModule",{value:!0}),He.getLowerCase=void 0,He.getLowerCase=function(e){return e?e.toLowerCase():e},Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.SafeAppProvider=void 0;const Be=h.default,qe=He;class ke extends Be.EventEmitter{constructor(e,t){super(),this.submittedTxs=new Map,this.safe=e,this.sdk=t}async connect(){this.emit("connect",{chainId:this.chainId})}async disconnect(){}get chainId(){return this.safe.chainId}async request(e){const{method:t,params:s=[]}=e;switch(t){case"eth_accounts":return[this.safe.safeAddress];case"net_version":case"eth_chainId":return`0x${this.chainId.toString(16)}`;case"personal_sign":{const[e,t]=s;if(this.safe.safeAddress.toLowerCase()!==t.toLowerCase())throw new Error("The address or message hash is invalid");return await this.sdk.txs.signMessage(e),"0x"}case"eth_sign":{const[e,t]=s;if(this.safe.safeAddress.toLowerCase()!==e.toLowerCase()||!t.startsWith("0x"))throw new Error("The address or message hash is invalid");return await this.sdk.txs.signMessage(t),"0x"}case"eth_signTypedData":case"eth_signTypedData_v4":{const[e,t]=s,a="string"==typeof t?JSON.parse(t):t;if(this.safe.safeAddress.toLowerCase()!==e.toLowerCase())throw new Error("The address is invalid");return await this.sdk.txs.signTypedMessage(a),"0x"}case"eth_sendTransaction":const t=Object.assign({value:"0",data:"0x"},s[0]);"string"==typeof t.gas&&t.gas.startsWith("0x")&&(t.gas=parseInt(t.gas,16));const a=await this.sdk.txs.send({txs:[t],params:{safeTxGas:t.gas}});return this.submittedTxs.set(a.safeTxHash,{from:this.safe.safeAddress,hash:a.safeTxHash,gas:0,gasPrice:"0x00",nonce:0,input:t.data,value:t.value,to:t.to,blockHash:null,blockNumber:null,transactionIndex:null}),a.safeTxHash;case"eth_blockNumber":return(await this.sdk.eth.getBlockByNumber(["latest"])).number;case"eth_getBalance":return this.sdk.eth.getBalance([(0,qe.getLowerCase)(s[0]),s[1]]);case"eth_getCode":return this.sdk.eth.getCode([(0,qe.getLowerCase)(s[0]),s[1]]);case"eth_getTransactionCount":return this.sdk.eth.getTransactionCount([(0,qe.getLowerCase)(s[0]),s[1]]);case"eth_getStorageAt":return this.sdk.eth.getStorageAt([(0,qe.getLowerCase)(s[0]),s[1],s[2]]);case"eth_getBlockByNumber":return this.sdk.eth.getBlockByNumber([s[0],s[1]]);case"eth_getBlockByHash":return this.sdk.eth.getBlockByHash([s[0],s[1]]);case"eth_getTransactionByHash":let r=s[0];try{r=(await this.sdk.txs.getBySafeTxHash(r)).txHash||r}catch(e){}return this.submittedTxs.has(r)?this.submittedTxs.get(r):this.sdk.eth.getTransactionByHash([r]).then((e=>(e&&(e.hash=s[0]),e)));case"eth_getTransactionReceipt":{let e=s[0];try{e=(await this.sdk.txs.getBySafeTxHash(e)).txHash||e}catch(e){}return this.sdk.eth.getTransactionReceipt([e]).then((e=>(e&&(e.transactionHash=s[0]),e)))}case"eth_estimateGas":return this.sdk.eth.getEstimateGas(s[0]);case"eth_call":return this.sdk.eth.call([s[0],s[1]]);case"eth_getLogs":return this.sdk.eth.getPastLogs([s[0]]);case"eth_gasPrice":return this.sdk.eth.getGasPrice();case"wallet_getPermissions":return this.sdk.wallet.getPermissions();case"wallet_requestPermissions":return this.sdk.wallet.requestPermissions(s[0]);case"safe_setSettings":return this.sdk.eth.setSafeSettings([s[0]]);default:throw Error(`"${e.method}" not implemented`)}}send(e,t){e||t("Undefined request"),this.request(e).then((s=>t(null,{jsonrpc:"2.0",id:e.id,result:s}))).catch((e=>t(e,null)))}}let Ue,$e;function Fe(){return e.__awaiter(this,void 0,void 0,(function*(){return $e||($e=new De),void 0===Ue&&(Ue=yield Promise.race([$e.safe.getInfo(),new Promise((e=>setTimeout(e,200)))])),Ue}))}Ge.SafeAppProvider=ke,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SafeAppProvider=void 0;var t=Ge;Object.defineProperty(e,"SafeAppProvider",{enumerable:!0,get:function(){return t.SafeAppProvider}})}(xe);var We={},Ve={},Ke={};Object.defineProperty(Ke,"__esModule",{value:!0}),Ke.getTxServiceBaseUrl=void 0,Ke.getTxServiceBaseUrl=function(e){return`${e}/api`};var Qe={},Xe={exports:{}};!function(t,s){var a=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e.commonjsGlobal)return e.commonjsGlobal;throw new Error("unable to locate global object")}();t.exports=s=a.fetch,a.fetch&&(s.default=a.fetch.bind(a)),s.Headers=a.Headers,s.Request=a.Request,s.Response=a.Response}(Xe,Xe.exports),function(t){var s=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.sendRequest=t.HttpMethod=void 0;const a=s(Xe.exports);var r;(r=t.HttpMethod||(t.HttpMethod={})).Get="get",r.Post="post",r.Delete="delete",t.sendRequest=async function({url:e,method:t,body:s}){const r=await(0,a.default)(e,{method:t,headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(s)});let n;try{n=await r.json()}catch(e){if(!r.ok)throw new Error(r.statusText)}if(r.ok)return n;if(n.data)throw new Error(n.data);if(n.detail)throw new Error(n.detail);if(n.message)throw new Error(n.message);if(n.nonFieldErrors)throw new Error(n.nonFieldErrors);if(n.delegate)throw new Error(n.delegate);if(n.safe)throw new Error(n.safe);if(n.delegator)throw new Error(n.delegator);throw new Error(r.statusText)}}(Qe);var Ye,Je,ze=e.commonjsGlobal&&e.commonjsGlobal.__classPrivateFieldSet||function(e,t,s,a,r){if("m"===a)throw new TypeError("Private method is not writable");if("a"===a&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===a?r.call(e,s):r?r.value=s:t.set(e,s),s},Ze=e.commonjsGlobal&&e.commonjsGlobal.__classPrivateFieldGet||function(e,t,s,a){if("a"===s&&!a)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?a:"a"===s?a.call(e):a?a.value:t.get(e)};Object.defineProperty(Ve,"__esModule",{value:!0});const et=Ke,tt=Qe;Ye=new WeakMap,Je=new WeakMap,Ve.default=class{constructor({txServiceUrl:e,ethAdapter:t}){Ye.set(this,void 0),Je.set(this,void 0),ze(this,Ye,(0,et.getTxServiceBaseUrl)(e),"f"),ze(this,Je,t,"f")}async getServiceInfo(){return(0,tt.sendRequest)({url:`${Ze(this,Ye,"f")}/v1/about`,method:tt.HttpMethod.Get})}async getServiceMasterCopiesInfo(){return(0,tt.sendRequest)({url:`${Ze(this,Ye,"f")}/v1/about/master-copies`,method:tt.HttpMethod.Get})}async decodeData(e){if(""===e)throw new Error("Invalid data");return(0,tt.sendRequest)({url:`${Ze(this,Ye,"f")}/v1/data-decoder/`,method:tt.HttpMethod.Post,body:{data:e}})}async getSafesByOwner(e){if(""===e)throw new Error("Invalid owner address");const{address:t}=await Ze(this,Je,"f").getEip3770Address(e);return(0,tt.sendRequest)({url:`${Ze(this,Ye,"f")}/v1/owners/${t}/safes/`,method:tt.HttpMethod.Get})}async getSafesByModule(e){if(""===e)throw new Error("Invalid module address");const{address:t}=await Ze(this,Je,"f").getEip3770Address(e);return(0,tt.sendRequest)({url:`${Ze(this,Ye,"f")}/v1/modules/${t}/safes/`,method:tt.HttpMethod.Get})}async getTransaction(e){if(""===e)throw new Error("Invalid safeTxHash");return(0,tt.sendRequest)({url:`${Ze(this,Ye,"f")}/v1/multisig-transactions/${e}/`,method:tt.HttpMethod.Get})}async getTransactionConfirmations(e){if(""===e)throw new Error("Invalid safeTxHash");return(0,tt.sendRequest)({url:`${Ze(this,Ye,"f")}/v1/multisig-transactions/${e}/confirmations/`,method:tt.HttpMethod.Get})}async confirmTransaction(e,t){if(""===e)throw new Error("Invalid safeTxHash");if(""===t)throw new Error("Invalid signature");return(0,tt.sendRequest)({url:`${Ze(this,Ye,"f")}/v1/multisig-transactions/${e}/confirmations/`,method:tt.HttpMethod.Post,body:{signature:t}})}async getSafeInfo(e){if(""===e)throw new Error("Invalid Safe address");const{address:t}=await Ze(this,Je,"f").getEip3770Address(e);return(0,tt.sendRequest)({url:`${Ze(this,Ye,"f")}/v1/safes/${t}/`,method:tt.HttpMethod.Get})}async getSafeDelegates({safeAddress:e,delegateAddress:t,delegatorAddress:s,label:a,limit:r,offset:n}){const o=new URL(`${Ze(this,Ye,"f")}/v1/delegates`);if(e){const{address:t}=await Ze(this,Je,"f").getEip3770Address(e);o.searchParams.set("safe",t)}if(t){const{address:e}=await Ze(this,Je,"f").getEip3770Address(t);o.searchParams.set("delegate",e)}if(s){const{address:e}=await Ze(this,Je,"f").getEip3770Address(s);o.searchParams.set("delegator",e)}return a&&o.searchParams.set("label",a),r&&o.searchParams.set("limit",r),n&&o.searchParams.set("offset",n),(0,tt.sendRequest)({url:o.toString(),method:tt.HttpMethod.Get})}async addSafeDelegate({safeAddress:e,delegateAddress:t,delegatorAddress:s,label:a,signer:r}){if(""===t)throw new Error("Invalid Safe delegate address");if(""===s)throw new Error("Invalid Safe delegator address");if(""===a)throw new Error("Invalid label");const{address:n}=await Ze(this,Je,"f").getEip3770Address(t),{address:o}=await Ze(this,Je,"f").getEip3770Address(s),i=n+Math.floor(Date.now()/1e3/3600),d=await r.signMessage(i),c={safe:e?(await Ze(this,Je,"f").getEip3770Address(e)).address:null,delegate:n,delegator:o,label:a,signature:d};return(0,tt.sendRequest)({url:`${Ze(this,Ye,"f")}/v1/delegates/`,method:tt.HttpMethod.Post,body:c})}async removeSafeDelegate({delegateAddress:e,delegatorAddress:t,signer:s}){if(""===e)throw new Error("Invalid Safe delegate address");if(""===t)throw new Error("Invalid Safe delegator address");const{address:a}=await Ze(this,Je,"f").getEip3770Address(e),{address:r}=await Ze(this,Je,"f").getEip3770Address(t),n=a+Math.floor(Date.now()/1e3/3600),o=await s.signMessage(n);return(0,tt.sendRequest)({url:`${Ze(this,Ye,"f")}/v1/delegates/${a}`,method:tt.HttpMethod.Delete,body:{delegate:a,delegator:r,signature:o}})}async getSafeCreationInfo(e){if(""===e)throw new Error("Invalid Safe address");const{address:t}=await Ze(this,Je,"f").getEip3770Address(e);return(0,tt.sendRequest)({url:`${Ze(this,Ye,"f")}/v1/safes/${t}/creation/`,method:tt.HttpMethod.Get})}async estimateSafeTransaction(e,t){if(""===e)throw new Error("Invalid Safe address");const{address:s}=await Ze(this,Je,"f").getEip3770Address(e);return(0,tt.sendRequest)({url:`${Ze(this,Ye,"f")}/v1/safes/${s}/multisig-transactions/estimations/`,method:tt.HttpMethod.Post,body:t})}async proposeTransaction({safeAddress:e,safeTransactionData:t,safeTxHash:s,senderAddress:a,senderSignature:r,origin:n}){if(""===e)throw new Error("Invalid Safe address");const{address:o}=await Ze(this,Je,"f").getEip3770Address(e),{address:i}=await Ze(this,Je,"f").getEip3770Address(a);if(""===s)throw new Error("Invalid safeTxHash");return(0,tt.sendRequest)({url:`${Ze(this,Ye,"f")}/v1/safes/${o}/multisig-transactions/`,method:tt.HttpMethod.Post,body:{...t,contractTransactionHash:s,sender:i,signature:r,origin:n}})}async getIncomingTransactions(e){if(""===e)throw new Error("Invalid Safe address");const{address:t}=await Ze(this,Je,"f").getEip3770Address(e);return(0,tt.sendRequest)({url:`${Ze(this,Ye,"f")}/v1/safes/${t}/incoming-transfers?executed=true`,method:tt.HttpMethod.Get})}async getModuleTransactions(e){if(""===e)throw new Error("Invalid Safe address");const{address:t}=await Ze(this,Je,"f").getEip3770Address(e);return(0,tt.sendRequest)({url:`${Ze(this,Ye,"f")}/v1/safes/${t}/module-transactions/`,method:tt.HttpMethod.Get})}async getMultisigTransactions(e){if(""===e)throw new Error("Invalid Safe address");const{address:t}=await Ze(this,Je,"f").getEip3770Address(e);return(0,tt.sendRequest)({url:`${Ze(this,Ye,"f")}/v1/safes/${t}/multisig-transactions/`,method:tt.HttpMethod.Get})}async getPendingTransactions(e,t){if(""===e)throw new Error("Invalid Safe address");const{address:s}=await Ze(this,Je,"f").getEip3770Address(e),a=t||(await this.getSafeInfo(s)).nonce;return(0,tt.sendRequest)({url:`${Ze(this,Ye,"f")}/v1/safes/${s}/multisig-transactions/?executed=false&nonce__gte=${a}`,method:tt.HttpMethod.Get})}async getAllTransactions(e,t){var s,a,r;if(""===e)throw new Error("Invalid Safe address");const{address:n}=await Ze(this,Je,"f").getEip3770Address(e),o=new URL(`${Ze(this,Ye,"f")}/v1/safes/${n}/all-transactions/`),i=(null===(s=null==t?void 0:t.trusted)||void 0===s?void 0:s.toString())||"true";o.searchParams.set("trusted",i);const d=(null===(a=null==t?void 0:t.queued)||void 0===a?void 0:a.toString())||"true";o.searchParams.set("queued",d);const c=(null===(r=null==t?void 0:t.executed)||void 0===r?void 0:r.toString())||"false";return o.searchParams.set("executed",c),(0,tt.sendRequest)({url:o.toString(),method:tt.HttpMethod.Get})}async getNextNonce(e){if(""===e)throw new Error("Invalid Safe address");const{address:t}=await Ze(this,Je,"f").getEip3770Address(e),s=await this.getPendingTransactions(t);if(s.results.length>0){const e=s.results.map((e=>e.nonce));return Math.max(...e)+1}return(await this.getSafeInfo(t)).nonce}async getTokenList(){return(0,tt.sendRequest)({url:`${Ze(this,Ye,"f")}/v1/tokens/`,method:tt.HttpMethod.Get})}async getToken(e){if(""===e)throw new Error("Invalid token address");const{address:t}=await Ze(this,Je,"f").getEip3770Address(e);return(0,tt.sendRequest)({url:`${Ze(this,Ye,"f")}/v1/tokens/${t}/`,method:tt.HttpMethod.Get})}};var st={};Object.defineProperty(st,"__esModule",{value:!0}),function(t){var s=e.commonjsGlobal&&e.commonjsGlobal.__createBinding||(Object.create?function(e,t,s,a){void 0===a&&(a=s);var r=Object.getOwnPropertyDescriptor(t,s);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,a,r)}:function(e,t,s,a){void 0===a&&(a=s),e[a]=t[s]}),a=e.commonjsGlobal&&e.commonjsGlobal.__exportStar||function(e,t){for(var a in e)"default"===a||Object.prototype.hasOwnProperty.call(t,a)||s(t,e,a)},r=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(Ve);a(st,t),t.default=n.default}(We);var at=e.getDefaultExportFromCjs(We);const rt={1:"https://safe-transaction-mainnet.safe.global/",5:"https://safe-transaction-goerli.safe.global/",42161:"https://safe-transaction-arbitrum.safe.global/",43114:"https://safe-transaction-avalanche.safe.global/",1313161554:"https://safe-transaction-aurora.safe.global/",56:"https://safe-transaction-bsc.safe.global/",10:"https://safe-transaction-optimism.safe.global/",137:"https://safe-transaction-polygon.safe.global/"};let nt;function ot(t){return e.__awaiter(this,void 0,void 0,(function*(){if((null==nt?void 0:nt.chainId)===t)return nt.safeService;if(!e.useWalletStore.getState().provider)throw new Error("provider is undefined");const s=function(){return{getEip3770Address:t=>e.__awaiter(this,void 0,void 0,(function*(){const{address:e,prefix:s}=function(e){const t=e.split(":"),s=t.length>1?t[1]:t[0];return{prefix:t.length>1?t[0]:"",address:s}}(t);return{address:e,prefix:s}}))}}(),a=rt[t];if(!a)return;const r=new at({txServiceUrl:a,ethAdapter:s});return nt={safeService:r,chainId:t},nt.safeService}))}exports.default=function(t){return e.__awaiter(this,void 0,void 0,(function*(){const s=yield Fe();if(!s)throw Error("Could not load Safe information");const a=new xe.SafeAppProvider(s,$e);return a.on("connect",t.connect),a.on("disconnect",t.disconnect),a.on("accountsChanged",t.accountsChanged),a.on("chainChanged",t.chainChanged),a.on("message",t.message),e.convertWeb3Provider(a)}))},exports.getAccountIsSafe=function(t,s){return e.__awaiter(this,void 0,void 0,(function*(){if(!s)return!1;const e=yield ot(t);if(!e)return!1;try{return!!(yield e.getSafeInfo(s))}catch(e){return console.error(e),!1}}))},exports.getConnectedSafe=Fe,exports.getIsSafe=function(){return e.__awaiter(this,void 0,void 0,(function*(){return!!(yield Fe())}))},exports.getSafeHashDetailUrl=function(e,t,s){const a={1:"eth",5:"gor",137:"matic",56:"bnb",42161:"arb1",10:"oeth",43114:"avax",1313161554:"aurora"}[t];if(!a)throw new Error(`Not Supported network: ${t}`);return`https://app.safe.global/transactions/tx?id=multisig_${s}_${e}&safe=${a}%3A${s}`},exports.getSafeTxHash=function(t,s,a){return e.__awaiter(this,void 0,void 0,(function*(){const e=yield ot(t);if(!e)return console.error(`chainId: ${t} is not supported safe`),a;if(a!==s)return a;const r=yield e.getMultisigTransactions(a),[n]=r.results;return n.safeTxHash}))},exports.getSafeTxStatus=function(t,s,a){return e.__awaiter(this,void 0,void 0,(function*(){const e=yield ot(t);if(!e)throw new Error(`chainId: ${t} is not supported safe`);try{const{results:t}=yield e.getMultisigTransactions(a),r=t.find((e=>e.safeTxHash.toLocaleLowerCase()===s.toLocaleLowerCase()));if(!r)return null;if(t.some((e=>!(e.nonce!==r.nonce||e.safeTxHash.toLocaleLowerCase()===s.toLocaleLowerCase()||!e.isExecuted||!e.isSuccessful))))return"rejected";if(null===r.isExecuted||null===r.isSuccessful)return null;return{status:r.isExecuted&&r.isSuccessful||!1,transactionHash:r.transactionHash,blockNumber:r.blockNumber||null}}catch(e){throw console.error(e),new Error(`safeTxHash: ${s} is not valid.`)}}))};
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./index-46767b56.cjs");require("@ethersproject/providers"),require("zustand"),require("events"),require("@ethersproject/address"),require("@ethersproject/constants"),require("@ethersproject/contracts"),require("@ethersproject/properties"),require("@ethersproject/transactions"),require("@ethersproject/bytes"),Object.defineProperty(exports,"ChainId",{enumerable:!0,get:function(){return e.ChainId}}),exports.HD_PATH_LIST=e.HD_PATH_LIST,exports.OpenBlockIframeWallet=e.OpenBlockIframeWallet,Object.defineProperty(exports,"WalletType",{enumerable:!0,get:function(){return e.WalletType}}),Object.defineProperty(exports,"WatchResult",{enumerable:!0,get:function(){return e.WatchResult}}),exports.allWalletList=e.allWalletList,exports.allWalletObject=e.allWalletObject,exports.approve=e.approve,exports.convertTransactionType=e.convertTransactionType,exports.convertWeb3Provider=e.convertWeb3Provider,exports.default=e.Core,exports.getBinanceConnector=e.getBinanceConnector,exports.getBinancePackage=e.getBinancePackage,exports.getBloctoConnector=e.getBloctoConnector,exports.getBloctoPackage=e.getBloctoPackage,exports.getContract=e.getContract,exports.getCyberConnector=e.getCyberConnector,exports.getCyberPackage=e.getCyberPackage,exports.getEstimateGas=e.getEstimateGas,exports.getGasPrice=e.getGasPrice,exports.getGnosisPackage=e.getGnosisPackage,exports.getIsAndroid=e.getIsAndroid,exports.getIsIOS=e.getIsIOS,exports.getIsMobile=e.getIsMobile,exports.getIsOpenBlockIframe=e.getIsOpenBlockIframe,exports.getIsolatedEnvironmentWallet=e.getIsolatedEnvironmentWallet,exports.getLedgerUSBPackage=e.getLedgerUSBPackage,exports.getMetamaskConnector=e.getMetamaskConnector,exports.getMetamaskPackage=e.getMetamaskPackage,exports.getOpenBlockIframeConnector=e.connectOpenBlockIframe,exports.getPortisConnector=e.getPortisConnector,exports.getPortisPackage=e.getPortisPackage,exports.getProviderByChain=e.getProviderByChain,exports.getRainbowConnectPackage=e.getRainbowConnectPackage,exports.getRainbowConnector=e.getRainbowConnector,exports.getUAuthPackage=e.getUAuthPackage,exports.getUniPassConnector=e.getUniPassConnector,exports.getUniPassPackage=e.getUniPassPackage,exports.getWalletConnectConnector=e.getWalletConnectConnector,exports.getWalletConnectPackage=e.getWalletConnectPackage,exports.getWalletDisabledState=e.getWalletDisabledState,exports.getWalletLinkConnector=e.getWalletLinkConnector,exports.getWalletLinkPackage=e.getWalletLinkPackage,exports.getWalletList=e.getWalletList,exports.getWindow=e.getWindow,exports.injectedConnect=e.injectedConnect,exports.isAddress=e.isAddress,exports.isLargeIOS=e.isLargeIOS,exports.isSmallIOS=e.isSmallIOS,exports.isSupportWebHid=e.isSupportWebHid,exports.personalSign=e.personalSign,exports.registerNetworkWithMetamask=e.registerNetworkWithMetamask,exports.sendTransaction=e.sendTransaction,exports.sign=e.sign,exports.signTransaction=e.signTransaction,exports.signTypedData=e.signTypedData,exports.standaloneList=e.standaloneList,exports.standaloneListObject=e.standaloneListObject,exports.useWalletStore=e.useWalletStore,exports.watchTx=e.watchTx;
|