coinley-checkout 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/coinley-checkout.es.js +1662 -1949
- package/dist/coinley-checkout.es.js.map +1 -1
- package/dist/coinley-checkout.umd.js +4 -27
- package/dist/coinley-checkout.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +19 -13
@@ -1,4 +1,4 @@
|
|
1
|
-
(function(P,y){typeof exports=="object"&&typeof module!="undefined"?y(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],y):(P=typeof globalThis!="undefined"?globalThis:P||self,y(P.CoinleyCheckout={},P.React))})(this,function(P,y){"use strict";var Fr=Object.defineProperty,Ur=Object.defineProperties;var _r=Object.getOwnPropertyDescriptors;var Ot=Object.getOwnPropertySymbols;var Wr=Object.prototype.hasOwnProperty,Br=Object.prototype.propertyIsEnumerable;var Lt=(P,y,K)=>y in P?Fr(P,y,{enumerable:!0,configurable:!0,writable:!0,value:K}):P[y]=K,de=(P,y)=>{for(var K in y||(y={}))Wr.call(y,K)&&Lt(P,K,y[K]);if(Ot)for(var K of Ot(y))Br.call(y,K)&&Lt(P,K,y[K]);return P},Dt=(P,y)=>Ur(P,_r(y));var H=(P,y,K)=>new Promise((Y,Oe)=>{var Ae=se=>{try{Se(K.next(se))}catch(pe){Oe(pe)}},Le=se=>{try{Se(K.throw(se))}catch(pe){Oe(pe)}},Se=se=>se.done?Y(se.value):Promise.resolve(se.value).then(Ae,Le);Se((K=K.apply(P,y)).next())});const K="";let Y={apiKey:null,apiSecret:null,apiUrl:"http://localhost:9000",merchantWalletAddresses:{}};const Oe=i=>{Y=de(de({},Y),i),console.log("API initialized with:",{apiUrl:Y.apiUrl,apiKey:Y.apiKey?`${Y.apiKey.substring(0,6)}...`:null,hasWalletAddresses:Object.keys(Y.merchantWalletAddresses||{}).length>0})},Ae=()=>({"Content-Type":"application/json","x-api-key":Y.apiKey,"x-api-secret":Y.apiSecret}),Le=i=>H(this,null,function*(){try{console.log("Creating payment with data:",i),console.log("API URL:",`${Y.apiUrl}/api/payments/create`);const o=Dt(de({},i),{merchantWalletAddresses:de(de({},Y.merchantWalletAddresses),i.merchantWalletAddresses)}),s=yield fetch(`${Y.apiUrl}/api/payments/create`,{method:"POST",headers:Ae(),body:JSON.stringify(o)});if(console.log("Create payment response status:",s.status),!s.ok){const h=yield s.json();throw console.error("Error creating payment:",h),new Error(h.error||`Failed to create payment: ${s.status}`)}const f=yield s.json();return console.log("Create payment response data:",f),f}catch(o){throw console.error("Create payment error:",o),o}}),Se=i=>H(this,null,function*(){try{console.log("Getting payment:",i);const o=yield fetch(`${Y.apiUrl}/api/payments/${i}`,{method:"GET",headers:Ae()});if(!o.ok){const f=yield o.json();throw console.error("Error getting payment:",f),new Error(f.error||`Failed to get payment: ${o.status}`)}const s=yield o.json();return console.log("Get payment response:",s),s}catch(o){throw console.error("Get payment error:",o),o}}),se=i=>H(this,null,function*(){try{console.log("Processing payment with data:",i),console.log("API URL:",`${Y.apiUrl}/api/payments/process`);const o=yield fetch(`${Y.apiUrl}/api/payments/process`,{method:"POST",headers:Ae(),body:JSON.stringify(i)});if(console.log("Process payment response status:",o.status),!o.ok){const f=yield o.json();throw console.error("Error processing payment:",f),new Error(f.error||`Failed to process payment: ${o.status}`)}const s=yield o.json();return console.log("Process payment response data:",s),s}catch(o){throw console.error("Process payment error:",o),o}}),pe=()=>typeof window!="undefined"&&typeof window.ethereum!="undefined",It=()=>H(this,null,function*(){if(!pe())throw new Error("MetaMask is not installed");try{return yield window.ethereum.request({method:"eth_requestAccounts"})}catch(i){throw console.error("Error connecting to wallet:",i),i}});var _e={exports:{}},je={};/**
|
1
|
+
(function(b,f){typeof exports=="object"&&typeof module!="undefined"?f(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],f):(b=typeof globalThis!="undefined"?globalThis:b||self,f(b.CoinleyCheckout={},b.React))})(this,function(b,f){"use strict";var It=Object.defineProperty,Ft=Object.defineProperties;var Wt=Object.getOwnPropertyDescriptors;var He=Object.getOwnPropertySymbols;var Bt=Object.prototype.hasOwnProperty,Qt=Object.prototype.propertyIsEnumerable;var $e=(b,f,W)=>f in b?It(b,f,{enumerable:!0,configurable:!0,writable:!0,value:W}):b[f]=W,q=(b,f)=>{for(var W in f||(f={}))Bt.call(f,W)&&$e(b,W,f[W]);if(He)for(var W of He(f))Qt.call(f,W)&&$e(b,W,f[W]);return b},Ke=(b,f)=>Ft(b,Wt(f));var P=(b,f,W)=>new Promise((N,E)=>{var X=H=>{try{z(W.next(H))}catch(K){E(K)}},se=H=>{try{z(W.throw(H))}catch(K){E(K)}},z=H=>H.done?N(H.value):Promise.resolve(H.value).then(X,se);z((W=W.apply(b,f)).next())});const W="",N={ETHEREUM:"ethereum",BSC:"bsc",TRON:"tron",ALGORAND:"algorand"},E={METAMASK:"metamask",TRONLINK:"tronlink",TRUST_WALLET:"trust_wallet",LUTE:"lute"},X={[N.ETHEREUM]:{chainId:"0x1",chainName:"Ethereum Mainnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:["https://mainnet.infura.io/v3/"],blockExplorerUrls:["https://etherscan.io/"],supportedWallets:[E.METAMASK,E.TRUST_WALLET]},[N.BSC]:{chainId:"0x38",chainName:"BNB Smart Chain",nativeCurrency:{name:"BNB",symbol:"BNB",decimals:18},rpcUrls:["https://bsc-dataseed.binance.org/"],blockExplorerUrls:["https://bscscan.com/"],supportedWallets:[E.METAMASK,E.TRUST_WALLET]},[N.TRON]:{fullHost:"https://api.trongrid.io",explorerUrl:"https://tronscan.org",supportedWallets:[E.TRONLINK]},[N.ALGORAND]:{network:"mainnet",explorerUrl:"https://algoexplorer.io",supportedWallets:[E.LUTE]}},se={USDT:{[N.ETHEREUM]:{address:"0xdAC17F958D2ee523a2206206994597C13D831ec7",decimals:6},[N.BSC]:{address:"0x55d398326f99059fF775485246999027B3197955",decimals:18},[N.TRON]:{address:"TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",decimals:6}},USDC:{[N.ETHEREUM]:{address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",decimals:6},[N.BSC]:{address:"0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",decimals:18},[N.TRON]:{address:"TEkxiTehnzSmSe2XqrBj4w32RUN966rdz8",decimals:6}},ALGO:{[N.ALGORAND]:{address:"native",decimals:6}}};let z=null;const H=()=>P(this,null,function*(){if(z)return z;try{if(typeof window!="undefined"&&window.Web3)return z=window.Web3,z;const s=yield import("web3");return z=s.default||s.Web3||s,z}catch(s){throw console.error("Failed to load Web3:",s),new Error("Web3 is required for blockchain transactions. Please ensure web3 is installed: npm install web3")}}),K=()=>{const s={[E.METAMASK]:!1,[E.TRUST_WALLET]:!1,[E.TRONLINK]:!1,[E.LUTE]:!1};if(typeof window=="undefined")return s;try{s[E.METAMASK]=!!(window.ethereum&&window.ethereum.isMetaMask),s[E.TRONLINK]=!!window.tronWeb,s[E.TRUST_WALLET]=!!(window.ethereum&&window.ethereum.isTrust),s[E.LUTE]=!!(window.algorand&&window.algorand.isLute)}catch(r){console.warn("Error detecting wallets:",r)}return s},fe=s=>{const r=X[s];if(!r)return[];const t=K();return r.supportedWallets.filter(l=>t[l])},ge=(s,r)=>P(this,null,function*(){switch(s){case E.METAMASK:return yield Ve(r);case E.TRONLINK:return yield _e();case E.TRUST_WALLET:return yield Je(r);case E.LUTE:return yield Ye();default:throw new Error(`Unsupported wallet type: ${s}`)}}),Ve=s=>P(this,null,function*(){if(typeof window=="undefined"||!window.ethereum||!window.ethereum.isMetaMask)throw new Error("MetaMask is not installed. Please install MetaMask extension.");try{const r=yield window.ethereum.request({method:"eth_requestAccounts"});if(!r||r.length===0)throw new Error("No accounts found. Please unlock MetaMask.");const t=X[s];return t&&t.chainId&&(yield we(t)),{address:r[0],network:s,walletType:E.METAMASK}}catch(r){throw r.code===4001?new Error("User rejected the connection request"):new Error(`Failed to connect MetaMask: ${r.message}`)}}),_e=()=>P(this,null,function*(){var l;if(typeof window=="undefined"||!window.tronWeb)throw new Error("TronLink is not installed. Please install TronLink extension.");let s=0;const r=10;for(;!window.tronWeb.ready&&s<r;)yield new Promise(d=>setTimeout(d,1e3)),s++;if(!window.tronWeb.ready)throw new Error("TronLink is not ready. Please unlock your TronLink wallet and try again.");const t=(l=window.tronWeb.defaultAddress)==null?void 0:l.base58;if(!t)throw new Error("No account found in TronLink. Please make sure you have an account set up.");return{address:t,network:N.TRON,walletType:E.TRONLINK}}),Je=s=>P(this,null,function*(){if(typeof window=="undefined"||!window.ethereum||!window.ethereum.isTrust)throw new Error("Trust Wallet is not installed. Please install Trust Wallet extension.");try{const r=yield window.ethereum.request({method:"eth_requestAccounts"});if(!r||r.length===0)throw new Error("No accounts found. Please unlock Trust Wallet.");const t=X[s];return t&&t.chainId&&(yield we(t)),{address:r[0],network:s,walletType:E.TRUST_WALLET}}catch(r){throw r.code===4001?new Error("User rejected the connection request"):new Error(`Failed to connect Trust Wallet: ${r.message}`)}}),Ye=()=>P(this,null,function*(){if(typeof window=="undefined"||!window.algorand||!window.algorand.isLute)throw new Error("Lute wallet is not installed. Please install Lute wallet extension.");try{const s=yield window.algorand.connect();if(!s||s.length===0)throw new Error("No accounts found. Please unlock Lute wallet.");return{address:s[0],network:N.ALGORAND,walletType:E.LUTE}}catch(s){throw new Error(`Failed to connect Lute wallet: ${s.message}`)}}),we=s=>P(this,null,function*(){if(typeof window=="undefined"||!window.ethereum)throw new Error("Ethereum provider not found");try{yield window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:s.chainId}]})}catch(r){if(r.code===4902)try{yield window.ethereum.request({method:"wallet_addEthereumChain",params:[s]})}catch(t){throw new Error(`Failed to add ${s.chainName} to wallet: ${t.message}`)}else throw r.code===4001?new Error("User rejected network switch request"):new Error(`Failed to switch to ${s.chainName}: ${r.message}`)}}),pe=(s,r)=>P(this,null,function*(){const{walletType:t,network:l,address:d}=s,{to:u,amount:v,tokenAddress:y,tokenDecimals:e}=r;switch(t){case E.METAMASK:case E.TRUST_WALLET:return yield Xe(d,u,v,y,e);case E.TRONLINK:return yield Ze(u,v,y,e);case E.LUTE:return yield et(d,u,v);default:throw new Error(`Unsupported wallet type: ${t}`)}}),Xe=(s,r,t,l,d)=>P(this,null,function*(){if(typeof window=="undefined"||!window.ethereum)throw new Error("Ethereum provider not found");try{const u=yield H(),v=new u(window.ethereum),y=v.utils.toBN(Math.floor(parseFloat(t)*Math.pow(10,d||18)));if(l&&l!=="native"){const e=[{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}];return(yield new v.eth.Contract(e,l).methods.transfer(r,y).send({from:s})).transactionHash}else return(yield v.eth.sendTransaction({from:s,to:r,value:y})).transactionHash}catch(u){throw u.code===4001?new Error("Transaction was rejected by user"):new Error(`Transaction failed: ${u.message}`)}}),Ze=(s,r,t,l)=>P(this,null,function*(){if(typeof window=="undefined"||!window.tronWeb||!window.tronWeb.ready)throw new Error("TronLink is not ready");try{const d=Math.floor(parseFloat(r)*Math.pow(10,l||6));return t&&t!=="native"?yield(yield window.tronWeb.contract().at(t)).transfer(s,d).send({feeLimit:1e8,callValue:0}):(yield window.tronWeb.trx.sendTransaction(s,d)).txid}catch(d){throw new Error(`TRON transaction failed: ${d.message}`)}}),et=(s,r,t)=>P(this,null,function*(){if(typeof window=="undefined"||!window.algorand)throw new Error("Algorand wallet is not available");try{const l=Math.floor(parseFloat(t)*1e6),d={from:s,to:r,amount:l,type:"pay"},u=yield window.algorand.signTransaction(d);return(yield window.algorand.sendTransaction(u)).txId}catch(l){throw new Error(`Algorand transaction failed: ${l.message}`)}}),xe=s=>({[E.METAMASK]:"https://metamask.io/",[E.TRONLINK]:"https://www.tronlink.org/",[E.TRUST_WALLET]:"https://trustwallet.com/",[E.LUTE]:"https://lute.app/"})[s]||"";let D={apiKey:null,apiSecret:null,apiUrl:"http://localhost:9000",merchantWalletAddresses:{}};const tt=s=>{D=q(q({},D),s),console.log("API initialized with:",{apiUrl:D.apiUrl,apiKey:D.apiKey?`${D.apiKey.substring(0,6)}...`:null,hasWalletAddresses:Object.keys(D.merchantWalletAddresses||{}).length>0})},Z=()=>({"Content-Type":"application/json","x-api-key":D.apiKey,"x-api-secret":D.apiSecret}),ye=s=>P(this,null,function*(){try{console.log("Creating payment with data:",s),console.log("API URL:",`${D.apiUrl}/api/payments/create`);const r=Ke(q({},s),{merchantWalletAddresses:q(q({},D.merchantWalletAddresses),s.merchantWalletAddresses)}),t=yield fetch(`${D.apiUrl}/api/payments/create`,{method:"POST",headers:Z(),body:JSON.stringify(r)});if(console.log("Create payment response status:",t.status),!t.ok){const d=yield t.json();throw console.error("Error creating payment:",d),new Error(d.error||`Failed to create payment: ${t.status}`)}const l=yield t.json();return console.log("Create payment response data:",l),l}catch(r){throw console.error("Create payment error:",r),r}}),rt=s=>P(this,null,function*(){try{console.log("Getting payment:",s);const r=yield fetch(`${D.apiUrl}/api/payments/${s}`,{method:"GET",headers:Z()});if(!r.ok){const l=yield r.json();throw console.error("Error getting payment:",l),new Error(l.error||`Failed to get payment: ${r.status}`)}const t=yield r.json();return console.log("Get payment response:",t),t}catch(r){throw console.error("Get payment error:",r),r}}),be=s=>P(this,null,function*(){try{console.log("Processing payment with data:",s),console.log("API URL:",`${D.apiUrl}/api/payments/process`);const r=yield fetch(`${D.apiUrl}/api/payments/process`,{method:"POST",headers:Z(),body:JSON.stringify(s)});if(console.log("Process payment response status:",r.status),!r.ok){const l=yield r.json();throw console.error("Error processing payment:",l),new Error(l.error||`Failed to process payment: ${r.status}`)}const t=yield r.json();return console.log("Process payment response data:",t),t}catch(r){throw console.error("Process payment error:",r),r}}),st=()=>P(this,null,function*(){try{const s=yield fetch(`${D.apiUrl}/api/networks`,{method:"GET",headers:Z()});if(!s.ok){const t=yield s.json();throw new Error(t.error||`Failed to get networks: ${s.status}`)}return yield s.json()}catch(s){throw console.error("Get supported networks error:",s),s}}),nt=()=>P(this,null,function*(){try{const s=yield fetch(`${D.apiUrl}/api/merchants/profile`,{method:"GET",headers:Z()});if(!s.ok){const t=yield s.json();throw new Error(t.error||`Failed to get merchant profile: ${s.status}`)}const r=yield s.json();return r.merchant&&r.merchant.walletAddresses&&(D.merchantWalletAddresses=q(q({},D.merchantWalletAddresses),r.merchant.walletAddresses)),r}catch(s){throw console.error("Get merchant profile error:",s),s}}),ot=(s,r)=>P(this,null,function*(){try{const t=yield fetch(`${D.apiUrl}/api/wallets/validate`,{method:"POST",headers:Z(),body:JSON.stringify({address:s,network:r})});if(!t.ok){const d=yield t.json();throw new Error(d.error||`Failed to validate address: ${t.status}`)}return yield t.json()}catch(t){throw console.error("Validate wallet address error:",t),t}}),at=(s="ethereum")=>{const t={ethereum:"0x",bsc:"0x",tron:"",algorand:""}[s]||"0x",l=Array.from({length:64},()=>Math.floor(Math.random()*16).toString(16)).join("");return`${t}${l}`};var Ne={exports:{}},ne={};/**
|
2
2
|
* @license React
|
3
3
|
* react-jsx-runtime.production.min.js
|
4
4
|
*
|
@@ -6,36 +6,13 @@
|
|
6
6
|
*
|
7
7
|
* This source code is licensed under the MIT license found in the
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
9
|
-
*/var
|
10
|
-
* @license React
|
11
|
-
* react-jsx-runtime.development.js
|
12
|
-
*
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
14
|
-
*
|
15
|
-
* This source code is licensed under the MIT license found in the
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
17
|
-
*/var Ze;function Ut(){return Ze||(Ze=1,process.env.NODE_ENV!=="production"&&function(){var i=y,o=Symbol.for("react.element"),s=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),h=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),T=Symbol.for("react.provider"),x=Symbol.for("react.context"),t=Symbol.for("react.forward_ref"),n=Symbol.for("react.suspense"),r=Symbol.for("react.suspense_list"),l=Symbol.for("react.memo"),c=Symbol.for("react.lazy"),w=Symbol.for("react.offscreen"),u=Symbol.iterator,p="@@iterator";function v(e){if(e===null||typeof e!="object")return null;var d=u&&e[u]||e[p];return typeof d=="function"?d:null}var A=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function N(e){{for(var d=arguments.length,g=new Array(d>1?d-1:0),b=1;b<d;b++)g[b-1]=arguments[b];E("error",e,g)}}function E(e,d,g){{var b=A.ReactDebugCurrentFrame,O=b.getStackAddendum();O!==""&&(d+="%s",g=g.concat([O]));var I=g.map(function(k){return String(k)});I.unshift("Warning: "+d),Function.prototype.apply.call(console[e],console,I)}}var F=!1,U=!1,ee=!1,ie=!1,C=!1,L;L=Symbol.for("react.module.reference");function le(e){return!!(typeof e=="string"||typeof e=="function"||e===f||e===m||C||e===h||e===n||e===r||ie||e===w||F||U||ee||typeof e=="object"&&e!==null&&(e.$$typeof===c||e.$$typeof===l||e.$$typeof===T||e.$$typeof===x||e.$$typeof===t||e.$$typeof===L||e.getModuleId!==void 0))}function q(e,d,g){var b=e.displayName;if(b)return b;var O=d.displayName||d.name||"";return O!==""?g+"("+O+")":g}function X(e){return e.displayName||"Context"}function $(e){if(e==null)return null;if(typeof e.tag=="number"&&N("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case f:return"Fragment";case s:return"Portal";case m:return"Profiler";case h:return"StrictMode";case n:return"Suspense";case r:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case x:var d=e;return X(d)+".Consumer";case T:var g=e;return X(g._context)+".Provider";case t:return q(e,e.render,"ForwardRef");case l:var b=e.displayName||null;return b!==null?b:$(e.type)||"Memo";case c:{var O=e,I=O._payload,k=O._init;try{return $(k(I))}catch(R){return null}}}return null}var V=Object.assign,_=0,oe,ae,he,ce,te,ye,me;function ve(){}ve.__reactDisabledLog=!0;function B(){{if(_===0){oe=console.log,ae=console.info,he=console.warn,ce=console.error,te=console.group,ye=console.groupCollapsed,me=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ve,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}_++}}function Ve(){{if(_--,_===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:V({},e,{value:oe}),info:V({},e,{value:ae}),warn:V({},e,{value:he}),error:V({},e,{value:ce}),group:V({},e,{value:te}),groupCollapsed:V({},e,{value:ye}),groupEnd:V({},e,{value:me})})}_<0&&N("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var xe=A.ReactCurrentDispatcher,ke;function Ee(e,d,g){{if(ke===void 0)try{throw Error()}catch(O){var b=O.stack.trim().match(/\n( *(at )?)/);ke=b&&b[1]||""}return`
|
18
|
-
`+ke+e}}var Me=!1,be;{var Ge=typeof WeakMap=="function"?WeakMap:Map;be=new Ge}function D(e,d){if(!e||Me)return"";{var g=be.get(e);if(g!==void 0)return g}var b;Me=!0;var O=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var I;I=xe.current,xe.current=null,B();try{if(d){var k=function(){throw Error()};if(Object.defineProperty(k.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(k,[])}catch(Z){b=Z}Reflect.construct(e,[],k)}else{try{k.call()}catch(Z){b=Z}e.call(k.prototype)}}else{try{throw Error()}catch(Z){b=Z}e()}}catch(Z){if(Z&&b&&typeof Z.stack=="string"){for(var R=Z.stack.split(`
|
19
|
-
`),J=b.stack.split(`
|
20
|
-
`),z=R.length-1,Q=J.length-1;z>=1&&Q>=0&&R[z]!==J[Q];)Q--;for(;z>=1&&Q>=0;z--,Q--)if(R[z]!==J[Q]){if(z!==1||Q!==1)do if(z--,Q--,Q<0||R[z]!==J[Q]){var ne=`
|
21
|
-
`+R[z].replace(" at new "," at ");return e.displayName&&ne.includes("<anonymous>")&&(ne=ne.replace("<anonymous>",e.displayName)),typeof e=="function"&&be.set(e,ne),ne}while(z>=1&&Q>=0);break}}}finally{Me=!1,xe.current=I,Ve(),Error.prepareStackTrace=O}var Ce=e?e.displayName||e.name:"",ge=Ce?Ee(Ce):"";return typeof e=="function"&&be.set(e,ge),ge}function G(e,d,g){return D(e,!1)}function re(e){var d=e.prototype;return!!(d&&d.isReactComponent)}function Ne(e,d,g){if(e==null)return"";if(typeof e=="function")return D(e,re(e));if(typeof e=="string")return Ee(e);switch(e){case n:return Ee("Suspense");case r:return Ee("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case t:return G(e.render);case l:return Ne(e.type,d,g);case c:{var b=e,O=b._payload,I=b._init;try{return Ne(I(O),d,g)}catch(k){}}}return""}var ue=Object.prototype.hasOwnProperty,xt={},Et=A.ReactDebugCurrentFrame;function Ue(e){if(e){var d=e._owner,g=Ne(e.type,e._source,d?d.type:null);Et.setExtraStackFrame(g)}else Et.setExtraStackFrame(null)}function gr(e,d,g,b,O){{var I=Function.call.bind(ue);for(var k in e)if(I(e,k)){var R=void 0;try{if(typeof e[k]!="function"){var J=Error((b||"React class")+": "+g+" type `"+k+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[k]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw J.name="Invariant Violation",J}R=e[k](d,k,b,g,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(z){R=z}R&&!(R instanceof Error)&&(Ue(O),N("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",b||"React class",g,k,typeof R),Ue(null)),R instanceof Error&&!(R.message in xt)&&(xt[R.message]=!0,Ue(O),N("Failed %s type: %s",g,R.message),Ue(null))}}}var pr=Array.isArray;function He(e){return pr(e)}function wr(e){{var d=typeof Symbol=="function"&&Symbol.toStringTag,g=d&&e[Symbol.toStringTag]||e.constructor.name||"Object";return g}}function yr(e){try{return bt(e),!1}catch(d){return!0}}function bt(e){return""+e}function Nt(e){if(yr(e))return N("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",wr(e)),bt(e)}var Pe=A.ReactCurrentOwner,vr={key:!0,ref:!0,__self:!0,__source:!0},Tt,Ct,Ke;Ke={};function xr(e){if(ue.call(e,"ref")){var d=Object.getOwnPropertyDescriptor(e,"ref").get;if(d&&d.isReactWarning)return!1}return e.ref!==void 0}function Er(e){if(ue.call(e,"key")){var d=Object.getOwnPropertyDescriptor(e,"key").get;if(d&&d.isReactWarning)return!1}return e.key!==void 0}function br(e,d){if(typeof e.ref=="string"&&Pe.current&&d&&Pe.current.stateNode!==d){var g=$(Pe.current.type);Ke[g]||(N('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',$(Pe.current.type),e.ref),Ke[g]=!0)}}function Nr(e,d){{var g=function(){Tt||(Tt=!0,N("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",d))};g.isReactWarning=!0,Object.defineProperty(e,"key",{get:g,configurable:!0})}}function Tr(e,d){{var g=function(){Ct||(Ct=!0,N("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",d))};g.isReactWarning=!0,Object.defineProperty(e,"ref",{get:g,configurable:!0})}}var Cr=function(e,d,g,b,O,I,k){var R={$$typeof:o,type:e,key:d,ref:g,props:k,_owner:I};return R._store={},Object.defineProperty(R._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(R,"_self",{configurable:!1,enumerable:!1,writable:!1,value:b}),Object.defineProperty(R,"_source",{configurable:!1,enumerable:!1,writable:!1,value:O}),Object.freeze&&(Object.freeze(R.props),Object.freeze(R)),R};function Ar(e,d,g,b,O){{var I,k={},R=null,J=null;g!==void 0&&(Nt(g),R=""+g),Er(d)&&(Nt(d.key),R=""+d.key),xr(d)&&(J=d.ref,br(d,O));for(I in d)ue.call(d,I)&&!vr.hasOwnProperty(I)&&(k[I]=d[I]);if(e&&e.defaultProps){var z=e.defaultProps;for(I in z)k[I]===void 0&&(k[I]=z[I])}if(R||J){var Q=typeof e=="function"?e.displayName||e.name||"Unknown":e;R&&Nr(k,Q),J&&Tr(k,Q)}return Cr(e,R,J,O,b,Pe.current,k)}}var Ye=A.ReactCurrentOwner,At=A.ReactDebugCurrentFrame;function Te(e){if(e){var d=e._owner,g=Ne(e.type,e._source,d?d.type:null);At.setExtraStackFrame(g)}else At.setExtraStackFrame(null)}var qe;qe=!1;function $e(e){return typeof e=="object"&&e!==null&&e.$$typeof===o}function St(){{if(Ye.current){var e=$(Ye.current.type);if(e)return`
|
22
|
-
|
23
|
-
Check the render method of \``+e+"`."}return""}}function Sr(e){{if(e!==void 0){var d=e.fileName.replace(/^.*[\\\/]/,""),g=e.lineNumber;return`
|
24
|
-
|
25
|
-
Check your code at `+d+":"+g+"."}return""}}var jt={};function jr(e){{var d=St();if(!d){var g=typeof e=="string"?e:e.displayName||e.name;g&&(d=`
|
26
|
-
|
27
|
-
Check the top-level render call using <`+g+">.")}return d}}function Rt(e,d){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var g=jr(d);if(jt[g])return;jt[g]=!0;var b="";e&&e._owner&&e._owner!==Ye.current&&(b=" It was passed a child from "+$(e._owner.type)+"."),Te(e),N('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',g,b),Te(null)}}function kt(e,d){{if(typeof e!="object")return;if(He(e))for(var g=0;g<e.length;g++){var b=e[g];$e(b)&&Rt(b,d)}else if($e(e))e._store&&(e._store.validated=!0);else if(e){var O=v(e);if(typeof O=="function"&&O!==e.entries)for(var I=O.call(e),k;!(k=I.next()).done;)$e(k.value)&&Rt(k.value,d)}}}function Rr(e){{var d=e.type;if(d==null||typeof d=="string")return;var g;if(typeof d=="function")g=d.propTypes;else if(typeof d=="object"&&(d.$$typeof===t||d.$$typeof===l))g=d.propTypes;else return;if(g){var b=$(d);gr(g,e.props,"prop",b,e)}else if(d.PropTypes!==void 0&&!qe){qe=!0;var O=$(d);N("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",O||"Unknown")}typeof d.getDefaultProps=="function"&&!d.getDefaultProps.isReactClassApproved&&N("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function kr(e){{for(var d=Object.keys(e.props),g=0;g<d.length;g++){var b=d[g];if(b!=="children"&&b!=="key"){Te(e),N("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",b),Te(null);break}}e.ref!==null&&(Te(e),N("Invalid attribute `ref` supplied to `React.Fragment`."),Te(null))}}var Mt={};function Pt(e,d,g,b,O,I){{var k=le(e);if(!k){var R="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(R+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var J=Sr(O);J?R+=J:R+=St();var z;e===null?z="null":He(e)?z="array":e!==void 0&&e.$$typeof===o?(z="<"+($(e.type)||"Unknown")+" />",R=" Did you accidentally export a JSX literal instead of a component?"):z=typeof e,N("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",z,R)}var Q=Ar(e,d,g,O,I);if(Q==null)return Q;if(k){var ne=d.children;if(ne!==void 0)if(b)if(He(ne)){for(var Ce=0;Ce<ne.length;Ce++)kt(ne[Ce],e);Object.freeze&&Object.freeze(ne)}else N("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else kt(ne,e)}if(ue.call(d,"key")){var ge=$(e),Z=Object.keys(d).filter(function(Ir){return Ir!=="key"}),Je=Z.length>0?"{key: someKey, "+Z.join(": ..., ")+": ...}":"{key: someKey}";if(!Mt[ge+Je]){var Dr=Z.length>0?"{"+Z.join(": ..., ")+": ...}":"{}";N(`A props object containing a "key" prop is being spread into JSX:
|
28
|
-
let props = %s;
|
29
|
-
<%s {...props} />
|
30
|
-
React keys must be passed directly to JSX without using spread:
|
31
|
-
let props = %s;
|
32
|
-
<%s key={someKey} {...props} />`,Je,ge,Dr,ge),Mt[ge+Je]=!0}}return e===f?kr(Q):Rr(Q),Q}}function Mr(e,d,g){return Pt(e,d,g,!0)}function Pr(e,d,g){return Pt(e,d,g,!1)}var Or=Pr,Lr=Mr;Re.Fragment=f,Re.jsx=Or,Re.jsxs=Lr}()),Re}process.env.NODE_ENV==="production"?_e.exports=Ft():_e.exports=Ut();var a=_e.exports;const et=y.createContext(),_t=()=>y.useContext(et),Wt=({initialTheme:i="light",children:o})=>{const[s,f]=y.useState(i),h=()=>{f(m=>m==="light"?"dark":"light")};return y.useEffect(()=>{document.documentElement.classList.remove("light","dark"),document.documentElement.classList.add(s)},[s]),a.jsx(et.Provider,{value:{theme:s,setTheme:f,toggleTheme:h},children:o})},tt=y.createContext(),Bt=()=>y.useContext(tt),zt=({apiKey:i,apiSecret:o,apiUrl:s="http://localhost:9000",merchantWalletAddress:f=null,merchantSolWalletAddress:h=null,debug:m=!1,children:T})=>{const[x,t]=y.useState(!1),[n,r]=y.useState(null),[l,c]=y.useState(null);y.useEffect(()=>{if(!i||!o){r("API key and secret are required");return}try{Oe({apiKey:i,apiSecret:o,apiUrl:s,merchantWalletAddress:f,merchantSolWalletAddress:h}),t(!0),m&&console.log("Coinley SDK initialized with:",{apiKey:i,apiUrl:s,merchantWalletAddress:f?`${f.substring(0,6)}...${f.substring(f.length-4)}`:"Not provided",merchantSolWalletAddress:h?`${h.substring(0,6)}...${h.substring(h.length-4)}`:"Not provided"})}catch(p){r(p.message),m&&console.error("Coinley SDK initialization error:",p)}},[i,o,s,f,h,m]);const u={apiKey:i,apiSecret:o,apiUrl:s,merchantWalletAddress:f,merchantSolWalletAddress:h,isInitialized:x,error:n,debug:m,paymentData:l,storePaymentData:p=>(c(p),p)};return a.jsx(tt.Provider,{value:u,children:T})};var Qt=Object.defineProperty,De=Object.getOwnPropertySymbols,rt=Object.prototype.hasOwnProperty,nt=Object.prototype.propertyIsEnumerable,st=(i,o,s)=>o in i?Qt(i,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[o]=s,We=(i,o)=>{for(var s in o||(o={}))rt.call(o,s)&&st(i,s,o[s]);if(De)for(var s of De(o))nt.call(o,s)&&st(i,s,o[s]);return i},Be=(i,o)=>{var s={};for(var f in i)rt.call(i,f)&&o.indexOf(f)<0&&(s[f]=i[f]);if(i!=null&&De)for(var f of De(i))o.indexOf(f)<0&&nt.call(i,f)&&(s[f]=i[f]);return s};/**
|
9
|
+
*/var it=f,lt=Symbol.for("react.element"),ct=Symbol.for("react.fragment"),dt=Object.prototype.hasOwnProperty,ut=it.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ht={key:!0,ref:!0,__self:!0,__source:!0};function Ee(s,r,t){var l,d={},u=null,v=null;t!==void 0&&(u=""+t),r.key!==void 0&&(u=""+r.key),r.ref!==void 0&&(v=r.ref);for(l in r)dt.call(r,l)&&!ht.hasOwnProperty(l)&&(d[l]=r[l]);if(s&&s.defaultProps)for(l in r=s.defaultProps,r)d[l]===void 0&&(d[l]=r[l]);return{$$typeof:lt,type:s,key:u,ref:v,props:d,_owner:ut.current}}ne.Fragment=ct,ne.jsx=Ee,ne.jsxs=Ee,Ne.exports=ne;var n=Ne.exports;const ve=f.createContext(),mt=()=>f.useContext(ve),ft=({initialTheme:s="light",children:r})=>{const[t,l]=f.useState(s),d=()=>{l(u=>u==="light"?"dark":"light")};return f.useEffect(()=>{document.documentElement.classList.remove("light","dark"),document.documentElement.classList.add(t)},[t]),n.jsx(ve.Provider,{value:{theme:t,setTheme:l,toggleTheme:d},children:r})},Te=f.createContext(),ke=()=>f.useContext(Te),gt=({apiKey:s,apiSecret:r,apiUrl:t="http://localhost:9000",merchantWalletAddress:l=null,merchantSolWalletAddress:d=null,debug:u=!1,children:v})=>{const[y,e]=f.useState(!1),[o,a]=f.useState(null),[i,c]=f.useState(null);f.useEffect(()=>{if(!s||!r){a("API key and secret are required");return}try{tt({apiKey:s,apiSecret:r,apiUrl:t,merchantWalletAddress:l,merchantSolWalletAddress:d}),e(!0),u&&console.log("Coinley SDK initialized with:",{apiKey:s,apiUrl:t,merchantWalletAddress:l?`${l.substring(0,6)}...${l.substring(l.length-4)}`:"Not provided",merchantSolWalletAddress:d?`${d.substring(0,6)}...${d.substring(d.length-4)}`:"Not provided"})}catch(m){a(m.message),u&&console.error("Coinley SDK initialization error:",m)}},[s,r,t,l,d,u]);const h={apiKey:s,apiSecret:r,apiUrl:t,merchantWalletAddress:l,merchantSolWalletAddress:d,isInitialized:y,error:o,debug:u,paymentData:i,storePaymentData:m=>(c(m),m)};return n.jsx(Te.Provider,{value:h,children:v})};var wt=Object.defineProperty,oe=Object.getOwnPropertySymbols,Ae=Object.prototype.hasOwnProperty,Ce=Object.prototype.propertyIsEnumerable,je=(s,r,t)=>r in s?wt(s,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[r]=t,de=(s,r)=>{for(var t in r||(r={}))Ae.call(r,t)&&je(s,t,r[t]);if(oe)for(var t of oe(r))Ce.call(r,t)&&je(s,t,r[t]);return s},ue=(s,r)=>{var t={};for(var l in s)Ae.call(s,l)&&r.indexOf(l)<0&&(t[l]=s[l]);if(s!=null&&oe)for(var l of oe(s))r.indexOf(l)<0&&Ce.call(s,l)&&(t[l]=s[l]);return t};/**
|
33
10
|
* @license QR Code generator library (TypeScript)
|
34
11
|
* Copyright (c) Project Nayuki.
|
35
12
|
* SPDX-License-Identifier: MIT
|
36
|
-
*/var fe;(i=>{const o=class j{constructor(t,n,r,l){if(this.version=t,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],t<j.MIN_VERSION||t>j.MAX_VERSION)throw new RangeError("Version value out of range");if(l<-1||l>7)throw new RangeError("Mask value out of range");this.size=t*4+17;let c=[];for(let u=0;u<this.size;u++)c.push(!1);for(let u=0;u<this.size;u++)this.modules.push(c.slice()),this.isFunction.push(c.slice());this.drawFunctionPatterns();const w=this.addEccAndInterleave(r);if(this.drawCodewords(w),l==-1){let u=1e9;for(let p=0;p<8;p++){this.applyMask(p),this.drawFormatBits(p);const v=this.getPenaltyScore();v<u&&(l=p,u=v),this.applyMask(p)}}h(0<=l&&l<=7),this.mask=l,this.applyMask(l),this.drawFormatBits(l),this.isFunction=[]}static encodeText(t,n){const r=i.QrSegment.makeSegments(t);return j.encodeSegments(r,n)}static encodeBinary(t,n){const r=i.QrSegment.makeBytes(t);return j.encodeSegments([r],n)}static encodeSegments(t,n,r=1,l=40,c=-1,w=!0){if(!(j.MIN_VERSION<=r&&r<=l&&l<=j.MAX_VERSION)||c<-1||c>7)throw new RangeError("Invalid value");let u,p;for(u=r;;u++){const E=j.getNumDataCodewords(u,n)*8,F=T.getTotalBits(t,u);if(F<=E){p=F;break}if(u>=l)throw new RangeError("Data too long")}for(const E of[j.Ecc.MEDIUM,j.Ecc.QUARTILE,j.Ecc.HIGH])w&&p<=j.getNumDataCodewords(u,E)*8&&(n=E);let v=[];for(const E of t){s(E.mode.modeBits,4,v),s(E.numChars,E.mode.numCharCountBits(u),v);for(const F of E.getData())v.push(F)}h(v.length==p);const A=j.getNumDataCodewords(u,n)*8;h(v.length<=A),s(0,Math.min(4,A-v.length),v),s(0,(8-v.length%8)%8,v),h(v.length%8==0);for(let E=236;v.length<A;E^=253)s(E,8,v);let N=[];for(;N.length*8<v.length;)N.push(0);return v.forEach((E,F)=>N[F>>>3]|=E<<7-(F&7)),new j(u,n,N,c)}getModule(t,n){return 0<=t&&t<this.size&&0<=n&&n<this.size&&this.modules[n][t]}getModules(){return this.modules}drawFunctionPatterns(){for(let r=0;r<this.size;r++)this.setFunctionModule(6,r,r%2==0),this.setFunctionModule(r,6,r%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const t=this.getAlignmentPatternPositions(),n=t.length;for(let r=0;r<n;r++)for(let l=0;l<n;l++)r==0&&l==0||r==0&&l==n-1||r==n-1&&l==0||this.drawAlignmentPattern(t[r],t[l]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(t){const n=this.errorCorrectionLevel.formatBits<<3|t;let r=n;for(let c=0;c<10;c++)r=r<<1^(r>>>9)*1335;const l=(n<<10|r)^21522;h(l>>>15==0);for(let c=0;c<=5;c++)this.setFunctionModule(8,c,f(l,c));this.setFunctionModule(8,7,f(l,6)),this.setFunctionModule(8,8,f(l,7)),this.setFunctionModule(7,8,f(l,8));for(let c=9;c<15;c++)this.setFunctionModule(14-c,8,f(l,c));for(let c=0;c<8;c++)this.setFunctionModule(this.size-1-c,8,f(l,c));for(let c=8;c<15;c++)this.setFunctionModule(8,this.size-15+c,f(l,c));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let t=this.version;for(let r=0;r<12;r++)t=t<<1^(t>>>11)*7973;const n=this.version<<12|t;h(n>>>18==0);for(let r=0;r<18;r++){const l=f(n,r),c=this.size-11+r%3,w=Math.floor(r/3);this.setFunctionModule(c,w,l),this.setFunctionModule(w,c,l)}}drawFinderPattern(t,n){for(let r=-4;r<=4;r++)for(let l=-4;l<=4;l++){const c=Math.max(Math.abs(l),Math.abs(r)),w=t+l,u=n+r;0<=w&&w<this.size&&0<=u&&u<this.size&&this.setFunctionModule(w,u,c!=2&&c!=4)}}drawAlignmentPattern(t,n){for(let r=-2;r<=2;r++)for(let l=-2;l<=2;l++)this.setFunctionModule(t+l,n+r,Math.max(Math.abs(l),Math.abs(r))!=1)}setFunctionModule(t,n,r){this.modules[n][t]=r,this.isFunction[n][t]=!0}addEccAndInterleave(t){const n=this.version,r=this.errorCorrectionLevel;if(t.length!=j.getNumDataCodewords(n,r))throw new RangeError("Invalid argument");const l=j.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][n],c=j.ECC_CODEWORDS_PER_BLOCK[r.ordinal][n],w=Math.floor(j.getNumRawDataModules(n)/8),u=l-w%l,p=Math.floor(w/l);let v=[];const A=j.reedSolomonComputeDivisor(c);for(let E=0,F=0;E<l;E++){let U=t.slice(F,F+p-c+(E<u?0:1));F+=U.length;const ee=j.reedSolomonComputeRemainder(U,A);E<u&&U.push(0),v.push(U.concat(ee))}let N=[];for(let E=0;E<v[0].length;E++)v.forEach((F,U)=>{(E!=p-c||U>=u)&&N.push(F[E])});return h(N.length==w),N}drawCodewords(t){if(t.length!=Math.floor(j.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let n=0;for(let r=this.size-1;r>=1;r-=2){r==6&&(r=5);for(let l=0;l<this.size;l++)for(let c=0;c<2;c++){const w=r-c,p=(r+1&2)==0?this.size-1-l:l;!this.isFunction[p][w]&&n<t.length*8&&(this.modules[p][w]=f(t[n>>>3],7-(n&7)),n++)}}h(n==t.length*8)}applyMask(t){if(t<0||t>7)throw new RangeError("Mask value out of range");for(let n=0;n<this.size;n++)for(let r=0;r<this.size;r++){let l;switch(t){case 0:l=(r+n)%2==0;break;case 1:l=n%2==0;break;case 2:l=r%3==0;break;case 3:l=(r+n)%3==0;break;case 4:l=(Math.floor(r/3)+Math.floor(n/2))%2==0;break;case 5:l=r*n%2+r*n%3==0;break;case 6:l=(r*n%2+r*n%3)%2==0;break;case 7:l=((r+n)%2+r*n%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[n][r]&&l&&(this.modules[n][r]=!this.modules[n][r])}}getPenaltyScore(){let t=0;for(let c=0;c<this.size;c++){let w=!1,u=0,p=[0,0,0,0,0,0,0];for(let v=0;v<this.size;v++)this.modules[c][v]==w?(u++,u==5?t+=j.PENALTY_N1:u>5&&t++):(this.finderPenaltyAddHistory(u,p),w||(t+=this.finderPenaltyCountPatterns(p)*j.PENALTY_N3),w=this.modules[c][v],u=1);t+=this.finderPenaltyTerminateAndCount(w,u,p)*j.PENALTY_N3}for(let c=0;c<this.size;c++){let w=!1,u=0,p=[0,0,0,0,0,0,0];for(let v=0;v<this.size;v++)this.modules[v][c]==w?(u++,u==5?t+=j.PENALTY_N1:u>5&&t++):(this.finderPenaltyAddHistory(u,p),w||(t+=this.finderPenaltyCountPatterns(p)*j.PENALTY_N3),w=this.modules[v][c],u=1);t+=this.finderPenaltyTerminateAndCount(w,u,p)*j.PENALTY_N3}for(let c=0;c<this.size-1;c++)for(let w=0;w<this.size-1;w++){const u=this.modules[c][w];u==this.modules[c][w+1]&&u==this.modules[c+1][w]&&u==this.modules[c+1][w+1]&&(t+=j.PENALTY_N2)}let n=0;for(const c of this.modules)n=c.reduce((w,u)=>w+(u?1:0),n);const r=this.size*this.size,l=Math.ceil(Math.abs(n*20-r*10)/r)-1;return h(0<=l&&l<=9),t+=l*j.PENALTY_N4,h(0<=t&&t<=2568888),t}getAlignmentPatternPositions(){if(this.version==1)return[];{const t=Math.floor(this.version/7)+2,n=this.version==32?26:Math.ceil((this.version*4+4)/(t*2-2))*2;let r=[6];for(let l=this.size-7;r.length<t;l-=n)r.splice(1,0,l);return r}}static getNumRawDataModules(t){if(t<j.MIN_VERSION||t>j.MAX_VERSION)throw new RangeError("Version number out of range");let n=(16*t+128)*t+64;if(t>=2){const r=Math.floor(t/7)+2;n-=(25*r-10)*r-55,t>=7&&(n-=36)}return h(208<=n&&n<=29648),n}static getNumDataCodewords(t,n){return Math.floor(j.getNumRawDataModules(t)/8)-j.ECC_CODEWORDS_PER_BLOCK[n.ordinal][t]*j.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][t]}static reedSolomonComputeDivisor(t){if(t<1||t>255)throw new RangeError("Degree out of range");let n=[];for(let l=0;l<t-1;l++)n.push(0);n.push(1);let r=1;for(let l=0;l<t;l++){for(let c=0;c<n.length;c++)n[c]=j.reedSolomonMultiply(n[c],r),c+1<n.length&&(n[c]^=n[c+1]);r=j.reedSolomonMultiply(r,2)}return n}static reedSolomonComputeRemainder(t,n){let r=n.map(l=>0);for(const l of t){const c=l^r.shift();r.push(0),n.forEach((w,u)=>r[u]^=j.reedSolomonMultiply(w,c))}return r}static reedSolomonMultiply(t,n){if(t>>>8||n>>>8)throw new RangeError("Byte out of range");let r=0;for(let l=7;l>=0;l--)r=r<<1^(r>>>7)*285,r^=(n>>>l&1)*t;return h(r>>>8==0),r}finderPenaltyCountPatterns(t){const n=t[1];h(n<=this.size*3);const r=n>0&&t[2]==n&&t[3]==n*3&&t[4]==n&&t[5]==n;return(r&&t[0]>=n*4&&t[6]>=n?1:0)+(r&&t[6]>=n*4&&t[0]>=n?1:0)}finderPenaltyTerminateAndCount(t,n,r){return t&&(this.finderPenaltyAddHistory(n,r),n=0),n+=this.size,this.finderPenaltyAddHistory(n,r),this.finderPenaltyCountPatterns(r)}finderPenaltyAddHistory(t,n){n[0]==0&&(t+=this.size),n.pop(),n.unshift(t)}};o.MIN_VERSION=1,o.MAX_VERSION=40,o.PENALTY_N1=3,o.PENALTY_N2=3,o.PENALTY_N3=40,o.PENALTY_N4=10,o.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],o.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],i.QrCode=o;function s(x,t,n){if(t<0||t>31||x>>>t)throw new RangeError("Value out of range");for(let r=t-1;r>=0;r--)n.push(x>>>r&1)}function f(x,t){return(x>>>t&1)!=0}function h(x){if(!x)throw new Error("Assertion error")}const m=class W{constructor(t,n,r){if(this.mode=t,this.numChars=n,this.bitData=r,n<0)throw new RangeError("Invalid argument");this.bitData=r.slice()}static makeBytes(t){let n=[];for(const r of t)s(r,8,n);return new W(W.Mode.BYTE,t.length,n)}static makeNumeric(t){if(!W.isNumeric(t))throw new RangeError("String contains non-numeric characters");let n=[];for(let r=0;r<t.length;){const l=Math.min(t.length-r,3);s(parseInt(t.substring(r,r+l),10),l*3+1,n),r+=l}return new W(W.Mode.NUMERIC,t.length,n)}static makeAlphanumeric(t){if(!W.isAlphanumeric(t))throw new RangeError("String contains unencodable characters in alphanumeric mode");let n=[],r;for(r=0;r+2<=t.length;r+=2){let l=W.ALPHANUMERIC_CHARSET.indexOf(t.charAt(r))*45;l+=W.ALPHANUMERIC_CHARSET.indexOf(t.charAt(r+1)),s(l,11,n)}return r<t.length&&s(W.ALPHANUMERIC_CHARSET.indexOf(t.charAt(r)),6,n),new W(W.Mode.ALPHANUMERIC,t.length,n)}static makeSegments(t){return t==""?[]:W.isNumeric(t)?[W.makeNumeric(t)]:W.isAlphanumeric(t)?[W.makeAlphanumeric(t)]:[W.makeBytes(W.toUtf8ByteArray(t))]}static makeEci(t){let n=[];if(t<0)throw new RangeError("ECI assignment value out of range");if(t<128)s(t,8,n);else if(t<16384)s(2,2,n),s(t,14,n);else if(t<1e6)s(6,3,n),s(t,21,n);else throw new RangeError("ECI assignment value out of range");return new W(W.Mode.ECI,0,n)}static isNumeric(t){return W.NUMERIC_REGEX.test(t)}static isAlphanumeric(t){return W.ALPHANUMERIC_REGEX.test(t)}getData(){return this.bitData.slice()}static getTotalBits(t,n){let r=0;for(const l of t){const c=l.mode.numCharCountBits(n);if(l.numChars>=1<<c)return 1/0;r+=4+c+l.bitData.length}return r}static toUtf8ByteArray(t){t=encodeURI(t);let n=[];for(let r=0;r<t.length;r++)t.charAt(r)!="%"?n.push(t.charCodeAt(r)):(n.push(parseInt(t.substring(r+1,r+3),16)),r+=2);return n}};m.NUMERIC_REGEX=/^[0-9]*$/,m.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,m.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let T=m;i.QrSegment=m})(fe||(fe={})),(i=>{(o=>{const s=class{constructor(h,m){this.ordinal=h,this.formatBits=m}};s.LOW=new s(0,1),s.MEDIUM=new s(1,0),s.QUARTILE=new s(2,3),s.HIGH=new s(3,2),o.Ecc=s})(i.QrCode||(i.QrCode={}))})(fe||(fe={})),(i=>{(o=>{const s=class{constructor(h,m){this.modeBits=h,this.numBitsCharCount=m}numCharCountBits(h){return this.numBitsCharCount[Math.floor((h+7)/17)]}};s.NUMERIC=new s(1,[10,12,14]),s.ALPHANUMERIC=new s(2,[9,11,13]),s.BYTE=new s(4,[8,16,16]),s.KANJI=new s(8,[8,10,12]),s.ECI=new s(7,[0,0,0]),o.Mode=s})(i.QrSegment||(i.QrSegment={}))})(fe||(fe={}));var we=fe;/**
|
13
|
+
*/var J;(s=>{const r=class T{constructor(e,o,a,i){if(this.version=e,this.errorCorrectionLevel=o,this.modules=[],this.isFunction=[],e<T.MIN_VERSION||e>T.MAX_VERSION)throw new RangeError("Version value out of range");if(i<-1||i>7)throw new RangeError("Mask value out of range");this.size=e*4+17;let c=[];for(let h=0;h<this.size;h++)c.push(!1);for(let h=0;h<this.size;h++)this.modules.push(c.slice()),this.isFunction.push(c.slice());this.drawFunctionPatterns();const g=this.addEccAndInterleave(a);if(this.drawCodewords(g),i==-1){let h=1e9;for(let m=0;m<8;m++){this.applyMask(m),this.drawFormatBits(m);const w=this.getPenaltyScore();w<h&&(i=m,h=w),this.applyMask(m)}}d(0<=i&&i<=7),this.mask=i,this.applyMask(i),this.drawFormatBits(i),this.isFunction=[]}static encodeText(e,o){const a=s.QrSegment.makeSegments(e);return T.encodeSegments(a,o)}static encodeBinary(e,o){const a=s.QrSegment.makeBytes(e);return T.encodeSegments([a],o)}static encodeSegments(e,o,a=1,i=40,c=-1,g=!0){if(!(T.MIN_VERSION<=a&&a<=i&&i<=T.MAX_VERSION)||c<-1||c>7)throw new RangeError("Invalid value");let h,m;for(h=a;;h++){const x=T.getNumDataCodewords(h,o)*8,C=v.getTotalBits(e,h);if(C<=x){m=C;break}if(h>=i)throw new RangeError("Data too long")}for(const x of[T.Ecc.MEDIUM,T.Ecc.QUARTILE,T.Ecc.HIGH])g&&m<=T.getNumDataCodewords(h,x)*8&&(o=x);let w=[];for(const x of e){t(x.mode.modeBits,4,w),t(x.numChars,x.mode.numCharCountBits(h),w);for(const C of x.getData())w.push(C)}d(w.length==m);const A=T.getNumDataCodewords(h,o)*8;d(w.length<=A),t(0,Math.min(4,A-w.length),w),t(0,(8-w.length%8)%8,w),d(w.length%8==0);for(let x=236;w.length<A;x^=253)t(x,8,w);let p=[];for(;p.length*8<w.length;)p.push(0);return w.forEach((x,C)=>p[C>>>3]|=x<<7-(C&7)),new T(h,o,p,c)}getModule(e,o){return 0<=e&&e<this.size&&0<=o&&o<this.size&&this.modules[o][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let a=0;a<this.size;a++)this.setFunctionModule(6,a,a%2==0),this.setFunctionModule(a,6,a%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const e=this.getAlignmentPatternPositions(),o=e.length;for(let a=0;a<o;a++)for(let i=0;i<o;i++)a==0&&i==0||a==0&&i==o-1||a==o-1&&i==0||this.drawAlignmentPattern(e[a],e[i]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){const o=this.errorCorrectionLevel.formatBits<<3|e;let a=o;for(let c=0;c<10;c++)a=a<<1^(a>>>9)*1335;const i=(o<<10|a)^21522;d(i>>>15==0);for(let c=0;c<=5;c++)this.setFunctionModule(8,c,l(i,c));this.setFunctionModule(8,7,l(i,6)),this.setFunctionModule(8,8,l(i,7)),this.setFunctionModule(7,8,l(i,8));for(let c=9;c<15;c++)this.setFunctionModule(14-c,8,l(i,c));for(let c=0;c<8;c++)this.setFunctionModule(this.size-1-c,8,l(i,c));for(let c=8;c<15;c++)this.setFunctionModule(8,this.size-15+c,l(i,c));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let a=0;a<12;a++)e=e<<1^(e>>>11)*7973;const o=this.version<<12|e;d(o>>>18==0);for(let a=0;a<18;a++){const i=l(o,a),c=this.size-11+a%3,g=Math.floor(a/3);this.setFunctionModule(c,g,i),this.setFunctionModule(g,c,i)}}drawFinderPattern(e,o){for(let a=-4;a<=4;a++)for(let i=-4;i<=4;i++){const c=Math.max(Math.abs(i),Math.abs(a)),g=e+i,h=o+a;0<=g&&g<this.size&&0<=h&&h<this.size&&this.setFunctionModule(g,h,c!=2&&c!=4)}}drawAlignmentPattern(e,o){for(let a=-2;a<=2;a++)for(let i=-2;i<=2;i++)this.setFunctionModule(e+i,o+a,Math.max(Math.abs(i),Math.abs(a))!=1)}setFunctionModule(e,o,a){this.modules[o][e]=a,this.isFunction[o][e]=!0}addEccAndInterleave(e){const o=this.version,a=this.errorCorrectionLevel;if(e.length!=T.getNumDataCodewords(o,a))throw new RangeError("Invalid argument");const i=T.NUM_ERROR_CORRECTION_BLOCKS[a.ordinal][o],c=T.ECC_CODEWORDS_PER_BLOCK[a.ordinal][o],g=Math.floor(T.getNumRawDataModules(o)/8),h=i-g%i,m=Math.floor(g/i);let w=[];const A=T.reedSolomonComputeDivisor(c);for(let x=0,C=0;x<i;x++){let S=e.slice(C,C+m-c+(x<h?0:1));C+=S.length;const V=T.reedSolomonComputeRemainder(S,A);x<h&&S.push(0),w.push(S.concat(V))}let p=[];for(let x=0;x<w[0].length;x++)w.forEach((C,S)=>{(x!=m-c||S>=h)&&p.push(C[x])});return d(p.length==g),p}drawCodewords(e){if(e.length!=Math.floor(T.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let o=0;for(let a=this.size-1;a>=1;a-=2){a==6&&(a=5);for(let i=0;i<this.size;i++)for(let c=0;c<2;c++){const g=a-c,m=(a+1&2)==0?this.size-1-i:i;!this.isFunction[m][g]&&o<e.length*8&&(this.modules[m][g]=l(e[o>>>3],7-(o&7)),o++)}}d(o==e.length*8)}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let o=0;o<this.size;o++)for(let a=0;a<this.size;a++){let i;switch(e){case 0:i=(a+o)%2==0;break;case 1:i=o%2==0;break;case 2:i=a%3==0;break;case 3:i=(a+o)%3==0;break;case 4:i=(Math.floor(a/3)+Math.floor(o/2))%2==0;break;case 5:i=a*o%2+a*o%3==0;break;case 6:i=(a*o%2+a*o%3)%2==0;break;case 7:i=((a+o)%2+a*o%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[o][a]&&i&&(this.modules[o][a]=!this.modules[o][a])}}getPenaltyScore(){let e=0;for(let c=0;c<this.size;c++){let g=!1,h=0,m=[0,0,0,0,0,0,0];for(let w=0;w<this.size;w++)this.modules[c][w]==g?(h++,h==5?e+=T.PENALTY_N1:h>5&&e++):(this.finderPenaltyAddHistory(h,m),g||(e+=this.finderPenaltyCountPatterns(m)*T.PENALTY_N3),g=this.modules[c][w],h=1);e+=this.finderPenaltyTerminateAndCount(g,h,m)*T.PENALTY_N3}for(let c=0;c<this.size;c++){let g=!1,h=0,m=[0,0,0,0,0,0,0];for(let w=0;w<this.size;w++)this.modules[w][c]==g?(h++,h==5?e+=T.PENALTY_N1:h>5&&e++):(this.finderPenaltyAddHistory(h,m),g||(e+=this.finderPenaltyCountPatterns(m)*T.PENALTY_N3),g=this.modules[w][c],h=1);e+=this.finderPenaltyTerminateAndCount(g,h,m)*T.PENALTY_N3}for(let c=0;c<this.size-1;c++)for(let g=0;g<this.size-1;g++){const h=this.modules[c][g];h==this.modules[c][g+1]&&h==this.modules[c+1][g]&&h==this.modules[c+1][g+1]&&(e+=T.PENALTY_N2)}let o=0;for(const c of this.modules)o=c.reduce((g,h)=>g+(h?1:0),o);const a=this.size*this.size,i=Math.ceil(Math.abs(o*20-a*10)/a)-1;return d(0<=i&&i<=9),e+=i*T.PENALTY_N4,d(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(this.version==1)return[];{const e=Math.floor(this.version/7)+2,o=this.version==32?26:Math.ceil((this.version*4+4)/(e*2-2))*2;let a=[6];for(let i=this.size-7;a.length<e;i-=o)a.splice(1,0,i);return a}}static getNumRawDataModules(e){if(e<T.MIN_VERSION||e>T.MAX_VERSION)throw new RangeError("Version number out of range");let o=(16*e+128)*e+64;if(e>=2){const a=Math.floor(e/7)+2;o-=(25*a-10)*a-55,e>=7&&(o-=36)}return d(208<=o&&o<=29648),o}static getNumDataCodewords(e,o){return Math.floor(T.getNumRawDataModules(e)/8)-T.ECC_CODEWORDS_PER_BLOCK[o.ordinal][e]*T.NUM_ERROR_CORRECTION_BLOCKS[o.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw new RangeError("Degree out of range");let o=[];for(let i=0;i<e-1;i++)o.push(0);o.push(1);let a=1;for(let i=0;i<e;i++){for(let c=0;c<o.length;c++)o[c]=T.reedSolomonMultiply(o[c],a),c+1<o.length&&(o[c]^=o[c+1]);a=T.reedSolomonMultiply(a,2)}return o}static reedSolomonComputeRemainder(e,o){let a=o.map(i=>0);for(const i of e){const c=i^a.shift();a.push(0),o.forEach((g,h)=>a[h]^=T.reedSolomonMultiply(g,c))}return a}static reedSolomonMultiply(e,o){if(e>>>8||o>>>8)throw new RangeError("Byte out of range");let a=0;for(let i=7;i>=0;i--)a=a<<1^(a>>>7)*285,a^=(o>>>i&1)*e;return d(a>>>8==0),a}finderPenaltyCountPatterns(e){const o=e[1];d(o<=this.size*3);const a=o>0&&e[2]==o&&e[3]==o*3&&e[4]==o&&e[5]==o;return(a&&e[0]>=o*4&&e[6]>=o?1:0)+(a&&e[6]>=o*4&&e[0]>=o?1:0)}finderPenaltyTerminateAndCount(e,o,a){return e&&(this.finderPenaltyAddHistory(o,a),o=0),o+=this.size,this.finderPenaltyAddHistory(o,a),this.finderPenaltyCountPatterns(a)}finderPenaltyAddHistory(e,o){o[0]==0&&(e+=this.size),o.pop(),o.unshift(e)}};r.MIN_VERSION=1,r.MAX_VERSION=40,r.PENALTY_N1=3,r.PENALTY_N2=3,r.PENALTY_N3=40,r.PENALTY_N4=10,r.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],r.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],s.QrCode=r;function t(y,e,o){if(e<0||e>31||y>>>e)throw new RangeError("Value out of range");for(let a=e-1;a>=0;a--)o.push(y>>>a&1)}function l(y,e){return(y>>>e&1)!=0}function d(y){if(!y)throw new Error("Assertion error")}const u=class M{constructor(e,o,a){if(this.mode=e,this.numChars=o,this.bitData=a,o<0)throw new RangeError("Invalid argument");this.bitData=a.slice()}static makeBytes(e){let o=[];for(const a of e)t(a,8,o);return new M(M.Mode.BYTE,e.length,o)}static makeNumeric(e){if(!M.isNumeric(e))throw new RangeError("String contains non-numeric characters");let o=[];for(let a=0;a<e.length;){const i=Math.min(e.length-a,3);t(parseInt(e.substring(a,a+i),10),i*3+1,o),a+=i}return new M(M.Mode.NUMERIC,e.length,o)}static makeAlphanumeric(e){if(!M.isAlphanumeric(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");let o=[],a;for(a=0;a+2<=e.length;a+=2){let i=M.ALPHANUMERIC_CHARSET.indexOf(e.charAt(a))*45;i+=M.ALPHANUMERIC_CHARSET.indexOf(e.charAt(a+1)),t(i,11,o)}return a<e.length&&t(M.ALPHANUMERIC_CHARSET.indexOf(e.charAt(a)),6,o),new M(M.Mode.ALPHANUMERIC,e.length,o)}static makeSegments(e){return e==""?[]:M.isNumeric(e)?[M.makeNumeric(e)]:M.isAlphanumeric(e)?[M.makeAlphanumeric(e)]:[M.makeBytes(M.toUtf8ByteArray(e))]}static makeEci(e){let o=[];if(e<0)throw new RangeError("ECI assignment value out of range");if(e<128)t(e,8,o);else if(e<16384)t(2,2,o),t(e,14,o);else if(e<1e6)t(6,3,o),t(e,21,o);else throw new RangeError("ECI assignment value out of range");return new M(M.Mode.ECI,0,o)}static isNumeric(e){return M.NUMERIC_REGEX.test(e)}static isAlphanumeric(e){return M.ALPHANUMERIC_REGEX.test(e)}getData(){return this.bitData.slice()}static getTotalBits(e,o){let a=0;for(const i of e){const c=i.mode.numCharCountBits(o);if(i.numChars>=1<<c)return 1/0;a+=4+c+i.bitData.length}return a}static toUtf8ByteArray(e){e=encodeURI(e);let o=[];for(let a=0;a<e.length;a++)e.charAt(a)!="%"?o.push(e.charCodeAt(a)):(o.push(parseInt(e.substring(a+1,a+3),16)),a+=2);return o}};u.NUMERIC_REGEX=/^[0-9]*$/,u.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,u.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let v=u;s.QrSegment=u})(J||(J={})),(s=>{(r=>{const t=class{constructor(d,u){this.ordinal=d,this.formatBits=u}};t.LOW=new t(0,1),t.MEDIUM=new t(1,0),t.QUARTILE=new t(2,3),t.HIGH=new t(3,2),r.Ecc=t})(s.QrCode||(s.QrCode={}))})(J||(J={})),(s=>{(r=>{const t=class{constructor(d,u){this.modeBits=d,this.numBitsCharCount=u}numCharCountBits(d){return this.numBitsCharCount[Math.floor((d+7)/17)]}};t.NUMERIC=new t(1,[10,12,14]),t.ALPHANUMERIC=new t(2,[9,11,13]),t.BYTE=new t(4,[8,16,16]),t.KANJI=new t(8,[8,10,12]),t.ECI=new t(7,[0,0,0]),r.Mode=t})(s.QrSegment||(s.QrSegment={}))})(J||(J={}));var ee=J;/**
|
37
14
|
* @license qrcode.react
|
38
15
|
* Copyright (c) Paul O'Shannessy
|
39
16
|
* SPDX-License-Identifier: ISC
|
40
|
-
*/var Vt={L:we.QrCode.Ecc.LOW,M:we.QrCode.Ecc.MEDIUM,Q:we.QrCode.Ecc.QUARTILE,H:we.QrCode.Ecc.HIGH},at=128,ot="L",it="#FFFFFF",lt="#000000",ct=!1,ut=1,Gt=4,Ht=0,Kt=.1;function dt(i,o=0){const s=[];return i.forEach(function(f,h){let m=null;f.forEach(function(T,x){if(!T&&m!==null){s.push(`M${m+o} ${h+o}h${x-m}v1H${m+o}z`),m=null;return}if(x===f.length-1){if(!T)return;m===null?s.push(`M${x+o},${h+o} h1v1H${x+o}z`):s.push(`M${m+o},${h+o} h${x+1-m}v1H${m+o}z`);return}T&&m===null&&(m=x)})}),s.join("")}function ft(i,o){return i.slice().map((s,f)=>f<o.y||f>=o.y+o.h?s:s.map((h,m)=>m<o.x||m>=o.x+o.w?h:!1))}function Yt(i,o,s,f){if(f==null)return null;const h=i.length+s*2,m=Math.floor(o*Kt),T=h/o,x=(f.width||m)*T,t=(f.height||m)*T,n=f.x==null?i.length/2-x/2:f.x*T,r=f.y==null?i.length/2-t/2:f.y*T,l=f.opacity==null?1:f.opacity;let c=null;if(f.excavate){let u=Math.floor(n),p=Math.floor(r),v=Math.ceil(x+n-u),A=Math.ceil(t+r-p);c={x:u,y:p,w:v,h:A}}const w=f.crossOrigin;return{x:n,y:r,h:t,w:x,excavation:c,opacity:l,crossOrigin:w}}function qt(i,o){return o!=null?Math.max(Math.floor(o),0):i?Gt:Ht}function ht({value:i,level:o,minVersion:s,includeMargin:f,marginSize:h,imageSettings:m,size:T,boostLevel:x}){let t=y.useMemo(()=>{const u=(Array.isArray(i)?i:[i]).reduce((p,v)=>(p.push(...we.QrSegment.makeSegments(v)),p),[]);return we.QrCode.encodeSegments(u,Vt[o],s,void 0,void 0,x)},[i,o,s,x]);const{cells:n,margin:r,numCells:l,calculatedImageSettings:c}=y.useMemo(()=>{let w=t.getModules();const u=qt(f,h),p=w.length+u*2,v=Yt(w,T,u,m);return{cells:w,margin:u,numCells:p,calculatedImageSettings:v}},[t,T,m,f,h]);return{qrcode:t,margin:r,cells:n,numCells:l,calculatedImageSettings:c}}var $t=function(){try{new Path2D().addPath(new Path2D)}catch(i){return!1}return!0}(),Jt=y.forwardRef(function(o,s){const f=o,{value:h,size:m=at,level:T=ot,bgColor:x=it,fgColor:t=lt,includeMargin:n=ct,minVersion:r=ut,boostLevel:l,marginSize:c,imageSettings:w}=f,p=Be(f,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:v}=p,A=Be(p,["style"]),N=w==null?void 0:w.src,E=y.useRef(null),F=y.useRef(null),U=y.useCallback(V=>{E.current=V,typeof s=="function"?s(V):s&&(s.current=V)},[s]),[ee,ie]=y.useState(!1),{margin:C,cells:L,numCells:le,calculatedImageSettings:q}=ht({value:h,level:T,minVersion:r,boostLevel:l,includeMargin:n,marginSize:c,imageSettings:w,size:m});y.useEffect(()=>{if(E.current!=null){const V=E.current,_=V.getContext("2d");if(!_)return;let oe=L;const ae=F.current,he=q!=null&&ae!==null&&ae.complete&&ae.naturalHeight!==0&&ae.naturalWidth!==0;he&&q.excavation!=null&&(oe=ft(L,q.excavation));const ce=window.devicePixelRatio||1;V.height=V.width=m*ce;const te=m/le*ce;_.scale(te,te),_.fillStyle=x,_.fillRect(0,0,le,le),_.fillStyle=t,$t?_.fill(new Path2D(dt(oe,C))):L.forEach(function(ye,me){ye.forEach(function(ve,B){ve&&_.fillRect(B+C,me+C,1,1)})}),q&&(_.globalAlpha=q.opacity),he&&_.drawImage(ae,q.x+C,q.y+C,q.w,q.h)}}),y.useEffect(()=>{ie(!1)},[N]);const X=We({height:m,width:m},v);let $=null;return N!=null&&($=y.createElement("img",{src:N,key:N,style:{display:"none"},onLoad:()=>{ie(!0)},ref:F,crossOrigin:q==null?void 0:q.crossOrigin})),y.createElement(y.Fragment,null,y.createElement("canvas",We({style:X,height:m,width:m,ref:U,role:"img"},A)),$)});Jt.displayName="QRCodeCanvas";var mt=y.forwardRef(function(o,s){const f=o,{value:h,size:m=at,level:T=ot,bgColor:x=it,fgColor:t=lt,includeMargin:n=ct,minVersion:r=ut,boostLevel:l,title:c,marginSize:w,imageSettings:u}=f,p=Be(f,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:v,cells:A,numCells:N,calculatedImageSettings:E}=ht({value:h,level:T,minVersion:r,boostLevel:l,includeMargin:n,marginSize:w,imageSettings:u,size:m});let F=A,U=null;u!=null&&E!=null&&(E.excavation!=null&&(F=ft(A,E.excavation)),U=y.createElement("image",{href:u.src,height:E.h,width:E.w,x:E.x+v,y:E.y+v,preserveAspectRatio:"none",opacity:E.opacity,crossOrigin:E.crossOrigin}));const ee=dt(F,v);return y.createElement("svg",We({height:m,width:m,viewBox:`0 0 ${N} ${N}`,ref:s,role:"img"},p),!!c&&y.createElement("title",null,c),y.createElement("path",{fill:x,d:`M0,0 h${N}v${N}H0z`,shapeRendering:"crispEdges"}),y.createElement("path",{fill:t,d:ee,shapeRendering:"crispEdges"}),U)});mt.displayName="QRCodeSVG";const Xt=({walletAddress:i,amount:o,currency:s,theme:f="light",size:h=200})=>{const[m,T]=y.useState(""),[x,t]=y.useState(null);y.useEffect(()=>{if(!i){t("No wallet address provided");return}try{let c;s==="SOL"||s==="USDC_SOL"?c=`solana:${i}?amount=${o}&spl-token=USDC`:s==="USDT"||s==="USDC"?c=`ethereum:${n(s)}/transfer?address=${i}&uint256=${r(o,s)}`:c=`ethereum:${i}@1?value=${l(o)}`,T(c),t(null)}catch(c){console.error("Error generating QR code:",c),t("Error generating payment QR code")}},[i,o,s]);const n=c=>({USDT:"0xdAC17F958D2ee523a2206206994597C13D831ec7",USDC:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",BNB:"0xB8c77482e45F1F44dE1745F52C74426C631bDD52"})[c]||"",r=(c,w)=>{const u=w==="USDT"||w==="USDC"?6:18;return Math.floor(parseFloat(c)*Math.pow(10,u)).toString()},l=c=>Math.floor(parseFloat(c)*1e18).toString();return a.jsxs("div",{className:"flex flex-col items-center",children:[x?a.jsx("div",{className:"p-4 rounded-lg bg-red-100 mb-3 text-red-700",children:x}):a.jsx("div",{className:"p-4 rounded-lg bg-white mb-3",children:m&&a.jsx(mt,{value:m,size:h,bgColor:f==="dark"?"#374151":"#FFFFFF",fgColor:f==="dark"?"#FFFFFF":"#000000",level:"H",includeMargin:!0})}),a.jsxs("div",{className:"text-center text-sm text-gray-700",children:[a.jsx("p",{className:"font-semibold text-gray-800",children:"Pay with QR Code"}),"Scan with your wallet app to pay"]}),a.jsx("div",{className:"mt-3 w-full"}),a.jsx("div",{className:"mt-4 w-full",children:a.jsxs("div",{className:"p-3 rounded bg-gray-100",children:[a.jsx("h4",{className:"text-sm font-medium mb-2 text-gray-800",children:"Payment Instructions"}),a.jsxs("ol",{className:"text-xs space-y-2 text-gray-600",children:[a.jsx("li",{children:"1. Open your crypto wallet app (MetaMask, Trust Wallet, etc.)"}),a.jsx("li",{children:"2. Scan the QR code above"}),a.jsxs("li",{children:["3. Confirm the payment amount (",o," ",s,")"]}),a.jsx("li",{children:'4. Click "Pay Now" button below after sending the payment'})]})]})})]})},Ie=({status:i,message:o,theme:s="light"})=>{const f=()=>{switch(i){case"processing":return a.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-4 border-t-blue-500 border-blue-500/20"});case"success":return a.jsx("div",{className:"rounded-full h-12 w-12 bg-green-100 flex items-center justify-center",children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8 text-green-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})});case"error":return a.jsx("div",{className:"rounded-full h-12 w-12 bg-red-100 flex items-center justify-center",children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8 text-red-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})});default:return null}},h=()=>{switch(i){case"processing":return"Processing Payment";case"success":return"Payment Successful";case"error":return"Payment Failed";default:return"Unknown Status"}},m=()=>{switch(i){case"processing":return s==="dark"?"text-blue-300":"text-blue-600";case"success":return s==="dark"?"text-green-300":"text-green-600";case"error":return s==="dark"?"text-red-300":"text-red-600";default:return s==="dark"?"text-gray-300":"text-gray-600"}};return a.jsxs("div",{className:"flex flex-col items-center justify-center py-6",children:[a.jsx("div",{className:"mb-4",children:f()}),a.jsx("h3",{className:`text-xl font-bold mb-2 ${s==="dark"?"text-white":"text-gray-900"}`,children:h()}),a.jsx("p",{className:`text-center ${m()}`,children:o}),i==="processing"&&a.jsx("div",{className:`mt-4 text-xs ${s==="dark"?"text-gray-400":"text-gray-500"}`,children:"This may take a few moments. Please do not close this window."}),i==="success"&&a.jsx("div",{className:`mt-4 p-2 rounded ${s==="dark"?"bg-gray-700":"bg-gray-100"}`,children:a.jsx("p",{className:`text-xs ${s==="dark"?"text-gray-300":"text-gray-600"}`,children:"Your payment has been successfully processed. You will receive a confirmation shortly."})})]})},M={ETHEREUM:"ethereum",BSC:"bsc",TRON:"tron",ALGORAND:"algorand"},S={METAMASK:"metamask",TRONLINK:"tronlink",TRUST_WALLET:"trust_wallet",LUTE:"lute"},ze={[M.ETHEREUM]:{chainId:"0x1",chainName:"Ethereum Mainnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:["https://mainnet.infura.io/v3/"],blockExplorerUrls:["https://etherscan.io/"],supportedWallets:[S.METAMASK,S.TRUST_WALLET]},[M.BSC]:{chainId:"0x38",chainName:"BNB Smart Chain",nativeCurrency:{name:"BNB",symbol:"BNB",decimals:18},rpcUrls:["https://bsc-dataseed.binance.org/"],blockExplorerUrls:["https://bscscan.com/"],supportedWallets:[S.METAMASK,S.TRUST_WALLET]},[M.TRON]:{fullHost:"https://api.trongrid.io",explorerUrl:"https://tronscan.org",supportedWallets:[S.TRONLINK]},[M.ALGORAND]:{network:"mainnet",explorerUrl:"https://algoexplorer.io",supportedWallets:[S.LUTE]}},Zt={USDT:{[M.ETHEREUM]:{address:"0xdAC17F958D2ee523a2206206994597C13D831ec7",decimals:6},[M.BSC]:{address:"0x55d398326f99059fF775485246999027B3197955",decimals:18},[M.TRON]:{address:"TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",decimals:6}},USDC:{[M.ETHEREUM]:{address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",decimals:6},[M.BSC]:{address:"0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",decimals:18},[M.TRON]:{address:"TEkxiTehnzSmSe2XqrBj4w32RUN966rdz8",decimals:6}},ALGO:{[M.ALGORAND]:{address:"native",decimals:6}}};let Fe=null;const er=()=>H(this,null,function*(){if(Fe)return Fe;try{const i=yield import("web3");return Fe=i.default||i,Fe}catch(i){throw console.error("Failed to import Web3:",i),new Error("Web3 is required for EVM transactions. Please install web3 package.")}}),Qe=()=>{const i={[S.METAMASK]:!1,[S.TRUST_WALLET]:!1,[S.TRONLINK]:!1,[S.LUTE]:!1};return typeof window!="undefined"&&(i[S.METAMASK]=!!(window.ethereum&&window.ethereum.isMetaMask),i[S.TRONLINK]=!!(window.tronWeb&&window.tronWeb.ready),i[S.TRUST_WALLET]=!!(window.ethereum&&window.ethereum.isTrust),i[S.LUTE]=!!(window.algorand&&window.algorand.isLute)),i},gt=i=>{const o=ze[i];if(!o)return[];const s=Qe();return o.supportedWallets.filter(f=>s[f])},tr=(i,o)=>H(this,null,function*(){switch(i){case S.METAMASK:return yield rr(o);case S.TRONLINK:return yield nr();case S.TRUST_WALLET:return yield sr(o);case S.LUTE:return yield ar();default:throw new Error(`Unsupported wallet type: ${i}`)}}),rr=i=>H(this,null,function*(){if(!window.ethereum||!window.ethereum.isMetaMask)throw new Error("MetaMask is not installed");try{const o=yield window.ethereum.request({method:"eth_requestAccounts"}),s=ze[i];return s&&s.chainId&&(yield pt(s)),{address:o[0],network:i,walletType:S.METAMASK}}catch(o){throw new Error(`Failed to connect MetaMask: ${o.message}`)}}),nr=()=>H(this,null,function*(){if(!window.tronWeb)throw new Error("TronLink is not installed");let i=0;for(;!window.tronWeb.ready&&i<10;)yield new Promise(s=>setTimeout(s,1e3)),i++;if(!window.tronWeb.ready)throw new Error("Please unlock your TronLink wallet");const o=window.tronWeb.defaultAddress.base58;if(!o)throw new Error("No account found in TronLink");return{address:o,network:M.TRON,walletType:S.TRONLINK}}),sr=i=>H(this,null,function*(){if(!window.ethereum||!window.ethereum.isTrust)throw new Error("Trust Wallet is not installed");try{const o=yield window.ethereum.request({method:"eth_requestAccounts"}),s=ze[i];return s&&s.chainId&&(yield pt(s)),{address:o[0],network:i,walletType:S.TRUST_WALLET}}catch(o){throw new Error(`Failed to connect Trust Wallet: ${o.message}`)}}),ar=()=>H(this,null,function*(){if(!window.algorand||!window.algorand.isLute)throw new Error("Lute wallet is not installed");try{return{address:(yield window.algorand.connect())[0],network:M.ALGORAND,walletType:S.LUTE}}catch(i){throw new Error(`Failed to connect Lute wallet: ${i.message}`)}}),pt=i=>H(this,null,function*(){try{yield window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:i.chainId}]})}catch(o){if(o.code===4902)yield window.ethereum.request({method:"wallet_addEthereumChain",params:[i]});else throw o}}),or=(i,o)=>H(this,null,function*(){const{walletType:s,network:f,address:h}=i,{to:m,amount:T,tokenAddress:x,tokenDecimals:t}=o;switch(s){case S.METAMASK:case S.TRUST_WALLET:return yield ir(h,m,T,x,t);case S.TRONLINK:return yield lr(m,T,x,t);case S.LUTE:return yield cr(h,m,T);default:throw new Error(`Unsupported wallet type: ${s}`)}}),ir=(i,o,s,f,h)=>H(this,null,function*(){const m=yield er();if(!window.ethereum)throw new Error("No Ethereum provider found");const T=new m(window.ethereum),x=T.utils.toBN(Math.floor(parseFloat(s)*Math.pow(10,h||18)));if(f&&f!=="native"){const t=[{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}];return(yield new T.eth.Contract(t,f).methods.transfer(o,x).send({from:i})).transactionHash}else return(yield T.eth.sendTransaction({from:i,to:o,value:x})).transactionHash}),lr=(i,o,s,f)=>H(this,null,function*(){if(!window.tronWeb||!window.tronWeb.ready)throw new Error("TronLink is not ready");const h=Math.floor(parseFloat(o)*Math.pow(10,f||6));return s&&s!=="native"?yield(yield window.tronWeb.contract().at(s)).transfer(i,h).send({feeLimit:1e8,callValue:0}):(yield window.tronWeb.trx.sendTransaction(i,h)).txid}),cr=(i,o,s)=>H(this,null,function*(){if(!window.algorand)throw new Error("Lute wallet is not available");const f=Math.floor(parseFloat(s)*1e6),h={from:i,to:o,amount:f,type:"pay"},m=yield window.algorand.signTransaction(h);return(yield window.algorand.sendTransaction(m)).txId}),ur=i=>({[S.METAMASK]:"https://metamask.io/",[S.TRONLINK]:"https://www.tronlink.org/",[S.TRUST_WALLET]:"https://trustwallet.com/",[S.LUTE]:"https://lute.app/"})[i]||"",wt=({onSelect:i,selected:o,theme:s="light",supportedNetworks:f=[]})=>{const[h,m]=y.useState({}),[T,x]=y.useState(M.ETHEREUM);y.useEffect(()=>{m(Qe())},[]);const t=[{id:"USDT",name:"USDT",description:"Tether USD",logo:"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSj0euZAOXsLTJFQxgiKzlX7z8xbfBk-7kmJA&s",networks:[M.ETHEREUM,M.BSC,M.TRON]},{id:"USDC",name:"USDC",description:"USD Coin",logo:"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ43MuDqq54iD1ZCRL_uthAPkfwSSL-J5qI_Q&s",networks:[M.ETHEREUM,M.BSC,M.TRON]},{id:"BNB",name:"BNB",description:"Binance Coin",logo:"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRHSjyW2sSnBhwztCwVW97i1BtV40g7heMMxg&s",networks:[M.BSC]},{id:"ETH",name:"ETH",description:"Ethereum",logo:"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTcyJyRKN0dRJWVZqoLzYgkRHdJsxKGq8nHUw&s",networks:[M.ETHEREUM]},{id:"TRX",name:"TRX",description:"Tron",logo:"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQKLpLNsGRHbZfCUXAjZLPSp_YFZvX5dMnAoA&s",networks:[M.TRON]},{id:"ALGO",name:"ALGO",description:"Algorand",logo:"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR0Yx1Vp8qPQI5XZoJuKfQS8bj_FNiMZGCHqA&s",networks:[M.ALGORAND]}],n=t.filter(u=>f.length===0?!0:u.networks.some(p=>f.includes(p))),r=u=>{const p=t.find(v=>v.id===u);return p?p.networks:[]},l=u=>({[M.ETHEREUM]:"Ethereum",[M.BSC]:"BSC",[M.TRON]:"Tron",[M.ALGORAND]:"Algorand"})[u]||u,c=u=>gt(u).length>0,w=(u,p)=>{var v;x(p),i({currency:u,network:p,tokenConfig:(v=Zt[u])==null?void 0:v[p]})};return a.jsxs("div",{children:[a.jsx("h3",{className:`text-lg font-medium mb-3 ${s==="dark"?"text-white":"text-gray-800"}`,children:"Select Payment Method"}),a.jsx("div",{className:"space-y-3",children:n.map(u=>{const p=r(u.id),v=(o==null?void 0:o.currency)===u.id;return a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:`flex items-center p-3 rounded-lg border-2 transition-colors ${v?s==="dark"?"bg-blue-900/30 border-[#7042D2]":"bg-blue-50 border-[#7042D2]":s==="dark"?"bg-gray-700 border-gray-700":"bg-white border-gray-200"}`,children:[a.jsx("div",{className:"flex-shrink-0 h-10 w-10 bg-white rounded-full flex items-center justify-center mr-3",children:a.jsx("img",{src:u.logo,alt:u.name,className:"h-6 w-6"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:`font-medium ${s==="dark"?"text-white":"text-gray-900"}`,children:u.name}),a.jsx("p",{className:`text-sm ${s==="dark"?"text-gray-300":"text-gray-500"}`,children:u.description})]})]}),p.length>1&&a.jsxs("div",{className:"ml-4 space-y-2",children:[a.jsx("p",{className:`text-sm font-medium ${s==="dark"?"text-gray-300":"text-gray-700"}`,children:"Select Network:"}),a.jsx("div",{className:"grid grid-cols-2 gap-2",children:p.map(A=>{const N=v&&(o==null?void 0:o.network)===A,E=c(A);return a.jsx("button",{onClick:()=>w(u.id,A),disabled:!E,className:`p-2 rounded-md text-sm font-medium transition-colors ${N?"bg-[#7042D2] text-white":E?s==="dark"?"bg-gray-600 text-gray-200 hover:bg-gray-500":"bg-gray-100 text-gray-700 hover:bg-gray-200":s==="dark"?"bg-gray-800 text-gray-500 cursor-not-allowed":"bg-gray-50 text-gray-400 cursor-not-allowed"}`,children:a.jsxs("div",{className:"flex items-center justify-center space-x-1",children:[a.jsx("span",{children:l(A)}),!E&&a.jsx("span",{className:"text-xs",children:"(No wallet)"})]})},A)})})]}),p.length===1&&a.jsx("div",{className:"ml-4",children:a.jsx("button",{onClick:()=>w(u.id,p[0]),disabled:!c(p[0]),className:`w-full p-2 rounded-md text-sm font-medium transition-colors ${v?"bg-[#7042D2] text-white":c(p[0])?s==="dark"?"bg-gray-600 text-gray-200 hover:bg-gray-500":"bg-gray-100 text-gray-700 hover:bg-gray-200":s==="dark"?"bg-gray-800 text-gray-500 cursor-not-allowed":"bg-gray-50 text-gray-400 cursor-not-allowed"}`,children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{children:l(p[0])}),!c(p[0])&&a.jsx("span",{className:"text-xs",children:"No wallet detected"}),v&&a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:a.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})})]})})})]},u.id)})}),a.jsxs("div",{className:"mt-4 p-3 rounded-lg bg-gray-50 dark:bg-gray-800",children:[a.jsx("h4",{className:`text-sm font-medium mb-2 ${s==="dark"?"text-white":"text-gray-800"}`,children:"Detected Wallets:"}),a.jsx("div",{className:"space-y-1",children:Object.entries(h).map(([u,p])=>a.jsxs("div",{className:"flex items-center justify-between text-xs",children:[a.jsx("span",{className:`capitalize ${s==="dark"?"text-gray-300":"text-gray-600"}`,children:u.replace("_"," ")}),a.jsx("span",{className:`px-2 py-1 rounded-full ${p?"bg-green-100 text-green-800":"bg-red-100 text-red-800"}`,children:p?"Available":"Not detected"})]},u))})]})]})},dr="data:image/png;base64,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",yt=({isOpen:i,onClose:o,payment:s,paymentStatus:f,selectedPaymentMethod:h,onPaymentMethodSelect:m,onPayment:T,onBack:x,error:t,theme:n="light",merchantName:r,transactionHash:l,walletConnection:c,onConnectWallet:w,testMode:u=!1,supportedNetworks:p=[],availableWallets:v={},supportedWallets:A=[],step:N="select-currency"})=>{const E=C=>parseFloat(C).toFixed(2),F=C=>C?C.length<=14?C:`${C.slice(0,8)}...${C.slice(-6)}`:"",U=C=>({ethereum:"Ethereum",bsc:"BSC",tron:"Tron",algorand:"Algorand"})[C]||C,ee=C=>({[S.METAMASK]:"MetaMask",[S.TRONLINK]:"TronLink",[S.TRUST_WALLET]:"Trust Wallet",[S.LUTE]:"Lute Wallet"})[C]||C,ie=C=>({[S.METAMASK]:"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT3ymr3UNKopfI0NmUY95Dr-0589vG-91KuAA&s",[S.TRONLINK]:"https://www.tronlink.org/images/logo.png",[S.TRUST_WALLET]:"https://trustwallet.com/assets/images/trust_logotype.svg",[S.LUTE]:"https://lute.app/logo.png"})[C]||"";return i?a.jsx("div",{className:"fixed inset-0 z-50 overflow-y-auto bg-black/50",children:a.jsx("div",{className:"flex min-h-screen items-center justify-center p-4",children:a.jsxs("div",{className:"relative p-6 w-full max-w-md mx-auto rounded-lg shadow-xl bg-white text-gray-800",children:[a.jsxs("div",{className:"flex justify-between items-center mb-6 bg-[#F1ECFB] p-3 rounded-xl",children:[a.jsx("div",{className:"flex items-center",children:a.jsx("h2",{className:"text-xl font-bold text-gray-900",children:a.jsx("img",{src:dr,className:"w-32",alt:"Coinley Logo"})})}),a.jsx("button",{onClick:o,className:"text-gray-500 hover:text-gray-700 focus:outline-none",children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),a.jsxs("div",{className:"mb-6 bg-[#F1ECFB] p-3 rounded-xl",children:[s&&a.jsxs("div",{className:"mb-6 p-4 rounded-lg",children:[a.jsxs("p",{className:"text-lg text-gray-800 font-semibold",children:["PAY: ",r]}),a.jsxs("div",{className:"flex justify-between items-center mt-2 bg-gray-100 px-3 rounded-lg",children:[a.jsx("span",{className:"font-medium text-gray-700",children:"Amount:"}),a.jsxs("span",{className:"font-bold text-xl text-[#7042D2]",children:["$",E(s.totalAmount||s.amount)]})]}),a.jsx("div",{className:"text-xs mt-1 text-right",children:a.jsxs("span",{className:"text-gray-500",children:["Payment ID: ",s.id?s.id.slice(0,8):"","..."]})})]}),N==="select-currency"&&a.jsx(wt,{onSelect:m,selected:h,theme:n,supportedNetworks:p}),N==="confirm"&&h&&s&&a.jsxs("div",{children:[a.jsxs("div",{className:"p-4 rounded-lg mb-4 bg-gray-100",children:[a.jsx("h3",{className:"text-lg font-medium mb-2 text-gray-800",children:"Payment Details"}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-[#7042D2] font-semibold",children:"Currency:"}),a.jsx("span",{className:"font-medium",children:h.currency})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-[#7042D2] font-semibold",children:"Network:"}),a.jsx("span",{className:"font-medium",children:U(h.network)})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-[#7042D2] font-semibold",children:"Fee:"}),a.jsx("span",{className:"font-medium",children:"1.75%"})]})]})]}),u?a.jsx("div",{className:"p-4 rounded-lg mb-4 bg-blue-50",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"bg-[#7042D2] rounded-full p-2 mr-3",children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})})}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-medium text-gray-800",children:"Test Mode Payment"}),a.jsx("p",{className:"text-sm text-gray-600",children:'Click "Pay Now" to simulate a successful payment'})]})]})}):a.jsxs("div",{className:"space-y-3",children:[a.jsx("h4",{className:"font-medium text-gray-800",children:"Select Wallet:"}),A.length===0?a.jsx("div",{className:"p-4 rounded-lg bg-yellow-50",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6 text-yellow-500 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-medium text-gray-800",children:"No Compatible Wallets"}),a.jsxs("p",{className:"text-sm text-gray-600",children:["No wallets detected for ",U(h.network)," network"]})]})]})}):A.map(C=>a.jsx("div",{className:"p-4 rounded-lg bg-blue-50",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx("img",{src:ie(C),alt:ee(C),className:"w-8 h-8 mr-2",onError:L=>{L.target.style.display="none"}}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-medium text-gray-800",children:ee(C)}),a.jsxs("p",{className:"text-sm text-gray-600",children:["Pay with ",ee(C)]})]})]}),(c==null?void 0:c.walletType)===C?a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),a.jsx("span",{className:"text-sm text-green-600",children:"Connected"})]}):a.jsx("button",{onClick:()=>w(C),className:"py-2 px-4 bg-[#7042D2] hover:bg-[#7042D2] text-white font-medium rounded-md",children:"Connect"})]})},C)),a.jsx("div",{className:"space-y-2",children:Object.entries(v).filter(([C,L])=>!L).map(([C])=>a.jsx("div",{className:"p-3 rounded-lg bg-gray-50",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("span",{className:"text-sm text-gray-600",children:[ee(C)," not detected"]}),a.jsx("a",{href:ur(C),target:"_blank",rel:"noopener noreferrer",className:"text-sm text-[#7042D2] hover:underline",children:"Install"})]})},C))})]}),a.jsxs("div",{className:"mt-6 grid grid-cols-2 gap-3",children:[a.jsx("button",{type:"button",onClick:x,className:"w-full py-2 px-4 bg-gray-200 hover:bg-gray-300 text-[#7042D2] font-medium rounded-md",children:"Back"}),a.jsx("button",{type:"button",onClick:T,className:"w-full py-2 px-4 bg-[#7042D2] hover:bg-[#7042D2] text-white font-medium rounded-md",disabled:!u&&!c,children:"Pay Now"})]})]}),N==="processing"&&a.jsx(Ie,{status:"processing",theme:n,message:"Processing your payment..."}),N==="success"&&a.jsxs("div",{children:[a.jsx(Ie,{status:"success",theme:n,message:"Payment successful!"}),l&&a.jsxs("div",{className:"mt-4 p-3 rounded-lg bg-gray-100",children:[a.jsx("p",{className:"text-xs text-gray-600 mb-1",children:"Transaction Hash:"}),a.jsx("p",{className:"text-sm font-mono break-all text-gray-800",children:F(l)}),h&&a.jsx("a",{href:`${fr(h.network)}/tx/${l}`,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-[#7042D2] mt-2 inline-block",children:"View on Explorer →"})]})]}),N==="error"&&a.jsxs("div",{children:[a.jsx(Ie,{status:"error",theme:n,message:t||"An error occurred while processing your payment."}),a.jsx("button",{type:"button",onClick:x,className:"mt-4 w-full py-2 px-4 bg-gray-200 hover:bg-gray-300 text-gray-800 font-medium rounded-md",children:"Try Again"})]})]}),a.jsx("div",{className:"text-center text-xs text-gray-500",children:a.jsxs("p",{children:["Powered by ",a.jsx("span",{className:"text-[#7042D2]",children:"Coinley"})," - Secure Cryptocurrency Payments"]})})]})})}):null},fr=i=>({ethereum:"https://etherscan.io",bsc:"https://bscscan.com",tron:"https://tronscan.org",algorand:"https://algoexplorer.io"})[i]||"https://etherscan.io",vt=y.forwardRef(({apiKey:i,apiSecret:o,apiUrl:s,customerEmail:f,merchantName:h="Merchant",merchantWalletAddresses:m={},onSuccess:T,onError:x,onClose:t,theme:n,autoOpen:r=!1,debug:l=!1,testMode:c=!1,supportedNetworks:w=[],preferredNetwork:u=M.ETHEREUM,preferredWallet:p=S.METAMASK},v)=>{const A=Bt(),{theme:N}=_t(),[E,F]=y.useState(r),[U,ee]=y.useState(null),[ie,C]=y.useState("idle"),[L,le]=y.useState(null),[q,X]=y.useState(null),[$,V]=y.useState(null),[_,oe]=y.useState(null),[ae,he]=y.useState({}),[ce,te]=y.useState("select-currency");i||(A==null||A.apiKey),o||(A==null||A.apiSecret),s||(A==null||A.apiUrl);const ye=n||N,me=l||(A==null?void 0:A.debug),ve=w.length>0?w:[M.ETHEREUM,M.BSC,M.TRON,M.ALGORAND];y.useImperativeHandle(v,()=>({open:D=>{Ve(D)},close:()=>{xe()},getPayment:()=>U,getWalletConnection:()=>_}));const B=(D,G)=>{me&&console.log(`[Coinley SDK] ${D}`,G)};y.useEffect(()=>{if(typeof window!="undefined"){const D=Qe();he(D),B("Available wallets detected:",D)}},[me]);const Ve=D=>H(this,null,function*(){if(!D||!D.amount){X("Payment amount is required"),x&&x(new Error("Payment amount is required"));return}C("loading"),F(!0),te("select-currency");try{B("Creating payment with details:",D);const G=yield Le({amount:D.amount,currency:D.currency||"USDT",network:D.network||u,customerEmail:D.customerEmail||f,callbackUrl:D.callbackUrl,metadata:D.metadata||{},merchantWalletAddresses:de(de({},m),D.merchantWalletAddresses)});B("Payment created:",G),ee(G.payment),C("idle"),X(null),B("Payment created and state updated")}catch(G){B("Error creating payment:",G),X(G.message||"Failed to create payment"),C("error"),x&&x(G)}}),xe=()=>{F(!1),V(null),oe(null),le(null),te("select-currency"),t&&t()},ke=D=>{B("Payment method selected:",D),le(D),te("confirm")},Ee=()=>{ce==="confirm"&&(te("select-currency"),oe(null))},Me=D=>H(this,null,function*(){if(!L){X("Please select a payment method first");return}try{B("Connecting wallet:",{walletType:D,network:L.network});const G=yield tr(D,L.network);oe(G),X(null),B("Wallet connected successfully:",G)}catch(G){B("Wallet connection error:",G),X(G.message||"Failed to connect wallet")}}),be=()=>H(this,null,function*(){var D,G;if(!U||!L){X("Missing payment information");return}if(!_&&!c){X("Please connect your wallet first");return}B("Starting payment process..."),C("loading"),V(null);try{let re;if(c)B("Test mode: Generating mock transaction..."),re=`test_${Date.now().toString(16)}_${Math.random().toString(16).substring(2,10)}`;else{const ue=m[L.network];if(!ue)throw new Error(`No merchant wallet address configured for ${L.network}`);B("Sending transaction through wallet..."),re=yield or(_,{to:ue,amount:U.amount,tokenAddress:(D=L.tokenConfig)==null?void 0:D.address,tokenDecimals:(G=L.tokenConfig)==null?void 0:G.decimals})}B("Transaction hash:",re),V(re),B("Processing payment with backend...");const Ne=yield se({paymentId:U.id,transactionHash:re,network:L.network,currency:L.currency,senderAddress:_==null?void 0:_.address});B("Payment processed successfully:",Ne),C("success"),te("success"),T&&(B("Calling onSuccess callback..."),T(U.id,re,{network:L.network,currency:L.currency,amount:U.amount}))}catch(re){B("Payment error:",re),X(re.message||"Failed to process payment"),C("error"),te("error"),x&&x(re)}}),Ge=()=>L?gt(L.network):[];return a.jsx(a.Fragment,{children:E&&a.jsx(yt,{isOpen:E,onClose:xe,payment:U,paymentStatus:ie,selectedPaymentMethod:L,onPaymentMethodSelect:ke,onPayment:be,onBack:Ee,error:q,theme:ye,merchantName:h,transactionHash:$,walletConnection:_,onConnectWallet:Me,testMode:c,supportedNetworks:ve,availableWallets:ae,supportedWallets:Ge(),step:ce})})});vt.displayName="CoinleyCheckout";const hr={apiUrl:"https://coinleyserver-production.up.railway.app",debug:!1,testMode:!1,theme:"light"},mr="0.3.0";P.CoinleyCheckout=vt,P.CoinleyModal=yt,P.CoinleyProvider=zt,P.DEFAULT_CONFIG=hr,P.PaymentMethods=wt,P.PaymentStatus=Ie,P.QRCode=Xt,P.ThemeProvider=Wt,P.VERSION=mr,P.connectWallet=It,P.createPayment=Le,P.getPayment=Se,P.isMetaMaskInstalled=pe,P.processPayment=se,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})});
|
17
|
+
*/var pt={L:ee.QrCode.Ecc.LOW,M:ee.QrCode.Ecc.MEDIUM,Q:ee.QrCode.Ecc.QUARTILE,H:ee.QrCode.Ecc.HIGH},Se=128,Me="L",Le="#FFFFFF",Pe="#000000",Re=!1,De=1,xt=4,yt=0,bt=.1;function Ue(s,r=0){const t=[];return s.forEach(function(l,d){let u=null;l.forEach(function(v,y){if(!v&&u!==null){t.push(`M${u+r} ${d+r}h${y-u}v1H${u+r}z`),u=null;return}if(y===l.length-1){if(!v)return;u===null?t.push(`M${y+r},${d+r} h1v1H${y+r}z`):t.push(`M${u+r},${d+r} h${y+1-u}v1H${u+r}z`);return}v&&u===null&&(u=y)})}),t.join("")}function Oe(s,r){return s.slice().map((t,l)=>l<r.y||l>=r.y+r.h?t:t.map((d,u)=>u<r.x||u>=r.x+r.w?d:!1))}function Nt(s,r,t,l){if(l==null)return null;const d=s.length+t*2,u=Math.floor(r*bt),v=d/r,y=(l.width||u)*v,e=(l.height||u)*v,o=l.x==null?s.length/2-y/2:l.x*v,a=l.y==null?s.length/2-e/2:l.y*v,i=l.opacity==null?1:l.opacity;let c=null;if(l.excavate){let h=Math.floor(o),m=Math.floor(a),w=Math.ceil(y+o-h),A=Math.ceil(e+a-m);c={x:h,y:m,w,h:A}}const g=l.crossOrigin;return{x:o,y:a,h:e,w:y,excavation:c,opacity:i,crossOrigin:g}}function Et(s,r){return r!=null?Math.max(Math.floor(r),0):s?xt:yt}function Ie({value:s,level:r,minVersion:t,includeMargin:l,marginSize:d,imageSettings:u,size:v,boostLevel:y}){let e=f.useMemo(()=>{const h=(Array.isArray(s)?s:[s]).reduce((m,w)=>(m.push(...ee.QrSegment.makeSegments(w)),m),[]);return ee.QrCode.encodeSegments(h,pt[r],t,void 0,void 0,y)},[s,r,t,y]);const{cells:o,margin:a,numCells:i,calculatedImageSettings:c}=f.useMemo(()=>{let g=e.getModules();const h=Et(l,d),m=g.length+h*2,w=Nt(g,v,h,u);return{cells:g,margin:h,numCells:m,calculatedImageSettings:w}},[e,v,u,l,d]);return{qrcode:e,margin:a,cells:o,numCells:i,calculatedImageSettings:c}}var vt=function(){try{new Path2D().addPath(new Path2D)}catch(s){return!1}return!0}(),Tt=f.forwardRef(function(r,t){const l=r,{value:d,size:u=Se,level:v=Me,bgColor:y=Le,fgColor:e=Pe,includeMargin:o=Re,minVersion:a=De,boostLevel:i,marginSize:c,imageSettings:g}=l,m=ue(l,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:w}=m,A=ue(m,["style"]),p=g==null?void 0:g.src,x=f.useRef(null),C=f.useRef(null),S=f.useCallback(Q=>{x.current=Q,typeof t=="function"?t(Q):t&&(t.current=Q)},[t]),[V,_]=f.useState(!1),{margin:O,cells:L,numCells:k,calculatedImageSettings:R}=Ie({value:d,level:v,minVersion:a,boostLevel:i,includeMargin:o,marginSize:c,imageSettings:g,size:u});f.useEffect(()=>{if(x.current!=null){const Q=x.current,I=Q.getContext("2d");if(!I)return;let te=L;const Y=C.current,le=R!=null&&Y!==null&&Y.complete&&Y.naturalHeight!==0&&Y.naturalWidth!==0;le&&R.excavation!=null&&(te=Oe(L,R.excavation));const re=window.devicePixelRatio||1;Q.height=Q.width=u*re;const $=u/k*re;I.scale($,$),I.fillStyle=y,I.fillRect(0,0,k,k),I.fillStyle=e,vt?I.fill(new Path2D(Ue(te,O))):L.forEach(function(he,ce){he.forEach(function(me,U){me&&I.fillRect(U+O,ce+O,1,1)})}),R&&(I.globalAlpha=R.opacity),le&&I.drawImage(Y,R.x+O,R.y+O,R.w,R.h)}}),f.useEffect(()=>{_(!1)},[p]);const B=de({height:u,width:u},w);let ie=null;return p!=null&&(ie=f.createElement("img",{src:p,key:p,style:{display:"none"},onLoad:()=>{_(!0)},ref:C,crossOrigin:R==null?void 0:R.crossOrigin})),f.createElement(f.Fragment,null,f.createElement("canvas",de({style:B,height:u,width:u,ref:S,role:"img"},A)),ie)});Tt.displayName="QRCodeCanvas";var Fe=f.forwardRef(function(r,t){const l=r,{value:d,size:u=Se,level:v=Me,bgColor:y=Le,fgColor:e=Pe,includeMargin:o=Re,minVersion:a=De,boostLevel:i,title:c,marginSize:g,imageSettings:h}=l,m=ue(l,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:w,cells:A,numCells:p,calculatedImageSettings:x}=Ie({value:d,level:v,minVersion:a,boostLevel:i,includeMargin:o,marginSize:g,imageSettings:h,size:u});let C=A,S=null;h!=null&&x!=null&&(x.excavation!=null&&(C=Oe(A,x.excavation)),S=f.createElement("image",{href:h.src,height:x.h,width:x.w,x:x.x+w,y:x.y+w,preserveAspectRatio:"none",opacity:x.opacity,crossOrigin:x.crossOrigin}));const V=Ue(C,w);return f.createElement("svg",de({height:u,width:u,viewBox:`0 0 ${p} ${p}`,ref:t,role:"img"},m),!!c&&f.createElement("title",null,c),f.createElement("path",{fill:y,d:`M0,0 h${p}v${p}H0z`,shapeRendering:"crispEdges"}),f.createElement("path",{fill:e,d:V,shapeRendering:"crispEdges"}),S)});Fe.displayName="QRCodeSVG";const We=({walletAddress:s,amount:r,currency:t,network:l,theme:d="light",size:u=200})=>{const[v,y]=f.useState(""),[e,o]=f.useState(null);f.useEffect(()=>{if(!s||s==="No address configured"){o("No wallet address configured for this network");return}try{let m;switch(l){case"tron":t==="TRX"?m=`tronlink://transfer?to=${s}&amount=${r}`:m=s;break;case"algorand":m=`algorand://${s}?amount=${Math.floor(parseFloat(r)*1e6)}`;break;case"bsc":if(t==="BNB")m=`ethereum:${s}@56?value=${c(r)}`;else{const w=a(t,"bsc");w?m=`ethereum:${w}/transfer?address=${s}&uint256=${i(r,t)}@56`:m=s}break;case"ethereum":default:if(t==="ETH")m=`ethereum:${s}@1?value=${c(r)}`;else{const w=a(t,"ethereum");w?m=`ethereum:${w}/transfer?address=${s}&uint256=${i(r,t)}`:m=s}break}y(m),o(null)}catch(m){console.error("Error generating QR code:",m),o("Error generating payment QR code")}},[s,r,t,l]);const a=(m,w)=>{var p;return((p={ethereum:{USDT:"0xdAC17F958D2ee523a2206206994597C13D831ec7",USDC:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},bsc:{USDT:"0x55d398326f99059fF775485246999027B3197955",USDC:"0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"},tron:{USDT:"TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",USDC:"TEkxiTehnzSmSe2XqrBj4w32RUN966rdz8"}}[w])==null?void 0:p[m])||""},i=(m,w)=>{const A=w==="USDT"||w==="USDC"?6:18;return Math.floor(parseFloat(m)*Math.pow(10,A)).toString()},c=m=>Math.floor(parseFloat(m)*1e18).toString(),g=m=>({ethereum:"Ethereum",bsc:"BSC",tron:"Tron",algorand:"Algorand"})[m]||m,h=m=>({ethereum:["MetaMask","Trust Wallet","Coinbase Wallet"],bsc:["MetaMask","Trust Wallet","SafePal"],tron:["TronLink","Trust Wallet"],algorand:["Pera Wallet","MyAlgo Wallet"]})[m]||["MetaMask","Trust Wallet"];return n.jsxs("div",{className:"flex flex-col items-center",children:[e?n.jsxs("div",{className:"p-4 rounded-lg bg-red-100 mb-3 text-red-700 text-center",children:[n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8 mx-auto mb-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),n.jsx("p",{className:"font-medium",children:e})]}):n.jsx("div",{className:"p-4 rounded-lg bg-white mb-3 shadow-sm border",children:v&&n.jsx(Fe,{value:v,size:u,bgColor:d==="dark"?"#374151":"#FFFFFF",fgColor:d==="dark"?"#FFFFFF":"#000000",level:"H",includeMargin:!0})}),n.jsxs("div",{className:"text-center text-sm text-gray-700 mb-4",children:[n.jsxs("p",{className:"font-semibold text-gray-800 flex items-center justify-center",children:[n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v1m6 11h2m-6 0h-2v4m0-11v3m0 0h.01M12 12h4.01M12 12h-4.01M12 12V8.01"})}),"Scan to Pay with ",t]}),n.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:["Scan with your ",g(l)," wallet app"]})]}),n.jsxs("div",{className:"w-full mb-4 p-3 bg-gray-50 rounded-lg",children:[n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Amount to Pay:"}),n.jsxs("span",{className:"text-lg font-bold text-[#7042D2]",children:[r," ",t]})]}),n.jsxs("div",{className:"flex justify-between items-center mt-1",children:[n.jsx("span",{className:"text-xs text-gray-500",children:"Network:"}),n.jsx("span",{className:"text-xs font-medium text-gray-700",children:g(l)})]})]}),!e&&n.jsxs("div",{className:"w-full mb-4",children:[n.jsx("p",{className:"text-xs text-gray-500 mb-1 text-center",children:"Or copy wallet address:"}),n.jsx("div",{className:"text-xs font-mono p-2 rounded bg-gray-100 text-gray-700 break-all text-center select-all cursor-pointer border",onClick:()=>{var m;return(m=navigator.clipboard)==null?void 0:m.writeText(s)},title:"Click to copy",children:s})]}),n.jsx("div",{className:"w-full",children:n.jsxs("div",{className:"p-3 rounded bg-blue-50 border border-blue-200",children:[n.jsxs("h4",{className:"text-sm font-medium mb-2 text-blue-800 flex items-center",children:[n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),"Payment Instructions"]}),n.jsxs("ol",{className:"text-xs space-y-1 text-blue-700",children:[n.jsxs("li",{children:["1. Open your crypto wallet app (",h(l).join(", "),")"]}),n.jsx("li",{children:"2. Scan the QR code above or copy the wallet address"}),n.jsxs("li",{children:["3. Send exactly ",n.jsxs("strong",{children:[r," ",t]})," on ",g(l)," network"]}),n.jsx("li",{children:'4. Click "I have sent the payment" button below after sending'})]}),n.jsx("div",{className:"mt-3 p-2 bg-yellow-50 border border-yellow-200 rounded",children:n.jsxs("p",{className:"text-xs text-yellow-800",children:[n.jsx("strong",{children:"Important:"})," Make sure you're sending on the correct network (",g(l),") and using the exact amount shown above."]})})]})})]})},ae=({status:s,message:r,theme:t="light"})=>{const l=()=>{switch(s){case"processing":return n.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-4 border-t-blue-500 border-blue-500/20"});case"success":return n.jsx("div",{className:"rounded-full h-12 w-12 bg-green-100 flex items-center justify-center",children:n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8 text-green-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})});case"error":return n.jsx("div",{className:"rounded-full h-12 w-12 bg-red-100 flex items-center justify-center",children:n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8 text-red-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})});default:return null}},d=()=>{switch(s){case"processing":return"Processing Payment";case"success":return"Payment Successful";case"error":return"Payment Failed";default:return"Unknown Status"}},u=()=>{switch(s){case"processing":return t==="dark"?"text-blue-300":"text-blue-600";case"success":return t==="dark"?"text-green-300":"text-green-600";case"error":return t==="dark"?"text-red-300":"text-red-600";default:return t==="dark"?"text-gray-300":"text-gray-600"}};return n.jsxs("div",{className:"flex flex-col items-center justify-center py-6",children:[n.jsx("div",{className:"mb-4",children:l()}),n.jsx("h3",{className:`text-xl font-bold mb-2 ${t==="dark"?"text-white":"text-gray-900"}`,children:d()}),n.jsx("p",{className:`text-center ${u()}`,children:r}),s==="processing"&&n.jsx("div",{className:`mt-4 text-xs ${t==="dark"?"text-gray-400":"text-gray-500"}`,children:"This may take a few moments. Please do not close this window."}),s==="success"&&n.jsx("div",{className:`mt-4 p-2 rounded ${t==="dark"?"bg-gray-700":"bg-gray-100"}`,children:n.jsx("p",{className:`text-xs ${t==="dark"?"text-gray-300":"text-gray-600"}`,children:"Your payment has been successfully processed. You will receive a confirmation shortly."})})]})},Be=({onSelect:s,selected:r,theme:t="light",supportedNetworks:l=[]})=>{const[d,u]=f.useState(N.ETHEREUM),[v,y]=f.useState({}),[e,o]=f.useState(!1);f.useEffect(()=>{y(K())},[]);const a=[{id:N.ETHEREUM,name:"Ethereum",description:"ERC-20 tokens"},{id:N.BSC,name:"BSC (Binance Smart Chain)",description:"BEP-20 tokens"},{id:N.TRON,name:"Tron",description:"TRC-20 tokens"},{id:N.ALGORAND,name:"Algorand",description:"ASA tokens"}],i=p=>{const x=[];switch(p){case N.ETHEREUM:x.push({id:"USDT",name:"USDT",description:"Tether USD",logo:"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSj0euZAOXsLTJFQxgiKzlX7z8xbfBk-7kmJA&s",network:N.ETHEREUM},{id:"USDC",name:"USDC",description:"USD Coin",logo:"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ43MuDqq54iD1ZCRL_uthAPkfwSSL-J5qI_Q&s",network:N.ETHEREUM},{id:"ETH",name:"ETH",description:"Ethereum",logo:"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTcyJyRKN0dRJWVZqoLzYgkRHdJsxKGq8nHUw&s",network:N.ETHEREUM});break;case N.BSC:x.push({id:"USDT",name:"USDT",description:"Tether USD",logo:"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSj0euZAOXsLTJFQxgiKzlX7z8xbfBk-7kmJA&s",network:N.BSC},{id:"USDC",name:"USDC",description:"USD Coin",logo:"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ43MuDqq54iD1ZCRL_uthAPkfwSSL-J5qI_Q&s",network:N.BSC},{id:"BNB",name:"BNB",description:"Binance Coin",logo:"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRHSjyW2sSnBhwztCwVW97i1BtV40g7heMMxg&s",network:N.BSC});break;case N.TRON:x.push({id:"USDT",name:"USDT",description:"Tether USD",logo:"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSj0euZAOXsLTJFQxgiKzlX7z8xbfBk-7kmJA&s",network:N.TRON},{id:"USDC",name:"USDC",description:"USD Coin",logo:"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ43MuDqq54iD1ZCRL_uthAPkfwSSL-J5qI_Q&s",network:N.TRON},{id:"TRX",name:"TRX",description:"Tron",logo:"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQKLpLNsGRHbZfCUXAjZLPSp_YFZvX5dMnAoA&s",network:N.TRON});break;case N.ALGORAND:x.push({id:"ALGO",name:"ALGO",description:"Algorand",logo:"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR0Yx1Vp8qPQI5XZoJuKfQS8bj_FNiMZGCHqA&s",network:N.ALGORAND});break}return x},c=p=>{u(p),o(!1),(r==null?void 0:r.network)!==p&&s(null)},g=p=>{var x;s({currency:p.id,network:d,tokenConfig:(x=se[p.id])==null?void 0:x[d],method:p})},h=i(d),m=e?h:h.slice(0,4);return n.jsxs("div",{children:[n.jsx("h3",{className:`text-lg font-medium mb-4 ${t==="dark"?"text-white":"text-gray-800"}`,children:"Select Payment Method"}),n.jsxs("div",{className:"mb-6",children:[n.jsx("label",{className:`block text-sm font-medium mb-2 ${t==="dark"?"text-white":"text-gray-700"}`,children:"Blockchain Network"}),n.jsx("select",{value:d,onChange:p=>c(p.target.value),className:`w-full p-3 rounded-lg border transition-colors ${t==="dark"?"bg-gray-700 border-gray-600 text-white focus:border-[#7042D2]":"bg-white border-gray-300 text-gray-900 focus:border-[#7042D2]"} focus:outline-none focus:ring-2 focus:ring-[#7042D2] focus:ring-opacity-50`,children:a.filter(p=>l.length===0||l.includes(p.id)).map(p=>n.jsxs("option",{value:p.id,children:[p.name," - ",p.description]},p.id))})]}),n.jsxs("div",{className:"mb-4",children:[n.jsx("label",{className:`block text-sm font-medium mb-3 ${t==="dark"?"text-white":"text-gray-700"}`,children:"Choose Cryptocurrency"}),n.jsx("div",{className:"grid grid-cols-2 gap-3 mb-4",children:m.map(p=>n.jsx("button",{onClick:()=>g(p),className:`p-4 rounded-lg transition-all duration-200 border-2 ${(r==null?void 0:r.currency)===p.id&&(r==null?void 0:r.network)===d?t==="dark"?"bg-blue-900/30 border-[#7042D2] ring-2 ring-[#7042D2] ring-opacity-50":"bg-blue-50 border-[#7042D2] ring-2 ring-[#7042D2] ring-opacity-50":t==="dark"?"bg-gray-700 hover:bg-gray-600 border-gray-600 hover:border-gray-500":"bg-white hover:bg-gray-50 border-gray-200 hover:border-gray-300"}`,children:n.jsxs("div",{className:"flex flex-col items-center text-center",children:[n.jsx("div",{className:"flex-shrink-0 h-10 w-10 bg-white rounded-full flex items-center justify-center mb-2 shadow-sm",children:n.jsx("img",{src:p.logo,alt:p.name,className:"h-6 w-6"})}),n.jsxs("div",{children:[n.jsx("h4",{className:`font-medium text-sm ${t==="dark"?"text-white":"text-gray-900"}`,children:p.name}),n.jsx("p",{className:`text-xs ${t==="dark"?"text-gray-300":"text-gray-500"}`,children:p.description})]}),(r==null?void 0:r.currency)===p.id&&(r==null?void 0:r.network)===d&&n.jsx("div",{className:"mt-2",children:n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-[#7042D2]",viewBox:"0 0 20 20",fill:"currentColor",children:n.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})})})]})},`${p.id}-${p.network}`))}),h.length>4&&n.jsx("button",{onClick:()=>o(!e),className:`w-full py-2 px-4 rounded-lg text-sm font-medium transition-colors ${t==="dark"?"bg-gray-700 text-gray-300 hover:bg-gray-600":"bg-gray-100 text-gray-600 hover:bg-gray-200"}`,children:e?"Show Less":`Show More (${h.length-4} more)`})]}),n.jsx("div",{className:`p-3 rounded-lg text-sm ${t==="dark"?"bg-gray-800 text-gray-300":"bg-gray-50 text-gray-600"}`,children:n.jsxs("div",{className:"flex items-center",children:[n.jsx("div",{className:`w-2 h-2 rounded-full mr-2 ${v[w(d)]?"bg-green-500":"bg-red-500"}`}),n.jsx("span",{className:"text-xs",children:A(d)})]})})]});function w(p){switch(p){case N.ETHEREUM:case N.BSC:return"metamask";case N.TRON:return"tronlink";case N.ALGORAND:return"lute";default:return"metamask"}}function A(p){const x=w(p),C=v[x],S={metamask:"MetaMask",tronlink:"TronLink",lute:"Lute Wallet"};return C?`${S[x]} detected - Ready to pay`:`${S[x]} required - Please install to continue`}},kt="data:image/png;base64,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",Qe=({isOpen:s,onClose:r,payment:t,paymentStatus:l,selectedPaymentMethod:d,onPaymentMethodSelect:u,onPayment:v,onBack:y,error:e,theme:o="light",merchantName:a,transactionHash:i,walletConnection:c,onConnectWallet:g,testMode:h=!1,supportedNetworks:m=[],availableWallets:w={},supportedWallets:A=[],step:p="select-currency"})=>{const[x,C]=f.useState("wallet"),S=k=>parseFloat(k).toFixed(2),V=k=>k?k.length<=14?k:`${k.slice(0,8)}...${k.slice(-6)}`:"",_=k=>({ethereum:"Ethereum",bsc:"BSC",tron:"Tron",algorand:"Algorand"})[k]||k,O=k=>({[E.METAMASK]:"MetaMask",[E.TRONLINK]:"TronLink",[E.TRUST_WALLET]:"Trust Wallet",[E.LUTE]:"Lute Wallet"})[k]||k,L=k=>({[E.METAMASK]:"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT3ymr3UNKopfI0NmUY95Dr-0589vG-91KuAA&s",[E.TRONLINK]:"https://www.tronlink.org/images/logo.png",[E.TRUST_WALLET]:"https://trustwallet.com/assets/images/trust_logotype.svg",[E.LUTE]:"https://lute.app/logo.png"})[k]||"";return s?n.jsx("div",{className:"fixed inset-0 z-50 overflow-y-auto bg-black/50",children:n.jsx("div",{className:"flex min-h-screen items-center justify-center p-4",children:n.jsxs("div",{className:"relative p-6 w-full max-w-md mx-auto rounded-lg shadow-xl bg-white text-gray-800",children:[n.jsxs("div",{className:"flex justify-between items-center mb-6 bg-[#F1ECFB] p-3 rounded-xl",children:[n.jsx("div",{className:"flex items-center",children:n.jsx("h2",{className:"text-xl font-bold text-gray-900",children:n.jsx("img",{src:kt,className:"w-32",alt:"Coinley Logo"})})}),n.jsx("button",{onClick:r,className:"text-gray-500 hover:text-gray-700 focus:outline-none",children:n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),n.jsxs("div",{className:"mb-6 bg-[#F1ECFB] p-3 rounded-xl",children:[t&&n.jsxs("div",{className:"mb-6 p-4 rounded-lg",children:[n.jsxs("p",{className:"text-lg text-gray-800 font-semibold",children:["PAY: ",a]}),n.jsxs("div",{className:"flex justify-between items-center mt-2 bg-gray-100 px-3 rounded-lg",children:[n.jsx("span",{className:"font-medium text-gray-700",children:"Amount:"}),n.jsxs("span",{className:"font-bold text-xl text-[#7042D2]",children:["$",S(t.totalAmount||t.amount)]})]}),n.jsx("div",{className:"text-xs mt-1 text-right",children:n.jsxs("span",{className:"text-gray-500",children:["Payment ID: ",t.id?t.id.slice(0,8):"","..."]})})]}),p==="select-currency"&&n.jsxs("div",{children:[n.jsx(Be,{onSelect:u,selected:d,theme:o,supportedNetworks:m}),d&&n.jsx("div",{className:"mt-6",children:n.jsxs("button",{onClick:()=>u(d),className:"w-full py-3 px-4 bg-[#7042D2] hover:bg-[#7042D2] text-white font-medium rounded-lg transition-colors",children:["Proceed with ",d.currency," on ",_(d.network)]})})]}),p==="confirm"&&d&&t&&n.jsxs("div",{children:[n.jsxs("div",{className:"p-4 rounded-lg mb-4 bg-gray-100",children:[n.jsx("h3",{className:"text-lg font-medium mb-2 text-gray-800",children:"Payment Details"}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{className:"flex justify-between",children:[n.jsx("span",{className:"text-[#7042D2] font-semibold",children:"Currency:"}),n.jsx("span",{className:"font-medium",children:d.currency})]}),n.jsxs("div",{className:"flex justify-between",children:[n.jsx("span",{className:"text-[#7042D2] font-semibold",children:"Network:"}),n.jsx("span",{className:"font-medium",children:_(d.network)})]}),n.jsxs("div",{className:"flex justify-between",children:[n.jsx("span",{className:"text-[#7042D2] font-semibold",children:"Fee:"}),n.jsx("span",{className:"font-medium",children:"1.75%"})]})]})]}),n.jsx("div",{className:"mb-4",children:n.jsxs("div",{className:"flex border-b border-gray-200",children:[n.jsx("button",{onClick:()=>C("wallet"),className:`py-2 px-4 text-sm font-medium ${x==="wallet"?"border-b-2 border-[#7042D2] text-[#7042D2]":"text-gray-500 hover:text-gray-700"}`,children:"Connect Wallet"}),n.jsx("button",{onClick:()=>C("qrcode"),className:`py-2 px-4 text-sm font-medium ${x==="qrcode"?"border-b-2 border-[#7042D2] text-[#7042D2]":"text-gray-500 hover:text-gray-700"}`,children:"QR Code"})]})}),h?n.jsx("div",{className:"p-4 rounded-lg mb-4 bg-blue-50",children:n.jsxs("div",{className:"flex items-center",children:[n.jsx("div",{className:"bg-[#7042D2] rounded-full p-2 mr-3",children:n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})})}),n.jsxs("div",{children:[n.jsx("h3",{className:"font-medium text-gray-800",children:"Test Mode Payment"}),n.jsx("p",{className:"text-sm text-gray-600",children:'Click "Pay Now" to simulate a successful payment'})]})]})}):x==="qrcode"?n.jsx("div",{className:"mb-4",children:n.jsx(We,{walletAddress:t.recipientWallet||"No address configured",amount:t.totalAmount||t.amount,currency:d.currency,network:d.network,theme:o})}):n.jsxs("div",{className:"space-y-3 mb-4",children:[A.length===0?n.jsx("div",{className:"p-4 rounded-lg bg-yellow-50",children:n.jsxs("div",{className:"flex items-center",children:[n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6 text-yellow-500 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),n.jsxs("div",{children:[n.jsx("h3",{className:"font-medium text-gray-800",children:"No Compatible Wallets"}),n.jsxs("p",{className:"text-sm text-gray-600",children:["No wallets detected for ",_(d.network)," network"]})]})]})}):A.map(k=>n.jsx("div",{className:"p-4 rounded-lg bg-blue-50",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center",children:[n.jsx("img",{src:L(k),alt:O(k),className:"w-8 h-8 mr-3",onError:R=>{R.target.style.display="none"}}),n.jsxs("div",{children:[n.jsx("h3",{className:"font-medium text-gray-800",children:O(k)}),n.jsxs("p",{className:"text-sm text-gray-600",children:["Pay with ",O(k)]})]})]}),(c==null?void 0:c.walletType)===k?n.jsxs("div",{className:"flex items-center space-x-2",children:[n.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),n.jsx("span",{className:"text-sm text-green-600",children:"Connected"})]}):n.jsx("button",{onClick:()=>g(k),className:"py-2 px-4 bg-[#7042D2] hover:bg-[#7042D2] text-white font-medium rounded-md text-sm",children:"Connect"})]})},k)),n.jsx("div",{className:"space-y-2",children:Object.entries(w).filter(([k,R])=>!R).map(([k])=>n.jsx("div",{className:"p-3 rounded-lg bg-gray-50",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("span",{className:"text-sm text-gray-600",children:[O(k)," not detected"]}),n.jsx("a",{href:xe(k),target:"_blank",rel:"noopener noreferrer",className:"text-sm text-[#7042D2] hover:underline",children:"Install"})]})},k))})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsx("button",{type:"button",onClick:y,className:"w-full py-2 px-4 bg-gray-200 hover:bg-gray-300 text-[#7042D2] font-medium rounded-md",children:"Back"}),n.jsx("button",{type:"button",onClick:()=>v(x==="qrcode"),className:"w-full py-2 px-4 bg-[#7042D2] hover:bg-[#7042D2] text-white font-medium rounded-md",disabled:!h&&x==="wallet"&&!c,children:x==="qrcode"?"I have sent the payment":"Pay Now"})]})]}),p==="processing"&&n.jsx(ae,{status:"processing",theme:o,message:"Processing your payment..."}),p==="success"&&n.jsxs("div",{children:[n.jsx(ae,{status:"success",theme:o,message:"Payment successful!"}),i&&n.jsxs("div",{className:"mt-4 p-3 rounded-lg bg-gray-100",children:[n.jsx("p",{className:"text-xs text-gray-600 mb-1",children:"Transaction Hash:"}),n.jsx("p",{className:"text-sm font-mono break-all text-gray-800",children:V(i)}),d&&n.jsx("a",{href:`${At(d.network)}/${Ct(d.network)}/${i}`,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-[#7042D2] mt-2 inline-block",children:"View on Explorer →"})]})]}),p==="error"&&n.jsxs("div",{children:[n.jsx(ae,{status:"error",theme:o,message:e||"An error occurred while processing your payment."}),n.jsx("button",{type:"button",onClick:y,className:"mt-4 w-full py-2 px-4 bg-gray-200 hover:bg-gray-300 text-gray-800 font-medium rounded-md",children:"Try Again"})]})]}),n.jsx("div",{className:"text-center text-xs text-gray-500",children:n.jsxs("p",{children:["Powered by ",n.jsx("span",{className:"text-[#7042D2]",children:"Coinley"})," - Secure Cryptocurrency Payments"]})})]})})}):null},At=s=>({ethereum:"https://etherscan.io",bsc:"https://bscscan.com",tron:"https://tronscan.org",algorand:"https://algoexplorer.io"})[s]||"https://etherscan.io",Ct=s=>({ethereum:"tx",bsc:"tx",tron:"transaction",algorand:"tx"})[s]||"tx",ze=f.forwardRef(({apiKey:s,apiSecret:r,apiUrl:t,customerEmail:l,merchantName:d="Merchant",merchantWalletAddresses:u={},onSuccess:v,onError:y,onClose:e,theme:o,autoOpen:a=!1,debug:i=!1,testMode:c=!1,supportedNetworks:g=[],preferredNetwork:h=N.ETHEREUM,preferredWallet:m=E.METAMASK},w)=>{const A=ke(),{theme:p}=mt(),[x,C]=f.useState(a),[S,V]=f.useState(null),[_,O]=f.useState("idle"),[L,k]=f.useState(null),[R,B]=f.useState(null),[ie,Q]=f.useState(null),[I,te]=f.useState(null),[Y,le]=f.useState({}),[re,$]=f.useState("select-currency");s||(A==null||A.apiKey),r||(A==null||A.apiSecret),t||(A==null||A.apiUrl);const he=o||p,ce=i||(A==null?void 0:A.debug),me=g.length>0?g:[N.ETHEREUM,N.BSC,N.TRON,N.ALGORAND];f.useImperativeHandle(w,()=>({open:j=>{Mt(j)},close:()=>{Ge()},getPayment:()=>S,getWalletConnection:()=>I}));const U=(j,F)=>{ce&&console.log(`[Coinley SDK] ${j}`,F)};f.useEffect(()=>{if(typeof window!="undefined"){const j=K();le(j),U("Available wallets detected:",j)}},[ce]);const Mt=j=>P(this,null,function*(){if(!j||!j.amount){B("Payment amount is required"),y&&y(new Error("Payment amount is required"));return}O("loading"),C(!0),$("select-currency");try{U("Creating payment with details:",j);const F=yield ye({amount:j.amount,currency:j.currency||"USDT",network:j.network||h,customerEmail:j.customerEmail||l,callbackUrl:j.callbackUrl,metadata:j.metadata||{},merchantWalletAddresses:q(q({},u),j.merchantWalletAddresses)});U("Payment created:",F),V(F.payment),O("idle"),B(null),U("Payment created and state updated")}catch(F){U("Error creating payment:",F),B(F.message||"Failed to create payment"),O("error"),y&&y(F)}}),Ge=()=>{C(!1),Q(null),te(null),k(null),$("select-currency"),e&&e()},Lt=j=>{U("Payment method selected:",j),k(j),$("confirm")},Pt=()=>{re==="confirm"&&($("select-currency"),te(null))},Rt=j=>P(this,null,function*(){if(!L){B("Please select a payment method first");return}try{U("Connecting wallet:",{walletType:j,network:L.network});const F=yield ge(j,L.network);te(F),B(null),U("Wallet connected successfully:",F)}catch(F){U("Wallet connection error:",F),B(F.message||"Failed to connect wallet")}}),Dt=()=>P(this,null,function*(){var j,F;if(!S||!L){B("Missing payment information");return}if(!I&&!c){B("Please connect your wallet first");return}U("Starting payment process..."),O("loading"),Q(null);try{let G;if(c)U("Test mode: Generating mock transaction..."),G=`test_${Date.now().toString(16)}_${Math.random().toString(16).substring(2,10)}`;else{const qe=u[L.network];if(!qe)throw new Error(`No merchant wallet address configured for ${L.network}`);U("Sending transaction through wallet..."),G=yield pe(I,{to:qe,amount:S.amount,tokenAddress:(j=L.tokenConfig)==null?void 0:j.address,tokenDecimals:(F=L.tokenConfig)==null?void 0:F.decimals})}U("Transaction hash:",G),Q(G),U("Processing payment with backend...");const Ot=yield be({paymentId:S.id,transactionHash:G,network:L.network,currency:L.currency,senderAddress:I==null?void 0:I.address});U("Payment processed successfully:",Ot),O("success"),$("success"),v&&(U("Calling onSuccess callback..."),v(S.id,G,{network:L.network,currency:L.currency,amount:S.amount}))}catch(G){U("Payment error:",G),B(G.message||"Failed to process payment"),O("error"),$("error"),y&&y(G)}}),Ut=()=>L?fe(L.network):[];return n.jsx(n.Fragment,{children:x&&n.jsx(Qe,{isOpen:x,onClose:Ge,payment:S,paymentStatus:_,selectedPaymentMethod:L,onPaymentMethodSelect:Lt,onPayment:Dt,onBack:Pt,error:R,theme:he,merchantName:d,transactionHash:ie,walletConnection:I,onConnectWallet:Rt,testMode:c,supportedNetworks:me,availableWallets:Y,supportedWallets:Ut(),step:re})})});ze.displayName="CoinleyCheckout";const jt={apiUrl:"http://localhost:9000",debug:!1,testMode:!1,theme:"light",supportedNetworks:["ethereum","bsc","tron","algorand"]},St="0.3.2";b.CoinleyCheckout=ze,b.CoinleyModal=Qe,b.CoinleyProvider=gt,b.DEFAULT_CONFIG=jt,b.NETWORK_CONFIG=X,b.NETWORK_TYPES=N,b.PaymentMethods=Be,b.PaymentStatus=ae,b.QRCode=We,b.TOKEN_CONFIG=se,b.ThemeProvider=ft,b.VERSION=St,b.WALLET_TYPES=E,b.connectWallet=ge,b.createPayment=ye,b.detectWallets=K,b.generateMockTransactionHash=at,b.getMerchantProfile=nt,b.getPayment=rt,b.getSupportedNetworks=st,b.getSupportedWalletsForNetwork=fe,b.getWalletInstallUrl=xe,b.processPayment=be,b.sendTransaction=pe,b.useCoinley=ke,b.validateWalletAddress=ot,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})});
|
41
18
|
//# sourceMappingURL=coinley-checkout.umd.js.map
|