keyring-chatbot-agent-sdk-test 0.0.30 → 0.0.32

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.
@@ -1,5 +1,5 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".chat-button{cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 12px #00000026;transition:all .3s ease;border-radius:16px}.chat-button:hover{transform:scale(1.1);box-shadow:0 6px 16px #0003}.chat-button:active{transform:scale(.95)}.chat-modal-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:transparent;display:flex;align-items:flex-end;justify-content:flex-end;z-index:9999;pointer-events:all;animation:fadeIn .2s ease}.chat-modal-overlay.chat-modal-overlay--left{justify-content:flex-start}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.chat-modal{width:90%;max-width:480px;height:700px;max-height:calc(100dvh - 64px);background:#f5f5f7;border-radius:14px;display:flex;flex-direction:column;overflow:hidden;box-shadow:0 20px 60px #0000004d;margin:20px;pointer-events:all;animation:slideUp .3s ease}@keyframes slideUp{0%{transform:translateY(30px);opacity:0}to{transform:translateY(0);opacity:1}}.chat-modal-header{background:#fff;padding:16px 20px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #e5e5e7}.chat-modal-header-left{display:flex;align-items:center;gap:12px}.keyring-logo{width:32px;height:32px}.chat-modal-header h3{margin:0;font-size:18px;font-weight:700;color:#1a1a1d}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;border-radius:8px;color:#666;transition:all .2s}.close-button:hover{background:#f5f5f7;color:#000}.chat-user-info{background:#fff;padding:12px 20px;display:flex;align-items:center;gap:10px;border-bottom:1px solid #e5e5e7}.user-avatar{width:20px;height:20px;border-radius:50%}.user-avatar img{border-radius:50%}.user-wallet,.user-wallet a{font-size:14px;font-weight:500;color:#1a1a1d}.copy-address-btn{display:flex;align-items:center;justify-content:center;background:none;border:none;cursor:pointer;padding:3px;color:#999;border-radius:4px;transition:color .15s,background .15s;line-height:0}@media(min-width:640px){.copy-address-btn:hover{color:#1a1a1d;background:#f0f0f0}}.chat-modal-messages-wrapper{position:relative;flex:1;overflow:hidden;display:flex;flex-direction:column}.chat-modal-messages{flex:1;padding:20px;overflow-y:auto;overscroll-behavior:contain;display:flex;flex-direction:column;gap:12px}.date-separator{text-align:center;font-size:12px;font-weight:600;color:#666;background:#e5e5e7;padding:6px 16px;border-radius:12px;align-self:center;width:fit-content;margin:8px auto}.message{display:flex;animation:messageSlide .3s ease;position:relative}@media(min-width:640px){.message:hover .message-reply-button{opacity:1}}@keyframes messageSlide{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.message-reply-button{position:absolute;top:50%;transform:translateY(-50%);background:#fff;border:1px solid #e5e5e7;border-radius:8px;padding:6px;cursor:pointer;opacity:0;transition:all .2s;box-shadow:0 2px 8px #0000001a;z-index:10}.message-bot .message-reply-button{right:20px}.message-user .message-reply-button{left:20px}.message-reply-button:hover{background:#f5f5f7;transform:translateY(-50%) scale(1.1)}.message-reply-button svg{display:block;width:16px;height:16px;color:#666}.message-bot{justify-content:flex-start}.message-user{justify-content:flex-end}.message-bubble{max-width:85%;padding:14px 16px;border-radius:20px}.message-bot .message-bubble{background:#fff;box-shadow:0 2px 8px #0000000f;border-bottom-left-radius:4px}.message-user .message-bubble{background:#5b7fff;color:#fff;border-bottom-right-radius:4px}.message-reply-to{background:#0000000d;padding:8px 12px;border-radius:6px;margin-bottom:8px;border-left:3px solid #5b7fff}.message-bot .message-reply-to{background:#f5f5f7}.message-user .message-reply-to{background:#ffffff26;border-left-color:#ffffff80}.message-reply-to-label{font-size:11px;font-weight:600;margin-bottom:4px}.message-bot .message-reply-to-label{color:#5b7fff}.message-user .message-reply-to-label{color:#ffffffe6}.message-reply-to-text{font-size:12px;opacity:.8;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.message-text{font-size:14px;line-height:1.5;margin-bottom:6px;word-wrap:break-word;white-space:pre-line}.message-bot .message-text{color:#1a1a1d}.message-user .message-text{color:#fff}.message-buttons{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px;margin-bottom:8px}.message-button{flex:1 1 calc(50% - 4px);min-width:100px;padding:10px 16px;background:#fffffff2;border:1px solid #e0e0e0;border-radius:12px;font-size:13px;font-weight:500;color:#1a1a1d;cursor:pointer;transition:all .2s ease;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.message-button.full-width{flex:1 1 100%;text-align:center;white-space:normal;padding:12px 16px;font-size:14px}@media(min-width:640px){.message-button:hover{background:#fff;border-color:#007aff;color:#007aff;transform:translateY(-1px);box-shadow:0 2px 8px #007aff26}.message-button:active{transform:translateY(0);box-shadow:0 1px 4px #007aff1a}}.message-user .message-button{background:#fff3;border-color:#ffffff4d;color:#fff}.message-user .message-button:hover{background:#ffffff4d;border-color:#ffffff80}.message-timestamp{font-size:11px;color:#999;display:flex;align-items:center;gap:4px;justify-content:flex-end}.message-user .message-timestamp{color:#ffffffb3}.check-icon{width:14px;height:14px}.typing-indicator .message-bubble{padding:12px 18px;display:flex;gap:6px;min-width:60px}.typing-dot{width:8px;height:8px;border-radius:50%;background:#999;animation:typingDot 1.4s infinite ease-in-out}.typing-dot:nth-child(1){animation-delay:0s}.typing-dot:nth-child(2){animation-delay:.2s}.typing-dot:nth-child(3){animation-delay:.4s}@keyframes typingDot{0%,60%,to{transform:translateY(0);opacity:.7}30%{transform:translateY(-8px);opacity:1}}.suggestions-container{display:flex;flex-direction:column;gap:10px;margin-top:8px}.suggestion-button{background:#d4d8f0;border:none;padding:12px 16px;border-radius:16px;display:flex;gap:12px;cursor:pointer;transition:all .2s;font-size:14px;font-weight:500;color:#1a1a1d;width:100%;text-align:center;align-items:center;justify-content:center}.suggestion-button:hover{background:#c5caeb;transform:translateY(-1px)}.suggestion-icon{font-size:18px}.chat-modal-input{padding:16px 20px;background:#fff;border-top:1px solid #e5e5e7;display:flex;flex-direction:column;gap:12px;box-shadow:0 -5px 8px 4px #0000000d}.reply-preview{background:#f5f5f7;padding:10px 14px;border-radius:6px;border-left:3px solid #5b7fff;display:flex;justify-content:space-between;align-items:flex-start;gap:10px}.reply-preview-content{flex:1;min-width:0}.reply-preview-label{font-size:11px;color:#5b7fff;font-weight:600;margin-bottom:4px}.reply-preview-text{font-size:13px;color:#666;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.reply-preview-close{background:transparent;border:none;cursor:pointer;padding:2px;color:#999;transition:color .2s;flex-shrink:0}.reply-preview-close:hover{color:#666}.chat-modal-input-row{display:flex;gap:12px;align-items:center}.chat-modal-input input{flex:1;padding:14px 18px;border:1px solid #e5e5e7;border-radius:24px;outline:none;font-size:16px;color:#1a1a1d;transition:all .2s}.chat-modal-input input::placeholder{color:#999}.chat-modal-input input:focus{border-color:#5b7fff;box-shadow:0 0 0 3px #5b7fff1a}.chat-modal-input input:disabled{opacity:.6;cursor:not-allowed;background:#f5f5f7}.send-button{width:44px;height:44px;border-radius:50%;background:#5b7fff;border:none;color:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .2s}.send-button:hover:not(:disabled){background:#4a6fee;transform:scale(1.05)}.send-button:disabled{opacity:.4;cursor:not-allowed}.chat-modal-messages::-webkit-scrollbar{width:6px}.chat-modal-messages::-webkit-scrollbar-thumb{background:#d1d1d6;border-radius:3px}@media(max-width:640px){.chat-modal{width:100%;height:100dvh;max-height:100dvh;border-radius:0;margin:0}}.action-status{margin-top:8px;padding:6px 10px;border-radius:6px;font-size:.8em;font-weight:500}.action-status-submitted{background:#fef3c7;color:#92400e;border:1px solid #fde68a}.action-status-success{background:#d1fae5;color:#065f46;border:1px solid #a7f3d0}.action-status-fail{background:#fee2e2;color:#991b1b;border:1px solid #fca5a5}.message-content{display:block;word-wrap:break-word;overflow-wrap:break-word;max-width:100%;overflow:hidden;font-size:inherit;line-height:1.5}.mc-line{min-height:1.2em;word-break:break-word}.mc-empty-line{height:.5em}.mc-heading{font-weight:600;margin:.3em 0;word-break:break-word}.mc-h1{font-size:1.4em}.mc-h2{font-size:1.2em}.mc-h3{font-size:1.05em}.mc-inline-code{background:#afb8c133;padding:1px 5px;border-radius:3px;font-family:Monaco,Menlo,Ubuntu Mono,Consolas,monospace;font-size:.88em}.mc-codeblock{background:#f6f8fa;border:1px solid #d0d7de;border-radius:6px;margin:6px 0;overflow:hidden;max-width:100%}.mc-codeblock-lang{background:#e8ecf0;padding:3px 10px;font-size:.75em;font-weight:600;color:#57606a;text-transform:uppercase;font-family:Monaco,Menlo,monospace;border-bottom:1px solid #d0d7de}.mc-codeblock pre{margin:0;padding:10px;overflow-x:auto}.mc-codeblock code{font-family:Monaco,Menlo,Ubuntu Mono,Consolas,monospace;font-size:.85em;line-height:1.5;color:#24292f;white-space:pre}.mc-link{color:#0969da;text-decoration:none;word-break:break-word}.mc-link:hover{text-decoration:underline}.mc-image{max-width:150px;width:150px;height:150px;object-fit:contain;border-radius:8px;margin:8px 0;display:block}.mc-image-inline{width:20px;height:20px;border-radius:50%;margin:0 4px;display:inline-block;vertical-align:middle;object-fit:cover}.mc-blockquote{margin:4px 0;padding:2px 0 2px 12px;color:#57606a;border-left:3px solid #d0d7de}.mc-hr{height:1px;border:0;background:#d0d7de;margin:.4em 0}.message-content strong{font-weight:600}.message-content del{text-decoration:line-through}.action-form{background:#f8f9fb;border:1px solid #e2e6ea;border-radius:10px;padding:12px;margin-top:8px}.action-form-title{font-weight:600;font-size:.9em;margin-bottom:10px;color:#1a1a2e;display:flex;align-items:center;gap:6px}.action-form-general-error{background:#fef2f2;border:1px solid #fecaca;border-radius:8px;padding:10px 12px;margin-bottom:10px;font-size:.8em;color:#dc2626;font-weight:500;display:flex;align-items:center;gap:6px}.action-form-fields{display:flex;flex-direction:column;gap:8px}.action-form-field{display:flex;flex-direction:column;gap:3px}.action-form-field label{font-size:.75em;font-weight:500;color:#6b7280}.action-form-field input,.action-form-field textarea{padding:8px 10px;border:1px solid #d1d5db;border-radius:6px;font-size:16px;background:#fff;color:#1a1a2e;outline:none;transition:border-color .2s;font-family:inherit}.action-form-field textarea{resize:none;word-break:break-all}.action-form-field input:focus,.action-form-field textarea:focus{border-color:#6c5ce7;box-shadow:0 0 0 2px #6c5ce726}.action-form-field input.error,.action-form-field textarea.error{border-color:#ef4444}.action-form-field input.readonly,.action-form-field textarea.readonly{background:#f3f4f6;color:#6b7280;cursor:not-allowed;border-color:#e5e7eb}.action-form-field .field-error{font-size:.7em;color:#ef4444;margin-top:1px}.action-form-actions{display:flex;gap:8px;margin-top:10px}.action-form-submit{flex:1;padding:8px 14px;background:#6c5ce7;color:#fff;border:none;border-radius:6px;font-size:.85em;font-weight:500;cursor:pointer;transition:background .2s}.action-form-submit:hover:not(:disabled){background:#5a4bd1}.action-form-submit:disabled{background:#a5b4fc;cursor:not-allowed}.action-form-cancel{padding:8px 14px;background:transparent;color:#6b7280;border:1px solid #d1d5db;border-radius:6px;font-size:.85em;font-weight:500;cursor:pointer;transition:all .2s}.action-form-cancel:hover{background:#f3f4f6;color:#374151}.action-form-token-info{background:#eef2ff;border:1px solid #c7d2fe;border-radius:8px;padding:8px 10px;margin-bottom:10px}.token-info-row{display:flex;align-items:center;gap:8px}.token-info-logo{border-radius:50%;flex-shrink:0}.token-info-details{display:flex;flex-direction:column;gap:2px;min-width:0}.token-info-name{font-size:.8em;font-weight:600;color:#1a1a2e;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.token-info-balance{font-size:.75em;color:#4b5563}.token-info-usd{color:#6c5ce7;font-weight:500}.action-form-field-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:4px}.action-form-field-header .action-form-field-label{margin-bottom:0;font-size:12px}.action-form-pct-btns{display:inline-flex;gap:4px}.action-form-pct-btn{padding:1px 6px;font-size:.7em;font-weight:600;color:#6c5ce7;background:#eef2ff;border:1px solid #c7d2fe;border-radius:4px;cursor:pointer;transition:all .15s}@media(min-width:640px){.action-form-pct-btn:hover:not(:disabled){background:#6c5ce7;color:#fff}}.action-form-pct-btn:disabled{opacity:.5;cursor:not-allowed}.action-form-max-btn{font-weight:700}.action-form-nft-info{margin-bottom:10px;text-align:center;display:flex;align-items:center;justify-content:center}.nft-info-image{width:80px;height:80px;border-radius:8px;object-fit:contain;background:#e5e7eb}.scroll-to-bottom-btn{position:absolute;bottom:16px;right:20px;background:#1a1a1dd6;color:#fff;border:1px solid rgba(255,255,255,.12);border-radius:50%;width:36px;height:36px;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 12px #00000040;z-index:20;transition:background .15s,transform .15s,box-shadow .15s;animation:fadeInUp .18s ease}@keyframes fadeInUp{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@media(min-width:640px){.scroll-to-bottom-btn:hover{background:#2d2d35;box-shadow:0 6px 16px #0000004d;transform:scale(1.08)}}.scroll-to-bottom-btn:active{transform:scale(.96)}")),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
2
- (function(gt,P){typeof exports=="object"&&typeof module<"u"?P(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],P):(gt=typeof globalThis<"u"?globalThis:gt||self,P(gt.ChatWidgetSDK={},gt.jsxRuntime,gt.React))})(this,(function(gt,P,ne){"use strict";const $s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHAAAABwCAYAAADG4PRLAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAfXSURBVHgB7Z1LbFRVGMe/c4YCAmKrEFiQWIIrNm13RE0olLRuTCq4w4C6Mbopo9GltFsVpmxQN1pJ2MkjcSMESrsgYdd2w8rGkrCA8GjFVintzPH878wZjrfzujPTe88p3y+ZzMydOxO4//s9z3dvBTWB7sxsqyTqF2q5k4R8nUh06s2thQeTZyZ4qOwU0bqJFkHjv6fbZqhBBNVJIJqiASFUN94SExl98CeVEsONiBlZQEu4E8QW1kTUSAv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wPHE1vGxHa1xLjBIh719PbSnbMKt7i6FDm0aAicZKYxIB4o+nXBst9XvUeVT2Zh/2K5M96x1ZiYiOfh+TS8IaV9qvpJmPdmdl2SeqG3rmdmFUHfU4kk6ViXphIf8ubXerqAqvThnLmWgWXGSbaH2OnvDWmVG6QhDhOTFMwwi2THC6sDtVMZAENebea7daJ7AAX/nUzprP98XqEM9QtoI0RUyjRqS2zg/Kxsp2YAFhYfnhMTeo3d5RQOsalLtcrms1//TyUbJOo0HUAAAAASUVORK5CYII=",po={en:{chatTitle:"Keyring Agent",closeChat:"Close chat",messagePlaceholder:"Message ....",sendMessage:"Send message",botIsTyping:"Bot is typing",canIHelpYou:"Can I help you with anything?",replyToMessage:"Reply to message",replyingTo:"Replying to",replyingToYou:"You",replyingToAgent:"Keyring Agent",cancelReply:"Cancel reply",suggestionAskText:"Ask a question",suggestionAskUserMessage:"I have a question",suggestionAskBotReply:"Ask me anything",suggestionBuyText:"Buy trending token",walletConnectedChainUnsupported:"Your wallet is connected but the chain is not supported for trading. Please switch to a supported chain to see trending tokens.",walletNotConnected:"Please connect your wallet to see trending tokens.",actionProcessing:"⏳ Processing transaction...",actionSuccess:"✅ Transaction completed",actionFail:"❌ Action cancelled or failed",txSubmitted:"⏳ Transaction submitted. Waiting for confirmation...",txConfirmed:"✅ Transaction confirmed!",txReverted:"❌ Transaction reverted on-chain.",txTimeout:"⚠️ Transaction submitted but confirmation timed out. Please check manually.",txSuccessful:"✅ Transaction successful!",txFailed:"Transaction failed. Please try again.",txNoHandler:"⚠️ No transaction handler configured.",txInsufficientGas:"⚠️ **Insufficient {symbol} for gas!** You have {balance} {symbol} but need ~{fee} {symbol} for the transaction fee. Please top up your wallet and try again.",txError:"❌ Error: {message}",swapConfirmButton:"Confirm",swapConfirmValue:"Confirm swap",swapReadyToProceed:"Ready to proceed with the swap?",swapEstimationError:"⚠️ Unable to get swap estimation. Error: {error}",formCancel:"Cancel",formExecute:"🚀 Execute",formProcessing:"⏳ Processing...",formBalance:"Balance:",formTokenNotFound:"Token not found in your wallet.",formNoBalance:"You have no {symbol} balance in your wallet.",formInsufficientBalance:"Insufficient balance. Available: {balance} {symbol}",formFieldRequired:"{field} is required",formInvalidAddress:"Invalid address (0x + 40 hex chars)",formMustBePositive:"Must be a positive number",formMustBeValidNumber:"Must be a valid number",openChat:"Open chat",openChatTitle:"Open chat support",walletBalanceSpendable:"This is the spendable balance of your wallet on {chain} chain. Please choose the coins you want to use for this trade.",walletNoTokensFound:"Sorry, I couldn't find any tokens in your wallet on {chain} chain. Please make sure you have some tokens to trade.",walletFetchFailed:"Sorry, I could not fetch your wallet balance. Please try again.",walletFetchError:"Sorry, I encountered an error fetching your wallet balance.",insufficientFeeToken:"Insufficient fee. Please ensure you have enough {symbol} to cover the transaction fees, or select a different token.",selectAmountOf:`📊 Select the amount of {symbol} to use:
1
+ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".chat-button{cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 12px #00000026;transition:all .3s ease;border-radius:16px}.chat-button:hover{transform:scale(1.1);box-shadow:0 6px 16px #0003}.chat-button:active{transform:scale(.95)}.chat-modal-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:transparent;display:flex;align-items:flex-end;justify-content:flex-end;z-index:9999;pointer-events:all;animation:fadeIn .2s ease}#chat-modal-title{color:#0b3988;font-weight:900;font-style:Regular;font-size:18px}.chat-modal-overlay.chat-modal-overlay--left{justify-content:flex-start}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.chat-modal{width:90%;max-width:480px;height:700px;max-height:calc(100dvh - 64px);background:#f5f5f7;border-radius:14px;display:flex;flex-direction:column;overflow:hidden;box-shadow:0 20px 60px #0000004d;margin:20px;pointer-events:all;animation:slideUp .3s ease}@keyframes slideUp{0%{transform:translateY(30px);opacity:0}to{transform:translateY(0);opacity:1}}.chat-modal-header{background:#fff;padding:16px 20px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #e5e5e7}.chat-modal-header-left{display:flex;align-items:center;gap:12px}.keyring-logo{width:32px;height:32px}.chat-modal-header h3{margin:0;font-size:18px;font-weight:700;color:#1a1a1d}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;border-radius:8px;color:#666;transition:all .2s}.close-button:hover{background:#f5f5f7;color:#000}.chat-user-info{background:#fff;padding:12px 20px;display:flex;align-items:center;gap:10px;border-bottom:1px solid #e5e5e7}.user-avatar{width:20px;height:20px;border-radius:50%}.user-avatar img{border-radius:50%}.user-wallet,.user-wallet a{font-size:14px;font-weight:500;color:#0b3988}.copy-address-btn{display:flex;align-items:center;justify-content:center;background:none;border:none;cursor:pointer;padding:3px;color:#999;border-radius:4px;transition:color .15s,background .15s;line-height:0}@media(min-width:640px){.copy-address-btn:hover{color:#1a1a1d;background:#f0f0f0}}.chat-modal-messages-wrapper{position:relative;flex:1;overflow:hidden;display:flex;flex-direction:column}.chat-modal-messages{flex:1;padding:20px;overflow-y:auto;overscroll-behavior:contain;display:flex;flex-direction:column;gap:12px}.date-separator{text-align:center;font-size:12px;font-weight:600;color:#666;background:#e5e5e7;padding:6px 16px;border-radius:12px;align-self:center;width:fit-content;margin:8px auto}.message{display:flex;animation:messageSlide .3s ease;position:relative}@media(min-width:640px){.message:hover .message-reply-button{opacity:1}}@keyframes messageSlide{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.message-reply-button{position:absolute;top:50%;transform:translateY(-50%);background:#fff;border:1px solid #e5e5e7;border-radius:8px;padding:6px;cursor:pointer;opacity:0;transition:all .2s;box-shadow:0 2px 8px #0000001a;z-index:10}.message-bot .message-reply-button{right:20px}.message-user .message-reply-button{left:20px}.message-reply-button:hover{background:#f5f5f7;transform:translateY(-50%) scale(1.1)}.message-reply-button svg{display:block;width:16px;height:16px;color:#666}.message-bot{justify-content:flex-start}.message-user{justify-content:flex-end}.message-bubble{max-width:85%;padding:14px 16px;border-radius:20px}.message-bot .message-bubble{background:#fff;box-shadow:0 2px 8px #0000000f;border-bottom-left-radius:4px}.message-user .message-bubble{background:#5b7fff;color:#fff;border-bottom-right-radius:4px}.message-reply-to{background:#0000000d;padding:8px 12px;border-radius:6px;margin-bottom:8px;border-left:3px solid #5b7fff}.message-bot .message-reply-to{background:#f5f5f7}.message-user .message-reply-to{background:#ffffff26;border-left-color:#ffffff80}.message-reply-to-label{font-size:11px;font-weight:600;margin-bottom:4px}.message-bot .message-reply-to-label{color:#5b7fff}.message-user .message-reply-to-label{color:#ffffffe6}.message-reply-to-text{font-size:12px;opacity:.8;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.message-text{font-size:14px;line-height:1.5;margin-bottom:6px;word-wrap:break-word;white-space:pre-line}.message-bot .message-text{color:#1a1a1d}.message-user .message-text{color:#fff}.message-buttons{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px;margin-bottom:8px}.message-button{flex:1 1 calc(50% - 4px);min-width:100px;padding:10px 16px;background:#fffffff2;border:1px solid #e0e0e0;border-radius:12px;font-size:13px;font-weight:500;color:#1a1a1d;cursor:pointer;transition:all .2s ease;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.message-button.full-width{flex:1 1 100%;text-align:center;white-space:normal;padding:12px 16px;font-size:14px}@media(min-width:640px){.message-button:hover{background:#fff;border-color:#007aff;color:#007aff;transform:translateY(-1px);box-shadow:0 2px 8px #007aff26}.message-button:active{transform:translateY(0);box-shadow:0 1px 4px #007aff1a}}.message-user .message-button{background:#fff3;border-color:#ffffff4d;color:#fff}.message-user .message-button:hover{background:#ffffff4d;border-color:#ffffff80}.message-timestamp{font-size:11px;color:#999;display:flex;align-items:center;gap:4px;justify-content:flex-end}.message-user .message-timestamp{color:#ffffffb3}.check-icon{width:14px;height:14px}.typing-indicator .message-bubble{padding:12px 18px;display:flex;gap:6px;min-width:60px}.typing-dot{width:8px;height:8px;border-radius:50%;background:#999;animation:typingDot 1.4s infinite ease-in-out}.typing-dot:nth-child(1){animation-delay:0s}.typing-dot:nth-child(2){animation-delay:.2s}.typing-dot:nth-child(3){animation-delay:.4s}@keyframes typingDot{0%,60%,to{transform:translateY(0);opacity:.7}30%{transform:translateY(-8px);opacity:1}}.suggestions-container{display:flex;flex-direction:column;gap:10px;margin-top:8px}.suggestion-button{background:#d4d8f0;border:none;padding:12px 16px;border-radius:16px;display:flex;gap:12px;cursor:pointer;transition:all .2s;font-size:14px;font-weight:500;color:#1a1a1d;width:100%;text-align:center;align-items:center;justify-content:center}.suggestion-button:hover{background:#c5caeb;transform:translateY(-1px)}.suggestion-icon{font-size:18px}.chat-modal-input{padding:16px 20px;background:#fff;border-top:1px solid #e5e5e7;display:flex;flex-direction:column;gap:12px;box-shadow:0 -5px 8px 4px #0000000d}.reply-preview{background:#f5f5f7;padding:10px 14px;border-radius:6px;border-left:3px solid #5b7fff;display:flex;justify-content:space-between;align-items:flex-start;gap:10px}.reply-preview-content{flex:1;min-width:0}.reply-preview-label{font-size:11px;color:#5b7fff;font-weight:600;margin-bottom:4px}.reply-preview-text{font-size:13px;color:#666;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.reply-preview-close{background:transparent;border:none;cursor:pointer;padding:2px;color:#999;transition:color .2s;flex-shrink:0}.reply-preview-close:hover{color:#666}.chat-modal-input-row{display:flex;gap:12px;align-items:center}.chat-modal-input input{flex:1;padding:14px 18px;border:1px solid #e5e5e7;border-radius:24px;outline:none;font-size:16px;color:#1a1a1d;transition:all .2s}.chat-modal-input input::placeholder{color:#999}.chat-modal-input input:focus{border-color:#5b7fff;box-shadow:0 0 0 3px #5b7fff1a}.chat-modal-input input:disabled{opacity:.6;cursor:not-allowed;background:#f5f5f7}.send-button{width:44px;height:44px;border-radius:50%;background:#5b7fff;border:none;color:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .2s}.send-button:hover:not(:disabled){background:#4a6fee;transform:scale(1.05)}.send-button:disabled{opacity:.4;cursor:not-allowed}.chat-modal-messages::-webkit-scrollbar{width:6px}.chat-modal-messages::-webkit-scrollbar-thumb{background:#d1d1d6;border-radius:3px}@media(max-width:640px){.chat-modal{width:100%;height:100dvh;max-height:100dvh;border-radius:0;margin:0}}.action-status{margin-top:8px;padding:6px 10px;border-radius:6px;font-size:.8em;font-weight:500}.action-status-submitted{background:#fef3c7;color:#92400e;border:1px solid #fde68a}.action-status-success{background:#d1fae5;color:#065f46;border:1px solid #a7f3d0}.action-status-fail{background:#fee2e2;color:#991b1b;border:1px solid #fca5a5}.message-content{display:block;word-wrap:break-word;overflow-wrap:break-word;max-width:100%;overflow:hidden;font-size:inherit;line-height:1.5}.mc-line{min-height:1.2em;word-break:break-word}.mc-empty-line{height:.5em}.mc-heading{font-weight:600;margin:.3em 0;word-break:break-word}.mc-h1{font-size:1.4em}.mc-h2{font-size:1.2em}.mc-h3{font-size:1.05em}.mc-inline-code{background:#afb8c133;padding:1px 5px;border-radius:3px;font-family:Monaco,Menlo,Ubuntu Mono,Consolas,monospace;font-size:.88em}.mc-codeblock{background:#f6f8fa;border:1px solid #d0d7de;border-radius:6px;margin:6px 0;overflow:hidden;max-width:100%}.mc-codeblock-lang{background:#e8ecf0;padding:3px 10px;font-size:.75em;font-weight:600;color:#57606a;text-transform:uppercase;font-family:Monaco,Menlo,monospace;border-bottom:1px solid #d0d7de}.mc-codeblock pre{margin:0;padding:10px;overflow-x:auto}.mc-codeblock code{font-family:Monaco,Menlo,Ubuntu Mono,Consolas,monospace;font-size:.85em;line-height:1.5;color:#24292f;white-space:pre}.mc-link{color:#0969da;text-decoration:none;word-break:break-word}.mc-link:hover{text-decoration:underline}.mc-image{max-width:150px;width:150px;height:150px;object-fit:contain;border-radius:8px;margin:8px 0;display:block}.mc-image-inline{width:20px;height:20px;border-radius:50%;margin:0 4px;display:inline-block;vertical-align:middle;object-fit:cover}.mc-blockquote{margin:4px 0;padding:2px 0 2px 12px;color:#57606a;border-left:3px solid #d0d7de}.mc-hr{height:1px;border:0;background:#d0d7de;margin:.4em 0}.message-content strong{font-weight:600}.message-content del{text-decoration:line-through}.action-form{background:#f8f9fb;border:1px solid #e2e6ea;border-radius:10px;padding:12px;margin-top:8px}.action-form-title{font-weight:600;font-size:.9em;margin-bottom:10px;color:#1a1a2e;display:flex;align-items:center;gap:6px}.action-form-general-error{background:#fef2f2;border:1px solid #fecaca;border-radius:8px;padding:10px 12px;margin-bottom:10px;font-size:.8em;color:#dc2626;font-weight:500;display:flex;align-items:center;gap:6px}.action-form-fields{display:flex;flex-direction:column;gap:8px}.action-form-field{display:flex;flex-direction:column;gap:3px}.action-form-field label{font-size:.75em;font-weight:500;color:#6b7280}.action-form-field input,.action-form-field textarea{padding:8px 10px;border:1px solid #d1d5db;border-radius:6px;font-size:16px;background:#fff;color:#1a1a2e;outline:none;transition:border-color .2s;font-family:inherit}.action-form-field textarea{resize:none;word-break:break-all}.action-form-field input:focus,.action-form-field textarea:focus{border-color:#6c5ce7;box-shadow:0 0 0 2px #6c5ce726}.action-form-field input.error,.action-form-field textarea.error{border-color:#ef4444}.action-form-field input.readonly,.action-form-field textarea.readonly{background:#f3f4f6;color:#6b7280;cursor:not-allowed;border-color:#e5e7eb}.action-form-field .field-error{font-size:.7em;color:#ef4444;margin-top:1px}.action-form-actions{display:flex;gap:8px;margin-top:10px}.action-form-submit{flex:1;padding:8px 14px;background:#6c5ce7;color:#fff;border:none;border-radius:6px;font-size:.85em;font-weight:500;cursor:pointer;transition:background .2s}.action-form-submit:hover:not(:disabled){background:#5a4bd1}.action-form-submit:disabled{background:#a5b4fc;cursor:not-allowed}.action-form-cancel{padding:8px 14px;background:transparent;color:#6b7280;border:1px solid #d1d5db;border-radius:6px;font-size:.85em;font-weight:500;cursor:pointer;transition:all .2s}.action-form-cancel:hover{background:#f3f4f6;color:#374151}.action-form-token-info{background:#eef2ff;border:1px solid #c7d2fe;border-radius:8px;padding:8px 10px;margin-bottom:10px}.token-info-row{display:flex;align-items:center;gap:8px}.token-info-logo{border-radius:50%;flex-shrink:0}.token-info-details{display:flex;flex-direction:column;gap:2px;min-width:0}.token-info-name{font-size:.8em;font-weight:600;color:#1a1a2e;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.token-info-balance{font-size:.75em;color:#4b5563}.token-info-usd{color:#6c5ce7;font-weight:500}.action-form-field-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:4px}.action-form-field-header .action-form-field-label{margin-bottom:0;font-size:12px}.action-form-pct-btns{display:inline-flex;gap:4px}.action-form-pct-btn{padding:1px 6px;font-size:.7em;font-weight:600;color:#6c5ce7;background:#eef2ff;border:1px solid #c7d2fe;border-radius:4px;cursor:pointer;transition:all .15s}@media(min-width:640px){.action-form-pct-btn:hover:not(:disabled){background:#6c5ce7;color:#fff}}.action-form-pct-btn:disabled{opacity:.5;cursor:not-allowed}.action-form-max-btn{font-weight:700}.action-form-nft-info{margin-bottom:10px;text-align:center;display:flex;align-items:center;justify-content:center}.nft-info-image{width:80px;height:80px;border-radius:8px;object-fit:contain;background:#e5e7eb}.scroll-to-bottom-btn{position:absolute;bottom:16px;right:20px;background:#1a1a1dd6;color:#fff;border:1px solid rgba(255,255,255,.12);border-radius:50%;width:36px;height:36px;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 12px #00000040;z-index:20;transition:background .15s,transform .15s,box-shadow .15s;animation:fadeInUp .18s ease}@keyframes fadeInUp{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@media(min-width:640px){.scroll-to-bottom-btn:hover{background:#2d2d35;box-shadow:0 6px 16px #0000004d;transform:scale(1.08)}}.scroll-to-bottom-btn:active{transform:scale(.96)}")),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
2
+ (function(gt,P){typeof exports=="object"&&typeof module<"u"?P(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],P):(gt=typeof globalThis<"u"?globalThis:gt||self,P(gt.ChatWidgetSDK={},gt.jsxRuntime,gt.React))})(this,(function(gt,P,ne){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vBXKC5VonVp5kuSF+V+7I0A1gRrqG/oFcwfLCkenHiPjGV5kWbcS38WsbpMoLFq46zArJ4teGkgCxe7TgnIIsXDacEZPGi44yALF59OLEeiNaVbwupruCEBbJ49cPLSZ7DAnoOC+g5LKDnsICeI/VSxBwx3iIFC+gzM9qFqklifGVG5hTdIcZPlJqSQrEFektKTsicTF0mxkuyORqXY+k2JDFjxHiFrh4mtXYzQR0ocmqcGK8QUgzjORBwWcphrgf9Au4Tz4GAcKM6HT1DjCeIEbhPvCq20tgK/SFLNGReFwVkK/QDRWrIWB9YcXuHg5nHE3pjJzHOoT3kzGj61d32thWrETkS77ErdQ9oorU5EN6+QsC8eebSxDiFoNxHtus0lFwPHE1vGxHa1xLjBIh719PbSnbMKt7i6FDm0aAicZKYxIB4o+nXBst9XvUeVT2Zh/2K5M96x1ZiYiOfh+TS8IaV9qvpJmPdmdl2SeqG3rmdmFUHfU4kk6ViXphIf8ubXerqAqvThnLmWgWXGSbaH2OnvDWmVG6QhDhOTFMwwi2THC6sDtVMZAENebea7daJ7AAX/nUzprP98XqEM9QtoI0RUyjRqS2zg/Kxsp2YAFhYfnhMTeo3d5RQOsalLtcrms1//TyUbJOo0HUAAAAASUVORK5CYII=",po={en:{chatTitle:"Keyring Agent",closeChat:"Close chat",messagePlaceholder:"Message ....",sendMessage:"Send message",botIsTyping:"Bot is typing",canIHelpYou:"Can I help you with anything?",replyToMessage:"Reply to message",replyingTo:"Replying to",replyingToYou:"You",replyingToAgent:"Keyring Agent",cancelReply:"Cancel reply",suggestionAskText:"Ask a question",suggestionAskUserMessage:"I have a question",suggestionAskBotReply:"Ask me anything",suggestionBuyText:"Buy trending token",walletConnectedChainUnsupported:"Your wallet is connected but the chain is not supported for trading. Please switch to a supported chain to see trending tokens.",walletNotConnected:"Please connect your wallet to see trending tokens.",actionProcessing:"⏳ Processing transaction...",actionSuccess:"✅ Transaction completed",actionFail:"❌ Action cancelled or failed",txSubmitted:"⏳ Transaction submitted. Waiting for confirmation...",txConfirmed:"✅ Transaction confirmed!",txReverted:"❌ Transaction reverted on-chain.",txTimeout:"⚠️ Transaction submitted but confirmation timed out. Please check manually.",txSuccessful:"✅ Transaction successful!",txFailed:"Transaction failed. Please try again.",txNoHandler:"⚠️ No transaction handler configured.",txInsufficientGas:"⚠️ **Insufficient {symbol} for gas!** You have {balance} {symbol} but need ~{fee} {symbol} for the transaction fee. Please top up your wallet and try again.",txError:"❌ Error: {message}",swapConfirmButton:"Confirm",swapConfirmValue:"Confirm swap",swapReadyToProceed:"Ready to proceed with the swap?",swapEstimationError:"⚠️ Unable to get swap estimation. Error: {error}",formCancel:"Cancel",formExecute:"🚀 Execute",formProcessing:"⏳ Processing...",formBalance:"Balance:",formTokenNotFound:"Token not found in your wallet.",formNoBalance:"You have no {symbol} balance in your wallet.",formInsufficientBalance:"Insufficient balance. Available: {balance} {symbol}",formFieldRequired:"{field} is required",formInvalidAddress:"Invalid address (0x + 40 hex chars)",formMustBePositive:"Must be a positive number",formMustBeValidNumber:"Must be a valid number",openChat:"Open chat",openChatTitle:"Open chat support",walletBalanceSpendable:"This is the spendable balance of your wallet on {chain} chain. Please choose the coins you want to use for this trade.",walletNoTokensFound:"Sorry, I couldn't find any tokens in your wallet on {chain} chain. Please make sure you have some tokens to trade.",walletFetchFailed:"Sorry, I could not fetch your wallet balance. Please try again.",walletFetchError:"Sorry, I encountered an error fetching your wallet balance.",insufficientFeeToken:"Insufficient fee. Please ensure you have enough {symbol} to cover the transaction fees, or select a different token.",selectAmountOf:`📊 Select the amount of {symbol} to use:
3
3
 
4
4
  Available: {balance} {symbol}`,swapFeeWarning:`
5
5
  ⚠️ **Insufficient {symbol} for fees!**
@@ -74,35 +74,35 @@ Select a token to interact with:`,viewBalancesEmpty:"💰 You don't have any tok
74
74
 
75
75
  {list}
76
76
 
77
- 选择要操作的代币:`,viewBalancesEmpty:"💰 您的钱包在此链上没有任何代币。",viewBalancesFetchError:"获取余额时遇到错误,请重试。",buttonSendToken:"发送{symbol}",buttonSwapToken:"兑换{symbol}",buttonBuyMoreToken:"购买更多{symbol}",actionSendNativeLabel:"发送原生代币",actionSendNativeDesc:"发送原生代币(ETH、BNB、MATIC 等)到某个地址",actionSendTokenLabel:"发送代币(ERC20)",actionSendTokenDesc:"将 ERC20 代币发送到某个地址",actionSwapTokenLabel:"兑换代币",actionSwapTokenDesc:"将一种代币兑换为另一种代币",actionApproveTokenLabel:"授权代币",actionApproveTokenDesc:"授权某地址使用您的代币",actionWrapNativeLabel:"包装原生代币",actionWrapNativeDesc:"包装原生代币(ETH → WETH)",actionUnwrapNativeLabel:"解包原生代币",actionUnwrapNativeDesc:"解包原生代币(WETH → ETH)",actionSendNftLabel:"发送 NFT",actionSendNftDesc:"将 ERC721 或 ERC1155 NFT 转移到另一个地址",fieldToAddress:"收款地址",fieldAmount:"数量",fieldTokenContract:"代币合约",fieldTokenSymbol:"代币符号",fieldDecimals:"小数位数",fieldTokenIn:"源代币",fieldTokenInSymbol:"源代币符号",fieldTokenOut:"目标代币",fieldTokenOutSymbol:"目标代币符号",fieldTokenInDecimals:"源代币小数位",fieldTokenOutDecimals:"目标代币小数位",fieldSpenderAddress:"授权地址",fieldAmountUnlimited:"数量(留空 = 无限授权)",fieldNftContract:"NFT 合约",fieldTokenId:"Token ID",fieldTokenStandard:"代币标准",fieldNftName:"NFT 名称",formMustBePositiveInteger:"必须是正整数",formAmountExceedsNft:"数量不能超过可用余额 {max}"}};function mo(e,t){return po[t]?.[e]??po.en[e]??e}function Hs(e,t){return e.replace(/\{(\w+)\}/g,(n,o)=>t[o]??`{${o}}`)}const ho=ne.createContext(void 0),Ws=({children:e,initialLanguage:t="en"})=>{const[n,o]=ne.useState(t);ne.useEffect(()=>{t&&o(t)},[t]);const s=ne.useCallback(r=>mo(r,n),[n]),a=ne.useCallback((r,l)=>Hs(mo(r,n),l),[n]);return P.jsx(ho.Provider,{value:{language:n,setLanguage:o,t:s,ti:a},children:e})},En=()=>{const e=ne.useContext(ho);if(!e)throw new Error("useLanguage must be used within a LanguageProvider");return e},Vs=ne.memo(({onClick:e})=>{const{t}=En(),n=o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),e())};return P.jsx("button",{className:"chat-button",onClick:e,onKeyDown:n,"aria-label":t("openChat"),title:t("openChatTitle"),type:"button",children:P.jsx("img",{src:$s,width:56,height:56,alt:"Ask AI"})})});function ut(e){const t={formatters:void 0,fees:void 0,serializers:void 0,...e};function n(o){return s=>{const a=typeof s=="function"?s(o):s,r={...o,...a};return Object.assign(r,{extend:n(r)})}}return Object.assign(t,{extend:n(t)})}const bo="2.45.1";let Nn={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${bo}`};class ue extends Error{constructor(t,n={}){const o=n.cause instanceof ue?n.cause.details:n.cause?.message?n.cause.message:n.details,s=n.cause instanceof ue&&n.cause.docsPath||n.docsPath,a=Nn.getDocsUrl?.({...n,docsPath:s}),r=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...o?[`Details: ${o}`]:[],...Nn.version?[`Version: ${Nn.version}`]:[]].join(`
78
- `);super(r,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=o,this.docsPath=s,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=t,this.version=bo}walk(t){return go(this,t)}}function go(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?go(e.cause,t):t?null:e}class Cn extends ue{constructor({max:t,min:n,signed:o,size:s,value:a}){super(`Number "${a}" is not in safe ${s?`${s*8}-bit ${o?"signed":"unsigned"} `:""}integer range ${t?`(${n} to ${t})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}}class Gs extends ue{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}}function Dt(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function Ve(e){return Dt(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function cn(e,{dir:t="left"}={}){let n=typeof e=="string"?e.replace("0x",""):e,o=0;for(let s=0;s<n.length-1&&n[t==="left"?s:n.length-s-1].toString()==="0";s++)o++;return n=t==="left"?n.slice(o):n.slice(0,n.length-o),typeof e=="string"?(n.length===1&&t==="right"&&(n=`${n}0`),`0x${n.length%2===1?`0${n}`:n}`):n}class wo extends ue{constructor({offset:t,position:n,size:o}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${o}).`,{name:"SliceOffsetOutOfBoundsError"})}}class yo extends ue{constructor({size:t,targetSize:n,type:o}){super(`${o.charAt(0).toUpperCase()}${o.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}}function _t(e,{dir:t,size:n=32}={}){return typeof e=="string"?wt(e,{dir:t,size:n}):zs(e,{dir:t,size:n})}function wt(e,{dir:t,size:n=32}={}){if(n===null)return e;const o=e.replace("0x","");if(o.length>n*2)throw new yo({size:Math.ceil(o.length/2),targetSize:n,type:"hex"});return`0x${o[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function zs(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new yo({size:e.length,targetSize:n,type:"bytes"});const o=new Uint8Array(n);for(let s=0;s<n;s++){const a=t==="right";o[a?s:n-s-1]=e[a?s:e.length-s-1]}return o}const qs=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Ut(e,t={}){return typeof e=="number"||typeof e=="bigint"?le(e,t):typeof e=="string"?ko(e,t):typeof e=="boolean"?vo(e,t):ft(e,t)}function vo(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(Ot(n,{size:t.size}),_t(n,{size:t.size})):n}function ft(e,t={}){let n="";for(let s=0;s<e.length;s++)n+=qs[e[s]];const o=`0x${n}`;return typeof t.size=="number"?(Ot(o,{size:t.size}),_t(o,{dir:"right",size:t.size})):o}function le(e,t={}){const{signed:n,size:o}=t,s=BigInt(e);let a;o?n?a=(1n<<BigInt(o)*8n-1n)-1n:a=2n**(BigInt(o)*8n)-1n:typeof e=="number"&&(a=BigInt(Number.MAX_SAFE_INTEGER));const r=typeof a=="bigint"&&n?-a-1n:0;if(a&&s>a||s<r){const d=typeof e=="bigint"?"n":"";throw new Cn({max:a?`${a}${d}`:void 0,min:`${r}${d}`,signed:n,size:o,value:`${e}${d}`})}const l=`0x${(n&&s<0?(1n<<BigInt(o*8))+BigInt(s):s).toString(16)}`;return o?_t(l,{size:o}):l}const Ys=new TextEncoder;function ko(e,t={}){const n=Ys.encode(e);return ft(n,t)}const js=new TextEncoder;function Bn(e,t={}){return typeof e=="number"||typeof e=="bigint"?Xs(e,t):typeof e=="boolean"?Js(e,t):Dt(e)?xt(e,t):To(e,t)}function Js(e,t={}){const n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(Ot(n,{size:t.size}),_t(n,{size:t.size})):n}const pt={zero:48,nine:57,A:65,F:70,a:97,f:102};function Ao(e){if(e>=pt.zero&&e<=pt.nine)return e-pt.zero;if(e>=pt.A&&e<=pt.F)return e-(pt.A-10);if(e>=pt.a&&e<=pt.f)return e-(pt.a-10)}function xt(e,t={}){let n=e;t.size&&(Ot(n,{size:t.size}),n=_t(n,{dir:"right",size:t.size}));let o=n.slice(2);o.length%2&&(o=`0${o}`);const s=o.length/2,a=new Uint8Array(s);for(let r=0,l=0;r<s;r++){const d=Ao(o.charCodeAt(l++)),T=Ao(o.charCodeAt(l++));if(d===void 0||T===void 0)throw new ue(`Invalid byte sequence ("${o[l-2]}${o[l-1]}" in "${o}").`);a[r]=d*16+T}return a}function Xs(e,t){const n=le(e,t);return xt(n)}function To(e,t={}){const n=js.encode(e);return typeof t.size=="number"?(Ot(n,{size:t.size}),_t(n,{dir:"right",size:t.size})):n}function Ot(e,{size:t}){if(Ve(e)>t)throw new Gs({givenSize:Ve(e),maxSize:t})}function Lt(e,t={}){const{signed:n}=t;t.size&&Ot(e,{size:t.size});const o=BigInt(e);if(!n)return o;const s=(e.length-2)/2,a=(1n<<BigInt(s)*8n-1n)-1n;return o<=a?o:o-BigInt(`0x${"f".padStart(s*2,"f")}`)-1n}function ln(e,t={}){const n=Lt(e,t),o=Number(n);if(!Number.isSafeInteger(o))throw new Cn({max:`${Number.MAX_SAFE_INTEGER}`,min:`${Number.MIN_SAFE_INTEGER}`,signed:t.signed,size:t.size,value:`${n}n`});return o}function In(e,t){return({exclude:n,format:o})=>({exclude:n,format:(s,a)=>{const r=t(s,a);if(n)for(const l of n)delete r[l];return{...r,...o(s,a)}},type:e})}const xo={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function Pn(e,t){const n={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?ln(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?ln(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?xo[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return e.authorizationList&&(n.authorizationList=Zs(e.authorizationList)),n.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof n.v=="bigint"){if(n.v===0n||n.v===27n)return 0;if(n.v===1n||n.v===28n)return 1;if(n.v>=35n)return n.v%2n===0n?1:0}})(),n.type==="legacy"&&(delete n.accessList,delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas,delete n.yParity),n.type==="eip2930"&&(delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas),n.type==="eip1559"&&delete n.maxFeePerBlobGas,n}const Ks=In("transaction",Pn);function Zs(e){return e.map(t=>({address:t.address,chainId:Number(t.chainId),nonce:Number(t.nonce),r:t.r,s:t.s,yParity:Number(t.yParity)}))}function Qs(e,t){const n=(e.transactions??[]).map(o=>typeof o=="string"?o:Pn(o));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:n,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}const ea=In("block",Qs);function ta(e,{args:t,eventName:n}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,blockTimestamp:e.blockTimestamp?BigInt(e.blockTimestamp):e.blockTimestamp===null?null:void 0,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...n?{args:t,eventName:n}:{}}}const na={"0x0":"reverted","0x1":"success"};function oa(e,t){const n={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(o=>ta(o)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?ln(e.transactionIndex):null,status:e.status?na[e.status]:null,type:e.type?xo[e.type]||e.type:null};return e.blobGasPrice&&(n.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(n.blobGasUsed=BigInt(e.blobGasUsed)),n}const sa=In("transactionReceipt",oa),aa={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function ra(e,t){const n={};return typeof e.authorizationList<"u"&&(n.authorizationList=ia(e.authorizationList)),typeof e.accessList<"u"&&(n.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(n.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?n.blobs=e.blobs.map(o=>ft(o)):n.blobs=e.blobs),typeof e.data<"u"&&(n.data=e.data),e.account&&(n.from=e.account.address),typeof e.from<"u"&&(n.from=e.from),typeof e.gas<"u"&&(n.gas=le(e.gas)),typeof e.gasPrice<"u"&&(n.gasPrice=le(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(n.maxFeePerBlobGas=le(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(n.maxFeePerGas=le(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(n.maxPriorityFeePerGas=le(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(n.nonce=le(e.nonce)),typeof e.to<"u"&&(n.to=e.to),typeof e.type<"u"&&(n.type=aa[e.type]),typeof e.value<"u"&&(n.value=le(e.value)),n}function ia(e){return e.map(t=>({address:t.address,r:t.r?le(BigInt(t.r)):t.r,s:t.s?le(BigInt(t.s)):t.s,chainId:le(t.chainId),nonce:le(t.nonce),...typeof t.yParity<"u"?{yParity:le(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:le(t.v)}:{}}))}const Mt=2n**256n-1n;function Rt(e){return typeof e[0]=="string"?St(e):ca(e)}function ca(e){let t=0;for(const s of e)t+=s.length;const n=new Uint8Array(t);let o=0;for(const s of e)n.set(s,o),o+=s.length;return n}function St(e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}class So extends ue{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class la extends ue{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}}class da extends ue{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}}const ua={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new da({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new la({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new So({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new So({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function Eo(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(ua);return n.bytes=e,n.dataView=new DataView(e.buffer??e,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function Et(e,t="hex"){const n=No(e),o=Eo(new Uint8Array(n.length));return n.encode(o),t==="hex"?ft(o.bytes):o.bytes}function No(e){return Array.isArray(e)?fa(e.map(t=>No(t))):pa(e)}function fa(e){const t=e.reduce((s,a)=>s+a.length,0),n=Co(t);return{length:t<=55?1+t:1+n+t,encode(s){t<=55?s.pushByte(192+t):(s.pushByte(247+n),n===1?s.pushUint8(t):n===2?s.pushUint16(t):n===3?s.pushUint24(t):s.pushUint32(t));for(const{encode:a}of e)a(s)}}}function pa(e){const t=typeof e=="string"?xt(e):e,n=Co(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length,encode(s){t.length===1&&t[0]<128?s.pushBytes(t):t.length<=55?(s.pushByte(128+t.length),s.pushBytes(t)):(s.pushByte(183+n),n===1?s.pushUint8(t.length):n===2?s.pushUint16(t.length):n===3?s.pushUint24(t.length):s.pushUint32(t.length),s.pushBytes(t))}}}function Co(e){if(e<2**8)return 1;if(e<2**16)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new ue("Length is too large.")}const ma={gwei:9,wei:18},ha={ether:-9,wei:9};function Ue(e,t){let n=e.toString();const o=n.startsWith("-");o&&(n=n.slice(1)),n=n.padStart(t,"0");let[s,a]=[n.slice(0,n.length-t),n.slice(n.length-t)];return a=a.replace(/(0+)$/,""),`${o?"-":""}${s||"0"}${a?`.${a}`:""}`}function ba(e,t="wei"){return Ue(e,ma[t])}function Nt(e,t="wei"){return Ue(e,ha[t])}function Bo(e){const t=Object.entries(e).map(([o,s])=>s===void 0||s===!1?null:[o,s]).filter(Boolean),n=t.reduce((o,[s])=>Math.max(o,s.length),0);return t.map(([o,s])=>` ${`${o}:`.padEnd(n+1)} ${s}`).join(`
79
- `)}class ga extends ue{constructor({v:t}){super(`Invalid \`v\` value "${t}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class wa extends ue{constructor({transaction:t}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",Bo(t),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}class ya extends ue{constructor({storageKey:t}){super(`Size for storage key "${t}" is invalid. Expected 32 bytes. Got ${Math.floor((t.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}function va(e){if(!e||e.length===0)return[];const t=[];for(const n of e){const{chainId:o,nonce:s,...a}=n,r=n.address;t.push([o?Ut(o):"0x",r,s?Ut(s):"0x",...Jt({},a)])}return t}function Io(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),o=typeof e.blobs[0]=="string"?e.blobs.map(a=>xt(a)):e.blobs,s=[];for(const a of o)s.push(Uint8Array.from(t.blobToKzgCommitment(a)));return n==="bytes"?s:s.map(a=>ft(a))}function Po(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),o=typeof e.blobs[0]=="string"?e.blobs.map(r=>xt(r)):e.blobs,s=typeof e.commitments[0]=="string"?e.commitments.map(r=>xt(r)):e.commitments,a=[];for(let r=0;r<o.length;r++){const l=o[r],d=s[r];a.push(Uint8Array.from(t.computeBlobKzgProof(l,d)))}return n==="bytes"?a:a.map(r=>ft(r))}function ka(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Fo(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function zt(e,...t){if(!ka(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function dn(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Do(e,t){zt(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function Aa(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function qt(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Fn(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function it(e,t){return e<<32-t|e>>>t}const Ta=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function xa(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function Sa(e){for(let t=0;t<e.length;t++)e[t]=xa(e[t]);return e}const _o=Ta?e=>e:Sa;function Ea(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function Dn(e){return typeof e=="string"&&(e=Ea(e)),zt(e),e}class Uo{}function Oo(e){const t=o=>e().update(Dn(o)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function Na(e,t,n,o){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,o);const s=BigInt(32),a=BigInt(4294967295),r=Number(n>>s&a),l=Number(n&a),d=o?4:0,T=o?0:4;e.setUint32(t+d,r,o),e.setUint32(t+T,l,o)}function Ca(e,t,n){return e&t^~e&n}function Ba(e,t,n){return e&t^e&n^t&n}class Ia extends Uo{constructor(t,n,o,s){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=n,this.padOffset=o,this.isLE=s,this.buffer=new Uint8Array(t),this.view=Fn(this.buffer)}update(t){dn(this),t=Dn(t),zt(t);const{view:n,buffer:o,blockLen:s}=this,a=t.length;for(let r=0;r<a;){const l=Math.min(s-this.pos,a-r);if(l===s){const d=Fn(t);for(;s<=a-r;r+=s)this.process(d,r);continue}o.set(t.subarray(r,r+l),this.pos),this.pos+=l,r+=l,this.pos===s&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){dn(this),Do(t,this),this.finished=!0;const{buffer:n,view:o,blockLen:s,isLE:a}=this;let{pos:r}=this;n[r++]=128,qt(this.buffer.subarray(r)),this.padOffset>s-r&&(this.process(o,0),r=0);for(let M=r;M<s;M++)n[M]=0;Na(o,s-8,BigInt(this.length*8),a),this.process(o,0);const l=Fn(t),d=this.outputLen;if(d%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const T=d/4,C=this.get();if(T>C.length)throw new Error("_sha2: outputLen bigger than state");for(let M=0;M<T;M++)l.setUint32(4*M,C[M],a)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const o=t.slice(0,n);return this.destroy(),o}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:o,length:s,finished:a,destroyed:r,pos:l}=this;return t.destroyed=r,t.finished=a,t.length=s,t.pos=l,s%n&&t.buffer.set(o),t}clone(){return this._cloneInto()}}const yt=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),un=BigInt(2**32-1),Lo=BigInt(32);function Pa(e,t=!1){return t?{h:Number(e&un),l:Number(e>>Lo&un)}:{h:Number(e>>Lo&un)|0,l:Number(e&un)|0}}function Fa(e,t=!1){const n=e.length;let o=new Uint32Array(n),s=new Uint32Array(n);for(let a=0;a<n;a++){const{h:r,l}=Pa(e[a],t);[o[a],s[a]]=[r,l]}return[o,s]}const Da=(e,t,n)=>e<<n|t>>>32-n,_a=(e,t,n)=>t<<n|e>>>32-n,Ua=(e,t,n)=>t<<n-32|e>>>64-n,Oa=(e,t,n)=>e<<n-32|t>>>64-n,La=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),vt=new Uint32Array(64);class Ma extends Ia{constructor(t=32){super(64,t,8,!1),this.A=yt[0]|0,this.B=yt[1]|0,this.C=yt[2]|0,this.D=yt[3]|0,this.E=yt[4]|0,this.F=yt[5]|0,this.G=yt[6]|0,this.H=yt[7]|0}get(){const{A:t,B:n,C:o,D:s,E:a,F:r,G:l,H:d}=this;return[t,n,o,s,a,r,l,d]}set(t,n,o,s,a,r,l,d){this.A=t|0,this.B=n|0,this.C=o|0,this.D=s|0,this.E=a|0,this.F=r|0,this.G=l|0,this.H=d|0}process(t,n){for(let M=0;M<16;M++,n+=4)vt[M]=t.getUint32(n,!1);for(let M=16;M<64;M++){const h=vt[M-15],x=vt[M-2],m=it(h,7)^it(h,18)^h>>>3,B=it(x,17)^it(x,19)^x>>>10;vt[M]=B+vt[M-7]+m+vt[M-16]|0}let{A:o,B:s,C:a,D:r,E:l,F:d,G:T,H:C}=this;for(let M=0;M<64;M++){const h=it(l,6)^it(l,11)^it(l,25),x=C+h+Ca(l,d,T)+La[M]+vt[M]|0,B=(it(o,2)^it(o,13)^it(o,22))+Ba(o,s,a)|0;C=T,T=d,d=l,l=r+x|0,r=a,a=s,s=o,o=x+B|0}o=o+this.A|0,s=s+this.B|0,a=a+this.C|0,r=r+this.D|0,l=l+this.E|0,d=d+this.F|0,T=T+this.G|0,C=C+this.H|0,this.set(o,s,a,r,l,d,T,C)}roundClean(){qt(vt)}destroy(){this.set(0,0,0,0,0,0,0,0),qt(this.buffer)}}const Ra=Oo(()=>new Ma);function $a(e,t){return Ra(Dt(e,{strict:!1})?Bn(e):e)}function Ha(e){const{commitment:t,version:n=1}=e,o=e.to??(typeof t=="string"?"hex":"bytes"),s=$a(t);return s.set([n],0),o==="bytes"?s:ft(s)}function Wa(e){const{commitments:t,version:n}=e,o=e.to??(typeof t[0]=="string"?"hex":"bytes"),s=[];for(const a of t)s.push(Ha({commitment:a,to:o,version:n}));return s}const Mo=6,Ro=32,_n=4096,$o=Ro*_n,Ho=$o*Mo-1-1*_n*Mo,Wo=1;class Va extends ue{constructor({maxSize:t,size:n}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${n} bytes`],name:"BlobSizeTooLargeError"})}}class Vo extends ue{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class Ga extends ue{constructor({hash:t,size:n}){super(`Versioned hash "${t}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${n}`],name:"InvalidVersionedHashSizeError"})}}class za extends ue{constructor({hash:t,version:n}){super(`Versioned hash "${t}" version is invalid.`,{metaMessages:[`Expected: ${Wo}`,`Received: ${n}`],name:"InvalidVersionedHashVersionError"})}}function qa(e){const t=e.to??(typeof e.data=="string"?"hex":"bytes"),n=typeof e.data=="string"?xt(e.data):e.data,o=Ve(n);if(!o)throw new Vo;if(o>Ho)throw new Va({maxSize:Ho,size:o});const s=[];let a=!0,r=0;for(;a;){const l=Eo(new Uint8Array($o));let d=0;for(;d<_n;){const T=n.slice(r,r+(Ro-1));if(l.pushByte(0),l.pushBytes(T),T.length<31){l.pushByte(128),a=!1;break}d++,r+=31}s.push(l)}return t==="bytes"?s.map(l=>l.bytes):s.map(l=>ft(l.bytes))}function Ya(e){const{data:t,kzg:n,to:o}=e,s=e.blobs??qa({data:t,to:o}),a=e.commitments??Io({blobs:s,kzg:n,to:o}),r=e.proofs??Po({blobs:s,commitments:a,kzg:n,to:o}),l=[];for(let d=0;d<s.length;d++)l.push({blob:s[d],commitment:a[d],proof:r[d]});return l}class ct extends ue{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}class fn extends ue{constructor({chainId:t}){super(typeof t=="number"?`Chain ID "${t}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}class $t extends ue{constructor({cause:t,message:n}={}){const o=n?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${o?`with reason: ${o}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"})}}Object.defineProperty($t,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty($t,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});class Ct extends ue{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${Nt(n)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}}Object.defineProperty(Ct,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class Un extends ue{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${Nt(n)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t,name:"FeeCapTooLowError"})}}Object.defineProperty(Un,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class On extends ue{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}is higher than the next one expected.`,{cause:t,name:"NonceTooHighError"})}}Object.defineProperty(On,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class Ln extends ue{constructor({cause:t,nonce:n}={}){super([`Nonce provided for the transaction ${n?`(${n}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
77
+ 选择要操作的代币:`,viewBalancesEmpty:"💰 您的钱包在此链上没有任何代币。",viewBalancesFetchError:"获取余额时遇到错误,请重试。",buttonSendToken:"发送{symbol}",buttonSwapToken:"兑换{symbol}",buttonBuyMoreToken:"购买更多{symbol}",actionSendNativeLabel:"发送原生代币",actionSendNativeDesc:"发送原生代币(ETH、BNB、MATIC 等)到某个地址",actionSendTokenLabel:"发送代币(ERC20)",actionSendTokenDesc:"将 ERC20 代币发送到某个地址",actionSwapTokenLabel:"兑换代币",actionSwapTokenDesc:"将一种代币兑换为另一种代币",actionApproveTokenLabel:"授权代币",actionApproveTokenDesc:"授权某地址使用您的代币",actionWrapNativeLabel:"包装原生代币",actionWrapNativeDesc:"包装原生代币(ETH → WETH)",actionUnwrapNativeLabel:"解包原生代币",actionUnwrapNativeDesc:"解包原生代币(WETH → ETH)",actionSendNftLabel:"发送 NFT",actionSendNftDesc:"将 ERC721 或 ERC1155 NFT 转移到另一个地址",fieldToAddress:"收款地址",fieldAmount:"数量",fieldTokenContract:"代币合约",fieldTokenSymbol:"代币符号",fieldDecimals:"小数位数",fieldTokenIn:"源代币",fieldTokenInSymbol:"源代币符号",fieldTokenOut:"目标代币",fieldTokenOutSymbol:"目标代币符号",fieldTokenInDecimals:"源代币小数位",fieldTokenOutDecimals:"目标代币小数位",fieldSpenderAddress:"授权地址",fieldAmountUnlimited:"数量(留空 = 无限授权)",fieldNftContract:"NFT 合约",fieldTokenId:"Token ID",fieldTokenStandard:"代币标准",fieldNftName:"NFT 名称",formMustBePositiveInteger:"必须是正整数",formAmountExceedsNft:"数量不能超过可用余额 {max}"}};function mo(e,t){return po[t]?.[e]??po.en[e]??e}function Ws(e,t){return e.replace(/\{(\w+)\}/g,(n,o)=>t[o]??`{${o}}`)}const ho=ne.createContext(void 0),Vs=({children:e,initialLanguage:t="en"})=>{const[n,o]=ne.useState(t);ne.useEffect(()=>{t&&o(t)},[t]);const s=ne.useCallback(r=>mo(r,n),[n]),a=ne.useCallback((r,i)=>Ws(mo(r,n),i),[n]);return P.jsx(ho.Provider,{value:{language:n,setLanguage:o,t:s,ti:a},children:e})},Sn=()=>{const e=ne.useContext(ho);if(!e)throw new Error("useLanguage must be used within a LanguageProvider");return e},Gs=ne.memo(({onClick:e})=>{const{t}=Sn(),n=o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),e())};return P.jsx("button",{className:"chat-button",onClick:e,onKeyDown:n,"aria-label":t("openChat"),title:t("openChatTitle"),type:"button",children:P.jsx("img",{src:Hs,width:56,height:56,alt:"Ask AI"})})});function ut(e){const t={formatters:void 0,fees:void 0,serializers:void 0,...e};function n(o){return s=>{const a=typeof s=="function"?s(o):s,r={...o,...a};return Object.assign(r,{extend:n(r)})}}return Object.assign(t,{extend:n(t)})}const bo="2.45.1";let Nn={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${bo}`};class ue extends Error{constructor(t,n={}){const o=n.cause instanceof ue?n.cause.details:n.cause?.message?n.cause.message:n.details,s=n.cause instanceof ue&&n.cause.docsPath||n.docsPath,a=Nn.getDocsUrl?.({...n,docsPath:s}),r=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...o?[`Details: ${o}`]:[],...Nn.version?[`Version: ${Nn.version}`]:[]].join(`
78
+ `);super(r,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=o,this.docsPath=s,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=t,this.version=bo}walk(t){return go(this,t)}}function go(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?go(e.cause,t):t?null:e}class Cn extends ue{constructor({max:t,min:n,signed:o,size:s,value:a}){super(`Number "${a}" is not in safe ${s?`${s*8}-bit ${o?"signed":"unsigned"} `:""}integer range ${t?`(${n} to ${t})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}}class zs extends ue{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}}function Dt(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function Ge(e){return Dt(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function cn(e,{dir:t="left"}={}){let n=typeof e=="string"?e.replace("0x",""):e,o=0;for(let s=0;s<n.length-1&&n[t==="left"?s:n.length-s-1].toString()==="0";s++)o++;return n=t==="left"?n.slice(o):n.slice(0,n.length-o),typeof e=="string"?(n.length===1&&t==="right"&&(n=`${n}0`),`0x${n.length%2===1?`0${n}`:n}`):n}class wo extends ue{constructor({offset:t,position:n,size:o}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${o}).`,{name:"SliceOffsetOutOfBoundsError"})}}class yo extends ue{constructor({size:t,targetSize:n,type:o}){super(`${o.charAt(0).toUpperCase()}${o.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}}function _t(e,{dir:t,size:n=32}={}){return typeof e=="string"?wt(e,{dir:t,size:n}):qs(e,{dir:t,size:n})}function wt(e,{dir:t,size:n=32}={}){if(n===null)return e;const o=e.replace("0x","");if(o.length>n*2)throw new yo({size:Math.ceil(o.length/2),targetSize:n,type:"hex"});return`0x${o[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function qs(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new yo({size:e.length,targetSize:n,type:"bytes"});const o=new Uint8Array(n);for(let s=0;s<n;s++){const a=t==="right";o[a?s:n-s-1]=e[a?s:e.length-s-1]}return o}const Ys=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Ot(e,t={}){return typeof e=="number"||typeof e=="bigint"?le(e,t):typeof e=="string"?ko(e,t):typeof e=="boolean"?vo(e,t):ft(e,t)}function vo(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(Ut(n,{size:t.size}),_t(n,{size:t.size})):n}function ft(e,t={}){let n="";for(let s=0;s<e.length;s++)n+=Ys[e[s]];const o=`0x${n}`;return typeof t.size=="number"?(Ut(o,{size:t.size}),_t(o,{dir:"right",size:t.size})):o}function le(e,t={}){const{signed:n,size:o}=t,s=BigInt(e);let a;o?n?a=(1n<<BigInt(o)*8n-1n)-1n:a=2n**(BigInt(o)*8n)-1n:typeof e=="number"&&(a=BigInt(Number.MAX_SAFE_INTEGER));const r=typeof a=="bigint"&&n?-a-1n:0;if(a&&s>a||s<r){const d=typeof e=="bigint"?"n":"";throw new Cn({max:a?`${a}${d}`:void 0,min:`${r}${d}`,signed:n,size:o,value:`${e}${d}`})}const i=`0x${(n&&s<0?(1n<<BigInt(o*8))+BigInt(s):s).toString(16)}`;return o?_t(i,{size:o}):i}const js=new TextEncoder;function ko(e,t={}){const n=js.encode(e);return ft(n,t)}const Js=new TextEncoder;function Bn(e,t={}){return typeof e=="number"||typeof e=="bigint"?Ks(e,t):typeof e=="boolean"?Xs(e,t):Dt(e)?xt(e,t):To(e,t)}function Xs(e,t={}){const n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(Ut(n,{size:t.size}),_t(n,{size:t.size})):n}const pt={zero:48,nine:57,A:65,F:70,a:97,f:102};function Ao(e){if(e>=pt.zero&&e<=pt.nine)return e-pt.zero;if(e>=pt.A&&e<=pt.F)return e-(pt.A-10);if(e>=pt.a&&e<=pt.f)return e-(pt.a-10)}function xt(e,t={}){let n=e;t.size&&(Ut(n,{size:t.size}),n=_t(n,{dir:"right",size:t.size}));let o=n.slice(2);o.length%2&&(o=`0${o}`);const s=o.length/2,a=new Uint8Array(s);for(let r=0,i=0;r<s;r++){const d=Ao(o.charCodeAt(i++)),T=Ao(o.charCodeAt(i++));if(d===void 0||T===void 0)throw new ue(`Invalid byte sequence ("${o[i-2]}${o[i-1]}" in "${o}").`);a[r]=d*16+T}return a}function Ks(e,t){const n=le(e,t);return xt(n)}function To(e,t={}){const n=Js.encode(e);return typeof t.size=="number"?(Ut(n,{size:t.size}),_t(n,{dir:"right",size:t.size})):n}function Ut(e,{size:t}){if(Ge(e)>t)throw new zs({givenSize:Ge(e),maxSize:t})}function Lt(e,t={}){const{signed:n}=t;t.size&&Ut(e,{size:t.size});const o=BigInt(e);if(!n)return o;const s=(e.length-2)/2,a=(1n<<BigInt(s)*8n-1n)-1n;return o<=a?o:o-BigInt(`0x${"f".padStart(s*2,"f")}`)-1n}function ln(e,t={}){const n=Lt(e,t),o=Number(n);if(!Number.isSafeInteger(o))throw new Cn({max:`${Number.MAX_SAFE_INTEGER}`,min:`${Number.MIN_SAFE_INTEGER}`,signed:t.signed,size:t.size,value:`${n}n`});return o}function In(e,t){return({exclude:n,format:o})=>({exclude:n,format:(s,a)=>{const r=t(s,a);if(n)for(const i of n)delete r[i];return{...r,...o(s,a)}},type:e})}const xo={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function Pn(e,t){const n={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?ln(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?ln(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?xo[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return e.authorizationList&&(n.authorizationList=Qs(e.authorizationList)),n.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof n.v=="bigint"){if(n.v===0n||n.v===27n)return 0;if(n.v===1n||n.v===28n)return 1;if(n.v>=35n)return n.v%2n===0n?1:0}})(),n.type==="legacy"&&(delete n.accessList,delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas,delete n.yParity),n.type==="eip2930"&&(delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas),n.type==="eip1559"&&delete n.maxFeePerBlobGas,n}const Zs=In("transaction",Pn);function Qs(e){return e.map(t=>({address:t.address,chainId:Number(t.chainId),nonce:Number(t.nonce),r:t.r,s:t.s,yParity:Number(t.yParity)}))}function ea(e,t){const n=(e.transactions??[]).map(o=>typeof o=="string"?o:Pn(o));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:n,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}const ta=In("block",ea);function na(e,{args:t,eventName:n}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,blockTimestamp:e.blockTimestamp?BigInt(e.blockTimestamp):e.blockTimestamp===null?null:void 0,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...n?{args:t,eventName:n}:{}}}const oa={"0x0":"reverted","0x1":"success"};function sa(e,t){const n={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(o=>na(o)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?ln(e.transactionIndex):null,status:e.status?oa[e.status]:null,type:e.type?xo[e.type]||e.type:null};return e.blobGasPrice&&(n.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(n.blobGasUsed=BigInt(e.blobGasUsed)),n}const aa=In("transactionReceipt",sa),ra={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function ia(e,t){const n={};return typeof e.authorizationList<"u"&&(n.authorizationList=ca(e.authorizationList)),typeof e.accessList<"u"&&(n.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(n.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?n.blobs=e.blobs.map(o=>ft(o)):n.blobs=e.blobs),typeof e.data<"u"&&(n.data=e.data),e.account&&(n.from=e.account.address),typeof e.from<"u"&&(n.from=e.from),typeof e.gas<"u"&&(n.gas=le(e.gas)),typeof e.gasPrice<"u"&&(n.gasPrice=le(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(n.maxFeePerBlobGas=le(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(n.maxFeePerGas=le(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(n.maxPriorityFeePerGas=le(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(n.nonce=le(e.nonce)),typeof e.to<"u"&&(n.to=e.to),typeof e.type<"u"&&(n.type=ra[e.type]),typeof e.value<"u"&&(n.value=le(e.value)),n}function ca(e){return e.map(t=>({address:t.address,r:t.r?le(BigInt(t.r)):t.r,s:t.s?le(BigInt(t.s)):t.s,chainId:le(t.chainId),nonce:le(t.nonce),...typeof t.yParity<"u"?{yParity:le(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:le(t.v)}:{}}))}const Mt=2n**256n-1n;function Rt(e){return typeof e[0]=="string"?Et(e):la(e)}function la(e){let t=0;for(const s of e)t+=s.length;const n=new Uint8Array(t);let o=0;for(const s of e)n.set(s,o),o+=s.length;return n}function Et(e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}class Eo extends ue{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class da extends ue{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}}class ua extends ue{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}}const fa={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new ua({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new da({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new Eo({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new Eo({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function So(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(fa);return n.bytes=e,n.dataView=new DataView(e.buffer??e,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function St(e,t="hex"){const n=No(e),o=So(new Uint8Array(n.length));return n.encode(o),t==="hex"?ft(o.bytes):o.bytes}function No(e){return Array.isArray(e)?pa(e.map(t=>No(t))):ma(e)}function pa(e){const t=e.reduce((s,a)=>s+a.length,0),n=Co(t);return{length:t<=55?1+t:1+n+t,encode(s){t<=55?s.pushByte(192+t):(s.pushByte(247+n),n===1?s.pushUint8(t):n===2?s.pushUint16(t):n===3?s.pushUint24(t):s.pushUint32(t));for(const{encode:a}of e)a(s)}}}function ma(e){const t=typeof e=="string"?xt(e):e,n=Co(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length,encode(s){t.length===1&&t[0]<128?s.pushBytes(t):t.length<=55?(s.pushByte(128+t.length),s.pushBytes(t)):(s.pushByte(183+n),n===1?s.pushUint8(t.length):n===2?s.pushUint16(t.length):n===3?s.pushUint24(t.length):s.pushUint32(t.length),s.pushBytes(t))}}}function Co(e){if(e<2**8)return 1;if(e<2**16)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new ue("Length is too large.")}const ha={gwei:9,wei:18},ba={ether:-9,wei:9};function Oe(e,t){let n=e.toString();const o=n.startsWith("-");o&&(n=n.slice(1)),n=n.padStart(t,"0");let[s,a]=[n.slice(0,n.length-t),n.slice(n.length-t)];return a=a.replace(/(0+)$/,""),`${o?"-":""}${s||"0"}${a?`.${a}`:""}`}function ga(e,t="wei"){return Oe(e,ha[t])}function Nt(e,t="wei"){return Oe(e,ba[t])}function Bo(e){const t=Object.entries(e).map(([o,s])=>s===void 0||s===!1?null:[o,s]).filter(Boolean),n=t.reduce((o,[s])=>Math.max(o,s.length),0);return t.map(([o,s])=>` ${`${o}:`.padEnd(n+1)} ${s}`).join(`
79
+ `)}class wa extends ue{constructor({v:t}){super(`Invalid \`v\` value "${t}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class ya extends ue{constructor({transaction:t}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",Bo(t),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}class va extends ue{constructor({storageKey:t}){super(`Size for storage key "${t}" is invalid. Expected 32 bytes. Got ${Math.floor((t.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}function ka(e){if(!e||e.length===0)return[];const t=[];for(const n of e){const{chainId:o,nonce:s,...a}=n,r=n.address;t.push([o?Ot(o):"0x",r,s?Ot(s):"0x",...Jt({},a)])}return t}function Io(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),o=typeof e.blobs[0]=="string"?e.blobs.map(a=>xt(a)):e.blobs,s=[];for(const a of o)s.push(Uint8Array.from(t.blobToKzgCommitment(a)));return n==="bytes"?s:s.map(a=>ft(a))}function Po(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),o=typeof e.blobs[0]=="string"?e.blobs.map(r=>xt(r)):e.blobs,s=typeof e.commitments[0]=="string"?e.commitments.map(r=>xt(r)):e.commitments,a=[];for(let r=0;r<o.length;r++){const i=o[r],d=s[r];a.push(Uint8Array.from(t.computeBlobKzgProof(i,d)))}return n==="bytes"?a:a.map(r=>ft(r))}function Aa(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Fo(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function zt(e,...t){if(!Aa(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function dn(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Do(e,t){zt(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function Ta(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function qt(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Fn(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function it(e,t){return e<<32-t|e>>>t}const xa=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Ea(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function Sa(e){for(let t=0;t<e.length;t++)e[t]=Ea(e[t]);return e}const _o=xa?e=>e:Sa;function Na(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function Dn(e){return typeof e=="string"&&(e=Na(e)),zt(e),e}class Oo{}function Uo(e){const t=o=>e().update(Dn(o)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function Ca(e,t,n,o){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,o);const s=BigInt(32),a=BigInt(4294967295),r=Number(n>>s&a),i=Number(n&a),d=o?4:0,T=o?0:4;e.setUint32(t+d,r,o),e.setUint32(t+T,i,o)}function Ba(e,t,n){return e&t^~e&n}function Ia(e,t,n){return e&t^e&n^t&n}class Pa extends Oo{constructor(t,n,o,s){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=n,this.padOffset=o,this.isLE=s,this.buffer=new Uint8Array(t),this.view=Fn(this.buffer)}update(t){dn(this),t=Dn(t),zt(t);const{view:n,buffer:o,blockLen:s}=this,a=t.length;for(let r=0;r<a;){const i=Math.min(s-this.pos,a-r);if(i===s){const d=Fn(t);for(;s<=a-r;r+=s)this.process(d,r);continue}o.set(t.subarray(r,r+i),this.pos),this.pos+=i,r+=i,this.pos===s&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){dn(this),Do(t,this),this.finished=!0;const{buffer:n,view:o,blockLen:s,isLE:a}=this;let{pos:r}=this;n[r++]=128,qt(this.buffer.subarray(r)),this.padOffset>s-r&&(this.process(o,0),r=0);for(let R=r;R<s;R++)n[R]=0;Ca(o,s-8,BigInt(this.length*8),a),this.process(o,0);const i=Fn(t),d=this.outputLen;if(d%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const T=d/4,B=this.get();if(T>B.length)throw new Error("_sha2: outputLen bigger than state");for(let R=0;R<T;R++)i.setUint32(4*R,B[R],a)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const o=t.slice(0,n);return this.destroy(),o}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:o,length:s,finished:a,destroyed:r,pos:i}=this;return t.destroyed=r,t.finished=a,t.length=s,t.pos=i,s%n&&t.buffer.set(o),t}clone(){return this._cloneInto()}}const yt=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),un=BigInt(2**32-1),Lo=BigInt(32);function Fa(e,t=!1){return t?{h:Number(e&un),l:Number(e>>Lo&un)}:{h:Number(e>>Lo&un)|0,l:Number(e&un)|0}}function Da(e,t=!1){const n=e.length;let o=new Uint32Array(n),s=new Uint32Array(n);for(let a=0;a<n;a++){const{h:r,l:i}=Fa(e[a],t);[o[a],s[a]]=[r,i]}return[o,s]}const _a=(e,t,n)=>e<<n|t>>>32-n,Oa=(e,t,n)=>t<<n|e>>>32-n,Ua=(e,t,n)=>t<<n-32|e>>>64-n,La=(e,t,n)=>e<<n-32|t>>>64-n,Ma=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),vt=new Uint32Array(64);class Ra extends Pa{constructor(t=32){super(64,t,8,!1),this.A=yt[0]|0,this.B=yt[1]|0,this.C=yt[2]|0,this.D=yt[3]|0,this.E=yt[4]|0,this.F=yt[5]|0,this.G=yt[6]|0,this.H=yt[7]|0}get(){const{A:t,B:n,C:o,D:s,E:a,F:r,G:i,H:d}=this;return[t,n,o,s,a,r,i,d]}set(t,n,o,s,a,r,i,d){this.A=t|0,this.B=n|0,this.C=o|0,this.D=s|0,this.E=a|0,this.F=r|0,this.G=i|0,this.H=d|0}process(t,n){for(let R=0;R<16;R++,n+=4)vt[R]=t.getUint32(n,!1);for(let R=16;R<64;R++){const h=vt[R-15],x=vt[R-2],m=it(h,7)^it(h,18)^h>>>3,C=it(x,17)^it(x,19)^x>>>10;vt[R]=C+vt[R-7]+m+vt[R-16]|0}let{A:o,B:s,C:a,D:r,E:i,F:d,G:T,H:B}=this;for(let R=0;R<64;R++){const h=it(i,6)^it(i,11)^it(i,25),x=B+h+Ba(i,d,T)+Ma[R]+vt[R]|0,C=(it(o,2)^it(o,13)^it(o,22))+Ia(o,s,a)|0;B=T,T=d,d=i,i=r+x|0,r=a,a=s,s=o,o=x+C|0}o=o+this.A|0,s=s+this.B|0,a=a+this.C|0,r=r+this.D|0,i=i+this.E|0,d=d+this.F|0,T=T+this.G|0,B=B+this.H|0,this.set(o,s,a,r,i,d,T,B)}roundClean(){qt(vt)}destroy(){this.set(0,0,0,0,0,0,0,0),qt(this.buffer)}}const $a=Uo(()=>new Ra);function Ha(e,t){return $a(Dt(e,{strict:!1})?Bn(e):e)}function Wa(e){const{commitment:t,version:n=1}=e,o=e.to??(typeof t=="string"?"hex":"bytes"),s=Ha(t);return s.set([n],0),o==="bytes"?s:ft(s)}function Va(e){const{commitments:t,version:n}=e,o=e.to??(typeof t[0]=="string"?"hex":"bytes"),s=[];for(const a of t)s.push(Wa({commitment:a,to:o,version:n}));return s}const Mo=6,Ro=32,_n=4096,$o=Ro*_n,Ho=$o*Mo-1-1*_n*Mo,Wo=1;class Ga extends ue{constructor({maxSize:t,size:n}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${n} bytes`],name:"BlobSizeTooLargeError"})}}class Vo extends ue{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class za extends ue{constructor({hash:t,size:n}){super(`Versioned hash "${t}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${n}`],name:"InvalidVersionedHashSizeError"})}}class qa extends ue{constructor({hash:t,version:n}){super(`Versioned hash "${t}" version is invalid.`,{metaMessages:[`Expected: ${Wo}`,`Received: ${n}`],name:"InvalidVersionedHashVersionError"})}}function Ya(e){const t=e.to??(typeof e.data=="string"?"hex":"bytes"),n=typeof e.data=="string"?xt(e.data):e.data,o=Ge(n);if(!o)throw new Vo;if(o>Ho)throw new Ga({maxSize:Ho,size:o});const s=[];let a=!0,r=0;for(;a;){const i=So(new Uint8Array($o));let d=0;for(;d<_n;){const T=n.slice(r,r+(Ro-1));if(i.pushByte(0),i.pushBytes(T),T.length<31){i.pushByte(128),a=!1;break}d++,r+=31}s.push(i)}return t==="bytes"?s.map(i=>i.bytes):s.map(i=>ft(i.bytes))}function ja(e){const{data:t,kzg:n,to:o}=e,s=e.blobs??Ya({data:t,to:o}),a=e.commitments??Io({blobs:s,kzg:n,to:o}),r=e.proofs??Po({blobs:s,commitments:a,kzg:n,to:o}),i=[];for(let d=0;d<s.length;d++)i.push({blob:s[d],commitment:a[d],proof:r[d]});return i}class ct extends ue{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}class fn extends ue{constructor({chainId:t}){super(typeof t=="number"?`Chain ID "${t}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}class $t extends ue{constructor({cause:t,message:n}={}){const o=n?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${o?`with reason: ${o}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"})}}Object.defineProperty($t,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty($t,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});class Ct extends ue{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${Nt(n)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}}Object.defineProperty(Ct,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class On extends ue{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${Nt(n)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t,name:"FeeCapTooLowError"})}}Object.defineProperty(On,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class Un extends ue{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}is higher than the next one expected.`,{cause:t,name:"NonceTooHighError"})}}Object.defineProperty(Un,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class Ln extends ue{constructor({cause:t,nonce:n}={}){super([`Nonce provided for the transaction ${n?`(${n}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
80
80
  `),{cause:t,name:"NonceTooLowError"})}}Object.defineProperty(Ln,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class Mn extends ue{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}exceeds the maximum allowed nonce.`,{cause:t,name:"NonceMaxValueError"})}}Object.defineProperty(Mn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class Rn extends ue{constructor({cause:t}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
81
81
  `),{cause:t,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(Rn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class $n extends ue{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:t,name:"IntrinsicGasTooHighError"})}}Object.defineProperty($n,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class Hn extends ue{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction is too low.`,{cause:t,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(Hn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class Wn extends ue{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(Wn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class Yt extends ue{constructor({cause:t,maxPriorityFeePerGas:n,maxFeePerGas:o}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${n?` = ${Nt(n)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${o?` = ${Nt(o)} gwei`:""}).`].join(`
82
- `),{cause:t,name:"TipAboveFeeCapError"})}}Object.defineProperty(Yt,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class Go extends ue{constructor({cause:t}){super(`An error occurred while executing: ${t?.shortMessage}`,{cause:t,name:"UnknownNodeError"})}}class zo extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const o=this.keys().next().value;o&&this.delete(o)}return this}}const ja=BigInt(0),jt=BigInt(1),Ja=BigInt(2),Xa=BigInt(7),Ka=BigInt(256),Za=BigInt(113),qo=[],Yo=[],jo=[];for(let e=0,t=jt,n=1,o=0;e<24;e++){[n,o]=[o,(2*n+3*o)%5],qo.push(2*(5*o+n)),Yo.push((e+1)*(e+2)/2%64);let s=ja;for(let a=0;a<7;a++)t=(t<<jt^(t>>Xa)*Za)%Ka,t&Ja&&(s^=jt<<(jt<<BigInt(a))-jt);jo.push(s)}const Jo=Fa(jo,!0),Qa=Jo[0],er=Jo[1],Xo=(e,t,n)=>n>32?Ua(e,t,n):Da(e,t,n),Ko=(e,t,n)=>n>32?Oa(e,t,n):_a(e,t,n);function tr(e,t=24){const n=new Uint32Array(10);for(let o=24-t;o<24;o++){for(let r=0;r<10;r++)n[r]=e[r]^e[r+10]^e[r+20]^e[r+30]^e[r+40];for(let r=0;r<10;r+=2){const l=(r+8)%10,d=(r+2)%10,T=n[d],C=n[d+1],M=Xo(T,C,1)^n[l],h=Ko(T,C,1)^n[l+1];for(let x=0;x<50;x+=10)e[r+x]^=M,e[r+x+1]^=h}let s=e[2],a=e[3];for(let r=0;r<24;r++){const l=Yo[r],d=Xo(s,a,l),T=Ko(s,a,l),C=qo[r];s=e[C],a=e[C+1],e[C]=d,e[C+1]=T}for(let r=0;r<50;r+=10){for(let l=0;l<10;l++)n[l]=e[r+l];for(let l=0;l<10;l++)e[r+l]^=~n[(l+2)%10]&n[(l+4)%10]}e[0]^=Qa[o],e[1]^=er[o]}qt(n)}class Vn extends Uo{constructor(t,n,o,s=!1,a=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=n,this.outputLen=o,this.enableXOF=s,this.rounds=a,Fo(o),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=Aa(this.state)}clone(){return this._cloneInto()}keccak(){_o(this.state32),tr(this.state32,this.rounds),_o(this.state32),this.posOut=0,this.pos=0}update(t){dn(this),t=Dn(t),zt(t);const{blockLen:n,state:o}=this,s=t.length;for(let a=0;a<s;){const r=Math.min(n-this.pos,s-a);for(let l=0;l<r;l++)o[this.pos++]^=t[a++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:o,blockLen:s}=this;t[o]^=n,(n&128)!==0&&o===s-1&&this.keccak(),t[s-1]^=128,this.keccak()}writeInto(t){dn(this,!1),zt(t),this.finish();const n=this.state,{blockLen:o}=this;for(let s=0,a=t.length;s<a;){this.posOut>=o&&this.keccak();const r=Math.min(o-this.posOut,a-s);t.set(n.subarray(this.posOut,this.posOut+r),s),this.posOut+=r,s+=r}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return Fo(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Do(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,qt(this.state)}_cloneInto(t){const{blockLen:n,suffix:o,outputLen:s,rounds:a,enableXOF:r}=this;return t||(t=new Vn(n,o,s,r,a)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=a,t.suffix=o,t.outputLen=s,t.enableXOF=r,t.destroyed=this.destroyed,t}}const nr=(e,t,n)=>Oo(()=>new Vn(t,e,n)),or=nr(1,136,256/8);function Zo(e,t){const n=t||"hex",o=or(Dt(e,{strict:!1})?Bn(e):e);return n==="bytes"?o:Ut(o)}const Gn=new zo(8192);function sr(e,t){if(Gn.has(`${e}.${t}`))return Gn.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),o=Zo(To(n),"bytes"),s=n.split("");for(let r=0;r<40;r+=2)o[r>>1]>>4>=8&&s[r]&&(s[r]=s[r].toUpperCase()),(o[r>>1]&15)>=8&&s[r+1]&&(s[r+1]=s[r+1].toUpperCase());const a=`0x${s.join("")}`;return Gn.set(`${e}.${t}`,a),a}const ar=/^0x[a-fA-F0-9]{40}$/,zn=new zo(8192);function Re(e,t){const{strict:n=!0}=t??{},o=`${e}.${n}`;if(zn.has(o))return zn.get(o);const s=ar.test(e)?e.toLowerCase()===e?!0:n?sr(e)===e:!0:!1;return zn.set(o,s),s}function qn(e,t,n,{strict:o}={}){return Dt(e,{strict:!1})?ir(e,t,n,{strict:o}):rr(e,t,n,{strict:o})}function Qo(e,t){if(typeof t=="number"&&t>0&&t>Ve(e)-1)throw new wo({offset:t,position:"start",size:Ve(e)})}function es(e,t,n){if(typeof t=="number"&&typeof n=="number"&&Ve(e)!==n-t)throw new wo({offset:n,position:"end",size:Ve(e)})}function rr(e,t,n,{strict:o}={}){Qo(e,t);const s=e.slice(t,n);return o&&es(s,t,n),s}function ir(e,t,n,{strict:o}={}){Qo(e,t);const s=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return o&&es(s,t,n),s}function cr(e){const{authorizationList:t}=e;if(t)for(const n of t){const{chainId:o}=n,s=n.address;if(!Re(s))throw new ct({address:s});if(o<0)throw new fn({chainId:o})}Yn(e)}function lr(e){const{blobVersionedHashes:t}=e;if(t){if(t.length===0)throw new Vo;for(const n of t){const o=Ve(n),s=ln(qn(n,0,1));if(o!==32)throw new Ga({hash:n,size:o});if(s!==Wo)throw new za({hash:n,version:s})}}Yn(e)}function Yn(e){const{chainId:t,maxPriorityFeePerGas:n,maxFeePerGas:o,to:s}=e;if(t<=0)throw new fn({chainId:t});if(s&&!Re(s))throw new ct({address:s});if(o&&o>Mt)throw new Ct({maxFeePerGas:o});if(n&&o&&n>o)throw new Yt({maxFeePerGas:o,maxPriorityFeePerGas:n})}function dr(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:o,maxFeePerGas:s,to:a}=e;if(t<=0)throw new fn({chainId:t});if(a&&!Re(a))throw new ct({address:a});if(n||s)throw new ue("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(o&&o>Mt)throw new Ct({maxFeePerGas:o})}function ur(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:o,maxFeePerGas:s,to:a}=e;if(a&&!Re(a))throw new ct({address:a});if(typeof t<"u"&&t<=0)throw new fn({chainId:t});if(n||s)throw new ue("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(o&&o>Mt)throw new Ct({maxFeePerGas:o})}function fr(e){if(e.type)return e.type;if(typeof e.authorizationList<"u")return"eip7702";if(typeof e.blobs<"u"||typeof e.blobVersionedHashes<"u"||typeof e.maxFeePerBlobGas<"u"||typeof e.sidecars<"u")return"eip4844";if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")return"eip1559";if(typeof e.gasPrice<"u")return typeof e.accessList<"u"?"eip2930":"legacy";throw new wa({transaction:e})}function pn(e){if(!e||e.length===0)return[];const t=[];for(let n=0;n<e.length;n++){const{address:o,storageKeys:s}=e[n];for(let a=0;a<s.length;a++)if(s[a].length-2!==64)throw new ya({storageKey:s[a]});if(!Re(o,{strict:!1}))throw new ct({address:o});t.push([o,s])}return t}function pr(e,t){const n=fr(e);return n==="eip1559"?br(e,t):n==="eip2930"?gr(e,t):n==="eip4844"?hr(e,t):n==="eip7702"?mr(e,t):wr(e,t)}function mr(e,t){const{authorizationList:n,chainId:o,gas:s,nonce:a,to:r,value:l,maxFeePerGas:d,maxPriorityFeePerGas:T,accessList:C,data:M}=e;cr(e);const h=pn(C),x=va(n);return St(["0x04",Et([le(o),a?le(a):"0x",T?le(T):"0x",d?le(d):"0x",s?le(s):"0x",r??"0x",l?le(l):"0x",M??"0x",h,x,...Jt(e,t)])])}function hr(e,t){const{chainId:n,gas:o,nonce:s,to:a,value:r,maxFeePerBlobGas:l,maxFeePerGas:d,maxPriorityFeePerGas:T,accessList:C,data:M}=e;lr(e);let h=e.blobVersionedHashes,x=e.sidecars;if(e.blobs&&(typeof h>"u"||typeof x>"u")){const V=typeof e.blobs[0]=="string"?e.blobs:e.blobs.map(pe=>ft(pe)),X=e.kzg,fe=Io({blobs:V,kzg:X});if(typeof h>"u"&&(h=Wa({commitments:fe})),typeof x>"u"){const pe=Po({blobs:V,commitments:fe,kzg:X});x=Ya({blobs:V,commitments:fe,proofs:pe})}}const m=pn(C),B=[le(n),s?le(s):"0x",T?le(T):"0x",d?le(d):"0x",o?le(o):"0x",a??"0x",r?le(r):"0x",M??"0x",m,l?le(l):"0x",h??[],...Jt(e,t)],L=[],ke=[],N=[];if(x)for(let V=0;V<x.length;V++){const{blob:X,commitment:fe,proof:pe}=x[V];L.push(X),ke.push(fe),N.push(pe)}return St(["0x03",Et(x?[B,L,ke,N]:B)])}function br(e,t){const{chainId:n,gas:o,nonce:s,to:a,value:r,maxFeePerGas:l,maxPriorityFeePerGas:d,accessList:T,data:C}=e;Yn(e);const M=pn(T),h=[le(n),s?le(s):"0x",d?le(d):"0x",l?le(l):"0x",o?le(o):"0x",a??"0x",r?le(r):"0x",C??"0x",M,...Jt(e,t)];return St(["0x02",Et(h)])}function gr(e,t){const{chainId:n,gas:o,data:s,nonce:a,to:r,value:l,accessList:d,gasPrice:T}=e;dr(e);const C=pn(d),M=[le(n),a?le(a):"0x",T?le(T):"0x",o?le(o):"0x",r??"0x",l?le(l):"0x",s??"0x",C,...Jt(e,t)];return St(["0x01",Et(M)])}function wr(e,t){const{chainId:n=0,gas:o,data:s,nonce:a,to:r,value:l,gasPrice:d}=e;ur(e);let T=[a?le(a):"0x",d?le(d):"0x",o?le(o):"0x",r??"0x",l?le(l):"0x",s??"0x"];if(t){const C=(()=>{if(t.v>=35n)return(t.v-35n)/2n>0?t.v:27n+(t.v===35n?0n:1n);if(n>0)return BigInt(n*2)+BigInt(35n+t.v-27n);const x=27n+(t.v===27n?0n:1n);if(t.v!==x)throw new ga({v:t.v});return x})(),M=cn(t.r),h=cn(t.s);T=[...T,le(C),M==="0x00"?"0x":M,h==="0x00"?"0x":h]}else n>0&&(T=[...T,le(n),"0x","0x"]);return Et(T)}function Jt(e,t){const n=t??e,{v:o,yParity:s}=n;if(typeof n.r>"u")return[];if(typeof n.s>"u")return[];if(typeof o>"u"&&typeof s>"u")return[];const a=cn(n.r),r=cn(n.s);return[typeof s=="number"?s?le(1):"0x":o===0n?"0x":o===1n?le(1):o===27n?"0x":le(1),a==="0x00"?"0x":a,r==="0x00"?"0x":r]}const yr={gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}},vr={block:ea({format(e){return{transactions:e.transactions?.map(n=>{if(typeof n=="string")return n;const o=Pn(n);return o.typeHex==="0x7e"&&(o.isSystemTx=n.isSystemTx,o.mint=n.mint?Lt(n.mint):void 0,o.sourceHash=n.sourceHash,o.type="deposit"),o}),stateRoot:e.stateRoot}}}),transaction:Ks({format(e){const t={};return e.type==="0x7e"&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?Lt(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}}),transactionReceipt:sa({format(e){return{l1GasPrice:e.l1GasPrice?Lt(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?Lt(e.l1GasUsed):null,l1Fee:e.l1Fee?Lt(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null}}})};function kr(e,t){return xr(e)?Tr(e):pr(e,t)}const Ar={transaction:kr};function Tr(e){Sr(e);const{sourceHash:t,data:n,from:o,gas:s,isSystemTx:a,mint:r,to:l,value:d}=e,T=[t,o,l??"0x",r?Ut(r):"0x",d?Ut(d):"0x",s?Ut(s):"0x",a?"0x1":"0x",n??"0x"];return St(["0x7e",Et(T)])}function xr(e){return e.type==="deposit"||typeof e.sourceHash<"u"}function Sr(e){const{from:t,to:n}=e;if(t&&!Re(t))throw new ct({address:t});if(n&&!Re(n))throw new ct({address:n})}const mn={blockTime:2e3,contracts:yr,formatters:vr,serializers:Ar},Er=ut({id:42161,name:"Arbitrum One",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:250,rpcUrls:{default:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://arbiscan.io",apiUrl:"https://api.arbiscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7654707}}}),Nr=ut({id:43114,name:"Avalanche",blockTime:1700,nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{default:{name:"SnowTrace",url:"https://snowtrace.io",apiUrl:"https://api.snowtrace.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:11907934}}}),Xt=1,ts=ut({...mn,id:8453,name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://basescan.org",apiUrl:"https://api.basescan.org/api"}},contracts:{...mn.contracts,disputeGameFactory:{[Xt]:{address:"0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e"}},l2OutputOracle:{[Xt]:{address:"0x56315b90c40730925ec5485cf004d835058518A0"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:5022},portal:{[Xt]:{address:"0x49048044D57e1C92A77f79988d21Fa8fAF74E97e",blockCreated:17482143}},l1StandardBridge:{[Xt]:{address:"0x3154Cf16ccdb4C6d922629664174b904d80F2C35",blockCreated:17482143}}},sourceId:Xt});({...ts});const Cr=ut({id:56,name:"BNB Smart Chain",blockTime:750,nativeCurrency:{decimals:18,name:"BNB",symbol:"BNB"},rpcUrls:{default:{http:["https://56.rpc.thirdweb.com"]}},blockExplorers:{default:{name:"BscScan",url:"https://bscscan.com",apiUrl:"https://api.bscscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:15921452}}});function jn(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}class Br extends ue{constructor({docsPath:t}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join(`
83
- `),{docsPath:t,docsSlug:"account",name:"AccountNotFoundError"})}}function Jn(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new Lr(e.type);return`${e.name}(${ns(e.inputs,{includeName:t})})`}function ns(e,{includeName:t=!1}={}){return e?e.map(n=>Ir(n,{includeName:t})).join(t?", ":","):""}function Ir(e,{includeName:t}){return e.type.startsWith("tuple")?`(${ns(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}class Pr extends ue{constructor({expectedLength:t,givenLength:n,type:o}){super([`ABI encoding array length mismatch for type ${o}.`,`Expected length: ${t}`,`Given length: ${n}`].join(`
84
- `),{name:"AbiEncodingArrayLengthMismatchError"})}}class Fr extends ue{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${Ve(n)}) does not match expected size (bytes${t}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class Dr extends ue{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${t}`,`Given length (values): ${n}`].join(`
82
+ `),{cause:t,name:"TipAboveFeeCapError"})}}Object.defineProperty(Yt,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class Go extends ue{constructor({cause:t}){super(`An error occurred while executing: ${t?.shortMessage}`,{cause:t,name:"UnknownNodeError"})}}class zo extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const o=this.keys().next().value;o&&this.delete(o)}return this}}const Ja=BigInt(0),jt=BigInt(1),Xa=BigInt(2),Ka=BigInt(7),Za=BigInt(256),Qa=BigInt(113),qo=[],Yo=[],jo=[];for(let e=0,t=jt,n=1,o=0;e<24;e++){[n,o]=[o,(2*n+3*o)%5],qo.push(2*(5*o+n)),Yo.push((e+1)*(e+2)/2%64);let s=Ja;for(let a=0;a<7;a++)t=(t<<jt^(t>>Ka)*Qa)%Za,t&Xa&&(s^=jt<<(jt<<BigInt(a))-jt);jo.push(s)}const Jo=Da(jo,!0),er=Jo[0],tr=Jo[1],Xo=(e,t,n)=>n>32?Ua(e,t,n):_a(e,t,n),Ko=(e,t,n)=>n>32?La(e,t,n):Oa(e,t,n);function nr(e,t=24){const n=new Uint32Array(10);for(let o=24-t;o<24;o++){for(let r=0;r<10;r++)n[r]=e[r]^e[r+10]^e[r+20]^e[r+30]^e[r+40];for(let r=0;r<10;r+=2){const i=(r+8)%10,d=(r+2)%10,T=n[d],B=n[d+1],R=Xo(T,B,1)^n[i],h=Ko(T,B,1)^n[i+1];for(let x=0;x<50;x+=10)e[r+x]^=R,e[r+x+1]^=h}let s=e[2],a=e[3];for(let r=0;r<24;r++){const i=Yo[r],d=Xo(s,a,i),T=Ko(s,a,i),B=qo[r];s=e[B],a=e[B+1],e[B]=d,e[B+1]=T}for(let r=0;r<50;r+=10){for(let i=0;i<10;i++)n[i]=e[r+i];for(let i=0;i<10;i++)e[r+i]^=~n[(i+2)%10]&n[(i+4)%10]}e[0]^=er[o],e[1]^=tr[o]}qt(n)}class Vn extends Oo{constructor(t,n,o,s=!1,a=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=n,this.outputLen=o,this.enableXOF=s,this.rounds=a,Fo(o),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=Ta(this.state)}clone(){return this._cloneInto()}keccak(){_o(this.state32),nr(this.state32,this.rounds),_o(this.state32),this.posOut=0,this.pos=0}update(t){dn(this),t=Dn(t),zt(t);const{blockLen:n,state:o}=this,s=t.length;for(let a=0;a<s;){const r=Math.min(n-this.pos,s-a);for(let i=0;i<r;i++)o[this.pos++]^=t[a++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:o,blockLen:s}=this;t[o]^=n,(n&128)!==0&&o===s-1&&this.keccak(),t[s-1]^=128,this.keccak()}writeInto(t){dn(this,!1),zt(t),this.finish();const n=this.state,{blockLen:o}=this;for(let s=0,a=t.length;s<a;){this.posOut>=o&&this.keccak();const r=Math.min(o-this.posOut,a-s);t.set(n.subarray(this.posOut,this.posOut+r),s),this.posOut+=r,s+=r}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return Fo(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Do(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,qt(this.state)}_cloneInto(t){const{blockLen:n,suffix:o,outputLen:s,rounds:a,enableXOF:r}=this;return t||(t=new Vn(n,o,s,r,a)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=a,t.suffix=o,t.outputLen=s,t.enableXOF=r,t.destroyed=this.destroyed,t}}const or=(e,t,n)=>Uo(()=>new Vn(t,e,n)),sr=or(1,136,256/8);function Zo(e,t){const n=t||"hex",o=sr(Dt(e,{strict:!1})?Bn(e):e);return n==="bytes"?o:Ot(o)}const Gn=new zo(8192);function ar(e,t){if(Gn.has(`${e}.${t}`))return Gn.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),o=Zo(To(n),"bytes"),s=n.split("");for(let r=0;r<40;r+=2)o[r>>1]>>4>=8&&s[r]&&(s[r]=s[r].toUpperCase()),(o[r>>1]&15)>=8&&s[r+1]&&(s[r+1]=s[r+1].toUpperCase());const a=`0x${s.join("")}`;return Gn.set(`${e}.${t}`,a),a}const rr=/^0x[a-fA-F0-9]{40}$/,zn=new zo(8192);function Re(e,t){const{strict:n=!0}=t??{},o=`${e}.${n}`;if(zn.has(o))return zn.get(o);const s=rr.test(e)?e.toLowerCase()===e?!0:n?ar(e)===e:!0:!1;return zn.set(o,s),s}function qn(e,t,n,{strict:o}={}){return Dt(e,{strict:!1})?cr(e,t,n,{strict:o}):ir(e,t,n,{strict:o})}function Qo(e,t){if(typeof t=="number"&&t>0&&t>Ge(e)-1)throw new wo({offset:t,position:"start",size:Ge(e)})}function es(e,t,n){if(typeof t=="number"&&typeof n=="number"&&Ge(e)!==n-t)throw new wo({offset:n,position:"end",size:Ge(e)})}function ir(e,t,n,{strict:o}={}){Qo(e,t);const s=e.slice(t,n);return o&&es(s,t,n),s}function cr(e,t,n,{strict:o}={}){Qo(e,t);const s=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return o&&es(s,t,n),s}function lr(e){const{authorizationList:t}=e;if(t)for(const n of t){const{chainId:o}=n,s=n.address;if(!Re(s))throw new ct({address:s});if(o<0)throw new fn({chainId:o})}Yn(e)}function dr(e){const{blobVersionedHashes:t}=e;if(t){if(t.length===0)throw new Vo;for(const n of t){const o=Ge(n),s=ln(qn(n,0,1));if(o!==32)throw new za({hash:n,size:o});if(s!==Wo)throw new qa({hash:n,version:s})}}Yn(e)}function Yn(e){const{chainId:t,maxPriorityFeePerGas:n,maxFeePerGas:o,to:s}=e;if(t<=0)throw new fn({chainId:t});if(s&&!Re(s))throw new ct({address:s});if(o&&o>Mt)throw new Ct({maxFeePerGas:o});if(n&&o&&n>o)throw new Yt({maxFeePerGas:o,maxPriorityFeePerGas:n})}function ur(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:o,maxFeePerGas:s,to:a}=e;if(t<=0)throw new fn({chainId:t});if(a&&!Re(a))throw new ct({address:a});if(n||s)throw new ue("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(o&&o>Mt)throw new Ct({maxFeePerGas:o})}function fr(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:o,maxFeePerGas:s,to:a}=e;if(a&&!Re(a))throw new ct({address:a});if(typeof t<"u"&&t<=0)throw new fn({chainId:t});if(n||s)throw new ue("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(o&&o>Mt)throw new Ct({maxFeePerGas:o})}function pr(e){if(e.type)return e.type;if(typeof e.authorizationList<"u")return"eip7702";if(typeof e.blobs<"u"||typeof e.blobVersionedHashes<"u"||typeof e.maxFeePerBlobGas<"u"||typeof e.sidecars<"u")return"eip4844";if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")return"eip1559";if(typeof e.gasPrice<"u")return typeof e.accessList<"u"?"eip2930":"legacy";throw new ya({transaction:e})}function pn(e){if(!e||e.length===0)return[];const t=[];for(let n=0;n<e.length;n++){const{address:o,storageKeys:s}=e[n];for(let a=0;a<s.length;a++)if(s[a].length-2!==64)throw new va({storageKey:s[a]});if(!Re(o,{strict:!1}))throw new ct({address:o});t.push([o,s])}return t}function mr(e,t){const n=pr(e);return n==="eip1559"?gr(e,t):n==="eip2930"?wr(e,t):n==="eip4844"?br(e,t):n==="eip7702"?hr(e,t):yr(e,t)}function hr(e,t){const{authorizationList:n,chainId:o,gas:s,nonce:a,to:r,value:i,maxFeePerGas:d,maxPriorityFeePerGas:T,accessList:B,data:R}=e;lr(e);const h=pn(B),x=ka(n);return Et(["0x04",St([le(o),a?le(a):"0x",T?le(T):"0x",d?le(d):"0x",s?le(s):"0x",r??"0x",i?le(i):"0x",R??"0x",h,x,...Jt(e,t)])])}function br(e,t){const{chainId:n,gas:o,nonce:s,to:a,value:r,maxFeePerBlobGas:i,maxFeePerGas:d,maxPriorityFeePerGas:T,accessList:B,data:R}=e;dr(e);let h=e.blobVersionedHashes,x=e.sidecars;if(e.blobs&&(typeof h>"u"||typeof x>"u")){const V=typeof e.blobs[0]=="string"?e.blobs:e.blobs.map(pe=>ft(pe)),X=e.kzg,fe=Io({blobs:V,kzg:X});if(typeof h>"u"&&(h=Va({commitments:fe})),typeof x>"u"){const pe=Po({blobs:V,commitments:fe,kzg:X});x=ja({blobs:V,commitments:fe,proofs:pe})}}const m=pn(B),C=[le(n),s?le(s):"0x",T?le(T):"0x",d?le(d):"0x",o?le(o):"0x",a??"0x",r?le(r):"0x",R??"0x",m,i?le(i):"0x",h??[],...Jt(e,t)],L=[],ke=[],N=[];if(x)for(let V=0;V<x.length;V++){const{blob:X,commitment:fe,proof:pe}=x[V];L.push(X),ke.push(fe),N.push(pe)}return Et(["0x03",St(x?[C,L,ke,N]:C)])}function gr(e,t){const{chainId:n,gas:o,nonce:s,to:a,value:r,maxFeePerGas:i,maxPriorityFeePerGas:d,accessList:T,data:B}=e;Yn(e);const R=pn(T),h=[le(n),s?le(s):"0x",d?le(d):"0x",i?le(i):"0x",o?le(o):"0x",a??"0x",r?le(r):"0x",B??"0x",R,...Jt(e,t)];return Et(["0x02",St(h)])}function wr(e,t){const{chainId:n,gas:o,data:s,nonce:a,to:r,value:i,accessList:d,gasPrice:T}=e;ur(e);const B=pn(d),R=[le(n),a?le(a):"0x",T?le(T):"0x",o?le(o):"0x",r??"0x",i?le(i):"0x",s??"0x",B,...Jt(e,t)];return Et(["0x01",St(R)])}function yr(e,t){const{chainId:n=0,gas:o,data:s,nonce:a,to:r,value:i,gasPrice:d}=e;fr(e);let T=[a?le(a):"0x",d?le(d):"0x",o?le(o):"0x",r??"0x",i?le(i):"0x",s??"0x"];if(t){const B=(()=>{if(t.v>=35n)return(t.v-35n)/2n>0?t.v:27n+(t.v===35n?0n:1n);if(n>0)return BigInt(n*2)+BigInt(35n+t.v-27n);const x=27n+(t.v===27n?0n:1n);if(t.v!==x)throw new wa({v:t.v});return x})(),R=cn(t.r),h=cn(t.s);T=[...T,le(B),R==="0x00"?"0x":R,h==="0x00"?"0x":h]}else n>0&&(T=[...T,le(n),"0x","0x"]);return St(T)}function Jt(e,t){const n=t??e,{v:o,yParity:s}=n;if(typeof n.r>"u")return[];if(typeof n.s>"u")return[];if(typeof o>"u"&&typeof s>"u")return[];const a=cn(n.r),r=cn(n.s);return[typeof s=="number"?s?le(1):"0x":o===0n?"0x":o===1n?le(1):o===27n?"0x":le(1),a==="0x00"?"0x":a,r==="0x00"?"0x":r]}const vr={gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}},kr={block:ta({format(e){return{transactions:e.transactions?.map(n=>{if(typeof n=="string")return n;const o=Pn(n);return o.typeHex==="0x7e"&&(o.isSystemTx=n.isSystemTx,o.mint=n.mint?Lt(n.mint):void 0,o.sourceHash=n.sourceHash,o.type="deposit"),o}),stateRoot:e.stateRoot}}}),transaction:Zs({format(e){const t={};return e.type==="0x7e"&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?Lt(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}}),transactionReceipt:aa({format(e){return{l1GasPrice:e.l1GasPrice?Lt(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?Lt(e.l1GasUsed):null,l1Fee:e.l1Fee?Lt(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null}}})};function Ar(e,t){return Er(e)?xr(e):mr(e,t)}const Tr={transaction:Ar};function xr(e){Sr(e);const{sourceHash:t,data:n,from:o,gas:s,isSystemTx:a,mint:r,to:i,value:d}=e,T=[t,o,i??"0x",r?Ot(r):"0x",d?Ot(d):"0x",s?Ot(s):"0x",a?"0x1":"0x",n??"0x"];return Et(["0x7e",St(T)])}function Er(e){return e.type==="deposit"||typeof e.sourceHash<"u"}function Sr(e){const{from:t,to:n}=e;if(t&&!Re(t))throw new ct({address:t});if(n&&!Re(n))throw new ct({address:n})}const mn={blockTime:2e3,contracts:vr,formatters:kr,serializers:Tr},Nr=ut({id:42161,name:"Arbitrum One",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:250,rpcUrls:{default:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://arbiscan.io",apiUrl:"https://api.arbiscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7654707}}}),Cr=ut({id:43114,name:"Avalanche",blockTime:1700,nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{default:{name:"SnowTrace",url:"https://snowtrace.io",apiUrl:"https://api.snowtrace.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:11907934}}}),Xt=1,ts=ut({...mn,id:8453,name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://basescan.org",apiUrl:"https://api.basescan.org/api"}},contracts:{...mn.contracts,disputeGameFactory:{[Xt]:{address:"0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e"}},l2OutputOracle:{[Xt]:{address:"0x56315b90c40730925ec5485cf004d835058518A0"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:5022},portal:{[Xt]:{address:"0x49048044D57e1C92A77f79988d21Fa8fAF74E97e",blockCreated:17482143}},l1StandardBridge:{[Xt]:{address:"0x3154Cf16ccdb4C6d922629664174b904d80F2C35",blockCreated:17482143}}},sourceId:Xt});({...ts});const Br=ut({id:56,name:"BNB Smart Chain",blockTime:750,nativeCurrency:{decimals:18,name:"BNB",symbol:"BNB"},rpcUrls:{default:{http:["https://56.rpc.thirdweb.com"]}},blockExplorers:{default:{name:"BscScan",url:"https://bscscan.com",apiUrl:"https://api.bscscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:15921452}}});function jn(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}class Ir extends ue{constructor({docsPath:t}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join(`
83
+ `),{docsPath:t,docsSlug:"account",name:"AccountNotFoundError"})}}function Jn(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new Mr(e.type);return`${e.name}(${ns(e.inputs,{includeName:t})})`}function ns(e,{includeName:t=!1}={}){return e?e.map(n=>Pr(n,{includeName:t})).join(t?", ":","):""}function Pr(e,{includeName:t}){return e.type.startsWith("tuple")?`(${ns(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}class Fr extends ue{constructor({expectedLength:t,givenLength:n,type:o}){super([`ABI encoding array length mismatch for type ${o}.`,`Expected length: ${t}`,`Given length: ${n}`].join(`
84
+ `),{name:"AbiEncodingArrayLengthMismatchError"})}}class Dr extends ue{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${Ge(n)}) does not match expected size (bytes${t}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class _r extends ue{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${t}`,`Given length (values): ${n}`].join(`
85
85
  `),{name:"AbiEncodingLengthMismatchError"})}}class os extends ue{constructor(t,{docsPath:n}={}){super([`Function ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(`
86
- `),{docsPath:n,name:"AbiFunctionNotFoundError"})}}class _r extends ue{constructor(t,n){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${t.type}\` in \`${Jn(t.abiItem)}\`, and`,`\`${n.type}\` in \`${Jn(n.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}class Ur extends ue{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
87
- `),{docsPath:n,name:"InvalidAbiEncodingType"})}}class Or extends ue{constructor(t){super([`Value "${t}" is not a valid array.`].join(`
88
- `),{name:"InvalidArrayError"})}}class Lr extends ue{constructor(t){super([`"${t}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
89
- `),{name:"InvalidDefinitionTypeError"})}}const Mr=e=>Zo(Bn(e));function Rr(e){return Mr(e)}function $r(e,t){return e.exec(t)?.groups}const ss=/^tuple(?<array>(\[(\d*)\])*)$/;function Xn(e){let t=e.type;if(ss.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let s=0;s<n;s++){const a=e.components[s];t+=Xn(a),s<n-1&&(t+=", ")}const o=$r(ss,e.type);return t+=`)${o?.array||""}`,Xn({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function Kt(e){let t="";const n=e.length;for(let o=0;o<n;o++){const s=e[o];t+=Xn(s),o!==n-1&&(t+=", ")}return t}function Hr(e){return e.type==="function"?`function ${e.name}(${Kt(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${e.outputs?.length?` returns (${Kt(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${Kt(e.inputs)})`:e.type==="error"?`error ${e.name}(${Kt(e.inputs)})`:e.type==="constructor"?`constructor(${Kt(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?`fallback() external${e.stateMutability==="payable"?" payable":""}`:"receive() external payable"}function Wr(e){let t=!0,n="",o=0,s="",a=!1;for(let r=0;r<e.length;r++){const l=e[r];if(["(",")",","].includes(l)&&(t=!0),l==="("&&o++,l===")"&&o--,!!t){if(o===0){if(l===" "&&["event","function",""].includes(s))s="";else if(s+=l,l===")"){a=!0;break}continue}if(l===" "){e[r-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}s+=l,n+=l}}if(!a)throw new ue("Unable to normalize signature.");return s}const Vr=e=>{const t=typeof e=="string"?e:Hr(e);return Wr(t)};function as(e){return Rr(Vr(e))}const rs=e=>qn(as(e),0,4),Gr=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function zr(e,t){if(e.length!==t.length)throw new Dr({expectedLength:e.length,givenLength:t.length});const n=qr({params:e,values:t}),o=Zn(n);return o.length===0?"0x":o}function qr({params:e,values:t}){const n=[];for(let o=0;o<e.length;o++)n.push(Kn({param:e[o],value:t[o]}));return n}function Kn({param:e,value:t}){const n=ei(e.type);if(n){const[o,s]=n;return jr(t,{length:o,param:{...e,type:s}})}if(e.type==="tuple")return Qr(t,{param:e});if(e.type==="address")return Yr(t);if(e.type==="bool")return Xr(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const o=e.type.startsWith("int"),[,,s="256"]=Gr.exec(e.type)??[];return Kr(t,{signed:o,size:Number(s)})}if(e.type.startsWith("bytes"))return Jr(t,{param:e});if(e.type==="string")return Zr(t);throw new Ur(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function Zn(e){let t=0;for(let a=0;a<e.length;a++){const{dynamic:r,encoded:l}=e[a];r?t+=32:t+=Ve(l)}const n=[],o=[];let s=0;for(let a=0;a<e.length;a++){const{dynamic:r,encoded:l}=e[a];r?(n.push(le(t+s,{size:32})),o.push(l),s+=Ve(l)):n.push(l)}return Rt([...n,...o])}function Yr(e){if(!Re(e))throw new ct({address:e});return{dynamic:!1,encoded:wt(e.toLowerCase())}}function jr(e,{length:t,param:n}){const o=t===null;if(!Array.isArray(e))throw new Or(e);if(!o&&e.length!==t)throw new Pr({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let s=!1;const a=[];for(let r=0;r<e.length;r++){const l=Kn({param:n,value:e[r]});l.dynamic&&(s=!0),a.push(l)}if(o||s){const r=Zn(a);if(o){const l=le(a.length,{size:32});return{dynamic:!0,encoded:a.length>0?Rt([l,r]):l}}if(s)return{dynamic:!0,encoded:r}}return{dynamic:!1,encoded:Rt(a.map(({encoded:r})=>r))}}function Jr(e,{param:t}){const[,n]=t.type.split("bytes"),o=Ve(e);if(!n){let s=e;return o%32!==0&&(s=wt(s,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:Rt([wt(le(o,{size:32})),s])}}if(o!==Number.parseInt(n,10))throw new Fr({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:wt(e,{dir:"right"})}}function Xr(e){if(typeof e!="boolean")throw new ue(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:wt(vo(e))}}function Kr(e,{signed:t,size:n=256}){if(typeof n=="number"){const o=2n**(BigInt(n)-(t?1n:0n))-1n,s=t?-o-1n:0n;if(e>o||e<s)throw new Cn({max:o.toString(),min:s.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:le(e,{size:32,signed:t})}}function Zr(e){const t=ko(e),n=Math.ceil(Ve(t)/32),o=[];for(let s=0;s<n;s++)o.push(wt(qn(t,s*32,(s+1)*32),{dir:"right"}));return{dynamic:!0,encoded:Rt([wt(le(Ve(t),{size:32})),...o])}}function Qr(e,{param:t}){let n=!1;const o=[];for(let s=0;s<t.components.length;s++){const a=t.components[s],r=Array.isArray(e)?s:a.name,l=Kn({param:a,value:e[r]});o.push(l),l.dynamic&&(n=!0)}return{dynamic:n,encoded:n?Zn(o):Rt(o.map(({encoded:s})=>s))}}function ei(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const ti=as;function ni(e){const{abi:t,args:n=[],name:o}=e,s=Dt(o,{strict:!1}),a=t.filter(l=>s?l.type==="function"?rs(l)===o:l.type==="event"?ti(l)===o:!1:"name"in l&&l.name===o);if(a.length===0)return;if(a.length===1)return a[0];let r;for(const l of a){if(!("inputs"in l))continue;if(!n||n.length===0){if(!l.inputs||l.inputs.length===0)return l;continue}if(!l.inputs||l.inputs.length===0||l.inputs.length!==n.length)continue;if(n.every((T,C)=>{const M="inputs"in l&&l.inputs[C];return M?Qn(T,M):!1})){if(r&&"inputs"in r&&r.inputs){const T=is(l.inputs,r.inputs,n);if(T)throw new _r({abiItem:l,type:T[0]},{abiItem:r,type:T[1]})}r=l}}return r||a[0]}function Qn(e,t){const n=typeof e,o=t.type;switch(o){case"address":return Re(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return o==="tuple"&&"components"in t?Object.values(t.components).every((s,a)=>n==="object"&&Qn(Object.values(e)[a],s)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(o)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(o)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(o)?Array.isArray(e)&&e.every(s=>Qn(s,{...t,type:o.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function is(e,t,n){for(const o in e){const s=e[o],a=t[o];if(s.type==="tuple"&&a.type==="tuple"&&"components"in s&&"components"in a)return is(s.components,a.components,n[o]);const r=[s.type,a.type];if(r.includes("address")&&r.includes("bytes20")?!0:r.includes("address")&&r.includes("string")?Re(n[o],{strict:!1}):r.includes("address")&&r.includes("bytes")?Re(n[o],{strict:!1}):!1)return r}}function cs(e){return e.reduce((t,{slot:n,value:o})=>`${t} ${n}: ${o}
90
- `,"")}function oi(e){return e.reduce((t,{address:n,...o})=>{let s=`${t} ${n}:
86
+ `),{docsPath:n,name:"AbiFunctionNotFoundError"})}}class Or extends ue{constructor(t,n){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${t.type}\` in \`${Jn(t.abiItem)}\`, and`,`\`${n.type}\` in \`${Jn(n.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}class Ur extends ue{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
87
+ `),{docsPath:n,name:"InvalidAbiEncodingType"})}}class Lr extends ue{constructor(t){super([`Value "${t}" is not a valid array.`].join(`
88
+ `),{name:"InvalidArrayError"})}}class Mr extends ue{constructor(t){super([`"${t}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
89
+ `),{name:"InvalidDefinitionTypeError"})}}const Rr=e=>Zo(Bn(e));function $r(e){return Rr(e)}function Hr(e,t){return e.exec(t)?.groups}const ss=/^tuple(?<array>(\[(\d*)\])*)$/;function Xn(e){let t=e.type;if(ss.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let s=0;s<n;s++){const a=e.components[s];t+=Xn(a),s<n-1&&(t+=", ")}const o=Hr(ss,e.type);return t+=`)${o?.array||""}`,Xn({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function Kt(e){let t="";const n=e.length;for(let o=0;o<n;o++){const s=e[o];t+=Xn(s),o!==n-1&&(t+=", ")}return t}function Wr(e){return e.type==="function"?`function ${e.name}(${Kt(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${e.outputs?.length?` returns (${Kt(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${Kt(e.inputs)})`:e.type==="error"?`error ${e.name}(${Kt(e.inputs)})`:e.type==="constructor"?`constructor(${Kt(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?`fallback() external${e.stateMutability==="payable"?" payable":""}`:"receive() external payable"}function Vr(e){let t=!0,n="",o=0,s="",a=!1;for(let r=0;r<e.length;r++){const i=e[r];if(["(",")",","].includes(i)&&(t=!0),i==="("&&o++,i===")"&&o--,!!t){if(o===0){if(i===" "&&["event","function",""].includes(s))s="";else if(s+=i,i===")"){a=!0;break}continue}if(i===" "){e[r-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}s+=i,n+=i}}if(!a)throw new ue("Unable to normalize signature.");return s}const Gr=e=>{const t=typeof e=="string"?e:Wr(e);return Vr(t)};function as(e){return $r(Gr(e))}const rs=e=>qn(as(e),0,4),zr=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function qr(e,t){if(e.length!==t.length)throw new _r({expectedLength:e.length,givenLength:t.length});const n=Yr({params:e,values:t}),o=Zn(n);return o.length===0?"0x":o}function Yr({params:e,values:t}){const n=[];for(let o=0;o<e.length;o++)n.push(Kn({param:e[o],value:t[o]}));return n}function Kn({param:e,value:t}){const n=ti(e.type);if(n){const[o,s]=n;return Jr(t,{length:o,param:{...e,type:s}})}if(e.type==="tuple")return ei(t,{param:e});if(e.type==="address")return jr(t);if(e.type==="bool")return Kr(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const o=e.type.startsWith("int"),[,,s="256"]=zr.exec(e.type)??[];return Zr(t,{signed:o,size:Number(s)})}if(e.type.startsWith("bytes"))return Xr(t,{param:e});if(e.type==="string")return Qr(t);throw new Ur(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function Zn(e){let t=0;for(let a=0;a<e.length;a++){const{dynamic:r,encoded:i}=e[a];r?t+=32:t+=Ge(i)}const n=[],o=[];let s=0;for(let a=0;a<e.length;a++){const{dynamic:r,encoded:i}=e[a];r?(n.push(le(t+s,{size:32})),o.push(i),s+=Ge(i)):n.push(i)}return Rt([...n,...o])}function jr(e){if(!Re(e))throw new ct({address:e});return{dynamic:!1,encoded:wt(e.toLowerCase())}}function Jr(e,{length:t,param:n}){const o=t===null;if(!Array.isArray(e))throw new Lr(e);if(!o&&e.length!==t)throw new Fr({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let s=!1;const a=[];for(let r=0;r<e.length;r++){const i=Kn({param:n,value:e[r]});i.dynamic&&(s=!0),a.push(i)}if(o||s){const r=Zn(a);if(o){const i=le(a.length,{size:32});return{dynamic:!0,encoded:a.length>0?Rt([i,r]):i}}if(s)return{dynamic:!0,encoded:r}}return{dynamic:!1,encoded:Rt(a.map(({encoded:r})=>r))}}function Xr(e,{param:t}){const[,n]=t.type.split("bytes"),o=Ge(e);if(!n){let s=e;return o%32!==0&&(s=wt(s,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:Rt([wt(le(o,{size:32})),s])}}if(o!==Number.parseInt(n,10))throw new Dr({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:wt(e,{dir:"right"})}}function Kr(e){if(typeof e!="boolean")throw new ue(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:wt(vo(e))}}function Zr(e,{signed:t,size:n=256}){if(typeof n=="number"){const o=2n**(BigInt(n)-(t?1n:0n))-1n,s=t?-o-1n:0n;if(e>o||e<s)throw new Cn({max:o.toString(),min:s.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:le(e,{size:32,signed:t})}}function Qr(e){const t=ko(e),n=Math.ceil(Ge(t)/32),o=[];for(let s=0;s<n;s++)o.push(wt(qn(t,s*32,(s+1)*32),{dir:"right"}));return{dynamic:!0,encoded:Rt([wt(le(Ge(t),{size:32})),...o])}}function ei(e,{param:t}){let n=!1;const o=[];for(let s=0;s<t.components.length;s++){const a=t.components[s],r=Array.isArray(e)?s:a.name,i=Kn({param:a,value:e[r]});o.push(i),i.dynamic&&(n=!0)}return{dynamic:n,encoded:n?Zn(o):Rt(o.map(({encoded:s})=>s))}}function ti(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const ni=as;function oi(e){const{abi:t,args:n=[],name:o}=e,s=Dt(o,{strict:!1}),a=t.filter(i=>s?i.type==="function"?rs(i)===o:i.type==="event"?ni(i)===o:!1:"name"in i&&i.name===o);if(a.length===0)return;if(a.length===1)return a[0];let r;for(const i of a){if(!("inputs"in i))continue;if(!n||n.length===0){if(!i.inputs||i.inputs.length===0)return i;continue}if(!i.inputs||i.inputs.length===0||i.inputs.length!==n.length)continue;if(n.every((T,B)=>{const R="inputs"in i&&i.inputs[B];return R?Qn(T,R):!1})){if(r&&"inputs"in r&&r.inputs){const T=is(i.inputs,r.inputs,n);if(T)throw new Or({abiItem:i,type:T[0]},{abiItem:r,type:T[1]})}r=i}}return r||a[0]}function Qn(e,t){const n=typeof e,o=t.type;switch(o){case"address":return Re(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return o==="tuple"&&"components"in t?Object.values(t.components).every((s,a)=>n==="object"&&Qn(Object.values(e)[a],s)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(o)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(o)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(o)?Array.isArray(e)&&e.every(s=>Qn(s,{...t,type:o.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function is(e,t,n){for(const o in e){const s=e[o],a=t[o];if(s.type==="tuple"&&a.type==="tuple"&&"components"in s&&"components"in a)return is(s.components,a.components,n[o]);const r=[s.type,a.type];if(r.includes("address")&&r.includes("bytes20")?!0:r.includes("address")&&r.includes("string")?Re(n[o],{strict:!1}):r.includes("address")&&r.includes("bytes")?Re(n[o],{strict:!1}):!1)return r}}function cs(e){return e.reduce((t,{slot:n,value:o})=>`${t} ${n}: ${o}
90
+ `,"")}function si(e){return e.reduce((t,{address:n,...o})=>{let s=`${t} ${n}:
91
91
  `;return o.nonce&&(s+=` nonce: ${o.nonce}
92
92
  `),o.balance&&(s+=` balance: ${o.balance}
93
93
  `),o.code&&(s+=` code: ${o.code}
94
94
  `),o.state&&(s+=` state:
95
95
  `,s+=cs(o.state)),o.stateDiff&&(s+=` stateDiff:
96
96
  `,s+=cs(o.stateDiff)),s},` State Override:
97
- `).slice(0,-1)}class si extends ue{constructor(t,{account:n,docsPath:o,chain:s,data:a,gas:r,gasPrice:l,maxFeePerGas:d,maxPriorityFeePerGas:T,nonce:C,to:M,value:h,stateOverride:x}){const m=n?jn(n):void 0;let B=Bo({from:m?.address,to:M,value:typeof h<"u"&&`${ba(h)} ${s?.nativeCurrency?.symbol||"ETH"}`,data:a,gas:r,gasPrice:typeof l<"u"&&`${Nt(l)} gwei`,maxFeePerGas:typeof d<"u"&&`${Nt(d)} gwei`,maxPriorityFeePerGas:typeof T<"u"&&`${Nt(T)} gwei`,nonce:C});x&&(B+=`
98
- ${oi(x)}`),super(t.shortMessage,{cause:t,docsPath:o,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Raw Call Arguments:",B].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}function ai(e,t){const n=(e.details||"").toLowerCase(),o=e instanceof ue?e.walk(s=>s?.code===$t.code):e;return o instanceof ue?new $t({cause:e,message:o.details}):$t.nodeMessage.test(n)?new $t({cause:e,message:e.details}):Ct.nodeMessage.test(n)?new Ct({cause:e,maxFeePerGas:t?.maxFeePerGas}):Un.nodeMessage.test(n)?new Un({cause:e,maxFeePerGas:t?.maxFeePerGas}):On.nodeMessage.test(n)?new On({cause:e,nonce:t?.nonce}):Ln.nodeMessage.test(n)?new Ln({cause:e,nonce:t?.nonce}):Mn.nodeMessage.test(n)?new Mn({cause:e,nonce:t?.nonce}):Rn.nodeMessage.test(n)?new Rn({cause:e}):$n.nodeMessage.test(n)?new $n({cause:e,gas:t?.gas}):Hn.nodeMessage.test(n)?new Hn({cause:e,gas:t?.gas}):Wn.nodeMessage.test(n)?new Wn({cause:e}):Yt.nodeMessage.test(n)?new Yt({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):new Go({cause:e})}function ri(e,{docsPath:t,...n}){const o=(()=>{const s=ai(e,n);return s instanceof Go?e:s})();return new si(o,{docsPath:t,...n})}function ii(e,{format:t}){if(!t)return{};const n={};function o(a){const r=Object.keys(a);for(const l of r)l in e&&(n[l]=e[l]),a[l]&&typeof a[l]=="object"&&!Array.isArray(a[l])&&o(a[l])}const s=t(e||{});return o(s),n}function ci(e){const{account:t,maxFeePerGas:n,maxPriorityFeePerGas:o,to:s}=e,a=t?jn(t):void 0;if(a&&!Re(a.address))throw new ct({address:a.address});if(s&&!Re(s))throw new ct({address:s});if(n&&n>Mt)throw new Ct({maxFeePerGas:n});if(o&&n&&o>n)throw new Yt({maxFeePerGas:n,maxPriorityFeePerGas:o})}async function li(e,t){const{account:n=e.account}=t;if(!n)throw new Br;const o=jn(n);try{const{accessList:s,blockNumber:a,blockTag:r,data:l,gas:d,gasPrice:T,maxFeePerGas:C,maxPriorityFeePerGas:M,nonce:h,to:x,value:m,...B}=t,ke=(typeof a=="bigint"?le(a):void 0)||r;ci(t);const N=e.chain?.formatters?.transactionRequest?.format,X=(N||ra)({...ii(B,{format:N}),account:o,accessList:s,data:l,gas:d,gasPrice:T,maxFeePerGas:C,maxPriorityFeePerGas:M,nonce:h,to:x,value:m},"estimateGas"),{baseFeePerGas:fe,gasLimit:pe,priorityFeePerGas:Ce}=await e.request({method:"linea_estimateGas",params:ke?[X,ke]:[X]});return{baseFeePerGas:BigInt(fe),gasLimit:BigInt(pe),priorityFeePerGas:BigInt(Ce)}}catch(s){throw ri(s,{...t,account:o,chain:e.chain})}}const di={fees:{estimateFeesPerGas:ls,async maxPriorityFeePerGas({block:e,client:t,request:n}){const o=await ls({block:e,client:t,multiply:s=>s,request:n,type:"eip1559"});return o?.maxPriorityFeePerGas?o.maxPriorityFeePerGas:null}}};async function ls({client:e,multiply:t,request:n,type:o}){try{const s=await li(e,{...n,account:n?.account}),{priorityFeePerGas:a}=s,l=t(BigInt(s.baseFeePerGas))+a;return o==="legacy"?{gasPrice:l}:{maxFeePerGas:l,maxPriorityFeePerGas:a}}catch{return null}}const ui=ut({...di,id:59144,name:"Linea Mainnet",blockTime:2e3,nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build",apiUrl:"https://api.lineascan.build/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:42},ensRegistry:{address:"0x50130b669B28C339991d8676FA73CF122a121267",blockCreated:6682888},ensUniversalResolver:{address:"0x4D41762915F83c76EcaF6776d9b08076aA32b492",blockCreated:22222151}},ensTlds:[".linea.eth"],testnet:!1}),fi=ut({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:12e3,rpcUrls:{default:{http:["https://eth.merkle.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensUniversalResolver:{address:"0xeeeeeeee14d718c2b47d9923deab1335e144eeee",blockCreated:23085558},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),Zt=1,pi=ut({...mn,id:10,name:"OP Mainnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.optimism.io"]}},blockExplorers:{default:{name:"Optimism Explorer",url:"https://optimistic.etherscan.io",apiUrl:"https://api-optimistic.etherscan.io/api"}},contracts:{...mn.contracts,disputeGameFactory:{[Zt]:{address:"0xe5965Ab5962eDc7477C8520243A95517CD252fA9"}},l2OutputOracle:{[Zt]:{address:"0xdfe97868233d1aa22e815a266982f2cf17685a27"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:4286263},portal:{[Zt]:{address:"0xbEb5Fc579115071764c7423A4f12eDde41f106Ed"}},l1StandardBridge:{[Zt]:{address:"0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1"}}},sourceId:Zt}),mi=ut({id:137,name:"Polygon",blockTime:2e3,nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{default:{http:["https://polygon-rpc.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://polygonscan.com",apiUrl:"https://api.etherscan.io/v2/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}}}),ds="/docs/contract/encodeFunctionData";function hi(e){const{abi:t,args:n,functionName:o}=e;let s=t[0];if(o){const a=ni({abi:t,args:n,name:o});if(!a)throw new os(o,{docsPath:ds});s=a}if(s.type!=="function")throw new os(void 0,{docsPath:ds});return{abi:[s],functionName:rs(Jn(s))}}function kt(e){const{args:t}=e,{abi:n,functionName:o}=e.abi.length===1&&e.functionName?.startsWith("0x")?e:hi(e),s=n[0],a=o,r="inputs"in s&&s.inputs?zr(s.inputs,t??[]):void 0;return St([a,r??"0x"])}const lt={1:{...fi,logo:"https://cryptologos.cc/logos/ethereum-eth-logo.png?v=024",chainId:1,chainType:"ether",chainTypeMoralis:"eth",tokenTrendingDefault:["0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2","0x2260fac5e5542a773aa44fbcfedf7c193bc2c599"]},10:{...pi,logo:"https://cryptologos.cc/logos/optimism-ethereum-op-logo.png?v=024",chainId:10,chainType:"optimism",chainTypeMoralis:"optimism",tokenTrendingDefault:["0x4200000000000000000000000000000000000006","0x68f180fcce6836688e9084f035309e29bf0a2095","0xc47da4cb96ce65a96844a01bfae509f9d5454534"]},56:{...Cr,logo:"https://cryptologos.cc/logos/bnb-bnb-logo.png?v=024",chainId:56,chainType:"bsc",chainTypeMoralis:"bsc",tokenTrendingDefault:["0x2170ed0880ac9a755fd29b2688956bd959f933f8","0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c"]},137:{...mi,rpcUrls:{default:{http:["https://polygon-bor-rpc.publicnode.com"]}},logo:"https://cryptologos.cc/logos/polygon-matic-logo.png?v=024",chainId:137,chainType:"matic",chainTypeMoralis:"polygon",tokenTrendingDefault:["0x7ceb23fd6bc0add59e62ac25578270cff1b9f619","0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6"]},8453:{...ts,logo:"https://icons.llamao.fi/icons/chains/rsz_base.jpg",chainId:8453,chainType:"base",chainTypeMoralis:"base",tokenTrendingDefault:["0x4200000000000000000000000000000000000006","0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf","0xc47da4cb96ce65a96844a01bfae509f9d5454534"]},42161:{...Er,logo:"https://cryptologos.cc/logos/arbitrum-arb-logo.png?v=024",chainId:42161,chainType:"arbitrum",chainTypeMoralis:"arbitrum",tokenTrendingDefault:["0x82af49447d8a07e3bd95bd0d56f35241523fbab1","0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f"]},43114:{...Nr,logo:"https://cryptologos.cc/logos/avalanche-avax-logo.png?v=024",chainId:43114,chainType:"avax",chainTypeMoralis:"avalanche",tokenTrendingDefault:["0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB","0x0555E30da8f98308EdB960aa94C0Db47230d2B9c"]},59144:{...ui,logo:"https://icons.llamao.fi/icons/chains/rsz_linea.jpg",chainId:59144,chainType:"linea",chainTypeMoralis:"linea",tokenTrendingDefault:["0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f","0x3aab2285ddcddad8edf438c1bab47e1a9d05a9b4"]}},us=e=>Object.values(lt).find(n=>n.chainTypeMoralis===e)?.chainType||null,bi=e=>{const t=new Date,n=new Date(t);n.setDate(n.getDate()-1);const o=new Date(e);return o.setHours(0,0,0,0),t.setHours(0,0,0,0),n.setHours(0,0,0,0),o.getTime()===t.getTime()?"Today":o.getTime()===n.getTime()?"Yesterday":o.toLocaleDateString("en-US",{month:"short",day:"numeric",year:o.getFullYear()!==t.getFullYear()?"numeric":void 0})},ot=e=>new Promise(t=>setTimeout(t,e||0)),gi=(e,t=5,n=5)=>(e=e||"",e?.length<=t+n?e:`${e.substr(0,t)}...${e.substr(e.length-n,n)}`),wi=e=>{if(!e)return"";const t=lt[e];return t?t.chainTypeMoralis:""},yi=e=>{if(!e)return"";const t=lt[e];return t?t.chainType:""},Bt={getItem(e){if(typeof window>"u")return null;try{return window.localStorage.getItem(e)}catch{return null}},setItem(e,t){if(!(typeof window>"u"))try{window.localStorage.setItem(e,t)}catch{}},removeItem(e){if(!(typeof window>"u"))try{window.localStorage.removeItem(e)}catch{}},get length(){if(typeof window>"u")return 0;try{return window.localStorage.length}catch{return 0}},key(e){if(typeof window>"u")return null;try{return window.localStorage.key(e)}catch{return null}}};class vi extends ue{constructor({value:t}){super(`Number \`${t}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function mt(e,t){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(e))throw new vi({value:e});let[n,o="0"]=e.split(".");const s=n.startsWith("-");if(s&&(n=n.slice(1)),o=o.replace(/(0+)$/,""),t===0)Math.round(+`.${o}`)===1&&(n=`${BigInt(n)+1n}`),o="";else if(o.length>t){const[a,r,l]=[o.slice(0,t-1),o.slice(t-1,t),o.slice(t)],d=Math.round(+`${r}.${l}`);d>9?o=`${BigInt(a)+BigInt(1)}0`.padStart(a.length+1,"0"):o=`${a}${d}`,o.length>t&&(o=o.slice(1),n=`${BigInt(n)+1n}`),o=o.slice(0,t)}else o=o.padEnd(t,"0");return BigInt(`${s?"-":""}${n}${o}`)}const ki="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",Ge="0x0000000000000000000000000000000000000000",fs=ne.createContext(void 0),eo=()=>{const e=ne.useContext(fs);if(!e)throw new Error("useConnect must be used within ConnectProvider");return{...e,chainData:lt[e.account?.chainId]||void 0,chainId:e.account?.chainId||void 0,chainType:yi(e.account?.chainId||void 0),chainTypeMoralis:wi(e.account?.chainId||void 0),isChainSupported:!!lt[e.account?.chainId]}},Ai=({children:e,initialAccount:t})=>P.jsx(fs.Provider,{value:{account:t||null},children:e}),Ti=({address:e,chainId:t})=>{const[n,o]=ne.useState(!1),{isChainSupported:s}=eo(),a=ne.useCallback(()=>{if(!e)return;const r=e,l=()=>{o(!0),setTimeout(()=>o(!1),2e3)};try{navigator.clipboard.writeText(r).then(l).catch(()=>{const d=document.createElement("input");d.value=r,document.body.appendChild(d),d.select(),document.execCommand("copy"),d.remove(),l()})}catch{const d=document.createElement("input");d.value=r,document.body.appendChild(d),d.select(),document.execCommand("copy"),d.remove(),l()}},[e]);return P.jsx(P.Fragment,{children:Re(e||"")&&P.jsxs("div",{className:"chat-user-info",children:[t&&lt[t]?.logo&&P.jsx("div",{className:"user-avatar",children:P.jsx("img",{src:lt[t].logo||"",alt:"Chain",width:20,height:20})}),P.jsx("span",{className:"user-wallet",children:P.jsx("a",{style:{pointerEvents:s?"auto":"none"},href:lt[t]?.blockExplorers?.default?.url+"/address/"+e,target:"_blank",rel:"noopener noreferrer",children:gi(e)||"Not connected"})}),P.jsx("button",{className:"copy-address-btn",onClick:a,"aria-label":"Copy wallet address",type:"button",title:n?"Copied!":"Copy address",children:n?P.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:P.jsx("path",{d:"M13.3333 4L6 11.3333L2.66667 8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}):P.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",children:[P.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),P.jsx("path",{d:"M5 15H4C2.89543 15 2 14.1046 2 13V4C2 2.89543 2.89543 2 4 2H13C14.1046 2 15 2.89543 15 4V5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})})},He=[];for(let e=0;e<256;++e)He.push((e+256).toString(16).slice(1));function xi(e,t=0){return(He[e[t+0]]+He[e[t+1]]+He[e[t+2]]+He[e[t+3]]+"-"+He[e[t+4]]+He[e[t+5]]+"-"+He[e[t+6]]+He[e[t+7]]+"-"+He[e[t+8]]+He[e[t+9]]+"-"+He[e[t+10]]+He[e[t+11]]+He[e[t+12]]+He[e[t+13]]+He[e[t+14]]+He[e[t+15]]).toLowerCase()}let to;const Si=new Uint8Array(16);function Ei(){if(!to){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");to=crypto.getRandomValues.bind(crypto)}return to(Si)}const ps={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Ni(e,t,n){e=e||{};const o=e.random??e.rng?.()??Ei();if(o.length<16)throw new Error("Random bytes length must be >= 16");return o[6]=o[6]&15|64,o[8]=o[8]&63|128,xi(o)}function ms(e,t,n){return ps.randomUUID&&!e?ps.randomUUID():Ni(e)}const no="chat_widget_messages",hs=200,Ht=[{id:ms(),text:`**Welcome! 🚀**
99
- You're connected and ready to explore DeFi! I can help you trade, check prices, and analyze your portfolio when you need it.`,sender:"bot",timestamp:new Date}];function Ci(e,t){return e&&t?`${e}_${t}`:""}function bs(e){return e.map(t=>({...t,timestamp:new Date(t.timestamp)}))}function gs(){const e=Bt.getItem(no);if(!e)return null;try{const t=JSON.parse(e);if(t&&t.owner!==void 0&&Array.isArray(t.messages))return{owner:t.owner,messages:bs(t.messages)};if(Array.isArray(t))return{owner:"",messages:bs(t)}}catch{}return null}function hn(e,t){Bt.setItem(no,JSON.stringify({owner:e,messages:t}))}function Bi(){const{account:e}=eo(),t=Ci(e?.address,e?.chainId),[n,o]=ne.useState(()=>t||"pending"),[s,a]=ne.useState(()=>{const C=gs();return t?C&&C.owner===t?C.messages:Ht:C?.messages??Ht});if(n==="pending"&&t){const C=gs();C&&C.owner===t?a(C.messages):hn(t,s),o(t)}else n!=="pending"&&t&&n!==t&&(a(Ht),hn(t,Ht),o(t));ne.useEffect(()=>{n!=="pending"&&hn(n,s)},[s,n]),ne.useEffect(()=>{const C=[];for(let M=0;M<Bt.length;M++){const h=Bt.key(M);h&&h.startsWith(no+"_")&&C.push(h)}C.forEach(M=>Bt.removeItem(M))},[]);const r=(C,M,h,x,m)=>{const B=h?s.find(ke=>ke.id===h):void 0,L={id:ms(),text:C,sender:M,timestamp:new Date,...B&&{replyTo:{id:B.id,text:B.text,sender:B.sender}},...x&&{buttons:x},...m&&{actionData:m}};return a(ke=>{const N=[...ke,L];return N.length>hs?N.slice(N.length-hs):N}),L},l=(C,M)=>{a(h=>h.map(x=>x.id===C&&x.actionData?{...x,actionData:{...x.actionData,status:M}}:x))},d=(C,M)=>{a(h=>h.map(x=>x.id===C?{...x,text:M}:x))},T=ne.useCallback(()=>{a(Ht),hn(t,Ht)},[t]);return{messages:s,setMessages:a,addMessage:r,updateMessageAction:l,updateMessageText:d,clearMessages:T}}const ws=ne.createContext(void 0),Ii=()=>{const e=ne.useContext(ws);if(!e)throw new Error("useConfig must be used within ConfigProvider");return e},Pi=({children:e,initialConfig:t})=>P.jsx(ws.Provider,{value:{config:t||null},children:e});var Fi=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,oo=Math.ceil,Ze=Math.floor,ze="[BigNumber Error] ",ys=ze+"Number primitive has more than 15 significant digits: ",st=1e14,he=14,so=9007199254740991,ao=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],At=1e7,$e=1e9;function vs(e){var t,n,o,s=N.prototype={constructor:N,toString:null,valueOf:null},a=new N(1),r=20,l=4,d=-7,T=21,C=-1e7,M=1e7,h=!1,x=1,m=0,B={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},L="0123456789abcdefghijklmnopqrstuvwxyz",ke=!0;function N(c,u){var i,b,g,y,v,w,A,k,S=this;if(!(S instanceof N))return new N(c,u);if(u==null){if(c&&c._isBigNumber===!0){S.s=c.s,!c.c||c.e>M?S.c=S.e=null:c.e<C?S.c=[S.e=0]:(S.e=c.e,S.c=c.c.slice());return}if((w=typeof c=="number")&&c*0==0){if(S.s=1/c<0?(c=-c,-1):1,c===~~c){for(y=0,v=c;v>=10;v/=10,y++);y>M?S.c=S.e=null:(S.e=y,S.c=[c]);return}k=String(c)}else{if(!Fi.test(k=String(c)))return o(S,k,w);S.s=k.charCodeAt(0)==45?(k=k.slice(1),-1):1}(y=k.indexOf("."))>-1&&(k=k.replace(".","")),(v=k.search(/e/i))>0?(y<0&&(y=v),y+=+k.slice(v+1),k=k.substring(0,v)):y<0&&(y=k.length)}else{if(Ie(u,2,L.length,"Base"),u==10&&ke)return S=new N(c),pe(S,r+S.e+1,l);if(k=String(c),w=typeof c=="number"){if(c*0!=0)return o(S,k,w,u);if(S.s=1/c<0?(k=k.slice(1),-1):1,N.DEBUG&&k.replace(/^0\.0*|\./,"").length>15)throw Error(ys+c)}else S.s=k.charCodeAt(0)===45?(k=k.slice(1),-1):1;for(i=L.slice(0,u),y=v=0,A=k.length;v<A;v++)if(i.indexOf(b=k.charAt(v))<0){if(b=="."){if(v>y){y=A;continue}}else if(!g&&(k==k.toUpperCase()&&(k=k.toLowerCase())||k==k.toLowerCase()&&(k=k.toUpperCase()))){g=!0,v=-1,y=0;continue}return o(S,String(c),w,u)}w=!1,k=n(k,u,10,S.s),(y=k.indexOf("."))>-1?k=k.replace(".",""):y=k.length}for(v=0;k.charCodeAt(v)===48;v++);for(A=k.length;k.charCodeAt(--A)===48;);if(k=k.slice(v,++A)){if(A-=v,w&&N.DEBUG&&A>15&&(c>so||c!==Ze(c)))throw Error(ys+S.s*c);if((y=y-v-1)>M)S.c=S.e=null;else if(y<C)S.c=[S.e=0];else{if(S.e=y,S.c=[],v=(y+1)%he,y<0&&(v+=he),v<A){for(v&&S.c.push(+k.slice(0,v)),A-=he;v<A;)S.c.push(+k.slice(v,v+=he));v=he-(k=k.slice(v)).length}else v-=A;for(;v--;k+="0");S.c.push(+k)}}else S.c=[S.e=0]}N.clone=vs,N.ROUND_UP=0,N.ROUND_DOWN=1,N.ROUND_CEIL=2,N.ROUND_FLOOR=3,N.ROUND_HALF_UP=4,N.ROUND_HALF_DOWN=5,N.ROUND_HALF_EVEN=6,N.ROUND_HALF_CEIL=7,N.ROUND_HALF_FLOOR=8,N.EUCLID=9,N.config=N.set=function(c){var u,i;if(c!=null)if(typeof c=="object"){if(c.hasOwnProperty(u="DECIMAL_PLACES")&&(i=c[u],Ie(i,0,$e,u),r=i),c.hasOwnProperty(u="ROUNDING_MODE")&&(i=c[u],Ie(i,0,8,u),l=i),c.hasOwnProperty(u="EXPONENTIAL_AT")&&(i=c[u],i&&i.pop?(Ie(i[0],-$e,0,u),Ie(i[1],0,$e,u),d=i[0],T=i[1]):(Ie(i,-$e,$e,u),d=-(T=i<0?-i:i))),c.hasOwnProperty(u="RANGE"))if(i=c[u],i&&i.pop)Ie(i[0],-$e,-1,u),Ie(i[1],1,$e,u),C=i[0],M=i[1];else if(Ie(i,-$e,$e,u),i)C=-(M=i<0?-i:i);else throw Error(ze+u+" cannot be zero: "+i);if(c.hasOwnProperty(u="CRYPTO"))if(i=c[u],i===!!i)if(i)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))h=i;else throw h=!i,Error(ze+"crypto unavailable");else h=i;else throw Error(ze+u+" not true or false: "+i);if(c.hasOwnProperty(u="MODULO_MODE")&&(i=c[u],Ie(i,0,9,u),x=i),c.hasOwnProperty(u="POW_PRECISION")&&(i=c[u],Ie(i,0,$e,u),m=i),c.hasOwnProperty(u="FORMAT"))if(i=c[u],typeof i=="object")B=i;else throw Error(ze+u+" not an object: "+i);if(c.hasOwnProperty(u="ALPHABET"))if(i=c[u],typeof i=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(i))ke=i.slice(0,10)=="0123456789",L=i;else throw Error(ze+u+" invalid: "+i)}else throw Error(ze+"Object expected: "+c);return{DECIMAL_PLACES:r,ROUNDING_MODE:l,EXPONENTIAL_AT:[d,T],RANGE:[C,M],CRYPTO:h,MODULO_MODE:x,POW_PRECISION:m,FORMAT:B,ALPHABET:L}},N.isBigNumber=function(c){if(!c||c._isBigNumber!==!0)return!1;if(!N.DEBUG)return!0;var u,i,b=c.c,g=c.e,y=c.s;e:if({}.toString.call(b)=="[object Array]"){if((y===1||y===-1)&&g>=-$e&&g<=$e&&g===Ze(g)){if(b[0]===0){if(g===0&&b.length===1)return!0;break e}if(u=(g+1)%he,u<1&&(u+=he),String(b[0]).length==u){for(u=0;u<b.length;u++)if(i=b[u],i<0||i>=st||i!==Ze(i))break e;if(i!==0)return!0}}}else if(b===null&&g===null&&(y===null||y===1||y===-1))return!0;throw Error(ze+"Invalid BigNumber: "+c)},N.maximum=N.max=function(){return X(arguments,-1)},N.minimum=N.min=function(){return X(arguments,1)},N.random=(function(){var c=9007199254740992,u=Math.random()*c&2097151?function(){return Ze(Math.random()*c)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(i){var b,g,y,v,w,A=0,k=[],S=new N(a);if(i==null?i=r:Ie(i,0,$e),v=oo(i/he),h)if(crypto.getRandomValues){for(b=crypto.getRandomValues(new Uint32Array(v*=2));A<v;)w=b[A]*131072+(b[A+1]>>>11),w>=9e15?(g=crypto.getRandomValues(new Uint32Array(2)),b[A]=g[0],b[A+1]=g[1]):(k.push(w%1e14),A+=2);A=v/2}else if(crypto.randomBytes){for(b=crypto.randomBytes(v*=7);A<v;)w=(b[A]&31)*281474976710656+b[A+1]*1099511627776+b[A+2]*4294967296+b[A+3]*16777216+(b[A+4]<<16)+(b[A+5]<<8)+b[A+6],w>=9e15?crypto.randomBytes(7).copy(b,A):(k.push(w%1e14),A+=7);A=v/7}else throw h=!1,Error(ze+"crypto unavailable");if(!h)for(;A<v;)w=u(),w<9e15&&(k[A++]=w%1e14);for(v=k[--A],i%=he,v&&i&&(w=ao[he-i],k[A]=Ze(v/w)*w);k[A]===0;k.pop(),A--);if(A<0)k=[y=0];else{for(y=-1;k[0]===0;k.splice(0,1),y-=he);for(A=1,w=k[0];w>=10;w/=10,A++);A<he&&(y-=he-A)}return S.e=y,S.c=k,S}})(),N.sum=function(){for(var c=1,u=arguments,i=new N(u[0]);c<u.length;)i=i.plus(u[c++]);return i},n=(function(){var c="0123456789";function u(i,b,g,y){for(var v,w=[0],A,k=0,S=i.length;k<S;){for(A=w.length;A--;w[A]*=b);for(w[0]+=y.indexOf(i.charAt(k++)),v=0;v<w.length;v++)w[v]>g-1&&(w[v+1]==null&&(w[v+1]=0),w[v+1]+=w[v]/g|0,w[v]%=g)}return w.reverse()}return function(i,b,g,y,v){var w,A,k,S,D,z,se,me,Ae=i.indexOf("."),Se=r,j=l;for(Ae>=0&&(S=m,m=0,i=i.replace(".",""),me=new N(b),z=me.pow(i.length-Ae),m=S,me.c=u(ht(et(z.c),z.e,"0"),10,g,c),me.e=me.c.length),se=u(i,b,g,v?(w=L,c):(w=c,L)),k=S=se.length;se[--S]==0;se.pop());if(!se[0])return w.charAt(0);if(Ae<0?--k:(z.c=se,z.e=k,z.s=y,z=t(z,me,Se,j,g),se=z.c,D=z.r,k=z.e),A=k+Se+1,Ae=se[A],S=g/2,D=D||A<0||se[A+1]!=null,D=j<4?(Ae!=null||D)&&(j==0||j==(z.s<0?3:2)):Ae>S||Ae==S&&(j==4||D||j==6&&se[A-1]&1||j==(z.s<0?8:7)),A<1||!se[0])i=D?ht(w.charAt(1),-Se,w.charAt(0)):w.charAt(0);else{if(se.length=A,D)for(--g;++se[--A]>g;)se[A]=0,A||(++k,se=[1].concat(se));for(S=se.length;!se[--S];);for(Ae=0,i="";Ae<=S;i+=w.charAt(se[Ae++]));i=ht(i,k,w.charAt(0))}return i}})(),t=(function(){function c(b,g,y){var v,w,A,k,S=0,D=b.length,z=g%At,se=g/At|0;for(b=b.slice();D--;)A=b[D]%At,k=b[D]/At|0,v=se*A+k*z,w=z*A+v%At*At+S,S=(w/y|0)+(v/At|0)+se*k,b[D]=w%y;return S&&(b=[S].concat(b)),b}function u(b,g,y,v){var w,A;if(y!=v)A=y>v?1:-1;else for(w=A=0;w<y;w++)if(b[w]!=g[w]){A=b[w]>g[w]?1:-1;break}return A}function i(b,g,y,v){for(var w=0;y--;)b[y]-=w,w=b[y]<g[y]?1:0,b[y]=w*v+b[y]-g[y];for(;!b[0]&&b.length>1;b.splice(0,1));}return function(b,g,y,v,w){var A,k,S,D,z,se,me,Ae,Se,j,be,xe,We,at,Je,Fe,qe,Me=b.s==g.s?1:-1,De=b.c,Te=g.c;if(!De||!De[0]||!Te||!Te[0])return new N(!b.s||!g.s||(De?Te&&De[0]==Te[0]:!Te)?NaN:De&&De[0]==0||!Te?Me*0:Me/0);for(Ae=new N(Me),Se=Ae.c=[],k=b.e-g.e,Me=y+k+1,w||(w=st,k=Qe(b.e/he)-Qe(g.e/he),Me=Me/he|0),S=0;Te[S]==(De[S]||0);S++);if(Te[S]>(De[S]||0)&&k--,Me<0)Se.push(1),D=!0;else{for(at=De.length,Fe=Te.length,S=0,Me+=2,z=Ze(w/(Te[0]+1)),z>1&&(Te=c(Te,z,w),De=c(De,z,w),Fe=Te.length,at=De.length),We=Fe,j=De.slice(0,Fe),be=j.length;be<Fe;j[be++]=0);qe=Te.slice(),qe=[0].concat(qe),Je=Te[0],Te[1]>=w/2&&Je++;do{if(z=0,A=u(Te,j,Fe,be),A<0){if(xe=j[0],Fe!=be&&(xe=xe*w+(j[1]||0)),z=Ze(xe/Je),z>1)for(z>=w&&(z=w-1),se=c(Te,z,w),me=se.length,be=j.length;u(se,j,me,be)==1;)z--,i(se,Fe<me?qe:Te,me,w),me=se.length,A=1;else z==0&&(A=z=1),se=Te.slice(),me=se.length;if(me<be&&(se=[0].concat(se)),i(j,se,be,w),be=j.length,A==-1)for(;u(Te,j,Fe,be)<1;)z++,i(j,Fe<be?qe:Te,be,w),be=j.length}else A===0&&(z++,j=[0]);Se[S++]=z,j[0]?j[be++]=De[We]||0:(j=[De[We]],be=1)}while((We++<at||j[0]!=null)&&Me--);D=j[0]!=null,Se[0]||Se.splice(0,1)}if(w==st){for(S=1,Me=Se[0];Me>=10;Me/=10,S++);pe(Ae,y+(Ae.e=S+k*he-1)+1,v,D)}else Ae.e=k,Ae.r=+D;return Ae}})();function V(c,u,i,b){var g,y,v,w,A;if(i==null?i=l:Ie(i,0,8),!c.c)return c.toString();if(g=c.c[0],v=c.e,u==null)A=et(c.c),A=b==1||b==2&&(v<=d||v>=T)?gn(A,v):ht(A,v,"0");else if(c=pe(new N(c),u,i),y=c.e,A=et(c.c),w=A.length,b==1||b==2&&(u<=y||y<=d)){for(;w<u;A+="0",w++);A=gn(A,y)}else if(u-=v+(b===2&&y>v),A=ht(A,y,"0"),y+1>w){if(--u>0)for(A+=".";u--;A+="0");}else if(u+=y-w,u>0)for(y+1==w&&(A+=".");u--;A+="0");return c.s<0&&g?"-"+A:A}function X(c,u){for(var i,b,g=1,y=new N(c[0]);g<c.length;g++)b=new N(c[g]),(!b.s||(i=It(y,b))===u||i===0&&y.s===u)&&(y=b);return y}function fe(c,u,i){for(var b=1,g=u.length;!u[--g];u.pop());for(g=u[0];g>=10;g/=10,b++);return(i=b+i*he-1)>M?c.c=c.e=null:i<C?c.c=[c.e=0]:(c.e=i,c.c=u),c}o=(function(){var c=/^(-?)0([xbo])(?=\w[\w.]*$)/i,u=/^([^.]+)\.$/,i=/^\.([^.]+)$/,b=/^-?(Infinity|NaN)$/,g=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(y,v,w,A){var k,S=w?v:v.replace(g,"");if(b.test(S))y.s=isNaN(S)?null:S<0?-1:1;else{if(!w&&(S=S.replace(c,function(D,z,se){return k=(se=se.toLowerCase())=="x"?16:se=="b"?2:8,!A||A==k?z:D}),A&&(k=A,S=S.replace(u,"$1").replace(i,"0.$1")),v!=S))return new N(S,k);if(N.DEBUG)throw Error(ze+"Not a"+(A?" base "+A:"")+" number: "+v);y.s=null}y.c=y.e=null}})();function pe(c,u,i,b){var g,y,v,w,A,k,S,D=c.c,z=ao;if(D){e:{for(g=1,w=D[0];w>=10;w/=10,g++);if(y=u-g,y<0)y+=he,v=u,A=D[k=0],S=Ze(A/z[g-v-1]%10);else if(k=oo((y+1)/he),k>=D.length)if(b){for(;D.length<=k;D.push(0));A=S=0,g=1,y%=he,v=y-he+1}else break e;else{for(A=w=D[k],g=1;w>=10;w/=10,g++);y%=he,v=y-he+g,S=v<0?0:Ze(A/z[g-v-1]%10)}if(b=b||u<0||D[k+1]!=null||(v<0?A:A%z[g-v-1]),b=i<4?(S||b)&&(i==0||i==(c.s<0?3:2)):S>5||S==5&&(i==4||b||i==6&&(y>0?v>0?A/z[g-v]:0:D[k-1])%10&1||i==(c.s<0?8:7)),u<1||!D[0])return D.length=0,b?(u-=c.e+1,D[0]=z[(he-u%he)%he],c.e=-u||0):D[0]=c.e=0,c;if(y==0?(D.length=k,w=1,k--):(D.length=k+1,w=z[he-y],D[k]=v>0?Ze(A/z[g-v]%z[v])*w:0),b)for(;;)if(k==0){for(y=1,v=D[0];v>=10;v/=10,y++);for(v=D[0]+=w,w=1;v>=10;v/=10,w++);y!=w&&(c.e++,D[0]==st&&(D[0]=1));break}else{if(D[k]+=w,D[k]!=st)break;D[k--]=0,w=1}for(y=D.length;D[--y]===0;D.pop());}c.e>M?c.c=c.e=null:c.e<C&&(c.c=[c.e=0])}return c}function Ce(c){var u,i=c.e;return i===null?c.toString():(u=et(c.c),u=i<=d||i>=T?gn(u,i):ht(u,i,"0"),c.s<0?"-"+u:u)}return s.absoluteValue=s.abs=function(){var c=new N(this);return c.s<0&&(c.s=1),c},s.comparedTo=function(c,u){return It(this,new N(c,u))},s.decimalPlaces=s.dp=function(c,u){var i,b,g,y=this;if(c!=null)return Ie(c,0,$e),u==null?u=l:Ie(u,0,8),pe(new N(y),c+y.e+1,u);if(!(i=y.c))return null;if(b=((g=i.length-1)-Qe(this.e/he))*he,g=i[g])for(;g%10==0;g/=10,b--);return b<0&&(b=0),b},s.dividedBy=s.div=function(c,u){return t(this,new N(c,u),r,l)},s.dividedToIntegerBy=s.idiv=function(c,u){return t(this,new N(c,u),0,1)},s.exponentiatedBy=s.pow=function(c,u){var i,b,g,y,v,w,A,k,S,D=this;if(c=new N(c),c.c&&!c.isInteger())throw Error(ze+"Exponent not an integer: "+Ce(c));if(u!=null&&(u=new N(u)),w=c.e>14,!D.c||!D.c[0]||D.c[0]==1&&!D.e&&D.c.length==1||!c.c||!c.c[0])return S=new N(Math.pow(+Ce(D),w?c.s*(2-bn(c)):+Ce(c))),u?S.mod(u):S;if(A=c.s<0,u){if(u.c?!u.c[0]:!u.s)return new N(NaN);b=!A&&D.isInteger()&&u.isInteger(),b&&(D=D.mod(u))}else{if(c.e>9&&(D.e>0||D.e<-1||(D.e==0?D.c[0]>1||w&&D.c[1]>=24e7:D.c[0]<8e13||w&&D.c[0]<=9999975e7)))return y=D.s<0&&bn(c)?-0:0,D.e>-1&&(y=1/y),new N(A?1/y:y);m&&(y=oo(m/he+2))}for(w?(i=new N(.5),A&&(c.s=1),k=bn(c)):(g=Math.abs(+Ce(c)),k=g%2),S=new N(a);;){if(k){if(S=S.times(D),!S.c)break;y?S.c.length>y&&(S.c.length=y):b&&(S=S.mod(u))}if(g){if(g=Ze(g/2),g===0)break;k=g%2}else if(c=c.times(i),pe(c,c.e+1,1),c.e>14)k=bn(c);else{if(g=+Ce(c),g===0)break;k=g%2}D=D.times(D),y?D.c&&D.c.length>y&&(D.c.length=y):b&&(D=D.mod(u))}return b?S:(A&&(S=a.div(S)),u?S.mod(u):y?pe(S,m,l,v):S)},s.integerValue=function(c){var u=new N(this);return c==null?c=l:Ie(c,0,8),pe(u,u.e+1,c)},s.isEqualTo=s.eq=function(c,u){return It(this,new N(c,u))===0},s.isFinite=function(){return!!this.c},s.isGreaterThan=s.gt=function(c,u){return It(this,new N(c,u))>0},s.isGreaterThanOrEqualTo=s.gte=function(c,u){return(u=It(this,new N(c,u)))===1||u===0},s.isInteger=function(){return!!this.c&&Qe(this.e/he)>this.c.length-2},s.isLessThan=s.lt=function(c,u){return It(this,new N(c,u))<0},s.isLessThanOrEqualTo=s.lte=function(c,u){return(u=It(this,new N(c,u)))===-1||u===0},s.isNaN=function(){return!this.s},s.isNegative=function(){return this.s<0},s.isPositive=function(){return this.s>0},s.isZero=function(){return!!this.c&&this.c[0]==0},s.minus=function(c,u){var i,b,g,y,v=this,w=v.s;if(c=new N(c,u),u=c.s,!w||!u)return new N(NaN);if(w!=u)return c.s=-u,v.plus(c);var A=v.e/he,k=c.e/he,S=v.c,D=c.c;if(!A||!k){if(!S||!D)return S?(c.s=-u,c):new N(D?v:NaN);if(!S[0]||!D[0])return D[0]?(c.s=-u,c):new N(S[0]?v:l==3?-0:0)}if(A=Qe(A),k=Qe(k),S=S.slice(),w=A-k){for((y=w<0)?(w=-w,g=S):(k=A,g=D),g.reverse(),u=w;u--;g.push(0));g.reverse()}else for(b=(y=(w=S.length)<(u=D.length))?w:u,w=u=0;u<b;u++)if(S[u]!=D[u]){y=S[u]<D[u];break}if(y&&(g=S,S=D,D=g,c.s=-c.s),u=(b=D.length)-(i=S.length),u>0)for(;u--;S[i++]=0);for(u=st-1;b>w;){if(S[--b]<D[b]){for(i=b;i&&!S[--i];S[i]=u);--S[i],S[b]+=st}S[b]-=D[b]}for(;S[0]==0;S.splice(0,1),--k);return S[0]?fe(c,S,k):(c.s=l==3?-1:1,c.c=[c.e=0],c)},s.modulo=s.mod=function(c,u){var i,b,g=this;return c=new N(c,u),!g.c||!c.s||c.c&&!c.c[0]?new N(NaN):!c.c||g.c&&!g.c[0]?new N(g):(x==9?(b=c.s,c.s=1,i=t(g,c,0,3),c.s=b,i.s*=b):i=t(g,c,0,x),c=g.minus(i.times(c)),!c.c[0]&&x==1&&(c.s=g.s),c)},s.multipliedBy=s.times=function(c,u){var i,b,g,y,v,w,A,k,S,D,z,se,me,Ae,Se,j=this,be=j.c,xe=(c=new N(c,u)).c;if(!be||!xe||!be[0]||!xe[0])return!j.s||!c.s||be&&!be[0]&&!xe||xe&&!xe[0]&&!be?c.c=c.e=c.s=null:(c.s*=j.s,!be||!xe?c.c=c.e=null:(c.c=[0],c.e=0)),c;for(b=Qe(j.e/he)+Qe(c.e/he),c.s*=j.s,A=be.length,D=xe.length,A<D&&(me=be,be=xe,xe=me,g=A,A=D,D=g),g=A+D,me=[];g--;me.push(0));for(Ae=st,Se=At,g=D;--g>=0;){for(i=0,z=xe[g]%Se,se=xe[g]/Se|0,v=A,y=g+v;y>g;)k=be[--v]%Se,S=be[v]/Se|0,w=se*k+S*z,k=z*k+w%Se*Se+me[y]+i,i=(k/Ae|0)+(w/Se|0)+se*S,me[y--]=k%Ae;me[y]=i}return i?++b:me.splice(0,1),fe(c,me,b)},s.negated=function(){var c=new N(this);return c.s=-c.s||null,c},s.plus=function(c,u){var i,b=this,g=b.s;if(c=new N(c,u),u=c.s,!g||!u)return new N(NaN);if(g!=u)return c.s=-u,b.minus(c);var y=b.e/he,v=c.e/he,w=b.c,A=c.c;if(!y||!v){if(!w||!A)return new N(g/0);if(!w[0]||!A[0])return A[0]?c:new N(w[0]?b:g*0)}if(y=Qe(y),v=Qe(v),w=w.slice(),g=y-v){for(g>0?(v=y,i=A):(g=-g,i=w),i.reverse();g--;i.push(0));i.reverse()}for(g=w.length,u=A.length,g-u<0&&(i=A,A=w,w=i,u=g),g=0;u;)g=(w[--u]=w[u]+A[u]+g)/st|0,w[u]=st===w[u]?0:w[u]%st;return g&&(w=[g].concat(w),++v),fe(c,w,v)},s.precision=s.sd=function(c,u){var i,b,g,y=this;if(c!=null&&c!==!!c)return Ie(c,1,$e),u==null?u=l:Ie(u,0,8),pe(new N(y),c,u);if(!(i=y.c))return null;if(g=i.length-1,b=g*he+1,g=i[g]){for(;g%10==0;g/=10,b--);for(g=i[0];g>=10;g/=10,b++);}return c&&y.e+1>b&&(b=y.e+1),b},s.shiftedBy=function(c){return Ie(c,-so,so),this.times("1e"+c)},s.squareRoot=s.sqrt=function(){var c,u,i,b,g,y=this,v=y.c,w=y.s,A=y.e,k=r+4,S=new N("0.5");if(w!==1||!v||!v[0])return new N(!w||w<0&&(!v||v[0])?NaN:v?y:1/0);if(w=Math.sqrt(+Ce(y)),w==0||w==1/0?(u=et(v),(u.length+A)%2==0&&(u+="0"),w=Math.sqrt(+u),A=Qe((A+1)/2)-(A<0||A%2),w==1/0?u="5e"+A:(u=w.toExponential(),u=u.slice(0,u.indexOf("e")+1)+A),i=new N(u)):i=new N(w+""),i.c[0]){for(A=i.e,w=A+k,w<3&&(w=0);;)if(g=i,i=S.times(g.plus(t(y,g,k,1))),et(g.c).slice(0,w)===(u=et(i.c)).slice(0,w))if(i.e<A&&--w,u=u.slice(w-3,w+1),u=="9999"||!b&&u=="4999"){if(!b&&(pe(g,g.e+r+2,0),g.times(g).eq(y))){i=g;break}k+=4,w+=4,b=1}else{(!+u||!+u.slice(1)&&u.charAt(0)=="5")&&(pe(i,i.e+r+2,1),c=!i.times(i).eq(y));break}}return pe(i,i.e+r+1,l,c)},s.toExponential=function(c,u){return c!=null&&(Ie(c,0,$e),c++),V(this,c,u,1)},s.toFixed=function(c,u){return c!=null&&(Ie(c,0,$e),c=c+this.e+1),V(this,c,u)},s.toFormat=function(c,u,i){var b,g=this;if(i==null)c!=null&&u&&typeof u=="object"?(i=u,u=null):c&&typeof c=="object"?(i=c,c=u=null):i=B;else if(typeof i!="object")throw Error(ze+"Argument not an object: "+i);if(b=g.toFixed(c,u),g.c){var y,v=b.split("."),w=+i.groupSize,A=+i.secondaryGroupSize,k=i.groupSeparator||"",S=v[0],D=v[1],z=g.s<0,se=z?S.slice(1):S,me=se.length;if(A&&(y=w,w=A,A=y,me-=y),w>0&&me>0){for(y=me%w||w,S=se.substr(0,y);y<me;y+=w)S+=k+se.substr(y,w);A>0&&(S+=k+se.slice(y)),z&&(S="-"+S)}b=D?S+(i.decimalSeparator||"")+((A=+i.fractionGroupSize)?D.replace(new RegExp("\\d{"+A+"}\\B","g"),"$&"+(i.fractionGroupSeparator||"")):D):S}return(i.prefix||"")+b+(i.suffix||"")},s.toFraction=function(c){var u,i,b,g,y,v,w,A,k,S,D,z,se=this,me=se.c;if(c!=null&&(w=new N(c),!w.isInteger()&&(w.c||w.s!==1)||w.lt(a)))throw Error(ze+"Argument "+(w.isInteger()?"out of range: ":"not an integer: ")+Ce(w));if(!me)return new N(se);for(u=new N(a),k=i=new N(a),b=A=new N(a),z=et(me),y=u.e=z.length-se.e-1,u.c[0]=ao[(v=y%he)<0?he+v:v],c=!c||w.comparedTo(u)>0?y>0?u:k:w,v=M,M=1/0,w=new N(z),A.c[0]=0;S=t(w,u,0,1),g=i.plus(S.times(b)),g.comparedTo(c)!=1;)i=b,b=g,k=A.plus(S.times(g=k)),A=g,u=w.minus(S.times(g=u)),w=g;return g=t(c.minus(i),b,0,1),A=A.plus(g.times(k)),i=i.plus(g.times(b)),A.s=k.s=se.s,y=y*2,D=t(k,b,y,l).minus(se).abs().comparedTo(t(A,i,y,l).minus(se).abs())<1?[k,b]:[A,i],M=v,D},s.toNumber=function(){return+Ce(this)},s.toPrecision=function(c,u){return c!=null&&Ie(c,1,$e),V(this,c,u,2)},s.toString=function(c){var u,i=this,b=i.s,g=i.e;return g===null?b?(u="Infinity",b<0&&(u="-"+u)):u="NaN":(c==null?u=g<=d||g>=T?gn(et(i.c),g):ht(et(i.c),g,"0"):c===10&&ke?(i=pe(new N(i),r+g+1,l),u=ht(et(i.c),i.e,"0")):(Ie(c,2,L.length,"Base"),u=n(ht(et(i.c),g,"0"),10,c,b,!0)),b<0&&i.c[0]&&(u="-"+u)),u},s.valueOf=s.toJSON=function(){return Ce(this)},s._isBigNumber=!0,s[Symbol.toStringTag]="BigNumber",s[Symbol.for("nodejs.util.inspect.custom")]=s.valueOf,e!=null&&N.set(e),N}function Qe(e){var t=e|0;return e>0||e===t?t:t-1}function et(e){for(var t,n,o=1,s=e.length,a=e[0]+"";o<s;){for(t=e[o++]+"",n=he-t.length;n--;t="0"+t);a+=t}for(s=a.length;a.charCodeAt(--s)===48;);return a.slice(0,s+1||1)}function It(e,t){var n,o,s=e.c,a=t.c,r=e.s,l=t.s,d=e.e,T=t.e;if(!r||!l)return null;if(n=s&&!s[0],o=a&&!a[0],n||o)return n?o?0:-l:r;if(r!=l)return r;if(n=r<0,o=d==T,!s||!a)return o?0:!s^n?1:-1;if(!o)return d>T^n?1:-1;for(l=(d=s.length)<(T=a.length)?d:T,r=0;r<l;r++)if(s[r]!=a[r])return s[r]>a[r]^n?1:-1;return d==T?0:d>T^n?1:-1}function Ie(e,t,n,o){if(e<t||e>n||e!==Ze(e))throw Error(ze+(o||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function bn(e){var t=e.c.length-1;return Qe(e.e/he)==t&&e.c[t]%2!=0}function gn(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function ht(e,t,n){var o,s;if(t<0){for(s=n+".";++t;s+=n);e=s+e}else if(o=e.length,++t>o){for(s=n,t-=o;--t;s+=n);e+=s}else t<o&&(e=e.slice(0,t)+"."+e.slice(t));return e}var ce=vs();class Qt{baseUrl;constructor(t){this.baseUrl=t}buildUrl(t,n){const o=new URL(t,this.baseUrl);return n&&Object.entries(n).forEach(([s,a])=>{a!=null&&o.searchParams.append(s,String(a))}),o.toString()}async get(t,n={}){const o=this.buildUrl(t,n.query),s=await fetch(o,{method:"GET",headers:n.headers||{}});if(!s.ok){let r=null;try{r=await s.json()}catch{try{const d=await s.text();d&&(r={message:d})}catch{}}const l=new Error(r?.message||r?.errorMessage||`HTTP ${s.status}: ${s.statusText}`);throw l.status=s.status,l.statusText=s.statusText,r&&(l.data=r),l}return{data:await s.json(),status:s.status}}async post(t,n,o={}){const s=this.buildUrl(t,o.query),a=await fetch(s,{method:"POST",headers:{"Content-Type":"application/json",...o.headers},body:JSON.stringify(n)});if(!a.ok){let l=null;try{l=await a.json()}catch{try{const T=await a.text();T&&(l={message:T})}catch{}}const d=new Error(l?.message||l?.errorMessage||`HTTP ${a.status}: ${a.statusText}`);throw d.status=a.status,d.statusText=a.statusText,l&&(d.data=l),d}return{data:await a.json(),status:a.status}}}const Di=.01,ks=new Qt("https://wallet-api.pantograph.app"),_i="https://deep-index.moralis.io";function en(){return"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJub25jZSI6ImY4NmY0Yzc2LTA3MDQtNGEwZS04YTA0LWUwODllOGQxMGZjZCIsIm9yZ0lkIjoiMzk0MDAyIiwidXNlcklkIjoiNDA0ODUzIiwidHlwZUlkIjoiYjQyODExOTQtOGQ0Yi00NjkxLTlhZjItNjU4ODE2NzExYmRjIiwidHlwZSI6IlBST0pFQ1QiLCJpYXQiOjE3MTY4NjQyNTYsImV4cCI6NDg3MjYyNDI1Nn0.V8crfBIBardAnZkc05FD0hQIJBeZxMqvzRnYExVtnF8"}function tn(e){return{"X-API-Key":e,Accept:"application/json"}}const nn=new Qt(_i);async function je(e){const{address:t,chain:n="base",token_addresses:o,exclude_spam:s,exclude_unverified_contracts:a}=e;if(!t)throw new Error("Address is required");try{const r=en(),l={chain:n,exclude_spam:s??!1,exclude_unverified_contracts:a??!1};o&&(l.token_addresses=o);const T=(await nn.get(`/api/v2.2/wallets/${encodeURIComponent(t)}/tokens`,{query:l,headers:tn(r)})).data;if(T?.result?.length>0){T.result=T.result.filter(C=>new ce(C?.balance||0).gt(0)),T.result=T.result.map(C=>({...C,token_address:C.token_address===ki?Ge:C.token_address}));try{const C=us(n)??n,M=T.result.map(x=>x.token_address),h=await ks.get(`/keyrings/tokens/${C}/v2`,{query:{addresses:M.join(",")}});if(Array.isArray(h.data)){const x=new Map;for(const m of h.data)m.address&&m.price!=null&&x.set(m.address.toLowerCase(),parseFloat(String(m.price)));T.result=T.result.map(m=>{const B=x.get(m.token_address.toLowerCase());if(B==null)return m;const L=ce(m.balance_formatted||"0").multipliedBy(B).toNumber();return{...m,usd_price:B,usd_value:L}}),T.result=T.result.filter(m=>m.usd_value==null||new ce(m.usd_value).gte(Di))}}catch(C){console.warn("⚠️ Failed to fetch Pantograph prices:",C)}}return{success:!0,data:T}}catch(r){const l=r instanceof Error?r.message:"Unknown error";return console.error("❌ Error fetching token balances:",l),{success:!1,error:l}}}async function Ui(e){const{address:t,chain:n="base"}=e;if(!t)throw new Error("Token address is required");try{const o=us(n)??n,s=await ks.get(`/keyrings/tokens/${o}/v2`,{query:{addresses:t}}),r=(Array.isArray(s.data)?s.data:[]).find(x=>x.address?.toLowerCase()===t.toLowerCase())??null;if(r)return{success:!0,data:{token_address:r.address??t,name:r.name??"",symbol:r.symbol??"",decimals:r.decimals!=null?Number(r.decimals):18,logo:r.icon_image||r.logo,thumbnail:r.icon_image||r.logo,usd_price:r.price!=null?parseFloat(r.price):void 0,usd_price_24hr_percent_change:r.price_change_percentage_24h??void 0,usd_price_24hr_usd_change:r.price_change_24h??void 0}};console.warn("⚠️ Pantograph returned no result, falling back to Moralis API");const l=en(),[d,T]=await Promise.allSettled([nn.get("/api/v2.2/erc20/metadata",{query:{chain:n,addresses:[t]},headers:tn(l)}),nn.get(`/api/v2.2/erc20/${encodeURIComponent(t)}/price`,{query:{chain:n,include:"percent_change"},headers:tn(l)})]),C=d.status==="fulfilled"?d.value.data:[];if(!C||C.length===0)return{success:!1,error:"Token metadata not found"};const M=C[0],h=T.status==="fulfilled"?T.value.data:void 0;return{success:!0,data:{token_address:M.token_address,name:M.name,symbol:M.symbol,decimals:M.decimals,logo:M.logo||M.thumbnail,thumbnail:M.thumbnail,usd_price:h?.usdPrice??void 0,usd_price_24hr_percent_change:h?.["24hrPercentChange"]?parseFloat(h["24hrPercentChange"]):void 0,usd_price_24hr_usd_change:h?.usdPriceChange24hr??void 0}}}catch(o){const s=o instanceof Error?o.message:"Unknown error";return console.error("❌ Error fetching token metadata:",s),{success:!1,error:s}}}async function Oi(e){const{prompt:t,model:n="gpt-4.1-mini",stream:o=!1,systemPrompt:s}=e;if(!t)throw new Error("Prompt is required");try{const a=en(),r=new Qt("https://cortex-api.moralis.io"),l=s?`${s}
97
+ `).slice(0,-1)}class ai extends ue{constructor(t,{account:n,docsPath:o,chain:s,data:a,gas:r,gasPrice:i,maxFeePerGas:d,maxPriorityFeePerGas:T,nonce:B,to:R,value:h,stateOverride:x}){const m=n?jn(n):void 0;let C=Bo({from:m?.address,to:R,value:typeof h<"u"&&`${ga(h)} ${s?.nativeCurrency?.symbol||"ETH"}`,data:a,gas:r,gasPrice:typeof i<"u"&&`${Nt(i)} gwei`,maxFeePerGas:typeof d<"u"&&`${Nt(d)} gwei`,maxPriorityFeePerGas:typeof T<"u"&&`${Nt(T)} gwei`,nonce:B});x&&(C+=`
98
+ ${si(x)}`),super(t.shortMessage,{cause:t,docsPath:o,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Raw Call Arguments:",C].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}function ri(e,t){const n=(e.details||"").toLowerCase(),o=e instanceof ue?e.walk(s=>s?.code===$t.code):e;return o instanceof ue?new $t({cause:e,message:o.details}):$t.nodeMessage.test(n)?new $t({cause:e,message:e.details}):Ct.nodeMessage.test(n)?new Ct({cause:e,maxFeePerGas:t?.maxFeePerGas}):On.nodeMessage.test(n)?new On({cause:e,maxFeePerGas:t?.maxFeePerGas}):Un.nodeMessage.test(n)?new Un({cause:e,nonce:t?.nonce}):Ln.nodeMessage.test(n)?new Ln({cause:e,nonce:t?.nonce}):Mn.nodeMessage.test(n)?new Mn({cause:e,nonce:t?.nonce}):Rn.nodeMessage.test(n)?new Rn({cause:e}):$n.nodeMessage.test(n)?new $n({cause:e,gas:t?.gas}):Hn.nodeMessage.test(n)?new Hn({cause:e,gas:t?.gas}):Wn.nodeMessage.test(n)?new Wn({cause:e}):Yt.nodeMessage.test(n)?new Yt({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):new Go({cause:e})}function ii(e,{docsPath:t,...n}){const o=(()=>{const s=ri(e,n);return s instanceof Go?e:s})();return new ai(o,{docsPath:t,...n})}function ci(e,{format:t}){if(!t)return{};const n={};function o(a){const r=Object.keys(a);for(const i of r)i in e&&(n[i]=e[i]),a[i]&&typeof a[i]=="object"&&!Array.isArray(a[i])&&o(a[i])}const s=t(e||{});return o(s),n}function li(e){const{account:t,maxFeePerGas:n,maxPriorityFeePerGas:o,to:s}=e,a=t?jn(t):void 0;if(a&&!Re(a.address))throw new ct({address:a.address});if(s&&!Re(s))throw new ct({address:s});if(n&&n>Mt)throw new Ct({maxFeePerGas:n});if(o&&n&&o>n)throw new Yt({maxFeePerGas:n,maxPriorityFeePerGas:o})}async function di(e,t){const{account:n=e.account}=t;if(!n)throw new Ir;const o=jn(n);try{const{accessList:s,blockNumber:a,blockTag:r,data:i,gas:d,gasPrice:T,maxFeePerGas:B,maxPriorityFeePerGas:R,nonce:h,to:x,value:m,...C}=t,ke=(typeof a=="bigint"?le(a):void 0)||r;li(t);const N=e.chain?.formatters?.transactionRequest?.format,X=(N||ia)({...ci(C,{format:N}),account:o,accessList:s,data:i,gas:d,gasPrice:T,maxFeePerGas:B,maxPriorityFeePerGas:R,nonce:h,to:x,value:m},"estimateGas"),{baseFeePerGas:fe,gasLimit:pe,priorityFeePerGas:Be}=await e.request({method:"linea_estimateGas",params:ke?[X,ke]:[X]});return{baseFeePerGas:BigInt(fe),gasLimit:BigInt(pe),priorityFeePerGas:BigInt(Be)}}catch(s){throw ii(s,{...t,account:o,chain:e.chain})}}const ui={fees:{estimateFeesPerGas:ls,async maxPriorityFeePerGas({block:e,client:t,request:n}){const o=await ls({block:e,client:t,multiply:s=>s,request:n,type:"eip1559"});return o?.maxPriorityFeePerGas?o.maxPriorityFeePerGas:null}}};async function ls({client:e,multiply:t,request:n,type:o}){try{const s=await di(e,{...n,account:n?.account}),{priorityFeePerGas:a}=s,i=t(BigInt(s.baseFeePerGas))+a;return o==="legacy"?{gasPrice:i}:{maxFeePerGas:i,maxPriorityFeePerGas:a}}catch{return null}}const fi=ut({...ui,id:59144,name:"Linea Mainnet",blockTime:2e3,nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build",apiUrl:"https://api.lineascan.build/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:42},ensRegistry:{address:"0x50130b669B28C339991d8676FA73CF122a121267",blockCreated:6682888},ensUniversalResolver:{address:"0x4D41762915F83c76EcaF6776d9b08076aA32b492",blockCreated:22222151}},ensTlds:[".linea.eth"],testnet:!1}),pi=ut({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:12e3,rpcUrls:{default:{http:["https://eth.merkle.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensUniversalResolver:{address:"0xeeeeeeee14d718c2b47d9923deab1335e144eeee",blockCreated:23085558},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),Zt=1,mi=ut({...mn,id:10,name:"OP Mainnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.optimism.io"]}},blockExplorers:{default:{name:"Optimism Explorer",url:"https://optimistic.etherscan.io",apiUrl:"https://api-optimistic.etherscan.io/api"}},contracts:{...mn.contracts,disputeGameFactory:{[Zt]:{address:"0xe5965Ab5962eDc7477C8520243A95517CD252fA9"}},l2OutputOracle:{[Zt]:{address:"0xdfe97868233d1aa22e815a266982f2cf17685a27"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:4286263},portal:{[Zt]:{address:"0xbEb5Fc579115071764c7423A4f12eDde41f106Ed"}},l1StandardBridge:{[Zt]:{address:"0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1"}}},sourceId:Zt}),hi=ut({id:137,name:"Polygon",blockTime:2e3,nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{default:{http:["https://polygon-rpc.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://polygonscan.com",apiUrl:"https://api.etherscan.io/v2/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}}}),ds="/docs/contract/encodeFunctionData";function bi(e){const{abi:t,args:n,functionName:o}=e;let s=t[0];if(o){const a=oi({abi:t,args:n,name:o});if(!a)throw new os(o,{docsPath:ds});s=a}if(s.type!=="function")throw new os(void 0,{docsPath:ds});return{abi:[s],functionName:rs(Jn(s))}}function kt(e){const{args:t}=e,{abi:n,functionName:o}=e.abi.length===1&&e.functionName?.startsWith("0x")?e:bi(e),s=n[0],a=o,r="inputs"in s&&s.inputs?qr(s.inputs,t??[]):void 0;return Et([a,r??"0x"])}const lt={1:{...pi,logo:"https://cryptologos.cc/logos/ethereum-eth-logo.png?v=024",chainId:1,chainType:"ether",chainTypeMoralis:"eth",tokenTrendingDefault:["0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2","0x2260fac5e5542a773aa44fbcfedf7c193bc2c599"]},10:{...mi,logo:"https://cryptologos.cc/logos/optimism-ethereum-op-logo.png?v=024",chainId:10,chainType:"optimism",chainTypeMoralis:"optimism",tokenTrendingDefault:["0x4200000000000000000000000000000000000006","0x68f180fcce6836688e9084f035309e29bf0a2095","0xc47da4cb96ce65a96844a01bfae509f9d5454534"]},56:{...Br,logo:"https://cryptologos.cc/logos/bnb-bnb-logo.png?v=024",chainId:56,chainType:"bsc",chainTypeMoralis:"bsc",tokenTrendingDefault:["0x2170ed0880ac9a755fd29b2688956bd959f933f8","0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c"]},137:{...hi,rpcUrls:{default:{http:["https://polygon-bor-rpc.publicnode.com"]}},logo:"https://cryptologos.cc/logos/polygon-matic-logo.png?v=024",chainId:137,chainType:"matic",chainTypeMoralis:"polygon",tokenTrendingDefault:["0x7ceb23fd6bc0add59e62ac25578270cff1b9f619","0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6"]},8453:{...ts,logo:"https://icons.llamao.fi/icons/chains/rsz_base.jpg",chainId:8453,chainType:"base",chainTypeMoralis:"base",tokenTrendingDefault:["0x4200000000000000000000000000000000000006","0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf","0xc47da4cb96ce65a96844a01bfae509f9d5454534"]},42161:{...Nr,logo:"https://cryptologos.cc/logos/arbitrum-arb-logo.png?v=024",chainId:42161,chainType:"arbitrum",chainTypeMoralis:"arbitrum",tokenTrendingDefault:["0x82af49447d8a07e3bd95bd0d56f35241523fbab1","0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f"]},43114:{...Cr,logo:"https://cryptologos.cc/logos/avalanche-avax-logo.png?v=024",chainId:43114,chainType:"avax",chainTypeMoralis:"avalanche",tokenTrendingDefault:["0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB","0x0555E30da8f98308EdB960aa94C0Db47230d2B9c"]},59144:{...fi,logo:"https://icons.llamao.fi/icons/chains/rsz_linea.jpg",chainId:59144,chainType:"linea",chainTypeMoralis:"linea",tokenTrendingDefault:["0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f","0x3aab2285ddcddad8edf438c1bab47e1a9d05a9b4"]}},us=e=>Object.values(lt).find(n=>n.chainTypeMoralis===e)?.chainType||null,gi=e=>{const t=new Date,n=new Date(t);n.setDate(n.getDate()-1);const o=new Date(e);return o.setHours(0,0,0,0),t.setHours(0,0,0,0),n.setHours(0,0,0,0),o.getTime()===t.getTime()?"Today":o.getTime()===n.getTime()?"Yesterday":o.toLocaleDateString("en-US",{month:"short",day:"numeric",year:o.getFullYear()!==t.getFullYear()?"numeric":void 0})},ot=e=>new Promise(t=>setTimeout(t,e||0)),wi=(e,t=5,n=5)=>(e=e||"",e?.length<=t+n?e:`${e.substr(0,t)}...${e.substr(e.length-n,n)}`),yi=e=>{if(!e)return"";const t=lt[e];return t?t.chainTypeMoralis:""},vi=e=>{if(!e)return"";const t=lt[e];return t?t.chainType:""},Bt={getItem(e){if(typeof window>"u")return null;try{return window.localStorage.getItem(e)}catch{return null}},setItem(e,t){if(!(typeof window>"u"))try{window.localStorage.setItem(e,t)}catch{}},removeItem(e){if(!(typeof window>"u"))try{window.localStorage.removeItem(e)}catch{}},get length(){if(typeof window>"u")return 0;try{return window.localStorage.length}catch{return 0}},key(e){if(typeof window>"u")return null;try{return window.localStorage.key(e)}catch{return null}}};class ki extends ue{constructor({value:t}){super(`Number \`${t}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function mt(e,t){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(e))throw new ki({value:e});let[n,o="0"]=e.split(".");const s=n.startsWith("-");if(s&&(n=n.slice(1)),o=o.replace(/(0+)$/,""),t===0)Math.round(+`.${o}`)===1&&(n=`${BigInt(n)+1n}`),o="";else if(o.length>t){const[a,r,i]=[o.slice(0,t-1),o.slice(t-1,t),o.slice(t)],d=Math.round(+`${r}.${i}`);d>9?o=`${BigInt(a)+BigInt(1)}0`.padStart(a.length+1,"0"):o=`${a}${d}`,o.length>t&&(o=o.slice(1),n=`${BigInt(n)+1n}`),o=o.slice(0,t)}else o=o.padEnd(t,"0");return BigInt(`${s?"-":""}${n}${o}`)}const Ai="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",He="0x0000000000000000000000000000000000000000",fs=ne.createContext(void 0),eo=()=>{const e=ne.useContext(fs);if(!e)throw new Error("useConnect must be used within ConnectProvider");return{...e,chainData:lt[e.account?.chainId]||void 0,chainId:e.account?.chainId||void 0,chainType:vi(e.account?.chainId||void 0),chainTypeMoralis:yi(e.account?.chainId||void 0),isChainSupported:!!lt[e.account?.chainId]}},Ti=({children:e,initialAccount:t})=>P.jsx(fs.Provider,{value:{account:t||null},children:e}),xi=({address:e,chainId:t})=>{const[n,o]=ne.useState(!1),{isChainSupported:s}=eo(),a=ne.useCallback(()=>{if(!e)return;const r=e,i=()=>{o(!0),setTimeout(()=>o(!1),2e3)};try{navigator.clipboard.writeText(r).then(i).catch(()=>{const d=document.createElement("input");d.value=r,document.body.appendChild(d),d.select(),document.execCommand("copy"),d.remove(),i()})}catch{const d=document.createElement("input");d.value=r,document.body.appendChild(d),d.select(),document.execCommand("copy"),d.remove(),i()}},[e]);return P.jsx(P.Fragment,{children:Re(e||"")&&P.jsxs("div",{className:"chat-user-info",children:[t&&lt[t]?.logo&&P.jsx("div",{className:"user-avatar",children:P.jsx("img",{src:lt[t].logo||"",alt:"Chain",width:20,height:20})}),P.jsx("span",{className:"user-wallet",children:P.jsx("a",{style:{pointerEvents:s?"auto":"none"},href:lt[t]?.blockExplorers?.default?.url+"/address/"+e,target:"_blank",rel:"noopener noreferrer",children:wi(e)||"Not connected"})}),P.jsx("button",{className:"copy-address-btn",onClick:a,"aria-label":"Copy wallet address",type:"button",title:n?"Copied!":"Copy address",children:n?P.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:P.jsx("path",{d:"M13.3333 4L6 11.3333L2.66667 8",stroke:"#0B3988",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}):P.jsx("svg",{width:"14",height:"14",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:P.jsx("path",{d:"M8.1 15.75H13.23C12.9638 16.4152 12.5041 16.9852 11.9105 17.3863C11.3168 17.7874 10.6165 18.0012 9.9 18H3.6C2.64522 18 1.72955 17.6207 1.05442 16.9456C0.379285 16.2704 0 15.3548 0 14.4V7.2C0.00104929 6.32332 0.321408 5.47704 0.901163 4.81944C1.48092 4.16183 2.28037 3.73792 3.15 3.627V10.8C3.15238 12.1121 3.67466 13.3698 4.60245 14.2975C5.53024 15.2253 6.78791 15.7476 8.1 15.75ZM15.75 3.825H17.658C17.6027 3.74389 17.5393 3.66852 17.469 3.6L14.4 0.531C14.3337 0.460854 14.258 0.400274 14.175 0.351V2.25C14.1769 2.66713 14.3434 3.06664 14.6384 3.3616C14.9334 3.65656 15.3329 3.8231 15.75 3.825ZM15.75 5.175C14.9747 5.17357 14.2315 4.86494 13.6833 4.31671C13.1351 3.76847 12.8264 3.02532 12.825 2.25V0H8.1C7.14522 0 6.22955 0.379285 5.55442 1.05442C4.87928 1.72955 4.5 2.64522 4.5 3.6V10.8C4.5 11.7548 4.87928 12.6704 5.55442 13.3456C6.22955 14.0207 7.14522 14.4 8.1 14.4H14.4C15.3548 14.4 16.2705 14.0207 16.9456 13.3456C17.6207 12.6704 18 11.7548 18 10.8V5.175H15.75Z",fill:"#0B3988"})})})]})})},We=[];for(let e=0;e<256;++e)We.push((e+256).toString(16).slice(1));function Ei(e,t=0){return(We[e[t+0]]+We[e[t+1]]+We[e[t+2]]+We[e[t+3]]+"-"+We[e[t+4]]+We[e[t+5]]+"-"+We[e[t+6]]+We[e[t+7]]+"-"+We[e[t+8]]+We[e[t+9]]+"-"+We[e[t+10]]+We[e[t+11]]+We[e[t+12]]+We[e[t+13]]+We[e[t+14]]+We[e[t+15]]).toLowerCase()}let to;const Si=new Uint8Array(16);function Ni(){if(!to){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");to=crypto.getRandomValues.bind(crypto)}return to(Si)}const ps={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Ci(e,t,n){e=e||{};const o=e.random??e.rng?.()??Ni();if(o.length<16)throw new Error("Random bytes length must be >= 16");return o[6]=o[6]&15|64,o[8]=o[8]&63|128,Ei(o)}function ms(e,t,n){return ps.randomUUID&&!e?ps.randomUUID():Ci(e)}const no="chat_widget_messages",hs=200,Ht=[{id:ms(),text:`**Welcome! 🚀**
99
+ You're connected and ready to explore DeFi! I can help you trade, check prices, and analyze your portfolio when you need it.`,sender:"bot",timestamp:new Date}];function Bi(e,t){return e&&t?`${e}_${t}`:""}function bs(e){return e.map(t=>({...t,timestamp:new Date(t.timestamp)}))}function gs(){const e=Bt.getItem(no);if(!e)return null;try{const t=JSON.parse(e);if(t&&t.owner!==void 0&&Array.isArray(t.messages))return{owner:t.owner,messages:bs(t.messages)};if(Array.isArray(t))return{owner:"",messages:bs(t)}}catch{}return null}function hn(e,t){Bt.setItem(no,JSON.stringify({owner:e,messages:t}))}function Ii(){const{account:e}=eo(),t=Bi(e?.address,e?.chainId),[n,o]=ne.useState(()=>t||"pending"),[s,a]=ne.useState(()=>{const B=gs();return t?B&&B.owner===t?B.messages:Ht:B?.messages??Ht});if(n==="pending"&&t){const B=gs();B&&B.owner===t?a(B.messages):hn(t,s),o(t)}else n!=="pending"&&t&&n!==t&&(a(Ht),hn(t,Ht),o(t));ne.useEffect(()=>{n!=="pending"&&hn(n,s)},[s,n]),ne.useEffect(()=>{const B=[];for(let R=0;R<Bt.length;R++){const h=Bt.key(R);h&&h.startsWith(no+"_")&&B.push(h)}B.forEach(R=>Bt.removeItem(R))},[]);const r=(B,R,h,x,m)=>{const C=h?s.find(ke=>ke.id===h):void 0,L={id:ms(),text:B,sender:R,timestamp:new Date,...C&&{replyTo:{id:C.id,text:C.text,sender:C.sender}},...x&&{buttons:x},...m&&{actionData:m}};return a(ke=>{const N=[...ke,L];return N.length>hs?N.slice(N.length-hs):N}),L},i=(B,R)=>{a(h=>h.map(x=>x.id===B&&x.actionData?{...x,actionData:{...x.actionData,status:R}}:x))},d=(B,R)=>{a(h=>h.map(x=>x.id===B?{...x,text:R}:x))},T=ne.useCallback(()=>{a(Ht),hn(t,Ht)},[t]);return{messages:s,setMessages:a,addMessage:r,updateMessageAction:i,updateMessageText:d,clearMessages:T}}const ws=ne.createContext(void 0),Pi=()=>{const e=ne.useContext(ws);if(!e)throw new Error("useConfig must be used within ConfigProvider");return e},Fi=({children:e,initialConfig:t})=>P.jsx(ws.Provider,{value:{config:t||null},children:e});var Di=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,oo=Math.ceil,Ze=Math.floor,ze="[BigNumber Error] ",ys=ze+"Number primitive has more than 15 significant digits: ",st=1e14,be=14,so=9007199254740991,ao=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],At=1e7,$e=1e9;function vs(e){var t,n,o,s=N.prototype={constructor:N,toString:null,valueOf:null},a=new N(1),r=20,i=4,d=-7,T=21,B=-1e7,R=1e7,h=!1,x=1,m=0,C={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},L="0123456789abcdefghijklmnopqrstuvwxyz",ke=!0;function N(l,u){var c,b,g,w,v,y,A,k,E=this;if(!(E instanceof N))return new N(l,u);if(u==null){if(l&&l._isBigNumber===!0){E.s=l.s,!l.c||l.e>R?E.c=E.e=null:l.e<B?E.c=[E.e=0]:(E.e=l.e,E.c=l.c.slice());return}if((y=typeof l=="number")&&l*0==0){if(E.s=1/l<0?(l=-l,-1):1,l===~~l){for(w=0,v=l;v>=10;v/=10,w++);w>R?E.c=E.e=null:(E.e=w,E.c=[l]);return}k=String(l)}else{if(!Di.test(k=String(l)))return o(E,k,y);E.s=k.charCodeAt(0)==45?(k=k.slice(1),-1):1}(w=k.indexOf("."))>-1&&(k=k.replace(".","")),(v=k.search(/e/i))>0?(w<0&&(w=v),w+=+k.slice(v+1),k=k.substring(0,v)):w<0&&(w=k.length)}else{if(Ie(u,2,L.length,"Base"),u==10&&ke)return E=new N(l),pe(E,r+E.e+1,i);if(k=String(l),y=typeof l=="number"){if(l*0!=0)return o(E,k,y,u);if(E.s=1/l<0?(k=k.slice(1),-1):1,N.DEBUG&&k.replace(/^0\.0*|\./,"").length>15)throw Error(ys+l)}else E.s=k.charCodeAt(0)===45?(k=k.slice(1),-1):1;for(c=L.slice(0,u),w=v=0,A=k.length;v<A;v++)if(c.indexOf(b=k.charAt(v))<0){if(b=="."){if(v>w){w=A;continue}}else if(!g&&(k==k.toUpperCase()&&(k=k.toLowerCase())||k==k.toLowerCase()&&(k=k.toUpperCase()))){g=!0,v=-1,w=0;continue}return o(E,String(l),y,u)}y=!1,k=n(k,u,10,E.s),(w=k.indexOf("."))>-1?k=k.replace(".",""):w=k.length}for(v=0;k.charCodeAt(v)===48;v++);for(A=k.length;k.charCodeAt(--A)===48;);if(k=k.slice(v,++A)){if(A-=v,y&&N.DEBUG&&A>15&&(l>so||l!==Ze(l)))throw Error(ys+E.s*l);if((w=w-v-1)>R)E.c=E.e=null;else if(w<B)E.c=[E.e=0];else{if(E.e=w,E.c=[],v=(w+1)%be,w<0&&(v+=be),v<A){for(v&&E.c.push(+k.slice(0,v)),A-=be;v<A;)E.c.push(+k.slice(v,v+=be));v=be-(k=k.slice(v)).length}else v-=A;for(;v--;k+="0");E.c.push(+k)}}else E.c=[E.e=0]}N.clone=vs,N.ROUND_UP=0,N.ROUND_DOWN=1,N.ROUND_CEIL=2,N.ROUND_FLOOR=3,N.ROUND_HALF_UP=4,N.ROUND_HALF_DOWN=5,N.ROUND_HALF_EVEN=6,N.ROUND_HALF_CEIL=7,N.ROUND_HALF_FLOOR=8,N.EUCLID=9,N.config=N.set=function(l){var u,c;if(l!=null)if(typeof l=="object"){if(l.hasOwnProperty(u="DECIMAL_PLACES")&&(c=l[u],Ie(c,0,$e,u),r=c),l.hasOwnProperty(u="ROUNDING_MODE")&&(c=l[u],Ie(c,0,8,u),i=c),l.hasOwnProperty(u="EXPONENTIAL_AT")&&(c=l[u],c&&c.pop?(Ie(c[0],-$e,0,u),Ie(c[1],0,$e,u),d=c[0],T=c[1]):(Ie(c,-$e,$e,u),d=-(T=c<0?-c:c))),l.hasOwnProperty(u="RANGE"))if(c=l[u],c&&c.pop)Ie(c[0],-$e,-1,u),Ie(c[1],1,$e,u),B=c[0],R=c[1];else if(Ie(c,-$e,$e,u),c)B=-(R=c<0?-c:c);else throw Error(ze+u+" cannot be zero: "+c);if(l.hasOwnProperty(u="CRYPTO"))if(c=l[u],c===!!c)if(c)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))h=c;else throw h=!c,Error(ze+"crypto unavailable");else h=c;else throw Error(ze+u+" not true or false: "+c);if(l.hasOwnProperty(u="MODULO_MODE")&&(c=l[u],Ie(c,0,9,u),x=c),l.hasOwnProperty(u="POW_PRECISION")&&(c=l[u],Ie(c,0,$e,u),m=c),l.hasOwnProperty(u="FORMAT"))if(c=l[u],typeof c=="object")C=c;else throw Error(ze+u+" not an object: "+c);if(l.hasOwnProperty(u="ALPHABET"))if(c=l[u],typeof c=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(c))ke=c.slice(0,10)=="0123456789",L=c;else throw Error(ze+u+" invalid: "+c)}else throw Error(ze+"Object expected: "+l);return{DECIMAL_PLACES:r,ROUNDING_MODE:i,EXPONENTIAL_AT:[d,T],RANGE:[B,R],CRYPTO:h,MODULO_MODE:x,POW_PRECISION:m,FORMAT:C,ALPHABET:L}},N.isBigNumber=function(l){if(!l||l._isBigNumber!==!0)return!1;if(!N.DEBUG)return!0;var u,c,b=l.c,g=l.e,w=l.s;e:if({}.toString.call(b)=="[object Array]"){if((w===1||w===-1)&&g>=-$e&&g<=$e&&g===Ze(g)){if(b[0]===0){if(g===0&&b.length===1)return!0;break e}if(u=(g+1)%be,u<1&&(u+=be),String(b[0]).length==u){for(u=0;u<b.length;u++)if(c=b[u],c<0||c>=st||c!==Ze(c))break e;if(c!==0)return!0}}}else if(b===null&&g===null&&(w===null||w===1||w===-1))return!0;throw Error(ze+"Invalid BigNumber: "+l)},N.maximum=N.max=function(){return X(arguments,-1)},N.minimum=N.min=function(){return X(arguments,1)},N.random=(function(){var l=9007199254740992,u=Math.random()*l&2097151?function(){return Ze(Math.random()*l)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(c){var b,g,w,v,y,A=0,k=[],E=new N(a);if(c==null?c=r:Ie(c,0,$e),v=oo(c/be),h)if(crypto.getRandomValues){for(b=crypto.getRandomValues(new Uint32Array(v*=2));A<v;)y=b[A]*131072+(b[A+1]>>>11),y>=9e15?(g=crypto.getRandomValues(new Uint32Array(2)),b[A]=g[0],b[A+1]=g[1]):(k.push(y%1e14),A+=2);A=v/2}else if(crypto.randomBytes){for(b=crypto.randomBytes(v*=7);A<v;)y=(b[A]&31)*281474976710656+b[A+1]*1099511627776+b[A+2]*4294967296+b[A+3]*16777216+(b[A+4]<<16)+(b[A+5]<<8)+b[A+6],y>=9e15?crypto.randomBytes(7).copy(b,A):(k.push(y%1e14),A+=7);A=v/7}else throw h=!1,Error(ze+"crypto unavailable");if(!h)for(;A<v;)y=u(),y<9e15&&(k[A++]=y%1e14);for(v=k[--A],c%=be,v&&c&&(y=ao[be-c],k[A]=Ze(v/y)*y);k[A]===0;k.pop(),A--);if(A<0)k=[w=0];else{for(w=-1;k[0]===0;k.splice(0,1),w-=be);for(A=1,y=k[0];y>=10;y/=10,A++);A<be&&(w-=be-A)}return E.e=w,E.c=k,E}})(),N.sum=function(){for(var l=1,u=arguments,c=new N(u[0]);l<u.length;)c=c.plus(u[l++]);return c},n=(function(){var l="0123456789";function u(c,b,g,w){for(var v,y=[0],A,k=0,E=c.length;k<E;){for(A=y.length;A--;y[A]*=b);for(y[0]+=w.indexOf(c.charAt(k++)),v=0;v<y.length;v++)y[v]>g-1&&(y[v+1]==null&&(y[v+1]=0),y[v+1]+=y[v]/g|0,y[v]%=g)}return y.reverse()}return function(c,b,g,w,v){var y,A,k,E,D,z,se,he,Ae=c.indexOf("."),Se=r,j=i;for(Ae>=0&&(E=m,m=0,c=c.replace(".",""),he=new N(b),z=he.pow(c.length-Ae),m=E,he.c=u(ht(et(z.c),z.e,"0"),10,g,l),he.e=he.c.length),se=u(c,b,g,v?(y=L,l):(y=l,L)),k=E=se.length;se[--E]==0;se.pop());if(!se[0])return y.charAt(0);if(Ae<0?--k:(z.c=se,z.e=k,z.s=w,z=t(z,he,Se,j,g),se=z.c,D=z.r,k=z.e),A=k+Se+1,Ae=se[A],E=g/2,D=D||A<0||se[A+1]!=null,D=j<4?(Ae!=null||D)&&(j==0||j==(z.s<0?3:2)):Ae>E||Ae==E&&(j==4||D||j==6&&se[A-1]&1||j==(z.s<0?8:7)),A<1||!se[0])c=D?ht(y.charAt(1),-Se,y.charAt(0)):y.charAt(0);else{if(se.length=A,D)for(--g;++se[--A]>g;)se[A]=0,A||(++k,se=[1].concat(se));for(E=se.length;!se[--E];);for(Ae=0,c="";Ae<=E;c+=y.charAt(se[Ae++]));c=ht(c,k,y.charAt(0))}return c}})(),t=(function(){function l(b,g,w){var v,y,A,k,E=0,D=b.length,z=g%At,se=g/At|0;for(b=b.slice();D--;)A=b[D]%At,k=b[D]/At|0,v=se*A+k*z,y=z*A+v%At*At+E,E=(y/w|0)+(v/At|0)+se*k,b[D]=y%w;return E&&(b=[E].concat(b)),b}function u(b,g,w,v){var y,A;if(w!=v)A=w>v?1:-1;else for(y=A=0;y<w;y++)if(b[y]!=g[y]){A=b[y]>g[y]?1:-1;break}return A}function c(b,g,w,v){for(var y=0;w--;)b[w]-=y,y=b[w]<g[w]?1:0,b[w]=y*v+b[w]-g[w];for(;!b[0]&&b.length>1;b.splice(0,1));}return function(b,g,w,v,y){var A,k,E,D,z,se,he,Ae,Se,j,ge,Ee,Ve,at,Je,Fe,qe,Me=b.s==g.s?1:-1,De=b.c,Te=g.c;if(!De||!De[0]||!Te||!Te[0])return new N(!b.s||!g.s||(De?Te&&De[0]==Te[0]:!Te)?NaN:De&&De[0]==0||!Te?Me*0:Me/0);for(Ae=new N(Me),Se=Ae.c=[],k=b.e-g.e,Me=w+k+1,y||(y=st,k=Qe(b.e/be)-Qe(g.e/be),Me=Me/be|0),E=0;Te[E]==(De[E]||0);E++);if(Te[E]>(De[E]||0)&&k--,Me<0)Se.push(1),D=!0;else{for(at=De.length,Fe=Te.length,E=0,Me+=2,z=Ze(y/(Te[0]+1)),z>1&&(Te=l(Te,z,y),De=l(De,z,y),Fe=Te.length,at=De.length),Ve=Fe,j=De.slice(0,Fe),ge=j.length;ge<Fe;j[ge++]=0);qe=Te.slice(),qe=[0].concat(qe),Je=Te[0],Te[1]>=y/2&&Je++;do{if(z=0,A=u(Te,j,Fe,ge),A<0){if(Ee=j[0],Fe!=ge&&(Ee=Ee*y+(j[1]||0)),z=Ze(Ee/Je),z>1)for(z>=y&&(z=y-1),se=l(Te,z,y),he=se.length,ge=j.length;u(se,j,he,ge)==1;)z--,c(se,Fe<he?qe:Te,he,y),he=se.length,A=1;else z==0&&(A=z=1),se=Te.slice(),he=se.length;if(he<ge&&(se=[0].concat(se)),c(j,se,ge,y),ge=j.length,A==-1)for(;u(Te,j,Fe,ge)<1;)z++,c(j,Fe<ge?qe:Te,ge,y),ge=j.length}else A===0&&(z++,j=[0]);Se[E++]=z,j[0]?j[ge++]=De[Ve]||0:(j=[De[Ve]],ge=1)}while((Ve++<at||j[0]!=null)&&Me--);D=j[0]!=null,Se[0]||Se.splice(0,1)}if(y==st){for(E=1,Me=Se[0];Me>=10;Me/=10,E++);pe(Ae,w+(Ae.e=E+k*be-1)+1,v,D)}else Ae.e=k,Ae.r=+D;return Ae}})();function V(l,u,c,b){var g,w,v,y,A;if(c==null?c=i:Ie(c,0,8),!l.c)return l.toString();if(g=l.c[0],v=l.e,u==null)A=et(l.c),A=b==1||b==2&&(v<=d||v>=T)?gn(A,v):ht(A,v,"0");else if(l=pe(new N(l),u,c),w=l.e,A=et(l.c),y=A.length,b==1||b==2&&(u<=w||w<=d)){for(;y<u;A+="0",y++);A=gn(A,w)}else if(u-=v+(b===2&&w>v),A=ht(A,w,"0"),w+1>y){if(--u>0)for(A+=".";u--;A+="0");}else if(u+=w-y,u>0)for(w+1==y&&(A+=".");u--;A+="0");return l.s<0&&g?"-"+A:A}function X(l,u){for(var c,b,g=1,w=new N(l[0]);g<l.length;g++)b=new N(l[g]),(!b.s||(c=It(w,b))===u||c===0&&w.s===u)&&(w=b);return w}function fe(l,u,c){for(var b=1,g=u.length;!u[--g];u.pop());for(g=u[0];g>=10;g/=10,b++);return(c=b+c*be-1)>R?l.c=l.e=null:c<B?l.c=[l.e=0]:(l.e=c,l.c=u),l}o=(function(){var l=/^(-?)0([xbo])(?=\w[\w.]*$)/i,u=/^([^.]+)\.$/,c=/^\.([^.]+)$/,b=/^-?(Infinity|NaN)$/,g=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(w,v,y,A){var k,E=y?v:v.replace(g,"");if(b.test(E))w.s=isNaN(E)?null:E<0?-1:1;else{if(!y&&(E=E.replace(l,function(D,z,se){return k=(se=se.toLowerCase())=="x"?16:se=="b"?2:8,!A||A==k?z:D}),A&&(k=A,E=E.replace(u,"$1").replace(c,"0.$1")),v!=E))return new N(E,k);if(N.DEBUG)throw Error(ze+"Not a"+(A?" base "+A:"")+" number: "+v);w.s=null}w.c=w.e=null}})();function pe(l,u,c,b){var g,w,v,y,A,k,E,D=l.c,z=ao;if(D){e:{for(g=1,y=D[0];y>=10;y/=10,g++);if(w=u-g,w<0)w+=be,v=u,A=D[k=0],E=Ze(A/z[g-v-1]%10);else if(k=oo((w+1)/be),k>=D.length)if(b){for(;D.length<=k;D.push(0));A=E=0,g=1,w%=be,v=w-be+1}else break e;else{for(A=y=D[k],g=1;y>=10;y/=10,g++);w%=be,v=w-be+g,E=v<0?0:Ze(A/z[g-v-1]%10)}if(b=b||u<0||D[k+1]!=null||(v<0?A:A%z[g-v-1]),b=c<4?(E||b)&&(c==0||c==(l.s<0?3:2)):E>5||E==5&&(c==4||b||c==6&&(w>0?v>0?A/z[g-v]:0:D[k-1])%10&1||c==(l.s<0?8:7)),u<1||!D[0])return D.length=0,b?(u-=l.e+1,D[0]=z[(be-u%be)%be],l.e=-u||0):D[0]=l.e=0,l;if(w==0?(D.length=k,y=1,k--):(D.length=k+1,y=z[be-w],D[k]=v>0?Ze(A/z[g-v]%z[v])*y:0),b)for(;;)if(k==0){for(w=1,v=D[0];v>=10;v/=10,w++);for(v=D[0]+=y,y=1;v>=10;v/=10,y++);w!=y&&(l.e++,D[0]==st&&(D[0]=1));break}else{if(D[k]+=y,D[k]!=st)break;D[k--]=0,y=1}for(w=D.length;D[--w]===0;D.pop());}l.e>R?l.c=l.e=null:l.e<B&&(l.c=[l.e=0])}return l}function Be(l){var u,c=l.e;return c===null?l.toString():(u=et(l.c),u=c<=d||c>=T?gn(u,c):ht(u,c,"0"),l.s<0?"-"+u:u)}return s.absoluteValue=s.abs=function(){var l=new N(this);return l.s<0&&(l.s=1),l},s.comparedTo=function(l,u){return It(this,new N(l,u))},s.decimalPlaces=s.dp=function(l,u){var c,b,g,w=this;if(l!=null)return Ie(l,0,$e),u==null?u=i:Ie(u,0,8),pe(new N(w),l+w.e+1,u);if(!(c=w.c))return null;if(b=((g=c.length-1)-Qe(this.e/be))*be,g=c[g])for(;g%10==0;g/=10,b--);return b<0&&(b=0),b},s.dividedBy=s.div=function(l,u){return t(this,new N(l,u),r,i)},s.dividedToIntegerBy=s.idiv=function(l,u){return t(this,new N(l,u),0,1)},s.exponentiatedBy=s.pow=function(l,u){var c,b,g,w,v,y,A,k,E,D=this;if(l=new N(l),l.c&&!l.isInteger())throw Error(ze+"Exponent not an integer: "+Be(l));if(u!=null&&(u=new N(u)),y=l.e>14,!D.c||!D.c[0]||D.c[0]==1&&!D.e&&D.c.length==1||!l.c||!l.c[0])return E=new N(Math.pow(+Be(D),y?l.s*(2-bn(l)):+Be(l))),u?E.mod(u):E;if(A=l.s<0,u){if(u.c?!u.c[0]:!u.s)return new N(NaN);b=!A&&D.isInteger()&&u.isInteger(),b&&(D=D.mod(u))}else{if(l.e>9&&(D.e>0||D.e<-1||(D.e==0?D.c[0]>1||y&&D.c[1]>=24e7:D.c[0]<8e13||y&&D.c[0]<=9999975e7)))return w=D.s<0&&bn(l)?-0:0,D.e>-1&&(w=1/w),new N(A?1/w:w);m&&(w=oo(m/be+2))}for(y?(c=new N(.5),A&&(l.s=1),k=bn(l)):(g=Math.abs(+Be(l)),k=g%2),E=new N(a);;){if(k){if(E=E.times(D),!E.c)break;w?E.c.length>w&&(E.c.length=w):b&&(E=E.mod(u))}if(g){if(g=Ze(g/2),g===0)break;k=g%2}else if(l=l.times(c),pe(l,l.e+1,1),l.e>14)k=bn(l);else{if(g=+Be(l),g===0)break;k=g%2}D=D.times(D),w?D.c&&D.c.length>w&&(D.c.length=w):b&&(D=D.mod(u))}return b?E:(A&&(E=a.div(E)),u?E.mod(u):w?pe(E,m,i,v):E)},s.integerValue=function(l){var u=new N(this);return l==null?l=i:Ie(l,0,8),pe(u,u.e+1,l)},s.isEqualTo=s.eq=function(l,u){return It(this,new N(l,u))===0},s.isFinite=function(){return!!this.c},s.isGreaterThan=s.gt=function(l,u){return It(this,new N(l,u))>0},s.isGreaterThanOrEqualTo=s.gte=function(l,u){return(u=It(this,new N(l,u)))===1||u===0},s.isInteger=function(){return!!this.c&&Qe(this.e/be)>this.c.length-2},s.isLessThan=s.lt=function(l,u){return It(this,new N(l,u))<0},s.isLessThanOrEqualTo=s.lte=function(l,u){return(u=It(this,new N(l,u)))===-1||u===0},s.isNaN=function(){return!this.s},s.isNegative=function(){return this.s<0},s.isPositive=function(){return this.s>0},s.isZero=function(){return!!this.c&&this.c[0]==0},s.minus=function(l,u){var c,b,g,w,v=this,y=v.s;if(l=new N(l,u),u=l.s,!y||!u)return new N(NaN);if(y!=u)return l.s=-u,v.plus(l);var A=v.e/be,k=l.e/be,E=v.c,D=l.c;if(!A||!k){if(!E||!D)return E?(l.s=-u,l):new N(D?v:NaN);if(!E[0]||!D[0])return D[0]?(l.s=-u,l):new N(E[0]?v:i==3?-0:0)}if(A=Qe(A),k=Qe(k),E=E.slice(),y=A-k){for((w=y<0)?(y=-y,g=E):(k=A,g=D),g.reverse(),u=y;u--;g.push(0));g.reverse()}else for(b=(w=(y=E.length)<(u=D.length))?y:u,y=u=0;u<b;u++)if(E[u]!=D[u]){w=E[u]<D[u];break}if(w&&(g=E,E=D,D=g,l.s=-l.s),u=(b=D.length)-(c=E.length),u>0)for(;u--;E[c++]=0);for(u=st-1;b>y;){if(E[--b]<D[b]){for(c=b;c&&!E[--c];E[c]=u);--E[c],E[b]+=st}E[b]-=D[b]}for(;E[0]==0;E.splice(0,1),--k);return E[0]?fe(l,E,k):(l.s=i==3?-1:1,l.c=[l.e=0],l)},s.modulo=s.mod=function(l,u){var c,b,g=this;return l=new N(l,u),!g.c||!l.s||l.c&&!l.c[0]?new N(NaN):!l.c||g.c&&!g.c[0]?new N(g):(x==9?(b=l.s,l.s=1,c=t(g,l,0,3),l.s=b,c.s*=b):c=t(g,l,0,x),l=g.minus(c.times(l)),!l.c[0]&&x==1&&(l.s=g.s),l)},s.multipliedBy=s.times=function(l,u){var c,b,g,w,v,y,A,k,E,D,z,se,he,Ae,Se,j=this,ge=j.c,Ee=(l=new N(l,u)).c;if(!ge||!Ee||!ge[0]||!Ee[0])return!j.s||!l.s||ge&&!ge[0]&&!Ee||Ee&&!Ee[0]&&!ge?l.c=l.e=l.s=null:(l.s*=j.s,!ge||!Ee?l.c=l.e=null:(l.c=[0],l.e=0)),l;for(b=Qe(j.e/be)+Qe(l.e/be),l.s*=j.s,A=ge.length,D=Ee.length,A<D&&(he=ge,ge=Ee,Ee=he,g=A,A=D,D=g),g=A+D,he=[];g--;he.push(0));for(Ae=st,Se=At,g=D;--g>=0;){for(c=0,z=Ee[g]%Se,se=Ee[g]/Se|0,v=A,w=g+v;w>g;)k=ge[--v]%Se,E=ge[v]/Se|0,y=se*k+E*z,k=z*k+y%Se*Se+he[w]+c,c=(k/Ae|0)+(y/Se|0)+se*E,he[w--]=k%Ae;he[w]=c}return c?++b:he.splice(0,1),fe(l,he,b)},s.negated=function(){var l=new N(this);return l.s=-l.s||null,l},s.plus=function(l,u){var c,b=this,g=b.s;if(l=new N(l,u),u=l.s,!g||!u)return new N(NaN);if(g!=u)return l.s=-u,b.minus(l);var w=b.e/be,v=l.e/be,y=b.c,A=l.c;if(!w||!v){if(!y||!A)return new N(g/0);if(!y[0]||!A[0])return A[0]?l:new N(y[0]?b:g*0)}if(w=Qe(w),v=Qe(v),y=y.slice(),g=w-v){for(g>0?(v=w,c=A):(g=-g,c=y),c.reverse();g--;c.push(0));c.reverse()}for(g=y.length,u=A.length,g-u<0&&(c=A,A=y,y=c,u=g),g=0;u;)g=(y[--u]=y[u]+A[u]+g)/st|0,y[u]=st===y[u]?0:y[u]%st;return g&&(y=[g].concat(y),++v),fe(l,y,v)},s.precision=s.sd=function(l,u){var c,b,g,w=this;if(l!=null&&l!==!!l)return Ie(l,1,$e),u==null?u=i:Ie(u,0,8),pe(new N(w),l,u);if(!(c=w.c))return null;if(g=c.length-1,b=g*be+1,g=c[g]){for(;g%10==0;g/=10,b--);for(g=c[0];g>=10;g/=10,b++);}return l&&w.e+1>b&&(b=w.e+1),b},s.shiftedBy=function(l){return Ie(l,-so,so),this.times("1e"+l)},s.squareRoot=s.sqrt=function(){var l,u,c,b,g,w=this,v=w.c,y=w.s,A=w.e,k=r+4,E=new N("0.5");if(y!==1||!v||!v[0])return new N(!y||y<0&&(!v||v[0])?NaN:v?w:1/0);if(y=Math.sqrt(+Be(w)),y==0||y==1/0?(u=et(v),(u.length+A)%2==0&&(u+="0"),y=Math.sqrt(+u),A=Qe((A+1)/2)-(A<0||A%2),y==1/0?u="5e"+A:(u=y.toExponential(),u=u.slice(0,u.indexOf("e")+1)+A),c=new N(u)):c=new N(y+""),c.c[0]){for(A=c.e,y=A+k,y<3&&(y=0);;)if(g=c,c=E.times(g.plus(t(w,g,k,1))),et(g.c).slice(0,y)===(u=et(c.c)).slice(0,y))if(c.e<A&&--y,u=u.slice(y-3,y+1),u=="9999"||!b&&u=="4999"){if(!b&&(pe(g,g.e+r+2,0),g.times(g).eq(w))){c=g;break}k+=4,y+=4,b=1}else{(!+u||!+u.slice(1)&&u.charAt(0)=="5")&&(pe(c,c.e+r+2,1),l=!c.times(c).eq(w));break}}return pe(c,c.e+r+1,i,l)},s.toExponential=function(l,u){return l!=null&&(Ie(l,0,$e),l++),V(this,l,u,1)},s.toFixed=function(l,u){return l!=null&&(Ie(l,0,$e),l=l+this.e+1),V(this,l,u)},s.toFormat=function(l,u,c){var b,g=this;if(c==null)l!=null&&u&&typeof u=="object"?(c=u,u=null):l&&typeof l=="object"?(c=l,l=u=null):c=C;else if(typeof c!="object")throw Error(ze+"Argument not an object: "+c);if(b=g.toFixed(l,u),g.c){var w,v=b.split("."),y=+c.groupSize,A=+c.secondaryGroupSize,k=c.groupSeparator||"",E=v[0],D=v[1],z=g.s<0,se=z?E.slice(1):E,he=se.length;if(A&&(w=y,y=A,A=w,he-=w),y>0&&he>0){for(w=he%y||y,E=se.substr(0,w);w<he;w+=y)E+=k+se.substr(w,y);A>0&&(E+=k+se.slice(w)),z&&(E="-"+E)}b=D?E+(c.decimalSeparator||"")+((A=+c.fractionGroupSize)?D.replace(new RegExp("\\d{"+A+"}\\B","g"),"$&"+(c.fractionGroupSeparator||"")):D):E}return(c.prefix||"")+b+(c.suffix||"")},s.toFraction=function(l){var u,c,b,g,w,v,y,A,k,E,D,z,se=this,he=se.c;if(l!=null&&(y=new N(l),!y.isInteger()&&(y.c||y.s!==1)||y.lt(a)))throw Error(ze+"Argument "+(y.isInteger()?"out of range: ":"not an integer: ")+Be(y));if(!he)return new N(se);for(u=new N(a),k=c=new N(a),b=A=new N(a),z=et(he),w=u.e=z.length-se.e-1,u.c[0]=ao[(v=w%be)<0?be+v:v],l=!l||y.comparedTo(u)>0?w>0?u:k:y,v=R,R=1/0,y=new N(z),A.c[0]=0;E=t(y,u,0,1),g=c.plus(E.times(b)),g.comparedTo(l)!=1;)c=b,b=g,k=A.plus(E.times(g=k)),A=g,u=y.minus(E.times(g=u)),y=g;return g=t(l.minus(c),b,0,1),A=A.plus(g.times(k)),c=c.plus(g.times(b)),A.s=k.s=se.s,w=w*2,D=t(k,b,w,i).minus(se).abs().comparedTo(t(A,c,w,i).minus(se).abs())<1?[k,b]:[A,c],R=v,D},s.toNumber=function(){return+Be(this)},s.toPrecision=function(l,u){return l!=null&&Ie(l,1,$e),V(this,l,u,2)},s.toString=function(l){var u,c=this,b=c.s,g=c.e;return g===null?b?(u="Infinity",b<0&&(u="-"+u)):u="NaN":(l==null?u=g<=d||g>=T?gn(et(c.c),g):ht(et(c.c),g,"0"):l===10&&ke?(c=pe(new N(c),r+g+1,i),u=ht(et(c.c),c.e,"0")):(Ie(l,2,L.length,"Base"),u=n(ht(et(c.c),g,"0"),10,l,b,!0)),b<0&&c.c[0]&&(u="-"+u)),u},s.valueOf=s.toJSON=function(){return Be(this)},s._isBigNumber=!0,s[Symbol.toStringTag]="BigNumber",s[Symbol.for("nodejs.util.inspect.custom")]=s.valueOf,e!=null&&N.set(e),N}function Qe(e){var t=e|0;return e>0||e===t?t:t-1}function et(e){for(var t,n,o=1,s=e.length,a=e[0]+"";o<s;){for(t=e[o++]+"",n=be-t.length;n--;t="0"+t);a+=t}for(s=a.length;a.charCodeAt(--s)===48;);return a.slice(0,s+1||1)}function It(e,t){var n,o,s=e.c,a=t.c,r=e.s,i=t.s,d=e.e,T=t.e;if(!r||!i)return null;if(n=s&&!s[0],o=a&&!a[0],n||o)return n?o?0:-i:r;if(r!=i)return r;if(n=r<0,o=d==T,!s||!a)return o?0:!s^n?1:-1;if(!o)return d>T^n?1:-1;for(i=(d=s.length)<(T=a.length)?d:T,r=0;r<i;r++)if(s[r]!=a[r])return s[r]>a[r]^n?1:-1;return d==T?0:d>T^n?1:-1}function Ie(e,t,n,o){if(e<t||e>n||e!==Ze(e))throw Error(ze+(o||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function bn(e){var t=e.c.length-1;return Qe(e.e/be)==t&&e.c[t]%2!=0}function gn(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function ht(e,t,n){var o,s;if(t<0){for(s=n+".";++t;s+=n);e=s+e}else if(o=e.length,++t>o){for(s=n,t-=o;--t;s+=n);e+=s}else t<o&&(e=e.slice(0,t)+"."+e.slice(t));return e}var ce=vs();class Qt{baseUrl;constructor(t){this.baseUrl=t}buildUrl(t,n){const o=new URL(t,this.baseUrl);return n&&Object.entries(n).forEach(([s,a])=>{a!=null&&o.searchParams.append(s,String(a))}),o.toString()}async get(t,n={}){const o=this.buildUrl(t,n.query),s=await fetch(o,{method:"GET",headers:n.headers||{}});if(!s.ok){let r=null;try{r=await s.json()}catch{try{const d=await s.text();d&&(r={message:d})}catch{}}const i=new Error(r?.message||r?.errorMessage||`HTTP ${s.status}: ${s.statusText}`);throw i.status=s.status,i.statusText=s.statusText,r&&(i.data=r),i}return{data:await s.json(),status:s.status}}async post(t,n,o={}){const s=this.buildUrl(t,o.query),a=await fetch(s,{method:"POST",headers:{"Content-Type":"application/json",...o.headers},body:JSON.stringify(n)});if(!a.ok){let i=null;try{i=await a.json()}catch{try{const T=await a.text();T&&(i={message:T})}catch{}}const d=new Error(i?.message||i?.errorMessage||`HTTP ${a.status}: ${a.statusText}`);throw d.status=a.status,d.statusText=a.statusText,i&&(d.data=i),d}return{data:await a.json(),status:a.status}}}const _i=.01,ks=new Qt("https://wallet-api.pantograph.app"),Oi="https://deep-index.moralis.io";function en(){return"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJub25jZSI6ImY4NmY0Yzc2LTA3MDQtNGEwZS04YTA0LWUwODllOGQxMGZjZCIsIm9yZ0lkIjoiMzk0MDAyIiwidXNlcklkIjoiNDA0ODUzIiwidHlwZUlkIjoiYjQyODExOTQtOGQ0Yi00NjkxLTlhZjItNjU4ODE2NzExYmRjIiwidHlwZSI6IlBST0pFQ1QiLCJpYXQiOjE3MTY4NjQyNTYsImV4cCI6NDg3MjYyNDI1Nn0.V8crfBIBardAnZkc05FD0hQIJBeZxMqvzRnYExVtnF8"}function tn(e){return{"X-API-Key":e,Accept:"application/json"}}const nn=new Qt(Oi);async function je(e){const{address:t,chain:n="base",token_addresses:o,exclude_spam:s,exclude_unverified_contracts:a}=e;if(!t)throw new Error("Address is required");try{const r=en(),i={chain:n,exclude_spam:s??!1,exclude_unverified_contracts:a??!1};o&&(i.token_addresses=o);const T=(await nn.get(`/api/v2.2/wallets/${encodeURIComponent(t)}/tokens`,{query:i,headers:tn(r)})).data;if(T?.result?.length>0){T.result=T.result.filter(B=>new ce(B?.balance||0).gt(0)),T.result=T.result.map(B=>({...B,token_address:B.token_address===Ai?He:B.token_address}));try{const B=us(n)??n,R=T.result.map(x=>x.token_address),h=await ks.get(`/keyrings/tokens/${B}/v2`,{query:{addresses:R.join(",")}});if(Array.isArray(h.data)){const x=new Map;for(const m of h.data)m.address&&m.price!=null&&x.set(m.address.toLowerCase(),parseFloat(String(m.price)));T.result=T.result.map(m=>{const C=x.get(m.token_address.toLowerCase());if(C==null)return m;const L=ce(m.balance_formatted||"0").multipliedBy(C).toNumber();return{...m,usd_price:C,usd_value:L}}),T.result=T.result.filter(m=>m.usd_value==null||new ce(m.usd_value).gte(_i))}}catch(B){console.warn("⚠️ Failed to fetch Pantograph prices:",B)}}return{success:!0,data:T}}catch(r){const i=r instanceof Error?r.message:"Unknown error";return console.error("❌ Error fetching token balances:",i),{success:!1,error:i}}}async function As(e){const{address:t,chain:n="base"}=e;if(!t)throw new Error("Token address is required");try{const o=us(n)??n,s=await ks.get(`/keyrings/tokens/${o}/v2`,{query:{addresses:t}}),a=t===He,i=(Array.isArray(s.data)?s.data:[]).find(m=>m.address?.toLowerCase()===t.toLowerCase()||a&&m.address==="")??null;if(i)return{success:!0,data:{token_address:i.address??t,name:i.name??"",symbol:i.symbol??"",decimals:i.decimals!=null?Number(i.decimals):18,logo:i.icon_image||i.logo,thumbnail:i.icon_image||i.logo,usd_price:i.price!=null?parseFloat(i.price):void 0,usd_price_24hr_percent_change:i.price_change_percentage_24h??void 0,usd_price_24hr_usd_change:i.price_change_24h??void 0}};console.warn("⚠️ Pantograph returned no result, falling back to Moralis API");const d=en(),[T,B]=await Promise.allSettled([nn.get("/api/v2.2/erc20/metadata",{query:{chain:n,addresses:[t]},headers:tn(d)}),nn.get(`/api/v2.2/erc20/${encodeURIComponent(t)}/price`,{query:{chain:n,include:"percent_change"},headers:tn(d)})]),R=T.status==="fulfilled"?T.value.data:[];if(!R||R.length===0)return{success:!1,error:"Token metadata not found"};const h=R[0],x=B.status==="fulfilled"?B.value.data:void 0;return{success:!0,data:{token_address:h.token_address,name:h.name,symbol:h.symbol,decimals:h.decimals,logo:h.logo||h.thumbnail,thumbnail:h.thumbnail,usd_price:x?.usdPrice??void 0,usd_price_24hr_percent_change:x?.["24hrPercentChange"]?parseFloat(x["24hrPercentChange"]):void 0,usd_price_24hr_usd_change:x?.usdPriceChange24hr??void 0}}}catch(o){const s=o instanceof Error?o.message:"Unknown error";return console.error("❌ Error fetching token metadata:",s),{success:!1,error:s}}}async function Ui(e){const{prompt:t,model:n="gpt-4.1-mini",stream:o=!1,systemPrompt:s}=e;if(!t)throw new Error("Prompt is required");try{const a=en(),r=new Qt("https://cortex-api.moralis.io"),i=s?`${s}
100
100
 
101
101
  ---
102
102
 
103
- User: ${t}`:t;return{success:!0,data:(await r.post("/chat",{prompt:l,model:n,stream:o},{headers:{"X-API-Key":a,Accept:"application/json","Content-Type":"application/json"}})).data}}catch(a){const r=a instanceof Error?a.message:"Unknown error";return console.error("❌ Error chatting with Cortex AI:",r),{success:!1,error:r}}}async function Li(e){const{address:t,chain:n="base"}=e;if(!t)throw new Error("Contract address is required");try{const o=en();return{success:!0,data:(await nn.get(`/api/v2.2/nft/${encodeURIComponent(t)}/metadata`,{query:{chain:n},headers:tn(o)})).data}}catch(o){const s=o instanceof Error?o.message:"Unknown error";return console.error("❌ Error fetching NFT contract metadata:",s),{success:!1,error:s}}}async function wn(e){const{address:t,chain:n="base",limit:o=20,exclude_spam:s=!0,cursor:a}=e;if(!t)throw new Error("Address is required");try{const r=en(),l={chain:n,format:"decimal",limit:o,exclude_spam:s,media_items:!0,normalizeMetadata:!0};return a&&(l.cursor=a),{success:!0,data:(await nn.get(`/api/v2.2/${encodeURIComponent(t)}/nft`,{query:l,headers:tn(r)})).data}}catch(r){const l=r instanceof Error?r.message:"Unknown error";return console.error("❌ Error fetching NFTs:",l),{success:!1,error:l}}}const Mi="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAx8SURBVHgB7VprbFzFFT5n9kmoil0JiUqVsuYX/7BRSeL+aOyKivKjxYYEmpbWNlQpUYvsQAtBVPHdoBYFodgWIiAK8ppWysOVbFrRh0qxUyE5BlQ7/VEqVYo3P6qq6iMbpYTEu3dOz7zuY72Jr51NIrU59u597NyZ+ea8zx2A63Sd/qcI4QoQTfW0QC3fDrLWpS4BUxUAeQwfmFyEa0xNB0xHtw9yrx7DbAlH4WGI1FkZBHq47egEXCNqGmCa3NbF3Q0z0K7IXbLD1I+zBCh24/Yjb8JVpssGTIe+WoCUP8TYbufemKvYzkdSghwcTUsKgQfnJfCrRdwxXYarRM0X6XHW3w3Ze1ln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OFkbHJoiyQbhQTvudH5pQMHPmio34s35eFcBlrI1nf0UxGbFJCM5uQ2iANRggR02YAVzfZ2lt/+yiYFumhDZ8PnoKQL0UOBfH/8pf3zUz9+NizQTXkLLYipcfX+OBpoUFgKDQmjmZrWgDI+mGx/V1MAO/pl751F8Pn9Eck3LHtMgmXfJwcv1o3A96BIvfOTfcf/fWT4+JKoLZ9mdFstIFcjiufFjgjbQ1HmSM6vfgESUlMBK1L7sw5/rbNfVPEOdl2nzKSsDkoKQIf6ia18swDubbmlSAhlDVdKb3HQm1j1zh/deAzOVTvWstFlzX5srfTYq3P9WRLDWR826p0/1XCrU66m94lg3uwAIrUXxGyNUruEACO7g8qF1zerCEzt6hvXgFNiCO87cmKN02k+h+vpxZ2dJV8qSy73IdUvMOk6ClC4Syt4z2QbmIPN0o7c38eFugncPtm9HrC6J7iK5I3MFfKcGWVr2J9zXNX7uMDu+TIc15ytBbt+IIOyrXD3/gq/SoP17t5xdFUBO3rhhfmeDTUYYbCFnNmqqEQ5AGu3O2mxzlRp922vbhmFJtE1Aezo9R+qLY1imAEWAo5arud8qqRqtLvjYGcJmkjXFLCjo9677bnl9Nasj60swpSuyWOfgPxix2jHZYnvdbpO/wf0X652D+/dGV80AAAAAElFTkSuQmCC",Ri="data:image/svg+xml,%3csvg%20width='36'%20height='36'%20viewBox='0%200%2036%2036'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3crect%20width='36'%20height='36'%20rx='18'%20fill='%232358B2'/%3e%3cmask%20id='mask0_1924_16177'%20style='mask-type:alpha'%20maskUnits='userSpaceOnUse'%20x='11'%20y='10'%20width='17'%20height='16'%3e%3crect%20x='11.334'%20y='10'%20width='16'%20height='16'%20fill='url(%23pattern0_1924_16177)'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_1924_16177)'%3e%3crect%20x='11.334'%20y='10'%20width='16'%20height='16'%20fill='white'/%3e%3c/g%3e%3cdefs%3e%3cpattern%20id='pattern0_1924_16177'%20patternContentUnits='objectBoundingBox'%20width='1'%20height='1'%3e%3cuse%20xlink:href='%23image0_1924_16177'%20transform='scale(0.00195312)'/%3e%3c/pattern%3e%3cimage%20id='image0_1924_16177'%20width='512'%20height='512'%20preserveAspectRatio='none'%20xlink:href='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAOgAAADoABlffMYAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAACAASURBVHic7d13uGRlme7/79M0ijnrKM6ImHAMmHXGgB7zKJhzAAMgZjFg4DfnzO8ISM4gKIKIEgwImAAjiAQRCSoCCgaCgOQcn/PHu5reNHt37121qt61qr6f6+pLbLr3vi/Seuqtp947MhNJkjRdFtUOIEmSxs8BQJKkKeQAIEnSFHIAkCRpCjkASJI0hRbXDjCoiFgMPBB40Iwf9wZimV96E/AP4PzmxwWZeeMYo0qS1DnRl48BRsSqwFrA85ofa3DHh/18JHAxcCrwmyU/MvPslqJKktR5nR0AImJ1lj7s1wJWH/G3vAw4EjgE+EFmXj7i7ydJUjWdGgAi4uXA2ykP/YdWjHITcBRlGDggMy+umEWSpNZVHwAiYmXgrcAngMdXDTO7G4ADgZ0z88TaYSRJakO1ASAi7glsAHwUWLVKiIU7FtgZ+FZm3lQ7jCRJgxr7ABARDwE+AmwI3Gus37w9fwW2AvbKzBtqh5EkaaHGNgBExKOBz1CO++80lm86ehcA2wB7ZOY1tcNIkjRfIx8Ams/rbwL8f8CdR/rN6vknsD2wS2ZeWTuMJEkrMtIBICKeCuwFrDmyb9Itl1N2BHbMzEtqh5EkaS4jGQCaV/3/F/gksFLr36D7rgZ2B7bNzAtrh5EkaVmtDwAR8UDgIMrlPdPueuDLwFaZ+ffaYSRJWqLVASAing58h7qX+HTRjcC+wBcy88+1w0iS1NoAEBHvohx7T+qiXxtuAfYHNs/M02uHkSRNr1YGg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lxGOgAARMQiYH3g88D9R/rN6rkc2BnYITMvrR1GkqQVGfkAcNs3irgP8P8DGzE5Vwj/E9ge2CUzr6wdRpKk+RrbAHDbNyyfFPgf4FUMcRNhZRdQLj/aw0peSVIfjX0AuO0bRzwK2BhYF7hLlRALdwKwG3CAlbySpD6rNgDcFiDiAcAHgXcCq1UNM7trKZ/h3z0zT6odRpKkNlQfAGaKiH8HXtH8eDawuFKUG4GjgO8C+2XmFZVySJI0Ep0aAGaKiHsBL6EMAy8HHjjib3ku8EPg+8BPMvPqEX8/SZKq6ewAMFNEBPB0ykCwOvDgGT/uz8KWCW8G/gT8fsaP07yiV5I0TXoxACxPRCymnA7MHAoeAFwPXAFcOeN/LwPOycwb66SVJKkbej8ASJKkhevr5/AlSdIQHAAkSZpCDgCSJE0hBwBJkqaQA4AkSVPo/wH9hnZgmG1pVwAAAABJRU5ErkJggg=='/%3e%3c/defs%3e%3c/svg%3e";class $i extends Qt{constructor(){super("https://wallet-api.pantograph.app")}async getTokensDetails(t,n="base"){try{if(!t||!Array.isArray(t)||t.length===0)throw new Error("Addresses must be a non-empty array");const o=t.join(","),s=await this.get(`/keyrings/tokens/${n}/v2`,{query:{addresses:o}});return Array.isArray(s.data)&&(s.data=s.data.filter((a,r,l)=>r===l.findIndex(d=>d.address.toLowerCase()===a.address.toLowerCase())),Array.isArray(t)&&t.length>0&&(s.data=s.data.filter(a=>t.some(r=>r.toLowerCase()===a.address.toLowerCase())),s.data.sort((a,r)=>t.findIndex(l=>l.toLowerCase()===a.address.toLowerCase())-t.findIndex(l=>l.toLowerCase()===r.address.toLowerCase())))),s}catch(o){throw console.error("❌ Error getting tokens details:",o instanceof Error?o.message:o),o}}async getTokenDetail(t,n="base"){try{if(!t)throw new Error("Address is required");const o=await this.getTokensDetails([t],n);return{data:o.data[0]||null,status:o.status}}catch(o){throw console.error(`❌ Error getting token detail for ${t}:`,o instanceof Error?o.message:o),o}}async getTopGainers(t="base",n="24h",o=3){try{return await this.get(`/token-list/top-gainers/${t}`,{query:{duration:n,limit:o}})}catch(s){throw console.error("❌ Error getting top gainers:",s instanceof Error?s.message:s),s}}}const tt=new $i,Hi="https://dln.debridge.finance",Wi=new Qt(Hi);async function ro(e){const{chainId:t,tokenIn:n,tokenInAmount:o,tokenOut:s,accesstoken:a,slippage:r="auto",tokenOutRecipient:l}=e;if(!t||!n||!o||!s)throw new Error("Missing required parameters: chainId, tokenIn, tokenInAmount, tokenOut");try{const C=(await(await fetch("https://exchange-api.keyring.app/admin/setting?configs=others",{method:"GET"})).json())?.others||{},M=C?.AFFILIATE_FEE_PERENT,h=C?.AFFILIATE_FEE_RECIPIENT,x=await Wi.get("/v1.0/chain/transaction",{query:{chainId:String(t),tokenIn:n,tokenInAmount:o,tokenOut:s,slippage:String(r),tokenOutRecipient:l,accesstoken:a,affiliateFeePercent:M,affiliateFeeRecipient:h}});if(x.data?.error)throw new Error(`DeBridge API Error: ${x.data.error}`);return console.log("✅ Quote retrieved successfully"),{success:!0,data:x.data}}catch(d){let T=d instanceof Error?d.message:"Unknown error";const C=d;C.data?.errorMessage?T=C.data.errorMessage:C.response?.data?.errorMessage?T=C.response.data.errorMessage:C.data?.message?T=C.data.message:C.response?.data?.message&&(T=C.response.data.message);const M=C.status||C.response?.status||C.statusCode||C.data?.status;return console.error("📋 Error details:",{errorMessage:T,errorCode:C.data?.errorCode,errorId:C.data?.errorId,status:M,reqId:C.data?.reqId,fullError:{message:C.message,status:C.status,statusCode:C.statusCode}}),{success:!1,error:d instanceof Error?d.message:"Unknown error",status:M,errorMessage:T,errorCode:C.data?.errorCode,errorId:C.data?.errorId}}}function Tt(e){const t=[],n=/!\[([^\]]*)\]\(([^)]+)\)|\[([^\]]*)\]\(([^)]+)\)|(https?:\/\/[^\s<>]+)|\*\*(.+?)\*\*|__(.+?)__|\*(.+?)\*|_(.+?)_|~~(.+?)~~|`([^`]+)`/g;let o=0,s;for(;(s=n.exec(e))!==null;)s.index>o&&t.push(e.slice(o,s.index)),s[1]!==void 0||s[2]!==void 0?t.push(P.jsx("img",{src:s[2],alt:s[1],className:"mc-image"},s.index)):s[3]!==void 0?t.push(P.jsx("a",{href:s[4],target:"_blank",rel:"noopener noreferrer",className:"mc-link",children:s[3]},s.index)):s[5]!==void 0?t.push(P.jsx("a",{href:s[5],target:"_blank",rel:"noopener noreferrer",className:"mc-link",children:s[5]},s.index)):s[6]!==void 0?t.push(P.jsx("strong",{children:Tt(s[6])},s.index)):s[7]!==void 0?t.push(P.jsx("strong",{children:Tt(s[7])},s.index)):s[8]!==void 0?t.push(P.jsx("em",{children:Tt(s[8])},s.index)):s[9]!==void 0?t.push(P.jsx("em",{children:Tt(s[9])},s.index)):s[10]!==void 0?t.push(P.jsx("del",{children:Tt(s[10])},s.index)):s[11]!==void 0&&t.push(P.jsx("code",{className:"mc-inline-code",children:s[11]},s.index)),o=s.index+s[0].length;return o<e.length&&t.push(e.slice(o)),t.length>0?t:[e]}const Vi=({content:e})=>{const t=e.split(`
104
- `),n=[];let o=0;for(;o<t.length;){const s=t[o];if(s.trimStart().startsWith("```")){const r=s.trimStart().slice(3)?.trim(),l=[];for(o++;o<t.length&&!t[o].trimStart().startsWith("```");)l.push(t[o]),o++;n.push(P.jsxs("div",{className:"mc-codeblock",children:[r&&P.jsx("div",{className:"mc-codeblock-lang",children:r}),P.jsx("pre",{children:P.jsx("code",{children:l.join(`
105
- `)})})]},`code-${o}`)),o++;continue}if(/^(\s*[-*_]\s*){3,}$/.test(s)){n.push(P.jsx("hr",{className:"mc-hr"},`hr-${o}`)),o++;continue}const a=s.match(/^(#{1,3})\s+(.+)/);if(a){const r=a[1].length,l=a[2];n.push(P.jsx("div",{className:`mc-heading mc-h${r}`,children:Tt(l)},`h-${o}`)),o++;continue}if(s.trimStart().startsWith("> ")){const r=[];for(;o<t.length&&t[o].trimStart().startsWith("> ");)r.push(t[o].replace(/^\s*>\s?/,"")),o++;n.push(P.jsx("div",{className:"mc-blockquote",children:r.map((l,d)=>P.jsx("div",{children:Tt(l)},d))},`bq-${o}`));continue}if(s?.trim()===""){n.push(P.jsx("div",{className:"mc-empty-line"},`empty-${o}`)),o++;continue}n.push(P.jsx("div",{className:"mc-line",children:Tt(s)},`line-${o}`)),o++}return P.jsx("div",{className:"message-content",children:n})},Gi={send_native:{label:"actionSendNativeLabel",description:"actionSendNativeDesc",fields:[{key:"to_address",label:"fieldToAddress",type:"address",placeholder:"0x...",required:!0,validation:"address"},{key:"amount",label:"fieldAmount",type:"amount",placeholder:"0.0",required:!0,validation:"amount"}]},send_token:{label:"actionSendTokenLabel",description:"actionSendTokenDesc",fields:[{key:"contract_address",label:"fieldTokenContract",type:"address",placeholder:"0x... token contract",required:!0,validation:"address",editable:!1},{key:"token_symbol",label:"fieldTokenSymbol",type:"text",placeholder:"e.g. USDC",required:!1,editable:!1},{key:"to_address",label:"fieldToAddress",type:"address",placeholder:"0x...",required:!0,validation:"address"},{key:"amount",label:"fieldAmount",type:"amount",placeholder:"0.0",required:!0,validation:"amount"},{key:"decimals",label:"fieldDecimals",type:"number",placeholder:"18",required:!1,editable:!1}]},swap_token:{label:"actionSwapTokenLabel",description:"actionSwapTokenDesc",fields:[{key:"token_in",label:"fieldTokenIn",type:"address",placeholder:"0x... or native",required:!0,editable:!1},{key:"token_in_symbol",label:"fieldTokenInSymbol",type:"text",placeholder:"e.g. ETH",required:!1,editable:!1},{key:"token_out",label:"fieldTokenOut",type:"address",placeholder:"0x...",required:!0,editable:!1},{key:"token_out_symbol",label:"fieldTokenOutSymbol",type:"text",placeholder:"e.g. USDC",required:!1,editable:!1},{key:"token_in_decimals",label:"fieldTokenInDecimals",type:"number",placeholder:"18",required:!1,editable:!1},{key:"token_out_decimals",label:"fieldTokenOutDecimals",type:"number",placeholder:"18",required:!1,editable:!1},{key:"amount",label:"fieldAmount",type:"amount",placeholder:"0.0",required:!0,validation:"amount"}]},approve_token:{label:"actionApproveTokenLabel",description:"actionApproveTokenDesc",fields:[{key:"contract_address",label:"fieldTokenContract",type:"address",placeholder:"0x... token contract",required:!0,validation:"address",editable:!1},{key:"token_symbol",label:"fieldTokenSymbol",type:"text",placeholder:"e.g. USDC",required:!1,editable:!1},{key:"spender_address",label:"fieldSpenderAddress",type:"address",placeholder:"0x... spender contract",required:!0,validation:"address",editable:!1},{key:"amount",label:"fieldAmountUnlimited",type:"amount",placeholder:"0.0 or leave empty for max",required:!1,validation:"amount"},{key:"decimals",label:"fieldDecimals",type:"number",placeholder:"18",required:!1,editable:!1}]},wrap_native:{label:"actionWrapNativeLabel",description:"actionWrapNativeDesc",fields:[{key:"amount",label:"fieldAmount",type:"amount",placeholder:"0.0",required:!0,validation:"amount"}]},unwrap_native:{label:"actionUnwrapNativeLabel",description:"actionUnwrapNativeDesc",fields:[{key:"amount",label:"fieldAmount",type:"amount",placeholder:"0.0",required:!0,validation:"amount"}]},send_nft:{label:"actionSendNftLabel",description:"actionSendNftDesc",fields:[{key:"contract_address",label:"fieldNftContract",type:"address",placeholder:"0x... NFT contract",required:!0,validation:"address",editable:!1},{key:"token_id",label:"fieldTokenId",type:"text",placeholder:"e.g. 1234",required:!0,editable:!1},{key:"to_address",label:"fieldToAddress",type:"address",placeholder:"0x...",required:!0,validation:"address"},{key:"token_standard",label:"fieldTokenStandard",type:"text",placeholder:"ERC721 or ERC1155",required:!0,editable:!1},{key:"amount",label:"fieldAmount",type:"text",placeholder:"1",required:!0},{key:"maxAmount",label:"fieldMaxAmount",type:"text",placeholder:"",required:!1,editable:!1,hidden:!0},{key:"nft_name",label:"fieldNftName",type:"text",placeholder:"e.g. Bored Ape #1234",required:!1,editable:!1}]}};function zi(e){return Re(e)}function io(e){if(!e||e?.trim()==="")return!1;const t=parseFloat(e);return!isNaN(t)&&t>0}const qi=({action:e,initialValues:t,onSubmit:n,onCancel:o,isSubmitting:s=!1,tokenInfo:a,nftInfo:r})=>{const{t:l,ti:d}=En(),T=Gi[e],[C,M]=ne.useState(()=>{if(!T)return{};const N={};return T.fields.forEach(V=>{N[V.key]=t[V.key]||""}),N}),[h]=ne.useState(()=>["send_native","send_token","swap_token"].includes(e)&&!a&&C.contract_address?l("formTokenNotFound"):null),[x,m]=ne.useState(()=>{const N={};if(["send_native","send_token","swap_token"].includes(e)&&a){const X=parseFloat(a.balanceFormatted||"0");if(X<=0)N.amount=d("formNoBalance",{symbol:a.symbol??""});else{const fe=t.amount?.trim();fe&&io(fe)&&parseFloat(fe)>X&&(N.amount=d("formInsufficientBalance",{balance:a.balanceFormatted,symbol:a.symbol??""}))}}return N}),B=ne.useCallback((N,V)=>{M(X=>({...X,[N]:V})),x[N]&&m(X=>{const fe={...X};return delete fe[N],fe})},[x]),L=ne.useCallback(()=>{if(!T)return!1;const N={};if(T.fields.forEach(V=>{const X=C[V.key]?.trim()||"";if(V.required&&!X&&!(e==="send_nft"&&V.key==="amount")){N[V.key]=d("formFieldRequired",{field:l(V.label)});return}if(X){if(V.validation==="address"&&!zi(X)&&(N[V.key]=l("formInvalidAddress")),V.validation==="amount"&&!io(X)&&(N[V.key]=l("formMustBePositive")),V.key==="amount"&&X&&io(X)&&a?.balanceFormatted){const fe=parseFloat(X),pe=parseFloat(a.balanceFormatted);fe>pe&&(N[V.key]=d("formInsufficientBalance",{balance:a.balanceFormatted,symbol:a.symbol??""}))}V.validation==="positive_number"&&(isNaN(Number(X))||Number(X)<0)&&(N[V.key]=l("formMustBeValidNumber"))}}),e==="send_nft"&&C.token_standard?.toUpperCase()==="ERC1155"){const V=C.amount?.trim();if(!V)N.amount=d("formFieldRequired",{field:l("fieldAmount")});else if(!/^\d+$/.test(V)||parseInt(V,10)<1)N.amount=l("formMustBePositiveInteger");else{const X=parseInt(t.maxAmount||"0",10);X>0&&parseInt(V,10)>X&&(N.amount=d("formAmountExceedsNft",{max:String(X)}))}}return m(N),Object.keys(N).length===0},[T,C,a,e,t,l,d]),ke=ne.useCallback(()=>{L()&&n(e,C)},[L,n,e,C]);return T?P.jsxs("div",{className:"action-form",children:[P.jsx("div",{className:"action-form-title",children:P.jsx("span",{children:l(T.label)})}),h&&P.jsxs("div",{className:"action-form-general-error",children:["⚠️ ",h]}),a&&P.jsx("div",{className:"action-form-token-info",children:P.jsxs("div",{className:"token-info-row",children:[a.logo&&P.jsx("img",{src:a.logo,alt:a.symbol,className:"token-info-logo",width:20,height:20}),P.jsxs("div",{className:"token-info-details",children:[P.jsxs("span",{className:"token-info-name",children:[a.name," (",a.symbol,")"]}),P.jsxs("span",{className:"token-info-balance",children:[l("formBalance")," ",ce(a.balanceFormatted).decimalPlaces(8,ce.ROUND_DOWN).toFormat()," ",a.symbol,a.usdValue!==void 0&&P.jsxs("span",{className:"token-info-usd",children:[" ","≈ $",a.usdValue.toFixed(2)]})]})]})]})}),r?.image&&P.jsx("div",{className:"action-form-nft-info",children:P.jsx("img",{src:r.image,alt:r.name,className:"nft-info-image",onError:N=>{N.target.style.display="none"}})}),P.jsx("div",{className:"action-form-fields",children:T.fields.map(N=>N.hidden||N.key==="amount"&&e==="send_nft"&&C.token_standard?.toUpperCase()!=="ERC1155"?null:P.jsxs("div",{className:"action-form-field",children:[P.jsxs("div",{className:"action-form-field-header",children:[P.jsxs("div",{className:"action-form-field-label",children:[l(N.label),N.required&&" *"]}),N.key==="amount"&&a&&e!=="send_nft"&&P.jsxs("div",{className:"action-form-pct-btns",children:[[25,50,75].map(V=>P.jsxs("button",{type:"button",className:"action-form-pct-btn",onClick:()=>B("amount",(parseFloat(a.balanceFormatted)*V/100).toString()),disabled:s,children:[V,"%"]},V)),P.jsx("button",{type:"button",className:"action-form-pct-btn action-form-max-btn",onClick:()=>B("amount",a.balanceFormatted),disabled:s,children:"MAX"})]})]}),(()=>{const V=N.editable===!1&&!!t[N.key],X=s||V,fe=[x[N.key]?"error":"",V?"readonly":""].filter(Boolean).join(" ");return N.type==="address"?P.jsx("textarea",{rows:2,placeholder:N.placeholder,value:C[N.key]||"",onChange:pe=>B(N.key,pe.target.value),className:fe,disabled:X}):P.jsx("input",{type:N.type==="number"?"number":"text",placeholder:N.placeholder,value:C[N.key]||"",onChange:pe=>B(N.key,pe.target.value),className:fe,disabled:X})})(),x[N.key]&&P.jsx("span",{className:"field-error",children:x[N.key]})]},N.key))}),P.jsxs("div",{className:"action-form-actions",children:[P.jsx("button",{className:"action-form-cancel",onClick:o,type:"button",disabled:s,children:l("formCancel")}),P.jsx("button",{className:"action-form-submit",onClick:ke,type:"button",disabled:s,children:l(s?"formProcessing":"formExecute")})]})]}):null},Yi=({scrollContainerRef:e,threshold:t=200})=>{const[n,o]=ne.useState(!1);ne.useEffect(()=>{const a=e.current;if(!a)return;const r=()=>{const{scrollTop:l,scrollHeight:d,clientHeight:T}=a,C=d-l-T;o(C>t)};return a.addEventListener("scroll",r,{passive:!0}),r(),()=>{a.removeEventListener("scroll",r)}},[e,t]);const s=()=>{e.current?.scrollTo({top:e.current.scrollHeight,behavior:"smooth"})};return n?P.jsx("button",{className:"scroll-to-bottom-btn",onClick:s,"aria-label":"Scroll to bottom",type:"button",children:P.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:P.jsx("path",{d:"M9 3V15M9 15L4 10M9 15L14 10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}):null};function ji(e){const{walletAddress:t,chainName:n,chainId:o,nativeSymbol:s,walletTokens:a,walletNfts:r}=e;if(!t)return`You are a Web3 wallet assistant for the Keyring crypto EVM wallet app.
103
+ User: ${t}`:t;return{success:!0,data:(await r.post("/chat",{prompt:i,model:n,stream:o},{headers:{"X-API-Key":a,Accept:"application/json","Content-Type":"application/json"}})).data}}catch(a){const r=a instanceof Error?a.message:"Unknown error";return console.error("❌ Error chatting with Cortex AI:",r),{success:!1,error:r}}}async function Li(e){const{address:t,chain:n="base"}=e;if(!t)throw new Error("Contract address is required");try{const o=en();return{success:!0,data:(await nn.get(`/api/v2.2/nft/${encodeURIComponent(t)}/metadata`,{query:{chain:n},headers:tn(o)})).data}}catch(o){const s=o instanceof Error?o.message:"Unknown error";return console.error("❌ Error fetching NFT contract metadata:",s),{success:!1,error:s}}}async function wn(e){const{address:t,chain:n="base",limit:o=20,exclude_spam:s=!0,cursor:a}=e;if(!t)throw new Error("Address is required");try{const r=en(),i={chain:n,format:"decimal",limit:o,exclude_spam:s,media_items:!0,normalizeMetadata:!0};return a&&(i.cursor=a),{success:!0,data:(await nn.get(`/api/v2.2/${encodeURIComponent(t)}/nft`,{query:i,headers:tn(r)})).data}}catch(r){const i=r instanceof Error?r.message:"Unknown error";return console.error("❌ Error fetching NFTs:",i),{success:!1,error:i}}}const Mi="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAx8SURBVHgB7VprbFzFFT5n9kmoil0JiUqVsuYX/7BRSeL+aOyKivKjxYYEmpbWNlQpUYvsQAtBVPHdoBYFodgWIiAK8ppWysOVbFrRh0qxUyE5BlQ7/VEqVYo3P6qq6iMbpYTEu3dOz7zuY72Jr51NIrU59u597NyZ+ea8zx2A63Sd/qcI4QoQTfW0QC3fDrLWpS4BUxUAeQwfmFyEa0xNB0xHtw9yrx7DbAlH4WGI1FkZBHq47egEXCNqGmCa3NbF3Q0z0K7IXbLD1I+zBCh24/Yjb8JVpssGTIe+WoCUP8TYbufemKvYzkdSghwcTUsKgQfnJfCrRdwxXYarRM0X6XHW3w3Ze1ln+xlTV4MWFMo4mkUBKkK6NoG9Vx74ugHfNjNXyJ/nk/P5ymJvR6VRGzpyfw+AGOFRCoF4o8BA0s0MrBQg6zdccf1eE+CWhYWWDedrg7mqP5StYUtOAuVqgHy+mPFpOi/lxK97O8v1z7Eh6+fDMH8KcdFuOCV+nnqvlEVPDLhlbq6QQpzJ+lhgkMBgQR2zPlBegfYB8vzJkvBguTYxvSMOnA71FECkPcbal0C3FZUgw/rdZDFPDPjG9+eXGGQhr0DWCHI+8keB5nMpiO9hzoGuQZnPvTce2rxCPDXwVHaEdfzeO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VTvWstFlzX5srfTYq3P9WRLDWR826p0/1XCrU66m94lg3uwAIrUXxGyNUruEACO7g8qF1zerCEzt6hvXgFNiCO87cmKN02k+h+vpxZ2dJV8qSy73IdUvMOk6ClC4Syt4z2QbmIPN0o7c38eFugncPtm9HrC6J7iK5I3MFfKcGWVr2J9zXNX7uMDu+TIc15ytBbt+IIOyrXD3/gq/SoP17t5xdFUBO3rhhfmeDTUYYbCFnNmqqEQ5AGu3O2mxzlRp922vbhmFJtE1Aezo9R+qLY1imAEWAo5arud8qqRqtLvjYGcJmkjXFLCjo9677bnl9Nasj60swpSuyWOfgPxix2jHZYnvdbpO/wf0X652D+/dGV80AAAAAElFTkSuQmCC",Ri="data:image/svg+xml,%3csvg%20width='36'%20height='36'%20viewBox='0%200%2036%2036'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3crect%20width='36'%20height='36'%20rx='18'%20fill='%232358B2'/%3e%3cmask%20id='mask0_1924_16177'%20style='mask-type:alpha'%20maskUnits='userSpaceOnUse'%20x='11'%20y='10'%20width='17'%20height='16'%3e%3crect%20x='11.334'%20y='10'%20width='16'%20height='16'%20fill='url(%23pattern0_1924_16177)'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_1924_16177)'%3e%3crect%20x='11.334'%20y='10'%20width='16'%20height='16'%20fill='white'/%3e%3c/g%3e%3cdefs%3e%3cpattern%20id='pattern0_1924_16177'%20patternContentUnits='objectBoundingBox'%20width='1'%20height='1'%3e%3cuse%20xlink:href='%23image0_1924_16177'%20transform='scale(0.00195312)'/%3e%3c/pattern%3e%3cimage%20id='image0_1924_16177'%20width='512'%20height='512'%20preserveAspectRatio='none'%20xlink:href='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAOgAAADoABlffMYAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ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EBPB0ykCwOvDgGT/uz8KWCW8G/gT8fsaP07yiV5I0TXoxACxPRCymnA7MHAoeAFwPXAFcOeN/LwPOycwb66SVJKkbej8ASJKkhevr5/AlSdIQHAAkSZpCDgCSJE0hBwBJkqaQA4AkSVPo/wH9hnZgmG1pVwAAAABJRU5ErkJggg=='/%3e%3c/defs%3e%3c/svg%3e";class $i extends Qt{constructor(){super("https://wallet-api.pantograph.app")}async getTokensDetails(t,n="base"){try{if(!t||!Array.isArray(t)||t.length===0)throw new Error("Addresses must be a non-empty array");const o=t.join(","),s=await this.get(`/keyrings/tokens/${n}/v2`,{query:{addresses:o}});return Array.isArray(s.data)&&(s.data=s.data.filter((a,r,i)=>r===i.findIndex(d=>d.address.toLowerCase()===a.address.toLowerCase())),Array.isArray(t)&&t.length>0&&(s.data=s.data.filter(a=>t.some(r=>r.toLowerCase()===a.address.toLowerCase())),s.data.sort((a,r)=>t.findIndex(i=>i.toLowerCase()===a.address.toLowerCase())-t.findIndex(i=>i.toLowerCase()===r.address.toLowerCase())))),s}catch(o){throw console.error("❌ Error getting tokens details:",o instanceof Error?o.message:o),o}}async getTokenDetail(t,n="base"){try{if(!t)throw new Error("Address is required");const o=await this.getTokensDetails([t],n);return{data:o.data[0]||null,status:o.status}}catch(o){throw console.error(`❌ Error getting token detail for ${t}:`,o instanceof Error?o.message:o),o}}async getTopGainers(t="base",n="24h",o=3){try{return await this.get(`/token-list/top-gainers/${t}`,{query:{duration:n,limit:o}})}catch(s){throw console.error("❌ Error getting top gainers:",s instanceof Error?s.message:s),s}}}const tt=new $i,Hi="https://dln.debridge.finance",Wi=new Qt(Hi);async function ro(e){const{chainId:t,tokenIn:n,tokenInAmount:o,tokenOut:s,accesstoken:a,slippage:r="auto",tokenOutRecipient:i}=e;if(!t||!n||!o||!s)throw new Error("Missing required parameters: chainId, tokenIn, tokenInAmount, tokenOut");try{const B=(await(await fetch("https://exchange-api.keyring.app/admin/setting?configs=others",{method:"GET"})).json())?.others||{},R=B?.AFFILIATE_FEE_PERENT,h=B?.AFFILIATE_FEE_RECIPIENT,x=await Wi.get("/v1.0/chain/transaction",{query:{chainId:String(t),tokenIn:n,tokenInAmount:o,tokenOut:s,slippage:String(r),tokenOutRecipient:i,accesstoken:a,affiliateFeePercent:R,affiliateFeeRecipient:h}});if(x.data?.error)throw new Error(`DeBridge API Error: ${x.data.error}`);return console.log("✅ Quote retrieved successfully"),{success:!0,data:x.data}}catch(d){let T=d instanceof Error?d.message:"Unknown error";const B=d;B.data?.errorMessage?T=B.data.errorMessage:B.response?.data?.errorMessage?T=B.response.data.errorMessage:B.data?.message?T=B.data.message:B.response?.data?.message&&(T=B.response.data.message);const R=B.status||B.response?.status||B.statusCode||B.data?.status;return console.error("📋 Error details:",{errorMessage:T,errorCode:B.data?.errorCode,errorId:B.data?.errorId,status:R,reqId:B.data?.reqId,fullError:{message:B.message,status:B.status,statusCode:B.statusCode}}),{success:!1,error:d instanceof Error?d.message:"Unknown error",status:R,errorMessage:T,errorCode:B.data?.errorCode,errorId:B.data?.errorId}}}function Tt(e){const t=[],n=/!\[([^\]]*)\]\(([^)]+)\)|\[([^\]]*)\]\(([^)]+)\)|(https?:\/\/[^\s<>]+)|\*\*(.+?)\*\*|__(.+?)__|\*(.+?)\*|_(.+?)_|~~(.+?)~~|`([^`]+)`/g;let o=0,s;for(;(s=n.exec(e))!==null;)s.index>o&&t.push(e.slice(o,s.index)),s[1]!==void 0||s[2]!==void 0?t.push(P.jsx("img",{src:s[2],alt:s[1],className:"mc-image"},s.index)):s[3]!==void 0?t.push(P.jsx("a",{href:s[4],target:"_blank",rel:"noopener noreferrer",className:"mc-link",children:s[3]},s.index)):s[5]!==void 0?t.push(P.jsx("a",{href:s[5],target:"_blank",rel:"noopener noreferrer",className:"mc-link",children:s[5]},s.index)):s[6]!==void 0?t.push(P.jsx("strong",{children:Tt(s[6])},s.index)):s[7]!==void 0?t.push(P.jsx("strong",{children:Tt(s[7])},s.index)):s[8]!==void 0?t.push(P.jsx("em",{children:Tt(s[8])},s.index)):s[9]!==void 0?t.push(P.jsx("em",{children:Tt(s[9])},s.index)):s[10]!==void 0?t.push(P.jsx("del",{children:Tt(s[10])},s.index)):s[11]!==void 0&&t.push(P.jsx("code",{className:"mc-inline-code",children:s[11]},s.index)),o=s.index+s[0].length;return o<e.length&&t.push(e.slice(o)),t.length>0?t:[e]}const Vi=({content:e})=>{const t=e.split(`
104
+ `),n=[];let o=0;for(;o<t.length;){const s=t[o];if(s.trimStart().startsWith("```")){const r=s.trimStart().slice(3)?.trim(),i=[];for(o++;o<t.length&&!t[o].trimStart().startsWith("```");)i.push(t[o]),o++;n.push(P.jsxs("div",{className:"mc-codeblock",children:[r&&P.jsx("div",{className:"mc-codeblock-lang",children:r}),P.jsx("pre",{children:P.jsx("code",{children:i.join(`
105
+ `)})})]},`code-${o}`)),o++;continue}if(/^(\s*[-*_]\s*){3,}$/.test(s)){n.push(P.jsx("hr",{className:"mc-hr"},`hr-${o}`)),o++;continue}const a=s.match(/^(#{1,3})\s+(.+)/);if(a){const r=a[1].length,i=a[2];n.push(P.jsx("div",{className:`mc-heading mc-h${r}`,children:Tt(i)},`h-${o}`)),o++;continue}if(s.trimStart().startsWith("> ")){const r=[];for(;o<t.length&&t[o].trimStart().startsWith("> ");)r.push(t[o].replace(/^\s*>\s?/,"")),o++;n.push(P.jsx("div",{className:"mc-blockquote",children:r.map((i,d)=>P.jsx("div",{children:Tt(i)},d))},`bq-${o}`));continue}if(s?.trim()===""){n.push(P.jsx("div",{className:"mc-empty-line"},`empty-${o}`)),o++;continue}n.push(P.jsx("div",{className:"mc-line",children:Tt(s)},`line-${o}`)),o++}return P.jsx("div",{className:"message-content",children:n})},Gi={send_native:{label:"actionSendNativeLabel",description:"actionSendNativeDesc",fields:[{key:"to_address",label:"fieldToAddress",type:"address",placeholder:"0x...",required:!0,validation:"address"},{key:"amount",label:"fieldAmount",type:"amount",placeholder:"0.0",required:!0,validation:"amount"}]},send_token:{label:"actionSendTokenLabel",description:"actionSendTokenDesc",fields:[{key:"contract_address",label:"fieldTokenContract",type:"address",placeholder:"0x... token contract",required:!0,validation:"address",editable:!1},{key:"token_symbol",label:"fieldTokenSymbol",type:"text",placeholder:"e.g. USDC",required:!1,editable:!1},{key:"to_address",label:"fieldToAddress",type:"address",placeholder:"0x...",required:!0,validation:"address"},{key:"amount",label:"fieldAmount",type:"amount",placeholder:"0.0",required:!0,validation:"amount"},{key:"decimals",label:"fieldDecimals",type:"number",placeholder:"18",required:!1,editable:!1}]},swap_token:{label:"actionSwapTokenLabel",description:"actionSwapTokenDesc",fields:[{key:"token_in",label:"fieldTokenIn",type:"address",placeholder:"0x... or native",required:!0,editable:!1},{key:"token_in_symbol",label:"fieldTokenInSymbol",type:"text",placeholder:"e.g. ETH",required:!1,editable:!1},{key:"token_out",label:"fieldTokenOut",type:"address",placeholder:"0x...",required:!0,editable:!1},{key:"token_out_symbol",label:"fieldTokenOutSymbol",type:"text",placeholder:"e.g. USDC",required:!1,editable:!1},{key:"token_in_decimals",label:"fieldTokenInDecimals",type:"number",placeholder:"18",required:!1,editable:!1},{key:"token_out_decimals",label:"fieldTokenOutDecimals",type:"number",placeholder:"18",required:!1,editable:!1},{key:"amount",label:"fieldAmount",type:"amount",placeholder:"0.0",required:!0,validation:"amount"}]},approve_token:{label:"actionApproveTokenLabel",description:"actionApproveTokenDesc",fields:[{key:"contract_address",label:"fieldTokenContract",type:"address",placeholder:"0x... token contract",required:!0,validation:"address",editable:!1},{key:"token_symbol",label:"fieldTokenSymbol",type:"text",placeholder:"e.g. USDC",required:!1,editable:!1},{key:"spender_address",label:"fieldSpenderAddress",type:"address",placeholder:"0x... spender contract",required:!0,validation:"address",editable:!1},{key:"amount",label:"fieldAmountUnlimited",type:"amount",placeholder:"0.0 or leave empty for max",required:!1,validation:"amount"},{key:"decimals",label:"fieldDecimals",type:"number",placeholder:"18",required:!1,editable:!1}]},wrap_native:{label:"actionWrapNativeLabel",description:"actionWrapNativeDesc",fields:[{key:"amount",label:"fieldAmount",type:"amount",placeholder:"0.0",required:!0,validation:"amount"}]},unwrap_native:{label:"actionUnwrapNativeLabel",description:"actionUnwrapNativeDesc",fields:[{key:"amount",label:"fieldAmount",type:"amount",placeholder:"0.0",required:!0,validation:"amount"}]},send_nft:{label:"actionSendNftLabel",description:"actionSendNftDesc",fields:[{key:"contract_address",label:"fieldNftContract",type:"address",placeholder:"0x... NFT contract",required:!0,validation:"address",editable:!1},{key:"token_id",label:"fieldTokenId",type:"text",placeholder:"e.g. 1234",required:!0,editable:!1},{key:"to_address",label:"fieldToAddress",type:"address",placeholder:"0x...",required:!0,validation:"address"},{key:"token_standard",label:"fieldTokenStandard",type:"text",placeholder:"ERC721 or ERC1155",required:!0,editable:!1},{key:"amount",label:"fieldAmount",type:"text",placeholder:"1",required:!0},{key:"maxAmount",label:"fieldMaxAmount",type:"text",placeholder:"",required:!1,editable:!1,hidden:!0},{key:"nft_name",label:"fieldNftName",type:"text",placeholder:"e.g. Bored Ape #1234",required:!1,editable:!1}]}};function zi(e){return Re(e)}function io(e){if(!e||e?.trim()==="")return!1;const t=parseFloat(e);return!isNaN(t)&&t>0}const qi=({action:e,initialValues:t,onSubmit:n,onCancel:o,isSubmitting:s=!1,tokenInfo:a,nftInfo:r})=>{const{t:i,ti:d}=Sn(),T=Gi[e],[B,R]=ne.useState(()=>{if(!T)return{};const N={};return T.fields.forEach(V=>{N[V.key]=t[V.key]||""}),N}),[h]=ne.useState(()=>["send_native","send_token","swap_token"].includes(e)&&!a&&B.contract_address?i("formTokenNotFound"):null),[x,m]=ne.useState(()=>{const N={};if(["send_native","send_token","swap_token"].includes(e)&&a){const X=parseFloat(a.balanceFormatted||"0");if(X<=0)N.amount=d("formNoBalance",{symbol:a.symbol??""});else{const fe=t.amount?.trim();fe&&io(fe)&&parseFloat(fe)>X&&(N.amount=d("formInsufficientBalance",{balance:a.balanceFormatted,symbol:a.symbol??""}))}}return N}),C=ne.useCallback((N,V)=>{R(X=>({...X,[N]:V})),x[N]&&m(X=>{const fe={...X};return delete fe[N],fe})},[x]),L=ne.useCallback(()=>{if(!T)return!1;const N={};if(T.fields.forEach(V=>{const X=B[V.key]?.trim()||"";if(V.required&&!X&&!(e==="send_nft"&&V.key==="amount")){N[V.key]=d("formFieldRequired",{field:i(V.label)});return}if(X){if(V.validation==="address"&&!zi(X)&&(N[V.key]=i("formInvalidAddress")),V.validation==="amount"&&!io(X)&&(N[V.key]=i("formMustBePositive")),V.key==="amount"&&X&&io(X)&&a?.balanceFormatted){const fe=parseFloat(X),pe=parseFloat(a.balanceFormatted);fe>pe&&(N[V.key]=d("formInsufficientBalance",{balance:a.balanceFormatted,symbol:a.symbol??""}))}V.validation==="positive_number"&&(isNaN(Number(X))||Number(X)<0)&&(N[V.key]=i("formMustBeValidNumber"))}}),e==="send_nft"&&B.token_standard?.toUpperCase()==="ERC1155"){const V=B.amount?.trim();if(!V)N.amount=d("formFieldRequired",{field:i("fieldAmount")});else if(!/^\d+$/.test(V)||parseInt(V,10)<1)N.amount=i("formMustBePositiveInteger");else{const X=parseInt(t.maxAmount||"0",10);X>0&&parseInt(V,10)>X&&(N.amount=d("formAmountExceedsNft",{max:String(X)}))}}return m(N),Object.keys(N).length===0},[T,B,a,e,t,i,d]),ke=ne.useCallback(()=>{L()&&n(e,B)},[L,n,e,B]);return T?P.jsxs("div",{className:"action-form",children:[P.jsx("div",{className:"action-form-title",children:P.jsx("span",{children:i(T.label)})}),h&&P.jsxs("div",{className:"action-form-general-error",children:["⚠️ ",h]}),a&&P.jsx("div",{className:"action-form-token-info",children:P.jsxs("div",{className:"token-info-row",children:[a.logo&&P.jsx("img",{src:a.logo,alt:a.symbol,className:"token-info-logo",width:20,height:20}),P.jsxs("div",{className:"token-info-details",children:[P.jsxs("span",{className:"token-info-name",children:[a.name," (",a.symbol,")"]}),P.jsxs("span",{className:"token-info-balance",children:[i("formBalance")," ",ce(a.balanceFormatted).decimalPlaces(8,ce.ROUND_DOWN).toFormat()," ",a.symbol,a.usdValue!==void 0&&P.jsxs("span",{className:"token-info-usd",children:[" ","≈ $",a.usdValue.toFixed(2)]})]})]})]})}),r?.image&&P.jsx("div",{className:"action-form-nft-info",children:P.jsx("img",{src:r.image,alt:r.name,className:"nft-info-image",onError:N=>{N.target.style.display="none"}})}),P.jsx("div",{className:"action-form-fields",children:T.fields.map(N=>N.hidden||N.key==="amount"&&e==="send_nft"&&B.token_standard?.toUpperCase()!=="ERC1155"?null:P.jsxs("div",{className:"action-form-field",children:[P.jsxs("div",{className:"action-form-field-header",children:[P.jsxs("div",{className:"action-form-field-label",children:[i(N.label),N.required&&" *"]}),N.key==="amount"&&a&&e!=="send_nft"&&P.jsxs("div",{className:"action-form-pct-btns",children:[[25,50,75].map(V=>P.jsxs("button",{type:"button",className:"action-form-pct-btn",onClick:()=>C("amount",(parseFloat(a.balanceFormatted)*V/100).toString()),disabled:s,children:[V,"%"]},V)),P.jsx("button",{type:"button",className:"action-form-pct-btn action-form-max-btn",onClick:()=>C("amount",a.balanceFormatted),disabled:s,children:"MAX"})]})]}),(()=>{const V=N.editable===!1&&!!t[N.key],X=s||V,fe=[x[N.key]?"error":"",V?"readonly":""].filter(Boolean).join(" ");return N.type==="address"?P.jsx("textarea",{rows:2,placeholder:N.placeholder,value:B[N.key]||"",onChange:pe=>C(N.key,pe.target.value),className:fe,disabled:X}):P.jsx("input",{type:N.type==="number"?"number":"text",placeholder:N.placeholder,value:B[N.key]||"",onChange:pe=>C(N.key,pe.target.value),className:fe,disabled:X})})(),x[N.key]&&P.jsx("span",{className:"field-error",children:x[N.key]})]},N.key))}),P.jsxs("div",{className:"action-form-actions",children:[P.jsx("button",{className:"action-form-cancel",onClick:o,type:"button",disabled:s,children:i("formCancel")}),P.jsx("button",{className:"action-form-submit",onClick:ke,type:"button",disabled:s,children:i(s?"formProcessing":"formExecute")})]})]}):null},Yi=({scrollContainerRef:e,threshold:t=200})=>{const[n,o]=ne.useState(!1);ne.useEffect(()=>{const a=e.current;if(!a)return;const r=()=>{const{scrollTop:i,scrollHeight:d,clientHeight:T}=a,B=d-i-T;o(B>t)};return a.addEventListener("scroll",r,{passive:!0}),r(),()=>{a.removeEventListener("scroll",r)}},[e,t]);const s=()=>{e.current?.scrollTo({top:e.current.scrollHeight,behavior:"smooth"})};return n?P.jsx("button",{className:"scroll-to-bottom-btn",onClick:s,"aria-label":"Scroll to bottom",type:"button",children:P.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:P.jsx("path",{d:"M9 3V15M9 15L4 10M9 15L14 10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}):null};function ji(e){const{walletAddress:t,chainName:n,chainId:o,nativeSymbol:s,walletTokens:a,walletNfts:r}=e;if(!t)return`You are a Web3 wallet assistant for the Keyring crypto EVM wallet app.
106
106
  The user is currently NOT connected to any wallet.
107
107
 
108
108
  ## YOUR ROLE:
@@ -158,20 +158,20 @@ Always respond with a valid JSON object:
158
158
  - **CRITICAL**: NEVER include any "Buy" actions (e.g., "Buy USDC", "Buy ETH", "Purchase token", etc.) in suggested_actions. The app handles Buy buttons separately. Only include non-buy actions in suggested_actions (e.g., "Send token", "Swap token", "Check balance", "Show my NFTs").
159
159
  - For wallet-required actions, politely explain the user needs to connect their wallet first, and put this in the "message" field
160
160
  - ALWAYS respond with raw JSON only, never wrap in \`\`\`json code blocks
161
- - **CRITICAL - LANGUAGE**: Always respond in the SAME language the user writes in. English → English. Vietnamese → Vietnamese. NEVER use Chinese or any other language unless the user wrote in that language.`;const l=a&&a.length>0?`
161
+ - **CRITICAL - LANGUAGE**: Always respond in the SAME language the user writes in. English → English. Vietnamese → Vietnamese. NEVER use Chinese or any other language unless the user wrote in that language.`;const i=a&&a.length>0?`
162
162
  ## USER'S CURRENT WALLET BALANCE:
163
- ${a.map(T=>{const C=T.usd_value!==void 0?` (~$${T.usd_value.toFixed(2)})`:"";return`- ${T.name} (${T.symbol}): ${T.balance_formatted}${C}${T.native_token?" [native]":` [${T.token_address}]`}`}).join(`
163
+ ${a.map(T=>{const B=T.usd_value!==void 0?` (~$${T.usd_value.toFixed(2)})`:"";return`- ${T.name} (${T.symbol}): ${T.balance_formatted}${B}${T.native_token?" [native]":` [${T.token_address}]`}`}).join(`
164
164
  `)}
165
165
  Use this balance data to accurately answer balance questions and to pre-fill token parameters in actions (contract_address, decimals, symbol). NEVER ask the user to provide token info that is already available above.
166
166
  `:"",d=r&&r.length>0?`
167
167
  ## USER'S NFT COLLECTION:
168
- ${r.map(T=>{const C=T.contract_type==="ERC1155"?` (x${T.amount})`:"";return`- ${T.name}${C} | ${T.contract_type} | contract: ${T.token_address} | tokenId: ${T.token_id}`}).join(`
168
+ ${r.map(T=>{const B=T.contract_type==="ERC1155"?` (x${T.amount})`:"";return`- ${T.name}${B} | ${T.contract_type} | contract: ${T.token_address} | tokenId: ${T.token_id}`}).join(`
169
169
  `)}
170
170
  When the user wants to send an NFT by name, use this data to fill contract_address, token_id, token_standard, and nft_name accurately. NEVER guess or fabricate NFT contract addresses.
171
171
  `:"";return`You are a Web3 wallet assistant for the Keyring crypto EVM wallet app.
172
172
  The user's wallet address is: ${t}
173
173
  The user is on chain: ${n} (chainId: ${o})
174
- Native token: ${s}${l}${d}
174
+ Native token: ${s}${i}${d}
175
175
  ## YOUR ROLE:
176
176
  - You are a friendly, knowledgeable assistant that can talk about ANY topic naturally
177
177
  - You also specialize in crypto wallet operations: send tokens, swap, approve, check balances, get token info
@@ -232,7 +232,8 @@ Each entry: { "symbol": "<TOKEN_SYMBOL>" (REQUIRED), "contract_address": "<actua
232
232
 
233
233
  ### 1. send_native - Send native token (${s})
234
234
  Parameters: { "to_address": "", "amount": "" }
235
- Triggered by: "send ETH", "transfer 0.1 ${s} to 0x...", "send native token"
235
+ Triggered by: "send ${s}", "transfer 0.1 ${s} to 0x...", "send native token"
236
+ **IMPORTANT**: ONLY use send_native when the user explicitly wants to send **${s}** (the native token of the CURRENT chain). If the user says "send ETH" but the current chain's native token is NOT ETH (e.g., on Polygon where native is MATIC), then ETH is an ERC20 token on this chain — use send_token with the correct ETH/WETH contract address instead. NEVER use send_native for a token that is not ${s}.
236
237
  Note: If user says "max", "all", or "send everything", set amount to "max". If user says "X%" (e.g., 50%), set amount to "50%". The app resolves these to actual values.
237
238
 
238
239
  ### 2. send_token - Send ERC20 token
@@ -295,7 +296,7 @@ You have comprehensive, precise knowledge of token contract addresses on ALL maj
295
296
  6. **IMPORTANT**: ALWAYS provide accurate decimals for each token. This is CRITICAL for accurate transaction amounts.
296
297
  7. **IMPORTANT**: ALWAYS provide accurate token_symbol for each token. Even if the user only provides a contract address without naming the token, you MUST identify the token from the address and fill in token_symbol and decimals. For example: if user provides "0x4200000000000000000000000000000000000006" on OP/Base, you know it is WETH with decimals 18 — fill in token_symbol:"WETH" and decimals:"18". You have comprehensive knowledge of well-known token contract addresses — use it to populate all fields.
297
298
  8. For amounts, use the exact number the user mentioned (don't convert units). If user says "max", "all", or "everything", set amount to "max". If user says "X%" (e.g., "send 50% of my USDC", "swap 25% of my ETH"), set amount to "50%" or "25%" — the literal percentage string. The app will resolve these to the actual balance values.
298
- 9. For native token sends, use "send_native" not "send_token"
299
+ 9. For native token sends, use "send_native" ONLY when the user wants to send **${s}** — the ACTUAL native token of the current chain (chainId: ${o}). If the user says "send ETH" but the native token on this chain is not ETH (e.g., Polygon where native is MATIC), treat ETH as an ERC20 token and use "send_token" with the correct ETH/WETH contract address on this chain. NEVER use send_native for a token symbol that does not match ${s}.
299
300
  10. **CRITICAL - LANGUAGE**: You MUST detect the language the user is writing in and respond ONLY in that exact same language. English user → English response. Vietnamese user → Vietnamese response. Do NOT default to Chinese or any other language under any circumstances.
300
301
  11. ALWAYS respond with raw JSON only, never wrap in \`\`\`json code blocks
301
302
  12. For swap_token: token_in for native tokens must be "native". ALWAYS provide token_in_symbol, token_out_symbol, token_in_decimals, and token_out_decimals.
@@ -309,15 +310,18 @@ You have comprehensive, precise knowledge of token contract addresses on ALL maj
309
310
 
310
311
  ## EXAMPLES:
311
312
 
312
- User: "send 0.5 ETH to 0x1234...5678"
313
+ User: "send 0.5 ${s} to 0x1234...5678" (on the current chain where native = ${s})
313
314
  Response: {"action":"send_native","message":"<friendly explanation>","parameters":{"to_address":"0x1234...5678","amount":"0.5"}}
314
315
 
315
- User: "send all my ETH to 0x1234...5678" or "send max ETH to 0x1234..."
316
+ User: "send all my ${s} to 0x1234...5678" or "send max ${s} to 0x1234..."
316
317
  Response: {"action":"send_native","message":"<friendly explanation>","parameters":{"to_address":"0x1234...5678","amount":"max"}}
317
318
 
318
- User: "send 50% of my ETH to 0x1234..."
319
+ User: "send 50% of my ${s} to 0x1234..."
319
320
  Response: {"action":"send_native","message":"<friendly explanation>","parameters":{"to_address":"0x1234...5678","amount":"50%"}}
320
321
 
322
+ User: "send 0.5 ETH to 0x1234...5678" (on Polygon where native = MATIC, so ETH is ERC20)
323
+ Response: {"action":"send_token","message":"<friendly explanation>","parameters":{"contract_address":"<actual ETH/WETH address on current chain>","token_symbol":"ETH","to_address":"0x1234...5678","amount":"0.5","decimals":"18"}}
324
+
321
325
  User: "transfer 100 USDC"
322
326
  Response: {"action":"send_token","message":"<friendly explanation>","parameters":{"contract_address":"<actual USDC address on current chain>","token_symbol":"USDC","to_address":"","amount":"100","decimals":"6"}}
323
327
 
@@ -392,48 +396,48 @@ Response: {"action":"view_nfts","message":"Let me show you your NFT collection!"
392
396
 
393
397
  [With conversation history where user previously swapped ETH to USDC]
394
398
  User: "do it again but with 2 ETH"
395
- Response: {"action":"swap_token","message":"<friendly explanation>","parameters":{"token_in":"native","token_in_symbol":"${s}","token_in_decimals":"18","token_out":"<actual USDC address on current chain>","token_out_symbol":"USDC","token_out_decimals":"6","amount":"2"}}`}const As={1:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",10:"0x4200000000000000000000000000000000000006",56:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",137:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",8453:"0x4200000000000000000000000000000000000006",42161:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"},yn=[{name:"transfer",type:"function",stateMutability:"nonpayable",inputs:[{name:"to",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{name:"approve",type:"function",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{name:"allowance",type:"function",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{name:"",type:"uint256"}]}],Ts=[{name:"deposit",type:"function",stateMutability:"payable",inputs:[],outputs:[]},{name:"withdraw",type:"function",stateMutability:"nonpayable",inputs:[{name:"wad",type:"uint256"}],outputs:[]}],Ji=[{name:"safeTransferFrom",type:"function",stateMutability:"nonpayable",inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"tokenId",type:"uint256"}],outputs:[]}],Xi=[{name:"safeTransferFrom",type:"function",stateMutability:"nonpayable",inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"id",type:"uint256"},{name:"amount",type:"uint256"},{name:"data",type:"bytes"}],outputs:[]}];function on(e,t){return t||lt[e]?.rpcUrls?.default?.http?.[0]}function Ki(e){const{action:t,parameters:n,fromAddress:o,chainId:s}=e;switch(t){case"send_native":return Zi(n,o,s);case"send_token":return Qi(n,o,s);case"approve_token":return ec(n,o,s);case"wrap_native":return tc(n,o,s);case"unwrap_native":return nc(n,o,s);case"send_nft":return sc(n,o,s);default:throw new Error(`Action "${t}" does not produce a transaction`)}}function Zi(e,t,n){const{to_address:o,amount:s}=e;if(!o)throw new Error("Recipient address is required");if(!s)throw new Error("Amount is required");const a=mt(s,18).toString();return{from:t,to:o,data:"0x",value:a,chainId:n,description:`Send ${s} native token to ${o}`}}function Qi(e,t,n){const{contract_address:o,to_address:s,amount:a,decimals:r,token_symbol:l}=e;if(!o)throw new Error("Token contract address is required");if(!s)throw new Error("Recipient address is required");if(!a)throw new Error("Amount is required");const d=parseInt(r)||18,T=mt(a,d),C=kt({abi:yn,functionName:"transfer",args:[s,T]});return{from:t,to:o,data:C,value:"0",chainId:n,description:`Send ${a} ${l||"tokens"} to ${s}`}}function ec(e,t,n){const{contract_address:o,spender_address:s,amount:a,token_symbol:r}=e;if(!o)throw new Error("Token contract address is required");if(!s)throw new Error("Spender address is required");const l=a&&a?.trim()!==""?mt(a,18):Mt,d=kt({abi:yn,functionName:"approve",args:[s,l]});return{from:t,to:o,data:d,value:"0",chainId:n,description:`Approve ${a||"unlimited"} ${r||"tokens"} for ${s}`}}function tc(e,t,n){const{amount:o}=e;if(!o)throw new Error("Amount is required");const s=As[n];if(!s)throw new Error(`WETH not supported on chain ${n}`);const a=mt(o,18).toString(),r=kt({abi:Ts,functionName:"deposit"});return{from:t,to:s,data:r,value:a,chainId:n,description:`Wrap ${o} native token`}}function nc(e,t,n){const{amount:o}=e;if(!o)throw new Error("Amount is required");const s=As[n];if(!s)throw new Error(`WETH not supported on chain ${n}`);const a=mt(o,18),r=kt({abi:Ts,functionName:"withdraw",args:[a]});return{from:t,to:s,data:r,value:"0",chainId:n,description:`Unwrap ${o} WETH`}}function oc(e){return["send_native","send_token","approve_token","wrap_native","unwrap_native","send_nft"].includes(e)}async function co(e){const{transactionHash:t,chainId:n,pollingInterval:o=3e3,timeout:s=12e4,rpcUrl:a}=e,r=on(n,a);if(!r)throw new Error(`No RPC endpoint for chain ${n}`);const l=Date.now();for(;Date.now()-l<s;){try{const T=await(await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"eth_getTransactionReceipt",params:[t]})})).json();if(T.result){const C=T.result;return{status:C.status==="0x1"?"success":"fail",blockNumber:C.blockNumber,gasUsed:C.gasUsed,effectiveGasPrice:C.effectiveGasPrice}}}catch(d){console.warn("eth_getTransactionReceipt poll error:",d)}await new Promise(d=>setTimeout(d,o))}throw new Error(`Transaction ${t} was not mined within ${s/1e3}s`)}async function lo(e){const{tokenAddress:t,ownerAddress:n,spenderAddress:o,chainId:s,rpcUrl:a}=e,r=on(s,a);if(!r)return console.warn(`No RPC endpoint for chain ${s}, assuming no allowance`),BigInt(0);try{const l=kt({abi:yn,functionName:"allowance",args:[n,o]}),T=await(await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"eth_call",params:[{to:t,data:l},"latest"]})})).json();return T.result&&T.result!=="0x"?BigInt(T.result):BigInt(0)}catch(l){return console.warn("checkAllowance failed:",l),BigInt(0)}}function vn(e){const{tokenAddress:t,spenderAddress:n,fromAddress:o,chainId:s,tokenSymbol:a}=e,r=kt({abi:yn,functionName:"approve",args:[n,Mt]});return{from:o,to:t,data:r,value:"0",chainId:s,description:`Approve ${a||"token"} for swap`}}function sc(e,t,n){const{contract_address:o,token_id:s,to_address:a,token_standard:r,amount:l,nft_name:d}=e;if(!o)throw new Error("NFT contract address is required");if(!s)throw new Error("Token ID is required");if(!a)throw new Error("Recipient address is required");const T=(r||"ERC721").toUpperCase(),C=BigInt(s);let M,h;if(T==="ERC1155"){const x=BigInt(l||"1");M=kt({abi:Xi,functionName:"safeTransferFrom",args:[t,a,C,x,"0x"]}),h=`Send ${x>1n?x.toString()+"x ":""}${d||"NFT"} (ERC1155 #${s}) to ${a}`}else M=kt({abi:Ji,functionName:"safeTransferFrom",args:[t,a,C]}),h=`Send ${d||"NFT"} (ERC721 #${s}) to ${a}`;return{from:t,to:o,data:M,value:"0",chainId:n,description:h}}async function kn(e){const{address:t,chainId:n,rpcUrl:o}=e,s=on(n,o);if(!s)return console.warn(`No RPC endpoint for chain ${n}`),new ce(0);try{const r=await(await fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"eth_getBalance",params:[t,"latest"]})})).json();return r.result&&r.result!=="0x"?new ce(BigInt(r.result).toString()):new ce(0)}catch(a){return console.warn("getNativeBalance failed:",a),new ce(0)}}async function sn(e){const{from:t,to:n,data:o,value:s,chainId:a,rpcUrl:r}=e,l=on(a,r);if(!l)return console.warn(`No RPC endpoint for chain ${a}`),new ce(0);try{const[d,T]=await Promise.all([fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"eth_estimateGas",params:[{from:t,to:n,data:o,...s&&s!=="0"?{value:s}:{}}]})}),fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:2,method:"eth_gasPrice",params:[]})})]),[C,M]=await Promise.all([d.json(),T.json()]),h=C.result?new ce(BigInt(C.result).toString()):new ce(0),x=M.result?new ce(BigInt(M.result).toString()):new ce(0);return h.times(x).times(1.1)}catch(d){return console.warn("estimateTransactionFee failed:",d),new ce(0)}}async function uo(e){const{chainId:t,rpcUrl:n}=e,o=on(t,n);if(!o)return console.warn(`No RPC endpoint for chain ${t}`),new ce(0);try{const a=await(await fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"eth_gasPrice",params:[]})})).json();return a.result&&a.result!=="0x"?new ce(BigInt(a.result).toString()):new ce(0)}catch(s){return console.warn("getGasPrice failed:",s),new ce(0)}}var oe={},an={exports:{}},ac=an.exports,xs;function rc(){return xs||(xs=1,(function(e,t){(function(n,o){var s="1.0.41",a="",r="?",l="function",d="undefined",T="object",C="string",M="major",h="model",x="name",m="type",B="vendor",L="version",ke="architecture",N="console",V="mobile",X="tablet",fe="smarttv",pe="wearable",Ce="embedded",c=500,u="Amazon",i="Apple",b="ASUS",g="BlackBerry",y="Browser",v="Chrome",w="Edge",A="Firefox",k="Google",S="Honor",D="Huawei",z="Lenovo",se="LG",me="Microsoft",Ae="Motorola",Se="Nvidia",j="OnePlus",be="Opera",xe="OPPO",We="Samsung",at="Sharp",Je="Sony",Fe="Xiaomi",qe="Zebra",Me="Facebook",De="Chromium OS",Te="Mac OS",Pt=" Browser",Vt=function(O,Q){var H={};for(var te in O)Q[te]&&Q[te].length%2===0?H[te]=Q[te].concat(O[te]):H[te]=O[te];return H},bt=function(O){for(var Q={},H=0;H<O.length;H++)Q[O[H].toUpperCase()]=O[H];return Q},U=function(O,Q){return typeof O===C?Z(Q).indexOf(Z(O))!==-1:!1},Z=function(O){return O.toLowerCase()},G=function(O){return typeof O===C?O.replace(/[^\d\.]/g,a).split(".")[0]:o},ee=function(O,Q){if(typeof O===C)return O=O.replace(/^\s\s*/,a),typeof Q===d?O:O.substring(0,c)},K=function(O,Q){for(var H=0,te,we,ae,R,_,$;H<Q.length&&!_;){var ge=Q[H],Be=Q[H+1];for(te=we=0;te<ge.length&&!_&&ge[te];)if(_=ge[te++].exec(O),_)for(ae=0;ae<Be.length;ae++)$=_[++we],R=Be[ae],typeof R===T&&R.length>0?R.length===2?typeof R[1]==l?this[R[0]]=R[1].call(this,$):this[R[0]]=R[1]:R.length===3?typeof R[1]===l&&!(R[1].exec&&R[1].test)?this[R[0]]=$?R[1].call(this,$,R[2]):o:this[R[0]]=$?$.replace(R[1],R[2]):o:R.length===4&&(this[R[0]]=$?R[3].call(this,$.replace(R[1],R[2])):o):this[R]=$||o;H+=2}},q=function(O,Q){for(var H in Q)if(typeof Q[H]===T&&Q[H].length>0){for(var te=0;te<Q[H].length;te++)if(U(Q[H][te],O))return H===r?o:H}else if(U(Q[H],O))return H===r?o:H;return Q.hasOwnProperty("*")?Q["*"]:O},Y={"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},ie={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},ye={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[L,[x,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[L,[x,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[x,L],[/opios[\/ ]+([\w\.]+)/i],[L,[x,be+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[L,[x,be+" GX"]],[/\bopr\/([\w\.]+)/i],[L,[x,be]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[L,[x,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[L,[x,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[x,L],[/quark(?:pc)?\/([-\w\.]+)/i],[L,[x,"Quark"]],[/\bddg\/([\w\.]+)/i],[L,[x,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[L,[x,"UC"+y]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[L,[x,"WeChat"]],[/konqueror\/([\w\.]+)/i],[L,[x,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[L,[x,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[L,[x,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[L,[x,"Smart Lenovo "+y]],[/(avast|avg)\/([\w\.]+)/i],[[x,/(.+)/,"$1 Secure "+y],L],[/\bfocus\/([\w\.]+)/i],[L,[x,A+" Focus"]],[/\bopt\/([\w\.]+)/i],[L,[x,be+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[L,[x,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[L,[x,"Dolphin"]],[/coast\/([\w\.]+)/i],[L,[x,be+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[L,[x,"MIUI"+Pt]],[/fxios\/([\w\.-]+)/i],[L,[x,A]],[/\bqihoobrowser\/?([\w\.]*)/i],[L,[x,"360"]],[/\b(qq)\/([\w\.]+)/i],[[x,/(.+)/,"$1Browser"],L],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[x,/(.+)/,"$1"+Pt],L],[/samsungbrowser\/([\w\.]+)/i],[L,[x,We+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[L,[x,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[x,"Sogou Mobile"],L],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[x,L],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[x],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[L,x],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[x,Me],L],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[x,L],[/\bgsa\/([\w\.]+) .*safari\//i],[L,[x,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[L,[x,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[L,[x,v+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[x,v+" WebView"],L],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[L,[x,"Android "+y]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[x,L],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[L,[x,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[L,x],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[x,[L,q,Y]],[/(webkit|khtml)\/([\w\.]+)/i],[x,L],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[x,"Netscape"],L],[/(wolvic|librewolf)\/([\w\.]+)/i],[x,L],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[L,[x,A+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[x,[L,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[x,[L,/master.|lts./,""]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[ke,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[ke,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[ke,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[ke,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[ke,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[ke,/ower/,a,Z]],[/ sun4\w[;\)]/i],[[ke,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[ke,Z]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[h,[B,We],[m,X]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[h,[B,We],[m,V]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[h,[B,i],[m,V]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[h,[B,i],[m,X]],[/(macintosh);/i],[h,[B,i]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[h,[B,at],[m,V]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[h,[B,S],[m,X]],[/honor([-\w ]+)[;\)]/i],[h,[B,S],[m,V]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[h,[B,D],[m,X]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[h,[B,D],[m,V]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[h,/_/g," "],[B,Fe],[m,X]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[h,/_/g," "],[B,Fe],[m,V]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[h,[B,xe],[m,V]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[h,[B,q,{OnePlus:["304","403","203"],"*":xe}],[m,X]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[h,[B,"Vivo"],[m,V]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[h,[B,"Realme"],[m,V]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[h,[B,Ae],[m,V]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[h,[B,Ae],[m,X]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[h,[B,se],[m,X]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv|watch)\w+)/i,/\blg-?([\d\w]+) bui/i],[h,[B,se],[m,V]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[h,[B,z],[m,X]],[/(nokia) (t[12][01])/i],[B,h,[m,X]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[h,/_/g," "],[m,V],[B,"Nokia"]],[/(pixel (c|tablet))\b/i],[h,[B,k],[m,X]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[h,[B,k],[m,V]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[h,[B,Je],[m,V]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[h,"Xperia Tablet"],[B,Je],[m,X]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[h,[B,j],[m,V]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[h,[B,u],[m,X]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[h,/(.+)/g,"Fire Phone $1"],[B,u],[m,V]],[/(playbook);[-\w\),; ]+(rim)/i],[h,B,[m,X]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[h,[B,g],[m,V]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[h,[B,b],[m,X]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[h,[B,b],[m,V]],[/(nexus 9)/i],[h,[B,"HTC"],[m,X]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[B,[h,/_/g," "],[m,V]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[h,[B,"TCL"],[m,X]],[/(itel) ((\w+))/i],[[B,Z],h,[m,q,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[h,[B,"Acer"],[m,X]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[h,[B,"Meizu"],[m,V]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[h,[B,"Ulefone"],[m,V]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[h,[B,"Energizer"],[m,V]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[h,[B,"Cat"],[m,V]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[h,[B,"Smartfren"],[m,V]],[/droid.+; (a(?:015|06[35]|142p?))/i],[h,[B,"Nothing"],[m,V]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[h,[B,"Archos"],[m,X]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[h,[B,"Archos"],[m,V]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[B,h,[m,X]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (hmd|imo) ([\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[B,h,[m,V]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[B,h,[m,X]],[/(surface duo)/i],[h,[B,me],[m,X]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[h,[B,"Fairphone"],[m,V]],[/(u304aa)/i],[h,[B,"AT&T"],[m,V]],[/\bsie-(\w*)/i],[h,[B,"Siemens"],[m,V]],[/\b(rct\w+) b/i],[h,[B,"RCA"],[m,X]],[/\b(venue[\d ]{2,7}) b/i],[h,[B,"Dell"],[m,X]],[/\b(q(?:mv|ta)\w+) b/i],[h,[B,"Verizon"],[m,X]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[h,[B,"Barnes & Noble"],[m,X]],[/\b(tm\d{3}\w+) b/i],[h,[B,"NuVision"],[m,X]],[/\b(k88) b/i],[h,[B,"ZTE"],[m,X]],[/\b(nx\d{3}j) b/i],[h,[B,"ZTE"],[m,V]],[/\b(gen\d{3}) b.+49h/i],[h,[B,"Swiss"],[m,V]],[/\b(zur\d{3}) b/i],[h,[B,"Swiss"],[m,X]],[/\b((zeki)?tb.*\b) b/i],[h,[B,"Zeki"],[m,X]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[B,"Dragon Touch"],h,[m,X]],[/\b(ns-?\w{0,9}) b/i],[h,[B,"Insignia"],[m,X]],[/\b((nxa|next)-?\w{0,9}) b/i],[h,[B,"NextBook"],[m,X]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[B,"Voice"],h,[m,V]],[/\b(lvtel\-)?(v1[12]) b/i],[[B,"LvTel"],h,[m,V]],[/\b(ph-1) /i],[h,[B,"Essential"],[m,V]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[h,[B,"Envizen"],[m,X]],[/\b(trio[-\w\. ]+) b/i],[h,[B,"MachSpeed"],[m,X]],[/\btu_(1491) b/i],[h,[B,"Rotor"],[m,X]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[h,[B,Se],[m,X]],[/(sprint) (\w+)/i],[B,h,[m,V]],[/(kin\.[onetw]{3})/i],[[h,/\./g," "],[B,me],[m,V]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[h,[B,qe],[m,X]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[h,[B,qe],[m,V]],[/smart-tv.+(samsung)/i],[B,[m,fe]],[/hbbtv.+maple;(\d+)/i],[[h,/^/,"SmartTV"],[B,We],[m,fe]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[B,se],[m,fe]],[/(apple) ?tv/i],[B,[h,i+" TV"],[m,fe]],[/crkey/i],[[h,v+"cast"],[B,k],[m,fe]],[/droid.+aft(\w+)( bui|\))/i],[h,[B,u],[m,fe]],[/(shield \w+ tv)/i],[h,[B,Se],[m,fe]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[h,[B,at],[m,fe]],[/(bravia[\w ]+)( bui|\))/i],[h,[B,Je],[m,fe]],[/(mi(tv|box)-?\w+) bui/i],[h,[B,Fe],[m,fe]],[/Hbbtv.*(technisat) (.*);/i],[B,h,[m,fe]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[B,ee],[h,ee],[m,fe]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[h,[m,fe]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[m,fe]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[B,h,[m,N]],[/droid.+; (shield)( bui|\))/i],[h,[B,Se],[m,N]],[/(playstation \w+)/i],[h,[B,Je],[m,N]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[h,[B,me],[m,N]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[h,[B,We],[m,pe]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[B,h,[m,pe]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[h,[B,xe],[m,pe]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[h,[B,i],[m,pe]],[/(opwwe\d{3})/i],[h,[B,j],[m,pe]],[/(moto 360)/i],[h,[B,Ae],[m,pe]],[/(smartwatch 3)/i],[h,[B,Je],[m,pe]],[/(g watch r)/i],[h,[B,se],[m,pe]],[/droid.+; (wt63?0{2,3})\)/i],[h,[B,qe],[m,pe]],[/droid.+; (glass) \d/i],[h,[B,k],[m,pe]],[/(pico) (4|neo3(?: link|pro)?)/i],[B,h,[m,pe]],[/; (quest( \d| pro)?)/i],[h,[B,Me],[m,pe]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[B,[m,Ce]],[/(aeobc)\b/i],[h,[B,u],[m,Ce]],[/(homepod).+mac os/i],[h,[B,i],[m,Ce]],[/windows iot/i],[[m,Ce]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[h,[m,V]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[h,[m,X]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[m,X]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[m,V]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[h,[B,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[L,[x,w+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[x,L],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[L,[x,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[x,L],[/ladybird\//i],[[x,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[L,x]],os:[[/microsoft (windows) (vista|xp)/i],[x,L],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[x,[L,q,ie]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[L,q,ie],[x,"Windows"]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[L,/_/g,"."],[x,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[x,Te],[L,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[L,x],[/(ubuntu) ([\w\.]+) like android/i],[[x,/(.+)/,"$1 Touch"],L],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; ]?([\d\.]*)/i],[x,L],[/\(bb(10);/i],[L,[x,g]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[L,[x,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[L,[x,A+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[L,[x,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[L,[x,"watchOS"]],[/crkey\/([\d\.]+)/i],[L,[x,v+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[x,De],L],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[x,L],[/(sunos) ?([\w\.\d]*)/i],[[x,"Solaris"],L],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[x,L]]},re=function(O,Q){if(typeof O===T&&(Q=O,O=o),!(this instanceof re))return new re(O,Q).getResult();var H=typeof n!==d&&n.navigator?n.navigator:o,te=O||(H&&H.userAgent?H.userAgent:a),we=H&&H.userAgentData?H.userAgentData:o,ae=Q?Vt(ye,Q):ye,R=H&&H.userAgent==te;return this.getBrowser=function(){var _={};return _[x]=o,_[L]=o,K.call(_,te,ae.browser),_[M]=G(_[L]),R&&H&&H.brave&&typeof H.brave.isBrave==l&&(_[x]="Brave"),_},this.getCPU=function(){var _={};return _[ke]=o,K.call(_,te,ae.cpu),_},this.getDevice=function(){var _={};return _[B]=o,_[h]=o,_[m]=o,K.call(_,te,ae.device),R&&!_[m]&&we&&we.mobile&&(_[m]=V),R&&_[h]=="Macintosh"&&H&&typeof H.standalone!==d&&H.maxTouchPoints&&H.maxTouchPoints>2&&(_[h]="iPad",_[m]=X),_},this.getEngine=function(){var _={};return _[x]=o,_[L]=o,K.call(_,te,ae.engine),_},this.getOS=function(){var _={};return _[x]=o,_[L]=o,K.call(_,te,ae.os),R&&!_[x]&&we&&we.platform&&we.platform!="Unknown"&&(_[x]=we.platform.replace(/chrome os/i,De).replace(/macos/i,Te)),_},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return te},this.setUA=function(_){return te=typeof _===C&&_.length>c?ee(_,c):_,this},this.setUA(te),this};re.VERSION=s,re.BROWSER=bt([x,L,M]),re.CPU=bt([ke]),re.DEVICE=bt([h,B,m,N,V,fe,X,pe,Ce]),re.ENGINE=re.OS=bt([x,L]),e.exports&&(t=e.exports=re),t.UAParser=re;var J=typeof n!==d&&(n.jQuery||n.Zepto);if(J&&!J.ua){var I=new re;J.ua=I.getResult(),J.ua.get=function(){return I.getUA()},J.ua.set=function(O){I.setUA(O);var Q=I.getResult();for(var H in Q)J.ua[H]=Q[H]}}})(typeof window=="object"?window:ac)})(an,an.exports)),an.exports}var Ss;function ic(){if(Ss)return oe;Ss=1,Object.defineProperty(oe,"__esModule",{value:!0});function e(E){return E&&typeof E=="object"&&"default"in E?E.default:E}var t=ne,n=e(t),o=rc(),s=new o,a=s.getBrowser(),r=s.getCPU(),l=s.getDevice(),d=s.getEngine(),T=s.getOS(),C=s.getUA(),M=function(f){return s.setUA(f)},h=function(f){if(!f){console.error("No userAgent string was provided");return}var p=new o(f);return{UA:p,browser:p.getBrowser(),cpu:p.getCPU(),device:p.getDevice(),engine:p.getEngine(),os:p.getOS(),ua:p.getUA(),setUserAgent:function(W){return p.setUA(W)}}},x=Object.freeze({ClientUAInstance:s,browser:a,cpu:r,device:l,engine:d,os:T,ua:C,setUa:M,parseUserAgent:h});function m(E,f){var p=Object.keys(E);if(Object.getOwnPropertySymbols){var F=Object.getOwnPropertySymbols(E);f&&(F=F.filter(function(W){return Object.getOwnPropertyDescriptor(E,W).enumerable})),p.push.apply(p,F)}return p}function B(E){for(var f=1;f<arguments.length;f++){var p=arguments[f]!=null?arguments[f]:{};f%2?m(Object(p),!0).forEach(function(F){X(E,F,p[F])}):Object.getOwnPropertyDescriptors?Object.defineProperties(E,Object.getOwnPropertyDescriptors(p)):m(Object(p)).forEach(function(F){Object.defineProperty(E,F,Object.getOwnPropertyDescriptor(p,F))})}return E}function L(E){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?L=function(f){return typeof f}:L=function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f},L(E)}function ke(E,f){if(!(E instanceof f))throw new TypeError("Cannot call a class as a function")}function N(E,f){for(var p=0;p<f.length;p++){var F=f[p];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(E,F.key,F)}}function V(E,f,p){return f&&N(E.prototype,f),E}function X(E,f,p){return f in E?Object.defineProperty(E,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):E[f]=p,E}function fe(){return fe=Object.assign||function(E){for(var f=1;f<arguments.length;f++){var p=arguments[f];for(var F in p)Object.prototype.hasOwnProperty.call(p,F)&&(E[F]=p[F])}return E},fe.apply(this,arguments)}function pe(E,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function");E.prototype=Object.create(f&&f.prototype,{constructor:{value:E,writable:!0,configurable:!0}}),f&&c(E,f)}function Ce(E){return Ce=Object.setPrototypeOf?Object.getPrototypeOf:function(p){return p.__proto__||Object.getPrototypeOf(p)},Ce(E)}function c(E,f){return c=Object.setPrototypeOf||function(F,W){return F.__proto__=W,F},c(E,f)}function u(E,f){if(E==null)return{};var p={},F=Object.keys(E),W,ve;for(ve=0;ve<F.length;ve++)W=F[ve],!(f.indexOf(W)>=0)&&(p[W]=E[W]);return p}function i(E,f){if(E==null)return{};var p=u(E,f),F,W;if(Object.getOwnPropertySymbols){var ve=Object.getOwnPropertySymbols(E);for(W=0;W<ve.length;W++)F=ve[W],!(f.indexOf(F)>=0)&&Object.prototype.propertyIsEnumerable.call(E,F)&&(p[F]=E[F])}return p}function b(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}function g(E,f){if(f&&(typeof f=="object"||typeof f=="function"))return f;if(f!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return b(E)}function y(E,f){return v(E)||w(E,f)||A(E,f)||S()}function v(E){if(Array.isArray(E))return E}function w(E,f){var p=E==null?null:typeof Symbol<"u"&&E[Symbol.iterator]||E["@@iterator"];if(p!=null){var F=[],W=!0,ve=!1,Le,Ye;try{for(p=p.call(E);!(W=(Le=p.next()).done)&&(F.push(Le.value),!(f&&F.length===f));W=!0);}catch(Sn){ve=!0,Ye=Sn}finally{try{!W&&p.return!=null&&p.return()}finally{if(ve)throw Ye}}return F}}function A(E,f){if(E){if(typeof E=="string")return k(E,f);var p=Object.prototype.toString.call(E).slice(8,-1);if(p==="Object"&&E.constructor&&(p=E.constructor.name),p==="Map"||p==="Set")return Array.from(E);if(p==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(p))return k(E,f)}}function k(E,f){(f==null||f>E.length)&&(f=E.length);for(var p=0,F=new Array(f);p<f;p++)F[p]=E[p];return F}function S(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
396
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var D={Mobile:"mobile",Tablet:"tablet",SmartTv:"smarttv",Console:"console",Wearable:"wearable",Embedded:"embedded",Browser:void 0},z={Chrome:"Chrome",Firefox:"Firefox",Opera:"Opera",Yandex:"Yandex",Safari:"Safari",InternetExplorer:"Internet Explorer",Edge:"Edge",Chromium:"Chromium",Ie:"IE",MobileSafari:"Mobile Safari",EdgeChromium:"Edge Chromium",MIUI:"MIUI Browser",SamsungBrowser:"Samsung Browser"},se={IOS:"iOS",Android:"Android",WindowsPhone:"Windows Phone",Windows:"Windows",MAC_OS:"Mac OS"},me={isMobile:!1,isTablet:!1,isBrowser:!1,isSmartTV:!1,isConsole:!1,isWearable:!1},Ae=function(f){switch(f){case D.Mobile:return{isMobile:!0};case D.Tablet:return{isTablet:!0};case D.SmartTv:return{isSmartTV:!0};case D.Console:return{isConsole:!0};case D.Wearable:return{isWearable:!0};case D.Browser:return{isBrowser:!0};case D.Embedded:return{isEmbedded:!0};default:return me}},Se=function(f){return M(f)},j=function(f){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"none";return f||p},be=function(){return typeof window<"u"&&(window.navigator||navigator)?window.navigator||navigator:!1},xe=function(f){var p=be();return p&&p.platform&&(p.platform.indexOf(f)!==-1||p.platform==="MacIntel"&&p.maxTouchPoints>1&&!window.MSStream)},We=function(f,p,F,W,ve){return{isBrowser:f,browserMajorVersion:j(p.major),browserFullVersion:j(p.version),browserName:j(p.name),engineName:j(F.name),engineVersion:j(F.version),osName:j(W.name),osVersion:j(W.version),userAgent:j(ve)}},at=function(f,p,F,W){return B({},f,{vendor:j(p.vendor),model:j(p.model),os:j(F.name),osVersion:j(F.version),ua:j(W)})},Je=function(f,p,F,W){return{isSmartTV:f,engineName:j(p.name),engineVersion:j(p.version),osName:j(F.name),osVersion:j(F.version),userAgent:j(W)}},Fe=function(f,p,F,W){return{isConsole:f,engineName:j(p.name),engineVersion:j(p.version),osName:j(F.name),osVersion:j(F.version),userAgent:j(W)}},qe=function(f,p,F,W){return{isWearable:f,engineName:j(p.name),engineVersion:j(p.version),osName:j(F.name),osVersion:j(F.version),userAgent:j(W)}},Me=function(f,p,F,W,ve){return{isEmbedded:f,vendor:j(p.vendor),model:j(p.model),engineName:j(F.name),engineVersion:j(F.version),osName:j(W.name),osVersion:j(W.version),userAgent:j(ve)}};function De(E){var f=E?h(E):x,p=f.device,F=f.browser,W=f.engine,ve=f.os,Le=f.ua,Ye=Ae(p.type),Sn=Ye.isBrowser,al=Ye.isMobile,rl=Ye.isTablet,Os=Ye.isSmartTV,Ls=Ye.isConsole,Ms=Ye.isWearable,Rs=Ye.isEmbedded;if(Sn)return We(Sn,F,W,ve,Le);if(Os)return Je(Os,W,ve,Le);if(Ls)return Fe(Ls,W,ve,Le);if(al||rl)return at(Ye,p,ve,Le);if(Ms)return qe(Ms,W,ve,Le);if(Rs)return Me(Rs,p,W,ve,Le)}var Te=function(f){var p=f.type;return p===D.Mobile},Pt=function(f){var p=f.type;return p===D.Tablet},Vt=function(f){var p=f.type;return p===D.Mobile||p===D.Tablet},bt=function(f){var p=f.type;return p===D.SmartTv},U=function(f){var p=f.type;return p===D.Browser},Z=function(f){var p=f.type;return p===D.Wearable},G=function(f){var p=f.type;return p===D.Console},ee=function(f){var p=f.type;return p===D.Embedded},K=function(f){var p=f.vendor;return j(p)},q=function(f){var p=f.model;return j(p)},Y=function(f){var p=f.type;return j(p,"browser")},ie=function(f){var p=f.name;return p===se.Android},ye=function(f){var p=f.name;return p===se.Windows},re=function(f){var p=f.name;return p===se.MAC_OS},J=function(f){var p=f.name;return p===se.WindowsPhone},I=function(f){var p=f.name;return p===se.IOS},O=function(f){var p=f.version;return j(p)},Q=function(f){var p=f.name;return j(p)},H=function(f){var p=f.name;return p===z.Chrome},te=function(f){var p=f.name;return p===z.Firefox},we=function(f){var p=f.name;return p===z.Chromium},ae=function(f){var p=f.name;return p===z.Edge},R=function(f){var p=f.name;return p===z.Yandex},_=function(f){var p=f.name;return p===z.Safari||p===z.MobileSafari},$=function(f){var p=f.name;return p===z.MobileSafari},ge=function(f){var p=f.name;return p===z.Opera},Be=function(f){var p=f.name;return p===z.InternetExplorer||p===z.Ie},de=function(f){var p=f.name;return p===z.MIUI},Ee=function(f){var p=f.name;return p===z.SamsungBrowser},Pe=function(f){var p=f.version;return j(p)},Ne=function(f){var p=f.major;return j(p)},_e=function(f){var p=f.name;return j(p)},Xe=function(f){var p=f.name;return j(p)},nt=function(f){var p=f.version;return j(p)},dt=function(){var f=be(),p=f&&f.userAgent&&f.userAgent.toLowerCase();return typeof p=="string"?/electron/.test(p):!1},rt=function(f){return typeof f=="string"&&f.indexOf("Edg/")!==-1},Ft=function(){var f=be();return f&&(/iPad|iPhone|iPod/.test(f.platform)||f.platform==="MacIntel"&&f.maxTouchPoints>1)&&!window.MSStream},Ke=function(){return xe("iPad")},rn=function(){return xe("iPhone")},Gt=function(){return xe("iPod")},Oe=function(f){return j(f)};function An(E){var f=E||x,p=f.device,F=f.browser,W=f.os,ve=f.engine,Le=f.ua;return{isSmartTV:bt(p),isConsole:G(p),isWearable:Z(p),isEmbedded:ee(p),isMobileSafari:$(F)||Ke(),isChromium:we(F),isMobile:Vt(p)||Ke(),isMobileOnly:Te(p),isTablet:Pt(p)||Ke(),isBrowser:U(p),isDesktop:U(p),isAndroid:ie(W),isWinPhone:J(W),isIOS:I(W)||Ke(),isChrome:H(F),isFirefox:te(F),isSafari:_(F),isOpera:ge(F),isIE:Be(F),osVersion:O(W),osName:Q(W),fullBrowserVersion:Pe(F),browserVersion:Ne(F),browserName:_e(F),mobileVendor:K(p),mobileModel:q(p),engineName:Xe(ve),engineVersion:nt(ve),getUA:Oe(Le),isEdge:ae(F)||rt(Le),isYandex:R(F),deviceType:Y(p),isIOS13:Ft(),isIPad13:Ke(),isIPhone13:rn(),isIPod13:Gt(),isElectron:dt(),isEdgeChromium:rt(Le),isLegacyEdge:ae(F)&&!rt(Le),isWindows:ye(W),isMacOs:re(W),isMIUI:de(F),isSamsungBrowser:Ee(F)}}var Tn=bt(l),Es=G(l),Ns=Z(l),uc=ee(l),fc=$(a)||Ke(),pc=we(a),xn=Vt(l)||Ke(),Cs=Te(l),Bs=Pt(l)||Ke(),Is=U(l),mc=U(l),Ps=ie(T),Fs=J(T),Ds=I(T)||Ke(),hc=H(a),bc=te(a),gc=_(a),wc=ge(a),_s=Be(a),yc=O(T),vc=Q(T),kc=Pe(a),Ac=Ne(a),Tc=_e(a),xc=K(l),Sc=q(l),Ec=Xe(d),Nc=nt(d),Cc=Oe(C),Bc=ae(a)||rt(C),Ic=R(a),Pc=Y(l),Fc=Ft(),Dc=Ke(),_c=rn(),Uc=Gt(),Oc=dt(),Lc=rt(C),Mc=ae(a)&&!rt(C),Rc=ye(T),$c=re(T),Hc=de(a),Wc=Ee(a),Vc=function(f){if(!f||typeof f!="string"){console.error("No valid user agent string was provided");return}var p=h(f),F=p.device,W=p.browser,ve=p.os,Le=p.engine,Ye=p.ua;return An({device:F,browser:W,os:ve,engine:Le,ua:Ye})},Gc=function(f){var p=f.renderWithFragment,F=f.children,W=i(f,["renderWithFragment","children"]);return Ps?p?n.createElement(t.Fragment,null,F):n.createElement("div",W,F):null},zc=function(f){var p=f.renderWithFragment,F=f.children,W=i(f,["renderWithFragment","children"]);return Is?p?n.createElement(t.Fragment,null,F):n.createElement("div",W,F):null},qc=function(f){var p=f.renderWithFragment,F=f.children,W=i(f,["renderWithFragment","children"]);return _s?p?n.createElement(t.Fragment,null,F):n.createElement("div",W,F):null},Yc=function(f){var p=f.renderWithFragment,F=f.children,W=i(f,["renderWithFragment","children"]);return Ds?p?n.createElement(t.Fragment,null,F):n.createElement("div",W,F):null},jc=function(f){var p=f.renderWithFragment,F=f.children,W=i(f,["renderWithFragment","children"]);return xn?p?n.createElement(t.Fragment,null,F):n.createElement("div",W,F):null},Jc=function(f){var p=f.renderWithFragment,F=f.children,W=i(f,["renderWithFragment","children"]);return Bs?p?n.createElement(t.Fragment,null,F):n.createElement("div",W,F):null},Xc=function(f){var p=f.renderWithFragment,F=f.children,W=i(f,["renderWithFragment","children"]);return Fs?p?n.createElement(t.Fragment,null,F):n.createElement("div",W,F):null},Kc=function(f){var p=f.renderWithFragment,F=f.children;f.viewClassName,f.style;var W=i(f,["renderWithFragment","children","viewClassName","style"]);return Cs?p?n.createElement(t.Fragment,null,F):n.createElement("div",W,F):null},Zc=function(f){var p=f.renderWithFragment,F=f.children,W=i(f,["renderWithFragment","children"]);return Tn?p?n.createElement(t.Fragment,null,F):n.createElement("div",W,F):null},Qc=function(f){var p=f.renderWithFragment,F=f.children,W=i(f,["renderWithFragment","children"]);return Es?p?n.createElement(t.Fragment,null,F):n.createElement("div",W,F):null},el=function(f){var p=f.renderWithFragment,F=f.children,W=i(f,["renderWithFragment","children"]);return Ns?p?n.createElement(t.Fragment,null,F):n.createElement("div",W,F):null},tl=function(f){var p=f.renderWithFragment,F=f.children;f.viewClassName,f.style;var W=f.condition,ve=i(f,["renderWithFragment","children","viewClassName","style","condition"]);return W?p?n.createElement(t.Fragment,null,F):n.createElement("div",ve,F):null};function nl(E){return(function(f){pe(p,f);function p(F){var W;return ke(this,p),W=g(this,Ce(p).call(this,F)),W.isEventListenerAdded=!1,W.handleOrientationChange=W.handleOrientationChange.bind(b(W)),W.onOrientationChange=W.onOrientationChange.bind(b(W)),W.onPageLoad=W.onPageLoad.bind(b(W)),W.state={isLandscape:!1,isPortrait:!1},W}return V(p,[{key:"handleOrientationChange",value:function(){this.isEventListenerAdded||(this.isEventListenerAdded=!0);var W=window.innerWidth>window.innerHeight?90:0;this.setState({isPortrait:W===0,isLandscape:W===90})}},{key:"onOrientationChange",value:function(){this.handleOrientationChange()}},{key:"onPageLoad",value:function(){this.handleOrientationChange()}},{key:"componentDidMount",value:function(){(typeof window>"u"?"undefined":L(window))!==void 0&&xn&&(this.isEventListenerAdded?window.removeEventListener("load",this.onPageLoad,!1):(this.handleOrientationChange(),window.addEventListener("load",this.onPageLoad,!1)),window.addEventListener("resize",this.onOrientationChange,!1))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.onOrientationChange,!1)}},{key:"render",value:function(){return n.createElement(E,fe({},this.props,{isLandscape:this.state.isLandscape,isPortrait:this.state.isPortrait}))}}]),p})(n.Component)}function ol(){var E=t.useState(function(){var ve=window.innerWidth>window.innerHeight?90:0;return{isPortrait:ve===0,isLandscape:ve===90,orientation:ve===0?"portrait":"landscape"}}),f=y(E,2),p=f[0],F=f[1],W=t.useCallback(function(){var ve=window.innerWidth>window.innerHeight?90:0,Le={isPortrait:ve===0,isLandscape:ve===90,orientation:ve===0?"portrait":"landscape"};p.orientation!==Le.orientation&&F(Le)},[p.orientation]);return t.useEffect(function(){return(typeof window>"u"?"undefined":L(window))!==void 0&&xn&&(W(),window.addEventListener("load",W,!1),window.addEventListener("resize",W,!1)),function(){window.removeEventListener("resize",W,!1),window.removeEventListener("load",W,!1)}},[W]),p}function Us(E){var f=E||window.navigator.userAgent;return h(f)}function sl(E){var f=E||window.navigator.userAgent,p=Us(f),F=An(p);return[F,p]}return oe.AndroidView=Gc,oe.BrowserTypes=z,oe.BrowserView=zc,oe.ConsoleView=Qc,oe.CustomView=tl,oe.IEView=qc,oe.IOSView=Yc,oe.MobileOnlyView=Kc,oe.MobileView=jc,oe.OsTypes=se,oe.SmartTVView=Zc,oe.TabletView=Jc,oe.WearableView=el,oe.WinPhoneView=Xc,oe.browserName=Tc,oe.browserVersion=Ac,oe.deviceDetect=De,oe.deviceType=Pc,oe.engineName=Ec,oe.engineVersion=Nc,oe.fullBrowserVersion=kc,oe.getSelectorsByUserAgent=Vc,oe.getUA=Cc,oe.isAndroid=Ps,oe.isBrowser=Is,oe.isChrome=hc,oe.isChromium=pc,oe.isConsole=Es,oe.isDesktop=mc,oe.isEdge=Bc,oe.isEdgeChromium=Lc,oe.isElectron=Oc,oe.isEmbedded=uc,oe.isFirefox=bc,oe.isIE=_s,oe.isIOS=Ds,oe.isIOS13=Fc,oe.isIPad13=Dc,oe.isIPhone13=_c,oe.isIPod13=Uc,oe.isLegacyEdge=Mc,oe.isMIUI=Hc,oe.isMacOs=$c,oe.isMobile=xn,oe.isMobileOnly=Cs,oe.isMobileSafari=fc,oe.isOpera=wc,oe.isSafari=gc,oe.isSamsungBrowser=Wc,oe.isSmartTV=Tn,oe.isTablet=Bs,oe.isWearable=Ns,oe.isWinPhone=Fs,oe.isWindows=Rc,oe.isYandex=Ic,oe.mobileModel=Sc,oe.mobileVendor=xc,oe.osName=vc,oe.osVersion=yc,oe.parseUserAgent=h,oe.setUserAgent=Se,oe.useDeviceData=Us,oe.useDeviceSelectors=sl,oe.useMobileOrientation=ol,oe.withOrientationChange=nl,oe}var Wt=ic();function fo(e,t){if(!e)return e;const n=e.toLowerCase().trim();if(n==="max"||n==="all")return t||e;const o=n.match(/^(\d+(?:\.\d+)?)%$/);if(o){const s=parseFloat(o[1])/100;return((parseFloat(t)||0)*s).toFixed(8).replace(/\.?0+$/,"")||"0"}return e}const cc=({isOpen:e,onClose:t,onTransaction:n,position:o="bottom-right",modalChatStyle:s={}})=>{const{t:a,ti:r}=En(),{messages:l,addMessage:d,updateMessageAction:T,updateMessageText:C}=Bi(),[M,h]=ne.useState(""),[x,m]=ne.useState(!1),[B,L]=ne.useState(!0),[ke,N]=ne.useState(null),V=ne.useRef(null),X=ne.useRef(null),fe=ne.useRef(null),pe=ne.useRef(null),Ce=ne.useRef(null),c=ne.useRef(!1),u=ne.useRef(B);ne.useEffect(()=>{u.current=B},[B]);const{account:i,chainData:b,chainType:g,chainTypeMoralis:y,chainId:v,isChainSupported:w}=eo(),{config:A}=Ii(),k=v&&A?.rpcUrls?.[v]||void 0,S=ne.useCallback(()=>{const U=Bt.getItem("dataBuyToken");if(U)try{return JSON.parse(U)}catch{return{srcTokenAddress:"",descTokenAddress:"",amount:"",srcTokenDecimals:18,descTokenDecimals:18}}return{srcTokenAddress:"",descTokenAddress:"",amount:"",srcTokenDecimals:18,descTokenDecimals:18}},[]),D=ne.useCallback(U=>{Bt.setItem("dataBuyToken",JSON.stringify(U))},[]),z=ne.useCallback(U=>{const G={...S(),...U};D(G)},[S,D]),se=ne.useCallback(U=>{N(U),Wt.isDesktop&&fe.current?.focus()},[]),me=ne.useCallback(async(U,Z)=>{z({descTokenAddress:U,descTokenDecimals:Z||18});try{m(!0);const G=await je({address:i?.address||"",chain:y});if(G?.success&&G?.data?.result){const ee=G.data.result;if(ee?.length>0){const K=ee.map(q=>({id:q.token_address,text:`${q.name}: ${q.balance_formatted} ${q.symbol} ($${ce(q.usd_value||0)?.decimalPlaces(2).toFormat()||"0"})`,value:r("buttonBuyWith",{symbol:q.symbol}),action:"click_balance_item_user_to_buy_button",fullWidth:!0,extraData:{tokenAddress:q.token_address,symbol:q.symbol,balance:q.balance_formatted,usdValue:q.usd_value,decimals:q.decimals}}));d(r("walletBalanceSpendable",{chain:b?.name||"unknown"}),"bot",void 0,K)}else d(r("walletNoTokensFound",{chain:b?.name||"unknown"}),"bot")}else d(a("walletFetchFailed"),"bot")}catch(G){console.error("Error fetching wallet balance:",G),d(a("walletFetchError"),"bot")}finally{m(!1)}},[z,i?.address,y,d,b?.name,a,r]),Ae=ne.useCallback(async(U,Z,G,ee)=>{const K=[25,50,75,100];z({srcTokenAddress:U,srcTokenDecimals:ee||18});let q=G||"0";if(U===Ge)try{const ie=await uo({chainId:v,rpcUrl:k});if(ie.isGreaterThan(0)){const ye=ie.times(1e6),J=new ce(mt(G,ee||18).toString()).minus(ye);J.isGreaterThan(0)?q=ce(Ue(BigInt(J.toFixed(0)),18)).toFixed():q="0"}}catch(ie){console.warn("getGasPrice for swap native fee deduction failed:",ie)}const Y=K.map(ie=>({id:`percent-${ie}`,text:`${ie}%`,value:r("buttonUsePercent",{percent:String(ie),symbol:Z}),action:"select_percent",extraData:{percent:ie,tokenAddress:U,tokenSymbol:Z,tokenBalance:q}}));if(ce(q).isZero()){d(r("insufficientFeeToken",{symbol:Z}),"bot");return}d(r("selectAmountOf",{symbol:Z,balance:q}),"bot",void 0,Y)},[d,v,k,z,r]),Se=ne.useCallback(async(U,Z)=>{z({amount:(parseFloat(Z)*(U/100)).toFixed(6)});const G=S(),ee=mt(G.amount,G.srcTokenDecimals||18).toString(),K=await ro({chainId:v,tokenIn:G.srcTokenAddress,tokenInAmount:ee,tokenOut:G.descTokenAddress,tokenOutRecipient:i?.address||"",slippage:"auto",accesstoken:"d6c45897b8f6"});if(K.success&&K.data){const q=K.data,Y=q.tokenIn,ie=q.tokenOut,ye=ce(Ue(BigInt(Y.amount||0),Y.decimals)).decimalPlaces(6).toFormat(),re=ce(Ue(BigInt(ie.amount||0),ie.decimals)).decimalPlaces(6).toFormat(),J=G.srcTokenAddress===Ge||G.srcTokenAddress==="";let I=!1;if(!J&&i?.address&&q.tx?.to)try{const _=await lo({tokenAddress:G.srcTokenAddress,ownerAddress:i.address,spenderAddress:q.tx.to,chainId:v,rpcUrl:k});I=ce(_.toString()).isLessThan(ee)}catch(_){console.warn("Allowance check failed:",_),I=!0}const O=q.estimatedTransactionFee?.total?ce(q.estimatedTransactionFee.total):ce(0);let Q=ce(0);if(I&&i?.address)try{const _=vn({tokenAddress:G.srcTokenAddress,spenderAddress:q.tx?.to||"",fromAddress:i.address,chainId:v});Q=await sn({from:i.address,to:_.to,data:_.data,chainId:v,rpcUrl:k})}catch(_){console.warn("Approve fee estimation failed:",_)}const H=O.plus(Q),te=b?.nativeCurrency?.symbol||"native";let we="",ae=!1;if(i?.address&&H.isGreaterThan(0))try{const _=await kn({address:i.address,chainId:v,rpcUrl:k});if(_.isLessThan(H)){ae=!0;const $=ce(Ue(BigInt(_.toFixed(0)),18)).decimalPlaces(6).toFormat(),ge=ce(Ue(BigInt(H.toFixed(0)),18)).decimalPlaces(6).toFormat();we=r("swapFeeWarning",{symbol:te,balance:$,needed:ge})}}catch(_){console.warn("Fee balance check failed:",_)}const R=`From: ${ye} ${Y.symbol}
399
+ Response: {"action":"swap_token","message":"<friendly explanation>","parameters":{"token_in":"native","token_in_symbol":"${s}","token_in_decimals":"18","token_out":"<actual USDC address on current chain>","token_out_symbol":"USDC","token_out_decimals":"6","amount":"2"}}`}const Ts={1:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",10:"0x4200000000000000000000000000000000000006",56:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",137:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",8453:"0x4200000000000000000000000000000000000006",42161:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"},yn=[{name:"transfer",type:"function",stateMutability:"nonpayable",inputs:[{name:"to",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{name:"approve",type:"function",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{name:"allowance",type:"function",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{name:"",type:"uint256"}]}],xs=[{name:"deposit",type:"function",stateMutability:"payable",inputs:[],outputs:[]},{name:"withdraw",type:"function",stateMutability:"nonpayable",inputs:[{name:"wad",type:"uint256"}],outputs:[]}],Ji=[{name:"safeTransferFrom",type:"function",stateMutability:"nonpayable",inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"tokenId",type:"uint256"}],outputs:[]}],Xi=[{name:"safeTransferFrom",type:"function",stateMutability:"nonpayable",inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"id",type:"uint256"},{name:"amount",type:"uint256"},{name:"data",type:"bytes"}],outputs:[]}];function on(e,t){return t||lt[e]?.rpcUrls?.default?.http?.[0]}function Ki(e){const{action:t,parameters:n,fromAddress:o,chainId:s}=e;switch(t){case"send_native":return Zi(n,o,s);case"send_token":return Qi(n,o,s);case"approve_token":return ec(n,o,s);case"wrap_native":return tc(n,o,s);case"unwrap_native":return nc(n,o,s);case"send_nft":return sc(n,o,s);default:throw new Error(`Action "${t}" does not produce a transaction`)}}function Zi(e,t,n){const{to_address:o,amount:s}=e;if(!o)throw new Error("Recipient address is required");if(!s)throw new Error("Amount is required");const a=mt(s,18).toString();return{from:t,to:o,data:"0x",value:a,chainId:n,description:`Send ${s} native token to ${o}`}}function Qi(e,t,n){const{contract_address:o,to_address:s,amount:a,decimals:r,token_symbol:i}=e;if(!o)throw new Error("Token contract address is required");if(!s)throw new Error("Recipient address is required");if(!a)throw new Error("Amount is required");const d=parseInt(r)||18,T=mt(a,d),B=kt({abi:yn,functionName:"transfer",args:[s,T]});return{from:t,to:o,data:B,value:"0",chainId:n,description:`Send ${a} ${i||"tokens"} to ${s}`}}function ec(e,t,n){const{contract_address:o,spender_address:s,amount:a,token_symbol:r}=e;if(!o)throw new Error("Token contract address is required");if(!s)throw new Error("Spender address is required");const i=a&&a?.trim()!==""?mt(a,18):Mt,d=kt({abi:yn,functionName:"approve",args:[s,i]});return{from:t,to:o,data:d,value:"0",chainId:n,description:`Approve ${a||"unlimited"} ${r||"tokens"} for ${s}`}}function tc(e,t,n){const{amount:o}=e;if(!o)throw new Error("Amount is required");const s=Ts[n];if(!s)throw new Error(`WETH not supported on chain ${n}`);const a=mt(o,18).toString(),r=kt({abi:xs,functionName:"deposit"});return{from:t,to:s,data:r,value:a,chainId:n,description:`Wrap ${o} native token`}}function nc(e,t,n){const{amount:o}=e;if(!o)throw new Error("Amount is required");const s=Ts[n];if(!s)throw new Error(`WETH not supported on chain ${n}`);const a=mt(o,18),r=kt({abi:xs,functionName:"withdraw",args:[a]});return{from:t,to:s,data:r,value:"0",chainId:n,description:`Unwrap ${o} WETH`}}function oc(e){return["send_native","send_token","approve_token","wrap_native","unwrap_native","send_nft"].includes(e)}async function co(e){const{transactionHash:t,chainId:n,pollingInterval:o=3e3,timeout:s=12e4,rpcUrl:a}=e,r=on(n,a);if(!r)throw new Error(`No RPC endpoint for chain ${n}`);const i=Date.now();for(;Date.now()-i<s;){try{const T=await(await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"eth_getTransactionReceipt",params:[t]})})).json();if(T.result){const B=T.result;return{status:B.status==="0x1"?"success":"fail",blockNumber:B.blockNumber,gasUsed:B.gasUsed,effectiveGasPrice:B.effectiveGasPrice}}}catch(d){console.warn("eth_getTransactionReceipt poll error:",d)}await new Promise(d=>setTimeout(d,o))}throw new Error(`Transaction ${t} was not mined within ${s/1e3}s`)}async function lo(e){const{tokenAddress:t,ownerAddress:n,spenderAddress:o,chainId:s,rpcUrl:a}=e,r=on(s,a);if(!r)return console.warn(`No RPC endpoint for chain ${s}, assuming no allowance`),BigInt(0);try{const i=kt({abi:yn,functionName:"allowance",args:[n,o]}),T=await(await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"eth_call",params:[{to:t,data:i},"latest"]})})).json();return T.result&&T.result!=="0x"?BigInt(T.result):BigInt(0)}catch(i){return console.warn("checkAllowance failed:",i),BigInt(0)}}function vn(e){const{tokenAddress:t,spenderAddress:n,fromAddress:o,chainId:s,tokenSymbol:a}=e,r=kt({abi:yn,functionName:"approve",args:[n,Mt]});return{from:o,to:t,data:r,value:"0",chainId:s,description:`Approve ${a||"token"} for swap`}}function sc(e,t,n){const{contract_address:o,token_id:s,to_address:a,token_standard:r,amount:i,nft_name:d}=e;if(!o)throw new Error("NFT contract address is required");if(!s)throw new Error("Token ID is required");if(!a)throw new Error("Recipient address is required");const T=(r||"ERC721").toUpperCase(),B=BigInt(s);let R,h;if(T==="ERC1155"){const x=BigInt(i||"1");R=kt({abi:Xi,functionName:"safeTransferFrom",args:[t,a,B,x,"0x"]}),h=`Send ${x>1n?x.toString()+"x ":""}${d||"NFT"} (ERC1155 #${s}) to ${a}`}else R=kt({abi:Ji,functionName:"safeTransferFrom",args:[t,a,B]}),h=`Send ${d||"NFT"} (ERC721 #${s}) to ${a}`;return{from:t,to:o,data:R,value:"0",chainId:n,description:h}}async function kn(e){const{address:t,chainId:n,rpcUrl:o}=e,s=on(n,o);if(!s)return console.warn(`No RPC endpoint for chain ${n}`),new ce(0);try{const r=await(await fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"eth_getBalance",params:[t,"latest"]})})).json();return r.result&&r.result!=="0x"?new ce(BigInt(r.result).toString()):new ce(0)}catch(a){return console.warn("getNativeBalance failed:",a),new ce(0)}}async function sn(e){const{from:t,to:n,data:o,value:s,chainId:a,rpcUrl:r}=e,i=on(a,r);if(!i)return console.warn(`No RPC endpoint for chain ${a}`),new ce(0);try{const[d,T]=await Promise.all([fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"eth_estimateGas",params:[{from:t,to:n,data:o,...s&&s!=="0"?{value:s}:{}}]})}),fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:2,method:"eth_gasPrice",params:[]})})]),[B,R]=await Promise.all([d.json(),T.json()]),h=B.result?new ce(BigInt(B.result).toString()):new ce(0),x=R.result?new ce(BigInt(R.result).toString()):new ce(0);return h.times(x).times(1.1)}catch(d){return console.warn("estimateTransactionFee failed:",d),new ce(0)}}async function uo(e){const{chainId:t,rpcUrl:n}=e,o=on(t,n);if(!o)return console.warn(`No RPC endpoint for chain ${t}`),new ce(0);try{const a=await(await fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"eth_gasPrice",params:[]})})).json();return a.result&&a.result!=="0x"?new ce(BigInt(a.result).toString()):new ce(0)}catch(s){return console.warn("getGasPrice failed:",s),new ce(0)}}var oe={},an={exports:{}},ac=an.exports,Es;function rc(){return Es||(Es=1,(function(e,t){(function(n,o){var s="1.0.41",a="",r="?",i="function",d="undefined",T="object",B="string",R="major",h="model",x="name",m="type",C="vendor",L="version",ke="architecture",N="console",V="mobile",X="tablet",fe="smarttv",pe="wearable",Be="embedded",l=500,u="Amazon",c="Apple",b="ASUS",g="BlackBerry",w="Browser",v="Chrome",y="Edge",A="Firefox",k="Google",E="Honor",D="Huawei",z="Lenovo",se="LG",he="Microsoft",Ae="Motorola",Se="Nvidia",j="OnePlus",ge="Opera",Ee="OPPO",Ve="Samsung",at="Sharp",Je="Sony",Fe="Xiaomi",qe="Zebra",Me="Facebook",De="Chromium OS",Te="Mac OS",Pt=" Browser",Vt=function(U,Q){var H={};for(var te in U)Q[te]&&Q[te].length%2===0?H[te]=Q[te].concat(U[te]):H[te]=U[te];return H},bt=function(U){for(var Q={},H=0;H<U.length;H++)Q[U[H].toUpperCase()]=U[H];return Q},O=function(U,Q){return typeof U===B?Z(Q).indexOf(Z(U))!==-1:!1},Z=function(U){return U.toLowerCase()},G=function(U){return typeof U===B?U.replace(/[^\d\.]/g,a).split(".")[0]:o},ee=function(U,Q){if(typeof U===B)return U=U.replace(/^\s\s*/,a),typeof Q===d?U:U.substring(0,l)},K=function(U,Q){for(var H=0,te,we,ae,M,_,$;H<Q.length&&!_;){var me=Q[H],xe=Q[H+1];for(te=we=0;te<me.length&&!_&&me[te];)if(_=me[te++].exec(U),_)for(ae=0;ae<xe.length;ae++)$=_[++we],M=xe[ae],typeof M===T&&M.length>0?M.length===2?typeof M[1]==i?this[M[0]]=M[1].call(this,$):this[M[0]]=M[1]:M.length===3?typeof M[1]===i&&!(M[1].exec&&M[1].test)?this[M[0]]=$?M[1].call(this,$,M[2]):o:this[M[0]]=$?$.replace(M[1],M[2]):o:M.length===4&&(this[M[0]]=$?M[3].call(this,$.replace(M[1],M[2])):o):this[M]=$||o;H+=2}},q=function(U,Q){for(var H in Q)if(typeof Q[H]===T&&Q[H].length>0){for(var te=0;te<Q[H].length;te++)if(O(Q[H][te],U))return H===r?o:H}else if(O(Q[H],U))return H===r?o:H;return Q.hasOwnProperty("*")?Q["*"]:U},Y={"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},ie={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},ye={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[L,[x,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[L,[x,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[x,L],[/opios[\/ ]+([\w\.]+)/i],[L,[x,ge+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[L,[x,ge+" GX"]],[/\bopr\/([\w\.]+)/i],[L,[x,ge]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[L,[x,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[L,[x,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[x,L],[/quark(?:pc)?\/([-\w\.]+)/i],[L,[x,"Quark"]],[/\bddg\/([\w\.]+)/i],[L,[x,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[L,[x,"UC"+w]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[L,[x,"WeChat"]],[/konqueror\/([\w\.]+)/i],[L,[x,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[L,[x,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[L,[x,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[L,[x,"Smart Lenovo "+w]],[/(avast|avg)\/([\w\.]+)/i],[[x,/(.+)/,"$1 Secure "+w],L],[/\bfocus\/([\w\.]+)/i],[L,[x,A+" Focus"]],[/\bopt\/([\w\.]+)/i],[L,[x,ge+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[L,[x,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[L,[x,"Dolphin"]],[/coast\/([\w\.]+)/i],[L,[x,ge+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[L,[x,"MIUI"+Pt]],[/fxios\/([\w\.-]+)/i],[L,[x,A]],[/\bqihoobrowser\/?([\w\.]*)/i],[L,[x,"360"]],[/\b(qq)\/([\w\.]+)/i],[[x,/(.+)/,"$1Browser"],L],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[x,/(.+)/,"$1"+Pt],L],[/samsungbrowser\/([\w\.]+)/i],[L,[x,Ve+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[L,[x,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[x,"Sogou Mobile"],L],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[x,L],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[x],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[L,x],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[x,Me],L],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[x,L],[/\bgsa\/([\w\.]+) .*safari\//i],[L,[x,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[L,[x,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[L,[x,v+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[x,v+" WebView"],L],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[L,[x,"Android "+w]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[x,L],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[L,[x,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[L,x],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[x,[L,q,Y]],[/(webkit|khtml)\/([\w\.]+)/i],[x,L],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[x,"Netscape"],L],[/(wolvic|librewolf)\/([\w\.]+)/i],[x,L],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[L,[x,A+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[x,[L,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[x,[L,/master.|lts./,""]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[ke,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[ke,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[ke,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[ke,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[ke,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[ke,/ower/,a,Z]],[/ sun4\w[;\)]/i],[[ke,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[ke,Z]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[h,[C,Ve],[m,X]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[h,[C,Ve],[m,V]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[h,[C,c],[m,V]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[h,[C,c],[m,X]],[/(macintosh);/i],[h,[C,c]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[h,[C,at],[m,V]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[h,[C,E],[m,X]],[/honor([-\w ]+)[;\)]/i],[h,[C,E],[m,V]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[h,[C,D],[m,X]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[h,[C,D],[m,V]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[h,/_/g," "],[C,Fe],[m,X]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[h,/_/g," "],[C,Fe],[m,V]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[h,[C,Ee],[m,V]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[h,[C,q,{OnePlus:["304","403","203"],"*":Ee}],[m,X]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[h,[C,"Vivo"],[m,V]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[h,[C,"Realme"],[m,V]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[h,[C,Ae],[m,V]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[h,[C,Ae],[m,X]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[h,[C,se],[m,X]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv|watch)\w+)/i,/\blg-?([\d\w]+) bui/i],[h,[C,se],[m,V]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[h,[C,z],[m,X]],[/(nokia) (t[12][01])/i],[C,h,[m,X]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[h,/_/g," "],[m,V],[C,"Nokia"]],[/(pixel (c|tablet))\b/i],[h,[C,k],[m,X]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[h,[C,k],[m,V]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[h,[C,Je],[m,V]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[h,"Xperia Tablet"],[C,Je],[m,X]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[h,[C,j],[m,V]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[h,[C,u],[m,X]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[h,/(.+)/g,"Fire Phone $1"],[C,u],[m,V]],[/(playbook);[-\w\),; ]+(rim)/i],[h,C,[m,X]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[h,[C,g],[m,V]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[h,[C,b],[m,X]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[h,[C,b],[m,V]],[/(nexus 9)/i],[h,[C,"HTC"],[m,X]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[C,[h,/_/g," "],[m,V]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[h,[C,"TCL"],[m,X]],[/(itel) ((\w+))/i],[[C,Z],h,[m,q,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[h,[C,"Acer"],[m,X]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[h,[C,"Meizu"],[m,V]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[h,[C,"Ulefone"],[m,V]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[h,[C,"Energizer"],[m,V]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[h,[C,"Cat"],[m,V]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[h,[C,"Smartfren"],[m,V]],[/droid.+; (a(?:015|06[35]|142p?))/i],[h,[C,"Nothing"],[m,V]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[h,[C,"Archos"],[m,X]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[h,[C,"Archos"],[m,V]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[C,h,[m,X]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (hmd|imo) ([\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[C,h,[m,V]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[C,h,[m,X]],[/(surface duo)/i],[h,[C,he],[m,X]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[h,[C,"Fairphone"],[m,V]],[/(u304aa)/i],[h,[C,"AT&T"],[m,V]],[/\bsie-(\w*)/i],[h,[C,"Siemens"],[m,V]],[/\b(rct\w+) b/i],[h,[C,"RCA"],[m,X]],[/\b(venue[\d ]{2,7}) b/i],[h,[C,"Dell"],[m,X]],[/\b(q(?:mv|ta)\w+) b/i],[h,[C,"Verizon"],[m,X]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[h,[C,"Barnes & Noble"],[m,X]],[/\b(tm\d{3}\w+) b/i],[h,[C,"NuVision"],[m,X]],[/\b(k88) b/i],[h,[C,"ZTE"],[m,X]],[/\b(nx\d{3}j) b/i],[h,[C,"ZTE"],[m,V]],[/\b(gen\d{3}) b.+49h/i],[h,[C,"Swiss"],[m,V]],[/\b(zur\d{3}) b/i],[h,[C,"Swiss"],[m,X]],[/\b((zeki)?tb.*\b) b/i],[h,[C,"Zeki"],[m,X]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[C,"Dragon Touch"],h,[m,X]],[/\b(ns-?\w{0,9}) b/i],[h,[C,"Insignia"],[m,X]],[/\b((nxa|next)-?\w{0,9}) b/i],[h,[C,"NextBook"],[m,X]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[C,"Voice"],h,[m,V]],[/\b(lvtel\-)?(v1[12]) b/i],[[C,"LvTel"],h,[m,V]],[/\b(ph-1) /i],[h,[C,"Essential"],[m,V]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[h,[C,"Envizen"],[m,X]],[/\b(trio[-\w\. ]+) b/i],[h,[C,"MachSpeed"],[m,X]],[/\btu_(1491) b/i],[h,[C,"Rotor"],[m,X]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[h,[C,Se],[m,X]],[/(sprint) (\w+)/i],[C,h,[m,V]],[/(kin\.[onetw]{3})/i],[[h,/\./g," "],[C,he],[m,V]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[h,[C,qe],[m,X]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[h,[C,qe],[m,V]],[/smart-tv.+(samsung)/i],[C,[m,fe]],[/hbbtv.+maple;(\d+)/i],[[h,/^/,"SmartTV"],[C,Ve],[m,fe]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[C,se],[m,fe]],[/(apple) ?tv/i],[C,[h,c+" TV"],[m,fe]],[/crkey/i],[[h,v+"cast"],[C,k],[m,fe]],[/droid.+aft(\w+)( bui|\))/i],[h,[C,u],[m,fe]],[/(shield \w+ tv)/i],[h,[C,Se],[m,fe]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[h,[C,at],[m,fe]],[/(bravia[\w ]+)( bui|\))/i],[h,[C,Je],[m,fe]],[/(mi(tv|box)-?\w+) bui/i],[h,[C,Fe],[m,fe]],[/Hbbtv.*(technisat) (.*);/i],[C,h,[m,fe]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[C,ee],[h,ee],[m,fe]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[h,[m,fe]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[m,fe]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[C,h,[m,N]],[/droid.+; (shield)( bui|\))/i],[h,[C,Se],[m,N]],[/(playstation \w+)/i],[h,[C,Je],[m,N]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[h,[C,he],[m,N]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[h,[C,Ve],[m,pe]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[C,h,[m,pe]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[h,[C,Ee],[m,pe]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[h,[C,c],[m,pe]],[/(opwwe\d{3})/i],[h,[C,j],[m,pe]],[/(moto 360)/i],[h,[C,Ae],[m,pe]],[/(smartwatch 3)/i],[h,[C,Je],[m,pe]],[/(g watch r)/i],[h,[C,se],[m,pe]],[/droid.+; (wt63?0{2,3})\)/i],[h,[C,qe],[m,pe]],[/droid.+; (glass) \d/i],[h,[C,k],[m,pe]],[/(pico) (4|neo3(?: link|pro)?)/i],[C,h,[m,pe]],[/; (quest( \d| pro)?)/i],[h,[C,Me],[m,pe]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[C,[m,Be]],[/(aeobc)\b/i],[h,[C,u],[m,Be]],[/(homepod).+mac os/i],[h,[C,c],[m,Be]],[/windows iot/i],[[m,Be]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[h,[m,V]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[h,[m,X]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[m,X]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[m,V]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[h,[C,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[L,[x,y+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[x,L],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[L,[x,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[x,L],[/ladybird\//i],[[x,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[L,x]],os:[[/microsoft (windows) (vista|xp)/i],[x,L],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[x,[L,q,ie]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[L,q,ie],[x,"Windows"]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[L,/_/g,"."],[x,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[x,Te],[L,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[L,x],[/(ubuntu) ([\w\.]+) like android/i],[[x,/(.+)/,"$1 Touch"],L],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; ]?([\d\.]*)/i],[x,L],[/\(bb(10);/i],[L,[x,g]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[L,[x,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[L,[x,A+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[L,[x,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[L,[x,"watchOS"]],[/crkey\/([\d\.]+)/i],[L,[x,v+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[x,De],L],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[x,L],[/(sunos) ?([\w\.\d]*)/i],[[x,"Solaris"],L],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[x,L]]},re=function(U,Q){if(typeof U===T&&(Q=U,U=o),!(this instanceof re))return new re(U,Q).getResult();var H=typeof n!==d&&n.navigator?n.navigator:o,te=U||(H&&H.userAgent?H.userAgent:a),we=H&&H.userAgentData?H.userAgentData:o,ae=Q?Vt(ye,Q):ye,M=H&&H.userAgent==te;return this.getBrowser=function(){var _={};return _[x]=o,_[L]=o,K.call(_,te,ae.browser),_[R]=G(_[L]),M&&H&&H.brave&&typeof H.brave.isBrave==i&&(_[x]="Brave"),_},this.getCPU=function(){var _={};return _[ke]=o,K.call(_,te,ae.cpu),_},this.getDevice=function(){var _={};return _[C]=o,_[h]=o,_[m]=o,K.call(_,te,ae.device),M&&!_[m]&&we&&we.mobile&&(_[m]=V),M&&_[h]=="Macintosh"&&H&&typeof H.standalone!==d&&H.maxTouchPoints&&H.maxTouchPoints>2&&(_[h]="iPad",_[m]=X),_},this.getEngine=function(){var _={};return _[x]=o,_[L]=o,K.call(_,te,ae.engine),_},this.getOS=function(){var _={};return _[x]=o,_[L]=o,K.call(_,te,ae.os),M&&!_[x]&&we&&we.platform&&we.platform!="Unknown"&&(_[x]=we.platform.replace(/chrome os/i,De).replace(/macos/i,Te)),_},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return te},this.setUA=function(_){return te=typeof _===B&&_.length>l?ee(_,l):_,this},this.setUA(te),this};re.VERSION=s,re.BROWSER=bt([x,L,R]),re.CPU=bt([ke]),re.DEVICE=bt([h,C,m,N,V,fe,X,pe,Be]),re.ENGINE=re.OS=bt([x,L]),e.exports&&(t=e.exports=re),t.UAParser=re;var J=typeof n!==d&&(n.jQuery||n.Zepto);if(J&&!J.ua){var I=new re;J.ua=I.getResult(),J.ua.get=function(){return I.getUA()},J.ua.set=function(U){I.setUA(U);var Q=I.getResult();for(var H in Q)J.ua[H]=Q[H]}}})(typeof window=="object"?window:ac)})(an,an.exports)),an.exports}var Ss;function ic(){if(Ss)return oe;Ss=1,Object.defineProperty(oe,"__esModule",{value:!0});function e(S){return S&&typeof S=="object"&&"default"in S?S.default:S}var t=ne,n=e(t),o=rc(),s=new o,a=s.getBrowser(),r=s.getCPU(),i=s.getDevice(),d=s.getEngine(),T=s.getOS(),B=s.getUA(),R=function(f){return s.setUA(f)},h=function(f){if(!f){console.error("No userAgent string was provided");return}var p=new o(f);return{UA:p,browser:p.getBrowser(),cpu:p.getCPU(),device:p.getDevice(),engine:p.getEngine(),os:p.getOS(),ua:p.getUA(),setUserAgent:function(W){return p.setUA(W)}}},x=Object.freeze({ClientUAInstance:s,browser:a,cpu:r,device:i,engine:d,os:T,ua:B,setUa:R,parseUserAgent:h});function m(S,f){var p=Object.keys(S);if(Object.getOwnPropertySymbols){var F=Object.getOwnPropertySymbols(S);f&&(F=F.filter(function(W){return Object.getOwnPropertyDescriptor(S,W).enumerable})),p.push.apply(p,F)}return p}function C(S){for(var f=1;f<arguments.length;f++){var p=arguments[f]!=null?arguments[f]:{};f%2?m(Object(p),!0).forEach(function(F){X(S,F,p[F])}):Object.getOwnPropertyDescriptors?Object.defineProperties(S,Object.getOwnPropertyDescriptors(p)):m(Object(p)).forEach(function(F){Object.defineProperty(S,F,Object.getOwnPropertyDescriptor(p,F))})}return S}function L(S){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?L=function(f){return typeof f}:L=function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f},L(S)}function ke(S,f){if(!(S instanceof f))throw new TypeError("Cannot call a class as a function")}function N(S,f){for(var p=0;p<f.length;p++){var F=f[p];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(S,F.key,F)}}function V(S,f,p){return f&&N(S.prototype,f),S}function X(S,f,p){return f in S?Object.defineProperty(S,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):S[f]=p,S}function fe(){return fe=Object.assign||function(S){for(var f=1;f<arguments.length;f++){var p=arguments[f];for(var F in p)Object.prototype.hasOwnProperty.call(p,F)&&(S[F]=p[F])}return S},fe.apply(this,arguments)}function pe(S,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function");S.prototype=Object.create(f&&f.prototype,{constructor:{value:S,writable:!0,configurable:!0}}),f&&l(S,f)}function Be(S){return Be=Object.setPrototypeOf?Object.getPrototypeOf:function(p){return p.__proto__||Object.getPrototypeOf(p)},Be(S)}function l(S,f){return l=Object.setPrototypeOf||function(F,W){return F.__proto__=W,F},l(S,f)}function u(S,f){if(S==null)return{};var p={},F=Object.keys(S),W,ve;for(ve=0;ve<F.length;ve++)W=F[ve],!(f.indexOf(W)>=0)&&(p[W]=S[W]);return p}function c(S,f){if(S==null)return{};var p=u(S,f),F,W;if(Object.getOwnPropertySymbols){var ve=Object.getOwnPropertySymbols(S);for(W=0;W<ve.length;W++)F=ve[W],!(f.indexOf(F)>=0)&&Object.prototype.propertyIsEnumerable.call(S,F)&&(p[F]=S[F])}return p}function b(S){if(S===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S}function g(S,f){if(f&&(typeof f=="object"||typeof f=="function"))return f;if(f!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return b(S)}function w(S,f){return v(S)||y(S,f)||A(S,f)||E()}function v(S){if(Array.isArray(S))return S}function y(S,f){var p=S==null?null:typeof Symbol<"u"&&S[Symbol.iterator]||S["@@iterator"];if(p!=null){var F=[],W=!0,ve=!1,Le,Ye;try{for(p=p.call(S);!(W=(Le=p.next()).done)&&(F.push(Le.value),!(f&&F.length===f));W=!0);}catch(En){ve=!0,Ye=En}finally{try{!W&&p.return!=null&&p.return()}finally{if(ve)throw Ye}}return F}}function A(S,f){if(S){if(typeof S=="string")return k(S,f);var p=Object.prototype.toString.call(S).slice(8,-1);if(p==="Object"&&S.constructor&&(p=S.constructor.name),p==="Map"||p==="Set")return Array.from(S);if(p==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(p))return k(S,f)}}function k(S,f){(f==null||f>S.length)&&(f=S.length);for(var p=0,F=new Array(f);p<f;p++)F[p]=S[p];return F}function E(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
400
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var D={Mobile:"mobile",Tablet:"tablet",SmartTv:"smarttv",Console:"console",Wearable:"wearable",Embedded:"embedded",Browser:void 0},z={Chrome:"Chrome",Firefox:"Firefox",Opera:"Opera",Yandex:"Yandex",Safari:"Safari",InternetExplorer:"Internet Explorer",Edge:"Edge",Chromium:"Chromium",Ie:"IE",MobileSafari:"Mobile Safari",EdgeChromium:"Edge Chromium",MIUI:"MIUI Browser",SamsungBrowser:"Samsung Browser"},se={IOS:"iOS",Android:"Android",WindowsPhone:"Windows Phone",Windows:"Windows",MAC_OS:"Mac OS"},he={isMobile:!1,isTablet:!1,isBrowser:!1,isSmartTV:!1,isConsole:!1,isWearable:!1},Ae=function(f){switch(f){case D.Mobile:return{isMobile:!0};case D.Tablet:return{isTablet:!0};case D.SmartTv:return{isSmartTV:!0};case D.Console:return{isConsole:!0};case D.Wearable:return{isWearable:!0};case D.Browser:return{isBrowser:!0};case D.Embedded:return{isEmbedded:!0};default:return he}},Se=function(f){return R(f)},j=function(f){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"none";return f||p},ge=function(){return typeof window<"u"&&(window.navigator||navigator)?window.navigator||navigator:!1},Ee=function(f){var p=ge();return p&&p.platform&&(p.platform.indexOf(f)!==-1||p.platform==="MacIntel"&&p.maxTouchPoints>1&&!window.MSStream)},Ve=function(f,p,F,W,ve){return{isBrowser:f,browserMajorVersion:j(p.major),browserFullVersion:j(p.version),browserName:j(p.name),engineName:j(F.name),engineVersion:j(F.version),osName:j(W.name),osVersion:j(W.version),userAgent:j(ve)}},at=function(f,p,F,W){return C({},f,{vendor:j(p.vendor),model:j(p.model),os:j(F.name),osVersion:j(F.version),ua:j(W)})},Je=function(f,p,F,W){return{isSmartTV:f,engineName:j(p.name),engineVersion:j(p.version),osName:j(F.name),osVersion:j(F.version),userAgent:j(W)}},Fe=function(f,p,F,W){return{isConsole:f,engineName:j(p.name),engineVersion:j(p.version),osName:j(F.name),osVersion:j(F.version),userAgent:j(W)}},qe=function(f,p,F,W){return{isWearable:f,engineName:j(p.name),engineVersion:j(p.version),osName:j(F.name),osVersion:j(F.version),userAgent:j(W)}},Me=function(f,p,F,W,ve){return{isEmbedded:f,vendor:j(p.vendor),model:j(p.model),engineName:j(F.name),engineVersion:j(F.version),osName:j(W.name),osVersion:j(W.version),userAgent:j(ve)}};function De(S){var f=S?h(S):x,p=f.device,F=f.browser,W=f.engine,ve=f.os,Le=f.ua,Ye=Ae(p.type),En=Ye.isBrowser,al=Ye.isMobile,rl=Ye.isTablet,Ls=Ye.isSmartTV,Ms=Ye.isConsole,Rs=Ye.isWearable,$s=Ye.isEmbedded;if(En)return Ve(En,F,W,ve,Le);if(Ls)return Je(Ls,W,ve,Le);if(Ms)return Fe(Ms,W,ve,Le);if(al||rl)return at(Ye,p,ve,Le);if(Rs)return qe(Rs,W,ve,Le);if($s)return Me($s,p,W,ve,Le)}var Te=function(f){var p=f.type;return p===D.Mobile},Pt=function(f){var p=f.type;return p===D.Tablet},Vt=function(f){var p=f.type;return p===D.Mobile||p===D.Tablet},bt=function(f){var p=f.type;return p===D.SmartTv},O=function(f){var p=f.type;return p===D.Browser},Z=function(f){var p=f.type;return p===D.Wearable},G=function(f){var p=f.type;return p===D.Console},ee=function(f){var p=f.type;return p===D.Embedded},K=function(f){var p=f.vendor;return j(p)},q=function(f){var p=f.model;return j(p)},Y=function(f){var p=f.type;return j(p,"browser")},ie=function(f){var p=f.name;return p===se.Android},ye=function(f){var p=f.name;return p===se.Windows},re=function(f){var p=f.name;return p===se.MAC_OS},J=function(f){var p=f.name;return p===se.WindowsPhone},I=function(f){var p=f.name;return p===se.IOS},U=function(f){var p=f.version;return j(p)},Q=function(f){var p=f.name;return j(p)},H=function(f){var p=f.name;return p===z.Chrome},te=function(f){var p=f.name;return p===z.Firefox},we=function(f){var p=f.name;return p===z.Chromium},ae=function(f){var p=f.name;return p===z.Edge},M=function(f){var p=f.name;return p===z.Yandex},_=function(f){var p=f.name;return p===z.Safari||p===z.MobileSafari},$=function(f){var p=f.name;return p===z.MobileSafari},me=function(f){var p=f.name;return p===z.Opera},xe=function(f){var p=f.name;return p===z.InternetExplorer||p===z.Ie},de=function(f){var p=f.name;return p===z.MIUI},Ne=function(f){var p=f.name;return p===z.SamsungBrowser},Pe=function(f){var p=f.version;return j(p)},Ce=function(f){var p=f.major;return j(p)},_e=function(f){var p=f.name;return j(p)},Xe=function(f){var p=f.name;return j(p)},nt=function(f){var p=f.version;return j(p)},dt=function(){var f=ge(),p=f&&f.userAgent&&f.userAgent.toLowerCase();return typeof p=="string"?/electron/.test(p):!1},rt=function(f){return typeof f=="string"&&f.indexOf("Edg/")!==-1},Ft=function(){var f=ge();return f&&(/iPad|iPhone|iPod/.test(f.platform)||f.platform==="MacIntel"&&f.maxTouchPoints>1)&&!window.MSStream},Ke=function(){return Ee("iPad")},rn=function(){return Ee("iPhone")},Gt=function(){return Ee("iPod")},Ue=function(f){return j(f)};function An(S){var f=S||x,p=f.device,F=f.browser,W=f.os,ve=f.engine,Le=f.ua;return{isSmartTV:bt(p),isConsole:G(p),isWearable:Z(p),isEmbedded:ee(p),isMobileSafari:$(F)||Ke(),isChromium:we(F),isMobile:Vt(p)||Ke(),isMobileOnly:Te(p),isTablet:Pt(p)||Ke(),isBrowser:O(p),isDesktop:O(p),isAndroid:ie(W),isWinPhone:J(W),isIOS:I(W)||Ke(),isChrome:H(F),isFirefox:te(F),isSafari:_(F),isOpera:me(F),isIE:xe(F),osVersion:U(W),osName:Q(W),fullBrowserVersion:Pe(F),browserVersion:Ce(F),browserName:_e(F),mobileVendor:K(p),mobileModel:q(p),engineName:Xe(ve),engineVersion:nt(ve),getUA:Ue(Le),isEdge:ae(F)||rt(Le),isYandex:M(F),deviceType:Y(p),isIOS13:Ft(),isIPad13:Ke(),isIPhone13:rn(),isIPod13:Gt(),isElectron:dt(),isEdgeChromium:rt(Le),isLegacyEdge:ae(F)&&!rt(Le),isWindows:ye(W),isMacOs:re(W),isMIUI:de(F),isSamsungBrowser:Ne(F)}}var Tn=bt(i),Ns=G(i),Cs=Z(i),uc=ee(i),fc=$(a)||Ke(),pc=we(a),xn=Vt(i)||Ke(),Bs=Te(i),Is=Pt(i)||Ke(),Ps=O(i),mc=O(i),Fs=ie(T),Ds=J(T),_s=I(T)||Ke(),hc=H(a),bc=te(a),gc=_(a),wc=me(a),Os=xe(a),yc=U(T),vc=Q(T),kc=Pe(a),Ac=Ce(a),Tc=_e(a),xc=K(i),Ec=q(i),Sc=Xe(d),Nc=nt(d),Cc=Ue(B),Bc=ae(a)||rt(B),Ic=M(a),Pc=Y(i),Fc=Ft(),Dc=Ke(),_c=rn(),Oc=Gt(),Uc=dt(),Lc=rt(B),Mc=ae(a)&&!rt(B),Rc=ye(T),$c=re(T),Hc=de(a),Wc=Ne(a),Vc=function(f){if(!f||typeof f!="string"){console.error("No valid user agent string was provided");return}var p=h(f),F=p.device,W=p.browser,ve=p.os,Le=p.engine,Ye=p.ua;return An({device:F,browser:W,os:ve,engine:Le,ua:Ye})},Gc=function(f){var p=f.renderWithFragment,F=f.children,W=c(f,["renderWithFragment","children"]);return Fs?p?n.createElement(t.Fragment,null,F):n.createElement("div",W,F):null},zc=function(f){var p=f.renderWithFragment,F=f.children,W=c(f,["renderWithFragment","children"]);return Ps?p?n.createElement(t.Fragment,null,F):n.createElement("div",W,F):null},qc=function(f){var p=f.renderWithFragment,F=f.children,W=c(f,["renderWithFragment","children"]);return Os?p?n.createElement(t.Fragment,null,F):n.createElement("div",W,F):null},Yc=function(f){var p=f.renderWithFragment,F=f.children,W=c(f,["renderWithFragment","children"]);return _s?p?n.createElement(t.Fragment,null,F):n.createElement("div",W,F):null},jc=function(f){var p=f.renderWithFragment,F=f.children,W=c(f,["renderWithFragment","children"]);return xn?p?n.createElement(t.Fragment,null,F):n.createElement("div",W,F):null},Jc=function(f){var p=f.renderWithFragment,F=f.children,W=c(f,["renderWithFragment","children"]);return Is?p?n.createElement(t.Fragment,null,F):n.createElement("div",W,F):null},Xc=function(f){var p=f.renderWithFragment,F=f.children,W=c(f,["renderWithFragment","children"]);return Ds?p?n.createElement(t.Fragment,null,F):n.createElement("div",W,F):null},Kc=function(f){var p=f.renderWithFragment,F=f.children;f.viewClassName,f.style;var W=c(f,["renderWithFragment","children","viewClassName","style"]);return Bs?p?n.createElement(t.Fragment,null,F):n.createElement("div",W,F):null},Zc=function(f){var p=f.renderWithFragment,F=f.children,W=c(f,["renderWithFragment","children"]);return Tn?p?n.createElement(t.Fragment,null,F):n.createElement("div",W,F):null},Qc=function(f){var p=f.renderWithFragment,F=f.children,W=c(f,["renderWithFragment","children"]);return Ns?p?n.createElement(t.Fragment,null,F):n.createElement("div",W,F):null},el=function(f){var p=f.renderWithFragment,F=f.children,W=c(f,["renderWithFragment","children"]);return Cs?p?n.createElement(t.Fragment,null,F):n.createElement("div",W,F):null},tl=function(f){var p=f.renderWithFragment,F=f.children;f.viewClassName,f.style;var W=f.condition,ve=c(f,["renderWithFragment","children","viewClassName","style","condition"]);return W?p?n.createElement(t.Fragment,null,F):n.createElement("div",ve,F):null};function nl(S){return(function(f){pe(p,f);function p(F){var W;return ke(this,p),W=g(this,Be(p).call(this,F)),W.isEventListenerAdded=!1,W.handleOrientationChange=W.handleOrientationChange.bind(b(W)),W.onOrientationChange=W.onOrientationChange.bind(b(W)),W.onPageLoad=W.onPageLoad.bind(b(W)),W.state={isLandscape:!1,isPortrait:!1},W}return V(p,[{key:"handleOrientationChange",value:function(){this.isEventListenerAdded||(this.isEventListenerAdded=!0);var W=window.innerWidth>window.innerHeight?90:0;this.setState({isPortrait:W===0,isLandscape:W===90})}},{key:"onOrientationChange",value:function(){this.handleOrientationChange()}},{key:"onPageLoad",value:function(){this.handleOrientationChange()}},{key:"componentDidMount",value:function(){(typeof window>"u"?"undefined":L(window))!==void 0&&xn&&(this.isEventListenerAdded?window.removeEventListener("load",this.onPageLoad,!1):(this.handleOrientationChange(),window.addEventListener("load",this.onPageLoad,!1)),window.addEventListener("resize",this.onOrientationChange,!1))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.onOrientationChange,!1)}},{key:"render",value:function(){return n.createElement(S,fe({},this.props,{isLandscape:this.state.isLandscape,isPortrait:this.state.isPortrait}))}}]),p})(n.Component)}function ol(){var S=t.useState(function(){var ve=window.innerWidth>window.innerHeight?90:0;return{isPortrait:ve===0,isLandscape:ve===90,orientation:ve===0?"portrait":"landscape"}}),f=w(S,2),p=f[0],F=f[1],W=t.useCallback(function(){var ve=window.innerWidth>window.innerHeight?90:0,Le={isPortrait:ve===0,isLandscape:ve===90,orientation:ve===0?"portrait":"landscape"};p.orientation!==Le.orientation&&F(Le)},[p.orientation]);return t.useEffect(function(){return(typeof window>"u"?"undefined":L(window))!==void 0&&xn&&(W(),window.addEventListener("load",W,!1),window.addEventListener("resize",W,!1)),function(){window.removeEventListener("resize",W,!1),window.removeEventListener("load",W,!1)}},[W]),p}function Us(S){var f=S||window.navigator.userAgent;return h(f)}function sl(S){var f=S||window.navigator.userAgent,p=Us(f),F=An(p);return[F,p]}return oe.AndroidView=Gc,oe.BrowserTypes=z,oe.BrowserView=zc,oe.ConsoleView=Qc,oe.CustomView=tl,oe.IEView=qc,oe.IOSView=Yc,oe.MobileOnlyView=Kc,oe.MobileView=jc,oe.OsTypes=se,oe.SmartTVView=Zc,oe.TabletView=Jc,oe.WearableView=el,oe.WinPhoneView=Xc,oe.browserName=Tc,oe.browserVersion=Ac,oe.deviceDetect=De,oe.deviceType=Pc,oe.engineName=Sc,oe.engineVersion=Nc,oe.fullBrowserVersion=kc,oe.getSelectorsByUserAgent=Vc,oe.getUA=Cc,oe.isAndroid=Fs,oe.isBrowser=Ps,oe.isChrome=hc,oe.isChromium=pc,oe.isConsole=Ns,oe.isDesktop=mc,oe.isEdge=Bc,oe.isEdgeChromium=Lc,oe.isElectron=Uc,oe.isEmbedded=uc,oe.isFirefox=bc,oe.isIE=Os,oe.isIOS=_s,oe.isIOS13=Fc,oe.isIPad13=Dc,oe.isIPhone13=_c,oe.isIPod13=Oc,oe.isLegacyEdge=Mc,oe.isMIUI=Hc,oe.isMacOs=$c,oe.isMobile=xn,oe.isMobileOnly=Bs,oe.isMobileSafari=fc,oe.isOpera=wc,oe.isSafari=gc,oe.isSamsungBrowser=Wc,oe.isSmartTV=Tn,oe.isTablet=Is,oe.isWearable=Cs,oe.isWinPhone=Ds,oe.isWindows=Rc,oe.isYandex=Ic,oe.mobileModel=Ec,oe.mobileVendor=xc,oe.osName=vc,oe.osVersion=yc,oe.parseUserAgent=h,oe.setUserAgent=Se,oe.useDeviceData=Us,oe.useDeviceSelectors=sl,oe.useMobileOrientation=ol,oe.withOrientationChange=nl,oe}var Wt=ic();function fo(e,t){if(!e)return e;const n=e.toLowerCase().trim();if(n==="max"||n==="all")return t||e;const o=n.match(/^(\d+(?:\.\d+)?)%$/);if(o){const s=parseFloat(o[1])/100;return((parseFloat(t)||0)*s).toFixed(8).replace(/\.?0+$/,"")||"0"}return e}const cc=({isOpen:e,onClose:t,onTransaction:n,position:o="bottom-right",modalChatStyle:s={}})=>{const{t:a,ti:r}=Sn(),{messages:i,addMessage:d,updateMessageAction:T,updateMessageText:B}=Ii(),[R,h]=ne.useState(""),[x,m]=ne.useState(!1),[C,L]=ne.useState(!0),[ke,N]=ne.useState(null),V=ne.useRef(null),X=ne.useRef(null),fe=ne.useRef(null),pe=ne.useRef(null),Be=ne.useRef(null),l=ne.useRef(!1),u=ne.useRef(C);ne.useEffect(()=>{u.current=C},[C]);const{account:c,chainData:b,chainType:g,chainTypeMoralis:w,chainId:v,isChainSupported:y}=eo(),{config:A}=Pi(),k=v&&A?.rpcUrls?.[v]||void 0,E=ne.useCallback(()=>{const O=Bt.getItem("dataBuyToken");if(O)try{return JSON.parse(O)}catch{return{srcTokenAddress:"",descTokenAddress:"",amount:"",srcTokenDecimals:18,descTokenDecimals:18}}return{srcTokenAddress:"",descTokenAddress:"",amount:"",srcTokenDecimals:18,descTokenDecimals:18}},[]),D=ne.useCallback(O=>{Bt.setItem("dataBuyToken",JSON.stringify(O))},[]),z=ne.useCallback(O=>{const G={...E(),...O};D(G)},[E,D]),se=ne.useCallback(O=>{N(O),Wt.isDesktop&&fe.current?.focus()},[]),he=ne.useCallback(async(O,Z)=>{z({descTokenAddress:O,descTokenDecimals:Z||18});try{m(!0);const G=await je({address:c?.address||"",chain:w});if(G?.success&&G?.data?.result){const ee=G.data.result;if(ee?.length>0){const K=ee.map(q=>({id:q.token_address,text:`${q.name}: ${q.balance_formatted} ${q.symbol} ($${ce(q.usd_value||0)?.decimalPlaces(2).toFormat()||"0"})`,value:r("buttonBuyWith",{symbol:q.symbol}),action:"click_balance_item_user_to_buy_button",fullWidth:!0,extraData:{tokenAddress:q.token_address,symbol:q.symbol,balance:q.balance_formatted,usdValue:q.usd_value,decimals:q.decimals}}));d(r("walletBalanceSpendable",{chain:b?.name||"unknown"}),"bot",void 0,K)}else d(r("walletNoTokensFound",{chain:b?.name||"unknown"}),"bot")}else d(a("walletFetchFailed"),"bot")}catch(G){console.error("Error fetching wallet balance:",G),d(a("walletFetchError"),"bot")}finally{m(!1)}},[z,c?.address,w,d,b?.name,a,r]),Ae=ne.useCallback(async(O,Z,G,ee)=>{const K=[25,50,75,100];z({srcTokenAddress:O,srcTokenDecimals:ee||18});let q=G||"0";if(O===He)try{const ie=await uo({chainId:v,rpcUrl:k});if(ie.isGreaterThan(0)){const ye=ie.times(1e6),J=new ce(mt(G,ee||18).toString()).minus(ye);J.isGreaterThan(0)?q=ce(Oe(BigInt(J.toFixed(0)),18)).toFixed():q="0"}}catch(ie){console.warn("getGasPrice for swap native fee deduction failed:",ie)}const Y=K.map(ie=>({id:`percent-${ie}`,text:`${ie}%`,value:r("buttonUsePercent",{percent:String(ie),symbol:Z}),action:"select_percent",extraData:{percent:ie,tokenAddress:O,tokenSymbol:Z,tokenBalance:q}}));if(ce(q).isZero()){d(r("insufficientFeeToken",{symbol:Z}),"bot");return}d(r("selectAmountOf",{symbol:Z,balance:q}),"bot",void 0,Y)},[d,v,k,z,r]),Se=ne.useCallback(async(O,Z)=>{z({amount:(parseFloat(Z)*(O/100)).toFixed(6)});const G=E(),ee=mt(G.amount,G.srcTokenDecimals||18).toString(),K=await ro({chainId:v,tokenIn:G.srcTokenAddress,tokenInAmount:ee,tokenOut:G.descTokenAddress,tokenOutRecipient:c?.address||"",slippage:"auto",accesstoken:"d6c45897b8f6"});if(K.success&&K.data){const q=K.data,Y=q.tokenIn,ie=q.tokenOut,ye=ce(Oe(BigInt(Y.amount||0),Y.decimals)).decimalPlaces(6).toFormat(),re=ce(Oe(BigInt(ie.amount||0),ie.decimals)).decimalPlaces(6).toFormat(),J=G.srcTokenAddress===He||G.srcTokenAddress==="";let I=!1;if(!J&&c?.address&&q.tx?.to)try{const _=await lo({tokenAddress:G.srcTokenAddress,ownerAddress:c.address,spenderAddress:q.tx.to,chainId:v,rpcUrl:k});I=ce(_.toString()).isLessThan(ee)}catch(_){console.warn("Allowance check failed:",_),I=!0}const U=q.estimatedTransactionFee?.total?ce(q.estimatedTransactionFee.total):ce(0);let Q=ce(0);if(I&&c?.address)try{const _=vn({tokenAddress:G.srcTokenAddress,spenderAddress:q.tx?.to||"",fromAddress:c.address,chainId:v});Q=await sn({from:c.address,to:_.to,data:_.data,chainId:v,rpcUrl:k})}catch(_){console.warn("Approve fee estimation failed:",_)}const H=U.plus(Q),te=b?.nativeCurrency?.symbol||"native";let we="",ae=!1;if(c?.address&&H.isGreaterThan(0))try{const _=await kn({address:c.address,chainId:v,rpcUrl:k});if(_.isLessThan(H)){ae=!0;const $=ce(Oe(BigInt(_.toFixed(0)),18)).decimalPlaces(6).toFormat(),me=ce(Oe(BigInt(H.toFixed(0)),18)).decimalPlaces(6).toFormat();we=r("swapFeeWarning",{symbol:te,balance:$,needed:me})}}catch(_){console.warn("Fee balance check failed:",_)}const M=`From: ${ye} ${Y.symbol}
397
401
  ⬇️
398
402
  To: ${re} ${ie.symbol}
399
403
 
400
404
  `+we+`
401
- `;if(ae)d(R,"bot");else if(I){const _=R+r("swapNeedApprove",{symbol:Y.symbol}),$=[{id:"approve-for-swap",text:r("swapApproveButton",{symbol:Y.symbol}),value:r("swapApproveValue",{symbol:Y.symbol}),action:"approve_for_swap",fullWidth:!0,extraData:{tokenAddress:G.srcTokenAddress,spenderAddress:q.tx.to,tokenSymbol:Y.symbol,tx:q.tx}}];d(_,"bot",void 0,$)}else{const _=[{id:"confirm-swap",text:a("swapConfirmButton"),value:a("swapConfirmValue"),action:"confirm_swap",extraData:{tx:q.tx}}];d(R+a("swapReadyToProceed"),"bot",void 0,_)}}else d(r("swapEstimationError",{error:K.errorMessage||K.error||"Unknown error"}),"bot")},[S,z,d,v,i?.address,b?.nativeCurrency?.symbol,k,a,r]),j=ne.useCallback(async(U,Z,G)=>{try{if(Z==="suggested_action"){pe.current=U,h(U);return}if(d(U,"user"),L(!1),m(!0),Z)switch(await ot(500),Z){case"click_buy_item_token_button":await me(G?.tokenAddress||"",G?.decimals||18);break;case"click_balance_item_user_to_buy_button":await Ae(G?.tokenAddress||"",G?.symbol||"",G?.balance||"",G?.decimals||18);break;case"select_percent":await Se(G?.percent||0,G?.tokenBalance||"");break;case"confirm_swap":if(G?.tx&&n){const ee=G.tx,K={from:i?.address||"",to:ee.to,data:ee.data,value:ee.value,chainId:v},q=d(a("txProcessing"),"bot");try{m(!1);const Y=await n(K);if(Y.status==="success"&&Y.transactionHash){const ie=b?.blockExplorers?.default?.url,ye=ie?`
405
+ `;if(ae)d(M,"bot");else if(I){const _=M+r("swapNeedApprove",{symbol:Y.symbol}),$=[{id:"approve-for-swap",text:r("swapApproveButton",{symbol:Y.symbol}),value:r("swapApproveValue",{symbol:Y.symbol}),action:"approve_for_swap",fullWidth:!0,extraData:{tokenAddress:G.srcTokenAddress,spenderAddress:q.tx.to,tokenSymbol:Y.symbol,tx:q.tx}}];d(_,"bot",void 0,$)}else{const _=[{id:"confirm-swap",text:a("swapConfirmButton"),value:a("swapConfirmValue"),action:"confirm_swap",extraData:{tx:q.tx}}];d(M+a("swapReadyToProceed"),"bot",void 0,_)}}else d(r("swapEstimationError",{error:K.errorMessage||K.error||"Unknown error"}),"bot")},[E,z,d,v,c?.address,b?.nativeCurrency?.symbol,k,a,r]),j=ne.useCallback(async(O,Z,G)=>{try{if(Z==="suggested_action"){pe.current=O,h(O);return}if(d(O,"user"),L(!1),m(!0),Z)switch(await ot(500),Z){case"click_buy_item_token_button":await he(G?.tokenAddress||"",G?.decimals||18);break;case"click_balance_item_user_to_buy_button":await Ae(G?.tokenAddress||"",G?.symbol||"",G?.balance||"",G?.decimals||18);break;case"select_percent":await Se(G?.percent||0,G?.tokenBalance||"");break;case"confirm_swap":if(G?.tx&&n){const ee=G.tx,K={from:c?.address||"",to:ee.to,data:ee.data,value:ee.value,chainId:v},q=d(a("txProcessing"),"bot");try{m(!1);const Y=await n(K);if(Y.status==="success"&&Y.transactionHash){const ie=b?.blockExplorers?.default?.url,ye=ie?`
402
406
  [View on Explorer](${ie}/tx/${Y.transactionHash})`:`
403
- Tx: ${Y.transactionHash}`;C(q.id,a("txSubmitted")+ye);try{await ot(2e3),(await co({transactionHash:Y.transactionHash,chainId:v||1,rpcUrl:k})).status==="success"?C(q.id,a("txConfirmedSwap")+ye):C(q.id,a("txRevertedSwap")+ye)}catch(re){console.warn("Transaction tracking timeout:",re),C(q.id,a("txTimeout")+ye)}}else if(Y.status==="success")C(q.id,a("txSuccessfulSwap"));else{const ie=Y.error?`
404
- Error: ${Y.error}`:"";C(q.id,a("txFailed")+ie)}}catch(Y){console.error("Transaction error:",Y),C(q.id,a("txFailed"))}}else d(a("txDataNotAvailable"),"bot");break;case"approve_for_swap":{const ee=G?.tokenAddress||"",K=G?.spenderAddress||"",q=G?.tokenSymbol||"token",Y=G?.tx;if(!ee||!K||!n){d(a("approvalDataNotAvailable"),"bot");break}const ie=vn({tokenAddress:ee,spenderAddress:K,fromAddress:i?.address||"",chainId:v,tokenSymbol:q}),ye={from:ie.from,to:ie.to,data:ie.data,value:ie.value,chainId:ie.chainId};d(r("approving",{symbol:q}),"bot");try{m(!1);const re=await n(ye);let J=re.status==="success";if(re.status==="success"&&re.transactionHash)try{J=(await co({transactionHash:re.transactionHash,chainId:v||1,rpcUrl:k})).status==="success"}catch(I){console.warn("Approval tracking timeout:",I),J=!0}if(J){d(r("approvalSuccess",{symbol:q}),"bot");const I=[{id:"confirm-swap-after-approve",text:a("confirmSwapButton"),value:a("swapConfirmValue"),action:"confirm_swap",fullWidth:!0,extraData:{tx:Y}}];d(a("approvalConfirmSwap"),"bot",void 0,I)}else{const I=re.error?`
405
- Error: ${re.error}`:"";d(a("approvalFailed")+I,"bot")}}catch(re){console.error("Approval error:",re),d(a("approvalFailed"),"bot")}break}case"click_swap_dest_token":{const ee=G?.tokenAddress||"",K=G?.symbol||"",q=G?.decimals||18;z({descTokenAddress:ee,descTokenDecimals:q});const ie=S().srcTokenAddress||"",ye=ie===Ge;try{const re=await je({address:i?.address||"",chain:y});if(re?.success&&re?.data?.result){const J=re.data.result;let I="",O="0";if(ye){const Q=J.find(H=>H.native_token);I=b?.nativeCurrency?.symbol||"ETH",O=Q?.balance_formatted||"0"}else{const Q=J.find(H=>H.token_address.toLowerCase()===ie.toLowerCase());Q&&(I=Q.symbol,O=Q.balance_formatted)}if(I&&parseFloat(O)>0){const H=[25,50,75,100].map(te=>({id:`percent-${te}`,text:`${te}%`,value:r("buttonUsePercent",{percent:String(te),symbol:I}),action:"select_percent",extraData:{percent:te,tokenAddress:ie,tokenSymbol:I,tokenBalance:O}}));d(r("swapSelectAmount",{from:I,to:K,balance:O}),"bot",void 0,H)}else d(a("swapNoSourceToken"),"bot")}else d(a("couldNotFetchBalance"),"bot")}catch(re){console.error("Error in click_swap_dest_token:",re),d(a("couldNotLoadBalance"),"bot")}break}case"select_nft_to_send":{const ee=G?.name||"NFT",K=G?.contractAddress||"",q=G?.tokenId||"",Y=G?.tokenStandard||"ERC721",ie=G?.amount||"1",ye=G?.image||"",re={contract_address:K,token_id:q,to_address:"",token_standard:Y,amount:"1",maxAmount:ie,nft_name:ee};d(r("nftSendReview",{name:ee,standard:Y,tokenId:q}),"bot",void 0,void 0,{action:"send_nft",parameters:re,status:"pending",nftInfo:{name:ee,image:ye||void 0,tokenId:q,contractAddress:K,tokenStandard:Y}});break}default:d(`Action "${Z}" executed for: ${U}`,"bot")}else await ot(500),d(`Received: ${U}`,"bot");m(!1),Wt.isDesktop&&fe.current?.focus()}catch(ee){d(a("errorProcessingRequest"),"bot"),m(!1),console.error("Error handling button click:",ee)}},[i?.address,d,C,b?.blockExplorers?.default?.url,b?.nativeCurrency?.symbol,v,y,S,me,Ae,n,Se,z,k,a,r]),be=ne.useCallback(async()=>{try{m(!0);const U=b?.tokenTrendingDefault||[],[Z,G]=await Promise.allSettled([tt.getTopGainers(g,"24h",5),tt.getTokensDetails(U,g)]);let ee=[];Z.status==="fulfilled"&&Z.value?.data?ee=[...Z.value.data]:console.warn("⚠️ Top gainers failed:"),G.status==="fulfilled"&&G.value?.data?ee=[...G.value.data,...ee]:console.warn("⚠️ Default tokens failed:"),ee=ee.filter((Y,ie,ye)=>ie===ye.findIndex(re=>re.address.toLowerCase()===Y.address.toLowerCase()));const K=ee.map(Y=>({id:Y?.symbol,text:Y?.symbol,value:r("buttonBuyToken",{name:Y.name,symbol:Y?.symbol||""}),action:"click_buy_item_token_button",extraData:{tokenAddress:Y?.address||"",symbol:Y?.symbol||"",decimals:Y?.decimals||18}}));await ot(1e3),m(!1),d(r("trendingTokensHeader",{chain:b?.name||"Unknown"}),"bot");const q=ee.map((Y,ie)=>`${ie+1}. ${Y.name} (${Y?.auditGoplus?.token_symbol||Y.symbol||"Unknown"})
407
+ Tx: ${Y.transactionHash}`;B(q.id,a("txSubmitted")+ye);try{await ot(2e3),(await co({transactionHash:Y.transactionHash,chainId:v||1,rpcUrl:k})).status==="success"?B(q.id,a("txConfirmedSwap")+ye):B(q.id,a("txRevertedSwap")+ye)}catch(re){console.warn("Transaction tracking timeout:",re),B(q.id,a("txTimeout")+ye)}}else if(Y.status==="success")B(q.id,a("txSuccessfulSwap"));else{const ie=Y.error?`
408
+ Error: ${Y.error}`:"";B(q.id,a("txFailed")+ie)}}catch(Y){console.error("Transaction error:",Y),B(q.id,a("txFailed"))}}else d(a("txDataNotAvailable"),"bot");break;case"approve_for_swap":{const ee=G?.tokenAddress||"",K=G?.spenderAddress||"",q=G?.tokenSymbol||"token",Y=G?.tx;if(!ee||!K||!n){d(a("approvalDataNotAvailable"),"bot");break}const ie=vn({tokenAddress:ee,spenderAddress:K,fromAddress:c?.address||"",chainId:v,tokenSymbol:q}),ye={from:ie.from,to:ie.to,data:ie.data,value:ie.value,chainId:ie.chainId};d(r("approving",{symbol:q}),"bot");try{m(!1);const re=await n(ye);let J=re.status==="success";if(re.status==="success"&&re.transactionHash)try{J=(await co({transactionHash:re.transactionHash,chainId:v||1,rpcUrl:k})).status==="success"}catch(I){console.warn("Approval tracking timeout:",I),J=!0}if(J){d(r("approvalSuccess",{symbol:q}),"bot");const I=[{id:"confirm-swap-after-approve",text:a("confirmSwapButton"),value:a("swapConfirmValue"),action:"confirm_swap",fullWidth:!0,extraData:{tx:Y}}];d(a("approvalConfirmSwap"),"bot",void 0,I)}else{const I=re.error?`
409
+ Error: ${re.error}`:"";d(a("approvalFailed")+I,"bot")}}catch(re){console.error("Approval error:",re),d(a("approvalFailed"),"bot")}break}case"click_swap_dest_token":{const ee=G?.tokenAddress||"",K=G?.symbol||"",q=G?.decimals||18;z({descTokenAddress:ee,descTokenDecimals:q});const ie=E().srcTokenAddress||"",ye=ie===He;try{const re=await je({address:c?.address||"",chain:w});if(re?.success&&re?.data?.result){const J=re.data.result;let I="",U="0";if(ye){const Q=J.find(H=>H.native_token);I=b?.nativeCurrency?.symbol||"ETH",U=Q?.balance_formatted||"0"}else{const Q=J.find(H=>H.token_address.toLowerCase()===ie.toLowerCase());Q&&(I=Q.symbol,U=Q.balance_formatted)}if(I&&parseFloat(U)>0){const H=[25,50,75,100].map(te=>({id:`percent-${te}`,text:`${te}%`,value:r("buttonUsePercent",{percent:String(te),symbol:I}),action:"select_percent",extraData:{percent:te,tokenAddress:ie,tokenSymbol:I,tokenBalance:U}}));d(r("swapSelectAmount",{from:I,to:K,balance:U}),"bot",void 0,H)}else d(a("swapNoSourceToken"),"bot")}else d(a("couldNotFetchBalance"),"bot")}catch(re){console.error("Error in click_swap_dest_token:",re),d(a("couldNotLoadBalance"),"bot")}break}case"select_nft_to_send":{const ee=G?.name||"NFT",K=G?.contractAddress||"",q=G?.tokenId||"",Y=G?.tokenStandard||"ERC721",ie=G?.amount||"1",ye=G?.image||"",re={contract_address:K,token_id:q,to_address:"",token_standard:Y,amount:"1",maxAmount:ie,nft_name:ee};d(r("nftSendReview",{name:ee,standard:Y,tokenId:q}),"bot",void 0,void 0,{action:"send_nft",parameters:re,status:"pending",nftInfo:{name:ee,image:ye||void 0,tokenId:q,contractAddress:K,tokenStandard:Y}});break}default:d(`Action "${Z}" executed for: ${O}`,"bot")}else await ot(500),d(`Received: ${O}`,"bot");m(!1),Wt.isDesktop&&fe.current?.focus()}catch(ee){d(a("errorProcessingRequest"),"bot"),m(!1),console.error("Error handling button click:",ee)}},[c?.address,d,B,b?.blockExplorers?.default?.url,b?.nativeCurrency?.symbol,v,w,E,he,Ae,n,Se,z,k,a,r]),ge=ne.useCallback(async()=>{try{m(!0);const O=b?.tokenTrendingDefault||[],[Z,G]=await Promise.allSettled([tt.getTopGainers(g,"24h",5),tt.getTokensDetails(O,g)]);let ee=[];Z.status==="fulfilled"&&Z.value?.data?ee=[...Z.value.data]:console.warn("⚠️ Top gainers failed:"),G.status==="fulfilled"&&G.value?.data?ee=[...G.value.data,...ee]:console.warn("⚠️ Default tokens failed:"),ee=ee.filter((Y,ie,ye)=>ie===ye.findIndex(re=>re.address.toLowerCase()===Y.address.toLowerCase()));const K=ee.map(Y=>({id:Y?.symbol,text:Y?.symbol,value:r("buttonBuyToken",{name:Y.name,symbol:Y?.symbol||""}),action:"click_buy_item_token_button",extraData:{tokenAddress:Y?.address||"",symbol:Y?.symbol||"",decimals:Y?.decimals||18}}));await ot(1e3),m(!1),d(r("trendingTokensHeader",{chain:b?.name||"Unknown"}),"bot");const q=ee.map((Y,ie)=>`${ie+1}. ${Y.name} (${Y?.auditGoplus?.token_symbol||Y.symbol||"Unknown"})
406
410
  $${ce(Y?.price||0).decimalPlaces(4).toFormat()} (${Y.price_change_percentage_24h||Y.priceChange}%)
407
411
 
408
412
  ---
409
413
  `).join(`
410
- `);d(`${q}${a("trendingTokensQuestion")}`,"bot",void 0,K)}catch(U){console.error("Error fetching trending tokens:",U),d(a("trendingTokensError"),"bot")}finally{m(!1)}},[d,b?.name,b?.tokenTrendingDefault,g,a,r]),xe=ne.useCallback(async()=>{try{m(!0);const U=await wn({address:i?.address||"",chain:y,limit:100,exclude_spam:!1});if(U?.success&&U?.data?.result&&U.data.result.length>0){const Z=U.data.result,G=Z.map(K=>{const q=K.normalized_metadata?.name||K.name||`#${K.token_id}`,Y=K.normalized_metadata?.image||K.media?.original_media_url||"";return{id:`${K.token_address}-${K.token_id}`,text:`${q} (${K.symbol||K.contract_type}) - ${K.token_id}`,value:r("buttonSendNft",{name:q}),action:"select_nft_to_send",fullWidth:!0,extraData:{contractAddress:K.token_address,tokenId:K.token_id,tokenStandard:K.contract_type,name:q,symbol:K.symbol,amount:K.amount,image:Y}}}),ee=Z.map((K,q)=>{const Y=K.normalized_metadata?.name||K.name||`#${K.token_id}`,ie=K.contract_type==="ERC1155"?` (x${K.amount})`:"",ye=K.normalized_metadata?.image||K.media?.original_media_url||"",re=ye?`![${Y}](${ye})
414
+ `);d(`${q}${a("trendingTokensQuestion")}`,"bot",void 0,K)}catch(O){console.error("Error fetching trending tokens:",O),d(a("trendingTokensError"),"bot")}finally{m(!1)}},[d,b?.name,b?.tokenTrendingDefault,g,a,r]),Ee=ne.useCallback(async()=>{try{m(!0);const O=await wn({address:c?.address||"",chain:w,limit:100,exclude_spam:!1});if(O?.success&&O?.data?.result&&O.data.result.length>0){const Z=O.data.result,G=Z.map(K=>{const q=K.normalized_metadata?.name||K.name||`#${K.token_id}`,Y=K.normalized_metadata?.image||K.media?.original_media_url||"";return{id:`${K.token_address}-${K.token_id}`,text:`${q} (${K.symbol||K.contract_type}) - ${K.token_id}`,value:r("buttonSendNft",{name:q}),action:"select_nft_to_send",fullWidth:!0,extraData:{contractAddress:K.token_address,tokenId:K.token_id,tokenStandard:K.contract_type,name:q,symbol:K.symbol,amount:K.amount,image:Y}}}),ee=Z.map((K,q)=>{const Y=K.normalized_metadata?.name||K.name||`#${K.token_id}`,ie=K.contract_type==="ERC1155"?` (x${K.amount})`:"",ye=K.normalized_metadata?.image||K.media?.original_media_url||"",re=ye?`![${Y}](${ye})
411
415
  `:"🖼️ ";return`${q+1}. ${re}**${Y}**${ie}
412
416
  ${K.symbol||K.contract_type} | Token ID: ${K.token_id}`}).join(`
413
417
 
414
- `);await ot(500),m(!1),d(r("nftCollectionHeader",{count:String(Z.length),list:ee}),"bot",void 0,G)}else m(!1),d(a("nftNoCollection"),"bot")}catch(U){console.error("Error fetching NFTs:",U),m(!1),d(a("nftFetchError"),"bot")}},[i?.address,y,d,a,r]),We=ne.useCallback(async()=>{try{m(!0);const U=await je({address:i?.address||"",chain:y});if(U?.success&&U?.data?.result&&U.data.result.length>0){const Z=U.data.result,G=Z.flatMap(K=>[{id:`send-${K.token_address}`,text:r("buttonSendToken",{symbol:K.symbol}),value:r("buttonSendToken",{symbol:K.symbol}),action:"suggested_action",fullWidth:!!Wt.isMobile},{id:`buy-more-${K.token_address}`,text:r("buttonBuyMoreToken",{symbol:K.symbol}),value:r("buttonBuyMoreToken",{symbol:K.symbol}),action:"suggested_action",fullWidth:!!Wt.isMobile}]),ee=Z.map((K,q)=>{const Y=K.usd_value!==void 0?` ≈ $${ce(K.usd_value).decimalPlaces(2).toFormat()}`:"";return`${q+1}. **${K.name}** (${K.symbol})
418
+ `);await ot(500),m(!1),d(r("nftCollectionHeader",{count:String(Z.length),list:ee}),"bot",void 0,G)}else m(!1),d(a("nftNoCollection"),"bot")}catch(O){console.error("Error fetching NFTs:",O),m(!1),d(a("nftFetchError"),"bot")}},[c?.address,w,d,a,r]),Ve=ne.useCallback(async()=>{try{m(!0);const O=await je({address:c?.address||"",chain:w});if(O?.success&&O?.data?.result&&O.data.result.length>0){const Z=O.data.result,G=Z.flatMap(K=>[{id:`send-${K.token_address}`,text:r("buttonSendToken",{symbol:K.symbol}),value:r("buttonSendToken",{symbol:K.symbol}),action:"suggested_action",fullWidth:!!Wt.isMobile},{id:`buy-more-${K.token_address}`,text:r("buttonBuyMoreToken",{symbol:K.symbol}),value:r("buttonBuyMoreToken",{symbol:K.symbol}),action:"suggested_action",fullWidth:!!Wt.isMobile}]),ee=Z.map((K,q)=>{const Y=K.usd_value!==void 0?` ≈ $${ce(K.usd_value).decimalPlaces(2).toFormat()}`:"";return`${q+1}. **${K.name}** (${K.symbol})
415
419
  Balance: ${K.balance_formatted}${Y}`}).join(`
416
420
 
417
- `);await ot(500),m(!1),d(r("viewBalancesHeader",{chain:b?.name||"this chain",list:ee}),"bot",void 0,G)}else m(!1),d(a("viewBalancesEmpty"),"bot")}catch(U){console.error("Error fetching balances:",U),m(!1),d(a("viewBalancesFetchError"),"bot")}},[i?.address,y,d,b?.name,a,r]),at=ne.useMemo(()=>[{id:"ask",icon:"❓",text:a("suggestionAskText"),action:async()=>{L(!1),m(!0),d(a("suggestionAskUserMessage"),"user"),await ot(1e3),m(!1),d(a("suggestionAskBotReply"),"bot")}},{id:"buy",icon:"💰",text:a("suggestionBuyText"),action:async()=>{L(!1),d(a("suggestionBuyText"),"user"),Re(i?.address||"")&&w?await be():(m(!0),await ot(1e3),Re(i?.address||"")&&!w?d(a("walletConnectedChainUnsupported"),"bot"):d(a("walletNotConnected"),"bot"),m(!1))}}],[d,i?.address,be,a,w]),Je=U=>{if(U===0)return!0;const Z=l[U],G=l[U-1],ee=new Date(Z.timestamp),K=new Date(G.timestamp);return ee.setHours(0,0,0,0),K.setHours(0,0,0,0),ee.getTime()!==K.getTime()};ne.useEffect(()=>{V.current?.scrollIntoView({behavior:"smooth"})},[l]),ne.useEffect(()=>{e?(fe.current&&Wt.isDesktop&&fe.current.focus(),V.current?.scrollIntoView({behavior:"instant"}),c.current&&Ce.current?Date.now()-Ce.current>1e4&&L(!0):L(!0),Ce.current=null,c.current=!1,setTimeout(()=>{V.current?.scrollIntoView({behavior:"smooth"})},50)):(Ce.current=Date.now(),c.current=!u.current)},[e]),ne.useEffect(()=>{const U=Z=>{Z.key==="Escape"&&e&&t()};return document.addEventListener("keydown",U),()=>document.removeEventListener("keydown",U)},[e,t]);const Fe=ne.useCallback(async()=>{if(M?.trim()===""||x)return;const U=ke,Z=d(M?.trim(),"user",ke?.id);h(""),N(null),m(!0),L(!1),m(!0);try{let G,ee;if(i?.address&&w)try{const[re,J]=await Promise.allSettled([je({address:i.address,chain:y}),wn({address:i.address,chain:y,limit:50,exclude_spam:!0})]);re.status==="fulfilled"&&re.value?.success&&re.value?.data?.result&&(G=re.value.data.result.map(I=>({symbol:I.symbol,name:I.name,balance_formatted:I.balance_formatted,usd_value:I.usd_value,native_token:I.native_token,token_address:I.token_address}))),J.status==="fulfilled"&&J.value?.success&&J.value?.data?.result&&(ee=J.value.data.result.map(I=>({name:I.normalized_metadata?.name||I.name||`#${I.token_id}`,token_address:I.token_address,token_id:I.token_id,contract_type:I.contract_type||"",amount:I.amount||"1"})))}catch{}const K=ji({walletAddress:i?.address||void 0,chainName:b?.name||void 0,chainId:v||void 0,nativeSymbol:b?.nativeCurrency?.symbol||void 0,walletTokens:G,walletNfts:ee}),q=l.slice(-20);let Y="";if(q.length>0){Y=`
421
+ `);await ot(500),m(!1),d(r("viewBalancesHeader",{chain:b?.name||"this chain",list:ee}),"bot",void 0,G)}else m(!1),d(a("viewBalancesEmpty"),"bot")}catch(O){console.error("Error fetching balances:",O),m(!1),d(a("viewBalancesFetchError"),"bot")}},[c?.address,w,d,b?.name,a,r]),at=ne.useMemo(()=>[{id:"ask",icon:"❓",text:a("suggestionAskText"),action:async()=>{L(!1),m(!0),d(a("suggestionAskUserMessage"),"user"),await ot(1e3),m(!1),d(a("suggestionAskBotReply"),"bot")}},{id:"buy",icon:"💰",text:a("suggestionBuyText"),action:async()=>{L(!1),d(a("suggestionBuyText"),"user"),Re(c?.address||"")&&y?await ge():(m(!0),await ot(1e3),Re(c?.address||"")&&!y?d(a("walletConnectedChainUnsupported"),"bot"):d(a("walletNotConnected"),"bot"),m(!1))}}],[d,c?.address,ge,a,y]),Je=O=>{if(O===0)return!0;const Z=i[O],G=i[O-1],ee=new Date(Z.timestamp),K=new Date(G.timestamp);return ee.setHours(0,0,0,0),K.setHours(0,0,0,0),ee.getTime()!==K.getTime()};ne.useEffect(()=>{V.current?.scrollIntoView({behavior:"smooth"})},[i]),ne.useEffect(()=>{e?(fe.current&&Wt.isDesktop&&fe.current.focus(),V.current?.scrollIntoView({behavior:"instant"}),l.current&&Be.current?Date.now()-Be.current>1e4&&L(!0):L(!0),Be.current=null,l.current=!1,setTimeout(()=>{V.current?.scrollIntoView({behavior:"smooth"})},50)):(Be.current=Date.now(),l.current=!u.current)},[e]),ne.useEffect(()=>{const O=Z=>{Z.key==="Escape"&&e&&t()};return document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)},[e,t]);const Fe=ne.useCallback(async()=>{if(R?.trim()===""||x)return;const O=ke,Z=d(R?.trim(),"user",ke?.id);h(""),N(null),m(!0),L(!1),m(!0);try{let G,ee;if(c?.address&&y)try{const[re,J]=await Promise.allSettled([je({address:c.address,chain:w}),wn({address:c.address,chain:w,limit:50,exclude_spam:!0})]);re.status==="fulfilled"&&re.value?.success&&re.value?.data?.result&&(G=re.value.data.result.map(I=>({symbol:I.symbol,name:I.name,balance_formatted:I.balance_formatted,usd_value:I.usd_value,native_token:I.native_token,token_address:I.token_address}))),J.status==="fulfilled"&&J.value?.success&&J.value?.data?.result&&(ee=J.value.data.result.map(I=>({name:I.normalized_metadata?.name||I.name||`#${I.token_id}`,token_address:I.token_address,token_id:I.token_id,contract_type:I.contract_type||"",amount:I.amount||"1"})))}catch{}const K=ji({walletAddress:c?.address||void 0,chainName:b?.name||void 0,chainId:v||void 0,nativeSymbol:b?.nativeCurrency?.symbol||void 0,walletTokens:G,walletNfts:ee}),q=i.slice(-20);let Y="";if(q.length>0){Y=`
418
422
 
419
423
  ## CONVERSATION HISTORY:
420
424
  `;for(const re of q)if(re.sender==="user")Y+=`User: ${re.text}
421
425
  `;else{const J=re.text.length>400?re.text.substring(0,400)+"...":re.text;Y+=`Assistant: ${J}
422
426
  `}Y+=`
423
427
  ---
424
- `}let ie=M?.trim();U&&(ie=`[Replying to ${U.sender==="user"?"my previous":"your"} message: "${U.text}"]
428
+ `}let ie=R?.trim();O&&(ie=`[Replying to ${O.sender==="user"?"my previous":"your"} message: "${O.text}"]
425
429
 
426
- ${ie}`);const ye=await Oi({prompt:ie,model:"gpt-4.1-mini",stream:!1,systemPrompt:K+Y});if(ye.success&&ye.data){const re=ye.data.text||"";let J=null;try{let I=re?.trim();I.startsWith("```json")?I=I.replace(/^```json\s*/,"").replace(/\s*```$/,""):I.startsWith("```")&&(I=I.replace(/^```\s*/,"").replace(/\s*```$/,"")),J=JSON.parse(I)}catch{J=null}if(J&&J.action&&J.action!=="chat")if(J.action==="buy_token"){const I=J.parameters?.token_symbol||"";let O=J.parameters?.contract_address||"",Q=18;if(O.toLowerCase()==="native"&&(O=Ge),O&&O!==Ge)try{const H=await tt.getTokensDetails([O],g);H?.data?.[0]&&(Q=H.data[0].decimals||18)}catch(H){console.warn("getTokensDetails for buy_token failed:",H)}if(!O&&I&&i?.address)try{const H=await je({address:i.address,chain:y});if(H?.success&&H?.data?.result){const te=H.data.result,we=te.find(ae=>ae.token_address.toLowerCase()===O.toLowerCase())||te.find(ae=>ae.symbol.toUpperCase()===I.toUpperCase());we&&(O=we.token_address,Q=we.decimals)}if(!O){const te=b.tokenTrendingDefault||[],[we,ae]=await Promise.allSettled([tt.getTopGainers(g,"24h",10),tt.getTokensDetails(te,g)]),R=[];we.status==="fulfilled"&&we.value?.data&&R.push(...we.value.data),ae.status==="fulfilled"&&ae.value?.data&&R.push(...ae.value.data);const _=R.find($=>$.address?.toLowerCase()===O.toLowerCase())||R.find($=>$.symbol?.toUpperCase()===I.toUpperCase());_&&(O=_.address,Q=_.decimals||18)}}catch(H){console.warn("Token lookup for buy failed:",H)}O?(d(J.message||`🛒 I'll help you buy ${I}. Let me show your available tokens to trade with.`,"bot",Z.id),await me(O,Q)):(d(J.message||`I couldn't find the token "${I}" on this chain. Here are the trending tokens you can buy:`,"bot",Z.id),await be())}else if(J.action==="swap_token"){const I={...J.parameters||{}},O=I.token_in==="native"||I.token_in_symbol?.toUpperCase()===b?.nativeCurrency?.symbol?.toUpperCase(),Q=I.token_out==="native"||I.token_out_symbol?.toUpperCase()===b?.nativeCurrency?.symbol?.toUpperCase();if(Q&&(I.token_out=Ge),!O&&(I.token_in||I.token_in_symbol)&&i?.address)try{const ae=await je({address:i.address,chain:y});if(ae?.success&&ae?.data?.result){const R=ae.data.result,_=I.token_in?R.find($=>$.token_address.toLowerCase()===I.token_in.toLowerCase()):R.find($=>$.symbol.toUpperCase()===I.token_in_symbol.toUpperCase());_&&(I.token_in=_.token_address,I.token_in_decimals=String(_.decimals))}}catch(ae){console.warn("Resolve token_in failed:",ae)}if(!Q&&(I.token_out||I.token_out_symbol)&&i?.address)try{const ae=await je({address:i.address,chain:y});if(ae?.success&&ae?.data?.result){const R=ae.data.result,_=I.token_out?R.find($=>$.token_address.toLowerCase()===I.token_out.toLowerCase()):R.find($=>$.symbol.toUpperCase()===I.token_out_symbol.toUpperCase());_&&(I.token_out=_.token_address,I.token_out_decimals=String(_.decimals))}}catch(ae){console.warn("Resolve token_out failed:",ae)}const H=!!(I.token_in||O),te=!!I.token_out,we=!!I.amount;if(H&&te&&we){d(J.message||"🔄 Preparing your swap...","bot",Z.id);try{const ae=[];I.token_out&&ae.push(I.token_out),I.token_in&&!O&&ae.push(I.token_in);let R=18,_=18;if(ae.length>0)try{const de=await tt.getTokensDetails(ae,g);if(de?.data)for(const Ee of de.data)!O&&Ee.address.toLowerCase()===I.token_in?.toLowerCase()&&(R=Ee.decimals||18),Ee.address.toLowerCase()===I.token_out?.toLowerCase()&&(_=Ee.decimals||18)}catch(de){console.warn("getTokensDetails failed, using default decimals:",de)}if(i?.address)try{const de=await je({address:i.address,chain:y});if(de?.success&&de?.data?.result){const Ee=de.data.result;if(O){const Pe=Ee.find(nt=>nt.native_token);let Ne=Pe?.balance_formatted||"0";try{const nt=await uo({chainId:v,rpcUrl:k});if(nt.isGreaterThan(0)){const dt=nt.times(1e6),Ft=new ce(Pe?.balance||"0").minus(dt);Ft.isGreaterThan(0)?Ne=ce(Ue(BigInt(Ft.toFixed(0)),Pe?.decimals||18)).toFixed():Ne="0"}}catch(nt){console.warn("getGasPrice for swap native fee deduction failed:",nt)}I.amount=fo(I.amount,Ne);const _e=parseFloat(Ne),Xe=parseFloat(I.amount);if(_e<Xe){d(r("swapInsufficientNativeBalance",{balance:_e.toFixed(6),symbol:b?.nativeCurrency?.symbol||"native",amount:I.amount}),"bot"),m(!1);return}}else{const Pe=Ee.find(Xe=>Xe.token_address.toLowerCase()===I.token_in?.toLowerCase());if(!Pe){d(r("swapTokenNotInWallet",{symbol:I.token_in_symbol||I.token_in}),"bot"),m(!1);return}I.amount=fo(I.amount,Pe.balance_formatted||"0");const Ne=parseFloat(Pe.balance_formatted||"0"),_e=parseFloat(I.amount);if(Ne<_e){d(r("swapInsufficientTokenBalance",{balance:Ne.toFixed(6),symbol:Pe.symbol,amount:I.amount}),"bot"),m(!1);return}}}}catch(de){console.warn("Balance check failed:",de)}const $=O?Ge:I.token_in;z({srcTokenAddress:$,descTokenAddress:I.token_out,amount:I.amount,srcTokenDecimals:R,descTokenDecimals:_});const ge=mt(I.amount,R).toString(),Be=await ro({chainId:v,tokenIn:$,tokenInAmount:ge,tokenOut:I.token_out,tokenOutRecipient:i?.address||"",slippage:"auto",accesstoken:"d6c45897b8f6"});if(Be.success&&Be.data){const de=Be.data,Ee=de.tokenIn,Pe=de.tokenOut,Ne=ce(Ue(BigInt(Ee.amount||0),Ee.decimals)).decimalPlaces(6).toFormat(),_e=ce(Ue(BigInt(Pe.amount||0),Pe.decimals)).decimalPlaces(6).toFormat();let Xe=!1;if(!O&&i?.address&&de.tx?.to)try{const Oe=await lo({tokenAddress:$,ownerAddress:i.address,spenderAddress:de.tx.to,chainId:v,rpcUrl:k});Xe=ce(Oe.toString()).isLessThan(ge)}catch(Oe){console.warn("Allowance check failed (CASE 1):",Oe),Xe=!0}const nt=de.estimatedTransactionFee?.total?ce(de.estimatedTransactionFee.total):ce(0);let dt=ce(0);if(Xe&&i?.address)try{const Oe=vn({tokenAddress:$,spenderAddress:de.tx?.to||"",fromAddress:i.address,chainId:v});dt=await sn({from:i.address,to:Oe.to,data:Oe.data,chainId:v,rpcUrl:k})}catch(Oe){console.warn("Approve fee estimation failed:",Oe)}const rt=nt.plus(dt),Ft=b?.nativeCurrency?.symbol||"native";let Ke="",rn=!1;if(i?.address&&rt.isGreaterThan(0))try{const Oe=await kn({address:i.address,chainId:v,rpcUrl:k});if(Oe.isLessThan(rt)){rn=!0;const An=ce(Ue(BigInt(Oe.toFixed(0)),18)).decimalPlaces(6).toFormat(),Tn=ce(Ue(BigInt(rt.toFixed(0)),18)).decimalPlaces(6).toFormat();Ke=r("swapFeeWarning",{symbol:Ft,balance:An,needed:Tn})}}catch(Oe){console.warn("Fee balance check failed:",Oe)}const Gt=`From: ${Ne} ${Ee.symbol}
430
+ ${ie}`);const ye=await Ui({prompt:ie,model:"gpt-4.1-mini",stream:!1,systemPrompt:K+Y});if(ye.success&&ye.data){const re=ye.data.text||"";let J=null;try{let I=re?.trim();I.startsWith("```json")?I=I.replace(/^```json\s*/,"").replace(/\s*```$/,""):I.startsWith("```")&&(I=I.replace(/^```\s*/,"").replace(/\s*```$/,"")),J=JSON.parse(I)}catch{J=null}if(J&&J.action&&J.action!=="chat")if(J.action==="buy_token"){const I=J.parameters?.token_symbol||"";let U=J.parameters?.contract_address||"",Q=18;if(U.toLowerCase()==="native"&&(U=He),U&&U!==He)try{const H=await tt.getTokensDetails([U],g);H?.data?.[0]&&(Q=H.data[0].decimals||18)}catch(H){console.warn("getTokensDetails for buy_token failed:",H)}if(!U&&I&&c?.address)try{const H=await je({address:c.address,chain:w});if(H?.success&&H?.data?.result){const te=H.data.result,we=te.find(ae=>ae.token_address.toLowerCase()===U.toLowerCase())||te.find(ae=>ae.symbol.toUpperCase()===I.toUpperCase());we&&(U=we.token_address,Q=we.decimals)}if(!U){const te=b.tokenTrendingDefault||[],[we,ae]=await Promise.allSettled([tt.getTopGainers(g,"24h",10),tt.getTokensDetails(te,g)]),M=[];we.status==="fulfilled"&&we.value?.data&&M.push(...we.value.data),ae.status==="fulfilled"&&ae.value?.data&&M.push(...ae.value.data);const _=M.find($=>$.address?.toLowerCase()===U.toLowerCase())||M.find($=>$.symbol?.toUpperCase()===I.toUpperCase());_&&(U=_.address,Q=_.decimals||18)}}catch(H){console.warn("Token lookup for buy failed:",H)}U?(d(J.message||`🛒 I'll help you buy ${I}. Let me show your available tokens to trade with.`,"bot",Z.id),await he(U,Q)):(d(J.message||`I couldn't find the token "${I}" on this chain. Here are the trending tokens you can buy:`,"bot",Z.id),await ge())}else if(J.action==="swap_token"){const I={...J.parameters||{}},U=I.token_in==="native"||I.token_in_symbol?.toUpperCase()===b?.nativeCurrency?.symbol?.toUpperCase(),Q=I.token_out==="native"||I.token_out_symbol?.toUpperCase()===b?.nativeCurrency?.symbol?.toUpperCase();if(Q&&(I.token_out=He),!U&&(I.token_in||I.token_in_symbol)&&c?.address)try{const ae=await je({address:c.address,chain:w});if(ae?.success&&ae?.data?.result){const M=ae.data.result,_=I.token_in?M.find($=>$.token_address.toLowerCase()===I.token_in.toLowerCase()):M.find($=>$.symbol.toUpperCase()===I.token_in_symbol.toUpperCase());_&&(I.token_in=_.token_address,I.token_in_decimals=String(_.decimals))}}catch(ae){console.warn("Resolve token_in failed:",ae)}if(!Q&&(I.token_out||I.token_out_symbol)&&c?.address)try{const ae=await je({address:c.address,chain:w});if(ae?.success&&ae?.data?.result){const M=ae.data.result,_=I.token_out?M.find($=>$.token_address.toLowerCase()===I.token_out.toLowerCase()):M.find($=>$.symbol.toUpperCase()===I.token_out_symbol.toUpperCase());_&&(I.token_out=_.token_address,I.token_out_decimals=String(_.decimals))}}catch(ae){console.warn("Resolve token_out failed:",ae)}const H=!!(I.token_in||U),te=!!I.token_out,we=!!I.amount;if(H&&te&&we){d(J.message||"🔄 Preparing your swap...","bot",Z.id);try{const ae=[];I.token_out&&ae.push(I.token_out),I.token_in&&!U&&ae.push(I.token_in);let M=18,_=18;if(ae.length>0)try{const de=await tt.getTokensDetails(ae,g);if(de?.data)for(const Ne of de.data)!U&&Ne.address.toLowerCase()===I.token_in?.toLowerCase()&&(M=Ne.decimals||18),Ne.address.toLowerCase()===I.token_out?.toLowerCase()&&(_=Ne.decimals||18)}catch(de){console.warn("getTokensDetails failed, using default decimals:",de)}if(c?.address)try{const de=await je({address:c.address,chain:w});if(de?.success&&de?.data?.result){const Ne=de.data.result;if(U){const Pe=Ne.find(nt=>nt.native_token);let Ce=Pe?.balance_formatted||"0";try{const nt=await uo({chainId:v,rpcUrl:k});if(nt.isGreaterThan(0)){const dt=nt.times(1e6),Ft=new ce(Pe?.balance||"0").minus(dt);Ft.isGreaterThan(0)?Ce=ce(Oe(BigInt(Ft.toFixed(0)),Pe?.decimals||18)).toFixed():Ce="0"}}catch(nt){console.warn("getGasPrice for swap native fee deduction failed:",nt)}I.amount=fo(I.amount,Ce);const _e=parseFloat(Ce),Xe=parseFloat(I.amount);if(_e<Xe){d(r("swapInsufficientNativeBalance",{balance:_e.toFixed(6),symbol:b?.nativeCurrency?.symbol||"native",amount:I.amount}),"bot"),m(!1);return}}else{const Pe=Ne.find(Xe=>Xe.token_address.toLowerCase()===I.token_in?.toLowerCase());if(!Pe){d(r("swapTokenNotInWallet",{symbol:I.token_in_symbol||I.token_in}),"bot"),m(!1);return}I.amount=fo(I.amount,Pe.balance_formatted||"0");const Ce=parseFloat(Pe.balance_formatted||"0"),_e=parseFloat(I.amount);if(Ce<_e){d(r("swapInsufficientTokenBalance",{balance:Ce.toFixed(6),symbol:Pe.symbol,amount:I.amount}),"bot"),m(!1);return}}}}catch(de){console.warn("Balance check failed:",de)}const $=U?He:I.token_in;z({srcTokenAddress:$,descTokenAddress:I.token_out,amount:I.amount,srcTokenDecimals:M,descTokenDecimals:_});const me=mt(I.amount,M).toString(),xe=await ro({chainId:v,tokenIn:$,tokenInAmount:me,tokenOut:I.token_out,tokenOutRecipient:c?.address||"",slippage:"auto",accesstoken:"d6c45897b8f6"});if(xe.success&&xe.data){const de=xe.data,Ne=de.tokenIn,Pe=de.tokenOut,Ce=ce(Oe(BigInt(Ne.amount||0),Ne.decimals)).decimalPlaces(6).toFormat(),_e=ce(Oe(BigInt(Pe.amount||0),Pe.decimals)).decimalPlaces(6).toFormat();let Xe=!1;if(!U&&c?.address&&de.tx?.to)try{const Ue=await lo({tokenAddress:$,ownerAddress:c.address,spenderAddress:de.tx.to,chainId:v,rpcUrl:k});Xe=ce(Ue.toString()).isLessThan(me)}catch(Ue){console.warn("Allowance check failed (CASE 1):",Ue),Xe=!0}const nt=de.estimatedTransactionFee?.total?ce(de.estimatedTransactionFee.total):ce(0);let dt=ce(0);if(Xe&&c?.address)try{const Ue=vn({tokenAddress:$,spenderAddress:de.tx?.to||"",fromAddress:c.address,chainId:v});dt=await sn({from:c.address,to:Ue.to,data:Ue.data,chainId:v,rpcUrl:k})}catch(Ue){console.warn("Approve fee estimation failed:",Ue)}const rt=nt.plus(dt),Ft=b?.nativeCurrency?.symbol||"native";let Ke="",rn=!1;if(c?.address&&rt.isGreaterThan(0))try{const Ue=await kn({address:c.address,chainId:v,rpcUrl:k});if(Ue.isLessThan(rt)){rn=!0;const An=ce(Oe(BigInt(Ue.toFixed(0)),18)).decimalPlaces(6).toFormat(),Tn=ce(Oe(BigInt(rt.toFixed(0)),18)).decimalPlaces(6).toFormat();Ke=r("swapFeeWarning",{symbol:Ft,balance:An,needed:Tn})}}catch(Ue){console.warn("Fee balance check failed:",Ue)}const Gt=`From: ${Ce} ${Ne.symbol}
427
431
  ⬇️
428
432
  To: ${_e} ${Pe.symbol}
429
433
 
430
434
  `+Ke+`
431
- `;if(rn)d(Gt,"bot");else if(Xe){const Oe=[{id:"approve-for-swap",text:r("swapApproveButton",{symbol:Ee.symbol}),value:r("swapApproveValue",{symbol:Ee.symbol}),action:"approve_for_swap",fullWidth:!0,extraData:{tokenAddress:$,spenderAddress:de.tx.to,tokenSymbol:Ee.symbol,tx:de.tx}}];d(Gt+r("swapNeedApprove",{symbol:Ee.symbol}),"bot",void 0,Oe)}else{const Oe=[{id:"confirm-swap",text:"Yes",value:a("swapConfirmValue"),action:"confirm_swap",extraData:{tx:de.tx}}];d(Gt+a("swapReadyToProceed"),"bot",void 0,Oe)}}else d(r("swapEstimationError",{error:Be.errorMessage||Be.error||"Unknown error"}),"bot")}catch(ae){console.error("Swap estimation error:",ae),d(a("swapEstimationFailed"),"bot")}}else if(H&&te&&!we){let ae=O?18:parseInt(I.token_in_decimals||"18",10),R=parseInt(I.token_out_decimals||"18",10);const _=[];if(I.token_out&&_.push(I.token_out),I.token_in&&!O&&_.push(I.token_in),_.length>0)try{const $=await tt.getTokensDetails(_,g);if($?.data)for(const ge of $.data)!O&&ge.address.toLowerCase()===I.token_in?.toLowerCase()&&(ae=ge.decimals||ae),ge.address.toLowerCase()===I.token_out?.toLowerCase()&&(R=ge.decimals||R)}catch($){console.warn("getTokensDetails failed in CASE 2, using fallback decimals:",$)}if(z({descTokenAddress:I.token_out,descTokenDecimals:R}),O)try{const $=await je({address:i?.address||"",chain:y});if($?.success&&$?.data?.result){const Be=$.data.result.find(_e=>_e.native_token),de=b?.nativeCurrency?.symbol||"ETH";let Ee=Be?.balance_formatted||"0";try{const _e=await uo({chainId:v,rpcUrl:k});if(_e.isGreaterThan(0)){const Xe=_e.times(1e6),dt=new ce(Be?.balance||"0").minus(Xe);dt.isGreaterThan(0)?Ee=ce(Ue(BigInt(dt.toFixed(0)),Be?.decimals||18)).toFixed():Ee="0"}}catch(_e){console.warn("getGasPrice for swap native fee deduction (CASE 2) failed:",_e)}z({srcTokenAddress:Ge,srcTokenDecimals:ae});const Ne=[25,50,75,100].map(_e=>({id:`percent-${_e}`,text:`${_e}%`,value:r("buttonUsePercent",{percent:String(_e),symbol:de}),action:"select_percent",extraData:{percent:_e,tokenAddress:Ge,tokenSymbol:de,tokenBalance:Ee}}));d(r("selectAmountToSwap",{symbol:de,balance:Ee}),"bot",Z.id,Ne)}else d(a("couldNotFetchBalance"),"bot")}catch($){console.warn("Native balance fetch failed:",$),d(a("couldNotFetchBalanceRetry"),"bot")}else{const $=I.token_in_symbol||"Token";z({srcTokenAddress:I.token_in,srcTokenDecimals:ae});try{const ge=await je({address:i?.address||"",chain:y});if(ge?.success&&ge?.data?.result){const de=ge.data.result.find(Ne=>Ne.token_address.toLowerCase()===I.token_in?.toLowerCase());if(!de){d(r("swapTokenNotInWallet",{symbol:$}),"bot"),m(!1);return}const Pe=[25,50,75,100].map(Ne=>({id:`percent-${Ne}`,text:`${Ne}%`,value:r("buttonUsePercent",{percent:String(Ne),symbol:de.symbol}),action:"select_percent",extraData:{percent:Ne,tokenAddress:de.token_address,tokenSymbol:de.symbol,tokenBalance:de.balance_formatted}}));d(r("selectAmountToSwap",{symbol:de.symbol,balance:`${de.balance_formatted} (~$${de.usd_value?.toFixed(2)||"0"})`}),"bot",Z.id,Pe)}else d(a("couldNotFetchBalance"),"bot")}catch(ge){console.warn("Token balance fetch failed:",ge),d(a("couldNotFetchBalanceRetry"),"bot")}}}else if(!H&&te){d(J.message||"🔄 Please choose which token you want to swap from:","bot",Z.id);let ae=parseInt(I.token_out_decimals||"18",10);if(I.token_out)try{const R=await tt.getTokensDetails([I.token_out],g);R?.data?.[0]&&(ae=R.data[0].decimals||ae)}catch(R){console.warn("getTokensDetails failed in CASE 3, using fallback:",R)}await me(I.token_out,ae)}else if(H&&!te){let ae=O?18:parseInt(I.token_in_decimals||"18",10);if(I.token_in&&!O)try{const R=await tt.getTokensDetails([I.token_in],g);R?.data?.[0]&&(ae=R.data[0].decimals||ae)}catch(R){console.warn("getTokensDetails failed in CASE 4, using fallback:",R)}z(O?{srcTokenAddress:Ge,srcTokenDecimals:18}:{srcTokenAddress:I.token_in,srcTokenDecimals:ae}),d(J.message||`🔄 You want to swap ${I.token_in_symbol||"your token"}. Please choose which token you want to receive:`,"bot",Z.id);try{m(!0);const R=b?.tokenTrendingDefault||[],[_,$]=await Promise.allSettled([tt.getTopGainers(g,"24h",5),tt.getTokensDetails(R,g)]);let ge=[];_.status==="fulfilled"&&_.value?.data&&(ge=[..._.value.data]),$.status==="fulfilled"&&$.value?.data&&(ge=[...$.value.data,...ge]),ge=ge.filter((de,Ee,Pe)=>Ee===Pe.findIndex(Ne=>Ne.address.toLowerCase()===de.address.toLowerCase()));const Be=ge.map(de=>({id:de?.symbol,text:de?.symbol,value:r("buttonSwapTo",{name:de.name,symbol:de?.symbol||""}),action:"click_swap_dest_token",extraData:{tokenAddress:de?.address||"",symbol:de?.symbol||"",decimals:de?.decimals||18}}));d(r("trendingTokensForReceive",{chain:b?.name||"Unknown"}),"bot",void 0,Be)}catch(R){console.error("Error fetching trending tokens for swap:",R),d(a("couldNotLoadTokenList"),"bot")}finally{m(!1)}}else d(J.message||'🔄 I need more details for your swap. Please specify which tokens you want to swap (e.g. "Swap 1 ETH to USDC").',"bot",Z.id)}else if(J.action==="view_balances")d(J.message||a("viewBalancesLoading"),"bot",Z.id),await We();else if(J.action==="view_nfts")d(J.message||"🖼️ Let me show you your NFT collection!","bot",Z.id),await xe();else if(J.action==="send_token"&&!J.parameters?.contract_address&&!J.parameters?.token_symbol&&i?.address){d("💰 Which token would you like to send?","bot",Z.id);try{m(!0);const I=await je({address:i.address,chain:y});if(I?.success&&I?.data?.result&&I.data.result.length>0){const Q=I.data.result.map(H=>({id:`send-select-${H.token_address}`,text:`Send ${H.name} (${H.symbol})`,value:`Send ${H.name} (${H.symbol})`,action:"suggested_action",fullWidth:!0}));await ot(500),m(!1),d(r("walletBalanceSpendable",{chain:b?.name||"this chain"}),"bot",void 0,Q)}else m(!1),d(r("walletNoTokensFound",{chain:b?.name||"this chain"}),"bot")}catch(I){console.warn("Failed to fetch balance for send_token picker:",I),m(!1),d(a("walletFetchError"),"bot")}}else if(J.action==="send_nft"&&!J.parameters?.contract_address&&!J.parameters?.token_id&&!J.parameters?.nft_name&&i?.address)d("Which NFT would you like to send?","bot",Z.id),await xe();else if(J.action==="send_nft"&&!Re(J.parameters?.contract_address||"")&&(J.parameters?.nft_name||J.parameters?.token_id)&&i?.address)try{m(!0);const I=await wn({address:i.address,chain:y,limit:100,exclude_spam:!1});if(I?.success&&I?.data?.result){const O=I.data.result,Q=(J.parameters?.nft_name||"").toLowerCase(),H=J.parameters?.token_id||"",te=O.find(we=>{const ae=(we.normalized_metadata?.name||we.name||"").toLowerCase(),R=(we.name||"").toLowerCase(),_=Q&&(ae.includes(Q)||R.includes(Q)),$=H&&we.token_id===H;return Q&&H?_&&$:Q?_:$});if(te){const we=te.normalized_metadata?.name||te.name||`#${te.token_id}`,ae=te.normalized_metadata?.image||te.media?.original_media_url||"",R={contract_address:te.token_address,token_id:te.token_id,to_address:J.parameters?.to_address||"",token_standard:te.contract_type||"",amount:"1",maxAmount:te.amount||"1",nft_name:we};d(J.message||r("nftSendReview",{name:we,standard:te.contract_type||"NFT",tokenId:te.token_id}),"bot",Z.id,void 0,{action:"send_nft",parameters:R,status:"pending",nftInfo:{name:we,image:ae||void 0,tokenId:te.token_id,contractAddress:te.token_address,tokenStandard:te.contract_type||void 0}})}else d(J.message||r("nftNotFoundInWallet",{name:Q||H}),"bot",Z.id),await xe()}else d(a("nftNoCollection"),"bot",Z.id)}catch(I){console.error("NFT lookup by name failed:",I),d(a("nftFetchError"),"bot",Z.id)}finally{m(!1)}else{const I=oc(J.action);let O={...J.parameters||{}},Q,H;const te=["send_token","approve_token"].includes(J.action)&&(O.contract_address||O.token_symbol),we=J.action==="send_native",ae=J.action==="send_nft"&&O.contract_address;if(te&&i?.address)try{const R=await je({address:i.address,chain:y});if(R?.success&&R?.data?.result){const _=R.data.result,$=O.contract_address?_.find(ge=>ge.token_address.toLowerCase()===O.contract_address.toLowerCase()):_.find(ge=>ge.symbol.toUpperCase()===O.token_symbol.toUpperCase());$&&(O={...O,contract_address:$.token_address,decimals:String($.decimals)},Q={symbol:$.symbol,name:$.name,balance:$.balance,balanceFormatted:$.balance_formatted,usdValue:$.usd_value,usdPrice:$.usd_price,decimals:$.decimals,logo:$.logo||$.thumbnail,contractAddress:$.token_address})}}catch(R){console.warn("Token enrichment failed:",R)}if(te&&!Q&&O.contract_address)try{const R=await Ui({address:O.contract_address,chain:y});if(R?.success&&R?.data){const _=R.data;Q={symbol:_.symbol,name:_.name,balance:"0",balanceFormatted:"0",usdPrice:_.usd_price,decimals:_.decimals,logo:_.logo,contractAddress:O.contract_address},O={...O,decimals:String(_.decimals)}}}catch(R){console.warn("Token metadata fallback failed:",R)}if(we&&i?.address)try{const R=await je({address:i.address,chain:y});if(R?.success&&R?.data?.result){const $=R.data.result.find(ge=>ge.native_token);if($){let ge=$.balance_formatted,Be=$.balance;try{const de=new ce($.balance),Ee="0x"+BigInt(de.toFixed(0)).toString(16),Pe=await sn({from:i.address,to:i.address,data:"0x",value:Ee,chainId:v,rpcUrl:k});if(Pe.isGreaterThan(0)){const Ne=de.minus(Pe);Ne.isGreaterThan(0)?(Be=Ne.toFixed(0),ge=ce(Ue(BigInt(Ne.toFixed(0)),$.decimals)).toFixed()):(Be="0",ge="0")}}catch(de){console.warn("Estimate send fee for send_native failed:",de)}Q={symbol:$.symbol,name:$.name,balance:Be,balanceFormatted:ge,usdValue:$.usd_value,usdPrice:$.usd_price,decimals:$.decimals,logo:$.logo||$.thumbnail,contractAddress:Ge}}}}catch(R){console.warn("Native token balance fetch failed:",R)}if(ae){try{const R=await Li({address:O.contract_address,chain:y});if(R?.success&&R?.data){const _=R.data;_.contract_type&&(O={...O,token_standard:_.contract_type}),!O.nft_name&&_.name&&(O={...O,nft_name:_.name})}}catch(R){console.warn("NFT contract metadata fetch failed:",R)}if(i?.address)try{const R=await wn({address:i.address,chain:y,limit:100,exclude_spam:!1});if(R?.success&&R?.data?.result){const _=R.data.result.find($=>$.token_address.toLowerCase()===O.contract_address.toLowerCase()&&$.token_id===O.token_id);if(_){O={...O,amount:"1",maxAmount:_.amount||"1"};const $=_.normalized_metadata?.image||_.media?.original_media_url||"";H={name:_.normalized_metadata?.name||_.name||O.nft_name||`#${_.token_id}`,image:$||void 0,tokenId:_.token_id,contractAddress:_.token_address,tokenStandard:_.contract_type||O.token_standard||void 0}}}}catch(R){console.warn("NFT ownership lookup failed:",R)}}if(O.amount&&Q?.balanceFormatted&&(J.action==="send_token"||J.action==="send_native")&&(O.amount=fo(O.amount,Q.balanceFormatted)),I){const R=J.message||"Please review and complete the form below.";d(R,"bot",Z.id,void 0,{action:J.action,parameters:O,status:"pending",tokenInfo:Q,nftInfo:H})}else d(J.message||re,"bot",Z.id)}else if(J&&J.action==="chat"){const I=J.token_mentions||[],O=J.suggested_actions||[],Q=[];I.length>0&&I.forEach(H=>{Q.push({id:`buy-${H.symbol}`,text:`💰 Buy ${H.symbol}`,value:r("buttonBuySymbol",{symbol:H.symbol}),action:"click_buy_item_token_button",extraData:{tokenAddress:H.contract_address||"",symbol:H.symbol,decimals:H.decimals||18},fullWidth:!0})}),O.length>0&&O.forEach((H,te)=>{Q.push({id:`suggested-${te}-${H.label}`,text:H.label,value:H.prompt,action:"suggested_action",fullWidth:!0})}),Q.length>0?d(J.message||re,"bot",Z.id,Q):d(J.message||re,"bot",Z.id)}else d(re,"bot",Z.id)}else d(a("errorProcessingRequest"),"bot",Z.id)}catch(G){console.error("Error getting AI response:",G),d(a("errorProcessingRequest"),"bot",Z.id)}m(!1),await ot(50),Wt.isDesktop&&fe.current?.focus()},[M,x,l,d,ke,i?.address,b?.name,b?.nativeCurrency?.symbol,b?.tokenTrendingDefault,v,g,y,w,me,be,xe,We,z,k,a,r]);ne.useEffect(()=>{pe.current&&M===pe.current&&(pe.current=null,Fe())},[M,Fe]);const qe=ne.useCallback(async(U,Z,G)=>{try{if(T(G,"submitted"),U==="swap_token"){let ee=18;if(Z.token_in&&Z.token_in!==Ge)try{const Y=await tt.getTokensDetails([Z.token_in],g);Y?.data?.[0]&&(ee=Y.data[0].decimals||18)}catch(Y){console.warn("getTokensDetails failed in ActionForm swap, using default 18:",Y)}const K=mt(Z.amount||"0",ee).toString(),q=await ro({chainId:v,tokenIn:Z.token_in||"",tokenInAmount:K,tokenOut:Z.token_out||"",tokenOutRecipient:i?.address||"",slippage:"auto",accesstoken:"d6c45897b8f6"});if(q.success&&q.data){const Y=q.data,ie=Y.tokenIn,ye=Y.tokenOut,re=ce(Ue(BigInt(ie.amount||0),ie.decimals)).decimalPlaces(6).toFormat(),J=ce(Ue(BigInt(ye.amount||0),ye.decimals)).decimalPlaces(6).toFormat(),I=!Z.token_in||Z.token_in===Ge;let O=!1;if(!I&&i?.address&&Y.tx?.to)try{const $=await lo({tokenAddress:Z.token_in,ownerAddress:i.address,spenderAddress:Y.tx.to,chainId:v,rpcUrl:k});O=ce($.toString()).isLessThan(K)}catch($){console.warn("Allowance check failed in ActionForm swap:",$)}const Q=Y.estimatedTransactionFee?.total?ce(Y.estimatedTransactionFee.total):ce(0);let H=ce(0);if(O&&i?.address)try{const $=vn({tokenAddress:Z.token_in,spenderAddress:Y.tx?.to||"",fromAddress:i.address,chainId:v});H=await sn({from:i.address,to:$.to,data:$.data,chainId:v,rpcUrl:k})}catch($){console.warn("Approve fee estimation failed:",$)}const te=Q.plus(H),we=b?.nativeCurrency?.symbol||"native";let ae="",R=!1;if(i?.address&&te.isGreaterThan(0))try{const $=await kn({address:i.address,chainId:v,rpcUrl:k});if($.isLessThan(te)){R=!0;const ge=ce(Ue(BigInt($.toFixed(0)),18)).decimalPlaces(6).toFormat(),Be=ce(Ue(BigInt(te.toFixed(0)),18)).decimalPlaces(6).toFormat();ae=r("swapFeeWarning",{symbol:we,balance:ge,needed:Be})}}catch($){console.warn("Fee balance check failed:",$)}const _=`From: ${re} ${ie.symbol}
435
+ `;if(rn)d(Gt,"bot");else if(Xe){const Ue=[{id:"approve-for-swap",text:r("swapApproveButton",{symbol:Ne.symbol}),value:r("swapApproveValue",{symbol:Ne.symbol}),action:"approve_for_swap",fullWidth:!0,extraData:{tokenAddress:$,spenderAddress:de.tx.to,tokenSymbol:Ne.symbol,tx:de.tx}}];d(Gt+r("swapNeedApprove",{symbol:Ne.symbol}),"bot",void 0,Ue)}else{const Ue=[{id:"confirm-swap",text:"Yes",value:a("swapConfirmValue"),action:"confirm_swap",extraData:{tx:de.tx}}];d(Gt+a("swapReadyToProceed"),"bot",void 0,Ue)}}else d(r("swapEstimationError",{error:xe.errorMessage||xe.error||"Unknown error"}),"bot")}catch(ae){console.error("Swap estimation error:",ae),d(a("swapEstimationFailed"),"bot")}}else if(H&&te&&!we){let ae=U?18:parseInt(I.token_in_decimals||"18",10),M=parseInt(I.token_out_decimals||"18",10);const _=[];if(I.token_out&&_.push(I.token_out),I.token_in&&!U&&_.push(I.token_in),_.length>0)try{const $=await tt.getTokensDetails(_,g);if($?.data)for(const me of $.data)!U&&me.address.toLowerCase()===I.token_in?.toLowerCase()&&(ae=me.decimals||ae),me.address.toLowerCase()===I.token_out?.toLowerCase()&&(M=me.decimals||M)}catch($){console.warn("getTokensDetails failed in CASE 2, using fallback decimals:",$)}if(z({descTokenAddress:I.token_out,descTokenDecimals:M}),U)try{const $=await je({address:c?.address||"",chain:w});if($?.success&&$?.data?.result){const xe=$.data.result.find(_e=>_e.native_token),de=b?.nativeCurrency?.symbol||"ETH";let Ne=xe?.balance_formatted||"0";try{const _e=await uo({chainId:v,rpcUrl:k});if(_e.isGreaterThan(0)){const Xe=_e.times(1e6),dt=new ce(xe?.balance||"0").minus(Xe);dt.isGreaterThan(0)?Ne=ce(Oe(BigInt(dt.toFixed(0)),xe?.decimals||18)).toFixed():Ne="0"}}catch(_e){console.warn("getGasPrice for swap native fee deduction (CASE 2) failed:",_e)}z({srcTokenAddress:He,srcTokenDecimals:ae});const Ce=[25,50,75,100].map(_e=>({id:`percent-${_e}`,text:`${_e}%`,value:r("buttonUsePercent",{percent:String(_e),symbol:de}),action:"select_percent",extraData:{percent:_e,tokenAddress:He,tokenSymbol:de,tokenBalance:Ne}}));d(r("selectAmountToSwap",{symbol:de,balance:Ne}),"bot",Z.id,Ce)}else d(a("couldNotFetchBalance"),"bot")}catch($){console.warn("Native balance fetch failed:",$),d(a("couldNotFetchBalanceRetry"),"bot")}else{const $=I.token_in_symbol||"Token";z({srcTokenAddress:I.token_in,srcTokenDecimals:ae});try{const me=await je({address:c?.address||"",chain:w});if(me?.success&&me?.data?.result){const de=me.data.result.find(Ce=>Ce.token_address.toLowerCase()===I.token_in?.toLowerCase());if(!de){d(r("swapTokenNotInWallet",{symbol:$}),"bot"),m(!1);return}const Pe=[25,50,75,100].map(Ce=>({id:`percent-${Ce}`,text:`${Ce}%`,value:r("buttonUsePercent",{percent:String(Ce),symbol:de.symbol}),action:"select_percent",extraData:{percent:Ce,tokenAddress:de.token_address,tokenSymbol:de.symbol,tokenBalance:de.balance_formatted}}));d(r("selectAmountToSwap",{symbol:de.symbol,balance:`${de.balance_formatted} (~$${de.usd_value?.toFixed(2)||"0"})`}),"bot",Z.id,Pe)}else d(a("couldNotFetchBalance"),"bot")}catch(me){console.warn("Token balance fetch failed:",me),d(a("couldNotFetchBalanceRetry"),"bot")}}}else if(!H&&te){d(J.message||"🔄 Please choose which token you want to swap from:","bot",Z.id);let ae=parseInt(I.token_out_decimals||"18",10);if(I.token_out)try{const M=await tt.getTokensDetails([I.token_out],g);M?.data?.[0]&&(ae=M.data[0].decimals||ae)}catch(M){console.warn("getTokensDetails failed in CASE 3, using fallback:",M)}await he(I.token_out,ae)}else if(H&&!te){let ae=U?18:parseInt(I.token_in_decimals||"18",10);if(I.token_in&&!U)try{const M=await tt.getTokensDetails([I.token_in],g);M?.data?.[0]&&(ae=M.data[0].decimals||ae)}catch(M){console.warn("getTokensDetails failed in CASE 4, using fallback:",M)}z(U?{srcTokenAddress:He,srcTokenDecimals:18}:{srcTokenAddress:I.token_in,srcTokenDecimals:ae}),d(J.message||`🔄 You want to swap ${I.token_in_symbol||"your token"}. Please choose which token you want to receive:`,"bot",Z.id);try{m(!0);const M=b?.tokenTrendingDefault||[],[_,$]=await Promise.allSettled([tt.getTopGainers(g,"24h",5),tt.getTokensDetails(M,g)]);let me=[];_.status==="fulfilled"&&_.value?.data&&(me=[..._.value.data]),$.status==="fulfilled"&&$.value?.data&&(me=[...$.value.data,...me]),me=me.filter((de,Ne,Pe)=>Ne===Pe.findIndex(Ce=>Ce.address.toLowerCase()===de.address.toLowerCase()));const xe=me.map(de=>({id:de?.symbol,text:de?.symbol,value:r("buttonSwapTo",{name:de.name,symbol:de?.symbol||""}),action:"click_swap_dest_token",extraData:{tokenAddress:de?.address||"",symbol:de?.symbol||"",decimals:de?.decimals||18}}));d(r("trendingTokensForReceive",{chain:b?.name||"Unknown"}),"bot",void 0,xe)}catch(M){console.error("Error fetching trending tokens for swap:",M),d(a("couldNotLoadTokenList"),"bot")}finally{m(!1)}}else d(J.message||'🔄 I need more details for your swap. Please specify which tokens you want to swap (e.g. "Swap 1 ETH to USDC").',"bot",Z.id)}else if(J.action==="view_balances")d(J.message||a("viewBalancesLoading"),"bot",Z.id),await Ve();else if(J.action==="view_nfts")d(J.message||"🖼️ Let me show you your NFT collection!","bot",Z.id),await Ee();else if(J.action==="send_token"&&!J.parameters?.contract_address&&!J.parameters?.token_symbol&&c?.address){d("💰 Which token would you like to send?","bot",Z.id);try{m(!0);const I=await je({address:c.address,chain:w});if(I?.success&&I?.data?.result&&I.data.result.length>0){const Q=I.data.result.map(H=>({id:`send-select-${H.token_address}`,text:`Send ${H.name} (${H.symbol})`,value:`Send ${H.name} (${H.symbol})`,action:"suggested_action",fullWidth:!0}));await ot(500),m(!1),d(r("walletBalanceSpendable",{chain:b?.name||"this chain"}),"bot",void 0,Q)}else m(!1),d(r("walletNoTokensFound",{chain:b?.name||"this chain"}),"bot")}catch(I){console.warn("Failed to fetch balance for send_token picker:",I),m(!1),d(a("walletFetchError"),"bot")}}else if(J.action==="send_nft"&&!J.parameters?.contract_address&&!J.parameters?.token_id&&!J.parameters?.nft_name&&c?.address)d("Which NFT would you like to send?","bot",Z.id),await Ee();else if(J.action==="send_nft"&&!Re(J.parameters?.contract_address||"")&&(J.parameters?.nft_name||J.parameters?.token_id)&&c?.address)try{m(!0);const I=await wn({address:c.address,chain:w,limit:100,exclude_spam:!1});if(I?.success&&I?.data?.result){const U=I.data.result,Q=(J.parameters?.nft_name||"").toLowerCase(),H=J.parameters?.token_id||"",te=U.find(we=>{const ae=(we.normalized_metadata?.name||we.name||"").toLowerCase(),M=(we.name||"").toLowerCase(),_=Q&&(ae.includes(Q)||M.includes(Q)),$=H&&we.token_id===H;return Q&&H?_&&$:Q?_:$});if(te){const we=te.normalized_metadata?.name||te.name||`#${te.token_id}`,ae=te.normalized_metadata?.image||te.media?.original_media_url||"",M={contract_address:te.token_address,token_id:te.token_id,to_address:J.parameters?.to_address||"",token_standard:te.contract_type||"",amount:"1",maxAmount:te.amount||"1",nft_name:we};d(J.message||r("nftSendReview",{name:we,standard:te.contract_type||"NFT",tokenId:te.token_id}),"bot",Z.id,void 0,{action:"send_nft",parameters:M,status:"pending",nftInfo:{name:we,image:ae||void 0,tokenId:te.token_id,contractAddress:te.token_address,tokenStandard:te.contract_type||void 0}})}else d(J.message||r("nftNotFoundInWallet",{name:Q||H}),"bot",Z.id),await Ee()}else d(a("nftNoCollection"),"bot",Z.id)}catch(I){console.error("NFT lookup by name failed:",I),d(a("nftFetchError"),"bot",Z.id)}finally{m(!1)}else{const I=oc(J.action);let U={...J.parameters||{}},Q,H;const te=["send_token","approve_token"].includes(J.action)&&(U.contract_address||U.token_symbol),we=J.action==="send_native",ae=J.action==="send_nft"&&U.contract_address;if(te&&c?.address)try{const M=await je({address:c.address,chain:w});if(M?.success&&M?.data?.result){const _=M.data.result,$=U.contract_address?_.find(me=>me.token_address.toLowerCase()===U.contract_address.toLowerCase()):_.find(me=>me.symbol.toUpperCase()===U.token_symbol.toUpperCase());$&&(U={...U,contract_address:$.token_address,decimals:String($.decimals)},Q={symbol:$.symbol,name:$.name,balance:$.balance,balanceFormatted:$.balance_formatted,usdValue:$.usd_value,usdPrice:$.usd_price,decimals:$.decimals,logo:$.logo||$.thumbnail,contractAddress:$.token_address})}}catch(M){console.warn("Token enrichment failed:",M)}if(te&&!Q&&U.contract_address)try{const M=await As({address:U.contract_address,chain:w});if(M?.success&&M?.data){const _=M.data;Q={symbol:_.symbol,name:_.name,balance:"0",balanceFormatted:"0",usdPrice:_.usd_price,decimals:_.decimals,logo:_.logo,contractAddress:U.contract_address},U={...U,decimals:String(_.decimals)}}}catch(M){console.warn("Token metadata fallback failed:",M)}if(we&&c?.address)try{const M=await je({address:c.address,chain:w});if(M?.success&&M?.data?.result){const $=M.data.result.find(me=>me.native_token);if($){let me=$.balance_formatted,xe=$.balance;try{const de=new ce($.balance),Ne="0x"+BigInt(de.toFixed(0)).toString(16),Pe=await sn({from:c.address,to:c.address,data:"0x",value:Ne,chainId:v,rpcUrl:k});if(Pe.isGreaterThan(0)){const Ce=de.minus(Pe);Ce.isGreaterThan(0)?(xe=Ce.toFixed(0),me=ce(Oe(BigInt(Ce.toFixed(0)),$.decimals)).toFixed()):(xe="0",me="0")}}catch(de){console.warn("Estimate send fee for send_native failed:",de)}Q={symbol:$.symbol,name:$.name,balance:xe,balanceFormatted:me,usdValue:$.usd_value,usdPrice:$.usd_price,decimals:$.decimals,logo:$.logo||$.thumbnail,contractAddress:He}}else{const me=await As({address:He,chain:w});if(me?.success&&me?.data){const xe=me.data;Q={symbol:xe.symbol,name:xe.name,balance:"0",balanceFormatted:"0",usdValue:0,usdPrice:xe.usd_price,decimals:xe.decimals,logo:xe.logo||xe.thumbnail,contractAddress:He}}}}}catch(M){console.warn("Native token balance fetch failed:",M)}if(ae){try{const M=await Li({address:U.contract_address,chain:w});if(M?.success&&M?.data){const _=M.data;_.contract_type&&(U={...U,token_standard:_.contract_type}),!U.nft_name&&_.name&&(U={...U,nft_name:_.name})}}catch(M){console.warn("NFT contract metadata fetch failed:",M)}if(c?.address)try{const M=await wn({address:c.address,chain:w,limit:100,exclude_spam:!1});if(M?.success&&M?.data?.result){const _=M.data.result.find($=>$.token_address.toLowerCase()===U.contract_address.toLowerCase()&&$.token_id===U.token_id);if(_){U={...U,amount:"1",maxAmount:_.amount||"1"};const $=_.normalized_metadata?.image||_.media?.original_media_url||"";H={name:_.normalized_metadata?.name||_.name||U.nft_name||`#${_.token_id}`,image:$||void 0,tokenId:_.token_id,contractAddress:_.token_address,tokenStandard:_.contract_type||U.token_standard||void 0}}}}catch(M){console.warn("NFT ownership lookup failed:",M)}}if(U.amount&&Q?.balanceFormatted&&(J.action==="send_token"||J.action==="send_native")&&(U.amount=fo(U.amount,Q.balanceFormatted)),I){const M=J.message||"Please review and complete the form below.";d(M,"bot",Z.id,void 0,{action:J.action,parameters:U,status:"pending",tokenInfo:Q,nftInfo:H})}else d(J.message||re,"bot",Z.id)}else if(J&&J.action==="chat"){const I=J.token_mentions||[],U=J.suggested_actions||[],Q=[];I.length>0&&I.forEach(H=>{Q.push({id:`buy-${H.symbol}`,text:`💰 Buy ${H.symbol}`,value:r("buttonBuySymbol",{symbol:H.symbol}),action:"click_buy_item_token_button",extraData:{tokenAddress:H.contract_address||"",symbol:H.symbol,decimals:H.decimals||18},fullWidth:!0})}),U.length>0&&U.forEach((H,te)=>{Q.push({id:`suggested-${te}-${H.label}`,text:H.label,value:H.prompt,action:"suggested_action",fullWidth:!0})}),Q.length>0?d(J.message||re,"bot",Z.id,Q):d(J.message||re,"bot",Z.id)}else d(re,"bot",Z.id)}else d(a("errorProcessingRequest"),"bot",Z.id)}catch(G){console.error("Error getting AI response:",G),d(a("errorProcessingRequest"),"bot",Z.id)}m(!1),await ot(50),Wt.isDesktop&&fe.current?.focus()},[R,x,i,d,ke,c?.address,b?.name,b?.nativeCurrency?.symbol,b?.tokenTrendingDefault,v,g,w,y,he,ge,Ee,Ve,z,k,a,r]);ne.useEffect(()=>{pe.current&&R===pe.current&&(pe.current=null,Fe())},[R,Fe]);const qe=ne.useCallback(async(O,Z,G)=>{try{if(T(G,"submitted"),O==="swap_token"){let ee=18;if(Z.token_in&&Z.token_in!==He)try{const Y=await tt.getTokensDetails([Z.token_in],g);Y?.data?.[0]&&(ee=Y.data[0].decimals||18)}catch(Y){console.warn("getTokensDetails failed in ActionForm swap, using default 18:",Y)}const K=mt(Z.amount||"0",ee).toString(),q=await ro({chainId:v,tokenIn:Z.token_in||"",tokenInAmount:K,tokenOut:Z.token_out||"",tokenOutRecipient:c?.address||"",slippage:"auto",accesstoken:"d6c45897b8f6"});if(q.success&&q.data){const Y=q.data,ie=Y.tokenIn,ye=Y.tokenOut,re=ce(Oe(BigInt(ie.amount||0),ie.decimals)).decimalPlaces(6).toFormat(),J=ce(Oe(BigInt(ye.amount||0),ye.decimals)).decimalPlaces(6).toFormat(),I=!Z.token_in||Z.token_in===He;let U=!1;if(!I&&c?.address&&Y.tx?.to)try{const $=await lo({tokenAddress:Z.token_in,ownerAddress:c.address,spenderAddress:Y.tx.to,chainId:v,rpcUrl:k});U=ce($.toString()).isLessThan(K)}catch($){console.warn("Allowance check failed in ActionForm swap:",$)}const Q=Y.estimatedTransactionFee?.total?ce(Y.estimatedTransactionFee.total):ce(0);let H=ce(0);if(U&&c?.address)try{const $=vn({tokenAddress:Z.token_in,spenderAddress:Y.tx?.to||"",fromAddress:c.address,chainId:v});H=await sn({from:c.address,to:$.to,data:$.data,chainId:v,rpcUrl:k})}catch($){console.warn("Approve fee estimation failed:",$)}const te=Q.plus(H),we=b?.nativeCurrency?.symbol||"native";let ae="",M=!1;if(c?.address&&te.isGreaterThan(0))try{const $=await kn({address:c.address,chainId:v,rpcUrl:k});if($.isLessThan(te)){M=!0;const me=ce(Oe(BigInt($.toFixed(0)),18)).decimalPlaces(6).toFormat(),xe=ce(Oe(BigInt(te.toFixed(0)),18)).decimalPlaces(6).toFormat();ae=r("swapFeeWarning",{symbol:we,balance:me,needed:xe})}}catch($){console.warn("Fee balance check failed:",$)}const _=`From: ${re} ${ie.symbol}
432
436
  ⬇️
433
437
  To: ${J} ${ye.symbol}
434
438
 
435
439
  `+ae+`
436
- `;if(R)T(G,"fail"),d(_,"bot");else if(O){const $=[{id:"approve-swap-actionform",text:r("swapApproveButton",{symbol:ie.symbol}),value:r("swapApproveValue",{symbol:ie.symbol}),action:"approve_for_swap",extraData:{tokenAddress:Z.token_in,spenderAddress:Y.tx.to,tokenSymbol:ie.symbol,tx:Y.tx},fullWidth:!0}];T(G,"success"),d(_+r("swapApprovalRequired",{symbol:ie.symbol}),"bot",void 0,$)}else{const $=[{id:"confirm-swap-actionform",text:"Yes",value:a("swapConfirmValue"),action:"confirm_swap",extraData:{tx:Y.tx}}];T(G,"success"),d(_+a("swapReadyToProceed"),"bot",void 0,$)}}else T(G,"fail"),d(r("swapEstimationError",{error:q.errorMessage||q.error||"Unknown error"}),"bot")}else{const ee=Ki({action:U,parameters:Z,fromAddress:i?.address||"",chainId:v||1}),K={from:ee.from,to:ee.to,data:ee.data,value:ee.value,chainId:ee.chainId};if((U==="send_token"||U==="send_native"||U==="send_nft")&&i?.address)try{const q=b?.nativeCurrency?.symbol||"native",Y=await sn({from:ee.from,to:ee.to,data:ee.data,value:ee.value&&ee.value!=="0"?`0x${BigInt(ee.value).toString(16)}`:void 0,chainId:v,rpcUrl:k});if(Y.isGreaterThan(0)){const ie=await kn({address:i.address,chainId:v,rpcUrl:k});if(ie.isLessThan(Y)){const ye=ce(Ue(BigInt(ie.toFixed(0)),18)).decimalPlaces(6).toFormat(),re=ce(Ue(BigInt(Y.toFixed(0)),18)).decimalPlaces(6).toFormat();T(G,"fail"),d(r("txInsufficientGas",{symbol:q,balance:ye,fee:re}),"bot");return}}}catch(q){console.warn("Pre-execution fee check failed:",q)}if(n){m(!1);const q=await n(K);if(q.status==="success"&&q.transactionHash){const Y=b?.blockExplorers?.default?.url,ie=Y?`
440
+ `;if(M)T(G,"fail"),d(_,"bot");else if(U){const $=[{id:"approve-swap-actionform",text:r("swapApproveButton",{symbol:ie.symbol}),value:r("swapApproveValue",{symbol:ie.symbol}),action:"approve_for_swap",extraData:{tokenAddress:Z.token_in,spenderAddress:Y.tx.to,tokenSymbol:ie.symbol,tx:Y.tx},fullWidth:!0}];T(G,"success"),d(_+r("swapApprovalRequired",{symbol:ie.symbol}),"bot",void 0,$)}else{const $=[{id:"confirm-swap-actionform",text:"Yes",value:a("swapConfirmValue"),action:"confirm_swap",extraData:{tx:Y.tx}}];T(G,"success"),d(_+a("swapReadyToProceed"),"bot",void 0,$)}}else T(G,"fail"),d(r("swapEstimationError",{error:q.errorMessage||q.error||"Unknown error"}),"bot")}else{const ee=Ki({action:O,parameters:Z,fromAddress:c?.address||"",chainId:v||1}),K={from:ee.from,to:ee.to,data:ee.data,value:ee.value,chainId:ee.chainId};if((O==="send_token"||O==="send_native"||O==="send_nft")&&c?.address)try{const q=b?.nativeCurrency?.symbol||"native",Y=await sn({from:ee.from,to:ee.to,data:ee.data,value:ee.value&&ee.value!=="0"?`0x${BigInt(ee.value).toString(16)}`:void 0,chainId:v,rpcUrl:k});if(Y.isGreaterThan(0)){const ie=await kn({address:c.address,chainId:v,rpcUrl:k});if(ie.isLessThan(Y)){const ye=ce(Oe(BigInt(ie.toFixed(0)),18)).decimalPlaces(6).toFormat(),re=ce(Oe(BigInt(Y.toFixed(0)),18)).decimalPlaces(6).toFormat();T(G,"fail"),d(r("txInsufficientGas",{symbol:q,balance:ye,fee:re}),"bot");return}}}catch(q){console.warn("Pre-execution fee check failed:",q)}if(n){m(!1);const q=await n(K);if(q.status==="success"&&q.transactionHash){const Y=b?.blockExplorers?.default?.url,ie=Y?`
437
441
  [View on Explorer](${Y}/tx/${q.transactionHash})`:`
438
- Tx: ${q.transactionHash}`,ye=d(a("txSubmitted")+ie,"bot");try{await ot(2e3),(await co({transactionHash:q.transactionHash,chainId:v||1,rpcUrl:k})).status==="success"?(T(G,"success"),C(ye.id,a("txConfirmed")+ie)):(T(G,"fail"),C(ye.id,a("txReverted")+ie))}catch(re){console.warn("Transaction tracking timeout:",re),T(G,"success"),d(a("txTimeout")+ie,"bot")}}else if(q.status==="success")T(G,"success"),d(a("txSuccessful"),"bot");else{T(G,"fail");const Y=q.error?`
439
- Error: ${q.error}`:"";d(a("txFailed")+Y,"bot")}}else T(G,"fail"),d(a("txNoHandler"),"bot")}}catch(ee){console.error("Action form submit error:",ee),T(G,"fail"),d(r("txError",{message:ee instanceof Error?ee.message:"Unknown error"}),"bot")}},[T,v,i?.address,g,d,n,b?.blockExplorers?.default?.url,b?.nativeCurrency?.symbol,C,k,a,r]),Me=ne.useCallback(U=>{T(U,"fail")},[T]),[De,Te]=ne.useState({}),Pt=ne.useCallback(async(U,Z,G)=>{Te(ee=>({...ee,[G]:!0}));try{await qe(U,Z,G)}finally{Te(ee=>({...ee,[G]:!1}))}},[qe]),Vt=ne.useCallback(U=>{U.key==="Enter"&&!U.shiftKey&&(U.preventDefault(),Fe())},[Fe]),bt=ne.useCallback(()=>{const U=window.getSelection();U&&U.toString().length>0||t()},[t]);return e?P.jsx("div",{className:`chat-modal-overlay${o==="bottom-left"?" chat-modal-overlay--left":""}`,onClick:bt,role:"dialog","aria-modal":"true","aria-labelledby":"chat-modal-title",children:P.jsxs("div",{className:"chat-modal",style:s,onClick:U=>U.stopPropagation(),children:[P.jsxs("div",{className:"chat-modal-header",children:[P.jsxs("div",{className:"chat-modal-header-left",children:[P.jsx("div",{className:"keyring-logo",children:P.jsx("img",{src:Mi,alt:"Keyring Logo",width:40,height:40})}),P.jsx("h3",{id:"chat-modal-title",children:a("chatTitle")})]}),P.jsx("button",{className:"close-button",onClick:t,"aria-label":a("closeChat"),type:"button",children:P.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:P.jsx("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),P.jsx(Ti,{address:i?.address,chainId:b?.chainId}),P.jsxs("div",{className:"chat-modal-messages-wrapper",children:[P.jsxs("div",{className:"chat-modal-messages",ref:X,role:"log","aria-live":"polite",children:[l.map((U,Z)=>P.jsxs("div",{children:[Je(Z)&&P.jsx("div",{className:"date-separator",children:bi(U.timestamp)}),P.jsxs("div",{className:`message ${U.sender==="user"?"message-user":"message-bot"}`,role:"article",children:[P.jsx("button",{className:"message-reply-button",onClick:()=>se(U),"aria-label":a("replyToMessage"),type:"button",children:P.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:P.jsx("path",{d:"M3.5 8.5L1 6L3.5 3.5M1.5 6H10C12.2091 6 14 7.79086 14 10V13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),P.jsxs("div",{className:"message-bubble",children:[U.replyTo&&P.jsxs("div",{className:"message-reply-to",children:[P.jsxs("div",{className:"message-reply-to-label",children:[a("replyingTo")," ",U.replyTo.sender==="user"?a("replyingToYou"):a("replyingToAgent")]}),P.jsx("div",{className:"message-reply-to-text",children:U.replyTo.text})]}),P.jsx("div",{className:"message-text",children:P.jsx(Vi,{content:U.text})}),U.buttons&&U.buttons.length>0&&P.jsx("div",{className:"message-buttons",children:U.buttons.map(G=>P.jsx("button",{className:`message-button ${G.fullWidth?"full-width":""} ${G.action==="suggested_action"?"suggested-action":""}`,onClick:()=>j(G.value,G.action,G?.extraData),type:"button",children:G.text},G.id))}),U.actionData&&U.actionData.status==="pending"&&P.jsx(qi,{action:U.actionData.action,initialValues:U.actionData.parameters,onSubmit:(G,ee)=>Pt(G,ee,U.id),onCancel:()=>Me(U.id),isSubmitting:De[U.id]||!1,tokenInfo:U.actionData.tokenInfo,nftInfo:U.actionData.nftInfo}),U.actionData&&U.actionData.status==="submitted"&&P.jsx("div",{className:"action-status action-status-submitted",children:a("actionProcessing")}),U.actionData&&U.actionData.status==="success"&&P.jsx("div",{className:"action-status action-status-success",children:a("actionSuccess")}),U.actionData&&U.actionData.status==="fail"&&P.jsx("div",{className:"action-status action-status-fail",children:a("actionFail")}),P.jsxs("div",{className:"message-timestamp",children:[U.timestamp.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1}),U.sender==="user"&&P.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"check-icon",children:P.jsx("path",{d:"M13.3333 4L6 11.3333L2.66667 8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})]})]})]},U.id)),x&&P.jsx("div",{className:"message message-bot typing-indicator",role:"status","aria-label":a("botIsTyping"),children:P.jsxs("div",{className:"message-bubble",children:[P.jsx("span",{className:"typing-dot"}),P.jsx("span",{className:"typing-dot"}),P.jsx("span",{className:"typing-dot"})]})}),(B||l.length===1)&&P.jsxs(P.Fragment,{children:[P.jsx("div",{className:"message message-bot",role:"article",children:P.jsx("div",{className:"message-bubble",children:P.jsx("div",{className:"message-text",children:a("canIHelpYou")})})}),P.jsx("div",{className:"suggestions-container",children:at.map(U=>P.jsxs("button",{className:"suggestion-button",onClick:U.action,type:"button",children:[P.jsx("span",{className:"suggestion-icon",children:U.icon}),P.jsx("span",{className:"suggestion-text",children:U.text})]},U.id))})]}),P.jsx("div",{ref:V})]}),P.jsx(Yi,{scrollContainerRef:X})]}),P.jsxs("div",{className:"chat-modal-input",children:[ke&&P.jsxs("div",{className:"reply-preview",children:[P.jsxs("div",{className:"reply-preview-content",children:[P.jsxs("div",{className:"reply-preview-label",children:[a("replyingTo")," ",ke.sender==="user"?a("replyingToYou"):a("replyingToAgent")]}),P.jsx("div",{className:"reply-preview-text",children:ke.text})]}),P.jsx("button",{className:"reply-preview-close",onClick:()=>N(null),"aria-label":a("cancelReply"),type:"button",children:P.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:P.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}),P.jsxs("div",{className:"chat-modal-input-row",children:[P.jsx("input",{ref:fe,type:"text",placeholder:a("messagePlaceholder"),value:M,onChange:U=>h(U.target.value),onKeyPress:Vt,disabled:x,"aria-label":"Message input"}),P.jsx("button",{className:"send-button",onClick:Fe,"aria-label":a("sendMessage"),disabled:x||M?.trim()==="",type:"button",children:P.jsx("img",{src:Ri,alt:"Send",width:44,height:44})})]})]})]})}):null},lc=({position:e,theme:t,defaultOpen:n,onOpen:o,onClose:s,onTransaction:a})=>{const[r,l]=ne.useState(n);ne.useEffect(()=>{n&&o&&o()},[]),ne.useEffect(()=>{if(typeof window>"u")return;const h=document.body,x=document.documentElement,m=h.style.overscrollBehavior,B=x.style.overscrollBehavior,L=h.style.overflow;return r&&(h.style.overscrollBehavior="none",x.style.overscrollBehavior="none",h.style.overflow="hidden"),()=>{h.style.overscrollBehavior=m,x.style.overscrollBehavior=B,h.style.overflow=L}},[r]);const d=ne.useCallback(()=>{l(!0),o?.()},[o]),T=ne.useCallback(()=>{l(!1),s?.()},[s]),C=ne.useCallback(()=>{r?T():d()},[r,d,T]),M={position:"fixed",[e==="bottom-right"?"right":"left"]:"20px",bottom:"20px",zIndex:t.zIndex??9999};return P.jsxs("div",{style:M,role:"complementary","aria-label":"Chat widget",children:[P.jsx(Vs,{onClick:C}),P.jsx(cc,{isOpen:r,onClose:T,onTransaction:a,position:e,modalChatStyle:t.modalChatStyle})]})},dc=({position:e="bottom-right",theme:t={},defaultOpen:n=!1,onOpen:o,onClose:s,account:a,onTransaction:r,language:l="en",rpcUrls:d})=>{const T={position:e,theme:t,rpcUrls:d};return typeof window>"u"?null:P.jsx(Pi,{initialConfig:T,children:P.jsx(Ai,{initialAccount:a,children:P.jsx(Ws,{initialLanguage:l,children:P.jsx(lc,{position:e,theme:t,defaultOpen:n,onOpen:o,onClose:s,onTransaction:r})})})})};gt.ChatWidget=dc,Object.defineProperty(gt,Symbol.toStringTag,{value:"Module"})}));
442
+ Tx: ${q.transactionHash}`,ye=d(a("txSubmitted")+ie,"bot");try{await ot(2e3),(await co({transactionHash:q.transactionHash,chainId:v||1,rpcUrl:k})).status==="success"?(T(G,"success"),B(ye.id,a("txConfirmed")+ie)):(T(G,"fail"),B(ye.id,a("txReverted")+ie))}catch(re){console.warn("Transaction tracking timeout:",re),T(G,"success"),d(a("txTimeout")+ie,"bot")}}else if(q.status==="success")T(G,"success"),d(a("txSuccessful"),"bot");else{T(G,"fail");const Y=q.error?`
443
+ Error: ${q.error}`:"";d(a("txFailed")+Y,"bot")}}else T(G,"fail"),d(a("txNoHandler"),"bot")}}catch(ee){console.error("Action form submit error:",ee),T(G,"fail"),d(r("txError",{message:ee instanceof Error?ee.message:"Unknown error"}),"bot")}},[T,v,c?.address,g,d,n,b?.blockExplorers?.default?.url,b?.nativeCurrency?.symbol,B,k,a,r]),Me=ne.useCallback(O=>{T(O,"fail")},[T]),[De,Te]=ne.useState({}),Pt=ne.useCallback(async(O,Z,G)=>{Te(ee=>({...ee,[G]:!0}));try{await qe(O,Z,G)}finally{Te(ee=>({...ee,[G]:!1}))}},[qe]),Vt=ne.useCallback(O=>{O.key==="Enter"&&!O.shiftKey&&(O.preventDefault(),Fe())},[Fe]),bt=ne.useCallback(()=>{const O=window.getSelection();O&&O.toString().length>0||t()},[t]);return e?P.jsx("div",{className:`chat-modal-overlay${o==="bottom-left"?" chat-modal-overlay--left":""}`,onClick:bt,role:"dialog","aria-modal":"true","aria-labelledby":"chat-modal-title",children:P.jsxs("div",{className:"chat-modal",style:s,onClick:O=>O.stopPropagation(),children:[P.jsxs("div",{className:"chat-modal-header",children:[P.jsxs("div",{className:"chat-modal-header-left",children:[P.jsx("div",{className:"keyring-logo",children:P.jsx("img",{src:Mi,alt:"Keyring Logo",width:40,height:40})}),P.jsx("h3",{id:"chat-modal-title",children:a("chatTitle")})]}),P.jsx("button",{className:"close-button",onClick:t,"aria-label":a("closeChat"),type:"button",children:P.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:P.jsx("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),P.jsx(xi,{address:c?.address,chainId:b?.chainId}),P.jsxs("div",{className:"chat-modal-messages-wrapper",children:[P.jsxs("div",{className:"chat-modal-messages",ref:X,role:"log","aria-live":"polite",children:[i.map((O,Z)=>P.jsxs("div",{children:[Je(Z)&&P.jsx("div",{className:"date-separator",children:gi(O.timestamp)}),P.jsxs("div",{className:`message ${O.sender==="user"?"message-user":"message-bot"}`,role:"article",children:[P.jsx("button",{className:"message-reply-button",onClick:()=>se(O),"aria-label":a("replyToMessage"),type:"button",children:P.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:P.jsx("path",{d:"M3.5 8.5L1 6L3.5 3.5M1.5 6H10C12.2091 6 14 7.79086 14 10V13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),P.jsxs("div",{className:"message-bubble",children:[O.replyTo&&P.jsxs("div",{className:"message-reply-to",children:[P.jsxs("div",{className:"message-reply-to-label",children:[a("replyingTo")," ",O.replyTo.sender==="user"?a("replyingToYou"):a("replyingToAgent")]}),P.jsx("div",{className:"message-reply-to-text",children:O.replyTo.text})]}),P.jsx("div",{className:"message-text",children:P.jsx(Vi,{content:O.text})}),O.buttons&&O.buttons.length>0&&P.jsx("div",{className:"message-buttons",children:O.buttons.map(G=>P.jsx("button",{className:`message-button ${G.fullWidth?"full-width":""} ${G.action==="suggested_action"?"suggested-action":""}`,onClick:()=>j(G.value,G.action,G?.extraData),type:"button",children:G.text},G.id))}),O.actionData&&O.actionData.status==="pending"&&P.jsx(qi,{action:O.actionData.action,initialValues:O.actionData.parameters,onSubmit:(G,ee)=>Pt(G,ee,O.id),onCancel:()=>Me(O.id),isSubmitting:De[O.id]||!1,tokenInfo:O.actionData.tokenInfo,nftInfo:O.actionData.nftInfo}),O.actionData&&O.actionData.status==="submitted"&&P.jsx("div",{className:"action-status action-status-submitted",children:a("actionProcessing")}),O.actionData&&O.actionData.status==="success"&&P.jsx("div",{className:"action-status action-status-success",children:a("actionSuccess")}),O.actionData&&O.actionData.status==="fail"&&P.jsx("div",{className:"action-status action-status-fail",children:a("actionFail")}),P.jsxs("div",{className:"message-timestamp",children:[O.timestamp.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1}),O.sender==="user"&&P.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"check-icon",children:P.jsx("path",{d:"M13.3333 4L6 11.3333L2.66667 8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})]})]})]},O.id)),x&&P.jsx("div",{className:"message message-bot typing-indicator",role:"status","aria-label":a("botIsTyping"),children:P.jsxs("div",{className:"message-bubble",children:[P.jsx("span",{className:"typing-dot"}),P.jsx("span",{className:"typing-dot"}),P.jsx("span",{className:"typing-dot"})]})}),(C||i.length===1)&&P.jsxs(P.Fragment,{children:[P.jsx("div",{className:"message message-bot",role:"article",children:P.jsx("div",{className:"message-bubble",children:P.jsx("div",{className:"message-text",children:a("canIHelpYou")})})}),P.jsx("div",{className:"suggestions-container",children:at.map(O=>P.jsxs("button",{className:"suggestion-button",onClick:O.action,type:"button",children:[P.jsx("span",{className:"suggestion-icon",children:O.icon}),P.jsx("span",{className:"suggestion-text",children:O.text})]},O.id))})]}),P.jsx("div",{ref:V})]}),P.jsx(Yi,{scrollContainerRef:X})]}),P.jsxs("div",{className:"chat-modal-input",children:[ke&&P.jsxs("div",{className:"reply-preview",children:[P.jsxs("div",{className:"reply-preview-content",children:[P.jsxs("div",{className:"reply-preview-label",children:[a("replyingTo")," ",ke.sender==="user"?a("replyingToYou"):a("replyingToAgent")]}),P.jsx("div",{className:"reply-preview-text",children:ke.text})]}),P.jsx("button",{className:"reply-preview-close",onClick:()=>N(null),"aria-label":a("cancelReply"),type:"button",children:P.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:P.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}),P.jsxs("div",{className:"chat-modal-input-row",children:[P.jsx("input",{ref:fe,type:"text",placeholder:a("messagePlaceholder"),value:R,onChange:O=>h(O.target.value),onKeyPress:Vt,disabled:x,"aria-label":"Message input"}),P.jsx("button",{className:"send-button",onClick:Fe,"aria-label":a("sendMessage"),disabled:x||R?.trim()==="",type:"button",children:P.jsx("img",{src:Ri,alt:"Send",width:44,height:44})})]})]})]})}):null},lc=({position:e,theme:t,defaultOpen:n,onOpen:o,onClose:s,onTransaction:a})=>{const[r,i]=ne.useState(n);ne.useEffect(()=>{n&&o&&o()},[]),ne.useEffect(()=>{if(typeof window>"u")return;const h=document.body,x=document.documentElement,m=h.style.overscrollBehavior,C=x.style.overscrollBehavior,L=h.style.overflow;return r&&(h.style.overscrollBehavior="none",x.style.overscrollBehavior="none",h.style.overflow="hidden"),()=>{h.style.overscrollBehavior=m,x.style.overscrollBehavior=C,h.style.overflow=L}},[r]);const d=ne.useCallback(()=>{i(!0),o?.()},[o]),T=ne.useCallback(()=>{i(!1),s?.()},[s]),B=ne.useCallback(()=>{r?T():d()},[r,d,T]),R={position:"fixed",[e==="bottom-right"?"right":"left"]:"20px",bottom:"20px",zIndex:t.zIndex??9999};return P.jsxs("div",{style:R,role:"complementary","aria-label":"Chat widget",children:[P.jsx(Gs,{onClick:B}),P.jsx(cc,{isOpen:r,onClose:T,onTransaction:a,position:e,modalChatStyle:t.modalChatStyle})]})},dc=({position:e="bottom-right",theme:t={},defaultOpen:n=!1,onOpen:o,onClose:s,account:a,onTransaction:r,language:i="en",rpcUrls:d})=>{const T={position:e,theme:t,rpcUrls:d};return typeof window>"u"?null:P.jsx(Fi,{initialConfig:T,children:P.jsx(Ti,{initialAccount:a,children:P.jsx(Vs,{initialLanguage:i,children:P.jsx(lc,{position:e,theme:t,defaultOpen:n,onOpen:o,onClose:s,onTransaction:r})})})})};gt.ChatWidget=dc,Object.defineProperty(gt,Symbol.toStringTag,{value:"Module"})}));