From b5c8d6a507498c80a1964be4c058c6ab7f86489a Mon Sep 17 00:00:00 2001
From: Halil Beycan <50718965+BeycanDeveloper@users.noreply.github.com>
Date: Fri, 30 Aug 2024 19:31:14 +0800
Subject: [PATCH 1/2] fixed wallet status information messages
---
assets/js/app.min.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/assets/js/app.min.js b/assets/js/app.min.js
index 861788f..b015bad 100644
--- a/assets/js/app.min.js
+++ b/assets/js/app.min.js
@@ -90,7 +90,7 @@ https://sweetalert2.github.io/#ajax-request`),Ope(q),typeof q.title=="string"&&(
${J1(c,u)+" "+t.paymentCurrency.symbol}
${c+" "+t.paymentCurrency.symbol}
- `}else return(t.paymentAmount||0)+" "+t.paymentCurrency.symbol}),r=async c=>{if(t.amount==0)return 0;Tt.setOrderParam("paymentAmount",0);const d=await Tt.get.api.currencyConverter();return await Vt.call("currencyConverter",{paymentCurrency:c,paymentAmount:d}),d?Tt.setOrderParams({paymentAmount:d}):(Tt.setOrderParam("paymentAmount",0),Al(ht.convertingError).then(()=>{Ys(),window.location.reload()})),d};let l=un(t);Se(t,c=>{l&&l.amount!=c.amount&&r(t.paymentCurrency),l=un(c)});const n=c=>{if(Ho.get.amountUpdateInterval)return;const d=setInterval(async()=>{i(t.paymentCurrency)},qt.amountUpdateMin*60*1e3);Ro.log("Start amount updater: ",d,"event: ",c),Ho.set("amountUpdateInterval",d)},a=c=>{if(!Ho.get.amountUpdateInterval)return;const d=Ho.get.amountUpdateInterval;Ro.log("Stop amount updater: ",d,"event: ",c),Ho.stopAmountUpdateInterval()},i=async c=>qt.modal&&!Ho.get.modal?Ro.log("Currency not updated, because modal is not opened"):(Ro.log("Currency updating: ",c),a("interval"),await r(c),n("interval"),!0);return Vt.add("selectedCurrency",({newCurrency:c})=>(Tt.setOrderParams({paymentCurrency:c}),i(c)),"paymentAmount"),Vt.add("paymentReset",()=>{a("paymentReset")},"paymentAmount"),qt.mode=="network"?(Vt.add("walletListOpened",({eventName:c})=>{a(c)},"paymentAmount"),Vt.add("walletListClosed",({eventName:c})=>{n(c)},"paymentAmount")):(Vt.add("walletConnectionRequest",({eventName:c})=>{a(c)},"paymentAmount"),Vt.add("walletPaymentDeclined, walletConnectionDeclined",({eventName:c})=>{n(c)},"paymentAmount")),ft(()=>{n("mounted")}),(c,d)=>(b(),M("div",{class:"payment-amount",innerHTML:o.value},null,8,OC))}}),PC=["data-disabled"],eb=N({__name:"InformationHeader",setup(e){const t=Tt.get.order,o=Tt.get.network,r=C(()=>Ho.get.networks),l=C(()=>{switch(qt.mode){case"network":return r.value.length>1;case"currency":return!0;default:return!0}});return(async()=>{if(window.cpCheckRpc)return;window.cpCheckRpc=!0,await Y1.checkRpcConnection()instanceof Error&&bo(ht.rpcConnectionError).then(()=>{window.location.reload()})})(),(n,a)=>{const i=nt("el-col"),c=nt("el-row");return b(),he(c,{justify:"center",class:"header"},{default:le(()=>[s(t).id?(b(),he(i,{key:0,span:12},{default:le(()=>[Ct($e(s(ht).orderId),1)]),_:1})):se("",!0),s(t).id?(b(),he(i,{key:1,span:12},{default:le(()=>[Ct($e(s(t).id),1)]),_:1})):se("",!0),ee(i,{span:12},{default:le(()=>[Ct($e(s(ht).orderAmount),1)]),_:1}),ee(i,{span:12},{default:le(()=>[Ct($e(s(t).amount)+" "+$e(s(t).currency),1)]),_:1}),ee(i,{span:12},{default:le(()=>[Ct($e(s(ht).amountToBePaid),1)]),_:1}),ee(i,{span:12},{default:le(()=>[ee(NC)]),_:1}),s(o)?(b(),he(i,{key:2,span:12},{default:le(()=>[Ct($e(s(ht).selectedNetwork),1)]),_:1})):se("",!0),s(o)?(b(),he(i,{key:3,span:12},{default:le(()=>[Ct($e(s(o).name)+" ",1),l.value?(b(),M("span",{key:0,onClick:a[0]||(a[0]=d=>s(Tt).$reset()),class:"change-network disable-el","data-disabled":s(Tt).isPaymentAmountUpdating}," ("+$e(s(ht).change)+")",9,PC)):se("",!0)]),_:1})):se("",!0)]),_:1})}}}),RC={class:"currencies"},LC=["onClick","data-disabled"],BC=["src","alt"],VC={class:"name"},DC={key:0,class:"discount"},HC=N({__name:"CurrencyList",setup(e){const t=Ge("container"),o=Tt.get.order,r=Tt.get.network,l=un((r==null?void 0:r.currencies)??[]),n=D(ht.payNow),a=c=>o.paymentCurrency.address==c.address?"selected":"",i=async c=>{Tt.isPaymentAmountUpdating||o.paymentCurrency.symbol==c.symbol||await Vt.call("selectedCurrency",{newCurrency:c,oldCurrency:o==null?void 0:o.paymentCurrency})};return ft(async()=>{let c=setInterval(()=>{var d;if((d=t==null?void 0:t.value)!=null&&d.querySelectorAll){const u=t.value.querySelectorAll(".adapters li");if(u.length==1&&u[0]){clearInterval(c);const p=u[0].querySelector(".name");let h=p==null?void 0:p.getAttribute("data-key"),v=p==null?void 0:p.getAttribute("data-name");h=="web3modal"?n.value=ht.payNow:n.value=ht.payWith.replace("{name}",v||"")}}},1)}),(c,d)=>{const u=nt("el-col"),p=nt("el-row"),h=nt("el-button");return b(),M(Qe,null,[ee(eb),s(l).length>1?(b(),he(p,{key:0},{default:le(()=>[ee(u,{span:24},{default:le(()=>[E("ul",RC,[ee(p,{gutter:20},{default:le(()=>[(b(!0),M(Qe,null,It(s(l),v=>(b(),he(u,{span:12,key:v.address},{default:le(()=>[E("li",{class:O(["disable-el",a(v)]),onClick:m=>i(v),"data-disabled":s(Tt).isPaymentAmountUpdating},[E("span",null,[E("img",{class:"icon",src:s(Xs)(v.symbol),alt:v.symbol},null,8,BC),E("span",VC,$e(v.symbol),1)]),s(qt).discountRates[v.symbol]?(b(),M("span",DC," ("+$e(s(qt).discountRates[v.symbol])+"% "+$e(s(ht).discount)+") ",1)):se("",!0)],10,LC)]),_:2},1024))),128))]),_:1})])]),_:1})]),_:1})):se("",!0),ee(h,{type:"primary",class:"button",disabled:s(Tt).isPaymentAmountUpdating,onClick:d[0]||(d[0]=v=>s(Vt).call("payNow",{order:s(o),network:s(r)}))},{default:le(()=>[Ct($e(n.value),1)]),_:1},8,["disabled"])],64)}}});var tb=(e=>(e.INCOMING="INCOMING",e.OUTGOING="OUTGOING",e))(tb||{}),ki=(e=>(e.GENERAL="GENERAL",e.CONTRACT="CONTRACT",e.COIN="COIN",e.TOKEN="TOKEN",e.NFT="NFT",e))(ki||{}),Ci=(e=>(e.FAILED="FAILED",e.PENDING="PENDING",e.CONFIRMED="CONFIRMED",e))(Ci||{}),Fo=(e=>(e.RPC_TIMEOUT="RPC_TIMEOUT",e.RPC_REQUEST_ERROR="RPC_REQUEST_ERROR",e.RPC_ACCESS_DENIED="RPC_ACCESS_DENIED",e.WS_URL_NOT_DEFINED="WS_URL_NOT_DEFINED",e.WS_CONNECTION_FAILED="WS_CONNECTION_FAILED",e.UNACCEPTED_CHAIN="UNACCEPTED_CHAIN",e.UNAUTHORIZED_ADDRESS="UNAUTHORIZED_ADDRESS",e.INSUFFICIENT_BALANCE="INSUFFICIENT_BALANCE",e.INVALID_AMOUNT="INVALID_AMOUNT",e.INVALID_ADDRESS="INVALID_ADDRESS",e.INVALID_PRIVATE_KEY="INVALID_PRIVATE_KEY",e.INVALID_PUBLIC_KEY="INVALID_PUBLIC_KEY",e.INVALID_TRANSACTION_ID="INVALID_TRANSACTION_ID",e.PROVIDER_IS_REQUIRED="PROVIDER_IS_REQUIRED",e.PROVIDER_IS_NOT_INITIALIZED="PROVIDER_IS_NOT_INITIALIZED",e.PROVIDER_IS_ALREADY_INITIALIZED="PROVIDER_IS_ALREADY_INITIALIZED",e.WALLET_ALREADY_PROCESSING="WALLET_ALREADY_PROCESSING",e.WALLET_CONNECT_REJECTED="WALLET_CONNECT_REJECTED",e.WALLET_REQUEST_REJECTED="WALLET_REQUEST_REJECTED",e.WALLET_CONNECTION_FAILED="WALLET_CONNECTION_FAILED",e.WALLET_CONNECTION_TIMEOUT="WALLET_CONNECTION_TIMEOUT",e.TRANSACTION_CREATION_FAILED="TRANSACTION_CREATION_FAILED",e.TRANSACTION_NOT_FOUND="TRANSACTION_NOT_FOUND",e.CLOSED_WALLETCONNECT_MODAL="CLOSED_WALLETCONNECT_MODAL",e.PROJECT_ID_IS_REQUIRED="PROJECT_ID_IS_REQUIRED",e.METADATA_IS_REQUIRED="METADATA_IS_REQUIRED",e.CONFIG_IS_REQUIRED="CONFIG_IS_REQUIRED",e))(Fo||{}),Zs=(e=>(e.BROWSER="BROWSER",e.MOBILE="MOBILE",e.DESKTOP="DESKTOP",e.UNIVERSAL="UNIVERSAL",e))(Zs||{});ki.GENERAL+"",ki.CONTRACT+"",ki.COIN+"",ki.TOKEN+"",ki.NFT+"";const FC=N({__name:"PaymentRequest",setup(e,{expose:t}){const o=Tt.get.order,r=Tt.get.network,l=Tt.get.receiver,n=D(!1),a=(c,d)=>{c!=Fo.CLOSED_WALLETCONNECT_MODAL&&(c==Fo.TRANSACTION_CREATION_FAILED?bo(ht.transactionCreateFail,ht.pleaseTryAgain):c==Fo.INSUFFICIENT_BALANCE?Al(ht.insufficientBalance):c==Fo.INVALID_AMOUNT?Al(ht.transferAmountError):c==Fo.WALLET_REQUEST_REJECTED||c==Fo.WALLET_CONNECT_REJECTED?Ju(ht.paymentRejected):c==Fo.RPC_ACCESS_DENIED||c.includes("Access forbidden")?bo(ht.rpcAccessForbidden):c==Fo.UNACCEPTED_CHAIN||c==Fo.RPC_REQUEST_ERROR?bo(ht.connectionError,Qu(r)):c==Fo.RPC_TIMEOUT?bo(ht.rpcTimeout):ht[d]?bo(ht[d]):c=="SAME_ADDRESS"?bo(ht.cannotPaySameAddress):bo(ht.anyError))};return t({start:async c=>{var u;n.value=!0,c0(),await Vt.call("walletPaymentRequest",{order:o,wallet:c,network:r});const d=async p=>{Ro.error(p),await Vt.call("walletPaymentDeclined",{order:o,wallet:c,network:r}),n.value=!1,a(typeof p=="string"?p:p.message)};try{let p;(u=o.paymentCurrency)!=null&&u.address?p=new Un.assets.Token(o.paymentCurrency.address):p=new Un.assets.Coin;const h=await c.getAddress();if(Ro.log("sender: ",h),h.toLowerCase()==l.toLowerCase())throw new Error("SAME_ADDRESS");const v=await p.transfer(h,l,o.paymentAmount);c.sendTransaction(v).then(async m=>{await Vt.call("walletPaymentApproved",{order:o,wallet:c,network:r}),n.value=!1,Tt.setTransactionHash(m)}).catch(d).finally(()=>{Gs(),xi(c)})}catch(p){d(p),Gs(),xi(c)}}}),(c,d)=>{const u=nt("cp-loading"),p=nt("cp-modal");return n.value?(b(),he(p,{key:0,title:s(ht).waitingApproval},{default:le(()=>[ee(u)]),_:1},8,["title"])):se("",!0)}}}),jC={class:"icon-wrapper"},KC=["src","alt"],UC=["data-key","data-name"],WC={class:"status"},qC={key:0},YC={key:1,class:"detected"},GC={key:2,class:"download"},XC={key:3,class:"onlyDesktop"},ZC={key:4,class:"openInApp"},JC={key:5,class:"openInAppManual"},QC=N({__name:"WalletAdapterList",emits:["statusChanged"],setup(e,{emit:t}){const o=Tt.get.order,r=Un.browser.Wallet,l=Tt.get.network,n=D(!1),a=D(0),i=D({}),c=D(!1),d=D(!1),u=D(["currency"].includes(qt.mode)),p=t;p("statusChanged",u.value),Se(u,R=>{p("statusChanged",R)});const h=D(null),v=D(null),m=C(()=>n.value?ht.connectionWallet:ht.selectWallet);Vt.add("payNow",()=>{f()},"walletList");const f=async()=>{var R,P;u.value=!0,Vt.call("walletListOpened",{network:l,order:o}),Object.values(i.value).length==1&&((P=(R=v.value)==null?void 0:R.listContent.querySelector("li"))==null||P.click())},_=()=>{Tt.isPaymentAmountUpdating||n.value||g()},g=()=>{u.value=!1,clearTimeout(a.value),Vt.call("walletListClosed",{network:l,order:o})};Vt.add("paymentReset",()=>{clearTimeout(a.value)},"walletList");const y=async R=>{const P={true:1,universal:2,false:3},L=await Promise.all(Object.keys(R).map(async B=>{const V=R[B],J=V.platforms.includes(Zs.UNIVERSAL)?"universal":await V.isDetected();return{key:B,isDetected:J}}));return L.sort((B,V)=>P[B.isDetected]-P[V.isDetected]),L.map(B=>B.key)},w=async()=>{let R=G1(qt.wallets);return R=(await y(R)).reduce((L,B)=>(L[B]=R[B],L),{}),u0()&&Object.values(R).forEach(async L=>{if(await L.isDetected())return R={},R[L.id]=L,!0}),R},x=()=>{clearTimeout(a.value),a.value=setTimeout(()=>{n.value=!1,bo(ht.walletConnectionTimedOut)},30*1e3)},$=R=>R==Fo.CLOSED_WALLETCONNECT_MODAL?!1:R.indexOf("Connection request reset. Please try again.")===-1;Vt.add("walletConnectionDeclined, walletPaymentDeclined",({wallet:R})=>{qt.mode=="network"?Object.values(i.value).length>1?f():g():f(),n.value=!1,clearTimeout(a.value),xi(R),d.value=!1},"walletList"),Vt.add("walletPaymentApproved",()=>{c.value=!0},"walletList");const T=async R=>{if(!r)return bo(ht.notFoundAnyWallet);const P=new r(R);if(await xi(P),P.isDetected()===!1)return yi()?P.getPlatforms().includes(Zs.MOBILE)?P.adapter.createDeepLink?(Al(ht.openInAppMsg),window.open(P.createDeepLink(window.location.origin),"_blank")):Al(ht.openInAppManualMsg):Al(ht.onlyDesktopMsg):P.getDownloadLink()?(window.open(P.getDownloadLink(),"_blank"),Al(ht.downloadMsg)):Al(ht.downloadManualMsg);await Vt.call("walletConnectionRequest",{network:l,order:o,wallet:P}),["walletconnect","web3modal"].includes(P.getId())||x();const L=qt.adapterConfig;L.metadata={name:"CryptoPay",url:window.location.origin,description:"Crypto Payment Gateway",icons:[qt.logo]};try{n.value=!0,P.connect(L).then(async()=>{var B;n.value=!1,clearTimeout(a.value),await Vt.call("walletConnectionApproved",{network:l,order:o,wallet:P}),dC(P),(B=h.value)==null||B.start(P),d.value=!0}).catch(async B=>{n.value=!1,clearTimeout(a.value),Ro.error(B),await Vt.call("walletConnectionDeclined",{network:l,order:o,wallet:P});const V=typeof B=="string"?B:B.message;$(V)&&(V==Fo.WALLET_REQUEST_REJECTED||V==Fo.WALLET_CONNECT_REJECTED?Ju(ht.connectionRejected):V==Fo.WALLET_ALREADY_PROCESSING?bo(ht.alreadyProcessing):V==Fo.UNACCEPTED_CHAIN?bo(ht.connectionError,Qu(l)):V==Fo.RPC_ACCESS_DENIED?bo(ht.rpcAccessForbidden):V==Fo.RPC_REQUEST_ERROR?bo(ht.connectionError,Qu(l)):V==Fo.RPC_TIMEOUT?bo(ht.rpcTimeout):ht[B]?bo(ht[B]):typeof B=="object"?B.message.includes("Proposal expired")&&bo(ht.walletConnectionTimedOut):bo(ht.anyError))})}catch(B){Ro.error(B)}};return ft(async()=>{i.value=await w()}),(R,P)=>{const L=nt("cp-loading"),B=nt("cp-list"),V=nt("cp-modal");return b(),M(Qe,null,[c.value?se("",!0):mt((b(),he(V,{key:0,show:u.value,title:m.value,onClose:P[0]||(P[0]=j=>_())},{default:le(()=>[s(qt).mode=="currency"?mt((b(),he(eb,{key:0},null,512)),[[Lt,!n.value]]):se("",!0),n.value?(b(),he(L,{key:1})):(b(),he(B,{key:2,search:!1,ref_key:"adapterListEl",ref:v,itemClass:"adapter",onHandleClick:T,list:Object.values(i.value),noFoundMsg:s(ht).notFoundAnyNetworkForPayment,listClass:"adapters "+(s(Tt).isPaymentAmountUpdating?"disabled":"")},{default:le(({item:j})=>[E("div",jC,[E("img",{class:"icon",src:j.icon,alt:j.name},null,8,KC)]),E("span",{class:"name","data-key":j.id,"data-name":j.name},$e(j.name),9,UC),E("span",WC,[j.platforms.includes(s(Zs).UNIVERSAL)?(b(),M("span",qC)):j.isDetected()===!0?(b(),M("span",YC,$e(s(ht).detected),1)):!yi()&&j.isDetected()===!1?(b(),M("span",GC,$e(s(ht).download),1)):yi()&&!j.platforms.includes(s(Zs).MOBILE)?(b(),M("span",XC,$e(s(ht).onlyDesktop),1)):yi()&&j.createDeepLink?(b(),M("span",ZC,$e(s(ht).openInApp),1)):yi()&&!j.createDeepLink?(b(),M("span",JC,$e(s(ht).openInAppManual),1)):se("",!0)])]),_:1},8,["list","noFoundMsg","listClass"]))]),_:1},8,["show","title"])),[[Lt,!d.value]]),ee(FC,{ref_key:"paymentRequest",ref:h},null,512)],64)}}});let Sa={};const Js={add:e=>{Sa=Object.assign(Sa,e)},set:(e,t)=>{Sa[e]=t},remove:e=>{delete Sa[e]},get:e=>Sa[e],getAll:()=>Sa,removeAll:()=>{Sa={}}},e7=N({__name:"TransactionProcess",props:{transactionHash:{type:String,required:!0}},setup(e){const t=D(!0),o=e;return ft(async()=>{try{const r=Tt.get.order,l=Tt.get.network,n=Tt.transactionInstance(o.transactionHash),a=await Vt.call("transactionReceived",{order:r,network:l,transaction:n});if(!Vt.check(a))return;if(qt.createTransaction){const i=await Tt.get.api.createTransaction(n);if(i.success)i.data&&Js.add(i.data);else{await Vt.call("transactionCreateFail",{order:r,network:l,transaction:n}),bo(i.message||ht.anyError).then(()=>{Ys(),i.data&&i.data.redirect?i.data.redirect=="reload"?window.location.reload():window.location.href=i.data.redirect:window.location.reload()});return}await Vt.call("transactionCreated",{order:r,network:l,transaction:n})}qt.confirmation&&Tt.setProcess(Zu.CONFIRMATION),t.value=!1}catch(r){return Ro.error(r),!1}}),(r,l)=>{const n=nt("cp-loading"),a=nt("cp-modal");return t.value?(b(),he(a,{key:0,title:s(ht).processing},{default:le(()=>[ee(n)]),_:1},8,["title"])):se("",!0)}}});function ob(e,t){return function(){return e.apply(t,arguments)}}const{toString:t7}=Object.prototype,{getPrototypeOf:d0}=Object,td=(e=>t=>{const o=t7.call(t);return e[o]||(e[o]=o.slice(8,-1).toLowerCase())})(Object.create(null)),ul=e=>(e=e.toLowerCase(),t=>td(t)===e),od=e=>t=>typeof t===e,{isArray:Si}=Array,Qs=od("undefined");function o7(e){return e!==null&&!Qs(e)&&e.constructor!==null&&!Qs(e.constructor)&&Ur(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const rb=ul("ArrayBuffer");function r7(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&rb(e.buffer),t}const l7=od("string"),Ur=od("function"),lb=od("number"),rd=e=>e!==null&&typeof e=="object",n7=e=>e===!0||e===!1,ld=e=>{if(td(e)!=="object")return!1;const t=d0(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},a7=ul("Date"),i7=ul("File"),s7=ul("Blob"),c7=ul("FileList"),u7=e=>rd(e)&&Ur(e.pipe),d7=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Ur(e.append)&&((t=td(e))==="formdata"||t==="object"&&Ur(e.toString)&&e.toString()==="[object FormData]"))},p7=ul("URLSearchParams"),[f7,h7,v7,m7]=["ReadableStream","Request","Response","Headers"].map(ul),g7=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ec(e,t,{allOwnKeys:o=!1}={}){if(e===null||typeof e>"u")return;let r,l;if(typeof e!="object"&&(e=[e]),Si(e))for(r=0,l=e.length;r0;)if(l=o[r],t===l.toLowerCase())return l;return null}const ab=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:Xl,ib=e=>!Qs(e)&&e!==ab;function p0(){const{caseless:e}=ib(this)&&this||{},t={},o=(r,l)=>{const n=e&&nb(t,l)||l;ld(t[n])&&ld(r)?t[n]=p0(t[n],r):ld(r)?t[n]=p0({},r):Si(r)?t[n]=r.slice():t[n]=r};for(let r=0,l=arguments.length;r(ec(t,(l,n)=>{o&&Ur(l)?e[n]=ob(l,o):e[n]=l},{allOwnKeys:r}),e),_7=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),w7=(e,t,o,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),o&&Object.assign(e.prototype,o)},y7=(e,t,o,r)=>{let l,n,a;const i={};if(t=t||{},e==null)return t;do{for(l=Object.getOwnPropertyNames(e),n=l.length;n-- >0;)a=l[n],(!r||r(a,e,t))&&!i[a]&&(t[a]=e[a],i[a]=!0);e=o!==!1&&d0(e)}while(e&&(!o||o(e,t))&&e!==Object.prototype);return t},x7=(e,t,o)=>{e=String(e),(o===void 0||o>e.length)&&(o=e.length),o-=t.length;const r=e.indexOf(t,o);return r!==-1&&r===o},k7=e=>{if(!e)return null;if(Si(e))return e;let t=e.length;if(!lb(t))return null;const o=new Array(t);for(;t-- >0;)o[t]=e[t];return o},C7=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&d0(Uint8Array)),S7=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let l;for(;(l=r.next())&&!l.done;){const n=l.value;t.call(e,n[0],n[1])}},E7=(e,t)=>{let o;const r=[];for(;(o=e.exec(t))!==null;)r.push(o);return r},T7=ul("HTMLFormElement"),$7=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(o,r,l){return r.toUpperCase()+l}),sb=(({hasOwnProperty:e})=>(t,o)=>e.call(t,o))(Object.prototype),M7=ul("RegExp"),cb=(e,t)=>{const o=Object.getOwnPropertyDescriptors(e),r={};ec(o,(l,n)=>{let a;(a=t(l,n,e))!==!1&&(r[n]=a||l)}),Object.defineProperties(e,r)},A7=e=>{cb(e,(t,o)=>{if(Ur(e)&&["arguments","caller","callee"].indexOf(o)!==-1)return!1;const r=e[o];if(Ur(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+o+"'")})}})},z7=(e,t)=>{const o={},r=l=>{l.forEach(n=>{o[n]=!0})};return Si(e)?r(e):r(String(e).split(t)),o},I7=()=>{},O7=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,f0="abcdefghijklmnopqrstuvwxyz",ub="0123456789",db={DIGIT:ub,ALPHA:f0,ALPHA_DIGIT:f0+f0.toUpperCase()+ub},N7=(e=16,t=db.ALPHA_DIGIT)=>{let o="";const{length:r}=t;for(;e--;)o+=t[Math.random()*r|0];return o};function P7(e){return!!(e&&Ur(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const R7=e=>{const t=new Array(10),o=(r,l)=>{if(rd(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[l]=r;const n=Si(r)?[]:{};return ec(r,(a,i)=>{const c=o(a,l+1);!Qs(c)&&(n[i]=c)}),t[l]=void 0,n}}return r};return o(e,0)},L7=ul("AsyncFunction"),Ue={isArray:Si,isArrayBuffer:rb,isBuffer:o7,isFormData:d7,isArrayBufferView:r7,isString:l7,isNumber:lb,isBoolean:n7,isObject:rd,isPlainObject:ld,isReadableStream:f7,isRequest:h7,isResponse:v7,isHeaders:m7,isUndefined:Qs,isDate:a7,isFile:i7,isBlob:s7,isRegExp:M7,isFunction:Ur,isStream:u7,isURLSearchParams:p7,isTypedArray:C7,isFileList:c7,forEach:ec,merge:p0,extend:b7,trim:g7,stripBOM:_7,inherits:w7,toFlatObject:y7,kindOf:td,kindOfTest:ul,endsWith:x7,toArray:k7,forEachEntry:S7,matchAll:E7,isHTMLForm:T7,hasOwnProperty:sb,hasOwnProp:sb,reduceDescriptors:cb,freezeMethods:A7,toObjectSet:z7,toCamelCase:$7,noop:I7,toFiniteNumber:O7,findKey:nb,global:ab,isContextDefined:ib,ALPHABET:db,generateString:N7,isSpecCompliantForm:P7,toJSONObject:R7,isAsyncFn:L7,isThenable:e=>e&&(rd(e)||Ur(e))&&Ur(e.then)&&Ur(e.catch)};var pb={},nd={};nd.byteLength=D7,nd.toByteArray=F7,nd.fromByteArray=U7;for(var zl=[],Wr=[],B7=typeof Uint8Array<"u"?Uint8Array:Array,h0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ei=0,V7=h0.length;Ei0)throw new Error("Invalid string. Length must be a multiple of 4");var o=e.indexOf("=");o===-1&&(o=t);var r=o===t?0:4-o%4;return[o,r]}function D7(e){var t=fb(e),o=t[0],r=t[1];return(o+r)*3/4-r}function H7(e,t,o){return(t+o)*3/4-o}function F7(e){var t,o=fb(e),r=o[0],l=o[1],n=new B7(H7(e,r,l)),a=0,i=l>0?r-4:r,c;for(c=0;c>16&255,n[a++]=t>>8&255,n[a++]=t&255;return l===2&&(t=Wr[e.charCodeAt(c)]<<2|Wr[e.charCodeAt(c+1)]>>4,n[a++]=t&255),l===1&&(t=Wr[e.charCodeAt(c)]<<10|Wr[e.charCodeAt(c+1)]<<4|Wr[e.charCodeAt(c+2)]>>2,n[a++]=t>>8&255,n[a++]=t&255),n}function j7(e){return zl[e>>18&63]+zl[e>>12&63]+zl[e>>6&63]+zl[e&63]}function K7(e,t,o){for(var r,l=[],n=t;ni?i:a+n));return r===1?(t=e[o-1],l.push(zl[t>>2]+zl[t<<4&63]+"==")):r===2&&(t=(e[o-2]<<8)+e[o-1],l.push(zl[t>>10]+zl[t>>4&63]+zl[t<<2&63]+"=")),l.join("")}var v0={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */v0.read=function(e,t,o,r,l){var n,a,i=l*8-r-1,c=(1<>1,u=-7,p=o?l-1:0,h=o?-1:1,v=e[t+p];for(p+=h,n=v&(1<<-u)-1,v>>=-u,u+=i;u>0;n=n*256+e[t+p],p+=h,u-=8);for(a=n&(1<<-u)-1,n>>=-u,u+=r;u>0;a=a*256+e[t+p],p+=h,u-=8);if(n===0)n=1-d;else{if(n===c)return a?NaN:(v?-1:1)*(1/0);a=a+Math.pow(2,r),n=n-d}return(v?-1:1)*a*Math.pow(2,n-r)},v0.write=function(e,t,o,r,l,n){var a,i,c,d=n*8-l-1,u=(1<>1,h=l===23?Math.pow(2,-24)-Math.pow(2,-77):0,v=r?0:n-1,m=r?1:-1,f=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(i=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+p>=1?t+=h/c:t+=h*Math.pow(2,1-p),t*c>=2&&(a++,c/=2),a+p>=u?(i=0,a=u):a+p>=1?(i=(t*c-1)*Math.pow(2,l),a=a+p):(i=t*Math.pow(2,p-1)*Math.pow(2,l),a=0));l>=8;e[o+v]=i&255,v+=m,i/=256,l-=8);for(a=a<0;e[o+v]=a&255,v+=m,a/=256,d-=8);e[o+v-m]|=f*128};/*!
+ `}else return(t.paymentAmount||0)+" "+t.paymentCurrency.symbol}),r=async c=>{if(t.amount==0)return 0;Tt.setOrderParam("paymentAmount",0);const d=await Tt.get.api.currencyConverter();return await Vt.call("currencyConverter",{paymentCurrency:c,paymentAmount:d}),d?Tt.setOrderParams({paymentAmount:d}):(Tt.setOrderParam("paymentAmount",0),Al(ht.convertingError).then(()=>{Ys(),window.location.reload()})),d};let l=un(t);Se(t,c=>{l&&l.amount!=c.amount&&r(t.paymentCurrency),l=un(c)});const n=c=>{if(Ho.get.amountUpdateInterval)return;const d=setInterval(async()=>{i(t.paymentCurrency)},qt.amountUpdateMin*60*1e3);Ro.log("Start amount updater: ",d,"event: ",c),Ho.set("amountUpdateInterval",d)},a=c=>{if(!Ho.get.amountUpdateInterval)return;const d=Ho.get.amountUpdateInterval;Ro.log("Stop amount updater: ",d,"event: ",c),Ho.stopAmountUpdateInterval()},i=async c=>qt.modal&&!Ho.get.modal?Ro.log("Currency not updated, because modal is not opened"):(Ro.log("Currency updating: ",c),a("interval"),await r(c),n("interval"),!0);return Vt.add("selectedCurrency",({newCurrency:c})=>(Tt.setOrderParams({paymentCurrency:c}),i(c)),"paymentAmount"),Vt.add("paymentReset",()=>{a("paymentReset")},"paymentAmount"),qt.mode=="network"?(Vt.add("walletListOpened",({eventName:c})=>{a(c)},"paymentAmount"),Vt.add("walletListClosed",({eventName:c})=>{n(c)},"paymentAmount")):(Vt.add("walletConnectionRequest",({eventName:c})=>{a(c)},"paymentAmount"),Vt.add("walletPaymentDeclined, walletConnectionDeclined",({eventName:c})=>{n(c)},"paymentAmount")),ft(()=>{n("mounted")}),(c,d)=>(b(),M("div",{class:"payment-amount",innerHTML:o.value},null,8,OC))}}),PC=["data-disabled"],eb=N({__name:"InformationHeader",setup(e){const t=Tt.get.order,o=Tt.get.network,r=C(()=>Ho.get.networks),l=C(()=>{switch(qt.mode){case"network":return r.value.length>1;case"currency":return!0;default:return!0}});return(async()=>{if(window.cpCheckRpc)return;window.cpCheckRpc=!0,await Y1.checkRpcConnection()instanceof Error&&bo(ht.rpcConnectionError).then(()=>{window.location.reload()})})(),(n,a)=>{const i=nt("el-col"),c=nt("el-row");return b(),he(c,{justify:"center",class:"header"},{default:le(()=>[s(t).id?(b(),he(i,{key:0,span:12},{default:le(()=>[Ct($e(s(ht).orderId),1)]),_:1})):se("",!0),s(t).id?(b(),he(i,{key:1,span:12},{default:le(()=>[Ct($e(s(t).id),1)]),_:1})):se("",!0),ee(i,{span:12},{default:le(()=>[Ct($e(s(ht).orderAmount),1)]),_:1}),ee(i,{span:12},{default:le(()=>[Ct($e(s(t).amount)+" "+$e(s(t).currency),1)]),_:1}),ee(i,{span:12},{default:le(()=>[Ct($e(s(ht).amountToBePaid),1)]),_:1}),ee(i,{span:12},{default:le(()=>[ee(NC)]),_:1}),s(o)?(b(),he(i,{key:2,span:12},{default:le(()=>[Ct($e(s(ht).selectedNetwork),1)]),_:1})):se("",!0),s(o)?(b(),he(i,{key:3,span:12},{default:le(()=>[Ct($e(s(o).name)+" ",1),l.value?(b(),M("span",{key:0,onClick:a[0]||(a[0]=d=>s(Tt).$reset()),class:"change-network disable-el","data-disabled":s(Tt).isPaymentAmountUpdating}," ("+$e(s(ht).change)+")",9,PC)):se("",!0)]),_:1})):se("",!0)]),_:1})}}}),RC={class:"currencies"},LC=["onClick","data-disabled"],BC=["src","alt"],VC={class:"name"},DC={key:0,class:"discount"},HC=N({__name:"CurrencyList",setup(e){const t=Ge("container"),o=Tt.get.order,r=Tt.get.network,l=un((r==null?void 0:r.currencies)??[]),n=D(ht.payNow),a=c=>o.paymentCurrency.address==c.address?"selected":"",i=async c=>{Tt.isPaymentAmountUpdating||o.paymentCurrency.symbol==c.symbol||await Vt.call("selectedCurrency",{newCurrency:c,oldCurrency:o==null?void 0:o.paymentCurrency})};return ft(async()=>{let c=setInterval(()=>{var d;if((d=t==null?void 0:t.value)!=null&&d.querySelectorAll){const u=t.value.querySelectorAll(".adapters li");if(u.length==1&&u[0]){clearInterval(c);const p=u[0].querySelector(".name");let h=p==null?void 0:p.getAttribute("data-key"),v=p==null?void 0:p.getAttribute("data-name");h=="web3modal"?n.value=ht.payNow:n.value=ht.payWith.replace("{name}",v||"")}}},1)}),(c,d)=>{const u=nt("el-col"),p=nt("el-row"),h=nt("el-button");return b(),M(Qe,null,[ee(eb),s(l).length>1?(b(),he(p,{key:0},{default:le(()=>[ee(u,{span:24},{default:le(()=>[E("ul",RC,[ee(p,{gutter:20},{default:le(()=>[(b(!0),M(Qe,null,It(s(l),v=>(b(),he(u,{span:12,key:v.address},{default:le(()=>[E("li",{class:O(["disable-el",a(v)]),onClick:m=>i(v),"data-disabled":s(Tt).isPaymentAmountUpdating},[E("span",null,[E("img",{class:"icon",src:s(Xs)(v.symbol),alt:v.symbol},null,8,BC),E("span",VC,$e(v.symbol),1)]),s(qt).discountRates[v.symbol]?(b(),M("span",DC," ("+$e(s(qt).discountRates[v.symbol])+"% "+$e(s(ht).discount)+") ",1)):se("",!0)],10,LC)]),_:2},1024))),128))]),_:1})])]),_:1})]),_:1})):se("",!0),ee(h,{type:"primary",class:"button",disabled:s(Tt).isPaymentAmountUpdating,onClick:d[0]||(d[0]=v=>s(Vt).call("payNow",{order:s(o),network:s(r)}))},{default:le(()=>[Ct($e(n.value),1)]),_:1},8,["disabled"])],64)}}});var tb=(e=>(e.INCOMING="INCOMING",e.OUTGOING="OUTGOING",e))(tb||{}),ki=(e=>(e.GENERAL="GENERAL",e.CONTRACT="CONTRACT",e.COIN="COIN",e.TOKEN="TOKEN",e.NFT="NFT",e))(ki||{}),Ci=(e=>(e.FAILED="FAILED",e.PENDING="PENDING",e.CONFIRMED="CONFIRMED",e))(Ci||{}),Fo=(e=>(e.RPC_TIMEOUT="RPC_TIMEOUT",e.RPC_REQUEST_ERROR="RPC_REQUEST_ERROR",e.RPC_ACCESS_DENIED="RPC_ACCESS_DENIED",e.WS_URL_NOT_DEFINED="WS_URL_NOT_DEFINED",e.WS_CONNECTION_FAILED="WS_CONNECTION_FAILED",e.UNACCEPTED_CHAIN="UNACCEPTED_CHAIN",e.UNAUTHORIZED_ADDRESS="UNAUTHORIZED_ADDRESS",e.INSUFFICIENT_BALANCE="INSUFFICIENT_BALANCE",e.INVALID_AMOUNT="INVALID_AMOUNT",e.INVALID_ADDRESS="INVALID_ADDRESS",e.INVALID_PRIVATE_KEY="INVALID_PRIVATE_KEY",e.INVALID_PUBLIC_KEY="INVALID_PUBLIC_KEY",e.INVALID_TRANSACTION_ID="INVALID_TRANSACTION_ID",e.PROVIDER_IS_REQUIRED="PROVIDER_IS_REQUIRED",e.PROVIDER_IS_NOT_INITIALIZED="PROVIDER_IS_NOT_INITIALIZED",e.PROVIDER_IS_ALREADY_INITIALIZED="PROVIDER_IS_ALREADY_INITIALIZED",e.WALLET_ALREADY_PROCESSING="WALLET_ALREADY_PROCESSING",e.WALLET_CONNECT_REJECTED="WALLET_CONNECT_REJECTED",e.WALLET_REQUEST_REJECTED="WALLET_REQUEST_REJECTED",e.WALLET_CONNECTION_FAILED="WALLET_CONNECTION_FAILED",e.WALLET_CONNECTION_TIMEOUT="WALLET_CONNECTION_TIMEOUT",e.TRANSACTION_CREATION_FAILED="TRANSACTION_CREATION_FAILED",e.TRANSACTION_NOT_FOUND="TRANSACTION_NOT_FOUND",e.CLOSED_WALLETCONNECT_MODAL="CLOSED_WALLETCONNECT_MODAL",e.PROJECT_ID_IS_REQUIRED="PROJECT_ID_IS_REQUIRED",e.METADATA_IS_REQUIRED="METADATA_IS_REQUIRED",e.CONFIG_IS_REQUIRED="CONFIG_IS_REQUIRED",e))(Fo||{}),Zs=(e=>(e.BROWSER="BROWSER",e.MOBILE="MOBILE",e.DESKTOP="DESKTOP",e.UNIVERSAL="UNIVERSAL",e))(Zs||{});ki.GENERAL+"",ki.CONTRACT+"",ki.COIN+"",ki.TOKEN+"",ki.NFT+"";const FC=N({__name:"PaymentRequest",setup(e,{expose:t}){const o=Tt.get.order,r=Tt.get.network,l=Tt.get.receiver,n=D(!1),a=(c,d)=>{c!=Fo.CLOSED_WALLETCONNECT_MODAL&&(c==Fo.TRANSACTION_CREATION_FAILED?bo(ht.transactionCreateFail,ht.pleaseTryAgain):c==Fo.INSUFFICIENT_BALANCE?Al(ht.insufficientBalance):c==Fo.INVALID_AMOUNT?Al(ht.transferAmountError):c==Fo.WALLET_REQUEST_REJECTED||c==Fo.WALLET_CONNECT_REJECTED?Ju(ht.paymentRejected):c==Fo.RPC_ACCESS_DENIED||c.includes("Access forbidden")?bo(ht.rpcAccessForbidden):c==Fo.UNACCEPTED_CHAIN||c==Fo.RPC_REQUEST_ERROR?bo(ht.connectionError,Qu(r)):c==Fo.RPC_TIMEOUT?bo(ht.rpcTimeout):ht[d]?bo(ht[d]):c=="SAME_ADDRESS"?bo(ht.cannotPaySameAddress):bo(ht.anyError))};return t({start:async c=>{var u;n.value=!0,c0(),await Vt.call("walletPaymentRequest",{order:o,wallet:c,network:r});const d=async p=>{Ro.error(p),await Vt.call("walletPaymentDeclined",{order:o,wallet:c,network:r}),n.value=!1,a(typeof p=="string"?p:p.message)};try{let p;(u=o.paymentCurrency)!=null&&u.address?p=new Un.assets.Token(o.paymentCurrency.address):p=new Un.assets.Coin;const h=await c.getAddress();if(Ro.log("sender: ",h),h.toLowerCase()==l.toLowerCase())throw new Error("SAME_ADDRESS");const v=await p.transfer(h,l,o.paymentAmount);c.sendTransaction(v).then(async m=>{await Vt.call("walletPaymentApproved",{order:o,wallet:c,network:r}),n.value=!1,Tt.setTransactionHash(m)}).catch(d).finally(()=>{Gs(),xi(c)})}catch(p){d(p),Gs(),xi(c)}}}),(c,d)=>{const u=nt("cp-loading"),p=nt("cp-modal");return n.value?(b(),he(p,{key:0,title:s(ht).waitingApproval},{default:le(()=>[ee(u)]),_:1},8,["title"])):se("",!0)}}}),jC={class:"icon-wrapper"},KC=["src","alt"],UC=["data-key","data-name"],WC={class:"status"},qC={key:0},YC={key:1,class:"detected"},GC={key:2,class:"download"},XC={key:3,class:"onlyDesktop"},ZC={key:4,class:"openInApp"},JC={key:5,class:"openInAppManual"},QC=N({__name:"WalletAdapterList",emits:["statusChanged"],setup(e,{emit:t}){const o=Tt.get.order,r=Un.browser.Wallet,l=Tt.get.network,n=D(!1),a=D(0),i=D({}),c=D(!1),d=D(!1),u=D(["currency"].includes(qt.mode)),p=t;p("statusChanged",u.value),Se(u,R=>{p("statusChanged",R)});const h=D(null),v=D(null),m=C(()=>n.value?ht.connectionWallet:ht.selectWallet);Vt.add("payNow",()=>{f()},"walletList");const f=async()=>{var R,P;u.value=!0,Vt.call("walletListOpened",{network:l,order:o}),Object.values(i.value).length==1&&((P=(R=v.value)==null?void 0:R.listContent.querySelector("li"))==null||P.click())},_=()=>{Tt.isPaymentAmountUpdating||n.value||g()},g=()=>{u.value=!1,clearTimeout(a.value),Vt.call("walletListClosed",{network:l,order:o})};Vt.add("paymentReset",()=>{clearTimeout(a.value)},"walletList");const y=async R=>{const P={true:1,universal:2,false:3},L=await Promise.all(Object.keys(R).map(async B=>{const V=R[B],J=V.platforms.includes(Zs.UNIVERSAL)?"universal":await V.isDetected();return{key:B,isDetected:J}}));return L.sort((B,V)=>P[B.isDetected]-P[V.isDetected]),L.map(B=>B.key)},w=async()=>{let R=G1(qt.wallets);return R=(await y(R)).reduce((L,B)=>(L[B]=R[B],L),{}),u0()&&Object.values(R).forEach(async L=>{if(await L.isDetected())return R={},R[L.id]=L,!0}),R},x=()=>{clearTimeout(a.value),a.value=setTimeout(()=>{n.value=!1,bo(ht.walletConnectionTimedOut)},30*1e3)},$=R=>R==Fo.CLOSED_WALLETCONNECT_MODAL?!1:R.indexOf("Connection request reset. Please try again.")===-1;Vt.add("walletConnectionDeclined, walletPaymentDeclined",({wallet:R})=>{qt.mode=="network"?Object.values(i.value).length>1?f():g():f(),n.value=!1,clearTimeout(a.value),xi(R),d.value=!1},"walletList"),Vt.add("walletPaymentApproved",()=>{c.value=!0},"walletList");const T=async R=>{if(!r)return bo(ht.notFoundAnyWallet);const P=new r(R);if(await xi(P),await P.isDetected()===!1)return yi()?P.getPlatforms().includes(Zs.MOBILE)?P.adapter.createDeepLink?(Al(ht.openInAppMsg),window.open(P.createDeepLink(window.location.origin),"_blank")):Al(ht.openInAppManualMsg):Al(ht.onlyDesktopMsg):P.getDownloadLink()?(window.open(P.getDownloadLink(),"_blank"),Al(ht.downloadMsg)):Al(ht.downloadManualMsg);await Vt.call("walletConnectionRequest",{network:l,order:o,wallet:P}),["walletconnect","web3modal"].includes(P.getId())||x();const L=qt.adapterConfig;L.metadata={name:"CryptoPay",url:window.location.origin,description:"Crypto Payment Gateway",icons:[qt.logo]};try{n.value=!0,P.connect(L).then(async()=>{var B;n.value=!1,clearTimeout(a.value),await Vt.call("walletConnectionApproved",{network:l,order:o,wallet:P}),dC(P),(B=h.value)==null||B.start(P),d.value=!0}).catch(async B=>{n.value=!1,clearTimeout(a.value),Ro.error(B),await Vt.call("walletConnectionDeclined",{network:l,order:o,wallet:P});const V=typeof B=="string"?B:B.message;$(V)&&(V==Fo.WALLET_REQUEST_REJECTED||V==Fo.WALLET_CONNECT_REJECTED?Ju(ht.connectionRejected):V==Fo.WALLET_ALREADY_PROCESSING?bo(ht.alreadyProcessing):V==Fo.UNACCEPTED_CHAIN?bo(ht.connectionError,Qu(l)):V==Fo.RPC_ACCESS_DENIED?bo(ht.rpcAccessForbidden):V==Fo.RPC_REQUEST_ERROR?bo(ht.connectionError,Qu(l)):V==Fo.RPC_TIMEOUT?bo(ht.rpcTimeout):ht[B]?bo(ht[B]):typeof B=="object"?B.message.includes("Proposal expired")&&bo(ht.walletConnectionTimedOut):bo(ht.anyError))})}catch(B){Ro.error(B)}};return ft(async()=>{i.value=await w()}),(R,P)=>{const L=nt("cp-loading"),B=nt("cp-list"),V=nt("cp-modal");return b(),M(Qe,null,[c.value?se("",!0):mt((b(),he(V,{key:0,show:u.value,title:m.value,onClose:P[0]||(P[0]=j=>_())},{default:le(()=>[s(qt).mode=="currency"?mt((b(),he(eb,{key:0},null,512)),[[Lt,!n.value]]):se("",!0),n.value?(b(),he(L,{key:1})):(b(),he(B,{key:2,search:!1,ref_key:"adapterListEl",ref:v,itemClass:"adapter",onHandleClick:T,list:Object.values(i.value),noFoundMsg:s(ht).notFoundAnyNetworkForPayment,listClass:"adapters "+(s(Tt).isPaymentAmountUpdating?"disabled":"")},{default:le(({item:j})=>[E("div",jC,[E("img",{class:"icon",src:j.icon,alt:j.name},null,8,KC)]),E("span",{class:"name","data-key":j.id,"data-name":j.name},$e(j.name),9,UC),E("span",WC,[j.platforms.includes(s(Zs).UNIVERSAL)?(b(),M("span",qC)):j.isDetected()===!0?(b(),M("span",YC,$e(s(ht).detected),1)):!yi()&&j.isDetected()===!1?(b(),M("span",GC,$e(s(ht).download),1)):yi()&&!j.platforms.includes(s(Zs).MOBILE)?(b(),M("span",XC,$e(s(ht).onlyDesktop),1)):yi()&&j.createDeepLink?(b(),M("span",ZC,$e(s(ht).openInApp),1)):yi()&&!j.createDeepLink?(b(),M("span",JC,$e(s(ht).openInAppManual),1)):se("",!0)])]),_:1},8,["list","noFoundMsg","listClass"]))]),_:1},8,["show","title"])),[[Lt,!d.value]]),ee(FC,{ref_key:"paymentRequest",ref:h},null,512)],64)}}});let Sa={};const Js={add:e=>{Sa=Object.assign(Sa,e)},set:(e,t)=>{Sa[e]=t},remove:e=>{delete Sa[e]},get:e=>Sa[e],getAll:()=>Sa,removeAll:()=>{Sa={}}},e7=N({__name:"TransactionProcess",props:{transactionHash:{type:String,required:!0}},setup(e){const t=D(!0),o=e;return ft(async()=>{try{const r=Tt.get.order,l=Tt.get.network,n=Tt.transactionInstance(o.transactionHash),a=await Vt.call("transactionReceived",{order:r,network:l,transaction:n});if(!Vt.check(a))return;if(qt.createTransaction){const i=await Tt.get.api.createTransaction(n);if(i.success)i.data&&Js.add(i.data);else{await Vt.call("transactionCreateFail",{order:r,network:l,transaction:n}),bo(i.message||ht.anyError).then(()=>{Ys(),i.data&&i.data.redirect?i.data.redirect=="reload"?window.location.reload():window.location.href=i.data.redirect:window.location.reload()});return}await Vt.call("transactionCreated",{order:r,network:l,transaction:n})}qt.confirmation&&Tt.setProcess(Zu.CONFIRMATION),t.value=!1}catch(r){return Ro.error(r),!1}}),(r,l)=>{const n=nt("cp-loading"),a=nt("cp-modal");return t.value?(b(),he(a,{key:0,title:s(ht).processing},{default:le(()=>[ee(n)]),_:1},8,["title"])):se("",!0)}}});function ob(e,t){return function(){return e.apply(t,arguments)}}const{toString:t7}=Object.prototype,{getPrototypeOf:d0}=Object,td=(e=>t=>{const o=t7.call(t);return e[o]||(e[o]=o.slice(8,-1).toLowerCase())})(Object.create(null)),ul=e=>(e=e.toLowerCase(),t=>td(t)===e),od=e=>t=>typeof t===e,{isArray:Si}=Array,Qs=od("undefined");function o7(e){return e!==null&&!Qs(e)&&e.constructor!==null&&!Qs(e.constructor)&&Ur(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const rb=ul("ArrayBuffer");function r7(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&rb(e.buffer),t}const l7=od("string"),Ur=od("function"),lb=od("number"),rd=e=>e!==null&&typeof e=="object",n7=e=>e===!0||e===!1,ld=e=>{if(td(e)!=="object")return!1;const t=d0(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},a7=ul("Date"),i7=ul("File"),s7=ul("Blob"),c7=ul("FileList"),u7=e=>rd(e)&&Ur(e.pipe),d7=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Ur(e.append)&&((t=td(e))==="formdata"||t==="object"&&Ur(e.toString)&&e.toString()==="[object FormData]"))},p7=ul("URLSearchParams"),[f7,h7,v7,m7]=["ReadableStream","Request","Response","Headers"].map(ul),g7=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ec(e,t,{allOwnKeys:o=!1}={}){if(e===null||typeof e>"u")return;let r,l;if(typeof e!="object"&&(e=[e]),Si(e))for(r=0,l=e.length;r0;)if(l=o[r],t===l.toLowerCase())return l;return null}const ab=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:Xl,ib=e=>!Qs(e)&&e!==ab;function p0(){const{caseless:e}=ib(this)&&this||{},t={},o=(r,l)=>{const n=e&&nb(t,l)||l;ld(t[n])&&ld(r)?t[n]=p0(t[n],r):ld(r)?t[n]=p0({},r):Si(r)?t[n]=r.slice():t[n]=r};for(let r=0,l=arguments.length;r(ec(t,(l,n)=>{o&&Ur(l)?e[n]=ob(l,o):e[n]=l},{allOwnKeys:r}),e),_7=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),w7=(e,t,o,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),o&&Object.assign(e.prototype,o)},y7=(e,t,o,r)=>{let l,n,a;const i={};if(t=t||{},e==null)return t;do{for(l=Object.getOwnPropertyNames(e),n=l.length;n-- >0;)a=l[n],(!r||r(a,e,t))&&!i[a]&&(t[a]=e[a],i[a]=!0);e=o!==!1&&d0(e)}while(e&&(!o||o(e,t))&&e!==Object.prototype);return t},x7=(e,t,o)=>{e=String(e),(o===void 0||o>e.length)&&(o=e.length),o-=t.length;const r=e.indexOf(t,o);return r!==-1&&r===o},k7=e=>{if(!e)return null;if(Si(e))return e;let t=e.length;if(!lb(t))return null;const o=new Array(t);for(;t-- >0;)o[t]=e[t];return o},C7=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&d0(Uint8Array)),S7=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let l;for(;(l=r.next())&&!l.done;){const n=l.value;t.call(e,n[0],n[1])}},E7=(e,t)=>{let o;const r=[];for(;(o=e.exec(t))!==null;)r.push(o);return r},T7=ul("HTMLFormElement"),$7=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(o,r,l){return r.toUpperCase()+l}),sb=(({hasOwnProperty:e})=>(t,o)=>e.call(t,o))(Object.prototype),M7=ul("RegExp"),cb=(e,t)=>{const o=Object.getOwnPropertyDescriptors(e),r={};ec(o,(l,n)=>{let a;(a=t(l,n,e))!==!1&&(r[n]=a||l)}),Object.defineProperties(e,r)},A7=e=>{cb(e,(t,o)=>{if(Ur(e)&&["arguments","caller","callee"].indexOf(o)!==-1)return!1;const r=e[o];if(Ur(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+o+"'")})}})},z7=(e,t)=>{const o={},r=l=>{l.forEach(n=>{o[n]=!0})};return Si(e)?r(e):r(String(e).split(t)),o},I7=()=>{},O7=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,f0="abcdefghijklmnopqrstuvwxyz",ub="0123456789",db={DIGIT:ub,ALPHA:f0,ALPHA_DIGIT:f0+f0.toUpperCase()+ub},N7=(e=16,t=db.ALPHA_DIGIT)=>{let o="";const{length:r}=t;for(;e--;)o+=t[Math.random()*r|0];return o};function P7(e){return!!(e&&Ur(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const R7=e=>{const t=new Array(10),o=(r,l)=>{if(rd(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[l]=r;const n=Si(r)?[]:{};return ec(r,(a,i)=>{const c=o(a,l+1);!Qs(c)&&(n[i]=c)}),t[l]=void 0,n}}return r};return o(e,0)},L7=ul("AsyncFunction"),Ue={isArray:Si,isArrayBuffer:rb,isBuffer:o7,isFormData:d7,isArrayBufferView:r7,isString:l7,isNumber:lb,isBoolean:n7,isObject:rd,isPlainObject:ld,isReadableStream:f7,isRequest:h7,isResponse:v7,isHeaders:m7,isUndefined:Qs,isDate:a7,isFile:i7,isBlob:s7,isRegExp:M7,isFunction:Ur,isStream:u7,isURLSearchParams:p7,isTypedArray:C7,isFileList:c7,forEach:ec,merge:p0,extend:b7,trim:g7,stripBOM:_7,inherits:w7,toFlatObject:y7,kindOf:td,kindOfTest:ul,endsWith:x7,toArray:k7,forEachEntry:S7,matchAll:E7,isHTMLForm:T7,hasOwnProperty:sb,hasOwnProp:sb,reduceDescriptors:cb,freezeMethods:A7,toObjectSet:z7,toCamelCase:$7,noop:I7,toFiniteNumber:O7,findKey:nb,global:ab,isContextDefined:ib,ALPHABET:db,generateString:N7,isSpecCompliantForm:P7,toJSONObject:R7,isAsyncFn:L7,isThenable:e=>e&&(rd(e)||Ur(e))&&Ur(e.then)&&Ur(e.catch)};var pb={},nd={};nd.byteLength=D7,nd.toByteArray=F7,nd.fromByteArray=U7;for(var zl=[],Wr=[],B7=typeof Uint8Array<"u"?Uint8Array:Array,h0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ei=0,V7=h0.length;Ei0)throw new Error("Invalid string. Length must be a multiple of 4");var o=e.indexOf("=");o===-1&&(o=t);var r=o===t?0:4-o%4;return[o,r]}function D7(e){var t=fb(e),o=t[0],r=t[1];return(o+r)*3/4-r}function H7(e,t,o){return(t+o)*3/4-o}function F7(e){var t,o=fb(e),r=o[0],l=o[1],n=new B7(H7(e,r,l)),a=0,i=l>0?r-4:r,c;for(c=0;c>16&255,n[a++]=t>>8&255,n[a++]=t&255;return l===2&&(t=Wr[e.charCodeAt(c)]<<2|Wr[e.charCodeAt(c+1)]>>4,n[a++]=t&255),l===1&&(t=Wr[e.charCodeAt(c)]<<10|Wr[e.charCodeAt(c+1)]<<4|Wr[e.charCodeAt(c+2)]>>2,n[a++]=t>>8&255,n[a++]=t&255),n}function j7(e){return zl[e>>18&63]+zl[e>>12&63]+zl[e>>6&63]+zl[e&63]}function K7(e,t,o){for(var r,l=[],n=t;ni?i:a+n));return r===1?(t=e[o-1],l.push(zl[t>>2]+zl[t<<4&63]+"==")):r===2&&(t=(e[o-2]<<8)+e[o-1],l.push(zl[t>>10]+zl[t>>4&63]+zl[t<<2&63]+"=")),l.join("")}var v0={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */v0.read=function(e,t,o,r,l){var n,a,i=l*8-r-1,c=(1<>1,u=-7,p=o?l-1:0,h=o?-1:1,v=e[t+p];for(p+=h,n=v&(1<<-u)-1,v>>=-u,u+=i;u>0;n=n*256+e[t+p],p+=h,u-=8);for(a=n&(1<<-u)-1,n>>=-u,u+=r;u>0;a=a*256+e[t+p],p+=h,u-=8);if(n===0)n=1-d;else{if(n===c)return a?NaN:(v?-1:1)*(1/0);a=a+Math.pow(2,r),n=n-d}return(v?-1:1)*a*Math.pow(2,n-r)},v0.write=function(e,t,o,r,l,n){var a,i,c,d=n*8-l-1,u=(1<>1,h=l===23?Math.pow(2,-24)-Math.pow(2,-77):0,v=r?0:n-1,m=r?1:-1,f=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(i=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+p>=1?t+=h/c:t+=h*Math.pow(2,1-p),t*c>=2&&(a++,c/=2),a+p>=u?(i=0,a=u):a+p>=1?(i=(t*c-1)*Math.pow(2,l),a=a+p):(i=t*Math.pow(2,p-1)*Math.pow(2,l),a=0));l>=8;e[o+v]=i&255,v+=m,i/=256,l-=8);for(a=a<0;e[o+v]=a&255,v+=m,a/=256,d-=8);e[o+v-m]|=f*128};/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh
From 1f1ccef9906ace5bcc9a4813f8a1c5cfdf81c9af Mon Sep 17 00:00:00 2001
From: Halil Beycan <50718965+BeycanDeveloper@users.noreply.github.com>
Date: Sat, 31 Aug 2024 08:41:15 +0800
Subject: [PATCH 2/2] version up
---
cryptopay-wc-lite.php | 2 +-
readme.txt | 7 +++++--
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/cryptopay-wc-lite.php b/cryptopay-wc-lite.php
index cdf3edd..f4f0833 100644
--- a/cryptopay-wc-lite.php
+++ b/cryptopay-wc-lite.php
@@ -11,7 +11,7 @@
/**
* Plugin Name: CryptoPay Lite
- * Version: 2.3.1
+ * Version: 2.3.2
* Plugin URI: https://beycanpress.com/cryptopay/
* Description: All In One Cryptocurrency Payments for WordPress
* Author: BeycanPress LLC
diff --git a/readme.txt b/readme.txt
index fdcb56f..6cb03a9 100644
--- a/readme.txt
+++ b/readme.txt
@@ -4,8 +4,8 @@ Tags: WooCommerce, Cryptocurrency, Payment, Gateway, Bitcoin
Requires at least: 5.0
Tested up to: 6.6.1
Requires PHP: 8.1
-Stable Tag: 2.3.1
-Version: 2.3.1
+Stable Tag: 2.3.2
+Version: 2.3.2
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html
@@ -160,6 +160,9 @@ Yes, our plugin comes with WooCommerce crypto payment gateway support by default
== Changelog ==
+= 2.3.2 =
+* Fixed: Wallet status information messages
+
= 2.3.1 =
* Fixed: An optional button option has been added for conflict issues that may occur with the theme during the payment process in the WooCommerce checkout section.