@multiversx/sdk-dapp 2.22.3 → 2.22.5
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/UI/NotificationModal/NotificationModal.js +1 -1
- package/UI/NotificationModal/index.js +1 -1
- package/UI/SignTransactionsModals/SignTransactionsModals.js +1 -1
- package/UI/SignTransactionsModals/SignWithDeviceModal/SignStep.js +1 -1
- package/UI/SignTransactionsModals/SignWithDeviceModal/SignWithDeviceModal.js +1 -1
- package/UI/SignTransactionsModals/SignWithDeviceModal/components/SignStepBody.js +1 -1
- package/UI/SignTransactionsModals/SignWithDeviceModal/components/components/ConfirmFee/ConfirmFee.js +1 -1
- package/UI/SignTransactionsModals/SignWithDeviceModal/components/components/ConfirmFee/index.js +1 -1
- package/UI/SignTransactionsModals/SignWithDeviceModal/components/components/ConfirmReceiver/ConfirmReceiver.js +1 -1
- package/UI/SignTransactionsModals/SignWithDeviceModal/components/components/ConfirmReceiver/components/ReceiverSubValue/ReceiverSubValue.js +1 -1
- package/UI/SignTransactionsModals/SignWithDeviceModal/components/components/ConfirmReceiver/components/ReceiverSubValue/index.js +1 -1
- package/UI/SignTransactionsModals/SignWithDeviceModal/components/components/ConfirmReceiver/components/ReceiverValue/ReceiverValue.js +1 -1
- package/UI/SignTransactionsModals/SignWithDeviceModal/components/components/ConfirmReceiver/components/ReceiverValue/index.js +1 -1
- package/UI/SignTransactionsModals/SignWithDeviceModal/components/components/ConfirmReceiver/index.js +1 -1
- package/UI/SignTransactionsModals/SignWithDeviceModal/components/components/NftSftPreviewComponent/NftSftPreviewComponent.js +1 -1
- package/UI/SignTransactionsModals/SignWithDeviceModal/components/components/NftSftPreviewComponent/index.js +1 -1
- package/UI/SignTransactionsModals/SignWithDeviceModal/components/index.js +1 -1
- package/UI/SignTransactionsModals/SignWithDeviceModal/index.js +1 -1
- package/UI/SignTransactionsModals/SignWithExtensionModal/SignWithExtensionModal.js +1 -1
- package/UI/SignTransactionsModals/SignWithExtensionModal/index.js +1 -1
- package/UI/SignTransactionsModals/SignWithLedgerModal/LedgerGuardianSigningModalError.js +1 -1
- package/UI/SignTransactionsModals/SignWithLedgerModal/SignWithLedgerModal.js +1 -1
- package/UI/SignTransactionsModals/SignWithLedgerModal/index.js +1 -1
- package/UI/SignTransactionsModals/components/ConfirmationScreen.js +1 -1
- package/UI/SignTransactionsModals/components/DeviceConfirmationScreen.js +1 -1
- package/UI/SignTransactionsModals/components/index.js +1 -1
- package/UI/SignTransactionsModals/index.js +1 -1
- package/UI/TransactionDetails/TransactionDetails.js +1 -1
- package/UI/TransactionDetails/components/TransactionDetailsBody.js +1 -1
- package/UI/TransactionDetails/components/index.js +1 -1
- package/UI/TransactionDetails/index.js +1 -1
- package/UI/TransactionInfo/TransactionInfo.js +1 -1
- package/UI/TransactionInfo/components/AddressDetailItem/AddressDetailitem.js +1 -1
- package/UI/TransactionInfo/components/AddressDetailItem/index.js +1 -1
- package/UI/TransactionInfo/components/EventsList/EventsList.js +1 -1
- package/UI/TransactionInfo/components/EventsList/index.js +1 -1
- package/UI/TransactionInfo/components/NonceMessage/NonceMessage.js +1 -1
- package/UI/TransactionInfo/components/NonceMessage/index.js +1 -1
- package/UI/TransactionInfo/components/OperationsList/OperationList.js +1 -1
- package/UI/TransactionInfo/components/OperationsList/components/DetailedItem.js +1 -1
- package/UI/TransactionInfo/components/OperationsList/components/OperationBlock.js +1 -1
- package/UI/TransactionInfo/components/OperationsList/components/OperationRow.js +1 -1
- package/UI/TransactionInfo/components/OperationsList/components/OperationText.js +1 -1
- package/UI/TransactionInfo/components/OperationsList/components/index.js +1 -1
- package/UI/TransactionInfo/components/OperationsList/index.js +1 -1
- package/UI/TransactionInfo/components/ScResultsList/ScResultsList.js +1 -1
- package/UI/TransactionInfo/components/ScResultsList/components/ResultHash/ResultHash.js +1 -1
- package/UI/TransactionInfo/components/ScResultsList/components/ResultHash/index.js +1 -1
- package/UI/TransactionInfo/components/ScResultsList/components/ResultReceiver/ResultReceiver.js +1 -1
- package/UI/TransactionInfo/components/ScResultsList/components/ResultReceiver/index.js +1 -1
- package/UI/TransactionInfo/components/ScResultsList/components/ResultSender/ResultSender.js +1 -1
- package/UI/TransactionInfo/components/ScResultsList/components/ResultSender/index.js +1 -1
- package/UI/TransactionInfo/components/ScResultsList/index.js +1 -1
- package/UI/TransactionInfo/components/ScrDetailItem/ScrDetailItem.js +1 -1
- package/UI/TransactionInfo/components/ScrDetailItem/index.js +1 -1
- package/UI/TransactionInfo/components/TransactionAction/TransactionAction.js +1 -1
- package/UI/TransactionInfo/components/TransactionAction/components/ActionText/index.js +1 -1
- package/UI/TransactionInfo/components/TransactionAction/components/index.js +1 -1
- package/UI/TransactionInfo/components/TransactionAction/index.js +1 -1
- package/UI/TransactionInfo/components/TransactionLogs/TransactionLogs.js +1 -1
- package/UI/TransactionInfo/components/TransactionLogs/index.js +1 -1
- package/UI/TransactionInfo/components/index.js +1 -1
- package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoFrom/TransactionInfoFrom.js +1 -1
- package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoFrom/index.js +1 -1
- package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoMethod/TransactionInfoMethod.js +1 -1
- package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoMethod/index.js +1 -1
- package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoMiniblock/TransactionInfoMiniblock.js +1 -1
- package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoMiniblock/index.js +1 -1
- package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoNonce/TransactionInfoNonce.js +1 -1
- package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoNonce/index.js +1 -1
- package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoScResults/TransactionInfoScResults.js +1 -1
- package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoScResults/index.js +1 -1
- package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoTo/TransactionInfoTo.js +1 -1
- package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoTo/index.js +1 -1
- package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoTokenOperations/TransactionInfoTokenOperations.js +1 -1
- package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoTokenOperations/index.js +1 -1
- package/UI/TransactionInfo/components/transactionInfoFields/index.js +1 -1
- package/UI/TransactionInfo/index.js +1 -1
- package/UI/TransactionsTable/TransactionsTable.js +1 -1
- package/UI/TransactionsTable/components/AccountName.js +1 -1
- package/UI/TransactionsTable/components/TransactionHash.js +1 -1
- package/UI/TransactionsTable/components/TransactionReceiver.js +1 -1
- package/UI/TransactionsTable/components/TransactionRow.js +1 -1
- package/UI/TransactionsTable/components/TransactionSender.js +1 -1
- package/UI/TransactionsTable/components/index.js +1 -1
- package/UI/TransactionsTable/index.js +1 -1
- package/UI/TransactionsToastList/TransactionsToastList.js +1 -1
- package/UI/TransactionsToastList/components/CustomToast/CustomToast.js +1 -1
- package/UI/TransactionsToastList/components/CustomToast/components/CustomComponentToast.js +1 -1
- package/UI/TransactionsToastList/components/CustomToast/components/IconToast/IconToast.js +1 -1
- package/UI/TransactionsToastList/components/CustomToast/components/IconToast/components/IconToastFooter/IconToastFooter.js +1 -1
- package/UI/TransactionsToastList/components/CustomToast/components/IconToast/components/IconToastFooter/components/TransactionToastFooter.js +1 -1
- package/UI/TransactionsToastList/components/CustomToast/components/IconToast/components/IconToastFooter/components/index.js +1 -1
- package/UI/TransactionsToastList/components/CustomToast/components/IconToast/components/IconToastFooter/index.js +1 -1
- package/UI/TransactionsToastList/components/CustomToast/components/IconToast/index.js +1 -1
- package/UI/TransactionsToastList/components/CustomToast/components/SimpleToast.js +1 -1
- package/UI/TransactionsToastList/components/CustomToast/components/index.js +1 -1
- package/UI/TransactionsToastList/components/CustomToast/helpers/index.js +1 -1
- package/UI/TransactionsToastList/components/CustomToast/helpers/useMemoizedCloseButton.js +1 -1
- package/UI/TransactionsToastList/components/CustomToast/index.js +1 -1
- package/UI/TransactionsToastList/components/TransactionToast/TransactionToast.js +1 -1
- package/UI/TransactionsToastList/components/TransactionToast/components/TransactionToastContent.js +1 -1
- package/UI/TransactionsToastList/components/TransactionToast/components/index.js +1 -1
- package/UI/TransactionsToastList/components/TransactionToast/hooks/useTransactionToast.js +1 -1
- package/UI/TransactionsToastList/components/TransactionToast/index.js +1 -1
- package/UI/TransactionsToastList/components/TransactionToastGuard.js +1 -1
- package/UI/TransactionsToastList/components/index.js +1 -1
- package/UI/TransactionsToastList/index.js +1 -1
- package/UI/Trim/Trim.js +1 -1
- package/UI/Trim/index.js +1 -1
- package/UI/index.js +1 -1
- package/UI/ledger/LedgerLoginButton/LedgerLoginButton.js +1 -1
- package/UI/ledger/LedgerLoginButton/index.js +1 -1
- package/UI/ledger/LedgerLoginContainer/AddressRow/AddressRow.js +1 -1
- package/UI/ledger/LedgerLoginContainer/AddressRow/index.js +1 -1
- package/UI/ledger/LedgerLoginContainer/AddressTable/AddressTable.js +1 -1
- package/UI/ledger/LedgerLoginContainer/AddressTable/index.js +1 -1
- package/UI/ledger/LedgerLoginContainer/ConfirmAddress/ConfirmAddress.js +1 -1
- package/UI/ledger/LedgerLoginContainer/ConfirmAddress/index.js +1 -1
- package/UI/ledger/LedgerLoginContainer/LedgerLoginContainer.js +1 -1
- package/UI/ledger/LedgerLoginContainer/LedgerLoginContent/LedgerLoginContent.js +1 -1
- package/UI/ledger/LedgerLoginContainer/LedgerLoginContent/index.js +1 -1
- package/UI/ledger/LedgerLoginContainer/LedgerLoginContentBody/LedgerLoginContentBody.js +1 -1
- package/UI/ledger/LedgerLoginContainer/LedgerLoginContentBody/index.js +1 -1
- package/UI/ledger/LedgerLoginContainer/index.js +1 -1
- package/UI/ledger/index.js +1 -1
- package/UI/operaWallet/OperaWalletLoginButton/OperaWalletLoginButton.js +1 -1
- package/UI/operaWallet/OperaWalletLoginButton/index.js +1 -1
- package/UI/pages/UnlockPage/index.js +1 -1
- package/UI/pages/index.js +1 -1
- package/UI/walletConnect/WalletConnectLoginButton/WalletConnectLoginButton.js +1 -1
- package/UI/walletConnect/WalletConnectLoginButton/index.js +1 -1
- package/UI/walletConnect/index.js +1 -1
- package/UI/webWallet/WebWalletLoginButton/WebWalletLoginButton.js +1 -1
- package/UI/webWallet/WebWalletLoginButton/index.js +1 -1
- package/__chunks__/{chunk-2X7IQMV3.js → chunk-66GI5LMJ.js} +2 -2
- package/__chunks__/chunk-6KZ376QS.js +2 -0
- package/__chunks__/chunk-ALWWVLET.js +2 -0
- package/__chunks__/{chunk-KBPU354O.js → chunk-CNEOY4HF.js} +2 -2
- package/__chunks__/{chunk-RJINUKHI.js → chunk-VGTBAXEI.js} +2 -2
- package/__chunks__/chunk-XKW7JKY7.js +2 -0
- package/__commonjs/UI/index.js +1 -1
- package/__commonjs/UI/pages/UnlockPage/index.js +1 -1
- package/__commonjs/UI/pages/index.js +1 -1
- package/__commonjs/UI/webWallet/WebWalletLoginButton/WebWalletLoginButton.js +1 -1
- package/__commonjs/UI/webWallet/WebWalletLoginButton/index.js +1 -1
- package/__commonjs/__mocks__/index.js +1 -1
- package/__commonjs/__mocks__/utils/index.js +1 -1
- package/__commonjs/__mocks__/utils/mockWindowHistory.js +1 -1
- package/__commonjs/__mocks__/utils/mockWindowLocation.js +1 -1
- package/__commonjs/hooks/index.js +1 -1
- package/__commonjs/hooks/login/index.js +1 -1
- package/__commonjs/hooks/login/useWebWalletLogin.js +1 -1
- package/__mocks__/index.js +1 -1
- package/__mocks__/utils/index.js +1 -1
- package/__mocks__/utils/mockWindowHistory.js +1 -1
- package/__mocks__/utils/mockWindowLocation.js +1 -1
- package/__mocks__/utils/renderWithProvider.js +1 -1
- package/components/LogoutListener/LogoutListener.js +1 -1
- package/components/LogoutListener/helpers/index.js +1 -1
- package/components/LogoutListener/helpers/useLogoutFromMultipleTabs.js +1 -1
- package/components/LogoutListener/helpers/useNativeAuthLogout.js +1 -1
- package/components/LogoutListener/helpers/useNativeAuthLogoutWarning/index.js +1 -1
- package/components/LogoutListener/helpers/useNativeAuthLogoutWarning/useNativeAuthLogoutWarning.js +1 -1
- package/components/LogoutListener/index.js +1 -1
- package/components/TransactionsTracker/TransactionTracker.js +1 -1
- package/components/TransactionsTracker/index.js +1 -1
- package/hooks/index.js +1 -1
- package/hooks/login/index.js +1 -1
- package/hooks/login/useWebWalletLogin.js +1 -1
- package/hooks/transactions/useTransactionsTracker.js +1 -1
- package/package.json +2 -2
- package/wrappers/DappProvider/CustomComponents.js +1 -1
- package/wrappers/DappProvider/DappProvider.js +1 -1
- package/wrappers/DappProvider/index.js +1 -1
- package/wrappers/index.js +1 -1
- package/__chunks__/chunk-GHE2YVYT.js +0 -2
- package/__chunks__/chunk-WIEHPIS6.js +0 -2
- package/__chunks__/chunk-ZD4T5RDE.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Lr=Object.create;var k=Object.defineProperty,Rr=Object.defineProperties,_r=Object.getOwnPropertyDescriptor,Mr=Object.getOwnPropertyDescriptors,kr=Object.getOwnPropertyNames,rr=Object.getOwnPropertySymbols,Dr=Object.getPrototypeOf,er=Object.prototype.hasOwnProperty,br=Object.prototype.propertyIsEnumerable;var tr=(e,r,t)=>r in e?k(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,ir=(e,r)=>{for(var t in r||(r={}))er.call(r,t)&&tr(e,t,r[t]);if(rr)for(var t of rr(r))br.call(r,t)&&tr(e,t,r[t]);return e},nr=(e,r)=>Rr(e,Mr(r));var Nr=(e,r)=>()=>(e&&(r=e(e=0)),r);var N=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),Wr=(e,r)=>{for(var t in r)k(e,t,{get:r[t],enumerable:!0})},or=(e,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of kr(r))!er.call(e,n)&&n!==t&&k(e,n,{get:()=>r[n],enumerable:!(i=_r(r,n))||i.enumerable});return e};var ur=(e,r,t)=>(t=e!=null?Lr(Dr(e)):{},or(r||!e||!e.__esModule?k(t,"default",{value:e,enumerable:!0}):t,e)),Yr=e=>or(k({},"__esModule",{value:!0}),e);var fr=N(W=>{"use strict";F();W.byteLength=Hr;W.toByteArray=Xr;W.fromByteArray=Jr;var g=[],m=[],qr=typeof Uint8Array!="undefined"?Uint8Array:Array,X="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(d=0,ar=X.length;d<ar;++d)g[d]=X[d],m[X.charCodeAt(d)]=d;var d,ar;m["-".charCodeAt(0)]=62;m["_".charCodeAt(0)]=63;function hr(e){var r=e.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=e.indexOf("=");t===-1&&(t=r);var i=t===r?0:4-t%4;return[t,i]}function Hr(e){var r=hr(e),t=r[0],i=r[1];return(t+i)*3/4-i}function Or(e,r,t){return(r+t)*3/4-t}function Xr(e){var r,t=hr(e),i=t[0],n=t[1],o=new qr(Or(e,i,n)),u=0,h=n>0?i-4:i,f;for(f=0;f<h;f+=4)r=m[e.charCodeAt(f)]<<18|m[e.charCodeAt(f+1)]<<12|m[e.charCodeAt(f+2)]<<6|m[e.charCodeAt(f+3)],o[u++]=r>>16&255,o[u++]=r>>8&255,o[u++]=r&255;return n===2&&(r=m[e.charCodeAt(f)]<<2|m[e.charCodeAt(f+1)]>>4,o[u++]=r&255),n===1&&(r=m[e.charCodeAt(f)]<<10|m[e.charCodeAt(f+1)]<<4|m[e.charCodeAt(f+2)]>>2,o[u++]=r>>8&255,o[u++]=r&255),o}function Gr(e){return g[e>>18&63]+g[e>>12&63]+g[e>>6&63]+g[e&63]}function zr(e,r,t){for(var i,n=[],o=r;o<t;o+=3)i=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(e[o+2]&255),n.push(Gr(i));return n.join("")}function Jr(e){for(var r,t=e.length,i=t%3,n=[],o=16383,u=0,h=t-i;u<h;u+=o)n.push(zr(e,u,u+o>h?h:u+o));return i===1?(r=e[t-1],n.push(g[r>>2]+g[r<<4&63]+"==")):i===2&&(r=(e[t-2]<<8)+e[t-1],n.push(g[r>>10]+g[r>>4&63]+g[r<<2&63]+"=")),n.join("")}});var pr=N(G=>{F();G.read=function(e,r,t,i,n){var o,u,h=n*8-i-1,f=(1<<h)-1,c=f>>1,l=-7,p=t?n-1:0,E=t?-1:1,x=e[r+p];for(p+=E,o=x&(1<<-l)-1,x>>=-l,l+=h;l>0;o=o*256+e[r+p],p+=E,l-=8);for(u=o&(1<<-l)-1,o>>=-l,l+=i;l>0;u=u*256+e[r+p],p+=E,l-=8);if(o===0)o=1-c;else{if(o===f)return u?NaN:(x?-1:1)*(1/0);u=u+Math.pow(2,i),o=o-c}return(x?-1:1)*u*Math.pow(2,o-i)};G.write=function(e,r,t,i,n,o){var u,h,f,c=o*8-n-1,l=(1<<c)-1,p=l>>1,E=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=i?0:o-1,L=i?1:-1,Sr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(h=isNaN(r)?1:0,u=l):(u=Math.floor(Math.log(r)/Math.LN2),r*(f=Math.pow(2,-u))<1&&(u--,f*=2),u+p>=1?r+=E/f:r+=E*Math.pow(2,1-p),r*f>=2&&(u++,f/=2),u+p>=l?(h=0,u=l):u+p>=1?(h=(r*f-1)*Math.pow(2,n),u=u+p):(h=r*Math.pow(2,p-1)*Math.pow(2,n),u=0));n>=8;e[t+x]=h&255,x+=L,h/=256,n-=8);for(u=u<<n|h,c+=n;c>0;e[t+x]=u&255,x+=L,u/=256,c-=8);e[t+x-L]|=Sr*128}});var vr=N(_=>{"use strict";F();var z=fr(),R=pr(),cr=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;_.Buffer=a;_.SlowBuffer=jr;_.INSPECT_MAX_BYTES=50;var q=2147483647;_.kMaxLength=q;a.TYPED_ARRAY_SUPPORT=Qr();!a.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Qr(){try{var e=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(e,r),e.foo()===42}catch(t){return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(!!a.isBuffer(this))return this.buffer}});Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(!!a.isBuffer(this))return this.byteOffset}});function U(e){if(e>q)throw new RangeError('The value "'+e+'" is invalid for option "size"');var r=new Uint8Array(e);return Object.setPrototypeOf(r,a.prototype),r}function a(e,r,t){if(typeof e=="number"){if(typeof r=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return K(e)}return wr(e,r,t)}a.poolSize=8192;function wr(e,r,t){if(typeof e=="string")return Kr(e,r);if(ArrayBuffer.isView(e))return Zr(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(B(e,ArrayBuffer)||e&&B(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(B(e,SharedArrayBuffer)||e&&B(e.buffer,SharedArrayBuffer)))return Q(e,r,t);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var i=e.valueOf&&e.valueOf();if(i!=null&&i!==e)return a.from(i,r,t);var n=$r(e);if(n)return n;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return a.from(e[Symbol.toPrimitive]("string"),r,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}a.from=function(e,r,t){return wr(e,r,t)};Object.setPrototypeOf(a.prototype,Uint8Array.prototype);Object.setPrototypeOf(a,Uint8Array);function yr(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function Vr(e,r,t){return yr(e),e<=0?U(e):r!==void 0?typeof t=="string"?U(e).fill(r,t):U(e).fill(r):U(e)}a.alloc=function(e,r,t){return Vr(e,r,t)};function K(e){return yr(e),U(e<0?0:Z(e)|0)}a.allocUnsafe=function(e){return K(e)};a.allocUnsafeSlow=function(e){return K(e)};function Kr(e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!a.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var t=xr(e,r)|0,i=U(t),n=i.write(e,r);return n!==t&&(i=i.slice(0,n)),i}function J(e){for(var r=e.length<0?0:Z(e.length)|0,t=U(r),i=0;i<r;i+=1)t[i]=e[i]&255;return t}function Zr(e){if(B(e,Uint8Array)){var r=new Uint8Array(e);return Q(r.buffer,r.byteOffset,r.byteLength)}return J(e)}function Q(e,r,t){if(r<0||e.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<r+(t||0))throw new RangeError('"length" is outside of buffer bounds');var i;return r===void 0&&t===void 0?i=new Uint8Array(e):t===void 0?i=new Uint8Array(e,r):i=new Uint8Array(e,r,t),Object.setPrototypeOf(i,a.prototype),i}function $r(e){if(a.isBuffer(e)){var r=Z(e.length)|0,t=U(r);return t.length===0||e.copy(t,0,0,r),t}if(e.length!==void 0)return typeof e.length!="number"||$(e.length)?U(0):J(e);if(e.type==="Buffer"&&Array.isArray(e.data))return J(e.data)}function Z(e){if(e>=q)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+q.toString(16)+" bytes");return e|0}function jr(e){return+e!=e&&(e=0),a.alloc(+e)}a.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==a.prototype};a.compare=function(r,t){if(B(r,Uint8Array)&&(r=a.from(r,r.offset,r.byteLength)),B(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(r)||!a.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===t)return 0;for(var i=r.length,n=t.length,o=0,u=Math.min(i,n);o<u;++o)if(r[o]!==t[o]){i=r[o],n=t[o];break}return i<n?-1:n<i?1:0};a.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};a.concat=function(r,t){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return a.alloc(0);var i;if(t===void 0)for(t=0,i=0;i<r.length;++i)t+=r[i].length;var n=a.allocUnsafe(t),o=0;for(i=0;i<r.length;++i){var u=r[i];if(B(u,Uint8Array))o+u.length>n.length?a.from(u).copy(n,o):Uint8Array.prototype.set.call(n,u,o);else if(a.isBuffer(u))u.copy(n,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=u.length}return n};function xr(e,r){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||B(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var t=e.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&t===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Ar(e).length;default:if(n)return i?-1:V(e).length;r=(""+r).toLowerCase(),n=!0}}a.byteLength=xr;function Pr(e,r,t){var i=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,r>>>=0,t<=r))return"";for(e||(e="utf8");;)switch(e){case"hex":return ft(this,r,t);case"utf8":case"utf-8":return Er(this,r,t);case"ascii":return at(this,r,t);case"latin1":case"binary":return ht(this,r,t);case"base64":return ot(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pt(this,r,t);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}a.prototype._isBuffer=!0;function C(e,r,t){var i=e[r];e[r]=e[t],e[t]=i}a.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<r;t+=2)C(this,t,t+1);return this};a.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<r;t+=4)C(this,t,t+3),C(this,t+1,t+2);return this};a.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<r;t+=8)C(this,t,t+7),C(this,t+1,t+6),C(this,t+2,t+5),C(this,t+3,t+4);return this};a.prototype.toString=function(){var r=this.length;return r===0?"":arguments.length===0?Er(this,0,r):Pr.apply(this,arguments)};a.prototype.toLocaleString=a.prototype.toString;a.prototype.equals=function(r){if(!a.isBuffer(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:a.compare(this,r)===0};a.prototype.inspect=function(){var r="",t=_.INSPECT_MAX_BYTES;return r=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(r+=" ... "),"<Buffer "+r+">"};cr&&(a.prototype[cr]=a.prototype.inspect);a.prototype.compare=function(r,t,i,n,o){if(B(r,Uint8Array)&&(r=a.from(r,r.offset,r.byteLength)),!a.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(t===void 0&&(t=0),i===void 0&&(i=r?r.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),t<0||i>r.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=i)return 0;if(n>=o)return-1;if(t>=i)return 1;if(t>>>=0,i>>>=0,n>>>=0,o>>>=0,this===r)return 0;for(var u=o-n,h=i-t,f=Math.min(u,h),c=this.slice(n,o),l=r.slice(t,i),p=0;p<f;++p)if(c[p]!==l[p]){u=c[p],h=l[p];break}return u<h?-1:h<u?1:0};function mr(e,r,t,i,n){if(e.length===0)return-1;if(typeof t=="string"?(i=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,$(t)&&(t=n?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(n)return-1;t=e.length-1}else if(t<0)if(n)t=0;else return-1;if(typeof r=="string"&&(r=a.from(r,i)),a.isBuffer(r))return r.length===0?-1:lr(e,r,t,i,n);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(e,r,t):Uint8Array.prototype.lastIndexOf.call(e,r,t):lr(e,[r],t,i,n);throw new TypeError("val must be string, number or Buffer")}function lr(e,r,t,i,n){var o=1,u=e.length,h=r.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(e.length<2||r.length<2)return-1;o=2,u/=2,h/=2,t/=2}function f(x,L){return o===1?x[L]:x.readUInt16BE(L*o)}var c;if(n){var l=-1;for(c=t;c<u;c++)if(f(e,c)===f(r,l===-1?0:c-l)){if(l===-1&&(l=c),c-l+1===h)return l*o}else l!==-1&&(c-=c-l),l=-1}else for(t+h>u&&(t=u-h),c=t;c>=0;c--){for(var p=!0,E=0;E<h;E++)if(f(e,c+E)!==f(r,E)){p=!1;break}if(p)return c}return-1}a.prototype.includes=function(r,t,i){return this.indexOf(r,t,i)!==-1};a.prototype.indexOf=function(r,t,i){return mr(this,r,t,i,!0)};a.prototype.lastIndexOf=function(r,t,i){return mr(this,r,t,i,!1)};function rt(e,r,t,i){t=Number(t)||0;var n=e.length-t;i?(i=Number(i),i>n&&(i=n)):i=n;var o=r.length;i>o/2&&(i=o/2);for(var u=0;u<i;++u){var h=parseInt(r.substr(u*2,2),16);if($(h))return u;e[t+u]=h}return u}function tt(e,r,t,i){return H(V(r,e.length-t),e,t,i)}function et(e,r,t,i){return H(st(r),e,t,i)}function it(e,r,t,i){return H(Ar(r),e,t,i)}function nt(e,r,t,i){return H(wt(r,e.length-t),e,t,i)}a.prototype.write=function(r,t,i,n){if(t===void 0)n="utf8",i=this.length,t=0;else if(i===void 0&&typeof t=="string")n=t,i=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(i)?(i=i>>>0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-t;if((i===void 0||i>o)&&(i=o),r.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var u=!1;;)switch(n){case"hex":return rt(this,r,t,i);case"utf8":case"utf-8":return tt(this,r,t,i);case"ascii":case"latin1":case"binary":return et(this,r,t,i);case"base64":return it(this,r,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return nt(this,r,t,i);default:if(u)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),u=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ot(e,r,t){return r===0&&t===e.length?z.fromByteArray(e):z.fromByteArray(e.slice(r,t))}function Er(e,r,t){t=Math.min(e.length,t);for(var i=[],n=r;n<t;){var o=e[n],u=null,h=o>239?4:o>223?3:o>191?2:1;if(n+h<=t){var f,c,l,p;switch(h){case 1:o<128&&(u=o);break;case 2:f=e[n+1],(f&192)===128&&(p=(o&31)<<6|f&63,p>127&&(u=p));break;case 3:f=e[n+1],c=e[n+2],(f&192)===128&&(c&192)===128&&(p=(o&15)<<12|(f&63)<<6|c&63,p>2047&&(p<55296||p>57343)&&(u=p));break;case 4:f=e[n+1],c=e[n+2],l=e[n+3],(f&192)===128&&(c&192)===128&&(l&192)===128&&(p=(o&15)<<18|(f&63)<<12|(c&63)<<6|l&63,p>65535&&p<1114112&&(u=p))}}u===null?(u=65533,h=1):u>65535&&(u-=65536,i.push(u>>>10&1023|55296),u=56320|u&1023),i.push(u),n+=h}return ut(i)}var sr=4096;function ut(e){var r=e.length;if(r<=sr)return String.fromCharCode.apply(String,e);for(var t="",i=0;i<r;)t+=String.fromCharCode.apply(String,e.slice(i,i+=sr));return t}function at(e,r,t){var i="";t=Math.min(e.length,t);for(var n=r;n<t;++n)i+=String.fromCharCode(e[n]&127);return i}function ht(e,r,t){var i="";t=Math.min(e.length,t);for(var n=r;n<t;++n)i+=String.fromCharCode(e[n]);return i}function ft(e,r,t){var i=e.length;(!r||r<0)&&(r=0),(!t||t<0||t>i)&&(t=i);for(var n="",o=r;o<t;++o)n+=yt[e[o]];return n}function pt(e,r,t){for(var i=e.slice(r,t),n="",o=0;o<i.length-1;o+=2)n+=String.fromCharCode(i[o]+i[o+1]*256);return n}a.prototype.slice=function(r,t){var i=this.length;r=~~r,t=t===void 0?i:~~t,r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),t<r&&(t=r);var n=this.subarray(r,t);return Object.setPrototypeOf(n,a.prototype),n};function w(e,r,t){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+r>t)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(r,t,i){r=r>>>0,t=t>>>0,i||w(r,t,this.length);for(var n=this[r],o=1,u=0;++u<t&&(o*=256);)n+=this[r+u]*o;return n};a.prototype.readUintBE=a.prototype.readUIntBE=function(r,t,i){r=r>>>0,t=t>>>0,i||w(r,t,this.length);for(var n=this[r+--t],o=1;t>0&&(o*=256);)n+=this[r+--t]*o;return n};a.prototype.readUint8=a.prototype.readUInt8=function(r,t){return r=r>>>0,t||w(r,1,this.length),this[r]};a.prototype.readUint16LE=a.prototype.readUInt16LE=function(r,t){return r=r>>>0,t||w(r,2,this.length),this[r]|this[r+1]<<8};a.prototype.readUint16BE=a.prototype.readUInt16BE=function(r,t){return r=r>>>0,t||w(r,2,this.length),this[r]<<8|this[r+1]};a.prototype.readUint32LE=a.prototype.readUInt32LE=function(r,t){return r=r>>>0,t||w(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};a.prototype.readUint32BE=a.prototype.readUInt32BE=function(r,t){return r=r>>>0,t||w(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};a.prototype.readIntLE=function(r,t,i){r=r>>>0,t=t>>>0,i||w(r,t,this.length);for(var n=this[r],o=1,u=0;++u<t&&(o*=256);)n+=this[r+u]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*t)),n};a.prototype.readIntBE=function(r,t,i){r=r>>>0,t=t>>>0,i||w(r,t,this.length);for(var n=t,o=1,u=this[r+--n];n>0&&(o*=256);)u+=this[r+--n]*o;return o*=128,u>=o&&(u-=Math.pow(2,8*t)),u};a.prototype.readInt8=function(r,t){return r=r>>>0,t||w(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};a.prototype.readInt16LE=function(r,t){r=r>>>0,t||w(r,2,this.length);var i=this[r]|this[r+1]<<8;return i&32768?i|4294901760:i};a.prototype.readInt16BE=function(r,t){r=r>>>0,t||w(r,2,this.length);var i=this[r+1]|this[r]<<8;return i&32768?i|4294901760:i};a.prototype.readInt32LE=function(r,t){return r=r>>>0,t||w(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};a.prototype.readInt32BE=function(r,t){return r=r>>>0,t||w(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};a.prototype.readFloatLE=function(r,t){return r=r>>>0,t||w(r,4,this.length),R.read(this,r,!0,23,4)};a.prototype.readFloatBE=function(r,t){return r=r>>>0,t||w(r,4,this.length),R.read(this,r,!1,23,4)};a.prototype.readDoubleLE=function(r,t){return r=r>>>0,t||w(r,8,this.length),R.read(this,r,!0,52,8)};a.prototype.readDoubleBE=function(r,t){return r=r>>>0,t||w(r,8,this.length),R.read(this,r,!1,52,8)};function y(e,r,t,i,n,o){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>n||r<o)throw new RangeError('"value" argument is out of bounds');if(t+i>e.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(r,t,i,n){if(r=+r,t=t>>>0,i=i>>>0,!n){var o=Math.pow(2,8*i)-1;y(this,r,t,i,o,0)}var u=1,h=0;for(this[t]=r&255;++h<i&&(u*=256);)this[t+h]=r/u&255;return t+i};a.prototype.writeUintBE=a.prototype.writeUIntBE=function(r,t,i,n){if(r=+r,t=t>>>0,i=i>>>0,!n){var o=Math.pow(2,8*i)-1;y(this,r,t,i,o,0)}var u=i-1,h=1;for(this[t+u]=r&255;--u>=0&&(h*=256);)this[t+u]=r/h&255;return t+i};a.prototype.writeUint8=a.prototype.writeUInt8=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,1,255,0),this[t]=r&255,t+1};a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,2,65535,0),this[t]=r&255,this[t+1]=r>>>8,t+2};a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,2,65535,0),this[t]=r>>>8,this[t+1]=r&255,t+2};a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,4,4294967295,0),this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=r&255,t+4};a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,4,4294967295,0),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};a.prototype.writeIntLE=function(r,t,i,n){if(r=+r,t=t>>>0,!n){var o=Math.pow(2,8*i-1);y(this,r,t,i,o-1,-o)}var u=0,h=1,f=0;for(this[t]=r&255;++u<i&&(h*=256);)r<0&&f===0&&this[t+u-1]!==0&&(f=1),this[t+u]=(r/h>>0)-f&255;return t+i};a.prototype.writeIntBE=function(r,t,i,n){if(r=+r,t=t>>>0,!n){var o=Math.pow(2,8*i-1);y(this,r,t,i,o-1,-o)}var u=i-1,h=1,f=0;for(this[t+u]=r&255;--u>=0&&(h*=256);)r<0&&f===0&&this[t+u+1]!==0&&(f=1),this[t+u]=(r/h>>0)-f&255;return t+i};a.prototype.writeInt8=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,1,127,-128),r<0&&(r=255+r+1),this[t]=r&255,t+1};a.prototype.writeInt16LE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,2,32767,-32768),this[t]=r&255,this[t+1]=r>>>8,t+2};a.prototype.writeInt16BE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,2,32767,-32768),this[t]=r>>>8,this[t+1]=r&255,t+2};a.prototype.writeInt32LE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,4,2147483647,-2147483648),this[t]=r&255,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24,t+4};a.prototype.writeInt32BE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};function Fr(e,r,t,i,n,o){if(t+i>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function gr(e,r,t,i,n){return r=+r,t=t>>>0,n||Fr(e,r,t,4,34028234663852886e22,-34028234663852886e22),R.write(e,r,t,i,23,4),t+4}a.prototype.writeFloatLE=function(r,t,i){return gr(this,r,t,!0,i)};a.prototype.writeFloatBE=function(r,t,i){return gr(this,r,t,!1,i)};function Br(e,r,t,i,n){return r=+r,t=t>>>0,n||Fr(e,r,t,8,17976931348623157e292,-17976931348623157e292),R.write(e,r,t,i,52,8),t+8}a.prototype.writeDoubleLE=function(r,t,i){return Br(this,r,t,!0,i)};a.prototype.writeDoubleBE=function(r,t,i){return Br(this,r,t,!1,i)};a.prototype.copy=function(r,t,i,n){if(!a.isBuffer(r))throw new TypeError("argument should be a Buffer");if(i||(i=0),!n&&n!==0&&(n=this.length),t>=r.length&&(t=r.length),t||(t=0),n>0&&n<i&&(n=i),n===i||r.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),r.length-t<n-i&&(n=r.length-t+i);var o=n-i;return this===r&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,i,n):Uint8Array.prototype.set.call(r,this.subarray(i,n),t),o};a.prototype.fill=function(r,t,i,n){if(typeof r=="string"){if(typeof t=="string"?(n=t,t=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(r.length===1){var o=r.charCodeAt(0);(n==="utf8"&&o<128||n==="latin1")&&(r=o)}}else typeof r=="number"?r=r&255:typeof r=="boolean"&&(r=Number(r));if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;t=t>>>0,i=i===void 0?this.length:i>>>0,r||(r=0);var u;if(typeof r=="number")for(u=t;u<i;++u)this[u]=r;else{var h=a.isBuffer(r)?r:a.from(r,n),f=h.length;if(f===0)throw new TypeError('The value "'+r+'" is invalid for argument "value"');for(u=0;u<i-t;++u)this[u+t]=h[u%f]}return this};var ct=/[^+/0-9A-Za-z-_]/g;function lt(e){if(e=e.split("=")[0],e=e.trim().replace(ct,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function V(e,r){r=r||1/0;for(var t,i=e.length,n=null,o=[],u=0;u<i;++u){if(t=e.charCodeAt(u),t>55295&&t<57344){if(!n){if(t>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(u+1===i){(r-=3)>-1&&o.push(239,191,189);continue}n=t;continue}if(t<56320){(r-=3)>-1&&o.push(239,191,189),n=t;continue}t=(n-55296<<10|t-56320)+65536}else n&&(r-=3)>-1&&o.push(239,191,189);if(n=null,t<128){if((r-=1)<0)break;o.push(t)}else if(t<2048){if((r-=2)<0)break;o.push(t>>6|192,t&63|128)}else if(t<65536){if((r-=3)<0)break;o.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((r-=4)<0)break;o.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return o}function st(e){for(var r=[],t=0;t<e.length;++t)r.push(e.charCodeAt(t)&255);return r}function wt(e,r){for(var t,i,n,o=[],u=0;u<e.length&&!((r-=2)<0);++u)t=e.charCodeAt(u),i=t>>8,n=t%256,o.push(n),o.push(i);return o}function Ar(e){return z.toByteArray(lt(e))}function H(e,r,t,i){for(var n=0;n<i&&!(n+t>=r.length||n>=e.length);++n)r[n+t]=e[n];return n}function B(e,r){return e instanceof r||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===r.name}function $(e){return e!==e}var yt=function(){for(var e="0123456789abcdef",r=new Array(256),t=0;t<16;++t)for(var i=t*16,n=0;n<16;++n)r[i+n]=e[t]+e[n];return r}()});var Cr=N((Ut,dr)=>{F();var s=dr.exports={},A,v;function j(){throw new Error("setTimeout has not been defined")}function P(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?A=setTimeout:A=j}catch(e){A=j}try{typeof clearTimeout=="function"?v=clearTimeout:v=P}catch(e){v=P}})();function Ur(e){if(A===setTimeout)return setTimeout(e,0);if((A===j||!A)&&setTimeout)return A=setTimeout,setTimeout(e,0);try{return A(e,0)}catch(r){try{return A.call(null,e,0)}catch(t){return A.call(this,e,0)}}}function xt(e){if(v===clearTimeout)return clearTimeout(e);if((v===P||!v)&&clearTimeout)return v=clearTimeout,clearTimeout(e);try{return v(e)}catch(r){try{return v.call(null,e)}catch(t){return v.call(this,e)}}}var T=[],M=!1,S,O=-1;function mt(){!M||!S||(M=!1,S.length?T=S.concat(T):O=-1,T.length&&Tr())}function Tr(){if(!M){var e=Ur(mt);M=!0;for(var r=T.length;r;){for(S=T,T=[];++O<r;)S&&S[O].run();O=-1,r=T.length}S=null,M=!1,xt(e)}}s.nextTick=function(e){var r=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)r[t-1]=arguments[t];T.push(new Ir(e,r)),T.length===1&&!M&&Ur(Tr)};function Ir(e,r){this.fun=e,this.array=r}Ir.prototype.run=function(){this.fun.apply(null,this.array)};s.title="browser";s.browser=!0;s.env={};s.argv=[];s.version="";s.versions={};function I(){}s.on=I;s.addListener=I;s.once=I;s.off=I;s.removeListener=I;s.removeAllListeners=I;s.emit=I;s.prependListener=I;s.prependOnceListener=I;s.listeners=function(e){return[]};s.binding=function(e){throw new Error("process.binding is not supported")};s.cwd=function(){return"/"};s.chdir=function(e){throw new Error("process.chdir is not supported")};s.umask=function(){return 0}});var D,b,Tt,F=Nr(()=>{D=ur(vr()),b=ur(Cr()),Tt=function(e){function r(){var i=this||self;return delete e.prototype.__magic__,i}if(typeof globalThis=="object")return globalThis;if(this)return r();e.defineProperty(e.prototype,"__magic__",{configurable:!0,get:r});var t=__magic__;return t}(Object)});var Ft={};Wr(Ft,{mockWindowHistory:()=>Et});module.exports=Yr(Ft);F();var Et=()=>{let e=window.history;delete window.history,window.history=Object.defineProperties({},nr(ir({},Object.getOwnPropertyDescriptors(e)),{pushState:{configurable:!0,value:jest.fn()}}))};0&&(module.exports={mockWindowHistory});
|
|
1
|
+
"use strict";var Lr=Object.create;var k=Object.defineProperty,Rr=Object.defineProperties,_r=Object.getOwnPropertyDescriptor,Mr=Object.getOwnPropertyDescriptors,kr=Object.getOwnPropertyNames,rr=Object.getOwnPropertySymbols,Dr=Object.getPrototypeOf,er=Object.prototype.hasOwnProperty,br=Object.prototype.propertyIsEnumerable;var tr=(e,r,t)=>r in e?k(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,ir=(e,r)=>{for(var t in r||(r={}))er.call(r,t)&&tr(e,t,r[t]);if(rr)for(var t of rr(r))br.call(r,t)&&tr(e,t,r[t]);return e},nr=(e,r)=>Rr(e,Mr(r));var Nr=(e,r)=>()=>(e&&(r=e(e=0)),r);var N=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),Wr=(e,r)=>{for(var t in r)k(e,t,{get:r[t],enumerable:!0})},or=(e,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of kr(r))!er.call(e,n)&&n!==t&&k(e,n,{get:()=>r[n],enumerable:!(i=_r(r,n))||i.enumerable});return e};var ur=(e,r,t)=>(t=e!=null?Lr(Dr(e)):{},or(r||!e||!e.__esModule?k(t,"default",{value:e,enumerable:!0}):t,e)),Yr=e=>or(k({},"__esModule",{value:!0}),e);var fr=N(W=>{"use strict";F();W.byteLength=Hr;W.toByteArray=Xr;W.fromByteArray=Jr;var g=[],m=[],qr=typeof Uint8Array!="undefined"?Uint8Array:Array,X="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(d=0,ar=X.length;d<ar;++d)g[d]=X[d],m[X.charCodeAt(d)]=d;var d,ar;m["-".charCodeAt(0)]=62;m["_".charCodeAt(0)]=63;function hr(e){var r=e.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=e.indexOf("=");t===-1&&(t=r);var i=t===r?0:4-t%4;return[t,i]}function Hr(e){var r=hr(e),t=r[0],i=r[1];return(t+i)*3/4-i}function Or(e,r,t){return(r+t)*3/4-t}function Xr(e){var r,t=hr(e),i=t[0],n=t[1],o=new qr(Or(e,i,n)),u=0,h=n>0?i-4:i,f;for(f=0;f<h;f+=4)r=m[e.charCodeAt(f)]<<18|m[e.charCodeAt(f+1)]<<12|m[e.charCodeAt(f+2)]<<6|m[e.charCodeAt(f+3)],o[u++]=r>>16&255,o[u++]=r>>8&255,o[u++]=r&255;return n===2&&(r=m[e.charCodeAt(f)]<<2|m[e.charCodeAt(f+1)]>>4,o[u++]=r&255),n===1&&(r=m[e.charCodeAt(f)]<<10|m[e.charCodeAt(f+1)]<<4|m[e.charCodeAt(f+2)]>>2,o[u++]=r>>8&255,o[u++]=r&255),o}function Gr(e){return g[e>>18&63]+g[e>>12&63]+g[e>>6&63]+g[e&63]}function zr(e,r,t){for(var i,n=[],o=r;o<t;o+=3)i=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(e[o+2]&255),n.push(Gr(i));return n.join("")}function Jr(e){for(var r,t=e.length,i=t%3,n=[],o=16383,u=0,h=t-i;u<h;u+=o)n.push(zr(e,u,u+o>h?h:u+o));return i===1?(r=e[t-1],n.push(g[r>>2]+g[r<<4&63]+"==")):i===2&&(r=(e[t-2]<<8)+e[t-1],n.push(g[r>>10]+g[r>>4&63]+g[r<<2&63]+"=")),n.join("")}});var pr=N(G=>{F();G.read=function(e,r,t,i,n){var o,u,h=n*8-i-1,f=(1<<h)-1,c=f>>1,l=-7,p=t?n-1:0,E=t?-1:1,x=e[r+p];for(p+=E,o=x&(1<<-l)-1,x>>=-l,l+=h;l>0;o=o*256+e[r+p],p+=E,l-=8);for(u=o&(1<<-l)-1,o>>=-l,l+=i;l>0;u=u*256+e[r+p],p+=E,l-=8);if(o===0)o=1-c;else{if(o===f)return u?NaN:(x?-1:1)*(1/0);u=u+Math.pow(2,i),o=o-c}return(x?-1:1)*u*Math.pow(2,o-i)};G.write=function(e,r,t,i,n,o){var u,h,f,c=o*8-n-1,l=(1<<c)-1,p=l>>1,E=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=i?0:o-1,L=i?1:-1,Sr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(h=isNaN(r)?1:0,u=l):(u=Math.floor(Math.log(r)/Math.LN2),r*(f=Math.pow(2,-u))<1&&(u--,f*=2),u+p>=1?r+=E/f:r+=E*Math.pow(2,1-p),r*f>=2&&(u++,f/=2),u+p>=l?(h=0,u=l):u+p>=1?(h=(r*f-1)*Math.pow(2,n),u=u+p):(h=r*Math.pow(2,p-1)*Math.pow(2,n),u=0));n>=8;e[t+x]=h&255,x+=L,h/=256,n-=8);for(u=u<<n|h,c+=n;c>0;e[t+x]=u&255,x+=L,u/=256,c-=8);e[t+x-L]|=Sr*128}});var vr=N(_=>{"use strict";F();var z=fr(),R=pr(),cr=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;_.Buffer=a;_.SlowBuffer=jr;_.INSPECT_MAX_BYTES=50;var q=2147483647;_.kMaxLength=q;a.TYPED_ARRAY_SUPPORT=Qr();!a.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Qr(){try{var e=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(e,r),e.foo()===42}catch(t){return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(!!a.isBuffer(this))return this.buffer}});Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(!!a.isBuffer(this))return this.byteOffset}});function U(e){if(e>q)throw new RangeError('The value "'+e+'" is invalid for option "size"');var r=new Uint8Array(e);return Object.setPrototypeOf(r,a.prototype),r}function a(e,r,t){if(typeof e=="number"){if(typeof r=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return K(e)}return wr(e,r,t)}a.poolSize=8192;function wr(e,r,t){if(typeof e=="string")return Kr(e,r);if(ArrayBuffer.isView(e))return Zr(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(B(e,ArrayBuffer)||e&&B(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(B(e,SharedArrayBuffer)||e&&B(e.buffer,SharedArrayBuffer)))return Q(e,r,t);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var i=e.valueOf&&e.valueOf();if(i!=null&&i!==e)return a.from(i,r,t);var n=$r(e);if(n)return n;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return a.from(e[Symbol.toPrimitive]("string"),r,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}a.from=function(e,r,t){return wr(e,r,t)};Object.setPrototypeOf(a.prototype,Uint8Array.prototype);Object.setPrototypeOf(a,Uint8Array);function yr(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function Vr(e,r,t){return yr(e),e<=0?U(e):r!==void 0?typeof t=="string"?U(e).fill(r,t):U(e).fill(r):U(e)}a.alloc=function(e,r,t){return Vr(e,r,t)};function K(e){return yr(e),U(e<0?0:Z(e)|0)}a.allocUnsafe=function(e){return K(e)};a.allocUnsafeSlow=function(e){return K(e)};function Kr(e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!a.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var t=xr(e,r)|0,i=U(t),n=i.write(e,r);return n!==t&&(i=i.slice(0,n)),i}function J(e){for(var r=e.length<0?0:Z(e.length)|0,t=U(r),i=0;i<r;i+=1)t[i]=e[i]&255;return t}function Zr(e){if(B(e,Uint8Array)){var r=new Uint8Array(e);return Q(r.buffer,r.byteOffset,r.byteLength)}return J(e)}function Q(e,r,t){if(r<0||e.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<r+(t||0))throw new RangeError('"length" is outside of buffer bounds');var i;return r===void 0&&t===void 0?i=new Uint8Array(e):t===void 0?i=new Uint8Array(e,r):i=new Uint8Array(e,r,t),Object.setPrototypeOf(i,a.prototype),i}function $r(e){if(a.isBuffer(e)){var r=Z(e.length)|0,t=U(r);return t.length===0||e.copy(t,0,0,r),t}if(e.length!==void 0)return typeof e.length!="number"||$(e.length)?U(0):J(e);if(e.type==="Buffer"&&Array.isArray(e.data))return J(e.data)}function Z(e){if(e>=q)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+q.toString(16)+" bytes");return e|0}function jr(e){return+e!=e&&(e=0),a.alloc(+e)}a.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==a.prototype};a.compare=function(r,t){if(B(r,Uint8Array)&&(r=a.from(r,r.offset,r.byteLength)),B(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(r)||!a.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===t)return 0;for(var i=r.length,n=t.length,o=0,u=Math.min(i,n);o<u;++o)if(r[o]!==t[o]){i=r[o],n=t[o];break}return i<n?-1:n<i?1:0};a.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};a.concat=function(r,t){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return a.alloc(0);var i;if(t===void 0)for(t=0,i=0;i<r.length;++i)t+=r[i].length;var n=a.allocUnsafe(t),o=0;for(i=0;i<r.length;++i){var u=r[i];if(B(u,Uint8Array))o+u.length>n.length?a.from(u).copy(n,o):Uint8Array.prototype.set.call(n,u,o);else if(a.isBuffer(u))u.copy(n,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=u.length}return n};function xr(e,r){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||B(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var t=e.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&t===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Ar(e).length;default:if(n)return i?-1:V(e).length;r=(""+r).toLowerCase(),n=!0}}a.byteLength=xr;function Pr(e,r,t){var i=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,r>>>=0,t<=r))return"";for(e||(e="utf8");;)switch(e){case"hex":return ft(this,r,t);case"utf8":case"utf-8":return Er(this,r,t);case"ascii":return at(this,r,t);case"latin1":case"binary":return ht(this,r,t);case"base64":return ot(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pt(this,r,t);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}a.prototype._isBuffer=!0;function C(e,r,t){var i=e[r];e[r]=e[t],e[t]=i}a.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<r;t+=2)C(this,t,t+1);return this};a.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<r;t+=4)C(this,t,t+3),C(this,t+1,t+2);return this};a.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<r;t+=8)C(this,t,t+7),C(this,t+1,t+6),C(this,t+2,t+5),C(this,t+3,t+4);return this};a.prototype.toString=function(){var r=this.length;return r===0?"":arguments.length===0?Er(this,0,r):Pr.apply(this,arguments)};a.prototype.toLocaleString=a.prototype.toString;a.prototype.equals=function(r){if(!a.isBuffer(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:a.compare(this,r)===0};a.prototype.inspect=function(){var r="",t=_.INSPECT_MAX_BYTES;return r=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(r+=" ... "),"<Buffer "+r+">"};cr&&(a.prototype[cr]=a.prototype.inspect);a.prototype.compare=function(r,t,i,n,o){if(B(r,Uint8Array)&&(r=a.from(r,r.offset,r.byteLength)),!a.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(t===void 0&&(t=0),i===void 0&&(i=r?r.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),t<0||i>r.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=i)return 0;if(n>=o)return-1;if(t>=i)return 1;if(t>>>=0,i>>>=0,n>>>=0,o>>>=0,this===r)return 0;for(var u=o-n,h=i-t,f=Math.min(u,h),c=this.slice(n,o),l=r.slice(t,i),p=0;p<f;++p)if(c[p]!==l[p]){u=c[p],h=l[p];break}return u<h?-1:h<u?1:0};function mr(e,r,t,i,n){if(e.length===0)return-1;if(typeof t=="string"?(i=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,$(t)&&(t=n?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(n)return-1;t=e.length-1}else if(t<0)if(n)t=0;else return-1;if(typeof r=="string"&&(r=a.from(r,i)),a.isBuffer(r))return r.length===0?-1:lr(e,r,t,i,n);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(e,r,t):Uint8Array.prototype.lastIndexOf.call(e,r,t):lr(e,[r],t,i,n);throw new TypeError("val must be string, number or Buffer")}function lr(e,r,t,i,n){var o=1,u=e.length,h=r.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(e.length<2||r.length<2)return-1;o=2,u/=2,h/=2,t/=2}function f(x,L){return o===1?x[L]:x.readUInt16BE(L*o)}var c;if(n){var l=-1;for(c=t;c<u;c++)if(f(e,c)===f(r,l===-1?0:c-l)){if(l===-1&&(l=c),c-l+1===h)return l*o}else l!==-1&&(c-=c-l),l=-1}else for(t+h>u&&(t=u-h),c=t;c>=0;c--){for(var p=!0,E=0;E<h;E++)if(f(e,c+E)!==f(r,E)){p=!1;break}if(p)return c}return-1}a.prototype.includes=function(r,t,i){return this.indexOf(r,t,i)!==-1};a.prototype.indexOf=function(r,t,i){return mr(this,r,t,i,!0)};a.prototype.lastIndexOf=function(r,t,i){return mr(this,r,t,i,!1)};function rt(e,r,t,i){t=Number(t)||0;var n=e.length-t;i?(i=Number(i),i>n&&(i=n)):i=n;var o=r.length;i>o/2&&(i=o/2);for(var u=0;u<i;++u){var h=parseInt(r.substr(u*2,2),16);if($(h))return u;e[t+u]=h}return u}function tt(e,r,t,i){return H(V(r,e.length-t),e,t,i)}function et(e,r,t,i){return H(st(r),e,t,i)}function it(e,r,t,i){return H(Ar(r),e,t,i)}function nt(e,r,t,i){return H(wt(r,e.length-t),e,t,i)}a.prototype.write=function(r,t,i,n){if(t===void 0)n="utf8",i=this.length,t=0;else if(i===void 0&&typeof t=="string")n=t,i=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(i)?(i=i>>>0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-t;if((i===void 0||i>o)&&(i=o),r.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var u=!1;;)switch(n){case"hex":return rt(this,r,t,i);case"utf8":case"utf-8":return tt(this,r,t,i);case"ascii":case"latin1":case"binary":return et(this,r,t,i);case"base64":return it(this,r,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return nt(this,r,t,i);default:if(u)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),u=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ot(e,r,t){return r===0&&t===e.length?z.fromByteArray(e):z.fromByteArray(e.slice(r,t))}function Er(e,r,t){t=Math.min(e.length,t);for(var i=[],n=r;n<t;){var o=e[n],u=null,h=o>239?4:o>223?3:o>191?2:1;if(n+h<=t){var f,c,l,p;switch(h){case 1:o<128&&(u=o);break;case 2:f=e[n+1],(f&192)===128&&(p=(o&31)<<6|f&63,p>127&&(u=p));break;case 3:f=e[n+1],c=e[n+2],(f&192)===128&&(c&192)===128&&(p=(o&15)<<12|(f&63)<<6|c&63,p>2047&&(p<55296||p>57343)&&(u=p));break;case 4:f=e[n+1],c=e[n+2],l=e[n+3],(f&192)===128&&(c&192)===128&&(l&192)===128&&(p=(o&15)<<18|(f&63)<<12|(c&63)<<6|l&63,p>65535&&p<1114112&&(u=p))}}u===null?(u=65533,h=1):u>65535&&(u-=65536,i.push(u>>>10&1023|55296),u=56320|u&1023),i.push(u),n+=h}return ut(i)}var sr=4096;function ut(e){var r=e.length;if(r<=sr)return String.fromCharCode.apply(String,e);for(var t="",i=0;i<r;)t+=String.fromCharCode.apply(String,e.slice(i,i+=sr));return t}function at(e,r,t){var i="";t=Math.min(e.length,t);for(var n=r;n<t;++n)i+=String.fromCharCode(e[n]&127);return i}function ht(e,r,t){var i="";t=Math.min(e.length,t);for(var n=r;n<t;++n)i+=String.fromCharCode(e[n]);return i}function ft(e,r,t){var i=e.length;(!r||r<0)&&(r=0),(!t||t<0||t>i)&&(t=i);for(var n="",o=r;o<t;++o)n+=yt[e[o]];return n}function pt(e,r,t){for(var i=e.slice(r,t),n="",o=0;o<i.length-1;o+=2)n+=String.fromCharCode(i[o]+i[o+1]*256);return n}a.prototype.slice=function(r,t){var i=this.length;r=~~r,t=t===void 0?i:~~t,r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),t<r&&(t=r);var n=this.subarray(r,t);return Object.setPrototypeOf(n,a.prototype),n};function w(e,r,t){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+r>t)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(r,t,i){r=r>>>0,t=t>>>0,i||w(r,t,this.length);for(var n=this[r],o=1,u=0;++u<t&&(o*=256);)n+=this[r+u]*o;return n};a.prototype.readUintBE=a.prototype.readUIntBE=function(r,t,i){r=r>>>0,t=t>>>0,i||w(r,t,this.length);for(var n=this[r+--t],o=1;t>0&&(o*=256);)n+=this[r+--t]*o;return n};a.prototype.readUint8=a.prototype.readUInt8=function(r,t){return r=r>>>0,t||w(r,1,this.length),this[r]};a.prototype.readUint16LE=a.prototype.readUInt16LE=function(r,t){return r=r>>>0,t||w(r,2,this.length),this[r]|this[r+1]<<8};a.prototype.readUint16BE=a.prototype.readUInt16BE=function(r,t){return r=r>>>0,t||w(r,2,this.length),this[r]<<8|this[r+1]};a.prototype.readUint32LE=a.prototype.readUInt32LE=function(r,t){return r=r>>>0,t||w(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};a.prototype.readUint32BE=a.prototype.readUInt32BE=function(r,t){return r=r>>>0,t||w(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};a.prototype.readIntLE=function(r,t,i){r=r>>>0,t=t>>>0,i||w(r,t,this.length);for(var n=this[r],o=1,u=0;++u<t&&(o*=256);)n+=this[r+u]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*t)),n};a.prototype.readIntBE=function(r,t,i){r=r>>>0,t=t>>>0,i||w(r,t,this.length);for(var n=t,o=1,u=this[r+--n];n>0&&(o*=256);)u+=this[r+--n]*o;return o*=128,u>=o&&(u-=Math.pow(2,8*t)),u};a.prototype.readInt8=function(r,t){return r=r>>>0,t||w(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};a.prototype.readInt16LE=function(r,t){r=r>>>0,t||w(r,2,this.length);var i=this[r]|this[r+1]<<8;return i&32768?i|4294901760:i};a.prototype.readInt16BE=function(r,t){r=r>>>0,t||w(r,2,this.length);var i=this[r+1]|this[r]<<8;return i&32768?i|4294901760:i};a.prototype.readInt32LE=function(r,t){return r=r>>>0,t||w(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};a.prototype.readInt32BE=function(r,t){return r=r>>>0,t||w(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};a.prototype.readFloatLE=function(r,t){return r=r>>>0,t||w(r,4,this.length),R.read(this,r,!0,23,4)};a.prototype.readFloatBE=function(r,t){return r=r>>>0,t||w(r,4,this.length),R.read(this,r,!1,23,4)};a.prototype.readDoubleLE=function(r,t){return r=r>>>0,t||w(r,8,this.length),R.read(this,r,!0,52,8)};a.prototype.readDoubleBE=function(r,t){return r=r>>>0,t||w(r,8,this.length),R.read(this,r,!1,52,8)};function y(e,r,t,i,n,o){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>n||r<o)throw new RangeError('"value" argument is out of bounds');if(t+i>e.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(r,t,i,n){if(r=+r,t=t>>>0,i=i>>>0,!n){var o=Math.pow(2,8*i)-1;y(this,r,t,i,o,0)}var u=1,h=0;for(this[t]=r&255;++h<i&&(u*=256);)this[t+h]=r/u&255;return t+i};a.prototype.writeUintBE=a.prototype.writeUIntBE=function(r,t,i,n){if(r=+r,t=t>>>0,i=i>>>0,!n){var o=Math.pow(2,8*i)-1;y(this,r,t,i,o,0)}var u=i-1,h=1;for(this[t+u]=r&255;--u>=0&&(h*=256);)this[t+u]=r/h&255;return t+i};a.prototype.writeUint8=a.prototype.writeUInt8=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,1,255,0),this[t]=r&255,t+1};a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,2,65535,0),this[t]=r&255,this[t+1]=r>>>8,t+2};a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,2,65535,0),this[t]=r>>>8,this[t+1]=r&255,t+2};a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,4,4294967295,0),this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=r&255,t+4};a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,4,4294967295,0),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};a.prototype.writeIntLE=function(r,t,i,n){if(r=+r,t=t>>>0,!n){var o=Math.pow(2,8*i-1);y(this,r,t,i,o-1,-o)}var u=0,h=1,f=0;for(this[t]=r&255;++u<i&&(h*=256);)r<0&&f===0&&this[t+u-1]!==0&&(f=1),this[t+u]=(r/h>>0)-f&255;return t+i};a.prototype.writeIntBE=function(r,t,i,n){if(r=+r,t=t>>>0,!n){var o=Math.pow(2,8*i-1);y(this,r,t,i,o-1,-o)}var u=i-1,h=1,f=0;for(this[t+u]=r&255;--u>=0&&(h*=256);)r<0&&f===0&&this[t+u+1]!==0&&(f=1),this[t+u]=(r/h>>0)-f&255;return t+i};a.prototype.writeInt8=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,1,127,-128),r<0&&(r=255+r+1),this[t]=r&255,t+1};a.prototype.writeInt16LE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,2,32767,-32768),this[t]=r&255,this[t+1]=r>>>8,t+2};a.prototype.writeInt16BE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,2,32767,-32768),this[t]=r>>>8,this[t+1]=r&255,t+2};a.prototype.writeInt32LE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,4,2147483647,-2147483648),this[t]=r&255,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24,t+4};a.prototype.writeInt32BE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};function Fr(e,r,t,i,n,o){if(t+i>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function gr(e,r,t,i,n){return r=+r,t=t>>>0,n||Fr(e,r,t,4,34028234663852886e22,-34028234663852886e22),R.write(e,r,t,i,23,4),t+4}a.prototype.writeFloatLE=function(r,t,i){return gr(this,r,t,!0,i)};a.prototype.writeFloatBE=function(r,t,i){return gr(this,r,t,!1,i)};function Br(e,r,t,i,n){return r=+r,t=t>>>0,n||Fr(e,r,t,8,17976931348623157e292,-17976931348623157e292),R.write(e,r,t,i,52,8),t+8}a.prototype.writeDoubleLE=function(r,t,i){return Br(this,r,t,!0,i)};a.prototype.writeDoubleBE=function(r,t,i){return Br(this,r,t,!1,i)};a.prototype.copy=function(r,t,i,n){if(!a.isBuffer(r))throw new TypeError("argument should be a Buffer");if(i||(i=0),!n&&n!==0&&(n=this.length),t>=r.length&&(t=r.length),t||(t=0),n>0&&n<i&&(n=i),n===i||r.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),r.length-t<n-i&&(n=r.length-t+i);var o=n-i;return this===r&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,i,n):Uint8Array.prototype.set.call(r,this.subarray(i,n),t),o};a.prototype.fill=function(r,t,i,n){if(typeof r=="string"){if(typeof t=="string"?(n=t,t=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(r.length===1){var o=r.charCodeAt(0);(n==="utf8"&&o<128||n==="latin1")&&(r=o)}}else typeof r=="number"?r=r&255:typeof r=="boolean"&&(r=Number(r));if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;t=t>>>0,i=i===void 0?this.length:i>>>0,r||(r=0);var u;if(typeof r=="number")for(u=t;u<i;++u)this[u]=r;else{var h=a.isBuffer(r)?r:a.from(r,n),f=h.length;if(f===0)throw new TypeError('The value "'+r+'" is invalid for argument "value"');for(u=0;u<i-t;++u)this[u+t]=h[u%f]}return this};var ct=/[^+/0-9A-Za-z-_]/g;function lt(e){if(e=e.split("=")[0],e=e.trim().replace(ct,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function V(e,r){r=r||1/0;for(var t,i=e.length,n=null,o=[],u=0;u<i;++u){if(t=e.charCodeAt(u),t>55295&&t<57344){if(!n){if(t>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(u+1===i){(r-=3)>-1&&o.push(239,191,189);continue}n=t;continue}if(t<56320){(r-=3)>-1&&o.push(239,191,189),n=t;continue}t=(n-55296<<10|t-56320)+65536}else n&&(r-=3)>-1&&o.push(239,191,189);if(n=null,t<128){if((r-=1)<0)break;o.push(t)}else if(t<2048){if((r-=2)<0)break;o.push(t>>6|192,t&63|128)}else if(t<65536){if((r-=3)<0)break;o.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((r-=4)<0)break;o.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return o}function st(e){for(var r=[],t=0;t<e.length;++t)r.push(e.charCodeAt(t)&255);return r}function wt(e,r){for(var t,i,n,o=[],u=0;u<e.length&&!((r-=2)<0);++u)t=e.charCodeAt(u),i=t>>8,n=t%256,o.push(n),o.push(i);return o}function Ar(e){return z.toByteArray(lt(e))}function H(e,r,t,i){for(var n=0;n<i&&!(n+t>=r.length||n>=e.length);++n)r[n+t]=e[n];return n}function B(e,r){return e instanceof r||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===r.name}function $(e){return e!==e}var yt=function(){for(var e="0123456789abcdef",r=new Array(256),t=0;t<16;++t)for(var i=t*16,n=0;n<16;++n)r[i+n]=e[t]+e[n];return r}()});var Cr=N((Ut,dr)=>{F();var s=dr.exports={},A,v;function j(){throw new Error("setTimeout has not been defined")}function P(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?A=setTimeout:A=j}catch(e){A=j}try{typeof clearTimeout=="function"?v=clearTimeout:v=P}catch(e){v=P}})();function Ur(e){if(A===setTimeout)return setTimeout(e,0);if((A===j||!A)&&setTimeout)return A=setTimeout,setTimeout(e,0);try{return A(e,0)}catch(r){try{return A.call(null,e,0)}catch(t){return A.call(this,e,0)}}}function xt(e){if(v===clearTimeout)return clearTimeout(e);if((v===P||!v)&&clearTimeout)return v=clearTimeout,clearTimeout(e);try{return v(e)}catch(r){try{return v.call(null,e)}catch(t){return v.call(this,e)}}}var T=[],M=!1,S,O=-1;function mt(){!M||!S||(M=!1,S.length?T=S.concat(T):O=-1,T.length&&Tr())}function Tr(){if(!M){var e=Ur(mt);M=!0;for(var r=T.length;r;){for(S=T,T=[];++O<r;)S&&S[O].run();O=-1,r=T.length}S=null,M=!1,xt(e)}}s.nextTick=function(e){var r=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)r[t-1]=arguments[t];T.push(new Ir(e,r)),T.length===1&&!M&&Ur(Tr)};function Ir(e,r){this.fun=e,this.array=r}Ir.prototype.run=function(){this.fun.apply(null,this.array)};s.title="browser";s.browser=!0;s.env={};s.argv=[];s.version="";s.versions={};function I(){}s.on=I;s.addListener=I;s.once=I;s.off=I;s.removeListener=I;s.removeAllListeners=I;s.emit=I;s.prependListener=I;s.prependOnceListener=I;s.listeners=function(e){return[]};s.binding=function(e){throw new Error("process.binding is not supported")};s.cwd=function(){return"/"};s.chdir=function(e){throw new Error("process.chdir is not supported")};s.umask=function(){return 0}});var D,b,Tt,F=Nr(()=>{D=ur(vr()),b=ur(Cr()),Tt=function(e){function r(){var i=this||self;return delete e.prototype.__magic__,i}if(typeof globalThis=="object")return globalThis;if(this)return r();e.defineProperty(e.prototype,"__magic__",{configurable:!0,get:r});var t=__magic__;return t}(Object)});var Ft={};Wr(Ft,{mockWindowHistory:()=>Et});module.exports=Yr(Ft);F();var Et=()=>{if(!window)return;let e=window.history;delete window.history,window.history=Object.defineProperties({},nr(ir({},Object.getOwnPropertyDescriptors(e)),{pushState:{configurable:!0,value:jest.fn()}}))};0&&(module.exports={mockWindowHistory});
|
|
2
2
|
/*!
|
|
3
3
|
* The buffer module from node.js, for the browser.
|
|
4
4
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Sr=Object.create;var k=Object.defineProperty,Rr=Object.defineProperties,_r=Object.getOwnPropertyDescriptor,Mr=Object.getOwnPropertyDescriptors,kr=Object.getOwnPropertyNames,rr=Object.getOwnPropertySymbols,Dr=Object.getPrototypeOf,er=Object.prototype.hasOwnProperty,br=Object.prototype.propertyIsEnumerable;var tr=(e,r,t)=>r in e?k(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,ir=(e,r)=>{for(var t in r||(r={}))er.call(r,t)&&tr(e,t,r[t]);if(rr)for(var t of rr(r))br.call(r,t)&&tr(e,t,r[t]);return e},nr=(e,r)=>Rr(e,Mr(r));var Nr=(e,r)=>()=>(e&&(r=e(e=0)),r);var N=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),Wr=(e,r)=>{for(var t in r)k(e,t,{get:r[t],enumerable:!0})},or=(e,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of kr(r))!er.call(e,n)&&n!==t&&k(e,n,{get:()=>r[n],enumerable:!(i=_r(r,n))||i.enumerable});return e};var ur=(e,r,t)=>(t=e!=null?Sr(Dr(e)):{},or(r||!e||!e.__esModule?k(t,"default",{value:e,enumerable:!0}):t,e)),Yr=e=>or(k({},"__esModule",{value:!0}),e);var fr=N(W=>{"use strict";F();W.byteLength=Hr;W.toByteArray=Xr;W.fromByteArray=Jr;var g=[],m=[],qr=typeof Uint8Array!="undefined"?Uint8Array:Array,X="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(d=0,ar=X.length;d<ar;++d)g[d]=X[d],m[X.charCodeAt(d)]=d;var d,ar;m["-".charCodeAt(0)]=62;m["_".charCodeAt(0)]=63;function hr(e){var r=e.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=e.indexOf("=");t===-1&&(t=r);var i=t===r?0:4-t%4;return[t,i]}function Hr(e){var r=hr(e),t=r[0],i=r[1];return(t+i)*3/4-i}function Or(e,r,t){return(r+t)*3/4-t}function Xr(e){var r,t=hr(e),i=t[0],n=t[1],o=new qr(Or(e,i,n)),u=0,h=n>0?i-4:i,f;for(f=0;f<h;f+=4)r=m[e.charCodeAt(f)]<<18|m[e.charCodeAt(f+1)]<<12|m[e.charCodeAt(f+2)]<<6|m[e.charCodeAt(f+3)],o[u++]=r>>16&255,o[u++]=r>>8&255,o[u++]=r&255;return n===2&&(r=m[e.charCodeAt(f)]<<2|m[e.charCodeAt(f+1)]>>4,o[u++]=r&255),n===1&&(r=m[e.charCodeAt(f)]<<10|m[e.charCodeAt(f+1)]<<4|m[e.charCodeAt(f+2)]>>2,o[u++]=r>>8&255,o[u++]=r&255),o}function Gr(e){return g[e>>18&63]+g[e>>12&63]+g[e>>6&63]+g[e&63]}function zr(e,r,t){for(var i,n=[],o=r;o<t;o+=3)i=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(e[o+2]&255),n.push(Gr(i));return n.join("")}function Jr(e){for(var r,t=e.length,i=t%3,n=[],o=16383,u=0,h=t-i;u<h;u+=o)n.push(zr(e,u,u+o>h?h:u+o));return i===1?(r=e[t-1],n.push(g[r>>2]+g[r<<4&63]+"==")):i===2&&(r=(e[t-2]<<8)+e[t-1],n.push(g[r>>10]+g[r>>4&63]+g[r<<2&63]+"=")),n.join("")}});var pr=N(G=>{F();G.read=function(e,r,t,i,n){var o,u,h=n*8-i-1,f=(1<<h)-1,c=f>>1,l=-7,p=t?n-1:0,E=t?-1:1,x=e[r+p];for(p+=E,o=x&(1<<-l)-1,x>>=-l,l+=h;l>0;o=o*256+e[r+p],p+=E,l-=8);for(u=o&(1<<-l)-1,o>>=-l,l+=i;l>0;u=u*256+e[r+p],p+=E,l-=8);if(o===0)o=1-c;else{if(o===f)return u?NaN:(x?-1:1)*(1/0);u=u+Math.pow(2,i),o=o-c}return(x?-1:1)*u*Math.pow(2,o-i)};G.write=function(e,r,t,i,n,o){var u,h,f,c=o*8-n-1,l=(1<<c)-1,p=l>>1,E=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=i?0:o-1,S=i?1:-1,Lr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(h=isNaN(r)?1:0,u=l):(u=Math.floor(Math.log(r)/Math.LN2),r*(f=Math.pow(2,-u))<1&&(u--,f*=2),u+p>=1?r+=E/f:r+=E*Math.pow(2,1-p),r*f>=2&&(u++,f/=2),u+p>=l?(h=0,u=l):u+p>=1?(h=(r*f-1)*Math.pow(2,n),u=u+p):(h=r*Math.pow(2,p-1)*Math.pow(2,n),u=0));n>=8;e[t+x]=h&255,x+=S,h/=256,n-=8);for(u=u<<n|h,c+=n;c>0;e[t+x]=u&255,x+=S,u/=256,c-=8);e[t+x-S]|=Lr*128}});var vr=N(_=>{"use strict";F();var z=fr(),R=pr(),cr=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;_.Buffer=a;_.SlowBuffer=jr;_.INSPECT_MAX_BYTES=50;var q=2147483647;_.kMaxLength=q;a.TYPED_ARRAY_SUPPORT=Qr();!a.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Qr(){try{var e=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(e,r),e.foo()===42}catch(t){return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(!!a.isBuffer(this))return this.buffer}});Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(!!a.isBuffer(this))return this.byteOffset}});function U(e){if(e>q)throw new RangeError('The value "'+e+'" is invalid for option "size"');var r=new Uint8Array(e);return Object.setPrototypeOf(r,a.prototype),r}function a(e,r,t){if(typeof e=="number"){if(typeof r=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return K(e)}return wr(e,r,t)}a.poolSize=8192;function wr(e,r,t){if(typeof e=="string")return Kr(e,r);if(ArrayBuffer.isView(e))return Zr(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(B(e,ArrayBuffer)||e&&B(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(B(e,SharedArrayBuffer)||e&&B(e.buffer,SharedArrayBuffer)))return Q(e,r,t);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var i=e.valueOf&&e.valueOf();if(i!=null&&i!==e)return a.from(i,r,t);var n=$r(e);if(n)return n;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return a.from(e[Symbol.toPrimitive]("string"),r,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}a.from=function(e,r,t){return wr(e,r,t)};Object.setPrototypeOf(a.prototype,Uint8Array.prototype);Object.setPrototypeOf(a,Uint8Array);function yr(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function Vr(e,r,t){return yr(e),e<=0?U(e):r!==void 0?typeof t=="string"?U(e).fill(r,t):U(e).fill(r):U(e)}a.alloc=function(e,r,t){return Vr(e,r,t)};function K(e){return yr(e),U(e<0?0:Z(e)|0)}a.allocUnsafe=function(e){return K(e)};a.allocUnsafeSlow=function(e){return K(e)};function Kr(e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!a.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var t=xr(e,r)|0,i=U(t),n=i.write(e,r);return n!==t&&(i=i.slice(0,n)),i}function J(e){for(var r=e.length<0?0:Z(e.length)|0,t=U(r),i=0;i<r;i+=1)t[i]=e[i]&255;return t}function Zr(e){if(B(e,Uint8Array)){var r=new Uint8Array(e);return Q(r.buffer,r.byteOffset,r.byteLength)}return J(e)}function Q(e,r,t){if(r<0||e.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<r+(t||0))throw new RangeError('"length" is outside of buffer bounds');var i;return r===void 0&&t===void 0?i=new Uint8Array(e):t===void 0?i=new Uint8Array(e,r):i=new Uint8Array(e,r,t),Object.setPrototypeOf(i,a.prototype),i}function $r(e){if(a.isBuffer(e)){var r=Z(e.length)|0,t=U(r);return t.length===0||e.copy(t,0,0,r),t}if(e.length!==void 0)return typeof e.length!="number"||$(e.length)?U(0):J(e);if(e.type==="Buffer"&&Array.isArray(e.data))return J(e.data)}function Z(e){if(e>=q)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+q.toString(16)+" bytes");return e|0}function jr(e){return+e!=e&&(e=0),a.alloc(+e)}a.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==a.prototype};a.compare=function(r,t){if(B(r,Uint8Array)&&(r=a.from(r,r.offset,r.byteLength)),B(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(r)||!a.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===t)return 0;for(var i=r.length,n=t.length,o=0,u=Math.min(i,n);o<u;++o)if(r[o]!==t[o]){i=r[o],n=t[o];break}return i<n?-1:n<i?1:0};a.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};a.concat=function(r,t){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return a.alloc(0);var i;if(t===void 0)for(t=0,i=0;i<r.length;++i)t+=r[i].length;var n=a.allocUnsafe(t),o=0;for(i=0;i<r.length;++i){var u=r[i];if(B(u,Uint8Array))o+u.length>n.length?a.from(u).copy(n,o):Uint8Array.prototype.set.call(n,u,o);else if(a.isBuffer(u))u.copy(n,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=u.length}return n};function xr(e,r){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||B(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var t=e.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&t===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Ar(e).length;default:if(n)return i?-1:V(e).length;r=(""+r).toLowerCase(),n=!0}}a.byteLength=xr;function Pr(e,r,t){var i=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,r>>>=0,t<=r))return"";for(e||(e="utf8");;)switch(e){case"hex":return ft(this,r,t);case"utf8":case"utf-8":return Er(this,r,t);case"ascii":return at(this,r,t);case"latin1":case"binary":return ht(this,r,t);case"base64":return ot(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pt(this,r,t);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}a.prototype._isBuffer=!0;function C(e,r,t){var i=e[r];e[r]=e[t],e[t]=i}a.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<r;t+=2)C(this,t,t+1);return this};a.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<r;t+=4)C(this,t,t+3),C(this,t+1,t+2);return this};a.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<r;t+=8)C(this,t,t+7),C(this,t+1,t+6),C(this,t+2,t+5),C(this,t+3,t+4);return this};a.prototype.toString=function(){var r=this.length;return r===0?"":arguments.length===0?Er(this,0,r):Pr.apply(this,arguments)};a.prototype.toLocaleString=a.prototype.toString;a.prototype.equals=function(r){if(!a.isBuffer(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:a.compare(this,r)===0};a.prototype.inspect=function(){var r="",t=_.INSPECT_MAX_BYTES;return r=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(r+=" ... "),"<Buffer "+r+">"};cr&&(a.prototype[cr]=a.prototype.inspect);a.prototype.compare=function(r,t,i,n,o){if(B(r,Uint8Array)&&(r=a.from(r,r.offset,r.byteLength)),!a.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(t===void 0&&(t=0),i===void 0&&(i=r?r.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),t<0||i>r.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=i)return 0;if(n>=o)return-1;if(t>=i)return 1;if(t>>>=0,i>>>=0,n>>>=0,o>>>=0,this===r)return 0;for(var u=o-n,h=i-t,f=Math.min(u,h),c=this.slice(n,o),l=r.slice(t,i),p=0;p<f;++p)if(c[p]!==l[p]){u=c[p],h=l[p];break}return u<h?-1:h<u?1:0};function mr(e,r,t,i,n){if(e.length===0)return-1;if(typeof t=="string"?(i=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,$(t)&&(t=n?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(n)return-1;t=e.length-1}else if(t<0)if(n)t=0;else return-1;if(typeof r=="string"&&(r=a.from(r,i)),a.isBuffer(r))return r.length===0?-1:lr(e,r,t,i,n);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(e,r,t):Uint8Array.prototype.lastIndexOf.call(e,r,t):lr(e,[r],t,i,n);throw new TypeError("val must be string, number or Buffer")}function lr(e,r,t,i,n){var o=1,u=e.length,h=r.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(e.length<2||r.length<2)return-1;o=2,u/=2,h/=2,t/=2}function f(x,S){return o===1?x[S]:x.readUInt16BE(S*o)}var c;if(n){var l=-1;for(c=t;c<u;c++)if(f(e,c)===f(r,l===-1?0:c-l)){if(l===-1&&(l=c),c-l+1===h)return l*o}else l!==-1&&(c-=c-l),l=-1}else for(t+h>u&&(t=u-h),c=t;c>=0;c--){for(var p=!0,E=0;E<h;E++)if(f(e,c+E)!==f(r,E)){p=!1;break}if(p)return c}return-1}a.prototype.includes=function(r,t,i){return this.indexOf(r,t,i)!==-1};a.prototype.indexOf=function(r,t,i){return mr(this,r,t,i,!0)};a.prototype.lastIndexOf=function(r,t,i){return mr(this,r,t,i,!1)};function rt(e,r,t,i){t=Number(t)||0;var n=e.length-t;i?(i=Number(i),i>n&&(i=n)):i=n;var o=r.length;i>o/2&&(i=o/2);for(var u=0;u<i;++u){var h=parseInt(r.substr(u*2,2),16);if($(h))return u;e[t+u]=h}return u}function tt(e,r,t,i){return H(V(r,e.length-t),e,t,i)}function et(e,r,t,i){return H(st(r),e,t,i)}function it(e,r,t,i){return H(Ar(r),e,t,i)}function nt(e,r,t,i){return H(wt(r,e.length-t),e,t,i)}a.prototype.write=function(r,t,i,n){if(t===void 0)n="utf8",i=this.length,t=0;else if(i===void 0&&typeof t=="string")n=t,i=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(i)?(i=i>>>0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-t;if((i===void 0||i>o)&&(i=o),r.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var u=!1;;)switch(n){case"hex":return rt(this,r,t,i);case"utf8":case"utf-8":return tt(this,r,t,i);case"ascii":case"latin1":case"binary":return et(this,r,t,i);case"base64":return it(this,r,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return nt(this,r,t,i);default:if(u)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),u=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ot(e,r,t){return r===0&&t===e.length?z.fromByteArray(e):z.fromByteArray(e.slice(r,t))}function Er(e,r,t){t=Math.min(e.length,t);for(var i=[],n=r;n<t;){var o=e[n],u=null,h=o>239?4:o>223?3:o>191?2:1;if(n+h<=t){var f,c,l,p;switch(h){case 1:o<128&&(u=o);break;case 2:f=e[n+1],(f&192)===128&&(p=(o&31)<<6|f&63,p>127&&(u=p));break;case 3:f=e[n+1],c=e[n+2],(f&192)===128&&(c&192)===128&&(p=(o&15)<<12|(f&63)<<6|c&63,p>2047&&(p<55296||p>57343)&&(u=p));break;case 4:f=e[n+1],c=e[n+2],l=e[n+3],(f&192)===128&&(c&192)===128&&(l&192)===128&&(p=(o&15)<<18|(f&63)<<12|(c&63)<<6|l&63,p>65535&&p<1114112&&(u=p))}}u===null?(u=65533,h=1):u>65535&&(u-=65536,i.push(u>>>10&1023|55296),u=56320|u&1023),i.push(u),n+=h}return ut(i)}var sr=4096;function ut(e){var r=e.length;if(r<=sr)return String.fromCharCode.apply(String,e);for(var t="",i=0;i<r;)t+=String.fromCharCode.apply(String,e.slice(i,i+=sr));return t}function at(e,r,t){var i="";t=Math.min(e.length,t);for(var n=r;n<t;++n)i+=String.fromCharCode(e[n]&127);return i}function ht(e,r,t){var i="";t=Math.min(e.length,t);for(var n=r;n<t;++n)i+=String.fromCharCode(e[n]);return i}function ft(e,r,t){var i=e.length;(!r||r<0)&&(r=0),(!t||t<0||t>i)&&(t=i);for(var n="",o=r;o<t;++o)n+=yt[e[o]];return n}function pt(e,r,t){for(var i=e.slice(r,t),n="",o=0;o<i.length-1;o+=2)n+=String.fromCharCode(i[o]+i[o+1]*256);return n}a.prototype.slice=function(r,t){var i=this.length;r=~~r,t=t===void 0?i:~~t,r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),t<r&&(t=r);var n=this.subarray(r,t);return Object.setPrototypeOf(n,a.prototype),n};function w(e,r,t){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+r>t)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(r,t,i){r=r>>>0,t=t>>>0,i||w(r,t,this.length);for(var n=this[r],o=1,u=0;++u<t&&(o*=256);)n+=this[r+u]*o;return n};a.prototype.readUintBE=a.prototype.readUIntBE=function(r,t,i){r=r>>>0,t=t>>>0,i||w(r,t,this.length);for(var n=this[r+--t],o=1;t>0&&(o*=256);)n+=this[r+--t]*o;return n};a.prototype.readUint8=a.prototype.readUInt8=function(r,t){return r=r>>>0,t||w(r,1,this.length),this[r]};a.prototype.readUint16LE=a.prototype.readUInt16LE=function(r,t){return r=r>>>0,t||w(r,2,this.length),this[r]|this[r+1]<<8};a.prototype.readUint16BE=a.prototype.readUInt16BE=function(r,t){return r=r>>>0,t||w(r,2,this.length),this[r]<<8|this[r+1]};a.prototype.readUint32LE=a.prototype.readUInt32LE=function(r,t){return r=r>>>0,t||w(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};a.prototype.readUint32BE=a.prototype.readUInt32BE=function(r,t){return r=r>>>0,t||w(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};a.prototype.readIntLE=function(r,t,i){r=r>>>0,t=t>>>0,i||w(r,t,this.length);for(var n=this[r],o=1,u=0;++u<t&&(o*=256);)n+=this[r+u]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*t)),n};a.prototype.readIntBE=function(r,t,i){r=r>>>0,t=t>>>0,i||w(r,t,this.length);for(var n=t,o=1,u=this[r+--n];n>0&&(o*=256);)u+=this[r+--n]*o;return o*=128,u>=o&&(u-=Math.pow(2,8*t)),u};a.prototype.readInt8=function(r,t){return r=r>>>0,t||w(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};a.prototype.readInt16LE=function(r,t){r=r>>>0,t||w(r,2,this.length);var i=this[r]|this[r+1]<<8;return i&32768?i|4294901760:i};a.prototype.readInt16BE=function(r,t){r=r>>>0,t||w(r,2,this.length);var i=this[r+1]|this[r]<<8;return i&32768?i|4294901760:i};a.prototype.readInt32LE=function(r,t){return r=r>>>0,t||w(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};a.prototype.readInt32BE=function(r,t){return r=r>>>0,t||w(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};a.prototype.readFloatLE=function(r,t){return r=r>>>0,t||w(r,4,this.length),R.read(this,r,!0,23,4)};a.prototype.readFloatBE=function(r,t){return r=r>>>0,t||w(r,4,this.length),R.read(this,r,!1,23,4)};a.prototype.readDoubleLE=function(r,t){return r=r>>>0,t||w(r,8,this.length),R.read(this,r,!0,52,8)};a.prototype.readDoubleBE=function(r,t){return r=r>>>0,t||w(r,8,this.length),R.read(this,r,!1,52,8)};function y(e,r,t,i,n,o){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>n||r<o)throw new RangeError('"value" argument is out of bounds');if(t+i>e.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(r,t,i,n){if(r=+r,t=t>>>0,i=i>>>0,!n){var o=Math.pow(2,8*i)-1;y(this,r,t,i,o,0)}var u=1,h=0;for(this[t]=r&255;++h<i&&(u*=256);)this[t+h]=r/u&255;return t+i};a.prototype.writeUintBE=a.prototype.writeUIntBE=function(r,t,i,n){if(r=+r,t=t>>>0,i=i>>>0,!n){var o=Math.pow(2,8*i)-1;y(this,r,t,i,o,0)}var u=i-1,h=1;for(this[t+u]=r&255;--u>=0&&(h*=256);)this[t+u]=r/h&255;return t+i};a.prototype.writeUint8=a.prototype.writeUInt8=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,1,255,0),this[t]=r&255,t+1};a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,2,65535,0),this[t]=r&255,this[t+1]=r>>>8,t+2};a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,2,65535,0),this[t]=r>>>8,this[t+1]=r&255,t+2};a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,4,4294967295,0),this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=r&255,t+4};a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,4,4294967295,0),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};a.prototype.writeIntLE=function(r,t,i,n){if(r=+r,t=t>>>0,!n){var o=Math.pow(2,8*i-1);y(this,r,t,i,o-1,-o)}var u=0,h=1,f=0;for(this[t]=r&255;++u<i&&(h*=256);)r<0&&f===0&&this[t+u-1]!==0&&(f=1),this[t+u]=(r/h>>0)-f&255;return t+i};a.prototype.writeIntBE=function(r,t,i,n){if(r=+r,t=t>>>0,!n){var o=Math.pow(2,8*i-1);y(this,r,t,i,o-1,-o)}var u=i-1,h=1,f=0;for(this[t+u]=r&255;--u>=0&&(h*=256);)r<0&&f===0&&this[t+u+1]!==0&&(f=1),this[t+u]=(r/h>>0)-f&255;return t+i};a.prototype.writeInt8=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,1,127,-128),r<0&&(r=255+r+1),this[t]=r&255,t+1};a.prototype.writeInt16LE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,2,32767,-32768),this[t]=r&255,this[t+1]=r>>>8,t+2};a.prototype.writeInt16BE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,2,32767,-32768),this[t]=r>>>8,this[t+1]=r&255,t+2};a.prototype.writeInt32LE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,4,2147483647,-2147483648),this[t]=r&255,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24,t+4};a.prototype.writeInt32BE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};function Fr(e,r,t,i,n,o){if(t+i>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function gr(e,r,t,i,n){return r=+r,t=t>>>0,n||Fr(e,r,t,4,34028234663852886e22,-34028234663852886e22),R.write(e,r,t,i,23,4),t+4}a.prototype.writeFloatLE=function(r,t,i){return gr(this,r,t,!0,i)};a.prototype.writeFloatBE=function(r,t,i){return gr(this,r,t,!1,i)};function Br(e,r,t,i,n){return r=+r,t=t>>>0,n||Fr(e,r,t,8,17976931348623157e292,-17976931348623157e292),R.write(e,r,t,i,52,8),t+8}a.prototype.writeDoubleLE=function(r,t,i){return Br(this,r,t,!0,i)};a.prototype.writeDoubleBE=function(r,t,i){return Br(this,r,t,!1,i)};a.prototype.copy=function(r,t,i,n){if(!a.isBuffer(r))throw new TypeError("argument should be a Buffer");if(i||(i=0),!n&&n!==0&&(n=this.length),t>=r.length&&(t=r.length),t||(t=0),n>0&&n<i&&(n=i),n===i||r.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),r.length-t<n-i&&(n=r.length-t+i);var o=n-i;return this===r&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,i,n):Uint8Array.prototype.set.call(r,this.subarray(i,n),t),o};a.prototype.fill=function(r,t,i,n){if(typeof r=="string"){if(typeof t=="string"?(n=t,t=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(r.length===1){var o=r.charCodeAt(0);(n==="utf8"&&o<128||n==="latin1")&&(r=o)}}else typeof r=="number"?r=r&255:typeof r=="boolean"&&(r=Number(r));if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;t=t>>>0,i=i===void 0?this.length:i>>>0,r||(r=0);var u;if(typeof r=="number")for(u=t;u<i;++u)this[u]=r;else{var h=a.isBuffer(r)?r:a.from(r,n),f=h.length;if(f===0)throw new TypeError('The value "'+r+'" is invalid for argument "value"');for(u=0;u<i-t;++u)this[u+t]=h[u%f]}return this};var ct=/[^+/0-9A-Za-z-_]/g;function lt(e){if(e=e.split("=")[0],e=e.trim().replace(ct,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function V(e,r){r=r||1/0;for(var t,i=e.length,n=null,o=[],u=0;u<i;++u){if(t=e.charCodeAt(u),t>55295&&t<57344){if(!n){if(t>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(u+1===i){(r-=3)>-1&&o.push(239,191,189);continue}n=t;continue}if(t<56320){(r-=3)>-1&&o.push(239,191,189),n=t;continue}t=(n-55296<<10|t-56320)+65536}else n&&(r-=3)>-1&&o.push(239,191,189);if(n=null,t<128){if((r-=1)<0)break;o.push(t)}else if(t<2048){if((r-=2)<0)break;o.push(t>>6|192,t&63|128)}else if(t<65536){if((r-=3)<0)break;o.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((r-=4)<0)break;o.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return o}function st(e){for(var r=[],t=0;t<e.length;++t)r.push(e.charCodeAt(t)&255);return r}function wt(e,r){for(var t,i,n,o=[],u=0;u<e.length&&!((r-=2)<0);++u)t=e.charCodeAt(u),i=t>>8,n=t%256,o.push(n),o.push(i);return o}function Ar(e){return z.toByteArray(lt(e))}function H(e,r,t,i){for(var n=0;n<i&&!(n+t>=r.length||n>=e.length);++n)r[n+t]=e[n];return n}function B(e,r){return e instanceof r||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===r.name}function $(e){return e!==e}var yt=function(){for(var e="0123456789abcdef",r=new Array(256),t=0;t<16;++t)for(var i=t*16,n=0;n<16;++n)r[i+n]=e[t]+e[n];return r}()});var Cr=N((Ut,dr)=>{F();var s=dr.exports={},A,v;function j(){throw new Error("setTimeout has not been defined")}function P(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?A=setTimeout:A=j}catch(e){A=j}try{typeof clearTimeout=="function"?v=clearTimeout:v=P}catch(e){v=P}})();function Ur(e){if(A===setTimeout)return setTimeout(e,0);if((A===j||!A)&&setTimeout)return A=setTimeout,setTimeout(e,0);try{return A(e,0)}catch(r){try{return A.call(null,e,0)}catch(t){return A.call(this,e,0)}}}function xt(e){if(v===clearTimeout)return clearTimeout(e);if((v===P||!v)&&clearTimeout)return v=clearTimeout,clearTimeout(e);try{return v(e)}catch(r){try{return v.call(null,e)}catch(t){return v.call(this,e)}}}var T=[],M=!1,L,O=-1;function mt(){!M||!L||(M=!1,L.length?T=L.concat(T):O=-1,T.length&&Tr())}function Tr(){if(!M){var e=Ur(mt);M=!0;for(var r=T.length;r;){for(L=T,T=[];++O<r;)L&&L[O].run();O=-1,r=T.length}L=null,M=!1,xt(e)}}s.nextTick=function(e){var r=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)r[t-1]=arguments[t];T.push(new Ir(e,r)),T.length===1&&!M&&Ur(Tr)};function Ir(e,r){this.fun=e,this.array=r}Ir.prototype.run=function(){this.fun.apply(null,this.array)};s.title="browser";s.browser=!0;s.env={};s.argv=[];s.version="";s.versions={};function I(){}s.on=I;s.addListener=I;s.once=I;s.off=I;s.removeListener=I;s.removeAllListeners=I;s.emit=I;s.prependListener=I;s.prependOnceListener=I;s.listeners=function(e){return[]};s.binding=function(e){throw new Error("process.binding is not supported")};s.cwd=function(){return"/"};s.chdir=function(e){throw new Error("process.chdir is not supported")};s.umask=function(){return 0}});var D,b,Tt,F=Nr(()=>{D=ur(vr()),b=ur(Cr()),Tt=function(e){function r(){var i=this||self;return delete e.prototype.__magic__,i}if(typeof globalThis=="object")return globalThis;if(this)return r();e.defineProperty(e.prototype,"__magic__",{configurable:!0,get:r});var t=__magic__;return t}(Object)});var Ft={};Wr(Ft,{mockWindowLocation:()=>Et});module.exports=Yr(Ft);F();var Et=()=>{let e=window.location;delete window.location,window.location=Object.defineProperties({},nr(ir({},Object.getOwnPropertyDescriptors(e)),{assign:{configurable:!0,value:jest.fn()}}))};0&&(module.exports={mockWindowLocation});
|
|
1
|
+
"use strict";var Sr=Object.create;var k=Object.defineProperty,Rr=Object.defineProperties,_r=Object.getOwnPropertyDescriptor,Mr=Object.getOwnPropertyDescriptors,kr=Object.getOwnPropertyNames,rr=Object.getOwnPropertySymbols,Dr=Object.getPrototypeOf,er=Object.prototype.hasOwnProperty,br=Object.prototype.propertyIsEnumerable;var tr=(e,r,t)=>r in e?k(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,ir=(e,r)=>{for(var t in r||(r={}))er.call(r,t)&&tr(e,t,r[t]);if(rr)for(var t of rr(r))br.call(r,t)&&tr(e,t,r[t]);return e},nr=(e,r)=>Rr(e,Mr(r));var Nr=(e,r)=>()=>(e&&(r=e(e=0)),r);var N=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),Wr=(e,r)=>{for(var t in r)k(e,t,{get:r[t],enumerable:!0})},or=(e,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of kr(r))!er.call(e,n)&&n!==t&&k(e,n,{get:()=>r[n],enumerable:!(i=_r(r,n))||i.enumerable});return e};var ur=(e,r,t)=>(t=e!=null?Sr(Dr(e)):{},or(r||!e||!e.__esModule?k(t,"default",{value:e,enumerable:!0}):t,e)),Yr=e=>or(k({},"__esModule",{value:!0}),e);var fr=N(W=>{"use strict";F();W.byteLength=Hr;W.toByteArray=Xr;W.fromByteArray=Jr;var g=[],m=[],qr=typeof Uint8Array!="undefined"?Uint8Array:Array,X="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(d=0,ar=X.length;d<ar;++d)g[d]=X[d],m[X.charCodeAt(d)]=d;var d,ar;m["-".charCodeAt(0)]=62;m["_".charCodeAt(0)]=63;function hr(e){var r=e.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=e.indexOf("=");t===-1&&(t=r);var i=t===r?0:4-t%4;return[t,i]}function Hr(e){var r=hr(e),t=r[0],i=r[1];return(t+i)*3/4-i}function Or(e,r,t){return(r+t)*3/4-t}function Xr(e){var r,t=hr(e),i=t[0],n=t[1],o=new qr(Or(e,i,n)),u=0,h=n>0?i-4:i,f;for(f=0;f<h;f+=4)r=m[e.charCodeAt(f)]<<18|m[e.charCodeAt(f+1)]<<12|m[e.charCodeAt(f+2)]<<6|m[e.charCodeAt(f+3)],o[u++]=r>>16&255,o[u++]=r>>8&255,o[u++]=r&255;return n===2&&(r=m[e.charCodeAt(f)]<<2|m[e.charCodeAt(f+1)]>>4,o[u++]=r&255),n===1&&(r=m[e.charCodeAt(f)]<<10|m[e.charCodeAt(f+1)]<<4|m[e.charCodeAt(f+2)]>>2,o[u++]=r>>8&255,o[u++]=r&255),o}function Gr(e){return g[e>>18&63]+g[e>>12&63]+g[e>>6&63]+g[e&63]}function zr(e,r,t){for(var i,n=[],o=r;o<t;o+=3)i=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(e[o+2]&255),n.push(Gr(i));return n.join("")}function Jr(e){for(var r,t=e.length,i=t%3,n=[],o=16383,u=0,h=t-i;u<h;u+=o)n.push(zr(e,u,u+o>h?h:u+o));return i===1?(r=e[t-1],n.push(g[r>>2]+g[r<<4&63]+"==")):i===2&&(r=(e[t-2]<<8)+e[t-1],n.push(g[r>>10]+g[r>>4&63]+g[r<<2&63]+"=")),n.join("")}});var pr=N(G=>{F();G.read=function(e,r,t,i,n){var o,u,h=n*8-i-1,f=(1<<h)-1,c=f>>1,l=-7,p=t?n-1:0,E=t?-1:1,x=e[r+p];for(p+=E,o=x&(1<<-l)-1,x>>=-l,l+=h;l>0;o=o*256+e[r+p],p+=E,l-=8);for(u=o&(1<<-l)-1,o>>=-l,l+=i;l>0;u=u*256+e[r+p],p+=E,l-=8);if(o===0)o=1-c;else{if(o===f)return u?NaN:(x?-1:1)*(1/0);u=u+Math.pow(2,i),o=o-c}return(x?-1:1)*u*Math.pow(2,o-i)};G.write=function(e,r,t,i,n,o){var u,h,f,c=o*8-n-1,l=(1<<c)-1,p=l>>1,E=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=i?0:o-1,S=i?1:-1,Lr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(h=isNaN(r)?1:0,u=l):(u=Math.floor(Math.log(r)/Math.LN2),r*(f=Math.pow(2,-u))<1&&(u--,f*=2),u+p>=1?r+=E/f:r+=E*Math.pow(2,1-p),r*f>=2&&(u++,f/=2),u+p>=l?(h=0,u=l):u+p>=1?(h=(r*f-1)*Math.pow(2,n),u=u+p):(h=r*Math.pow(2,p-1)*Math.pow(2,n),u=0));n>=8;e[t+x]=h&255,x+=S,h/=256,n-=8);for(u=u<<n|h,c+=n;c>0;e[t+x]=u&255,x+=S,u/=256,c-=8);e[t+x-S]|=Lr*128}});var vr=N(_=>{"use strict";F();var z=fr(),R=pr(),cr=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;_.Buffer=a;_.SlowBuffer=jr;_.INSPECT_MAX_BYTES=50;var q=2147483647;_.kMaxLength=q;a.TYPED_ARRAY_SUPPORT=Qr();!a.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Qr(){try{var e=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(e,r),e.foo()===42}catch(t){return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(!!a.isBuffer(this))return this.buffer}});Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(!!a.isBuffer(this))return this.byteOffset}});function U(e){if(e>q)throw new RangeError('The value "'+e+'" is invalid for option "size"');var r=new Uint8Array(e);return Object.setPrototypeOf(r,a.prototype),r}function a(e,r,t){if(typeof e=="number"){if(typeof r=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return K(e)}return wr(e,r,t)}a.poolSize=8192;function wr(e,r,t){if(typeof e=="string")return Kr(e,r);if(ArrayBuffer.isView(e))return Zr(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(B(e,ArrayBuffer)||e&&B(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(B(e,SharedArrayBuffer)||e&&B(e.buffer,SharedArrayBuffer)))return Q(e,r,t);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var i=e.valueOf&&e.valueOf();if(i!=null&&i!==e)return a.from(i,r,t);var n=$r(e);if(n)return n;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return a.from(e[Symbol.toPrimitive]("string"),r,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}a.from=function(e,r,t){return wr(e,r,t)};Object.setPrototypeOf(a.prototype,Uint8Array.prototype);Object.setPrototypeOf(a,Uint8Array);function yr(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function Vr(e,r,t){return yr(e),e<=0?U(e):r!==void 0?typeof t=="string"?U(e).fill(r,t):U(e).fill(r):U(e)}a.alloc=function(e,r,t){return Vr(e,r,t)};function K(e){return yr(e),U(e<0?0:Z(e)|0)}a.allocUnsafe=function(e){return K(e)};a.allocUnsafeSlow=function(e){return K(e)};function Kr(e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!a.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var t=xr(e,r)|0,i=U(t),n=i.write(e,r);return n!==t&&(i=i.slice(0,n)),i}function J(e){for(var r=e.length<0?0:Z(e.length)|0,t=U(r),i=0;i<r;i+=1)t[i]=e[i]&255;return t}function Zr(e){if(B(e,Uint8Array)){var r=new Uint8Array(e);return Q(r.buffer,r.byteOffset,r.byteLength)}return J(e)}function Q(e,r,t){if(r<0||e.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<r+(t||0))throw new RangeError('"length" is outside of buffer bounds');var i;return r===void 0&&t===void 0?i=new Uint8Array(e):t===void 0?i=new Uint8Array(e,r):i=new Uint8Array(e,r,t),Object.setPrototypeOf(i,a.prototype),i}function $r(e){if(a.isBuffer(e)){var r=Z(e.length)|0,t=U(r);return t.length===0||e.copy(t,0,0,r),t}if(e.length!==void 0)return typeof e.length!="number"||$(e.length)?U(0):J(e);if(e.type==="Buffer"&&Array.isArray(e.data))return J(e.data)}function Z(e){if(e>=q)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+q.toString(16)+" bytes");return e|0}function jr(e){return+e!=e&&(e=0),a.alloc(+e)}a.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==a.prototype};a.compare=function(r,t){if(B(r,Uint8Array)&&(r=a.from(r,r.offset,r.byteLength)),B(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(r)||!a.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===t)return 0;for(var i=r.length,n=t.length,o=0,u=Math.min(i,n);o<u;++o)if(r[o]!==t[o]){i=r[o],n=t[o];break}return i<n?-1:n<i?1:0};a.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};a.concat=function(r,t){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return a.alloc(0);var i;if(t===void 0)for(t=0,i=0;i<r.length;++i)t+=r[i].length;var n=a.allocUnsafe(t),o=0;for(i=0;i<r.length;++i){var u=r[i];if(B(u,Uint8Array))o+u.length>n.length?a.from(u).copy(n,o):Uint8Array.prototype.set.call(n,u,o);else if(a.isBuffer(u))u.copy(n,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=u.length}return n};function xr(e,r){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||B(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var t=e.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&t===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Ar(e).length;default:if(n)return i?-1:V(e).length;r=(""+r).toLowerCase(),n=!0}}a.byteLength=xr;function Pr(e,r,t){var i=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,r>>>=0,t<=r))return"";for(e||(e="utf8");;)switch(e){case"hex":return ft(this,r,t);case"utf8":case"utf-8":return Er(this,r,t);case"ascii":return at(this,r,t);case"latin1":case"binary":return ht(this,r,t);case"base64":return ot(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pt(this,r,t);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}a.prototype._isBuffer=!0;function C(e,r,t){var i=e[r];e[r]=e[t],e[t]=i}a.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<r;t+=2)C(this,t,t+1);return this};a.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<r;t+=4)C(this,t,t+3),C(this,t+1,t+2);return this};a.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<r;t+=8)C(this,t,t+7),C(this,t+1,t+6),C(this,t+2,t+5),C(this,t+3,t+4);return this};a.prototype.toString=function(){var r=this.length;return r===0?"":arguments.length===0?Er(this,0,r):Pr.apply(this,arguments)};a.prototype.toLocaleString=a.prototype.toString;a.prototype.equals=function(r){if(!a.isBuffer(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:a.compare(this,r)===0};a.prototype.inspect=function(){var r="",t=_.INSPECT_MAX_BYTES;return r=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(r+=" ... "),"<Buffer "+r+">"};cr&&(a.prototype[cr]=a.prototype.inspect);a.prototype.compare=function(r,t,i,n,o){if(B(r,Uint8Array)&&(r=a.from(r,r.offset,r.byteLength)),!a.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(t===void 0&&(t=0),i===void 0&&(i=r?r.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),t<0||i>r.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=i)return 0;if(n>=o)return-1;if(t>=i)return 1;if(t>>>=0,i>>>=0,n>>>=0,o>>>=0,this===r)return 0;for(var u=o-n,h=i-t,f=Math.min(u,h),c=this.slice(n,o),l=r.slice(t,i),p=0;p<f;++p)if(c[p]!==l[p]){u=c[p],h=l[p];break}return u<h?-1:h<u?1:0};function mr(e,r,t,i,n){if(e.length===0)return-1;if(typeof t=="string"?(i=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,$(t)&&(t=n?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(n)return-1;t=e.length-1}else if(t<0)if(n)t=0;else return-1;if(typeof r=="string"&&(r=a.from(r,i)),a.isBuffer(r))return r.length===0?-1:lr(e,r,t,i,n);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(e,r,t):Uint8Array.prototype.lastIndexOf.call(e,r,t):lr(e,[r],t,i,n);throw new TypeError("val must be string, number or Buffer")}function lr(e,r,t,i,n){var o=1,u=e.length,h=r.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(e.length<2||r.length<2)return-1;o=2,u/=2,h/=2,t/=2}function f(x,S){return o===1?x[S]:x.readUInt16BE(S*o)}var c;if(n){var l=-1;for(c=t;c<u;c++)if(f(e,c)===f(r,l===-1?0:c-l)){if(l===-1&&(l=c),c-l+1===h)return l*o}else l!==-1&&(c-=c-l),l=-1}else for(t+h>u&&(t=u-h),c=t;c>=0;c--){for(var p=!0,E=0;E<h;E++)if(f(e,c+E)!==f(r,E)){p=!1;break}if(p)return c}return-1}a.prototype.includes=function(r,t,i){return this.indexOf(r,t,i)!==-1};a.prototype.indexOf=function(r,t,i){return mr(this,r,t,i,!0)};a.prototype.lastIndexOf=function(r,t,i){return mr(this,r,t,i,!1)};function rt(e,r,t,i){t=Number(t)||0;var n=e.length-t;i?(i=Number(i),i>n&&(i=n)):i=n;var o=r.length;i>o/2&&(i=o/2);for(var u=0;u<i;++u){var h=parseInt(r.substr(u*2,2),16);if($(h))return u;e[t+u]=h}return u}function tt(e,r,t,i){return H(V(r,e.length-t),e,t,i)}function et(e,r,t,i){return H(st(r),e,t,i)}function it(e,r,t,i){return H(Ar(r),e,t,i)}function nt(e,r,t,i){return H(wt(r,e.length-t),e,t,i)}a.prototype.write=function(r,t,i,n){if(t===void 0)n="utf8",i=this.length,t=0;else if(i===void 0&&typeof t=="string")n=t,i=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(i)?(i=i>>>0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-t;if((i===void 0||i>o)&&(i=o),r.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var u=!1;;)switch(n){case"hex":return rt(this,r,t,i);case"utf8":case"utf-8":return tt(this,r,t,i);case"ascii":case"latin1":case"binary":return et(this,r,t,i);case"base64":return it(this,r,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return nt(this,r,t,i);default:if(u)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),u=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ot(e,r,t){return r===0&&t===e.length?z.fromByteArray(e):z.fromByteArray(e.slice(r,t))}function Er(e,r,t){t=Math.min(e.length,t);for(var i=[],n=r;n<t;){var o=e[n],u=null,h=o>239?4:o>223?3:o>191?2:1;if(n+h<=t){var f,c,l,p;switch(h){case 1:o<128&&(u=o);break;case 2:f=e[n+1],(f&192)===128&&(p=(o&31)<<6|f&63,p>127&&(u=p));break;case 3:f=e[n+1],c=e[n+2],(f&192)===128&&(c&192)===128&&(p=(o&15)<<12|(f&63)<<6|c&63,p>2047&&(p<55296||p>57343)&&(u=p));break;case 4:f=e[n+1],c=e[n+2],l=e[n+3],(f&192)===128&&(c&192)===128&&(l&192)===128&&(p=(o&15)<<18|(f&63)<<12|(c&63)<<6|l&63,p>65535&&p<1114112&&(u=p))}}u===null?(u=65533,h=1):u>65535&&(u-=65536,i.push(u>>>10&1023|55296),u=56320|u&1023),i.push(u),n+=h}return ut(i)}var sr=4096;function ut(e){var r=e.length;if(r<=sr)return String.fromCharCode.apply(String,e);for(var t="",i=0;i<r;)t+=String.fromCharCode.apply(String,e.slice(i,i+=sr));return t}function at(e,r,t){var i="";t=Math.min(e.length,t);for(var n=r;n<t;++n)i+=String.fromCharCode(e[n]&127);return i}function ht(e,r,t){var i="";t=Math.min(e.length,t);for(var n=r;n<t;++n)i+=String.fromCharCode(e[n]);return i}function ft(e,r,t){var i=e.length;(!r||r<0)&&(r=0),(!t||t<0||t>i)&&(t=i);for(var n="",o=r;o<t;++o)n+=yt[e[o]];return n}function pt(e,r,t){for(var i=e.slice(r,t),n="",o=0;o<i.length-1;o+=2)n+=String.fromCharCode(i[o]+i[o+1]*256);return n}a.prototype.slice=function(r,t){var i=this.length;r=~~r,t=t===void 0?i:~~t,r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),t<r&&(t=r);var n=this.subarray(r,t);return Object.setPrototypeOf(n,a.prototype),n};function w(e,r,t){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+r>t)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(r,t,i){r=r>>>0,t=t>>>0,i||w(r,t,this.length);for(var n=this[r],o=1,u=0;++u<t&&(o*=256);)n+=this[r+u]*o;return n};a.prototype.readUintBE=a.prototype.readUIntBE=function(r,t,i){r=r>>>0,t=t>>>0,i||w(r,t,this.length);for(var n=this[r+--t],o=1;t>0&&(o*=256);)n+=this[r+--t]*o;return n};a.prototype.readUint8=a.prototype.readUInt8=function(r,t){return r=r>>>0,t||w(r,1,this.length),this[r]};a.prototype.readUint16LE=a.prototype.readUInt16LE=function(r,t){return r=r>>>0,t||w(r,2,this.length),this[r]|this[r+1]<<8};a.prototype.readUint16BE=a.prototype.readUInt16BE=function(r,t){return r=r>>>0,t||w(r,2,this.length),this[r]<<8|this[r+1]};a.prototype.readUint32LE=a.prototype.readUInt32LE=function(r,t){return r=r>>>0,t||w(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};a.prototype.readUint32BE=a.prototype.readUInt32BE=function(r,t){return r=r>>>0,t||w(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};a.prototype.readIntLE=function(r,t,i){r=r>>>0,t=t>>>0,i||w(r,t,this.length);for(var n=this[r],o=1,u=0;++u<t&&(o*=256);)n+=this[r+u]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*t)),n};a.prototype.readIntBE=function(r,t,i){r=r>>>0,t=t>>>0,i||w(r,t,this.length);for(var n=t,o=1,u=this[r+--n];n>0&&(o*=256);)u+=this[r+--n]*o;return o*=128,u>=o&&(u-=Math.pow(2,8*t)),u};a.prototype.readInt8=function(r,t){return r=r>>>0,t||w(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};a.prototype.readInt16LE=function(r,t){r=r>>>0,t||w(r,2,this.length);var i=this[r]|this[r+1]<<8;return i&32768?i|4294901760:i};a.prototype.readInt16BE=function(r,t){r=r>>>0,t||w(r,2,this.length);var i=this[r+1]|this[r]<<8;return i&32768?i|4294901760:i};a.prototype.readInt32LE=function(r,t){return r=r>>>0,t||w(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};a.prototype.readInt32BE=function(r,t){return r=r>>>0,t||w(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};a.prototype.readFloatLE=function(r,t){return r=r>>>0,t||w(r,4,this.length),R.read(this,r,!0,23,4)};a.prototype.readFloatBE=function(r,t){return r=r>>>0,t||w(r,4,this.length),R.read(this,r,!1,23,4)};a.prototype.readDoubleLE=function(r,t){return r=r>>>0,t||w(r,8,this.length),R.read(this,r,!0,52,8)};a.prototype.readDoubleBE=function(r,t){return r=r>>>0,t||w(r,8,this.length),R.read(this,r,!1,52,8)};function y(e,r,t,i,n,o){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>n||r<o)throw new RangeError('"value" argument is out of bounds');if(t+i>e.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(r,t,i,n){if(r=+r,t=t>>>0,i=i>>>0,!n){var o=Math.pow(2,8*i)-1;y(this,r,t,i,o,0)}var u=1,h=0;for(this[t]=r&255;++h<i&&(u*=256);)this[t+h]=r/u&255;return t+i};a.prototype.writeUintBE=a.prototype.writeUIntBE=function(r,t,i,n){if(r=+r,t=t>>>0,i=i>>>0,!n){var o=Math.pow(2,8*i)-1;y(this,r,t,i,o,0)}var u=i-1,h=1;for(this[t+u]=r&255;--u>=0&&(h*=256);)this[t+u]=r/h&255;return t+i};a.prototype.writeUint8=a.prototype.writeUInt8=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,1,255,0),this[t]=r&255,t+1};a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,2,65535,0),this[t]=r&255,this[t+1]=r>>>8,t+2};a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,2,65535,0),this[t]=r>>>8,this[t+1]=r&255,t+2};a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,4,4294967295,0),this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=r&255,t+4};a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,4,4294967295,0),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};a.prototype.writeIntLE=function(r,t,i,n){if(r=+r,t=t>>>0,!n){var o=Math.pow(2,8*i-1);y(this,r,t,i,o-1,-o)}var u=0,h=1,f=0;for(this[t]=r&255;++u<i&&(h*=256);)r<0&&f===0&&this[t+u-1]!==0&&(f=1),this[t+u]=(r/h>>0)-f&255;return t+i};a.prototype.writeIntBE=function(r,t,i,n){if(r=+r,t=t>>>0,!n){var o=Math.pow(2,8*i-1);y(this,r,t,i,o-1,-o)}var u=i-1,h=1,f=0;for(this[t+u]=r&255;--u>=0&&(h*=256);)r<0&&f===0&&this[t+u+1]!==0&&(f=1),this[t+u]=(r/h>>0)-f&255;return t+i};a.prototype.writeInt8=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,1,127,-128),r<0&&(r=255+r+1),this[t]=r&255,t+1};a.prototype.writeInt16LE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,2,32767,-32768),this[t]=r&255,this[t+1]=r>>>8,t+2};a.prototype.writeInt16BE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,2,32767,-32768),this[t]=r>>>8,this[t+1]=r&255,t+2};a.prototype.writeInt32LE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,4,2147483647,-2147483648),this[t]=r&255,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24,t+4};a.prototype.writeInt32BE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};function Fr(e,r,t,i,n,o){if(t+i>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function gr(e,r,t,i,n){return r=+r,t=t>>>0,n||Fr(e,r,t,4,34028234663852886e22,-34028234663852886e22),R.write(e,r,t,i,23,4),t+4}a.prototype.writeFloatLE=function(r,t,i){return gr(this,r,t,!0,i)};a.prototype.writeFloatBE=function(r,t,i){return gr(this,r,t,!1,i)};function Br(e,r,t,i,n){return r=+r,t=t>>>0,n||Fr(e,r,t,8,17976931348623157e292,-17976931348623157e292),R.write(e,r,t,i,52,8),t+8}a.prototype.writeDoubleLE=function(r,t,i){return Br(this,r,t,!0,i)};a.prototype.writeDoubleBE=function(r,t,i){return Br(this,r,t,!1,i)};a.prototype.copy=function(r,t,i,n){if(!a.isBuffer(r))throw new TypeError("argument should be a Buffer");if(i||(i=0),!n&&n!==0&&(n=this.length),t>=r.length&&(t=r.length),t||(t=0),n>0&&n<i&&(n=i),n===i||r.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),r.length-t<n-i&&(n=r.length-t+i);var o=n-i;return this===r&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,i,n):Uint8Array.prototype.set.call(r,this.subarray(i,n),t),o};a.prototype.fill=function(r,t,i,n){if(typeof r=="string"){if(typeof t=="string"?(n=t,t=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(r.length===1){var o=r.charCodeAt(0);(n==="utf8"&&o<128||n==="latin1")&&(r=o)}}else typeof r=="number"?r=r&255:typeof r=="boolean"&&(r=Number(r));if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;t=t>>>0,i=i===void 0?this.length:i>>>0,r||(r=0);var u;if(typeof r=="number")for(u=t;u<i;++u)this[u]=r;else{var h=a.isBuffer(r)?r:a.from(r,n),f=h.length;if(f===0)throw new TypeError('The value "'+r+'" is invalid for argument "value"');for(u=0;u<i-t;++u)this[u+t]=h[u%f]}return this};var ct=/[^+/0-9A-Za-z-_]/g;function lt(e){if(e=e.split("=")[0],e=e.trim().replace(ct,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function V(e,r){r=r||1/0;for(var t,i=e.length,n=null,o=[],u=0;u<i;++u){if(t=e.charCodeAt(u),t>55295&&t<57344){if(!n){if(t>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(u+1===i){(r-=3)>-1&&o.push(239,191,189);continue}n=t;continue}if(t<56320){(r-=3)>-1&&o.push(239,191,189),n=t;continue}t=(n-55296<<10|t-56320)+65536}else n&&(r-=3)>-1&&o.push(239,191,189);if(n=null,t<128){if((r-=1)<0)break;o.push(t)}else if(t<2048){if((r-=2)<0)break;o.push(t>>6|192,t&63|128)}else if(t<65536){if((r-=3)<0)break;o.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((r-=4)<0)break;o.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return o}function st(e){for(var r=[],t=0;t<e.length;++t)r.push(e.charCodeAt(t)&255);return r}function wt(e,r){for(var t,i,n,o=[],u=0;u<e.length&&!((r-=2)<0);++u)t=e.charCodeAt(u),i=t>>8,n=t%256,o.push(n),o.push(i);return o}function Ar(e){return z.toByteArray(lt(e))}function H(e,r,t,i){for(var n=0;n<i&&!(n+t>=r.length||n>=e.length);++n)r[n+t]=e[n];return n}function B(e,r){return e instanceof r||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===r.name}function $(e){return e!==e}var yt=function(){for(var e="0123456789abcdef",r=new Array(256),t=0;t<16;++t)for(var i=t*16,n=0;n<16;++n)r[i+n]=e[t]+e[n];return r}()});var Cr=N((Ut,dr)=>{F();var s=dr.exports={},A,v;function j(){throw new Error("setTimeout has not been defined")}function P(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?A=setTimeout:A=j}catch(e){A=j}try{typeof clearTimeout=="function"?v=clearTimeout:v=P}catch(e){v=P}})();function Ur(e){if(A===setTimeout)return setTimeout(e,0);if((A===j||!A)&&setTimeout)return A=setTimeout,setTimeout(e,0);try{return A(e,0)}catch(r){try{return A.call(null,e,0)}catch(t){return A.call(this,e,0)}}}function xt(e){if(v===clearTimeout)return clearTimeout(e);if((v===P||!v)&&clearTimeout)return v=clearTimeout,clearTimeout(e);try{return v(e)}catch(r){try{return v.call(null,e)}catch(t){return v.call(this,e)}}}var T=[],M=!1,L,O=-1;function mt(){!M||!L||(M=!1,L.length?T=L.concat(T):O=-1,T.length&&Tr())}function Tr(){if(!M){var e=Ur(mt);M=!0;for(var r=T.length;r;){for(L=T,T=[];++O<r;)L&&L[O].run();O=-1,r=T.length}L=null,M=!1,xt(e)}}s.nextTick=function(e){var r=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)r[t-1]=arguments[t];T.push(new Ir(e,r)),T.length===1&&!M&&Ur(Tr)};function Ir(e,r){this.fun=e,this.array=r}Ir.prototype.run=function(){this.fun.apply(null,this.array)};s.title="browser";s.browser=!0;s.env={};s.argv=[];s.version="";s.versions={};function I(){}s.on=I;s.addListener=I;s.once=I;s.off=I;s.removeListener=I;s.removeAllListeners=I;s.emit=I;s.prependListener=I;s.prependOnceListener=I;s.listeners=function(e){return[]};s.binding=function(e){throw new Error("process.binding is not supported")};s.cwd=function(){return"/"};s.chdir=function(e){throw new Error("process.chdir is not supported")};s.umask=function(){return 0}});var D,b,Tt,F=Nr(()=>{D=ur(vr()),b=ur(Cr()),Tt=function(e){function r(){var i=this||self;return delete e.prototype.__magic__,i}if(typeof globalThis=="object")return globalThis;if(this)return r();e.defineProperty(e.prototype,"__magic__",{configurable:!0,get:r});var t=__magic__;return t}(Object)});var Ft={};Wr(Ft,{mockWindowLocation:()=>Et});module.exports=Yr(Ft);F();var Et=()=>{if(!window)return;let e=window.location;delete window.location,window.location=Object.defineProperties({},nr(ir({},Object.getOwnPropertyDescriptors(e)),{assign:{configurable:!0,value:jest.fn()}}))};0&&(module.exports={mockWindowLocation});
|
|
2
2
|
/*!
|
|
3
3
|
* The buffer module from node.js, for the browser.
|
|
4
4
|
*
|
|
@@ -2759,7 +2759,7 @@ a.dapp-core-component__main__side-link::after {
|
|
|
2759
2759
|
right: 0;
|
|
2760
2760
|
left: unset;
|
|
2761
2761
|
width: calc(100% - 1.85rem);
|
|
2762
|
-
}`;document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(_u));t();t();var ir=require("react"),nm=e=>{let[o,n]=(0,ir.useState)(!1),r=()=>{n(!0)},a=()=>{n(!1)};return(0,ir.useEffect)(()=>{(e==null?void 0:e.visible)===!0?r():(e==null?void 0:e.visible)===!1&&a()},[e==null?void 0:e.visible]),{handleShowModal:r,handleHideModal:a,showModal:o}};t();var rm=({hideButtonWhenModalOpens:e,onContentHide:o,onContentShow:n,onModalCloses:r,onModalOpens:a,token:p,wrapContentInsideModal:m})=>{let d=Sa(),[l,_]=(0,tm.useState)(!1),{handleShowModal:u,handleHideModal:g,showModal:h}=nm(),y=om(p),w=!e||!l,S=()=>{_(!1),o==null||o(),m?(g(),r==null||r()):r&&(console.warn('Deprecated: "onModalCloses" must be used only when "wrapContentInsideModal" is set to "true". Use "onContentHide" instead.'),r())};return{disabledConnectButton:y,handleCloseModal:S,handleOpenModal:()=>{if(d)throw new Error(Ue);if(l)return S();_(!0),n==null||n(),m?(u(),a==null||a()):a&&(console.warn('Deprecated: "onModalOpens" must be used only when "wrapContentInsideModal" is set to "true". Use "onContentShow" instead.'),a())},shouldRenderButton:w,showContent:l,showModal:h}};t();var No=require("react"),Ca=require("@multiversx/sdk-hw-provider");ho();se();X();te();Ho();t();t();Ar();t();t();var vu=I(require("platform"));t();t();t();t();t();t();t();t();t();te();t();sn();Go();t();t();t();X();t();t();var am=I(require("axios"));function cr(e){return x(this,null,function*(){try{let{data:o}=yield am.default.get(`${e}/websocket/config`);return`wss://${o.url}`}catch(o){throw console.error(o),new Error("Can not get websocket url")}})}t();var Eo=require("react"),Au=10,im=()=>{let[e,o]=(0,Eo.useState)(""),[n,r]=(0,Eo.useState)(!1),[a,p]=(0,Eo.useState)(0),[m,d]=(0,Eo.useState)([]),[l,_]=(0,Eo.useState)(null),[u,g]=(0,Eo.useState)(!1);return{accounts:m,defaultAddressesPerPage:Au,error:e,isLoading:n,onGoToNextPage:()=>{_(null),p(S=>S+1)},onGoToPrevPage:()=>{_(null),p(S=>S===0?0:S-1)},onSelectAddress:S=>{_(S)},selectedAddress:l,setAccounts:d,setError:o,setIsLoading:r,setShowAddressList:g,showAddressList:u,startIndex:a}};var sr="Check if the MultiversX App is open on Ledger",cm=({callbackRoute:e,token:o,addressesPerPage:n,nativeAuth:r,onLoginRedirect:a})=>{let p=b(as),m=ce(),d=$(),l=he(),_=r!=null,u=Ke(r),g=o,{accounts:h,setAccounts:y,isLoading:w,setIsLoading:S,setShowAddressList:v,showAddressList:R,startIndex:D,selectedAddress:E,onGoToPrevPage:G,onGoToNextPage:L,onSelectAddress:B,error:j,setError:Y,defaultAddressesPerPage:M}=im(),Z=n!=null?n:M,[J,ye]=(0,No.useState)(""),[pe,ge]=(0,No.useState)(!1),oe=({address:z,index:U,signature:N})=>{d(Yi({index:U,loginType:"ledger"})),N&&u.setTokenLoginInfo({signature:N,address:z}),d(_e({address:z,loginMethod:"ledger"})),Qe({callbackRoute:e,onLoginRedirect:a,options:{address:z,signature:N}})},F=(z,U="")=>{var Q;let{errorMessage:N,defaultErrorMessage:q}=et(z),K=(Q=N!=null?N:q)!=null?Q:sr;Y(`${K}.${U}`),S(!1),d(Pr(null))},re=()=>x(void 0,null,function*(){try{if(m instanceof Ca.HWProvider&&m.isInitialized())return yield m.isConnected()}catch(z){F(z)}return!1}),Ae=()=>x(void 0,null,function*(){if(yield re()){Y(""),S(!1);return}try{let U=new Ca.HWProvider;(yield U.init())&&Ee(U),Y(""),S(!1)}catch(U){F(U)}}),Pe=()=>x(void 0,null,function*(){let z=yield re();if(!E||!z)return F(sr);let{index:U}=E;if(_&&!g&&(g=yield u.getNativeAuthLoginToken(),!g)){console.warn("Fetching block failed. Login cancelled.");return}if(g){u.setLoginToken(g);try{let N=yield m.tokenLogin({token:i.Buffer.from(`${g}{}`),addressIndex:U});oe({address:N.address,index:U,signature:N.signature.toString("hex")})}catch(N){F(N,". Update MultiversX App to continue.")}}else try{let N=yield m.login({addressIndex:U});oe({address:N,index:U})}catch(N){return F(N),!1}return!0}),W=()=>x(void 0,null,function*(){try{if(S(!0),E==null)return!1;d(p?Vi(E):Pr(P(T({},E),{version:J,hasContractDataEnabled:pe}))),S(!1),yield Pe()}catch(z){F(z)}finally{S(!1)}return v(!1),!0}),V=()=>x(void 0,null,function*(){if(!(yield re()))return F(j);try{S(!0);let U=yield m.getAccounts(D,Z),N=yield jt(m);ye(N.version),ge(N.dataEnabled),y(U),S(!1)}catch(U){F(U)}}),me=()=>x(void 0,null,function*(){if(l)throw new Error(Ue);Y("");try{if(S(!0),yield Ae(),!(yield re()))return F(sr);if(p!=null){if(!E)return F(sr);let U=yield m.login({addressIndex:E.index.valueOf()});if(!U)return F("Login cancelled.");d(_e({address:U,loginMethod:"ledger"})),Qe({callbackRoute:e,onLoginRedirect:a})}else h!=null&&h.length||(yield V()),v(!0)}catch(z){F(z)}finally{S(!1)}});(0,No.useEffect)(()=>{Ae()},[m]),(0,No.useEffect)(()=>{V()},[D,R,m]),(0,No.useEffect)(()=>{(h==null?void 0:h.length)>0&&!R&&v(!0)},[h]);let be=Boolean(j);return[me,{loginFailed:be,isLoggedIn:l&&!be,error:j,isLoading:w&&!be},{accounts:h,showAddressList:R,startIndex:D,selectedAddress:E,version:J,contractDataEnabled:pe,onGoToPrevPage:G,onGoToNextPage:L,onSelectAddress:B,onConfirmSelectedAddress:W}]};t();var Pa=require("react"),sm=require("@multiversx/sdk-opera-provider");ho();se();te();Ho();var pm=({callbackRoute:e,token:o,nativeAuth:n,onLoginRedirect:r})=>{let[a,p]=(0,Pa.useState)(""),[m,d]=(0,Pa.useState)(!1),l=n!=null,_=Ke(n),u=o,g=$(),h=he();function y(){return x(this,null,function*(){if(h)throw new Error(Ue);d(!0);let S=sm.OperaProvider.getInstance();try{if(!(yield S.init())){console.warn("Something went wrong trying to redirect to wallet login..");return}let{origin:R}=H(),D=vo(),E=encodeURIComponent(`${R}${e!=null?e:D}`);if(l&&!u&&(u=yield _.getNativeAuthLoginToken(),!u)){console.warn("Fetching block failed. Login cancelled.");return}u&&_.setLoginToken(u);let G=T({callbackUrl:E},u&&{token:u});yield S.login(G),Ee(S);let{signature:L,address:B}=S.account;if(!B){d(!1),console.warn("Login cancelled.");return}L&&u&&_.setTokenLoginInfo({signature:L,address:B}),g(_e({address:B,loginMethod:"opera"})),Qe({callbackRoute:e,onLoginRedirect:r,options:{signature:L,address:B}})}catch(v){console.error("error loging in",v),p("error logging in"+v.message)}finally{d(!1)}})}let w=Boolean(a);return[y,{loginFailed:w,error:a,isLoading:m&&!w,isLoggedIn:h&&!w}]};t();var Ce=require("react");se();X();te();Ho();var mm=({callbackRoute:e,token:o,nativeAuth:n,onLoginRedirect:r,logoutRoute:a,canLoginRef:p})=>{var U;let m=$(),d=n!=null,l=Ke(n),_=o,[u,g]=(0,Ce.useState)(""),[h,y]=(0,Ce.useState)(""),[w,S]=(0,Ce.useState)(!0),[v,R]=(0,Ce.useState)([]),D=ce(),E=b(ds),G=b(ls),L=b(_s),B=b(ln),j=b(us),Y=b(yt),M=(0,Ce.useRef)(D),Z=p!=null?p:(0,Ce.useRef)(!1),J=(0,Ce.useRef)(!1),ye=(U=a!=null?a:Y)!=null?U:"/",pe=[Ht.CANCEL_ACTION];o&&pe.push(Ht.SIGN_LOGIN_TOKEN),d&&pe.push(Ht.SIGN_NATIVE_AUTH_TOKEN);let ge=w?"":`${j}?wallet-connect=${encodeURIComponent(h)}`,oe=Boolean(u),F=he(),re=()=>{kn(ye)},Ae=N=>{console.log("WalletConnect Session Event: ",N)},Pe=()=>x(void 0,null,function*(){var N,q,K;try{let Q=M.current;if(he()||Q==null||!Ne("walletconnectv2")||J.current)return;if(!Z.current){try{yield(N=M.current)==null?void 0:N.logout()}catch(Mu){console.warn("Unable to logout")}return}let De=yield(q=M.current)==null?void 0:q.getAddress();if(!De){console.warn("Login cancelled.");return}let Co=yield(K=M.current)==null?void 0:K.getSignature(),Po={address:De,loginMethod:"walletconnectv2"},Sm={logoutRoute:ye,loginType:"walletconnectv2",callbackRoute:e!=null?e:H().href};m(Xi(Sm)),Co&&l.setTokenLoginInfo({signature:Co,address:De}),m(_e(Po)),Qe({callbackRoute:e,onLoginRedirect:r,options:{address:De,signature:Co}})}catch(Q){g("User rejected connection proposal"),console.error(Q)}}),W=()=>x(void 0,null,function*(){var N,q,K,Q,Re;Z.current=!1;try{((Q=(K=(q=(N=M.current)==null?void 0:N.walletConnector)==null?void 0:q.session)==null?void 0:K.getAll())!=null?Q:[]).length>0&&(yield(Re=M.current)==null?void 0:Re.logout())}catch(De){console.warn("Unable to logout")}}),V=N=>x(void 0,null,function*(){var q,K,Q;if(!E||!G){g("Invalid WalletConnect setup");return}if(!N||!N.topic){g("Expired connection");return}try{let{approval:Re}=yield(q=M.current)==null?void 0:q.connect({topic:N.topic,methods:pe});if(d&&!_&&(_=yield l.getNativeAuthLoginToken(),!_)){console.warn("Fetching block failed. Login cancelled.");return}_&&l.setLoginToken(_);try{yield(K=M.current)==null?void 0:K.login({approval:Re,token:_})}catch(De){g("User rejected existing connection proposal"),S(!0),yield be()}}catch(Re){console.error("Unable to connect to existing session",Re),g("Unable to connect to existing session")}finally{R((Q=M.current)==null?void 0:Q.pairings)}}),me=N=>x(void 0,null,function*(){var q,K;try{N&&(yield(q=M.current)==null?void 0:q.logout({topic:N}))}catch(Q){console.error("Unable to remove existing pairing",Q),g("Unable to remove existing pairing")}finally{let Q=yield(K=M.current)==null?void 0:K.getPairings();R(Q)}});function be(N=!0){return x(this,null,function*(){var Q;if(!G||!E){g("Invalid WalletConnect setup");return}if(J.current)return;if(J.current=!0,(Q=M.current)!=null&&Q.walletConnector){M.current.init(),Ee(M.current),J.current=!1,Z.current=!0,N&&z();return}let q={onClientLogin:Pe,onClientLogout:re,onClientEvent:Ae},K=new Vt(q,B,E,G,L);yield K.init(),Ee(K),M.current=K,J.current=!1,Z.current=!0,N&&(R(K.pairings),z())})}function z(){return x(this,null,function*(){var N,q;if(!E||!G){g("Invalid WalletConnect setup");return}try{let{uri:K,approval:Q}=yield(N=M.current)==null?void 0:N.connect({methods:pe});if(!Boolean(K))return;if(y(K),(L==null?void 0:L.logger)==="debug"&&console.log("WalletConnect uri: ",K),d&&!_&&(_=yield l.getNativeAuthLoginToken(),!_)){console.warn("Fetching block failed. Login cancelled.");return}_&&l.setLoginToken(_);try{yield(q=M.current)==null?void 0:q.login({approval:Q,token:_})}catch(De){g("User rejected connection proposal"),S(!0),yield be()}}catch(K){console.error("Unable to connect",K)}})}return Wt(()=>{!o||z()},[o]),Wt(()=>{M.current=D},[D]),(0,Ce.useEffect)(()=>{S(!Boolean(h))},[h]),[be,{error:u,loginFailed:oe,isLoading:w&&!oe,isLoggedIn:F&&!oe},{uriDeepLink:ge,walletConnectUri:h,cancelLogin:W,connectExisting:V,removeExistingPairing:me,wcPairings:v}]};t();var Ra=require("react");ho();X();t();var dm=(e,o=["address"])=>{let n=new URL(e),r=new URLSearchParams(n.search);o.forEach(m=>r.delete(m));let a=Array.from(r.values()).length>0?"?":"",p=n.pathname==="/"&&!e.endsWith("/")?"":n.pathname;return n.protocol==="vscode:"?e:`${n.origin}${p}${a}${r.toString()}${n.hash}`};var lm=({callbackRoute:e,token:o,nativeAuth:n,redirectDelayMilliseconds:r=100,customWalletAddress:a})=>{let[p,m]=(0,Ra.useState)(""),[d,l]=(0,Ra.useState)(!1),_=b(Te),u=$(),g=he(),h=Boolean(n),y=Ke(n),w=o;function S(){return x(this,null,function*(){if(g)throw new Error(Ue);u(_c(a));try{l(!0);let R=$t(a!=null?a:_.walletAddress),D=new Date,E=D.setMinutes(D.getMinutes()+3)/1e3,G={data:{},expires:E};if(h&&!w&&(w=yield y.getNativeAuthLoginToken(),!w)){console.warn("Login cancelled.");return}w&&y.setLoginToken(w);let{origin:L}=H(),B=window!=null&&window.location?`${L}${e}`:`${e}`;new URLSearchParams(document.location.search).get("address")||u(Zi(G));let M=dm(B),Z=encodeURIComponent(M),J=P(T({callbackUrl:Z},w&&{token:w}),{redirectDelayMilliseconds:r});yield R.login(J)}catch(R){console.error(R),m("error logging in"+R.message)}finally{l(!1)}})}let v=Boolean(p);return[S,{error:p,loginFailed:v,isLoading:d&&!v,isLoggedIn:g&&!v}]};t();t();var Mn=require("react");function Iu(e){let[o,n]=(0,Mn.useState)(),[r,a]=(0,Mn.useState)();function p(){return x(this,null,function*(){try{let m=yield cr(e);n(m)}catch(m){a(m)}})}return(0,Mn.useEffect)(()=>{p()},[]),{data:o,error:r,getUrl:p}}t();var Da=require("react");t();var _o=require("react"),gm=require("socket.io-client");X();t();var xe={current:null,status:"not_initialized"};var ku=3e3,Lu=3,_m=500,um=1e3,Eu="batchUpdated",Nu="connect",Cu="disconnect";function fm(){let e=(0,_o.useRef)(null),o=(0,_o.useRef)(null),{address:n}=qe(),r=$(),{network:a}=xn(),p=l=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{r($i(l))},um)},m=l=>{o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{r(ji(l))},um)},d=(0,_o.useCallback)(nr(()=>x(this,null,function*(){xe.status="pending";let l=yield cr(a.apiAddress);if(l==null){console.warn("Can not get websocket url");return}xe.current=(0,gm.io)(l,{forceNew:!0,reconnectionAttempts:Lu,timeout:ku,query:{address:n}}),xe.status="completed",xe.current.onAny(p),xe.current.on(Eu,m),xe.current.on(Nu,()=>{console.log("Websocket connected.")}),xe.current.on(Cu,()=>{console.warn("Websocket disconnected. Trying to reconnect..."),setTimeout(()=>{var _;console.log("Websocket reconnecting..."),(_=xe.current)==null||_.connect()},_m)})}),{retries:2,delay:_m}),[n]);(0,_o.useEffect)(()=>{var l;n&&xe.status==="not_initialized"&&!((l=xe.current)!=null&&l.active)&&d()},[n,d]),(0,_o.useEffect)(()=>()=>{var l;(l=xe.current)==null||l.close(),xe.status="not_initialized",e.current&&clearTimeout(e.current)},[])}function Pu(e,o){fm();let n=b(xt),r=b(is);(0,Da.useEffect)(()=>{let a=n==null?void 0:n.message;a&&e(a)},[e,n]),(0,Da.useEffect)(()=>{let a=r==null?void 0:r.data;a&&(o==null||o(a))},[o,r])}t();t();var Ma=require("react");ie();var Tm=()=>{let e=b(vt),o=b(Kr),{signedTransactions:n}=vn(),r=(0,Ma.useMemo)(()=>e.map(p=>{var d,l,_,u,g;let m=(d=n[p.toastId])==null?void 0:d.status;return{sessionId:p.toastId,baseTransactionsInfo:(l=o[p.toastId])!=null?l:{},customTransactionsInfo:(g=(u=(_=n[p.toastId])==null?void 0:_.customTransactionInformation)==null?void 0:u.sessionInformation)!=null?g:{},status:m,isPending:m!=="success"&&m!=="fail"&&m!=="cancelled"}}),[e,n,o]),a=(0,Ma.useMemo)(()=>r.filter(p=>p.isPending),[r]);return{transactionsToastsInfo:r,pendingTransactionsToastsInfo:a}};t();var hm=()=>{let e=b(Ts),o=b(vt);return{customToasts:e,transactionToasts:o}};t();t();var bm=I(require("swr"));t();t();t();t();var xm=I(require("axios"));function ym(e=Lt){let o=bn();return xm.default.get(e,{baseURL:o})}function Ru(){let e=r=>ym(r).then(a=>a.data),{data:o,error:n}=(0,bm.default)(Lt,e);return{price:o==null?void 0:o.price,error:n}}0&&(module.exports={useCheckTransactionStatus,useDebounce,useExtensionLogin,useGetAccount,useGetAccountFromApi,useGetAccountInfo,useGetAccountProvider,useGetActiveTransactionsStatus,useGetEgldPrice,useGetFailedTransactions,useGetIsLoggedIn,useGetLastPendingTransactionHash,useGetLoginInfo,useGetModalLoginMethods,useGetNetworkConfig,useGetNotification,useGetPendingTransactions,useGetSignTransactionsError,useGetSignedTransactions,useGetSuccessfulTransactions,useGetToasts,useGetTokenDetails,useGetTransactionDisplayInfo,useGetWebsocketEvent,useGetWebsocketUrl,useLedgerLogin,useOperaLogin,useParseMultiEsdtTransferData,useParseSignedTransactions,useRegisterWebsocketListener,useSignMultipleTransactions,useSignTransactions,useSignTransactionsCommonData,useSignTransactionsWithDevice,useSignTransactionsWithLedger,useTrackTransactionStatus,useTransactionsToasts,useUpdateEffect,useWalletConnectV2Login,useWebWalletLogin});
|
|
2762
|
+
}`;document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(_u));t();t();var ir=require("react"),nm=e=>{let[o,n]=(0,ir.useState)(!1),r=()=>{n(!0)},a=()=>{n(!1)};return(0,ir.useEffect)(()=>{(e==null?void 0:e.visible)===!0?r():(e==null?void 0:e.visible)===!1&&a()},[e==null?void 0:e.visible]),{handleShowModal:r,handleHideModal:a,showModal:o}};t();var rm=({hideButtonWhenModalOpens:e,onContentHide:o,onContentShow:n,onModalCloses:r,onModalOpens:a,token:p,wrapContentInsideModal:m})=>{let d=Sa(),[l,_]=(0,tm.useState)(!1),{handleShowModal:u,handleHideModal:g,showModal:h}=nm(),y=om(p),w=!e||!l,S=()=>{_(!1),o==null||o(),m?(g(),r==null||r()):r&&(console.warn('Deprecated: "onModalCloses" must be used only when "wrapContentInsideModal" is set to "true". Use "onContentHide" instead.'),r())};return{disabledConnectButton:y,handleCloseModal:S,handleOpenModal:()=>{if(d)throw new Error(Ue);if(l)return S();_(!0),n==null||n(),m?(u(),a==null||a()):a&&(console.warn('Deprecated: "onModalOpens" must be used only when "wrapContentInsideModal" is set to "true". Use "onContentShow" instead.'),a())},shouldRenderButton:w,showContent:l,showModal:h}};t();var No=require("react"),Ca=require("@multiversx/sdk-hw-provider");ho();se();X();te();Ho();t();t();Ar();t();t();var vu=I(require("platform"));t();t();t();t();t();t();t();t();t();te();t();sn();Go();t();t();t();X();t();t();var am=I(require("axios"));function cr(e){return x(this,null,function*(){try{let{data:o}=yield am.default.get(`${e}/websocket/config`);return`wss://${o.url}`}catch(o){throw console.error(o),new Error("Can not get websocket url")}})}t();var Eo=require("react"),Au=10,im=()=>{let[e,o]=(0,Eo.useState)(""),[n,r]=(0,Eo.useState)(!1),[a,p]=(0,Eo.useState)(0),[m,d]=(0,Eo.useState)([]),[l,_]=(0,Eo.useState)(null),[u,g]=(0,Eo.useState)(!1);return{accounts:m,defaultAddressesPerPage:Au,error:e,isLoading:n,onGoToNextPage:()=>{_(null),p(S=>S+1)},onGoToPrevPage:()=>{_(null),p(S=>S===0?0:S-1)},onSelectAddress:S=>{_(S)},selectedAddress:l,setAccounts:d,setError:o,setIsLoading:r,setShowAddressList:g,showAddressList:u,startIndex:a}};var sr="Check if the MultiversX App is open on Ledger",cm=({callbackRoute:e,token:o,addressesPerPage:n,nativeAuth:r,onLoginRedirect:a})=>{let p=b(as),m=ce(),d=$(),l=he(),_=r!=null,u=Ke(r),g=o,{accounts:h,setAccounts:y,isLoading:w,setIsLoading:S,setShowAddressList:v,showAddressList:R,startIndex:D,selectedAddress:E,onGoToPrevPage:G,onGoToNextPage:L,onSelectAddress:B,error:j,setError:Y,defaultAddressesPerPage:M}=im(),Z=n!=null?n:M,[J,ye]=(0,No.useState)(""),[pe,ge]=(0,No.useState)(!1),oe=({address:z,index:U,signature:N})=>{d(Yi({index:U,loginType:"ledger"})),N&&u.setTokenLoginInfo({signature:N,address:z}),d(_e({address:z,loginMethod:"ledger"})),Qe({callbackRoute:e,onLoginRedirect:a,options:{address:z,signature:N}})},F=(z,U="")=>{var Q;let{errorMessage:N,defaultErrorMessage:q}=et(z),K=(Q=N!=null?N:q)!=null?Q:sr;Y(`${K}.${U}`),S(!1),d(Pr(null))},re=()=>x(void 0,null,function*(){try{if(m instanceof Ca.HWProvider&&m.isInitialized())return yield m.isConnected()}catch(z){F(z)}return!1}),Ae=()=>x(void 0,null,function*(){if(yield re()){Y(""),S(!1);return}try{let U=new Ca.HWProvider;(yield U.init())&&Ee(U),Y(""),S(!1)}catch(U){F(U)}}),Pe=()=>x(void 0,null,function*(){let z=yield re();if(!E||!z)return F(sr);let{index:U}=E;if(_&&!g&&(g=yield u.getNativeAuthLoginToken(),!g)){console.warn("Fetching block failed. Login cancelled.");return}if(g){u.setLoginToken(g);try{let N=yield m.tokenLogin({token:i.Buffer.from(`${g}{}`),addressIndex:U});oe({address:N.address,index:U,signature:N.signature.toString("hex")})}catch(N){F(N,". Update MultiversX App to continue.")}}else try{let N=yield m.login({addressIndex:U});oe({address:N,index:U})}catch(N){return F(N),!1}return!0}),W=()=>x(void 0,null,function*(){try{if(S(!0),E==null)return!1;d(p?Vi(E):Pr(P(T({},E),{version:J,hasContractDataEnabled:pe}))),S(!1),yield Pe()}catch(z){F(z)}finally{S(!1)}return v(!1),!0}),V=()=>x(void 0,null,function*(){if(!(yield re()))return F(j);try{S(!0);let U=yield m.getAccounts(D,Z),N=yield jt(m);ye(N.version),ge(N.dataEnabled),y(U),S(!1)}catch(U){F(U)}}),me=()=>x(void 0,null,function*(){if(l)throw new Error(Ue);Y("");try{if(S(!0),yield Ae(),!(yield re()))return F(sr);if(p!=null){if(!E)return F(sr);let U=yield m.login({addressIndex:E.index.valueOf()});if(!U)return F("Login cancelled.");d(_e({address:U,loginMethod:"ledger"})),Qe({callbackRoute:e,onLoginRedirect:a})}else h!=null&&h.length||(yield V()),v(!0)}catch(z){F(z)}finally{S(!1)}});(0,No.useEffect)(()=>{Ae()},[m]),(0,No.useEffect)(()=>{V()},[D,R,m]),(0,No.useEffect)(()=>{(h==null?void 0:h.length)>0&&!R&&v(!0)},[h]);let be=Boolean(j);return[me,{loginFailed:be,isLoggedIn:l&&!be,error:j,isLoading:w&&!be},{accounts:h,showAddressList:R,startIndex:D,selectedAddress:E,version:J,contractDataEnabled:pe,onGoToPrevPage:G,onGoToNextPage:L,onSelectAddress:B,onConfirmSelectedAddress:W}]};t();var Pa=require("react"),sm=require("@multiversx/sdk-opera-provider");ho();se();te();Ho();var pm=({callbackRoute:e,token:o,nativeAuth:n,onLoginRedirect:r})=>{let[a,p]=(0,Pa.useState)(""),[m,d]=(0,Pa.useState)(!1),l=n!=null,_=Ke(n),u=o,g=$(),h=he();function y(){return x(this,null,function*(){if(h)throw new Error(Ue);d(!0);let S=sm.OperaProvider.getInstance();try{if(!(yield S.init())){console.warn("Something went wrong trying to redirect to wallet login..");return}let{origin:R}=H(),D=vo(),E=encodeURIComponent(`${R}${e!=null?e:D}`);if(l&&!u&&(u=yield _.getNativeAuthLoginToken(),!u)){console.warn("Fetching block failed. Login cancelled.");return}u&&_.setLoginToken(u);let G=T({callbackUrl:E},u&&{token:u});yield S.login(G),Ee(S);let{signature:L,address:B}=S.account;if(!B){d(!1),console.warn("Login cancelled.");return}L&&u&&_.setTokenLoginInfo({signature:L,address:B}),g(_e({address:B,loginMethod:"opera"})),Qe({callbackRoute:e,onLoginRedirect:r,options:{signature:L,address:B}})}catch(v){console.error("error loging in",v),p("error logging in"+v.message)}finally{d(!1)}})}let w=Boolean(a);return[y,{loginFailed:w,error:a,isLoading:m&&!w,isLoggedIn:h&&!w}]};t();var Ce=require("react");se();X();te();Ho();var mm=({callbackRoute:e,token:o,nativeAuth:n,onLoginRedirect:r,logoutRoute:a,canLoginRef:p})=>{var U;let m=$(),d=n!=null,l=Ke(n),_=o,[u,g]=(0,Ce.useState)(""),[h,y]=(0,Ce.useState)(""),[w,S]=(0,Ce.useState)(!0),[v,R]=(0,Ce.useState)([]),D=ce(),E=b(ds),G=b(ls),L=b(_s),B=b(ln),j=b(us),Y=b(yt),M=(0,Ce.useRef)(D),Z=p!=null?p:(0,Ce.useRef)(!1),J=(0,Ce.useRef)(!1),ye=(U=a!=null?a:Y)!=null?U:"/",pe=[Ht.CANCEL_ACTION];o&&pe.push(Ht.SIGN_LOGIN_TOKEN),d&&pe.push(Ht.SIGN_NATIVE_AUTH_TOKEN);let ge=w?"":`${j}?wallet-connect=${encodeURIComponent(h)}`,oe=Boolean(u),F=he(),re=()=>{kn(ye)},Ae=N=>{console.log("WalletConnect Session Event: ",N)},Pe=()=>x(void 0,null,function*(){var N,q,K;try{let Q=M.current;if(he()||Q==null||!Ne("walletconnectv2")||J.current)return;if(!Z.current){try{yield(N=M.current)==null?void 0:N.logout()}catch(Mu){console.warn("Unable to logout")}return}let De=yield(q=M.current)==null?void 0:q.getAddress();if(!De){console.warn("Login cancelled.");return}let Co=yield(K=M.current)==null?void 0:K.getSignature(),Po={address:De,loginMethod:"walletconnectv2"},Sm={logoutRoute:ye,loginType:"walletconnectv2",callbackRoute:e!=null?e:H().href};m(Xi(Sm)),Co&&l.setTokenLoginInfo({signature:Co,address:De}),m(_e(Po)),Qe({callbackRoute:e,onLoginRedirect:r,options:{address:De,signature:Co}})}catch(Q){g("User rejected connection proposal"),console.error(Q)}}),W=()=>x(void 0,null,function*(){var N,q,K,Q,Re;Z.current=!1;try{((Q=(K=(q=(N=M.current)==null?void 0:N.walletConnector)==null?void 0:q.session)==null?void 0:K.getAll())!=null?Q:[]).length>0&&(yield(Re=M.current)==null?void 0:Re.logout())}catch(De){console.warn("Unable to logout")}}),V=N=>x(void 0,null,function*(){var q,K,Q;if(!E||!G){g("Invalid WalletConnect setup");return}if(!N||!N.topic){g("Expired connection");return}try{let{approval:Re}=yield(q=M.current)==null?void 0:q.connect({topic:N.topic,methods:pe});if(d&&!_&&(_=yield l.getNativeAuthLoginToken(),!_)){console.warn("Fetching block failed. Login cancelled.");return}_&&l.setLoginToken(_);try{yield(K=M.current)==null?void 0:K.login({approval:Re,token:_})}catch(De){g("User rejected existing connection proposal"),S(!0),yield be()}}catch(Re){console.error("Unable to connect to existing session",Re),g("Unable to connect to existing session")}finally{R((Q=M.current)==null?void 0:Q.pairings)}}),me=N=>x(void 0,null,function*(){var q,K;try{N&&(yield(q=M.current)==null?void 0:q.logout({topic:N}))}catch(Q){console.error("Unable to remove existing pairing",Q),g("Unable to remove existing pairing")}finally{let Q=yield(K=M.current)==null?void 0:K.getPairings();R(Q)}});function be(N=!0){return x(this,null,function*(){var Q;if(!G||!E){g("Invalid WalletConnect setup");return}if(J.current)return;if(J.current=!0,(Q=M.current)!=null&&Q.walletConnector){M.current.init(),Ee(M.current),J.current=!1,Z.current=!0,N&&z();return}let q={onClientLogin:Pe,onClientLogout:re,onClientEvent:Ae},K=new Vt(q,B,E,G,L);yield K.init(),Ee(K),M.current=K,J.current=!1,Z.current=!0,N&&(R(K.pairings),z())})}function z(){return x(this,null,function*(){var N,q;if(!E||!G){g("Invalid WalletConnect setup");return}try{let{uri:K,approval:Q}=yield(N=M.current)==null?void 0:N.connect({methods:pe});if(!Boolean(K))return;if(y(K),(L==null?void 0:L.logger)==="debug"&&console.log("WalletConnect uri: ",K),d&&!_&&(_=yield l.getNativeAuthLoginToken(),!_)){console.warn("Fetching block failed. Login cancelled.");return}_&&l.setLoginToken(_);try{yield(q=M.current)==null?void 0:q.login({approval:Q,token:_})}catch(De){g("User rejected connection proposal"),S(!0),yield be()}}catch(K){console.error("Unable to connect",K)}})}return Wt(()=>{!o||z()},[o]),Wt(()=>{M.current=D},[D]),(0,Ce.useEffect)(()=>{S(!Boolean(h))},[h]),[be,{error:u,loginFailed:oe,isLoading:w&&!oe,isLoggedIn:F&&!oe},{uriDeepLink:ge,walletConnectUri:h,cancelLogin:W,connectExisting:V,removeExistingPairing:me,wcPairings:v}]};t();var Ra=require("react");ho();X();t();var dm=(e,o=["address"])=>{let n=new URL(e),r=new URLSearchParams(n.search);o.forEach(m=>r.delete(m));let a=Array.from(r.values()).length>0?"?":"",p=n.pathname==="/"&&!e.endsWith("/")?"":n.pathname;return n.protocol==="vscode:"?e:`${n.origin}${p}${a}${r.toString()}${n.hash}`};var lm=({callbackRoute:e,token:o,nativeAuth:n,redirectDelayMilliseconds:r=100,customWalletAddress:a})=>{let[p,m]=(0,Ra.useState)(""),[d,l]=(0,Ra.useState)(!1),_=b(Te),u=$(),g=he(),h=Boolean(n),y=Ke(n),w=o;function S(){return x(this,null,function*(){if(g)throw new Error(Ue);u(_c(a));try{l(!0);let R=$t(a!=null?a:_.walletAddress),D=new Date,E=D.setMinutes(D.getMinutes()+3)/1e3,G={data:{},expires:E};if(h&&!w&&(w=yield y.getNativeAuthLoginToken(),!w)){console.warn("Login cancelled.");return}w&&y.setLoginToken(w);let{origin:L}=H(),B=window!=null&&window.location?`${L}${e}`:`${e}`;new URLSearchParams(document==null?void 0:document.location.search).get("address")||u(Zi(G));let M=dm(B),Z=encodeURIComponent(M),J=P(T({callbackUrl:Z},w&&{token:w}),{redirectDelayMilliseconds:r});yield R.login(J)}catch(R){console.error(R),m("error logging in"+R.message)}finally{l(!1)}})}let v=Boolean(p);return[S,{error:p,loginFailed:v,isLoading:d&&!v,isLoggedIn:g&&!v}]};t();t();var Mn=require("react");function Iu(e){let[o,n]=(0,Mn.useState)(),[r,a]=(0,Mn.useState)();function p(){return x(this,null,function*(){try{let m=yield cr(e);n(m)}catch(m){a(m)}})}return(0,Mn.useEffect)(()=>{p()},[]),{data:o,error:r,getUrl:p}}t();var Da=require("react");t();var _o=require("react"),gm=require("socket.io-client");X();t();var xe={current:null,status:"not_initialized"};var ku=3e3,Lu=3,_m=500,um=1e3,Eu="batchUpdated",Nu="connect",Cu="disconnect";function fm(){let e=(0,_o.useRef)(null),o=(0,_o.useRef)(null),{address:n}=qe(),r=$(),{network:a}=xn(),p=l=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{r($i(l))},um)},m=l=>{o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{r(ji(l))},um)},d=(0,_o.useCallback)(nr(()=>x(this,null,function*(){xe.status="pending";let l=yield cr(a.apiAddress);if(l==null){console.warn("Can not get websocket url");return}xe.current=(0,gm.io)(l,{forceNew:!0,reconnectionAttempts:Lu,timeout:ku,query:{address:n}}),xe.status="completed",xe.current.onAny(p),xe.current.on(Eu,m),xe.current.on(Nu,()=>{console.log("Websocket connected.")}),xe.current.on(Cu,()=>{console.warn("Websocket disconnected. Trying to reconnect..."),setTimeout(()=>{var _;console.log("Websocket reconnecting..."),(_=xe.current)==null||_.connect()},_m)})}),{retries:2,delay:_m}),[n]);(0,_o.useEffect)(()=>{var l;n&&xe.status==="not_initialized"&&!((l=xe.current)!=null&&l.active)&&d()},[n,d]),(0,_o.useEffect)(()=>()=>{var l;(l=xe.current)==null||l.close(),xe.status="not_initialized",e.current&&clearTimeout(e.current)},[])}function Pu(e,o){fm();let n=b(xt),r=b(is);(0,Da.useEffect)(()=>{let a=n==null?void 0:n.message;a&&e(a)},[e,n]),(0,Da.useEffect)(()=>{let a=r==null?void 0:r.data;a&&(o==null||o(a))},[o,r])}t();t();var Ma=require("react");ie();var Tm=()=>{let e=b(vt),o=b(Kr),{signedTransactions:n}=vn(),r=(0,Ma.useMemo)(()=>e.map(p=>{var d,l,_,u,g;let m=(d=n[p.toastId])==null?void 0:d.status;return{sessionId:p.toastId,baseTransactionsInfo:(l=o[p.toastId])!=null?l:{},customTransactionsInfo:(g=(u=(_=n[p.toastId])==null?void 0:_.customTransactionInformation)==null?void 0:u.sessionInformation)!=null?g:{},status:m,isPending:m!=="success"&&m!=="fail"&&m!=="cancelled"}}),[e,n,o]),a=(0,Ma.useMemo)(()=>r.filter(p=>p.isPending),[r]);return{transactionsToastsInfo:r,pendingTransactionsToastsInfo:a}};t();var hm=()=>{let e=b(Ts),o=b(vt);return{customToasts:e,transactionToasts:o}};t();t();var bm=I(require("swr"));t();t();t();t();var xm=I(require("axios"));function ym(e=Lt){let o=bn();return xm.default.get(e,{baseURL:o})}function Ru(){let e=r=>ym(r).then(a=>a.data),{data:o,error:n}=(0,bm.default)(Lt,e);return{price:o==null?void 0:o.price,error:n}}0&&(module.exports={useCheckTransactionStatus,useDebounce,useExtensionLogin,useGetAccount,useGetAccountFromApi,useGetAccountInfo,useGetAccountProvider,useGetActiveTransactionsStatus,useGetEgldPrice,useGetFailedTransactions,useGetIsLoggedIn,useGetLastPendingTransactionHash,useGetLoginInfo,useGetModalLoginMethods,useGetNetworkConfig,useGetNotification,useGetPendingTransactions,useGetSignTransactionsError,useGetSignedTransactions,useGetSuccessfulTransactions,useGetToasts,useGetTokenDetails,useGetTransactionDisplayInfo,useGetWebsocketEvent,useGetWebsocketUrl,useLedgerLogin,useOperaLogin,useParseMultiEsdtTransferData,useParseSignedTransactions,useRegisterWebsocketListener,useSignMultipleTransactions,useSignTransactions,useSignTransactionsCommonData,useSignTransactionsWithDevice,useSignTransactionsWithLedger,useTrackTransactionStatus,useTransactionsToasts,useUpdateEffect,useWalletConnectV2Login,useWebWalletLogin});
|
|
2763
2763
|
/*!
|
|
2764
2764
|
* The buffer module from node.js, for the browser.
|
|
2765
2765
|
*
|
|
@@ -2759,7 +2759,7 @@ a.dapp-core-component__main__side-link::after {
|
|
|
2759
2759
|
right: 0;
|
|
2760
2760
|
left: unset;
|
|
2761
2761
|
width: calc(100% - 1.85rem);
|
|
2762
|
-
}`;document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(td));t();t();var Pn=require("react"),bc=e=>{let[o,n]=(0,Pn.useState)(!1),r=()=>{n(!0)},a=()=>{n(!1)};return(0,Pn.useEffect)(()=>{(e==null?void 0:e.visible)===!0?r():(e==null?void 0:e.visible)===!1&&a()},[e==null?void 0:e.visible]),{handleShowModal:r,handleHideModal:a,showModal:o}};t();var wc=({hideButtonWhenModalOpens:e,onContentHide:o,onContentShow:n,onModalCloses:r,onModalOpens:a,token:s,wrapContentInsideModal:m})=>{let d=Wi(),[l,g]=(0,Sc.useState)(!1),{handleShowModal:f,handleHideModal:u,showModal:b}=bc(),A=Tc(s),S=!e||!l,T=()=>{g(!1),o==null||o(),m?(u(),r==null||r()):r&&(console.warn('Deprecated: "onModalCloses" must be used only when "wrapContentInsideModal" is set to "true". Use "onContentHide" instead.'),r())};return{disabledConnectButton:A,handleCloseModal:T,handleOpenModal:()=>{if(d)throw new Error(xe);if(l)return T();g(!0),n==null||n(),m?(f(),a==null||a()):a&&(console.warn('Deprecated: "onModalOpens" must be used only when "wrapContentInsideModal" is set to "true". Use "onContentShow" instead.'),a())},shouldRenderButton:S,showContent:l,showModal:b}};t();var Xe=require("react"),jt=require("@multiversx/sdk-hw-provider");no();z();te();K();po();t();t();t();var vc=()=>{let{search:e}=G(),o=new URLSearchParams(e),n=Object.fromEntries(o),r=n==null?void 0:n.address;return wo(r)?r:null};t();t();t();function kc(){let e=Z();return fo(e)}t();K();t();function qe(e){return kc()===e}function Rn(){let e=R.getState(),o=Z(),n=bo(e),r=_o(e),a=hi(e);if(!o)throw"provider not initialized";return qe("ledger")&&r?new Promise(s=>{s(n)}):!qe("")&&!qe("wallet")&&!qe("extra")?o.getAddress():new Promise(s=>{let m=vc();a!=null&&m&&s(m),r&&s(n),s("")})}t();t();t();z();ne();t();te();t();te();t();var Ac=require("@multiversx/sdk-core");t();pt();t();t();var ud=k(require("platform"));t();z();ne();nn();co();io();var fd=e=>{let o=ye.local.getItem(se.logoutEvent),{data:n}=o?JSON.parse(o):{data:e};e===n&&(ye.local.setItem({key:se.logoutEvent,data:e,expires:0}),ye.local.removeItem(se.logoutEvent))};function Ic(e,o,n=!0){return w(this,null,function*(){let r=Z(),a=fo(r),s=re(),m=a==="wallet";if(n&&(r==null?void 0:r.relogin)!=null)return yield r.relogin();if(!s||!r){Dn(e,o);return}try{let d=yield Rn();fd(d)}catch(d){Dn(e,o),console.error("error fetching logout address",d)}m&&fa(),R.dispatch(B());try{let d=Io(e);if(a==="")return Dn(d,o);m?setTimeout(()=>{r.logout({callbackUrl:d})}):(yield r.logout({callbackUrl:d}),Dn(d,o))}catch(d){console.error("error logging out",d)}})}function Dn(e,o,n){e&&!n&&(typeof o=="function"?o(e):on({url:e}))}t();t();t();t();t();t();t();t();t();K();t();nn();co();t();t();t();te();t();t();var xd=k(require("axios"));t();var Ke=require("react"),hd=10,Lc=()=>{let[e,o]=(0,Ke.useState)(""),[n,r]=(0,Ke.useState)(!1),[a,s]=(0,Ke.useState)(0),[m,d]=(0,Ke.useState)([]),[l,g]=(0,Ke.useState)(null),[f,u]=(0,Ke.useState)(!1);return{accounts:m,defaultAddressesPerPage:hd,error:e,isLoading:n,onGoToNextPage:()=>{g(null),s(T=>T+1)},onGoToPrevPage:()=>{g(null),s(T=>T===0?0:T-1)},onSelectAddress:T=>{g(T)},selectedAddress:l,setAccounts:d,setError:o,setIsLoading:r,setShowAddressList:u,showAddressList:f,startIndex:a}};var Mn="Check if the MultiversX App is open on Ledger",Ec=({callbackRoute:e,token:o,addressesPerPage:n,nativeAuth:r,onLoginRedirect:a})=>{let s=C(xi),m=Z(),d=ce(),l=re(),g=r!=null,f=Se(r),u=o,{accounts:b,setAccounts:A,isLoading:S,setIsLoading:T,setShowAddressList:E,showAddressList:D,startIndex:M,selectedAddress:I,onGoToPrevPage:q,onGoToNextPage:V,onSelectAddress:de,error:Ye,setError:Oe,defaultAddressesPerPage:F}=Lc(),Pe=n!=null?n:F,[_e,Ro]=(0,Xe.useState)(""),[Fe,Fn]=(0,Xe.useState)(!1),Je=({address:U,index:O,signature:v})=>{d(sa({index:O,loginType:"ledger"})),v&&f.setTokenLoginInfo({signature:v,address:U}),d(Q({address:U,loginMethod:"ledger"})),Le({callbackRoute:e,onLoginRedirect:a,options:{address:U,signature:v}})},X=(U,O="")=>{var W;let{errorMessage:v,defaultErrorMessage:$}=ba(U),P=(W=v!=null?v:$)!=null?W:Mn;Oe(`${P}.${O}`),T(!1),d(ut(null))},Ze=()=>w(void 0,null,function*(){try{if(m instanceof jt.HWProvider&&m.isInitialized())return yield m.isConnected()}catch(U){X(U)}return!1}),Do=()=>w(void 0,null,function*(){if(yield Ze()){Oe(""),T(!1);return}try{let O=new jt.HWProvider;(yield O.init())&&Ie(O),Oe(""),T(!1)}catch(O){X(O)}}),Bn=()=>w(void 0,null,function*(){let U=yield Ze();if(!I||!U)return X(Mn);let{index:O}=I;if(g&&!u&&(u=yield f.getNativeAuthLoginToken(),!u)){console.warn("Fetching block failed. Login cancelled.");return}if(u){f.setLoginToken(u);try{let v=yield m.tokenLogin({token:i.Buffer.from(`${u}{}`),addressIndex:O});Je({address:v.address,index:O,signature:v.signature.toString("hex")})}catch(v){X(v,". Update MultiversX App to continue.")}}else try{let v=yield m.login({addressIndex:O});Je({address:v,index:O})}catch(v){return X(v),!1}return!0}),Un=()=>w(void 0,null,function*(){try{if(T(!0),I==null)return!1;d(s?ra(I):ut(L(x({},I),{version:_e,hasContractDataEnabled:Fe}))),T(!1),yield Bn()}catch(U){X(U)}finally{T(!1)}return E(!1),!0}),Mo=()=>w(void 0,null,function*(){if(!(yield Ze()))return X(Ye);try{T(!0);let O=yield m.getAccounts(M,Pe),v=yield zr(m);Ro(v.version),Fn(v.dataEnabled),A(O),T(!1)}catch(O){X(O)}}),Wn=()=>w(void 0,null,function*(){if(l)throw new Error(xe);Oe("");try{if(T(!0),yield Do(),!(yield Ze()))return X(Mn);if(s!=null){if(!I)return X(Mn);let O=yield m.login({addressIndex:I.index.valueOf()});if(!O)return X("Login cancelled.");d(Q({address:O,loginMethod:"ledger"})),Le({callbackRoute:e,onLoginRedirect:a})}else b!=null&&b.length||(yield Mo()),E(!0)}catch(U){X(U)}finally{T(!1)}});(0,Xe.useEffect)(()=>{Do()},[m]),(0,Xe.useEffect)(()=>{Mo()},[M,D,m]),(0,Xe.useEffect)(()=>{(b==null?void 0:b.length)>0&&!D&&E(!0)},[b]);let Be=Boolean(Ye);return[Wn,{loginFailed:Be,isLoggedIn:l&&!Be,error:Ye,isLoading:S&&!Be},{accounts:b,showAddressList:D,startIndex:M,selectedAddress:I,version:_e,contractDataEnabled:Fe,onGoToPrevPage:q,onGoToNextPage:V,onSelectAddress:de,onConfirmSelectedAddress:Un}]};t();var zt=require("react"),Nc=require("@multiversx/sdk-opera-provider");no();z();K();po();var Cc=({callbackRoute:e,token:o,nativeAuth:n,onLoginRedirect:r})=>{let[a,s]=(0,zt.useState)(""),[m,d]=(0,zt.useState)(!1),l=n!=null,g=Se(n),f=o,u=ce(),b=re();function A(){return w(this,null,function*(){if(b)throw new Error(xe);d(!0);let T=Nc.OperaProvider.getInstance();try{if(!(yield T.init())){console.warn("Something went wrong trying to redirect to wallet login..");return}let{origin:D}=G(),M=kn(),I=encodeURIComponent(`${D}${e!=null?e:M}`);if(l&&!f&&(f=yield g.getNativeAuthLoginToken(),!f)){console.warn("Fetching block failed. Login cancelled.");return}f&&g.setLoginToken(f);let q=x({callbackUrl:I},f&&{token:f});yield T.login(q),Ie(T);let{signature:V,address:de}=T.account;if(!de){d(!1),console.warn("Login cancelled.");return}V&&f&&g.setTokenLoginInfo({signature:V,address:de}),u(Q({address:de,loginMethod:"opera"})),Le({callbackRoute:e,onLoginRedirect:r,options:{signature:V,address:de}})}catch(E){console.error("error loging in",E),s("error logging in"+E.message)}finally{d(!1)}})}let S=Boolean(a);return[A,{loginFailed:S,error:a,isLoading:m&&!S,isLoggedIn:b&&!S}]};t();var me=require("react");t();var On=require("react");function qt(e,o=[]){let n=(0,On.useRef)(!0);(0,On.useEffect)(()=>{n.current?n.current=!1:e()},o)}z();te();K();po();var Pc=({callbackRoute:e,token:o,nativeAuth:n,onLoginRedirect:r,logoutRoute:a,canLoginRef:s})=>{var O;let m=ce(),d=n!=null,l=Se(n),g=o,[f,u]=(0,me.useState)(""),[b,A]=(0,me.useState)(""),[S,T]=(0,me.useState)(!0),[E,D]=(0,me.useState)([]),M=Z(),I=C(bi),q=C(Si),V=C(wi),de=C(Ct),Ye=C(vi),Oe=C(yi),F=(0,me.useRef)(M),Pe=s!=null?s:(0,me.useRef)(!1),_e=(0,me.useRef)(!1),Ro=(O=a!=null?a:Oe)!=null?O:"/",Fe=[Vo.CANCEL_ACTION];o&&Fe.push(Vo.SIGN_LOGIN_TOKEN),d&&Fe.push(Vo.SIGN_NATIVE_AUTH_TOKEN);let Fn=S?"":`${Ye}?wallet-connect=${encodeURIComponent(b)}`,Je=Boolean(f),X=re(),Ze=()=>{Ic(Ro)},Do=v=>{console.log("WalletConnect Session Event: ",v)},Bn=()=>w(void 0,null,function*(){var v,$,P;try{let W=F.current;if(re()||W==null||!qe("walletconnectv2")||_e.current)return;if(!Pe.current){try{yield(v=F.current)==null?void 0:v.logout()}catch(Td){console.warn("Unable to logout")}return}let De=yield($=F.current)==null?void 0:$.getAddress();if(!De){console.warn("Login cancelled.");return}let Hn=yield(P=F.current)==null?void 0:P.getSignature(),Mc={address:De,loginMethod:"walletconnectv2"},Oc={logoutRoute:Ro,loginType:"walletconnectv2",callbackRoute:e!=null?e:G().href};m(pa(Oc)),Hn&&l.setTokenLoginInfo({signature:Hn,address:De}),m(Q(Mc)),Le({callbackRoute:e,onLoginRedirect:r,options:{address:De,signature:Hn}})}catch(W){u("User rejected connection proposal"),console.error(W)}}),Un=()=>w(void 0,null,function*(){var v,$,P,W,Re;Pe.current=!1;try{((W=(P=($=(v=F.current)==null?void 0:v.walletConnector)==null?void 0:$.session)==null?void 0:P.getAll())!=null?W:[]).length>0&&(yield(Re=F.current)==null?void 0:Re.logout())}catch(De){console.warn("Unable to logout")}}),Mo=v=>w(void 0,null,function*(){var $,P,W;if(!I||!q){u("Invalid WalletConnect setup");return}if(!v||!v.topic){u("Expired connection");return}try{let{approval:Re}=yield($=F.current)==null?void 0:$.connect({topic:v.topic,methods:Fe});if(d&&!g&&(g=yield l.getNativeAuthLoginToken(),!g)){console.warn("Fetching block failed. Login cancelled.");return}g&&l.setLoginToken(g);try{yield(P=F.current)==null?void 0:P.login({approval:Re,token:g})}catch(De){u("User rejected existing connection proposal"),T(!0),yield Be()}}catch(Re){console.error("Unable to connect to existing session",Re),u("Unable to connect to existing session")}finally{D((W=F.current)==null?void 0:W.pairings)}}),Wn=v=>w(void 0,null,function*(){var $,P;try{v&&(yield($=F.current)==null?void 0:$.logout({topic:v}))}catch(W){console.error("Unable to remove existing pairing",W),u("Unable to remove existing pairing")}finally{let W=yield(P=F.current)==null?void 0:P.getPairings();D(W)}});function Be(v=!0){return w(this,null,function*(){var W;if(!q||!I){u("Invalid WalletConnect setup");return}if(_e.current)return;if(_e.current=!0,(W=F.current)!=null&&W.walletConnector){F.current.init(),Ie(F.current),_e.current=!1,Pe.current=!0,v&&U();return}let $={onClientLogin:Bn,onClientLogout:Ze,onClientEvent:Do},P=new $o($,de,I,q,V);yield P.init(),Ie(P),F.current=P,_e.current=!1,Pe.current=!0,v&&(D(P.pairings),U())})}function U(){return w(this,null,function*(){var v,$;if(!I||!q){u("Invalid WalletConnect setup");return}try{let{uri:P,approval:W}=yield(v=F.current)==null?void 0:v.connect({methods:Fe});if(!Boolean(P))return;if(A(P),(V==null?void 0:V.logger)==="debug"&&console.log("WalletConnect uri: ",P),d&&!g&&(g=yield l.getNativeAuthLoginToken(),!g)){console.warn("Fetching block failed. Login cancelled.");return}g&&l.setLoginToken(g);try{yield($=F.current)==null?void 0:$.login({approval:W,token:g})}catch(De){u("User rejected connection proposal"),T(!0),yield Be()}}catch(P){console.error("Unable to connect",P)}})}return qt(()=>{!o||U()},[o]),qt(()=>{F.current=M},[M]),(0,me.useEffect)(()=>{T(!Boolean(b))},[b]),[Be,{error:f,loginFailed:Je,isLoading:S&&!Je,isLoggedIn:X&&!Je},{uriDeepLink:Fn,walletConnectUri:b,cancelLogin:Un,connectExisting:Mo,removeExistingPairing:Wn,wcPairings:E}]};t();var Kt=require("react");no();te();t();var Rc=(e,o=["address"])=>{let n=new URL(e),r=new URLSearchParams(n.search);o.forEach(m=>r.delete(m));let a=Array.from(r.values()).length>0?"?":"",s=n.pathname==="/"&&!e.endsWith("/")?"":n.pathname;return n.protocol==="vscode:"?e:`${n.origin}${s}${a}${r.toString()}${n.hash}`};var Dc=({callbackRoute:e,token:o,nativeAuth:n,redirectDelayMilliseconds:r=100,customWalletAddress:a})=>{let[s,m]=(0,Kt.useState)(""),[d,l]=(0,Kt.useState)(!1),g=C(Ne),f=ce(),u=re(),b=Boolean(n),A=Se(n),S=o;function T(){return w(this,null,function*(){if(u)throw new Error(xe);f(Ia(a));try{l(!0);let D=jr(a!=null?a:g.walletAddress),M=new Date,I=M.setMinutes(M.getMinutes()+3)/1e3,q={data:{},expires:I};if(b&&!S&&(S=yield A.getNativeAuthLoginToken(),!S)){console.warn("Login cancelled.");return}S&&A.setLoginToken(S);let{origin:V}=G(),de=window!=null&&window.location?`${V}${e}`:`${e}`;new URLSearchParams(document.location.search).get("address")||f(ma(q));let F=Rc(de),Pe=encodeURIComponent(F),_e=L(x({callbackUrl:Pe},S&&{token:S}),{redirectDelayMilliseconds:r});yield D.login(_e)}catch(D){console.error(D),m("error logging in"+D.message)}finally{l(!1)}})}let E=Boolean(s);return[T,{error:s,loginFailed:E,isLoading:d&&!E,isLoggedIn:u&&!E}]};0&&(module.exports={useExtensionLogin,useGetModalLoginMethods,useLedgerLogin,useOperaLogin,useWalletConnectV2Login,useWebWalletLogin});
|
|
2762
|
+
}`;document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(td));t();t();var Pn=require("react"),bc=e=>{let[o,n]=(0,Pn.useState)(!1),r=()=>{n(!0)},a=()=>{n(!1)};return(0,Pn.useEffect)(()=>{(e==null?void 0:e.visible)===!0?r():(e==null?void 0:e.visible)===!1&&a()},[e==null?void 0:e.visible]),{handleShowModal:r,handleHideModal:a,showModal:o}};t();var wc=({hideButtonWhenModalOpens:e,onContentHide:o,onContentShow:n,onModalCloses:r,onModalOpens:a,token:s,wrapContentInsideModal:m})=>{let d=Wi(),[l,g]=(0,Sc.useState)(!1),{handleShowModal:f,handleHideModal:u,showModal:b}=bc(),A=Tc(s),S=!e||!l,T=()=>{g(!1),o==null||o(),m?(u(),r==null||r()):r&&(console.warn('Deprecated: "onModalCloses" must be used only when "wrapContentInsideModal" is set to "true". Use "onContentHide" instead.'),r())};return{disabledConnectButton:A,handleCloseModal:T,handleOpenModal:()=>{if(d)throw new Error(xe);if(l)return T();g(!0),n==null||n(),m?(f(),a==null||a()):a&&(console.warn('Deprecated: "onModalOpens" must be used only when "wrapContentInsideModal" is set to "true". Use "onContentShow" instead.'),a())},shouldRenderButton:S,showContent:l,showModal:b}};t();var Xe=require("react"),jt=require("@multiversx/sdk-hw-provider");no();z();te();K();po();t();t();t();var vc=()=>{let{search:e}=G(),o=new URLSearchParams(e),n=Object.fromEntries(o),r=n==null?void 0:n.address;return wo(r)?r:null};t();t();t();function kc(){let e=Z();return fo(e)}t();K();t();function qe(e){return kc()===e}function Rn(){let e=R.getState(),o=Z(),n=bo(e),r=_o(e),a=hi(e);if(!o)throw"provider not initialized";return qe("ledger")&&r?new Promise(s=>{s(n)}):!qe("")&&!qe("wallet")&&!qe("extra")?o.getAddress():new Promise(s=>{let m=vc();a!=null&&m&&s(m),r&&s(n),s("")})}t();t();t();z();ne();t();te();t();te();t();var Ac=require("@multiversx/sdk-core");t();pt();t();t();var ud=k(require("platform"));t();z();ne();nn();co();io();var fd=e=>{let o=ye.local.getItem(se.logoutEvent),{data:n}=o?JSON.parse(o):{data:e};e===n&&(ye.local.setItem({key:se.logoutEvent,data:e,expires:0}),ye.local.removeItem(se.logoutEvent))};function Ic(e,o,n=!0){return w(this,null,function*(){let r=Z(),a=fo(r),s=re(),m=a==="wallet";if(n&&(r==null?void 0:r.relogin)!=null)return yield r.relogin();if(!s||!r){Dn(e,o);return}try{let d=yield Rn();fd(d)}catch(d){Dn(e,o),console.error("error fetching logout address",d)}m&&fa(),R.dispatch(B());try{let d=Io(e);if(a==="")return Dn(d,o);m?setTimeout(()=>{r.logout({callbackUrl:d})}):(yield r.logout({callbackUrl:d}),Dn(d,o))}catch(d){console.error("error logging out",d)}})}function Dn(e,o,n){e&&!n&&(typeof o=="function"?o(e):on({url:e}))}t();t();t();t();t();t();t();t();t();K();t();nn();co();t();t();t();te();t();t();var xd=k(require("axios"));t();var Ke=require("react"),hd=10,Lc=()=>{let[e,o]=(0,Ke.useState)(""),[n,r]=(0,Ke.useState)(!1),[a,s]=(0,Ke.useState)(0),[m,d]=(0,Ke.useState)([]),[l,g]=(0,Ke.useState)(null),[f,u]=(0,Ke.useState)(!1);return{accounts:m,defaultAddressesPerPage:hd,error:e,isLoading:n,onGoToNextPage:()=>{g(null),s(T=>T+1)},onGoToPrevPage:()=>{g(null),s(T=>T===0?0:T-1)},onSelectAddress:T=>{g(T)},selectedAddress:l,setAccounts:d,setError:o,setIsLoading:r,setShowAddressList:u,showAddressList:f,startIndex:a}};var Mn="Check if the MultiversX App is open on Ledger",Ec=({callbackRoute:e,token:o,addressesPerPage:n,nativeAuth:r,onLoginRedirect:a})=>{let s=C(xi),m=Z(),d=ce(),l=re(),g=r!=null,f=Se(r),u=o,{accounts:b,setAccounts:A,isLoading:S,setIsLoading:T,setShowAddressList:E,showAddressList:D,startIndex:M,selectedAddress:I,onGoToPrevPage:q,onGoToNextPage:V,onSelectAddress:de,error:Ye,setError:Oe,defaultAddressesPerPage:F}=Lc(),Pe=n!=null?n:F,[_e,Ro]=(0,Xe.useState)(""),[Fe,Fn]=(0,Xe.useState)(!1),Je=({address:U,index:O,signature:v})=>{d(sa({index:O,loginType:"ledger"})),v&&f.setTokenLoginInfo({signature:v,address:U}),d(Q({address:U,loginMethod:"ledger"})),Le({callbackRoute:e,onLoginRedirect:a,options:{address:U,signature:v}})},X=(U,O="")=>{var W;let{errorMessage:v,defaultErrorMessage:$}=ba(U),P=(W=v!=null?v:$)!=null?W:Mn;Oe(`${P}.${O}`),T(!1),d(ut(null))},Ze=()=>w(void 0,null,function*(){try{if(m instanceof jt.HWProvider&&m.isInitialized())return yield m.isConnected()}catch(U){X(U)}return!1}),Do=()=>w(void 0,null,function*(){if(yield Ze()){Oe(""),T(!1);return}try{let O=new jt.HWProvider;(yield O.init())&&Ie(O),Oe(""),T(!1)}catch(O){X(O)}}),Bn=()=>w(void 0,null,function*(){let U=yield Ze();if(!I||!U)return X(Mn);let{index:O}=I;if(g&&!u&&(u=yield f.getNativeAuthLoginToken(),!u)){console.warn("Fetching block failed. Login cancelled.");return}if(u){f.setLoginToken(u);try{let v=yield m.tokenLogin({token:i.Buffer.from(`${u}{}`),addressIndex:O});Je({address:v.address,index:O,signature:v.signature.toString("hex")})}catch(v){X(v,". Update MultiversX App to continue.")}}else try{let v=yield m.login({addressIndex:O});Je({address:v,index:O})}catch(v){return X(v),!1}return!0}),Un=()=>w(void 0,null,function*(){try{if(T(!0),I==null)return!1;d(s?ra(I):ut(L(x({},I),{version:_e,hasContractDataEnabled:Fe}))),T(!1),yield Bn()}catch(U){X(U)}finally{T(!1)}return E(!1),!0}),Mo=()=>w(void 0,null,function*(){if(!(yield Ze()))return X(Ye);try{T(!0);let O=yield m.getAccounts(M,Pe),v=yield zr(m);Ro(v.version),Fn(v.dataEnabled),A(O),T(!1)}catch(O){X(O)}}),Wn=()=>w(void 0,null,function*(){if(l)throw new Error(xe);Oe("");try{if(T(!0),yield Do(),!(yield Ze()))return X(Mn);if(s!=null){if(!I)return X(Mn);let O=yield m.login({addressIndex:I.index.valueOf()});if(!O)return X("Login cancelled.");d(Q({address:O,loginMethod:"ledger"})),Le({callbackRoute:e,onLoginRedirect:a})}else b!=null&&b.length||(yield Mo()),E(!0)}catch(U){X(U)}finally{T(!1)}});(0,Xe.useEffect)(()=>{Do()},[m]),(0,Xe.useEffect)(()=>{Mo()},[M,D,m]),(0,Xe.useEffect)(()=>{(b==null?void 0:b.length)>0&&!D&&E(!0)},[b]);let Be=Boolean(Ye);return[Wn,{loginFailed:Be,isLoggedIn:l&&!Be,error:Ye,isLoading:S&&!Be},{accounts:b,showAddressList:D,startIndex:M,selectedAddress:I,version:_e,contractDataEnabled:Fe,onGoToPrevPage:q,onGoToNextPage:V,onSelectAddress:de,onConfirmSelectedAddress:Un}]};t();var zt=require("react"),Nc=require("@multiversx/sdk-opera-provider");no();z();K();po();var Cc=({callbackRoute:e,token:o,nativeAuth:n,onLoginRedirect:r})=>{let[a,s]=(0,zt.useState)(""),[m,d]=(0,zt.useState)(!1),l=n!=null,g=Se(n),f=o,u=ce(),b=re();function A(){return w(this,null,function*(){if(b)throw new Error(xe);d(!0);let T=Nc.OperaProvider.getInstance();try{if(!(yield T.init())){console.warn("Something went wrong trying to redirect to wallet login..");return}let{origin:D}=G(),M=kn(),I=encodeURIComponent(`${D}${e!=null?e:M}`);if(l&&!f&&(f=yield g.getNativeAuthLoginToken(),!f)){console.warn("Fetching block failed. Login cancelled.");return}f&&g.setLoginToken(f);let q=x({callbackUrl:I},f&&{token:f});yield T.login(q),Ie(T);let{signature:V,address:de}=T.account;if(!de){d(!1),console.warn("Login cancelled.");return}V&&f&&g.setTokenLoginInfo({signature:V,address:de}),u(Q({address:de,loginMethod:"opera"})),Le({callbackRoute:e,onLoginRedirect:r,options:{signature:V,address:de}})}catch(E){console.error("error loging in",E),s("error logging in"+E.message)}finally{d(!1)}})}let S=Boolean(a);return[A,{loginFailed:S,error:a,isLoading:m&&!S,isLoggedIn:b&&!S}]};t();var me=require("react");t();var On=require("react");function qt(e,o=[]){let n=(0,On.useRef)(!0);(0,On.useEffect)(()=>{n.current?n.current=!1:e()},o)}z();te();K();po();var Pc=({callbackRoute:e,token:o,nativeAuth:n,onLoginRedirect:r,logoutRoute:a,canLoginRef:s})=>{var O;let m=ce(),d=n!=null,l=Se(n),g=o,[f,u]=(0,me.useState)(""),[b,A]=(0,me.useState)(""),[S,T]=(0,me.useState)(!0),[E,D]=(0,me.useState)([]),M=Z(),I=C(bi),q=C(Si),V=C(wi),de=C(Ct),Ye=C(vi),Oe=C(yi),F=(0,me.useRef)(M),Pe=s!=null?s:(0,me.useRef)(!1),_e=(0,me.useRef)(!1),Ro=(O=a!=null?a:Oe)!=null?O:"/",Fe=[Vo.CANCEL_ACTION];o&&Fe.push(Vo.SIGN_LOGIN_TOKEN),d&&Fe.push(Vo.SIGN_NATIVE_AUTH_TOKEN);let Fn=S?"":`${Ye}?wallet-connect=${encodeURIComponent(b)}`,Je=Boolean(f),X=re(),Ze=()=>{Ic(Ro)},Do=v=>{console.log("WalletConnect Session Event: ",v)},Bn=()=>w(void 0,null,function*(){var v,$,P;try{let W=F.current;if(re()||W==null||!qe("walletconnectv2")||_e.current)return;if(!Pe.current){try{yield(v=F.current)==null?void 0:v.logout()}catch(Td){console.warn("Unable to logout")}return}let De=yield($=F.current)==null?void 0:$.getAddress();if(!De){console.warn("Login cancelled.");return}let Hn=yield(P=F.current)==null?void 0:P.getSignature(),Mc={address:De,loginMethod:"walletconnectv2"},Oc={logoutRoute:Ro,loginType:"walletconnectv2",callbackRoute:e!=null?e:G().href};m(pa(Oc)),Hn&&l.setTokenLoginInfo({signature:Hn,address:De}),m(Q(Mc)),Le({callbackRoute:e,onLoginRedirect:r,options:{address:De,signature:Hn}})}catch(W){u("User rejected connection proposal"),console.error(W)}}),Un=()=>w(void 0,null,function*(){var v,$,P,W,Re;Pe.current=!1;try{((W=(P=($=(v=F.current)==null?void 0:v.walletConnector)==null?void 0:$.session)==null?void 0:P.getAll())!=null?W:[]).length>0&&(yield(Re=F.current)==null?void 0:Re.logout())}catch(De){console.warn("Unable to logout")}}),Mo=v=>w(void 0,null,function*(){var $,P,W;if(!I||!q){u("Invalid WalletConnect setup");return}if(!v||!v.topic){u("Expired connection");return}try{let{approval:Re}=yield($=F.current)==null?void 0:$.connect({topic:v.topic,methods:Fe});if(d&&!g&&(g=yield l.getNativeAuthLoginToken(),!g)){console.warn("Fetching block failed. Login cancelled.");return}g&&l.setLoginToken(g);try{yield(P=F.current)==null?void 0:P.login({approval:Re,token:g})}catch(De){u("User rejected existing connection proposal"),T(!0),yield Be()}}catch(Re){console.error("Unable to connect to existing session",Re),u("Unable to connect to existing session")}finally{D((W=F.current)==null?void 0:W.pairings)}}),Wn=v=>w(void 0,null,function*(){var $,P;try{v&&(yield($=F.current)==null?void 0:$.logout({topic:v}))}catch(W){console.error("Unable to remove existing pairing",W),u("Unable to remove existing pairing")}finally{let W=yield(P=F.current)==null?void 0:P.getPairings();D(W)}});function Be(v=!0){return w(this,null,function*(){var W;if(!q||!I){u("Invalid WalletConnect setup");return}if(_e.current)return;if(_e.current=!0,(W=F.current)!=null&&W.walletConnector){F.current.init(),Ie(F.current),_e.current=!1,Pe.current=!0,v&&U();return}let $={onClientLogin:Bn,onClientLogout:Ze,onClientEvent:Do},P=new $o($,de,I,q,V);yield P.init(),Ie(P),F.current=P,_e.current=!1,Pe.current=!0,v&&(D(P.pairings),U())})}function U(){return w(this,null,function*(){var v,$;if(!I||!q){u("Invalid WalletConnect setup");return}try{let{uri:P,approval:W}=yield(v=F.current)==null?void 0:v.connect({methods:Fe});if(!Boolean(P))return;if(A(P),(V==null?void 0:V.logger)==="debug"&&console.log("WalletConnect uri: ",P),d&&!g&&(g=yield l.getNativeAuthLoginToken(),!g)){console.warn("Fetching block failed. Login cancelled.");return}g&&l.setLoginToken(g);try{yield($=F.current)==null?void 0:$.login({approval:W,token:g})}catch(De){u("User rejected connection proposal"),T(!0),yield Be()}}catch(P){console.error("Unable to connect",P)}})}return qt(()=>{!o||U()},[o]),qt(()=>{F.current=M},[M]),(0,me.useEffect)(()=>{T(!Boolean(b))},[b]),[Be,{error:f,loginFailed:Je,isLoading:S&&!Je,isLoggedIn:X&&!Je},{uriDeepLink:Fn,walletConnectUri:b,cancelLogin:Un,connectExisting:Mo,removeExistingPairing:Wn,wcPairings:E}]};t();var Kt=require("react");no();te();t();var Rc=(e,o=["address"])=>{let n=new URL(e),r=new URLSearchParams(n.search);o.forEach(m=>r.delete(m));let a=Array.from(r.values()).length>0?"?":"",s=n.pathname==="/"&&!e.endsWith("/")?"":n.pathname;return n.protocol==="vscode:"?e:`${n.origin}${s}${a}${r.toString()}${n.hash}`};var Dc=({callbackRoute:e,token:o,nativeAuth:n,redirectDelayMilliseconds:r=100,customWalletAddress:a})=>{let[s,m]=(0,Kt.useState)(""),[d,l]=(0,Kt.useState)(!1),g=C(Ne),f=ce(),u=re(),b=Boolean(n),A=Se(n),S=o;function T(){return w(this,null,function*(){if(u)throw new Error(xe);f(Ia(a));try{l(!0);let D=jr(a!=null?a:g.walletAddress),M=new Date,I=M.setMinutes(M.getMinutes()+3)/1e3,q={data:{},expires:I};if(b&&!S&&(S=yield A.getNativeAuthLoginToken(),!S)){console.warn("Login cancelled.");return}S&&A.setLoginToken(S);let{origin:V}=G(),de=window!=null&&window.location?`${V}${e}`:`${e}`;new URLSearchParams(document==null?void 0:document.location.search).get("address")||f(ma(q));let F=Rc(de),Pe=encodeURIComponent(F),_e=L(x({callbackUrl:Pe},S&&{token:S}),{redirectDelayMilliseconds:r});yield D.login(_e)}catch(D){console.error(D),m("error logging in"+D.message)}finally{l(!1)}})}let E=Boolean(s);return[T,{error:s,loginFailed:E,isLoading:d&&!E,isLoggedIn:u&&!E}]};0&&(module.exports={useExtensionLogin,useGetModalLoginMethods,useLedgerLogin,useOperaLogin,useWalletConnectV2Login,useWebWalletLogin});
|
|
2763
2763
|
/*!
|
|
2764
2764
|
* The buffer module from node.js, for the browser.
|
|
2765
2765
|
*
|