1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PublicSymbolSearchOverlay-C8DQfFZA.js","assets/AssetSearchOverlay-BxFrUSPj.js","assets/marketUtils-CFI6vbti.js","assets/WatchToggleButton-TlI7bolJ.js","assets/minus-Curu9W6K.js","assets/plus-hOg_iQrg.js","assets/chevron-left-BqM8J1fw.js","assets/symbolSeoRoutes-B_LMCjIE.js","assets/index-Cuqwd3E8.js","assets/parseSignature-DWGmPMzY.js","assets/AccountNotFoundScreen-mrDHRRtZ-yvOqa6Xk.js","assets/ScreenLayout-DTsWfKKs-rOYZW3HB.js","assets/ModalFooter-DKyozrEX-BzUQ78VB.js","assets/Screen-DMmH56yL-DVjkRCtI.js","assets/index-CWARkn2w-DrMeyL5V.js","assets/createLucideIcon-BI5TfuQN.js","assets/AddFundsSelectionScreen-D76JlRA1-BQXVYQyK.js","assets/styles-DVyDvTdj-CcvM0V-P.js","assets/styles-tjTwTW2h-zIHD0eMJ.js","assets/credit-card-UL6xDn6f.js","assets/AffirmativeConsentScreen-Cva7mCde-TbQtFbIO.js","assets/shouldProceedtoEmbeddedWalletCreationFlow-DDzHjOUJ-BAxfBWiJ.js","assets/external-link-DF0fvErT.js","assets/AllowlistRejectionScreen-CJlenrjE-CndA7FUz.js","assets/safe-url-D7SRPu33-A8zMgOTd.js","assets/lock-mQesPl0C.js","assets/AuthenticateWithWalletScreen-C_zdZyDa-DrbpI10y.js","assets/ConnectWalletView-D37hqEee-DxwFRQX2.js","assets/CopyableText-CQapvaMr-ChGzJ5BQ.js","assets/check-D7ahH1p8.js","assets/copy-DKvFiYeO.js","assets/Link-DTncR-24-Ch_ZKyPh.js","assets/QrCode-CpGkVlXb-CkLO77ZW.js","assets/browser-CHFBeGQd.js","assets/dijkstra-COg3n3zL.js","assets/EmailInputForm-Cqo1mda8-DkArtjg6.js","assets/ErrorMessage-D8VaAP5m-8fwDlivw.js","assets/useI18n-C0rfdPEH-C659f15P.js","assets/WalletCards-DH1rqayz-Dq6NvpAs.js","assets/AwaitingEvmToSolBridgingScreen-Ch3fh4A4-BGLjK7Ac.js","assets/CheckCircleIcon-DRZFDWKF.js","assets/Layouts-BMRfo5hw-BSc0WGOr.js","assets/ScreenHeader-CHmc4-Lu-DzOciIl9.js","assets/FundWalletMethodHeader-CkyJhN9p-ARk8goGF.js","assets/useGetTokenPrice-B9Z2p9XG-Xebja5Vb.js","assets/useGetSolPrice-x7gfUIHJ-CkG2y1d2.js","assets/analytics-mkkvFRju-DOXuftJB.js","assets/reservoir-B7XIq5qj-BRdyETsa.js","assets/getChainName-DjpPdUSc-c2urPd0g.js","assets/transaction-BNTP-bFm-CrebgH-D.js","assets/getFormattedUsdFromLamports-De3U9GlO-C446pzMl.js","assets/BridgeNetworkSelectionView-DPw4O-jL-DQvRZIVE.js","assets/getErc20Balance-DHgWH7_1-Bex6tuob.js","assets/Value-DTgR824E-BuZ-8UB7.js","assets/LoadingSkeleton-BMsgO5PV-CIjAiFXk.js","assets/Subtitle-CV-2yKE4-B9QYWdtg.js","assets/Title-BnzYV3Is-CJXlCJIi.js","assets/WalletIcon-D10mz1Mb.js","assets/Chip-CZKIKt9K-Bs1fUbxC.js","assets/TransferOrBridgeLoadingScreen-DUbPtRQe-Djdi5qmm.js","assets/InjectedWalletIcon-DLcYOGDj-DBV2uC4E.js","assets/Address-9aHCoAYt-TMvewCEc.js","assets/GlobeAltIcon-BUJvzqtb.js","assets/shared-FM0rljBt-Cfe2mjca.js","assets/ChevronDownIcon-3Bu-cF4f.js","assets/formatErc20TokenAmount-BuPk9xcy-CkAr4Oc0.js","assets/ethers-DKNnmkib-CeICnk3F.js","assets/styles-C9oLwuTf-DY3m48io.js","assets/LinkPasskeyScreen-CxW7ka3t-DzU8h7yB.js","assets/TodoList-DnyULl18-Ai_Z6n1h.js","assets/x-cHSbHret.js","assets/circle-check-big-8OZOLy8w.js","assets/fingerprint-pattern-DkmM8QtI.js","assets/floating-ui.react-CnSI3Z07.js","assets/floating-ui.react-dom-C_-8JnJW.js","assets/custom-D8uieiN1.js","assets/AwaitingExternalEthereumTransferScreen-C9yfbYim-BhZL0CfL.js","assets/transfer-6YztDh-t-
1DU6hH7CZ.js","assets/parseEther-Bx7uARXb.js","assets/AwaitingPasswordlessCodeScreen-DkpWm3cl-DJuHZstn.js","assets/EnvelopeIcon-D8yn6I0s.js","assets/PhoneIcon-DfuZnkyQ.js","assets/AwaitingSolToEvmBridgingScreen-D-2h-r2V-Bnj7mqZD.js","assets/CaptchaScreen-DTWKq3oC-XQPti3Lg.js","assets/circle-x-B1-QQhFv.js","assets/CoinbaseOnrampStatusScreen-yM8i1dq5-Bk0AN1ar.js","assets/ArrowsRightLeftIcon-CF-rmRBC.js","assets/CheckCircleIcon-CyZU73DK.js","assets/ConnectLedgerScreen-COys-OjJ-CVefpSIz.js","assets/ConnectOnlyLandingScreen-C3myVsvL-uJzwGfci.js","assets/ConnectOnlyStatusScreen-B-uqGIbz-D30TAtk3.js","assets/ConnectionStatusScreen-gJeQDnkD-DLT6zRO0.js","assets/ConnectOrCreateScreen-DD7cB8dy-CZF-ruKI.js","assets/CustomLandingScreenView-mjmDHGwr-BuwayKRK.js","assets/ConnectEmailForm-CvtooZ8i-Cum9JY7Q.js","assets/mail-CwPBlBB8.js","assets/farcaster-DPlSjvF5-mX7mh445.js","assets/FingerPrintIcon-vCfkJjZu.js","assets/ConnectPhoneForm-BClRnco--DvkHIA5W.js","assets/twitch-5IOe4sIQ-Dy8pFnLI.js","assets/telegram-B-JqnkqZ-Ws1q5l4I.js","assets/WalletOverflowButton-BsG-fdaJ-CDqQD2ge.js","assets/wallet-rx7mWfqL.js","assets/smartphone-BH-x5P2m.js","assets/CrossAppAuthScreen-DO1JO_KV-D8FLk5th.js","assets/DelegatedActionsConsentScreen-BCgARvf7-Cf5p3Azg.js","assets/WalletInfoCard-BpO3gP5Y-DCP3uNsO.js","assets/LabelXs-oqZNqbm_-DO5LKCB9.js","assets/circle-alert-DQjhNft4.js","assets/DelegatedActionsRevokeScreen-BcwL74R--DmMjgi6k.js","assets/DepositAddressScreen-CDAmKcTm-Ch_05mVQ.js","assets/triangle-alert-wkitZYh3.js","assets/hourglass-BMiacY-Y.js","assets/chevron-down-CB3mHJnC.js","assets/EmbeddedWalletConnectingScreen-CM-Kfv91-BELhZTH4.js","assets/EmbeddedWalletCreatedScreen-Zscvn5zZ-BNQ71jyT.js","assets/EmbeddedWalletKeyExportScreen-CP5NN-uM-DkusIuOy.js","assets/WarningBanner-ZZqCEtZK--97WiMO1.js","assets/ExclamationTriangleIcon-Dn6DlNWf.js","assets/EmbeddedWalletOnAccountCreateScreen-Cc3IEizD-DcGOgDN6.js","assets/RecoveryPasswordCreateScreen-Dr_WQf6A-Cx14R_gt.js","assets/SetWalletPasswordForm-B3EVuPZv-DVdAid_g.js","assets/shared-DEkT-Gv3-BAzPuU55.js","assets/Checkbox-D1EDeo41-DL2wVlO0.js","assets/EmbeddedWalletPasswordUpdateScreen-vT10Bm2m-CSP05FYi.js","assets/EmbeddedWalletPasswordUpdateSplashScreen-BuBFHC6o-B7kRO1tg.js","assets/ErrorScreen-CudzJvQF-BmqfVLR5.js","assets/FarcasterConnectStatusScreen-AJge1G0j-C8JwauiJ.js","assets/OpenLink-CUpJ1mOr-BlXpLc1a.js","assets/FarcasterSignerStatusScreen-Cjd-9_IN-B4EvHSm2.js","assets/CopyToClipboard-i_OQSBJr-BIoPofvK.js","assets/FiatOnrampScreen-D-ijGLq9-i3427Pb
1S.js","assets/SelectSourceAsset-CXcAyH34-DzqFNVmI.js","assets/InfoBanner-Cb3p1z12-CTOOl-fv.js","assets/GooglePay-B53WnudL-DGj-U070.js","assets/with-selector-BbjhrDVq.js","assets/FundSolWalletWithExternalSolanaWallet-Bu7nN8uS-CKkYAHcX.js","assets/simulateTransaction-BM0su-14-BlM6Qwkk.js","assets/getUsdcMintAddress-BVgm9GRo-FDalV59C.js","assets/FundWithBankDepositScreen-CbY8cUX1-CgNeH_Cw.js","assets/FundingEditAmountScreen-DTonST2j-COk5t_2M.js","assets/FundingMethodSelectionScreen-CebSau1c-Cv-WlPdS.js","assets/ErrorBanner-BcpGRt0h-4K_Gjln-.js","assets/ExclamationCircleIcon-bTduyJ-l.js","assets/getErc20TokenInfo-DluFoVaC-XsG_GFIr.js","assets/index-DmwSQBu2-BXAeoZov.js","assets/InAppBrowserLoginNotPossible-BsOHoSJE-CiXC_UR9.js","assets/InstallWalletScreen-BTkuwBNN-CPC8YbKg.js","assets/LandingScreen-DA4XFqxS-BPuihP7q.js","assets/LinkConflictScreen-CZztICqG-CcRmGkRL.js","assets/StackedContainer-B2vaEl56-HfTSJQ5I.js","assets/capitalizeFirstLetter-DmLYqXsO-tV1Idewc.js","assets/LinkEmailScreen-DGPysBCv-DZNx7cug.js","assets/LinkPhoneScreen-CJcpCkxo-VcOPlYGr.js","assets/LoginFailedScreen-Dze4SI3Y-CjeUZAHu.js","assets/ManualTransferScreen-Drt1Mp6E-9bOpR5ds.js","assets/useWalletBalance-D47dI-xh-DkpOOesf.js","assets/MfaAuthEnrollmentFlowScreen-5IWp37BG-RxAcpFQQ.js","assets/ShieldCheckIcon-D3Pr4u1o.js","assets/EnrollTotp-C2nNwn93-BeJiCYm1.js","assets/PinInput-DbZ0b1i1-C0AvY_BR.js","assets/MfaAuthVerifyFlowScreen-W132fIHD-CXhBtQj9.js","assets/to-ui-error-CD8Q_l7P-dHOePByH.js","assets/TransactionDetails-BkfhYtAg-C1Gufm9O.js","assets/WalletLink-7Vc0Y1tZ-D8lsVrNy.js","assets/MfaEnrollmentFlowScreen-B2ZcSeBE-H459ZcuG.js","assets/MoonpayStatusScreen-Bey2zhxF-BcudI9Ts.js","assets/OAuthStatusScreen-D8EiVa2Y-bq_Cudyk.js","assets/PasskeySelectSignupOrLogin-CwjunGne-5I6quehn.js","assets/PasskeyStatusScreen-D0GgmiKb-C7m3KL3W.js","assets/PasswordRecoveryScreen-Q5SHSGfd-BM5QLDlz.js","assets/RecoveryOAuthStatusScreen-CGpbUHkL-BgkzlB0r.js","assets/styles-BsotlekN-Kf2lD_Wc.js","assets/RecoverySelectionScreen-CagonGs_-DMZoTPZi.js","assets/LockClosedIcon-BCvtoDeY.js","assets/index-BKK46WdR-Ez5WWR3m.js","assets/JsonTree-BHzNC-ic-CZri2c37.js","assets/TransactionErrorView-DLbrU4bp-B2in34tX.js","assets/SetAutomaticRecoveryScreen-Dz6S1LST-CB0uVnl6.js","assets/SignRequestScreen-ipPnPIlP-XJkUZvbI.js","assets/StandardSignAndSendTransactionScreen-DPcArlC7-B7LzdnTq.js","assets/TelegramAuthScreen-Bb_tyqBP-BG8pVDIw.js","assets/TransferFromWalletScreen-DTZSqDtC-G8Zw-JFw.js","assets/UpdateEmailScreen-LL6semse-DM_yVgy2.js","assets/UpdatePhoneScreen-CS7n7kwA-C7RIt4Sk.js","assets/UserLimitReachedScreen-Cq4YnJkA-DzGBvg6c.js","assets/WalletInterstitialScreen-CZboB6Va-SkQ5yP9s.js","assets/MfaVerifyFlowScreen-CzNn41ji-BPdGCxpE.js","assets/PricingPage-CnyQBD-v.js","assets/chevron-up-BbO36miO.js","assets/BlogPage-yoTZmgqn.js","assets/funnel-F0lDEGqJ.js","assets/clock-bS9aCvYO.js","assets/BlogPage-z-j4Pfqa.css","assets/BlogPostPage-1TMEXpNz.js","assets/CartesianChart-BS4myg1q.js","assets/BarChart-BxckEVBW.js","assets/Legend-I0VJToVZ.js","assets/math-C7nrg5M4.js","assets/AreaChart-BMFn6pRp.js","assets/LineChart-y6ZiDy_I.js","assets/FAQSection-Blijssc_.js","assets/blogAuthorSeo-DyvEiPpG.js","assets/index-C4IUurBZ.js","assets/calendar-DKnUp6jO.js","assets/PressRoomPage-COQVhxrd.js","assets/announcements-yuNgP1uU.js","assets/PressAnnouncementPage-i-n5CVr0.js","assets/NewsPage-DZqPEZWy.js","assets/clock-3-CzdUZXDl.js","assets/calendar-days-BBifuhQP.js","assets/NewsDetailPage-VtPzZl-B.js","assets/IdeasPage-DTp6Q_Hx.js","assets/PublicIdeaCard-DyLzvSF4.js","assets/ConfirmModal-CoeKEpEf.js","assets/tvPublicIdeas-CwxaIifl.js","assets/message-square-CaICj9uc.js","assets/rocket-BG2j9VBt.js","assets/trending-down-DZ3nSbP3.js","assets/IdeaDetailPage-yEenG40H.js","assets/TvAdvancedChart-CxMviJ95.js","assets/PaywallModal-BGjsou5Z.js","assets/priceFormatting-CZrYJiK0.js","assets/TradeIdeaCard-9MJ5BtTe.js","assets/useMarketPrices-ChblDxPF.js","assets/smile-CNq5UudW.js","assets/PortfolioPage-DABUY73H.js","assets/CopyTradeModal-BTlE81mr.js","assets/brokerAccountDisplay-Cokx6Hc6.js","assets/PrivyWalletConnectRow-18bRbzuD.js","assets/connectorIcons-BXYxudIU.js","assets/link-2-DMpFe-7D.js","assets/circle-x-9wJzI3-f.js","assets/shield-check-DhOMNA7u.js","assets/circle-play-CMk4j9XY.js","assets/calculator-KBkIi6cA.js","assets/chart-pie-D_5AxMo2.js","assets/activity-BHuUg-H0.js","assets/arrow-down-right-s8-wp78U.js","assets/AlphaWhalesPage-D1OJP8Qb.js","assets/target-kIrvjwrp.js","assets/WhaleDetailPage-lAcfMAiy.js","assets/ResearchStudioShell-Dz6vbLAR.js","assets/ResearchStudioUiContext-BJC44x_F.js","assets/ResearchStudioPage-Dyc43hM3.js","assets/schemas-I5s12icL.js","assets/send-31H_4FL3.js","assets/chatShares-DtTbFO7m.js","assets/AssetPanelHost-CsmgRf1l.js","assets/getContractAddress-CG-d4qtN.js","assets/lightbulb-DKzsTDPM.js","assets/AssetNewsPanel-BnK8AK-d.js","assets/circle-question-mark-BnImBq7A.js","assets/chart-column-Bs2TzK3u.js","assets/layers-CmX6Pp-i.js","assets/WalletPanel-CPKX7TY-.js","assets/landmark-BAZyBOra.js","assets/watchHotCoins-Z_0CgA7l.js","assets/sliders-horizontal-DgYqDuqJ.js","assets/save-89Q2YQYQ.js","assets/rotate-ccw-DwN-HGeu.js","assets/building-2-_6C1_DvF.js","assets/newspaper-BOK9Vu4u.js","assets/calendar-clock-s-Iwaz8G.js","assets/layout-grid-B-NcIgrJ.js","assets/trash-2-Cqe5Xgqq.js","assets/circle-pause-DNuSJfqI.js","assets/copyTradeStrategies-DZBAZal8.js","assets/dayTradeBots-QuUKo_Il.js","assets/connectorSkills-Cg1_cZ7F.js","assets/checkoutSession-BCSKSKqk.js","assets/desktopSidePanel-CObcD3Xm.js","assets/message-circle-C1OZK1IJ.js","assets/list-checks-C9m_8reg.js","assets/image-plus-C3tWm5rR.js","assets/ResearchStudioPage-cPm47yMD.css","assets/TvSnapshotRenderPage-DYqh6AKY.js","assets/SettingsPage-BiPt4i2J.js","assets/history-Dh5D6iYS.js","assets/CybersecurityPolicyPage-DzrIigm_.js","assets/CreditGuidePage-BfCTuc94.js","assets/HelpCenterPage-BQjhT54Y.js","assets/WatchPage-B5b5EE01.js","assets/earth-BjHZh8X-.js","assets/appPageLayout-DCC3H5hF.js","assets/SymbolQuoteCard-DeNHVfcs.js","assets/dayTradeQuotes-CQPeNS1_.js","assets/DiscoverPage-BEEXBAm4.js","assets/radar-CgFKbJFx.js","assets/InstitutionStrategyCard-4sbrIsfa.js","assets/chart-line-B6RkyhlB.js","assets/repeat-2-CO3EP_ha.js","assets/AgentFeaturePage-DeJTO-ym.js","assets/AiConsensusPickPage-BLo5HDdg.js","assets/InstitutionSmartMoneyPage-Du9MUZTx.js","assets/trophy-CwRNX9z6.js","assets/SocialAgentPage--WaHRdlE.js","assets/AiTechnicalAnalysisPage-DHbgmDS3.js","assets/CopyTradeFeaturePage-F1M-Jbky.js","assets/SwingTradeBotFeaturePage-CziSwjRU.js","assets/DayTradeBotFeaturePage-CtkqxGgE.js","assets/MarketDataPage-dHvbRcha.js","assets/ForBusinessPage-CdAOKScr.js","assets/ComparePage-CMf9wJWG.js","assets/AboutPage-CtI3_T1h.js","assets/ModelLandingPage-BeeUJHa2.js","assets/badge-check-CQdPf9vr.js","assets/ConnectorPage-C0vo96xC.js","assets/AccountPage-wYiiTCMC.js","assets/CommunityPage-DcrupVOU.js","assets/SharedChatPage-zMTGkKB6.js","assets/SymbolSeoPage-CQY5Ihlm.js"])))=>i.map(i=>d[i]); 2var V2e=Object.defineProperty;var TD=t=>{throw TypeError(t)};var H2e=(t,e,n)=>e in t?V2e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var fe=(t,e,n)=>H2e(t,typeof e!="symbol"?e+"":e,n),LD=(t,e,n)=>e.has(t)||TD("Cannot "+n);var es=(t,e,n)=>(LD(t,e,"read from private field"),n?n.call(t):e.get(t)),Zx=(t,e,n)=>e.has(t)?TD("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Kx=(t,e,n,r)=>(LD(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);function W2e(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var ql=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Wa(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function AY(t){if(Object.prototype.hasOwnProperty.call(t,"__esMo
vendor: 4,304 bytes, lines 2-18
2dule"))return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var Gx={exports:{}},py={};/** 3 * @license React 4 * react-jsx-runtime.production.js 5 * 6 * Copyright (c) Meta Platforms, Inc. and affiliates. 7 * 8 * This source code is licensed under the MIT license found in the 9 * LICENSE file in the root directory of this source tree. 10 */var $D;function q2e(){if($D)return py;$D=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,i,s){var a=null;if(s!==void 0&&(a=""+s),i.key!==void 0&&(a=""+i.key),"key"in i){s={};for(var o in i)o!=="key"&&(s[o]=i[o])}else s=i;return i=s.ref,{$$typeof:t,type:r,key:a,ref:i!==void 0?i:null,props:s}}return py.Fragment=e,py.jsx=n,py.jsxs=n,py}var ID;function Z2e(){return ID||(ID=1,Gx.exports=q2e()),Gx.exports}var h=Z2e(),Yx={exports:{}},Bt={};/** 11 * @license React 12 * react.production.js 13 * 14 * Copyright (c) Meta Platforms, Inc. and affiliates. 15 * 16 * This source code is licensed under the MIT license found in the 17 * LICENSE file in the root directory of this source tree. 18 */var ND;function K2e(){if(ND)return Bt;ND=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),a=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),y=Symbol.iterator;function g(F){return F===null||typeof F!="object"?null:(F=y&&F[y]||F["@@iterator"],typeof F=="function"?F:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,_={};function C(F,q,G){this.props=F,this.context=q,this.refs=_,this.updater=G||b}C.prototype.isReactComponent={},C.prototype.setState=function(F,q){if(typeof F!="object"&&typeof F!="function"&&F!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,F,q,"setState")},C.prototype.forceUpdate=function(F){this.updater.enqueueForceUpdate(this,F,"forceUpdate")};function S(){}S.prototype=C.prototype;function x(F,q,G){this.props=F,this.context=q,this.refs=_,this.updater=G||b}var A=x.prototype=new S;A.constructor=x,v(A,C.prototype),A.isPureReactComponent=!0;var I=Array.isArray;function $(){}var O={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function j(F,q,G){var Y=G.ref;return{$$typeof:t,type:F,key:q,ref:Y!==void 0?Y:null,props:G}}function U(F,q){return j(F.type,q,F.props)}function z(F){return typeof F=="object"&&F!==null&&F.$$typeof===t}function D(F){var q={"=":"=0",":":"=2"};return"$"+F.replace(/[=:]/g,function(G){return q[G]})}var R=/\/+/g;function W(F,q){return typeof F=="object"&&F!==null&&F.key!=null?D(""+F.key):q.toString(36)}function T(F){switch(F.status){case"fulfilled":return F.value;case"rejected":throw F.reason;default:switch(typeof F.status=="string"?F.then($,$):(F.status="pending",F.then(function(q){F.status==="pending"&&(F.status="fulfilled",F.value=q)},function(q){F.status==="pending"&&(F.status="rejected",F.reason=q)})),F.status){case"fulfilled":return F.value;case"rejected":throw F.reason}}throw F}function L(F,q,G,Y,X){var te=typeof F;(te==="undefined"||te==="boolean")&&(F=null);var ie=!1;if(F===null)ie=!0;else switch(te){case"bigint":case"string":case"number":ie=!0;break;case"object":switch(F.$$typeof){case t:case e:ie=!0;break;case f:return ie=F._init,L(ie(F._payload),q,G,Y,X)}}if(ie)return X=X(F),ie=Y===""?"."+W(F,0):Y,I(X)?(G="",ie!=null&&(G=ie.replace(R,"$&/")+"/"),L(X,q,G,"",function(Ce){return Ce})):X!=null&&(z(X)&&(X=U(X,G+(X.key==null||F&&F.key===X.key?"":(""+X.key).replace(R,"$&/")+"/")+ie)),q.push(X)),1;ie=0;var se=Y===""?".":Y+":";if(I(F))for(var pe=0;pe<F.length;pe++)Y=F[pe],te=se+W(Y,pe),ie+=L(Y,q,G,te,X);
vendor: 6,638 bytes, lines 18-26
18else if(pe=g(F),typeof pe=="function")for(F=pe.call(F),pe=0;!(Y=F.next()).done;)Y=Y.value,te=se+W(Y,pe++),ie+=L(Y,q,G,te,X);else if(te==="object"){if(typeof F.then=="function")return L(T(F),q,G,Y,X);throw q=String(F),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(F).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return ie}function M(F,q,G){if(F==null)return F;var Y=[],X=0;return L(F,Y,"","",function(te){return q.call(G,te,X++)}),Y}function Z(F){if(F._status===-1){var q=F._result;q=q(),q.then(function(G){(F._status===0||F._status===-1)&&(F._status=1,F._result=G)},function(G){(F._status===0||F._status===-1)&&(F._status=2,F._result=G)}),F._status===-1&&(F._status=0,F._result=q)}if(F._status===1)return F._result.default;throw F._result}var H=typeof reportError=="function"?reportError:function(F){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof F=="object"&&F!==null&&typeof F.message=="string"?String(F.message):String(F),error:F});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",F);return}console.error(F)},V={map:M,forEach:function(F,q,G){M(F,function(){q.apply(this,arguments)},G)},count:function(F){var q=0;return M(F,function(){q++}),q},toArray:function(F){return M(F,function(q){return q})||[]},only:function(F){if(!z(F))throw Error("React.Children.only expected to receive a single React element child.");return F}};return Bt.Activity=p,Bt.Children=V,Bt.Component=C,Bt.Fragment=n,Bt.Profiler=i,Bt.PureComponent=x,Bt.StrictMode=r,Bt.Suspense=l,Bt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,Bt.__COMPILER_RUNTIME={__proto__:null,c:function(F){return O.H.useMemoCache(F)}},Bt.cache=function(F){return function(){return F.apply(null,arguments)}},Bt.cacheSignal=function(){return null},Bt.cloneElement=function(F,q,G){if(F==null)throw Error("The argument must be a React element, but you passed "+F+".");var Y=v({},F.props),X=F.key;if(q!=null)for(te in q.key!==void 0&&(X=""+q.key),q)!P.call(q,te)||te==="key"||te==="__self"||te==="__source"||te==="ref"&&q.ref===void 0||(Y[te]=q[te]);var te=arguments.length-2;if(te===1)Y.children=G;else if(1<te){for(var ie=Array(te),se=0;se<te;se++)ie[se]=arguments[se+2];Y.children=ie}return j(F.type,X,Y)},Bt.createContext=function(F){return F={$$typeof:a,_currentValue:F,_currentValue2:F,_threadCount:0,Provider:null,Consumer:null},F.Provider=F,F.Consumer={$$typeof:s,_context:F},F},Bt.createElement=function(F,q,G){var Y,X={},te=null;if(q!=null)for(Y in q.key!==void 0&&(te=""+q.key),q)P.call(q,Y)&&Y!=="key"&&Y!=="__self"&&Y!=="__source"&&(X[Y]=q[Y]);var ie=arguments.length-2;if(ie===1)X.children=G;else if(1<ie){for(var se=Array(ie),pe=0;pe<ie;pe++)se[pe]=arguments[pe+2];X.children=se}if(F&&F.defaultProps)for(Y in ie=F.defaultProps,ie)X[Y]===void 0&&(X[Y]=ie[Y]);return j(F,te,X)},Bt.createRef=function(){return{current:null}},Bt.forwardRef=function(F){return{$$typeof:o,render:F}},Bt.isValidElement=z,Bt.lazy=function(F){return{$$typeof:f,_payload:{_status:-1,_result:F},_init:Z}},Bt.memo=function(F,q){return{$$typeof:u,type:F,compare:q===void 0?null:q}},Bt.startTransition=function(F){var q=O.T,G={};O.T=G;try{var Y=F(),X=O.S;X!==null&&X(G,Y),typeof Y=="object"&&Y!==null&&typeof Y.then=="function"&&Y.then($,H)}catch(te){H(te)}finally{q!==null&&G.types!==null&&(q.types=G.types),O.T=q}},Bt.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},Bt.use=function(F){return O.H.use(F)},Bt.useActionState=function(F,q,G){return O.H.useActionState(F,q,G)},Bt.useCallback=function(F,q){return O.H.useCallback(F,q)},Bt.useContext=function(F){return O.H.useContext(F)},Bt.useDebugValue=function(){},Bt.useDeferredValue=function(F,q){return O.H.useDeferredValue(F,q)},Bt.useEffect=function(F,q){return O.H.useEffect(F,q)},Bt.useEffectEvent=function(F){return O.H.useEffectEvent(F)},Bt.useId=function(){return O.H.useId()},Bt.useImperativeHandle=function(F,q,G){return O.H.useImperativeHandle(F,q,G)},Bt.useInsertionEffect=function(F,q){return O.H.useInsertionEffect(F,q)},Bt.useLayoutEffect=function(F,q){return O.H.useLayoutEffect(F,q)},Bt.useMemo=function(F,q){return O.H.useMemo(F,q)},Bt.useOptimistic=function(F,q){return O.H.useOptimistic(F,q)},Bt.useReducer=function(F,q,G){return O.H.useReducer(F,q,G)},Bt.useRef=function(F){return O.H.useRef(F)},Bt.useState=function(F){return O.H.useState(F)},Bt.useSyncExternalStore=function(F,q,G){return O.H.useSyncExternalStore(F,q,G)},Bt.useTransition=function(){return O.H.useTransition()},Bt.version="19.2.4",Bt}var OD;function B1(){return OD||(OD=1,Yx.exports=K2e()),Yx.exports}var N=B1();const Qe=Wa(N),PD=W2e({__proto__:null,default:Qe},[N]);var Jx={exports:{}},my={},Xx={exports:{}},Qx={};/** 19 * @license React 20 * scheduler.production.js 21 * 22 * Copyright (c) Meta Platforms, Inc. and affiliates. 23 * 24 * This source code is licensed under the MIT license found in the 25 * LICENSE file in the root directory of this source tree. 26 */var RD;function G2e(){return RD||(RD=1,(function(t){function e(L,M){var Z=L.length;L.push(M);e:for(;0<Z;){var H=Z-1>>>1,V=L[H];if(0<i(V,M))L[H]=M,L[Z]=V,Z=H;else break e}}function n(L){return L.length===0?null:L[0]}function r(L){if(L.length===0)return null;var M=L[0],Z=L.pop();if(Z!==M){L[0]=Z;e:for(var H=0,V=L.length,F=V>>>1;H<F;){var q=2*(H+1)-1,G=L[q],Y=q+1,X=L[Y];if(0>i(G,Z))Y<V&&0>i(X,G)?(L[H]=X,L[Y]=Z,H=Y):(L[H]=G,L[q]=Z,H=q);else if(Y<V&&0>i(X,Z))L[H]=X,L[Y]=Z,H=Y;else break e}}return M}function i(L,M){var Z=L.sortIndex-M.sortIndex;return Z!==0?Z:L.id-M.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();t.unstable_now=function(){return a.now()-o}}var l=[],u=[],f=1,p=null,y=3,g=!1,b=!1,v=!1,_=!1,C=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;function A(L){for(var M=n(u);M!==null;){if(M.callback===null)r(u);else if(M.startTime<=L)r(u),M.sortIndex=M.expirationTime,e(l,M);else break;M=n(u)}}function I(L){if(v=!1,A(L),!b)if(n(l)!==null)b=!0,$||($=!0,D());else{var M=n(u);M!==null&&T(I,M.startTime-L)}}var $=!1,O=-1,P=5,j=-1;function U(){return _?!0:!(t.unstable_now()-j<P)}function z(){if(_=!1,$){var L=t.unstable_now();j=L;var M=!0;try{e:{b=!1,v&&(v=!1,S(O),O=-1),g=!0;var Z=y;try{t:{for(A(L),p=n(l);p!==null&&!(p.expirationTime>L&&U());
vendor: 1,031 bytes, line 26
26){var H=p.callback;if(typeof H=="function"){p.callback=null,y=p.priorityLevel;var V=H(p.expirationTime<=L);if(L=t.unstable_now(),typeof V=="function"){p.callback=V,A(L),M=!0;break t}p===n(l)&&r(l),A(L)}else r(l);p=n(l)}if(p!==null)M=!0;else{var F=n(u);F!==null&&T(I,F.startTime-L),M=!1}}break e}finally{p=null,y=Z,g=!1}M=void 0}}finally{M?D():$=!1}}}var D;if(typeof x=="function")D=function(){x(z)};else if(typeof MessageChannel<"u"){var R=new MessageChannel,W=R.port2;R.port1.onmessage=z,D=function(){W.postMessage(null)}}else D=function(){C(z,0)};function T(L,M){O=C(function(){L(t.unstable_now())},M)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(L){L.callback=null},t.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<L?Math.floor(1e3/L):
vendor: 10,135 bytes, lines 26-44
265},t.unstable_getCurrentPriorityLevel=function(){return y},t.unstable_next=function(L){switch(y){case 1:case 2:case 3:var M=3;break;default:M=y}var Z=y;y=M;try{return L()}finally{y=Z}},t.unstable_requestPaint=function(){_=!0},t.unstable_runWithPriority=function(L,M){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var Z=y;y=L;try{return M()}finally{y=Z}},t.unstable_scheduleCallback=function(L,M,Z){var H=t.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?H+Z:H):Z=H,L){case 1:var V=-1;break;case 2:V=250;break;case 5:V=1073741823;break;case 4:V=1e4;break;default:V=5e3}return V=Z+V,L={id:f++,callback:M,priorityLevel:L,startTime:Z,expirationTime:V,sortIndex:-1},Z>H?(L.sortIndex=Z,e(u,L),n(l)===null&&L===n(u)&&(v?(S(O),O=-1):v=!0,T(I,Z-H))):(L.sortIndex=V,e(l,L),b||g||(b=!0,$||($=!0,D()))),L},t.unstable_shouldYield=U,t.unstable_wrapCallback=function(L){var M=y;return function(){var Z=y;y=M;try{return L.apply(this,arguments)}finally{y=Z}}}})(Qx)),Qx}var jD;function Y2e(){return jD||(jD=1,Xx.exports=G2e()),Xx.exports}var eC={exports:{}},ps={};/** 27 * @license React 28 * react-dom.production.js 29 * 30 * Copyright (c) Meta Platforms, Inc. and affiliates. 31 * 32 * This source code is licensed under the MIT license found in the 33 * LICENSE file in the root directory of this source tree. 34 */var MD;function J2e(){if(MD)return ps;MD=1;var t=B1();function e(l){var u="https://react.dev/errors/"+l;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var f=2;f<arguments.length;f++)u+="&args[]="+encodeURIComponent(arguments[f])}return"Minified React error #"+l+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function s(l,u,f){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:p==null?null:""+p,children:l,containerInfo:u,implementation:f}}var a=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(l,u){if(l==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return ps.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,ps.createPortal=function(l,u){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)throw Error(e(299));return s(l,u,null,f)},ps.flushSync=function(l){var u=a.T,f=r.p;try{if(a.T=null,r.p=2,l)return l()}finally{a.T=u,r.p=f,r.d.f()}},ps.preconnect=function(l,u){typeof l=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,r.d.C(l,u))},ps.prefetchDNS=function(l){typeof l=="string"&&r.d.D(l)},ps.preinit=function(l,u){if(typeof l=="string"&&u&&typeof u.as=="string"){var f=u.as,p=o(f,u.crossOrigin),y=typeof u.integrity=="string"?u.integrity:void 0,g=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;f==="style"?r.d.S(l,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:p,integrity:y,fetchPriority:g}):f==="script"&&r.d.X(l,{crossOrigin:p,integrity:y,fetchPriority:g,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},ps.preinitModule=function(l,u){if(typeof l=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var f=o(u.as,u.crossOrigin);r.d.M(l,{crossOrigin:f,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0})}}else u==null&&r.d.M(l)},ps.preload=function(l,u){if(typeof l=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var f=u.as,p=o(f,u.crossOrigin);r.d.L(l,f,{crossOrigin:p,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0,type:typeof u.type=="string"?u.type:void 0,fetchPriority:typeof u.fetchPriority=="string"?u.fetchPriority:void 0,referrerPolicy:typeof u.referrerPolicy=="string"?u.referrerPolicy:void 0,imageSrcSet:typeof u.imageSrcSet=="string"?u.imageSrcSet:void 0,imageSizes:typeof u.imageSizes=="string"?u.imageSizes:void 0,media:typeof u.media=="string"?u.media:void 0})}},ps.preloadModule=function(l,u){if(typeof l=="string")if(u){var f=o(u.as,u.crossOrigin);r.d.m(l,{as:typeof u.as=="string"&&u.as!=="script"?u.as:void 0,crossOrigin:f,integrity:typeof u.integrity=="string"?u.integrity:void 0})}else r.d.m(l)},ps.requestFormReset=function(l){r.d.r(l)},ps.unstable_batchedUpdates=function(l,u){return l(u)},ps.useFormState=function(l,u,f){return a.H.useFormState(l,u,f)},ps.useFormStatus=function(){return a.H.useHostTransitionStatus()},ps.version="19.2.4",ps}var DD;function kY(){if(DD)return eC.exports;DD=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),eC.exports=J2e(),eC.exports}/** 35 * @license React 36 * react-dom-client.production.js 37 * 38 * Copyright (c) Meta Platforms, Inc. and affiliates. 39 * 40 * This source code is licensed under the MIT license found in the 41 * LICENSE file in the root directory of this source tree. 42 */var UD;function X2e(){if(UD)return my;UD=1;var t=Y2e(),e=B1(),n=kY();function r(c){var d="https://react.dev/errors/"+c;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)d+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+c+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(c){return!(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)}function s(c){var d=c,m=c;if(c.alternate)for(;d.return;)d=d.return;else{c=d;do d=c,(d.flags&4098)!==0&&(m=d.return),c=d.return;while(c)}return d.tag===3?m:null}function a(c){if(c.tag===13){var d=c.memoizedState;if(d===null&&(c=c.alternate,c!==null&&(d=c.memoizedState)),d!==null)return d.dehydrated}return null}function o(c){if(c.tag===31){var d=c.memoizedState;if(d===null&&(c=c.alternate,c!==null&&(d=c.memoizedState)),d!==null)return d.dehydrated}return null}function l(c){if(s(c)!==c)throw Error(r(188))}function u(c){var d=c.alternate;if(!d){if(d=s(c),d===null)throw Error(r(188));return d!==c?null:c}for(var m=c,w=d;;){var E=m.return;if(E===null)break;var k=E.alternate;if(k===null){if(w=E.return,w!==null){m=w;continue}break}if(E.child===k.child){for(k=E.child;k;){if(k===m)return l(E),c;if(k===w)return l(E),d;k=k.sibling}throw Error(r(188))}if(m.return!==w.return)m=E,w=k;else{for(var B=!1,J=E.child;J;){if(J===m){B=!0,m=E,w=k;break}if(J===w){B=!0,w=E,m=k;break}J=J.sibling}if(!B){for(J=k.child;J;){if(J===m){B=!0,m=k,w=E;break}if(J===w){B=!0,w=k,m=E;break}J=J.sibling}if(!B)throw Error(r(189))}}if(m.alternate!==w)throw Error(r(190))}if(m.tag!==3)throw Error(r(188));return m.stateNode.current===m?c:d}function f(c){var d=c.tag;if(d===5||d===26||d===27||d===6)return c;for(c=c.child;c!==null;){if(d=f(c),d!==null)return d;c=c.sibling}return null}var p=Object.assign,y=Symbol.for("react.element"),g=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),S=Symbol.for("react.consumer"),x=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),U=Symbol.for("react.memo_cache_sentinel"),z=Symbol.iterator;function D(c){return c===null||typeof c!="object"?null:(c=z&&c[z]||c["@@iterator"],typeof c=="function"?c:null)}var R=Symbol.for("react.client.reference");function W(c){if(c==null)return null;if(typeof c=="function")return c.$$typeof===R?null:c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case v:return"Fragment";case C:return"Profiler";case _:return"StrictMode";case I:return"Suspense";case $:return"SuspenseList";case j:return"Activity"}if(typeof c=="object")switch(c.$$typeof){case b:return"Portal";case x:return c.displayName||"Context";case S:return(c._context.displayName||"Context")+".Consumer";case A:var d=c.render;return c=c.displayName,c||(c=d.displayName||d.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case O:return d=c.displayName||null,d!==null?d:W(c.type)||"Memo";case P:d=c._payload,c=c._init;try{return W(c(d))}catch{}}return null}var T=Array.isArray,L=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,M=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z={pending:!1,data:null,method:null,action:null},H=[],V=-1;function F(c){return{current:c}}function q(c){0>V||(c.current=H[V],H[V]=null,V--)}function G(c,d){V++,H[V]=c.current,c.current=d}var Y=F(null),X=F(null),te=F(null),ie=F(null);function se(c,d){switch(G(te,d),G(X,c),G(Y,null),d.nodeType){case 9:case 11:c=(c=d.documentElement)&&(c=c.namespaceURI)?JM(c):0;break;default:if(c=d.tagName,d=d.namespaceURI)d=JM(d),c=XM(d,c);else switch(c){case"svg":c=1;break;case"math":c=2;break;default:c=0}}q(Y),G(Y,c)}function pe(){q(Y),q(X),q(te)}function Ce(c){c.memoizedState!==null&&G(ie,c);var d=Y.current,m=XM(d,c.type);d!==m&&(G(X,c),G(Y,m))}function xe(c){X.current===c&&(q(Y),q(X)),ie.current===c&&(q(ie),uy._currentValue=Z)}var Te,Et;function Ke(c){if(Te===void 0)try{throw Error()}catch(m){var d=m.stack.trim().match(/\n( *(at )?)/);Te=d&&d[1]||"",Et=-1<m.stack.indexOf(` 43 at`)?" (<anonymous>)":-1<m.stack.indexOf("@")?"@unknown:0:0":""}return` 44`+Te+c+Et}var Ge=!1;function nn(c,d){if(!c||Ge)return"";Ge=!0;var m=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var w={DetermineComponentFrameRoot:function(){try{if(d){var Ne=function(){throw Error()};if(Object.defineProperty(Ne.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ne,[])}catch(_e){var be=_e}Reflect.construct(c,[],Ne)}else{try{Ne.call()}catch(_e){be=_e}c.call(Ne.prototype)}}else{try{throw Error()}catch(_e){be=_e}(Ne=c())&&typeof Ne.catch=="function"&&Ne.catch(function(){})}}
vendor: 8,544 bytes, lines 44-49
44catch(_e){if(_e&&be&&typeof _e.stack=="string")return[_e.stack,be.stack]}return[null,null]}};w.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var E=Object.getOwnPropertyDescriptor(w.DetermineComponentFrameRoot,"name");E&&E.configurable&&Object.defineProperty(w.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var k=w.DetermineComponentFrameRoot(),B=k[0],J=k[1];if(B&&J){var ne=B.split(` 45`),ge=J.split(` 46`);for(E=w=0;w<ne.length&&!ne[w].includes("DetermineComponentFrameRoot");)w++;for(;E<ge.length&&!ge[E].includes("DetermineComponentFrameRoot");)E++;if(w===ne.length||E===ge.length)for(w=ne.length-1,E=ge.length-1;1<=w&&0<=E&&ne[w]!==ge[E];)E--;for(;1<=w&&0<=E;w--,E--)if(ne[w]!==ge[E]){if(w!==1||E!==1)do if(w--,E--,0>E||ne[w]!==ge[E]){var ke=` 47`+ne[w].replace(" at new "," at ");return c.displayName&&ke.includes("<anonymous>")&&(ke=ke.replace("<anonymous>",c.displayName)),ke}while(1<=w&&0<=E);break}}}finally{Ge=!1,Error.prepareStackTrace=m}return(m=c?c.displayName||c.name:"")?Ke(m):""}function yr(c,d){switch(c.tag){case 26:case 27:case 5:return Ke(c.type);case 16:return Ke("Lazy");case 13:return c.child!==d&&d!==null?Ke("Suspense Fallback"):Ke("Suspense");case 19:return Ke("SuspenseList");case 0:case 15:return nn(c.type,!1);case 11:return nn(c.type.render,!1);case 1:return nn(c.type,!0);case 31:return Ke("Activity");default:return""}}function gr(c){try{var d="",m=null;do d+=yr(c,m),m=c,c=c.return;while(c);return d}catch(w){return` 48Error generating stack: `+w.message+` 49`+w.stack}}var ve=Object.prototype.hasOwnProperty,et=t.unstable_scheduleCallback,rn=t.unstable_cancelCallback,br=t.unstable_shouldYield,$n=t.unstable_requestPaint,$t=t.unstable_now,jr=t.unstable_getCurrentPriorityLevel,ar=t.unstable_ImmediatePriority,Mr=t.unstable_UserBlockingPriority,In=t.unstable_NormalPriority,Tr=t.unstable_LowPriority,ln=t.unstable_IdlePriority,Rt=t.log,Ht=t.unstable_setDisableYieldValue,wt=null,Ze=null;function or(c){if(typeof Rt=="function"&&Ht(c),Ze&&typeof Ze.setStrictMode=="function")try{Ze.setStrictMode(wt,c)}catch{}}var bn=Math.clz32?Math.clz32:Zr,Gt=Math.log,_t=Math.LN2;function Zr(c){return c>>>=0,c===0?32:31-(Gt(c)/_t|0)|0}var K=256,Q=262144,le=4194304;function ae(c){var d=c&42;if(d!==0)return d;switch(c&-c){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return c&261888;case 262144:case 524288:case 1048576:case 2097152:return c&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return c&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return c}}function ce(c,d,m){var w=c.pendingLanes;if(w===0)return 0;var E=0,k=c.suspendedLanes,B=c.pingedLanes;c=c.warmLanes;var J=w&134217727;return J!==0?(w=J&~k,w!==0?E=ae(w):(B&=J,B!==0?E=ae(B):m||(m=J&~c,m!==0&&(E=ae(m))))):(J=w&~k,J!==0?E=ae(J):B!==0?E=ae(B):m||(m=w&~c,m!==0&&(E=ae(m)))),E===0?0:d!==0&&d!==E&&(d&k)===0&&(k=E&-E,m=d&-d,k>=m||k===32&&(m&4194048)!==0)?d:E}function ye(c,d){return(c.pendingLanes&~(c.suspendedLanes&~c.pingedLanes)&d)===0}function Pe(c,d){switch(c){case 1:case 2:case 4:case 8:case 64:return d+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return d+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Re(){var c=le;return le<<=1,(le&62914560)===0&&(le=4194304),c}function it(c){for(var d=[],m=0;31>m;m++)d.push(c);return d}function bt(c,d){c.pendingLanes|=d,d!==268435456&&(c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0)}function Ut(c,d,m,w,E,k){var B=c.pendingLanes;c.pendingLanes=m,c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0,c.expiredLanes&=m,c.entangledLanes&=m,c.errorRecoveryDisabledLanes&=m,c.shellSuspendCounter=0;var J=c.entanglements,ne=c.expirationTimes,ge=c.hiddenUpdates;for(m=B&~m;0<m;){var ke=31-bn(m),Ne=1<<ke;J[ke]=0,ne[ke]=-1;var be=ge[ke];if(be!==null)for(ge[ke]=null,ke=0;ke<be.length;ke++){var _e=be[ke];_e!==null&&(_e.lane&=-536870913)}m&=~Ne}w!==0&&St(c,w,0),k!==0&&E===0&&c.tag!==0&&(c.suspendedLanes|=k&~(B&~d))}function St(c,d,m){c.pendingLanes|=d,c.suspendedLanes&=~d;var w=31-bn(d);c.entangledLanes|=d,c.entanglements[w]=c.entanglements[w]|1073741824|m&261930}function jt(c,d){var m=c.entangledLanes|=d;for(c=c.entanglements;m;){var w=31-bn(m),E=1<<w;E&d|c[w]&d&&(c[w]|=d),m&=~E}}function Hn(c,d){var m=d&-d;return m=(m&42)!==0?1:ot(m),(m&(c.suspendedLanes|d))!==0?0:m}function ot(c){switch(c){case 2:c=1;break;case 8:c=4;break;case 32:c=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:c=128;break;case 268435456:c=134217728;break;default:c=0}return c}function Nn(c){return c&=-c,2<c?8<c?(c&134217727)!==0?32:268435456:8:2}function Jn(){var c=M.p;return c!==0?c:(c=window.event,c===void 0?32:_D(c.type))}function Fr(c,d){var m=M.p;try{return M.p=c,d()}finally{M.p=m}}var lr=Math.random().toString(36).slice(2),en="__reactFiber$"+lr,Dn="__reactProps$"+lr,cr="__reactContainer$"+lr,zr="__reactEvents$"+lr,ga="__reactListeners$"+lr,Vo="__reactHandles$"+lr,Ho="__reactResources$"+lr,Wt="__reactMarker$"+lr;function Un(c){delete c[en],delete c[Dn],delete c[zr],delete c[ga],delete c[Vo]}function Ct(c){var d=c[en];if(d)return d;for(var m=c.parentNode;m;){if(d=m[cr]||m[en]){if(m=d.alternate,d.child!==null||m!==null&&m.child!==null)for(c=sD(c);c!==null;){if(m=c[en])return m;c=sD(c)}return d}c=m,m=c.parentNode}return null}function wn(c){if(c=c[en]||c[cr]){var d=c.tag;if(d===5||d===6||d===13||d===31||d===26||d===27||d===3)return c}return null}function Wn(c){var d=c.tag;if(d===5||d===26||d===27||d===6)return c.stateNode;throw Error(r(33))}function Dr(c){var d=c[Ho];return d||(d=c[Ho]={hoistableStyles:new Map,hoistableScripts:new Map}),d}function _n(c){c[Wt]=!0}var xc=new Set,pn={};function si(c,d){Pi(c,d),Pi(c+"Capture",d)}function Pi(c,d){for(pn[c]=d,c=0;c<d.length;c++)xc.add(d[c])}var Bs=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),G2={},ip={};function W9(c){return ve.call(ip,c)?!0:ve.call(G2,c)?!1:Bs.test(c)?ip[c]=!0:(G2[c]=!0,!1)}function sp(c,d,m){if(W9(d))if(m===null)c.removeAttribute(d);else{switch(typeof m){case"undefined":case"function":case"symbol":c.removeAttribute(d);return;case"boolean":var w=d.toLowerCase().slice(0,5);if(w!=="data-"&&w!=="aria-"){c.removeAttribute(d);return}}c.setAttribute(d,""+m)}}function ap(c,d,m){if(m===null)c.removeAttribute(d);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":c.removeAttribute(d);return}c.setAttribute(d,""+m)}}function Wo(c,d,m,w){if(w===null)c.removeAttribute(m);else{switch(typeof w){case"undefined":case"function":case"symbol":case"boolean":c.removeAttribute(m);return}c.setAttributeNS(d,m,""+w)}}function Fs(c){switch(typeof c){case"bigint":case"boolean":case"number":case"string":case"undefined":return c;case"object":return c;default:return""}}function M5(c){var d=c.type;return(c=c.nodeName)&&c.toLowerCase()==="input"&&(d==="checkbox"||d==="radio")}function q9(c,d,m){var w=Object.getOwnPropertyDescriptor(c.constructor.prototype,d);if(!c.hasOwnProperty(d)&&typeof w<"u"&&typeof w.get=="function"&&typeof w.set=="function"){var E=w.get,k=w.set;return Object.defineProperty(c,d,{configurable:!0,get:function(){return E.call(this)},set:function(B){m=""+B,k.call(this,B)}}),Object.defineProperty(c,d,{enumerable:w.enumerable}),{getValue:function(){return m},setValue:function(B){m=""+B},stopTracking:function(){c._valueTracker=null,delete c[d]}}}}function xm(c){if(!c._valueTracker){var d=M5(c)?"checked":"value";c._valueTracker=q9(c,d,""+c[d])}}function D5(c){if(!c)return!1;var d=c._valueTracker;if(!d)return!0;var m=d.getValue(),w="";
vendor: 4,728 bytes, line 49
49return c&&(w=M5(c)?c.checked?"true":"false":c.value),c=w,c!==m?(d.setValue(c),!0):!1}function op(c){if(c=c||(typeof document<"u"?document:void 0),typeof c>"u")return null;try{return c.activeElement||c.body}catch{return c.body}}var Z9=/[\n"\\]/g;function zs(c){return c.replace(Z9,function(d){return"\\"+d.charCodeAt(0).toString(16)+" "})}function Cm(c,d,m,w,E,k,B,J){c.name="",B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"?c.type=B:c.removeAttribute("type"),d!=null?B==="number"?(d===0&&c.value===""||c.value!=d)&&(c.value=""+Fs(d)):c.value!==""+Fs(d)&&(c.value=""+Fs(d)):B!=="submit"&&B!=="reset"||c.removeAttribute("value"),d!=null?Em(c,B,Fs(d)):m!=null?Em(c,B,Fs(m)):w!=null&&c.removeAttribute("value"),E==null&&k!=null&&(c.defaultChecked=!!k),E!=null&&(c.checked=E&&typeof E!="function"&&typeof E!="symbol"),J!=null&&typeof J!="function"&&typeof J!="symbol"&&typeof J!="boolean"?c.name=""+Fs(J):c.removeAttribute("name")}function U5(c,d,m,w,E,k,B,J){if(k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(c.type=k),d!=null||m!=null){if(!(k!=="submit"&&k!=="reset"||d!=null)){xm(c);return}m=m!=null?""+Fs(m):"",d=d!=null?""+Fs(d):m,J||d===c.value||(c.value=d),c.defaultValue=d}w=w??E,w=typeof w!="function"&&typeof w!="symbol"&&!!w,c.checked=J?c.checked:!!w,c.defaultChecked=!!w,B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"&&(c.name=B),xm(c)}function Em(c,d,m){d==="number"&&op(c.ownerDocument)===c||c.defaultValue===""+m||(c.defaultValue=""+m)}function Gu(c,d,m,w){if(c=c.options,d){d={};for(var E=0;E<m.length;E++)d["$"+m[E]]=!0;for(m=0;m<c.length;m++)E=d.hasOwnProperty("$"+c[m].value),c[m].selected!==E&&(c[m].selected=E),E&&w&&(c[m].defaultSelected=!0)}else{for(m=""+Fs(m),d=null,E=0;E<c.length;E++){if(c[E].value===m){c[E].selected=!0,w&&(c[E].defaultSelected=!0);return}d!==null||c[E].disabled||(d=c[E])}d!==null&&(d.selected=!0)}}function B5(c,d,m){if(d!=null&&(d=""+Fs(d),d!==c.value&&(c.value=d),m==null)){c.defaultValue!==d&&(c.defaultValue=d);return}c.defaultValue=m!=null?""+Fs(m):""}function F5(c,d,m,w){if(d==null){if(w!=null){if(m!=null)throw Error(r(92));if(T(w)){if(1<w.length)throw Error(r(93));w=w[0]}m=w}m==null&&(m=""),d=m}m=Fs(d),c.defaultValue=m,w=c.textContent,w===m&&w!==""&&w!==null&&(c.value=w),xm(c)}function Yu(c,d){if(d){var m=c.firstChild;if(m&&m===c.lastChild&&m.nodeType===3){m.nodeValue=d;return}}c.textContent=d}var K9=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function z5(c,d,m){var w=d.indexOf("--")===0;m==null||typeof m=="boolean"||m===""?w?c.setProperty(d,""):d==="float"?c.cssFloat="":c[d]="":w?c.setProperty(d,m):typeof m!="number"||m===0||K9.has(d)?d==="float"?c.cssFloat=m:c[d]=(""+m).trim():c[d]=m+"px"}function V5(c,d,m){if(d!=null&&typeof d!="object")throw Error(r(62));if(c=c.style,m!=null){for(var w in m)!m.hasOwnProperty(w)||d!=null&&d.hasOwnProperty(w)||(w.indexOf("--")===0?c.setProperty(w,""):w==="float"?c.cssFloat="":c[w]="");for(var E in d)w=d[E],d.hasOwnProperty(E)&&m[E]!==w&&z5(c,E,w)}else for(var k in d)d.hasOwnProperty(k)&&z5(c,k,d[k])}function Sm(c){if(c.indexOf("-")===-1)return!1;switch(c){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var G9=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRen
49dering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Y9=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function lp(c){return Y9.test(""+c)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":c}function qo(){}var Am=null;function km(c){return c=c.target||c.srcElement||window,c.correspondingUseElement&&(c=c.correspondingUseElement),c.nodeType===3?c.parentNode:c}var Ju=null,Xu=null;function H5(c){var d=wn(c);if(d&&(c=d.stateNode)){var m=c[Dn]||null;e:switch(c=d.stateNode,d.type){case"input":if(Cm(c,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name),d=m.name,m.type==="radio"&&d!=null){for(m=c;m.parentNode;)m=m.parentNode;for(m=m.querySelectorAll('input[name="'+zs(""+d)+'"][type="radio"]'),d=0;d<m.length;d++){var w=m[d];if(w!==c&&w.form===c.form){var E=w[Dn]||null;if(!E)throw Error(r(90));Cm(w,E.value,E.defaultValue,E.defaultValue,E.checked,E.defaultChecked,E.type,E.name)}}for(d=0;d<m.length;d++)w=m[d],w.form===c.form&&D5(w)}break e;case"textarea":B5(c,m.value,m.defaultValue);break e;case"select":d=m.value,d!=null&&Gu(c,!!m.multiple,d,!1)}}}var Tm=!1;function W5(c,d,m){if(Tm)return c(d,m);Tm=!0;try{var w=c(d);return w}finally{if(Tm=!1,(Ju!==null||Xu!==null)&&(Lb(),Ju&&(d=Ju,c=Xu,Xu=Ju=null,H5(d),c)))for(d=0;d<c.length;d++)H5(c[d])}}function Y2(c,d){var m=c.stateNode;if(m===null)return null;var w=m[Dn]||null;if(w===null)return null;m=w[d];e:switch(d){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(w=!w.disabled)||(c=c.type,w=!(c==="button"||c==="input"||c==="select"||c==="textarea")),c=!w;break e;default:c=!1}if(c)return null;if(m&&typeof m!="function")throw Error(r(231,d,typeof m));return m}var Ga=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Lm=!1;
vendor: 11,336 bytes, line 49
49if(Ga)try{var he={};Object.defineProperty(he,"passive",{get:function(){Lm=!0}}),window.addEventListener("test",he,he),window.removeEventListener("test",he,he)}catch{Lm=!1}var ee=null,re=null,Ee=null;function De(){if(Ee)return Ee;var c,d=re,m=d.length,w,E="value"in ee?ee.value:ee.textContent,k=E.length;for(c=0;c<m&&d[c]===E[c];c++);var B=m-c;for(w=1;w<=B&&d[m-w]===E[k-w];w++);return Ee=E.slice(c,1<w?1-w:void 0)}function Zt(c){var d=c.keyCode;return"charCode"in c?(c=c.charCode,c===0&&d===13&&(c=13)):c=d,c===10&&(c=13),32<=c||c===13?c:0}function wr(){return!0}function Gi(){return!1}function Ci(c){function d(m,w,E,k,B){this._reactName=m,this._targetInst=E,this.type=w,this.nativeEvent=k,this.target=B,this.currentTarget=null;for(var J in c)c.hasOwnProperty(J)&&(m=c[J],this[J]=m?m(k):k[J]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?wr:Gi,this.isPropagationStopped=Gi,this}return p(d.prototype,{preventDefault:function(){this.defaultPrevented=!0;var m=this.nativeEvent;m&&(m.preventDefault?m.preventDefault():typeof m.returnValue!="unknown"&&(m.returnValue=!1),this.isDefaultPrevented=wr)},stopPropagation:function(){var m=this.nativeEvent;m&&(m.stopPropagation?m.stopPropagation():typeof m.cancelBubble!="unknown"&&(m.cancelBubble=!0),this.isPropagationStopped=wr)},persist:function(){},isPersistent:wr}),d}var Cc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(c){return c.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},cp=Ci(Cc),Qu=p({},Cc,{view:0,detail:0}),q5=Ci(Qu),up,dp,$m,Z5=p({},Qu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:X9,button:0,buttons:0,relatedTarget:function(c){return c.relatedTarget===void 0?c.fromElement===c.srcElement?c.toElement:c.fromElement:c.relatedTarget},movementX:function(c){return"movementX"in c?c.movementX:(c!==$m&&($m&&c.type==="mousemove"?(up=c.screenX-$m.screenX,dp=c.screenY-$m.screenY):dp=up=0,$m=c),up)},movementY:function(c){return"movementY"in c?c.movementY:dp}}),eR=Ci(Z5),zue=p({},Z5,{dataTransfer:0}),Vue=Ci(zue),Hue=p({},Qu,{relatedTarget:0}),J9=Ci(Hue),Wue=p({},Cc,{animationName:0,elapsedTime:0,pseudoElement:0}),que=Ci(Wue),Zue=p({},Cc,{clipboardData:function(c){return"clipboardData"in c?c.clipboardData:window.clipboardData}}),Kue=Ci(Zue),Gue=p({},Cc,{data:0}),tR=Ci(Gue),Yue={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Jue={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Xue={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Que(c){var d=this.nativeEvent;return d.getModifierState?d.getModifierState(c):(c=Xue[c])?!!d[c]:!1}function X9(){return Que}var ede=p({},Qu,{key:function(c){if(c.key){var d=Yue[c.key]||c.key;if(d!=="Unidentified")return d}return c.type==="keypress"?(c=Zt(c),c===13?"Enter":String.fromCharCode(c)):c.type==="keydown"||c.type==="keyup"?Jue[c.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:X9,charCode:function(c){return c.type==="keypress"?Zt(c):0},keyCode:function(c){return c.type==="keydown"||c.type==="keyup"?c.keyCode:0},which:function(c){return c.type==="keypress"?Zt(c):c.type==="keydown"||c.type==="keyup"?c.keyCode:0}}),tde=Ci(ede),nde=p({},Z5,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),nR=Ci(nde),rde=p({},Qu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:X9}),ide=Ci(rde),sde=p({},Cc,{propertyName:0,elapsedTime:0,pseudoElement:0}),ade=Ci(sde),ode=p({},Z5,{deltaX:function(c){return"deltaX"in c?c.deltaX:"wheelDeltaX"in c?-c.wheelDeltaX:0},deltaY:function(c){return"deltaY"in c?c.deltaY:"wheelDeltaY"in c?-c.wheelDeltaY:"wheelDelta"in c?-c.wheelDelta:0},deltaZ:0,deltaMode:0}),lde=Ci(ode),cde=p({},Cc,{newState:0,oldState:0}),ude=Ci(cde),dde=[9,13,27,32],Q9=Ga&&"CompositionEvent"in window,Im=null;Ga&&"documentMode"in document&&(Im=document.documentMode);var hde=Ga&&"TextEvent"in window&&!Im,rR=Ga&&(!Q9||Im&&8<Im&&11>=Im),iR=" ",sR=!1;function aR(c,d){switch(c){case"keyup":return dde.indexOf(d.keyCode)!==-1;case"keydown":return d.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function oR(c){return c=c.detail,typeof c=="object"&&"data"in c?c.data:null}var hp=!1;function fde(c,d){switch(c){case"compositionend":return oR(d);case"keypress":return d.which!==32?null:(sR=!0,iR);case"textInput":return c=d.data,c===iR&&sR?null:c;default:return null}}function pde(c,d){if(hp)return c==="compositionend"||!Q9&&aR(c,d)?(c=De(),Ee=re=ee=null,hp=!1,c):null;switch(c){case"paste":return null;case"keypress":if(!(d.ctrlKey||d.altKey||d.metaKey)||d.ctrlKey&&d.altKey){if(d.char&&1<d.char.length)return d.char;if(d.which)return String.fromCharCode(d.which)}return null;case"compositionend":return rR&&d.locale!=="ko"?null:d.data;default:return null}}var mde={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function lR(c){var d=c&&c.nodeName&&c.nodeName.toLowerCase();return d==="input"?!!mde[c.type]:d==="textarea"}function cR(c,d,m,w){Ju?Xu?Xu.push(w):Xu=[w]:Ju=w,d=jb(d,"onChange"),0<d.length&&(m=new cp("onChange","change",null,m,w),c.push({event:m,listeners:d}))}var Nm=null,Om=null;function yde(c){WM(c,0)}function K5(c){var d=Wn(c);if(D5(d))return c}function uR(c,d){if(c==="change")return d}var dR=!1;if(Ga){var e_;if(Ga){var t_="oninput"in document;if(!t_){var hR=document.createElement("div");hR.setAttribute("oninput","return;"),t_=typeof hR.oninput=="function"}e_=t_}else e_=!1;dR=e_&&(!document.documentMode||9<document.documentMode)}function fR(){Nm&&(Nm.detachEvent("onpropertychange",pR),Om=Nm=null)}function pR(c){if(c.propertyName==="value"&&K5(Om)){var d=[];cR(d,Om,c,km(c)),W5(yde,d)}}function gde(c,d,m){c==="focusin"?(fR(),Nm=d,Om=m,Nm.attachEvent("onpropertychange",pR)):c==="focusout"&&fR()}function bde(c){if(c==="selectionchange"||c==="keyup"||c==="keydown")return K5(Om)}function wde(c,d){if(c==="click")return K5(d)}function vde(c,d){if(c==="input"||c==="change")return K5(d)}function _de(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}var ba=typeof Object.is=="function"?Object.is:_de;function Pm(c,d){if(ba(c,d))return!0;if(typeof c!="object"||c===null||typeof d!="object"||d===null)return!1;var m=Object.keys(c),w=Object.keys(d);if(m.length!==w.length)return!1;for(w=0;w<m.length;w++){var E=m[w];if(!ve.call(d,E)||!ba(c[E],d[E]))return!1}return!0}function mR(c){for(;c&&c.firstChild;)c=c.firstChild;return c}function yR(c,d){var m=mR(c);c=0;for(var w;m;){if(m.nodeType===3){if(w=c+m.textContent.length,c<=d&&w>=d)return{node:m,offset:d-c};c=w}e:{for(;m;){if(m.nextSibling){m=m.nextSibling;break e}m=m.parentNode}m=void 0}m=mR(m)}}function gR(c,d){return c&&d?c===d?!0:c&&c.nodeType===3?!1:d&&d.nodeType===3?gR(c,d.parentNode):"contains"in c?c.contains(d):c.compareDocumentPosition?!!(c.compareDocumentPosition(d)&16):!1:!1}function bR(c){c=c!=null&&c.ownerDocument!=null&&c.ownerDocument.defaultView!=null?c.ownerDocument.defaultView:window;for(var d=op(c.document);d instanceof c.HTMLIFrameElement;){try{var m=typeof d.contentWindow.location.href=="string"}catch{m=!1}if(m)c=d.contentWindow;else break;d=op(c.document)}return d}function n_(c){var d=c&&c.nodeName&&c.nodeName.toLowerCase();return d&&(d==="input"&&(c.type==="text"||c.type==="search"||c.type==="tel"||c.type==="url"||c.type==="password")||d==="textarea"||c.contentEditable==="true")}var xde=Ga&&"documentMode"in document&&11>=document.documentMode,fp=null,r_=null,Rm=null,i_=!1;function wR(c,d,m){var w=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;i_||fp==null||fp!==op(w)||(w=fp,"selectionStart"in w&&n_(w)?w={start:w.selectionStart,end:w.selectionEnd}:(w=(w.ownerDocument&&w.ownerDocument.defaultView||window).getSelection(),w={anchorNode:w.anchorNode,anchorOffset:w.anchorOffset,focusNode:w.focusNode,focusOffset:w.focusOffset}),Rm&&Pm(Rm,w)||(Rm=w,w=jb(r_,"onSelect"),0<w.length&&(d=new cp("onSelect","select",null,d,m),c.push({event:d,listeners:w}),d.target=fp)))}function J2(c,d){var m={};return m[c.toLowerCase()]=d.toLowerCase(),m["Webkit"+c]="webkit"+d,m["Moz"+c]="moz"+d,m}var pp={animationend:J2("Animation","AnimationEnd"),animationiteration:J2("Animation","AnimationIteration"),animationstart:J2("Animation","AnimationStart"),transitionrun:J2("Transition","TransitionRun"),transitionstart:J2("Transition","TransitionStart"),transitioncancel:J2("Transition","TransitionCancel"),transitionend:J2("Transition","TransitionEnd")},s_={},vR={};Ga&&(vR=document.createElement("div").style,"AnimationEvent"in window||(delete pp.animationend.animation,delete pp.animationiteration.animation,delete pp.animationstart.animation),"TransitionEvent"in window||delete pp.transitionend.transition);function X2(c){if(s_[c])return s_[c];if(!pp[c])return c;var d=pp[c],m;for(m in d)if(d.hasOwnProperty(m)&&m in vR)return s_[c]=d[m];return c}var _R=X2("animationend"),xR=X2("animationiteration"),CR=X2("animationstart"),Cde=X2("transitionrun"),Ede=X2("transitionstart"),Sde=X2("transitioncancel"),ER=X2("transitionend"),SR=new Map,a_="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");a_.push("scrollEnd");function Zo(c,d){SR.set(c,d),si(d,[c])}var G5=typeof reportError=="function"?reportError:function(c){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var d=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof c=="object"&&c!==null&&typeof c.message=="string"?String(c.message):String(c),error:c});if(!window.dispatchEvent(d))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",c);return}console.error(c)},Ya=[],mp=0,o_=0;function Y5(){for(var c=mp,d=o_=mp=0;d<c;){var m=Ya[d];Ya[d++]=null;var w=Ya[d];Ya[d++]=null;var E=Ya[d];Ya[d++]=null;var k=Ya[d];if(Ya[d++]=null,w!==null&&E!==null){var B=w.pending;B===null?E.next=E:(E.next=B.next,B.next=E),w.pending=E}k!==0&&AR(m,E,k)}}function J5(c,d,m,w){Ya[mp++]=c,Ya[mp++]=d,Ya[mp++]=m,Ya[mp++]=w,o_|=w,c.lanes|=w,c=c.alternate,c!==null&&(c.lanes|=w)}function l_(c,d,m,w){return J5(c,d,m,w),X5(c)}
vendor: 1,959 bytes, line 49
49function Q2(c,d){return J5(c,null,null,d),X5(c)}function AR(c,d,m){c.lanes|=m;var w=c.alternate;w!==null&&(w.lanes|=m);for(var E=!1,k=c.return;k!==null;)k.childLanes|=m,w=k.alternate,w!==null&&(w.childLanes|=m),k.tag===22&&(c=k.stateNode,c===null||c._visibility&1||(E=!0)),c=k,k=k.return;return c.tag===3?(k=c.stateNode,E&&d!==null&&(E=31-bn(m),c=k.hiddenUpdates,w=c[E],w===null?c[E]=[d]:w.push(d),d.lane=m|536870912),k):null}function X5(c){if(50<ry)throw ry=0,gx=null,Error(r(185));for(var d=c.return;d!==null;)c=d,d=c.return;return c.tag===3?c.stateNode:null}var yp={};function Ade(c,d,m,w){this.tag=c,this.key=m,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=d,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=w,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wa(c,d,m,w){return new Ade(c,d,m,w)}function c_(c){return c=c.prototype,!(!c||!c.isReactComponent)}function Ec(c,d){var m=c.alternate;return m===null?(m=wa(c.tag,d,c.key,c.mode),m.elementType=c.elementType,m.type=c.type,m.stateNode=c.stateNode,m.alternate=c,c.alternate=m):(m.pendingProps=d,m.type=c.type,m.flags=0,m.subtreeFlags=0,m.deletions=null),m.flags=c.flags&65011712,m.childLanes=c.childLanes,m.lanes=c.lanes,m.child=c.child,m.memoizedProps=c.memoizedProps,m.memoizedState=c.memoizedState,m.updateQueue=c.updateQueue,d=c.dependencies,m.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},m.sibling=c.sibling,m.index=c.index,m.ref=c.ref,m.refCleanup=c.refCleanup,m}function kR(c,d){c.flags&=65011714;var m=c.alternate;return m===null?(c.childLanes=0,c.lanes=d,c.child=null,c.subtreeFlags=0,c.memoizedProps=null,c.memoizedState=null,c.updateQueue=null,c.dependencies=null,c.stateNode=null):(c.childLanes=m.childLanes,c.lanes=m.lanes,c.child=m.child,c.subtreeFlags=0,c.deleti
vendor: 18,069 bytes, line 49
49ons=null,c.memoizedProps=m.memoizedProps,c.memoizedState=m.memoizedState,c.updateQueue=m.updateQueue,c.type=m.type,d=m.dependencies,c.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext}),c}function Q5(c,d,m,w,E,k){var B=0;if(w=c,typeof c=="function")c_(c)&&(B=1);else if(typeof c=="string")B=I2e(c,m,Y.current)?26:c==="html"||c==="head"||c==="body"?27:5;else e:switch(c){case j:return c=wa(31,m,d,E),c.elementType=j,c.lanes=k,c;case v:return eh(m.children,E,k,d);case _:B=8,E|=24;break;case C:return c=wa(12,m,d,E|2),c.elementType=C,c.lanes=k,c;case I:return c=wa(13,m,d,E),c.elementType=I,c.lanes=k,c;case $:return c=wa(19,m,d,E),c.elementType=$,c.lanes=k,c;default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case x:B=10;break e;case S:B=9;break e;case A:B=11;break e;case O:B=14;break e;case P:B=16,w=null;break e}B=29,m=Error(r(130,c===null?"null":typeof c,"")),w=null}return d=wa(B,m,d,E),d.elementType=c,d.type=w,d.lanes=k,d}function eh(c,d,m,w){return c=wa(7,c,w,d),c.lanes=m,c}function u_(c,d,m){return c=wa(6,c,null,d),c.lanes=m,c}function TR(c){var d=wa(18,null,null,0);return d.stateNode=c,d}function d_(c,d,m){return d=wa(4,c.children!==null?c.children:[],c.key,d),d.lanes=m,d.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},d}var LR=new WeakMap;function Ja(c,d){if(typeof c=="object"&&c!==null){var m=LR.get(c);return m!==void 0?m:(d={value:c,source:d,stack:gr(d)},LR.set(c,d),d)}return{value:c,source:d,stack:gr(d)}}var gp=[],bp=0,eb=null,jm=0,Xa=[],Qa=0,ed=null,kl=1,Tl="";function Sc(c,d){gp[bp++]=jm,gp[bp++]=eb,eb=c,jm=d}function $R(c,d,m){Xa[Qa++]=kl,Xa[Qa++]=Tl,Xa[Qa++]=ed,ed=c;var w=kl;c=Tl;var E=32-bn(w)-1;w&=~(1<<E),m+=1;var k=32-bn(d)+E;if(30<k){var B=E-E%5;k=(w&(1<<B)-1).toString(32),w>>=B,E-=B,kl=1<<32-bn(d)+E|m<<E|w,Tl=k+c}else kl=1<<k|m<<E|w,Tl=c}function h_(c){c.return!==null&&(Sc(c,1),$R(c,1,0))}function f_(c){for(;c===eb;)eb=gp[--bp],gp[bp]=null,jm=gp[--bp],gp[bp]=null;for(;c===ed;)ed=Xa[--Qa],Xa[Qa]=null,Tl=Xa[--Qa],Xa[Qa]=null,kl=Xa[--Qa],Xa[Qa]=null}function IR(c,d){Xa[Qa++]=kl,Xa[Qa++]=Tl,Xa[Qa++]=ed,kl=d.id,Tl=d.overflow,ed=c}var Yi=null,vr=null,mn=!1,td=null,eo=!1,p_=Error(r(519));function nd(c){var d=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Mm(Ja(d,c)),p_}function NR(c){var d=c.stateNode,m=c.type,w=c.memoizedProps;switch(d[en]=c,d[Dn]=w,m){case"dialog":on("cancel",d),on("close",d);break;case"iframe":case"object":case"embed":on("load",d);break;case"video":case"audio":for(m=0;m<sy.length;m++)on(sy[m],d);break;case"source":on("error",d);break;case"img":case"image":case"link":on("error",d),on("load",d);break;case"details":on("toggle",d);break;case"input":on("invalid",d),U5(d,w.value,w.defaultValue,w.checked,w.defaultChecked,w.type,w.name,!0);break;case"select":on("invalid",d);break;case"textarea":on("invalid",d),F5(d,w.value,w.defaultValue,w.children)}m=w.children,typeof m!="string"&&typeof m!="number"&&typeof m!="bigint"||d.textContent===""+m||w.suppressHydrationWarning===!0||GM(d.textContent,m)?(w.popover!=null&&(on("beforetoggle",d),on("toggle",d)),w.onScroll!=null&&on("scroll",d),w.onScrollEnd!=null&&on("scrollend",d),w.onClick!=null&&(d.onclick=qo),d=!0):d=!1,d||nd(c,!0)}function OR(c){for(Yi=c.return;Yi;)switch(Yi.tag){case 5:case 31:case 13:eo=!1;return;case 27:case 3:eo=!0;return;default:Yi=Yi.return}}function wp(c){if(c!==Yi)return!1;if(!mn)return OR(c),mn=!0,!1;var d=c.tag,m;if((m=d!==3&&d!==27)&&((m=d===5)&&(m=c.type,m=!(m!=="form"&&m!=="button")||Nx(c.type,c.memoizedProps)),m=!m),m&&vr&&nd(c),OR(c),d===13){if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(r(317));vr=iD(c)}else if(d===31){if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(r(317));vr=iD(c)}else d===27?(d=vr,yd(c.type)?(c=Mx,Mx=null,vr=c):vr=d):vr=Yi?no(c.stateNode.nextSibling):null;return!0}function th(){vr=Yi=null,mn=!1}function m_(){var c=td;return c!==null&&(qs===null?qs=c:qs.push.apply(qs,c),td=null),c}function Mm(c){td===null?td=[c]:td.push(c)}var y_=F(null),nh=null,Ac=null;function rd(c,d,m){G(y_,d._currentValue),d._currentValue=m}function kc(c){c._currentValue=y_.current,q(y_)}function g_(c,d,m){for(;c!==null;){var w=c.alternate;if((c.childLanes&d)!==d?(c.childLanes|=d,w!==null&&(w.childLanes|=d)):w!==null&&(w.childLanes&d)!==d&&(w.childLanes|=d),c===m)break;c=c.return}}function b_(c,d,m,w){var E=c.child;for(E!==null&&(E.return=c);E!==null;){var k=E.dependencies;if(k!==null){var B=E.child;k=k.firstContext;e:for(;k!==null;){var J=k;k=E;for(var ne=0;ne<d.length;ne++)if(J.context===d[ne]){k.lanes|=m,J=k.alternate,J!==null&&(J.lanes|=m),g_(k.return,m,c),w||(B=null);break e}k=J.next}}else if(E.tag===18){if(B=E.return,B===null)throw Error(r(341));B.lanes|=m,k=B.alternate,k!==null&&(k.lanes|=m),g_(B,m,c),B=null}else B=E.child;if(B!==null)B.return=E;else for(B=E;B!==null;){if(B===c){B=null;break}if(E=B.sibling,E!==null){E.return=B.return,B=E;break}B=B.return}E=B}}function vp(c,d,m,w){c=null;for(var E=d,k=!1;E!==null;){if(!k){if((E.flags&524288)!==0)k=!0;else if((E.flags&262144)!==0)break}if(E.tag===10){var B=E.alternate;if(B===null)throw Error(r(387));if(B=B.memoizedProps,B!==null){var J=E.type;ba(E.pendingProps.value,B.value)||(c!==null?c.push(J):c=[J])}}else if(E===ie.current){if(B=E.alternate,B===null)throw Error(r(387));B.memoizedState.memoizedState!==E.memoizedState.memoizedState&&(c!==null?c.push(uy):c=[uy])}E=E.return}c!==null&&b_(d,c,m,w),d.flags|=262144}function tb(c){for(c=c.firstContext;c!==null;){if(!ba(c.context._currentValue,c.memoizedValue))return!0;c=c.next}return!1}function rh(c){nh=c,Ac=null,c=c.dependencies,c!==null&&(c.firstContext=null)}function Ji(c){return PR(nh,c)}function nb(c,d){return nh===null&&rh(c),PR(c,d)}function PR(c,d){var m=d._currentValue;if(d={context:d,memoizedValue:m,next:null},Ac===null){if(c===null)throw Error(r(308));Ac=d,c.dependencies={lanes:0,firstContext:d},c.flags|=524288}else Ac=Ac.next=d;return m}var kde=typeof AbortController<"u"?AbortController:function(){var c=[],d=this.signal={aborted:!1,addEventListener:function(m,w){c.push(w)}};this.abort=function(){d.aborted=!0,c.forEach(function(m){return m()})}},Tde=t.unstable_scheduleCallback,Lde=t.unstable_NormalPriority,ai={$$typeof:x,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function w_(){return{controller:new kde,data:new Map,refCount:0}}function Dm(c){c.refCount--,c.refCount===0&&Tde(Lde,function(){c.controller.abort()})}var Um=null,v_=0,_p=0,xp=null;function $de(c,d){if(Um===null){var m=Um=[];v_=0,_p=Cx(),xp={status:"pending",value:void 0,then:function(w){m.push(w)}}}return v_++,d.then(RR,RR),d}function RR(){if(--v_===0&&Um!==null){xp!==null&&(xp.status="fulfilled");var c=Um;Um=null,_p=0,xp=null;for(var d=0;d<c.length;d++)(0,c[d])()}}function Ide(c,d){var m=[],w={status:"pending",value:null,reason:null,then:function(E){m.push(E)}};return c.then(function(){w.status="fulfilled",w.value=d;for(var E=0;E<m.length;E++)(0,m[E])(d)},function(E){for(w.status="rejected",w.reason=E,E=0;E<m.length;E++)(0,m[E])(void 0)}),w}var jR=L.S;L.S=function(c,d){wM=$t(),typeof d=="object"&&d!==null&&typeof d.then=="function"&&$de(c,d),jR!==null&&jR(c,d)};var ih=F(null);function __(){var c=ih.current;return c!==null?c:Xn.pooledCache}function rb(c,d){d===null?G(ih,ih.current):G(ih,d.pool)}function MR(){var c=__();return c===null?null:{parent:ai._currentValue,pool:c}}var Cp=Error(r(460)),x_=Error(r(474)),ib=Error(r(542)),sb={then:function(){}};function DR(c){return c=c.status,c==="fulfilled"||c==="rejected"}function UR(c,d,m){switch(m=c[m],m===void 0?c.push(d):m!==d&&(d.then(qo,qo),d=m),d.status){case"fulfilled":return d.value;case"rejected":throw c=d.reason,FR(c),c;default:if(typeof d.status=="string")d.then(qo,qo);else{if(c=Xn,c!==null&&100<c.shellSuspendCounter)throw Error(r(482));c=d,c.status="pending",c.then(function(w){if(d.status==="pending"){var E=d;E.status="fulfilled",E.value=w}},function(w){if(d.status==="pending"){var E=d;E.status="rejected",E.reason=w}})}switch(d.status){case"fulfilled":return d.value;case"rejected":throw c=d.reason,FR(c),c}throw ah=d,Cp}}function sh(c){try{var d=c._init;return d(c._payload)}catch(m){throw m!==null&&typeof m=="object"&&typeof m.then=="function"?(ah=m,Cp):m}}var ah=null;function BR(){if(ah===null)throw Error(r(459));var c=ah;return ah=null,c}function FR(c){if(c===Cp||c===ib)throw Error(r(483))}var Ep=null,Bm=0;function ab(c){var d=Bm;return Bm+=1,Ep===null&&(Ep=[]),UR(Ep,c,d)}function Fm(c,d){d=d.props.ref,c.ref=d!==void 0?d:null}function ob(c,d){throw d.$$typeof===y?Error(r(525)):(c=Object.prototype.toString.call(d),Error(r(31,c==="[object Object]"?"object with keys {"+Object.keys(d).join(", ")+"}":c)))}function zR(c){function d(de,oe){if(c){var me=de.deletions;me===null?(de.deletions=[oe],de.flags|=16):me.push(oe)}}function m(de,oe){if(!c)return null;for(;oe!==null;)d(de,oe),oe=oe.sibling;return null}function w(de){for(var oe=new Map;de!==null;)de.key!==null?oe.set(de.key,de):oe.set(de.index,de),de=de.sibling;return oe}function E(de,oe){return de=Ec(de,oe),de.index=0,de.sibling=null,de}function k(de,oe,me){return de.index=me,c?(me=de.alternate,me!==null?(me=me.index,me<oe?(de.flags|=67108866,oe):me):(de.flags|=67108866,oe)):(de.flags|=1048576,oe)}function B(de){return c&&de.alternate===null&&(de.flags|=67108866),de}function J(de,oe,me,$e){return oe===null||oe.tag!==6?(oe=u_(me,de.mode,$e),oe.return=de,oe):(oe=E(oe,me),oe.return=de,oe)}function ne(de,oe,me,$e){var xt=me.type;return xt===v?ke(de,oe,me.props.children,$e,me.key):oe!==null&&(oe.elementType===xt||typeof xt=="object"&&xt!==null&&xt.$$typeof===P&&sh(xt)===oe.type)?(oe=E(oe,me.props),Fm(oe,me),oe.return=de,oe):(oe=Q5(me.type,me.key,me.props,null,de.mode,$e),Fm(oe,me),oe.return=de,oe)}function ge(de,oe,me,$e){return oe===null||oe.tag!==4||oe.stateNode.containerInfo!==me.containerInfo||oe.stateNode.implementation!==me.implementation?(oe=d_(me,de.mode,$e),oe.return=de,oe):(oe=E(oe,me.children||[]),oe.return=de,oe)}function ke(de,oe,me,$e,xt){return oe===null||oe.tag!==7?(oe=eh(me,de.mode,$e,xt),oe.return=de,oe):(oe=E(oe,me),oe.return=de,oe)}function Ne(de,oe,me){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return oe=u_(""+oe,de.mode,me),oe.return=de,oe;if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case g:return me=Q5(oe.type,oe.key,oe.props,null,de.mode,me),Fm(me,oe),me.return=de,me;case b:return oe=d_(oe,de.mode,me),oe.return=de,oe;case P:return oe=sh(oe),Ne(de,oe,me)}if(T(oe)||D(oe))return oe=eh(oe,de.mode,me,null),oe.return=de,oe;if(typeof oe.then=="function")return Ne(de,ab(oe),me);if(oe.$$typeof===x)return Ne(de,nb(de,oe),me);ob(de,oe)}return null}function be(de,oe,me,$e){var xt=oe!==null?oe.key:null;if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return xt!==null?null:J(de,oe,""+me,$e);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case g:return me.key===xt?ne(de,oe,me,$e):null;case b:return me.key===xt?ge(de,oe,me,$e):null;case P:return me=sh(me),be(de,oe,me,$e)}if(T(me)||D(me))return xt!==null?null:ke(de,oe,me,$e,null);if(typeof me.then=="function")return be(de,oe,ab(me),$e);if(me.$$typeof===x)return be(de,oe,nb(de,me),$e);ob(de,me)}return null}function _e(de,oe,me,$e,xt){if(typeof $e=="string"&&$e!==""||typeof $e=="number"||typeof $e=="bigint")return de=de.get(me)||null,J(oe,de,""+$e,xt);if(typeof $e=="object"&&$e!==null){switch($e.$$typeof){case g:return de=de.get($e.key===null?me:$e.key)||null,ne(oe,de,$e,xt);case b:return de=de.get($e.key===null?me:$e.key)||null,ge(oe,de,$e,xt);case P:return $e=sh($e),_e(de,oe,me,$e,xt)}if(T($e)||D($e))return de=de.get(me)||null,ke(oe,de,$e,xt,null);if(typeof $e.then=="function")return _e(de,oe,me,ab($e),xt);if($e.$$typeof===x)return _e(de,oe,me,nb(oe,$e),xt);ob(oe,$e)}return null}function at(de,oe,me,$e){for(var xt=null,Sn=null,dt=oe,Yt=oe=0,un=null;dt!==null&&Yt<me.length;Yt++){dt.index>Yt?(un=dt,dt=null):un=dt.sibling;var An=be(de,dt,me[Yt],$e);if(An===null){dt===null&&(dt=un);break}c&&dt&&An.alternate===null&&d(de,dt),oe=k(An,oe,Yt),Sn===null?xt=An:Sn.sibling=An,Sn=An,dt=un}if(Yt===me.length)return m(de,dt),mn&&Sc(de,Yt),xt;if(dt===null){for(;Yt<me.length;Yt++)dt=Ne(de,me[Yt],$e),dt!==null&&(oe=k(dt,oe,Yt),Sn===null?xt=dt:Sn.sibling=dt,Sn=dt);return mn&&Sc(de,Yt),xt}for(dt=w(dt);Yt<me.length;Yt++)un=_e(dt,de,Yt,me[Yt],$e),un!==null&&(c&&un.alternate!==null&&dt.delete(un.key===null?Yt:un.key),oe=k(un,oe,Yt),Sn===null?xt=un:Sn.sibling=un,Sn=un);return c&&dt.forEach(function(_d){return d(de,_d)}),mn&&Sc(de,Yt),xt}function At(de,oe,me,$e){if(me==null)throw Error(r(151));for(var xt=null,Sn=null,dt=oe,Yt=oe=0,un=null,An=me.next();dt!==null&&!An.done;Yt++,An=me.next()){dt.index>Yt?(un=dt,dt=null):un=dt.sibling;var _d=be(de,dt,An.value,$e);if(_d===null){dt===null&&(dt=un);break}c&&dt&&_d.alternate===null&&d(de,dt),oe=k(_d,oe,Yt),Sn===null?xt=_d:Sn.sibling=_d,Sn=_d,dt=un}if(An.done)return m(de,dt),mn&&Sc(de,Yt),xt;if(dt===null){for(;!An.done;Yt++,An=me.next())An=Ne(de,An.value,$e),An!==null&&(oe=k(An,oe,Yt),Sn===null?xt=An:Sn.sibling=An,Sn=An);return mn&&Sc(de,Yt),xt}for(dt=w(dt);!An.done;Yt++,An=me.next())An=_e(dt,de,Yt,An.value,$e),An!==null&&(c&&An.alternate!==null&&dt.delete(An.key===null?Yt:An.key),oe=k(An,oe,Yt),Sn===null?xt=An:Sn.sibling=An,Sn=An);return c&&dt.forEach(function(z2e){return d(de,z2e)}),mn&&Sc(de,Yt),xt}function Kn(de,oe,me,$e){if(typeof me=="object"&&me!==null&&me.type===v&&me.key===null&&(me=me.props.children),typeof me=="object"&&me!==null){switch(me.$$typeof){case g:e:{for(var xt=me.key;oe!==null;){if(oe.key===xt){if(xt=me.type,xt===v){if(oe.tag===7){m(de,oe.sibling),$e=E(oe,me.props.children),$e.return=de,de=$e;break e}}else if(oe.elementType===xt||typeof xt=="object"&&xt!==null&&xt.$$typeof===P&&sh(xt)===oe.type){m(de,oe.sibling),$e=E(oe,me.props),Fm($e,me),$e.return=de,de=$e;break e}m(de,oe);break}else d(de,oe);oe=oe.sibling}me.type===v?($e=eh(me.props.children,de.mode,$e,me.key),$e.return=de,de=$e):($e=Q5(me.type,me.key,me.props,null,de.mode,$e),Fm($e,me),$e.return=de,de=$e)}return B(de);case b:e:{for(xt=me.key;oe!==null;){if(oe.key===xt)if(oe.tag===4&&oe.stateNode.containerInfo===me.containerInfo&&oe.stateNode.implementation===me.implementation){m(de,oe.sibling),$e=E(oe,me.children||[]),$e.return=de,de=$e;break e}else{m(de,oe);break}else d(de,oe);oe=oe.sibling}$e=d_(me,de.mode,$e),$e.return=de,de=$e}return B(de);case P:return me=sh(me),Kn(de,oe,me,$e)}if(T(me))return at(de,oe,me,$e);if(D(me)){if(xt=D(me),typeof xt!="function")throw Error(r(150));return me=xt.call(me),At(de,oe,me,$e)}if(typeof me.then=="function")return Kn(de,oe,ab(me),$e);if(me.$$typeof===x)return Kn(de,oe,nb(de,me),$e);ob(de,me)}return typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint"?(me=""+me,oe!==null&&oe.tag===6?(m(de,oe.sibling),$e=E(oe,me),$e.return=de,de=$e):(m(de,oe),$e=u_(me,de.mode,$e),$e.return=de,de=$e),B(de)):m(de,oe)}return function(de,oe,me,$e){try{Bm=0;var xt=Kn(de,oe,me,$e);return Ep=null,xt}catch(dt){if(dt===Cp||dt===ib)throw dt;var Sn=wa(29,dt,null,de.mode);return Sn.lanes=$e,Sn.return=de,Sn}finally{}}}var oh=zR(!0),VR=zR(!1),id=!1;function C_(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function E_(c,d){c=c.updateQueue,d.updateQueue===c&&(d.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,callbacks:null})}function sd(c){return{lane:c,tag:0,payload:null,callback:null,next:null}}function ad(c,d,m){var w=c.updateQueue;if(w===null)return null;if(w=w.shared,(On&2)!==0){var E=w.pending;return E===null?d.next=d:(d.next=E.next,E.next=d),w.pending=d,d=X5(c),AR(c,null,m),d}return J5(c,w,d,m),X5(c)}function zm(c,d,m){if(d=d.updateQueue,d!==null&&(d=d.shared,(m&4194048)!==0)){var w=d.lanes;w&=c.pendingLanes,m|=w,d.lanes=m,jt(c,m)}}function S_(c,d){var m=c.updateQueue,w=c.alternate;if(w!==null&&(w=w.updateQueue,m===w)){var E=null,k=null;if(m=m.firstBaseUpdate,m!==null){do{var B={lane:m.lane,tag:m.tag,payload:m.payload,callback:null,next:null};k===null?E=k=B:k=k.next=B,m=m.next}while(m!==null);k===null?E=k=d:k=k.next=d}else E=k=d;m={baseState:w.baseState,firstBaseUpdate:E,lastBaseUpdate:k,shared:w.shared,callbacks:w.callbacks},c.updateQueue=m;return}c=m.lastBaseUpdate,c===null?m.firstBaseUpdate=d:c.next=d,m.lastBaseUpdate=d}var A_=!1;function Vm(){if(A_){var c=xp;if(c!==null)throw c}}function Hm(c,d,m,w){A_=!1;var E=c.updateQueue;id=!1;var k=E.firstBaseUpdate,B=E.lastBaseUpdate,J=E.shared.pending;if(J!==null){E.shared.pending=null;var ne=J,ge=ne.next;ne.next=null,B===null?k=ge:B.next=ge,B=ne;var ke=c.alternate;ke!==null&&(ke=ke.updateQueue,J=ke.lastBaseUpdate,J!==B&&(J===null?ke.firstBaseUpdate=ge:J.next=ge,ke.lastBaseUpdate=ne))}if(k!==null){var Ne=E.baseState;B=0,ke=ge=ne=null,J=k;do{var be=J.lane&-536870913,_e=be!==J.lane;if(_e?(cn&be)===be:(w&be)===be){be!==0&&be===_p&&(A_=!0),ke!==null&&(ke=ke.next={lane:0,tag:J.tag,payload:J.payload,callback:null,next:null});e:{var at=c,At=J;be=d;var Kn=m;switch(At.tag){case 1:if(at=At.payload,typeof at=="function"){Ne=at.call(Kn,Ne,be);break e}Ne=at;break e;case 3:at.flags=at.flags&-65537|128;case 0:if(at=At.payload,be=typeof at=="function"?at.call(Kn,Ne,be):at,be==null)break e;Ne=p({},Ne,be);break e;case 2:id=!0}}be=J.callback,be!==null&&(c.flags|=64,_e&&(c.flags|=8192),_e=E.callbacks,_e===null?E.callbacks=[be]:_e.push(be))}else _e={lane:be,tag:J.tag,payload:J.payload,callback:J.callback,next:null},ke===null?(ge=ke=_e,ne=Ne):ke=ke.next=_e,B|=be;if(J=J.next,J===null){if(J=E.shared.pending,J===null)break;_e=J,J=_e.next,_e.next=null,E.lastBaseUpdate=_e,E.shared.pending=null}}while(!0);ke===null&&(ne=Ne),E.baseState=ne,E.firstBaseUpdate=ge,E.lastBaseUpdate=ke,k===null&&(E.shared.lanes=0),dd|=B,c.lanes=B,c.memoizedState=Ne}}function HR(c,d){if(typeof c!="function")throw Error(r(191,c));c.call(d)}function WR(c,d){var m=c.callbacks;
vendor: 5,028 bytes, line 49
49if(m!==null)for(c.callbacks=null,c=0;c<m.length;c++)HR(m[c],d)}var Sp=F(null),lb=F(0);function qR(c,d){c=jc,G(lb,c),G(Sp,d),jc=c|d.baseLanes}function k_(){G(lb,jc),G(Sp,Sp.current)}function T_(){jc=lb.current,q(Sp),q(lb)}var va=F(null),to=null;function od(c){var d=c.alternate;G(Kr,Kr.current&1),G(va,c),to===null&&(d===null||Sp.current!==null||d.memoizedState!==null)&&(to=c)}function L_(c){G(Kr,Kr.current),G(va,c),to===null&&(to=c)}function ZR(c){c.tag===22?(G(Kr,Kr.current),G(va,c),to===null&&(to=c)):ld()}function ld(){G(Kr,Kr.current),G(va,va.current)}function _a(c){q(va),to===c&&(to=null),q(Kr)}var Kr=F(0);function cb(c){for(var d=c;d!==null;){if(d.tag===13){var m=d.memoizedState;if(m!==null&&(m=m.dehydrated,m===null||Rx(m)||jx(m)))return d}else if(d.tag===19&&(d.memoizedProps.revealOrder==="forwards"||d.memoizedProps.revealOrder==="backwards"||d.memoizedProps.revealOrder==="unstable_legacy-backwards"||d.memoizedProps.revealOrder==="together")){if((d.flags&128)!==0)return d}else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===c)break;for(;d.sibling===null;){if(d.return===null||d.return===c)return null;d=d.return}d.sibling.return=d.return,d=d.sibling}return null}var Tc=0,Kt=null,qn=null,oi=null,ub=!1,Ap=!1,lh=!1,db=0,Wm=0,kp=null,Nde=0;function Vr(){throw Error(r(321))}function $_(c,d){if(d===null)return!1;for(var m=0;m<d.length&&m<c.length;m++)if(!ba(c[m],d[m]))return!1;return!0}function I_(c,d,m,w,E,k){return Tc=k,Kt=d,d.memoizedState=null,d.updateQueue=null,d.lanes=0,L.H=c===null||c.memoizedState===null?$j:q_,lh=!1,k=m(w,E),lh=!1,Ap&&(k=GR(d,m,w,E)),KR(c),k}function KR(c){L.H=Km;var d=qn!==null&&qn.next!==null;if(Tc=0,oi=qn=Kt=null,ub=!1,Wm=0,kp=null,d)throw Error(r(300));c===null||li||(c=c.dependencies,c!==null&&tb(c)&&(li=!0))}function GR(c,d,m,w){Kt=c;var E=0;do{if(Ap&&(kp=null),Wm=0,Ap=!1,25<=E)throw Error(r(301));if(E+=1,oi=qn=null,c.updateQueue!=null){var k=c.updateQueue;k.lastEffect=null,k.events=null,k.stores=null,k.memoCache!=null&&(k.memoCache.index=0)}L.H=Ij,k=d(m,w)}while(Ap);return k}function Ode(){var c=L.H,d=c.useState()[0];return d=typeof d.then=="function"?qm(d):d,c=c.useState()[0],(qn!==null?qn.memoizedState:null)!==c&&(Kt.flags|=1024),d}function N_(){var c=db!==0;return db=0,c}function O_(c,d,m){d.updateQueue=c.updateQueue,d.flags&=-2053,c.lanes&=~m}function P_(c){if(ub){for(c=c.memoizedState;c!==null;){var d=c.queue;d!==null&&(d.pending=null),c=c.next}ub=!1}Tc=0,oi=qn=Kt=null,Ap=!1,Wm=db=0,kp=null}function Ls(){var c={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return oi===null?Kt.memoizedState=oi=c:oi=oi.next=c,oi}function Gr(){if(qn===null){var c=Kt.alternate;c=c!==null?c.memoizedState:null}else c=qn.next;var d=oi===null?Kt.memoizedState:oi.next;if(d!==null)oi=d,qn=c;else{if(c===null)throw Kt.alternate===null?Error(r(467)):Error(r(310));qn=c,c={memoizedState:qn.memoizedState,baseState:qn.baseState,baseQueue:qn.baseQueue,queue:qn.queue,next:null},oi===null?Kt.memoizedState=oi=c:oi=oi.next=c}return oi}function hb(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function qm(c){var d=Wm;return Wm+=1,kp===null&&(kp=[]),c=UR(kp,c,d),d=Kt,(oi===null?d.memoizedState:oi.next)===null&&(d=d.alternate,L.H=d===null||d.memoizedState===null?$j:q_),c}function fb(c){if(c!==null&&typeof c=="object"){if(typeof c.then=="function")return qm(c);if(c.$$typeof===x)return Ji(c)}throw Error(r(438,String(c)))}function R_(c){var d=null,m=Kt.updateQueue;if(m!==null&&(d=m.memoCache),d==null){var w=Kt.alternate;w!==null&&(w=w.updateQueue,w!==null&&(w=w.memoCache,w!=null&&(d={data:w.data.map(function(E){return E.slice()}),index:0})))}if(d==null&&(d={data:[],index:0}),m===null&&(m=hb(),Kt.updateQueue=m),m.memoCache=d,m=d.data[d.index],m===void 0)for(m=d.data[d.index]=Array(c),w=0;w<c;w++)m[w]=U;return d.index++,m}function Lc(c,d){return typeof d=="function"?d(c):d}function pb(c){var d=Gr();return j_(d,qn,c)}function j_(c,d,m){var w=c.queue;if(w===null)throw Error(r(311));w.lastRenderedReducer=m;var E=c.baseQueue,k=w.pending;if(k!==null){if(E!==null){var B=E.next;E.next=k.next,k.next=B}d.baseQueue=E=k,w.pending=null}if(k=c.baseState,E===null)c.memoizedState=k;else{d=E.next;var J=B=null,ne=null,ge=d,ke=!1;do{var Ne=ge.lane&-536870913;if(Ne!==ge.lane?(cn&Ne)===Ne:(Tc&Ne)===Ne){var be=ge.revertLane;if(be===0)ne!==null&&(ne=ne.next={lane:0,revertLane:0,gesture:null,action:ge.action,hasEagerState:ge.hasEagerState,eagerState:ge.eagerState,next:null}),Ne===_p&&(ke=!0);else if((Tc&be)===be){ge=ge.next,be===_p&&(ke=!0);continue}else Ne={lane:0,revertLane:ge.revertLane,gesture:null,action:ge.action,hasEagerState:ge.hasEagerState,eagerState:ge.eagerState,next:null},ne===null?(J=ne=Ne,B=k):ne=ne.next=Ne,Kt.lanes|=be,dd|=be;Ne=ge.action,lh&&m(k,Ne),k=ge.hasEagerState?ge.eagerState:m(k,Ne)}else be={lane:Ne,revertLane:ge.revertLane,gesture:ge.gesture,action:ge.action,hasEagerState:ge.hasEagerState,eagerState:ge.eagerState,next:null},ne===null?(J=ne=be,B=k):ne=ne.next=be,Kt.lanes|=Ne,dd|=Ne;ge=ge.next}
vendor: 15,866 bytes, line 49
49while(ge!==null&&ge!==d);if(ne===null?B=k:ne.next=J,!ba(k,c.memoizedState)&&(li=!0,ke&&(m=xp,m!==null)))throw m;c.memoizedState=k,c.baseState=B,c.baseQueue=ne,w.lastRenderedState=k}return E===null&&(w.lanes=0),[c.memoizedState,w.dispatch]}function M_(c){var d=Gr(),m=d.queue;if(m===null)throw Error(r(311));m.lastRenderedReducer=c;var w=m.dispatch,E=m.pending,k=d.memoizedState;if(E!==null){m.pending=null;var B=E=E.next;do k=c(k,B.action),B=B.next;while(B!==E);ba(k,d.memoizedState)||(li=!0),d.memoizedState=k,d.baseQueue===null&&(d.baseState=k),m.lastRenderedState=k}return[k,w]}function YR(c,d,m){var w=Kt,E=Gr(),k=mn;if(k){if(m===void 0)throw Error(r(407));m=m()}else m=d();var B=!ba((qn||E).memoizedState,m);if(B&&(E.memoizedState=m,li=!0),E=E.queue,B_(QR.bind(null,w,E,c),[c]),E.getSnapshot!==d||B||oi!==null&&oi.memoizedState.tag&1){if(w.flags|=2048,Tp(9,{destroy:void 0},XR.bind(null,w,E,m,d),null),Xn===null)throw Error(r(349));k||(Tc&127)!==0||JR(w,d,m)}return m}function JR(c,d,m){c.flags|=16384,c={getSnapshot:d,value:m},d=Kt.updateQueue,d===null?(d=hb(),Kt.updateQueue=d,d.stores=[c]):(m=d.stores,m===null?d.stores=[c]:m.push(c))}function XR(c,d,m,w){d.value=m,d.getSnapshot=w,ej(d)&&tj(c)}function QR(c,d,m){return m(function(){ej(d)&&tj(c)})}function ej(c){var d=c.getSnapshot;c=c.value;try{var m=d();return!ba(c,m)}catch{return!0}}function tj(c){var d=Q2(c,2);d!==null&&Zs(d,c,2)}function D_(c){var d=Ls();if(typeof c=="function"){var m=c;if(c=m(),lh){or(!0);try{m()}finally{or(!1)}}}return d.memoizedState=d.baseState=c,d.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lc,lastRenderedState:c},d}function nj(c,d,m,w){return c.baseState=m,j_(c,qn,typeof w=="function"?w:Lc)}function Pde(c,d,m,w,E){if(gb(c))throw Error(r(485));if(c=d.action,c!==null){var k={payload:E,action:c,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(B){k.listeners.push(B)}};L.T!==null?m(!0):k.isTransition=!1,w(k),m=d.pending,m===null?(k.next=d.pending=k,rj(d,k)):(k.next=m.next,d.pending=m.next=k)}}function rj(c,d){var m=d.action,w=d.payload,E=c.state;if(d.isTransition){var k=L.T,B={};L.T=B;try{var J=m(E,w),ne=L.S;ne!==null&&ne(B,J),ij(c,d,J)}catch(ge){U_(c,d,ge)}finally{k!==null&&B.types!==null&&(k.types=B.types),L.T=k}}else try{k=m(E,w),ij(c,d,k)}catch(ge){U_(c,d,ge)}}function ij(c,d,m){m!==null&&typeof m=="object"&&typeof m.then=="function"?m.then(function(w){sj(c,d,w)},function(w){return U_(c,d,w)}):sj(c,d,m)}function sj(c,d,m){d.status="fulfilled",d.value=m,aj(d),c.state=m,d=c.pending,d!==null&&(m=d.next,m===d?c.pending=null:(m=m.next,d.next=m,rj(c,m)))}function U_(c,d,m){var w=c.pending;if(c.pending=null,w!==null){w=w.next;do d.status="rejected",d.reason=m,aj(d),d=d.next;while(d!==w)}c.action=null}function aj(c){c=c.listeners;for(var d=0;d<c.length;d++)(0,c[d])()}function oj(c,d){return d}function lj(c,d){if(mn){var m=Xn.formState;if(m!==null){e:{var w=Kt;if(mn){if(vr){t:{for(var E=vr,k=eo;E.nodeType!==8;){if(!k){E=null;break t}if(E=no(E.nextSibling),E===null){E=null;break t}}k=E.data,E=k==="F!"||k==="F"?E:null}if(E){vr=no(E.nextSibling),w=E.data==="F!";break e}}nd(w)}w=!1}w&&(d=m[0])}}return m=Ls(),m.memoizedState=m.baseState=d,w={pending:null,lanes:0,dispatch:null,lastRenderedReducer:oj,lastRenderedState:d},m.queue=w,m=kj.bind(null,Kt,w),w.dispatch=m,w=D_(!1),k=W_.bind(null,Kt,!1,w.queue),w=Ls(),E={state:d,dispatch:null,action:c,pending:null},w.queue=E,m=Pde.bind(null,Kt,E,k,m),E.dispatch=m,w.memoizedState=c,[d,m,!1]}function cj(c){var d=Gr();return uj(d,qn,c)}function uj(c,d,m){if(d=j_(c,d,oj)[0],c=pb(Lc)[0],typeof d=="object"&&d!==null&&typeof d.then=="function")try{var w=qm(d)}catch(B){throw B===Cp?ib:B}else w=d;d=Gr();var E=d.queue,k=E.dispatch;return m!==d.memoizedState&&(Kt.flags|=2048,Tp(9,{destroy:void 0},Rde.bind(null,E,m),null)),[w,k,c]}function Rde(c,d){c.action=d}function dj(c){var d=Gr(),m=qn;if(m!==null)return uj(d,m,c);Gr(),d=d.memoizedState,m=Gr();var w=m.queue.dispatch;return m.memoizedState=c,[d,w,!1]}function Tp(c,d,m,w){return c={tag:c,create:m,deps:w,inst:d,next:null},d=Kt.updateQueue,d===null&&(d=hb(),Kt.updateQueue=d),m=d.lastEffect,m===null?d.lastEffect=c.next=c:(w=m.next,m.next=c,c.next=w,d.lastEffect=c),c}function hj(){return Gr().memoizedState}function mb(c,d,m,w){var E=Ls();Kt.flags|=c,E.memoizedState=Tp(1|d,{destroy:void 0},m,w===void 0?null:w)}function yb(c,d,m,w){var E=Gr();w=w===void 0?null:w;var k=E.memoizedState.inst;qn!==null&&w!==null&&$_(w,qn.memoizedState.deps)?E.memoizedState=Tp(d,k,m,w):(Kt.flags|=c,E.memoizedState=Tp(1|d,k,m,w))}function fj(c,d){mb(8390656,8,c,d)}function B_(c,d){yb(2048,8,c,d)}function jde(c){Kt.flags|=4;var d=Kt.updateQueue;if(d===null)d=hb(),Kt.updateQueue=d,d.events=[c];else{var m=d.events;m===null?d.events=[c]:m.push(c)}}function pj(c){var d=Gr().memoizedState;return jde({ref:d,nextImpl:c}),function(){if((On&2)!==0)throw Error(r(440));return d.impl.apply(void 0,arguments)}}function mj(c,d){return yb(4,2,c,d)}function yj(c,d){return yb(4,4,c,d)}function gj(c,d){if(typeof d=="function"){c=c();var m=d(c);return function(){typeof m=="function"?m():d(null)}}if(d!=null)return c=c(),d.current=c,function(){d.current=null}}function bj(c,d,m){m=m!=null?m.concat([c]):null,yb(4,4,gj.bind(null,d,c),m)}function F_(){}function wj(c,d){var m=Gr();d=d===void 0?null:d;var w=m.memoizedState;return d!==null&&$_(d,w[1])?w[0]:(m.memoizedState=[c,d],c)}function vj(c,d){var m=Gr();d=d===void 0?null:d;var w=m.memoizedState;if(d!==null&&$_(d,w[1]))return w[0];if(w=c(),lh){or(!0);try{c()}finally{or(!1)}}return m.memoizedState=[w,d],w}function z_(c,d,m){return m===void 0||(Tc&1073741824)!==0&&(cn&261930)===0?c.memoizedState=d:(c.memoizedState=m,c=_M(),Kt.lanes|=c,dd|=c,m)}function _j(c,d,m,w){return ba(m,d)?m:Sp.current!==null?(c=z_(c,m,w),ba(c,d)||(li=!0),c):(Tc&42)===0||(Tc&1073741824)!==0&&(cn&261930)===0?(li=!0,c.memoizedState=m):(c=_M(),Kt.lanes|=c,dd|=c,d)}function xj(c,d,m,w,E){var k=M.p;M.p=k!==0&&8>k?k:8;var B=L.T,J={};L.T=J,W_(c,!1,d,m);try{var ne=E(),ge=L.S;if(ge!==null&&ge(J,ne),ne!==null&&typeof ne=="object"&&typeof ne.then=="function"){var ke=Ide(ne,w);Zm(c,d,ke,Ea(c))}else Zm(c,d,w,Ea(c))}catch(Ne){Zm(c,d,{then:function(){},status:"rejected",reason:Ne},Ea())}finally{M.p=k,B!==null&&J.types!==null&&(B.types=J.types),L.T=B}}function Mde(){}function V_(c,d,m,w){if(c.tag!==5)throw Error(r(476));var E=Cj(c).queue;xj(c,E,d,Z,m===null?Mde:function(){return Ej(c),m(w)})}function Cj(c){var d=c.memoizedState;if(d!==null)return d;d={memoizedState:Z,baseState:Z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lc,lastRenderedState:Z},next:null};var m={};return d.next={memoizedState:m,baseState:m,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lc,lastRenderedState:m},next:null},c.memoizedState=d,c=c.alternate,c!==null&&(c.memoizedState=d),d}function Ej(c){var d=Cj(c);d.next===null&&(d=c.alternate.memoizedState),Zm(c,d.next.queue,{},Ea())}function H_(){return Ji(uy)}function Sj(){return Gr().memoizedState}function Aj(){return Gr().memoizedState}function Dde(c){for(var d=c.return;d!==null;){switch(d.tag){case 24:case 3:var m=Ea();c=sd(m);var w=ad(d,c,m);w!==null&&(Zs(w,d,m),zm(w,d,m)),d={cache:w_()},c.payload=d;return}d=d.return}}function Ude(c,d,m){var w=Ea();m={lane:w,revertLane:0,gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},gb(c)?Tj(d,m):(m=l_(c,d,m,w),m!==null&&(Zs(m,c,w),Lj(m,d,w)))}function kj(c,d,m){var w=Ea();Zm(c,d,m,w)}function Zm(c,d,m,w){var E={lane:w,revertLane:0,gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null};if(gb(c))Tj(d,E);else{var k=c.alternate;if(c.lanes===0&&(k===null||k.lanes===0)&&(k=d.lastRenderedReducer,k!==null))try{var B=d.lastRenderedState,J=k(B,m);if(E.hasEagerState=!0,E.eagerState=J,ba(J,B))return J5(c,d,E,0),Xn===null&&Y5(),!1}catch{}finally{}if(m=l_(c,d,E,w),m!==null)return Zs(m,c,w),Lj(m,d,w),!0}return!1}function W_(c,d,m,w){if(w={lane:2,revertLane:Cx(),gesture:null,action:w,hasEagerState:!1,eagerState:null,next:null},gb(c)){if(d)throw Error(r(479))}else d=l_(c,m,w,2),d!==null&&Zs(d,c,2)}function gb(c){var d=c.alternate;return c===Kt||d!==null&&d===Kt}function Tj(c,d){Ap=ub=!0;var m=c.pending;m===null?d.next=d:(d.next=m.next,m.next=d),c.pending=d}function Lj(c,d,m){if((m&4194048)!==0){var w=d.lanes;w&=c.pendingLanes,m|=w,d.lanes=m,jt(c,m)}}var Km={readContext:Ji,use:fb,useCallback:Vr,useContext:Vr,useEffect:Vr,useImperativeHandle:Vr,useLayoutEffect:Vr,useInsertionEffect:Vr,useMemo:Vr,useReducer:Vr,useRef:Vr,useState:Vr,useDebugValue:Vr,useDeferredValue:Vr,useTransition:Vr,useSyncExternalStore:Vr,useId:Vr,useHostTransitionStatus:Vr,useFormState:Vr,useActionState:Vr,useOptimistic:Vr,useMemoCache:Vr,useCacheRefresh:Vr};Km.useEffectEvent=Vr;var $j={readContext:Ji,use:fb,useCallback:function(c,d){return Ls().memoizedState=[c,d===void 0?null:d],c},useContext:Ji,useEffect:fj,useImperativeHandle:function(c,d,m){m=m!=null?m.concat([c]):null,mb(4194308,4,gj.bind(null,d,c),m)},useLayoutEffect:function(c,d){return mb(4194308,4,c,d)},useInsertionEffect:function(c,d){mb(4,2,c,d)},useMemo:function(c,d){var m=Ls();d=d===void 0?null:d;var w=c();if(lh){or(!0);try{c()}finally{or(!1)}}return m.memoizedState=[w,d],w},useReducer:function(c,d,m){var w=Ls();if(m!==void 0){var E=m(d);if(lh){or(!0);try{m(d)}finally{or(!1)}}}else E=d;return w.memoizedState=w.baseState=E,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:E},w.queue=c,c=c.dispatch=Ude.bind(null,Kt,c),[w.memoizedState,c]},useRef:function(c){var d=Ls();return c={current:c},d.memoizedState=c},useState:function(c){c=D_(c);var d=c.queue,m=kj.bind(null,Kt,d);return d.dispatch=m,[c.memoizedState,m]},useDebugValue:F_,useDeferredValue:function(c,d){var m=Ls();return z_(m,c,d)},useTransition:function(){var c=D_(!1);return c=xj.bind(null,Kt,c.queue,!0,!1),Ls().memoizedState=c,[!1,c]},useSyncExternalStore:function(c,d,m){var w=Kt,E=Ls();if(mn){if(m===void 0)throw Error(r(407));m=m()}else{if(m=d(),Xn===null)throw Error(r(349));(cn&127)!==0||JR(w,d,m)}E.memoizedState=m;var k={value:m,getSnapshot:d};return E.queue=k,fj(QR.bind(null,w,k,c),[c]),w.flags|=2048,Tp(9,{destroy:void 0},XR.bind(null,w,k,m,d),null),m},useId:function(){var c=Ls(),d=Xn.identifierPrefix;if(mn){var m=Tl,w=kl;m=(w&~(1<<32-bn(w)-1)).toString(32)+m,d="_"+d+"R_"+m,m=db++,0<m&&(d+="H"+m.toString(32)),d+="_"}else m=Nde++,d="_"+d+"r_"+m.toString(32)+"_";return c.memoizedState=d},useHostTransitionStatus:H_,useFormState:lj,useActionState:lj,useOptimistic:function(c){var d=Ls();d.memoizedState=d.baseState=c;var m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return d.queue=m,d=W_.bind(null,Kt,!0,m),m.dispatch=d,[c,d]},useMemoCache:R_,useCacheRefresh:function(){return Ls().memoizedState=Dde.bind(null,Kt)},useEffectEvent:function(c){var d=Ls(),m={impl:c};return d.memoizedState=m,function(){if((On&2)!==0)throw Error(r(440));return m.impl.apply(void 0,arguments)}}},q_={readContext:Ji,use:fb,useCallback:wj,useContext:Ji,useEffect:B_,useImperativeHandle:bj,useInsertionEffect:mj,useLayoutEffect:yj,useMemo:vj,useReducer:pb,useRef:hj,useState:function(){return pb(Lc)},useDebugValue:F_,useDeferredValue:function(c,d){var m=Gr();return _j(m,qn.memoizedState,c,d)},useTransition:function(){var c=pb(Lc)[0],d=Gr().memoizedState;return[typeof c=="boolean"?c:qm(c),d]},useSyncExternalStore:YR,useId:Sj,useHostTransitionStatus:H_,useFormState:cj,useActionState:cj,useOptimistic:function(c,d){var m=Gr();return nj(m,qn,c,d)},useMemoCache:R_,useCacheRefresh:Aj};q_.useEffectEvent=pj;var Ij={readContext:Ji,use:fb,useCallback:wj,useContext:Ji,useEffect:B_,useImperativeHandle:bj,useInsertionEffect:mj,useLayoutEffect:yj,useMemo:vj,useReducer:M_,useRef:hj,useState:function(){return M_(Lc)},useDebugValue:F_,useDeferredValue:function(c,d){var m=Gr();return qn===null?z_(m,c,d):_j(m,qn.memoizedState,c,d)},useTransition:function(){var c=M_(Lc)[0],d=Gr().memoizedState;return[typeof c=="boolean"?c:qm(c),d]},useSyncExternalStore:YR,useId:Sj,useHostTransitionStatus:H_,useFormState:dj,useActionState:dj,useOptimistic:function(c,d){var m=Gr();return qn!==null?nj(m,qn,c,d):(m.baseState=c,[c,m.queue.dispatch])},useMemoCache:R_,useCacheRefresh:Aj};Ij.useEffectEvent=pj;function Z_(c,d,m,w){d=c.memoizedState,m=m(w,d),m=m==null?d:p({},d,m),c.memoizedState=m,c.lanes===0&&(c.updateQueue.baseState=m)}var K_={enqueueSetState:function(c,d,m){c=c._reactInternals;var w=Ea(),E=sd(w);E.payload=d,m!=null&&(E.callback=m),d=ad(c,E,w),d!==null&&(Zs(d,c,w),zm(d,c,w))},enqueueReplaceState:function(c,d,m){c=c._reactInternals;var w=Ea(),E=sd(w);E.tag=1,E.payload=d,m!=null&&(E.callback=m),d=ad(c,E,w),d!==null&&(Zs(d,c,w),zm(d,c,w))},enqueueForceUpdate:function(c,d){c=c._reactInternals;var m=Ea(),w=sd(m);w.tag=2,d!=null&&(w.callback=d),d=ad(c,w,m),d!==null&&(Zs(d,c,m),zm(d,c,m))}};function Nj(c,d,m,w,E,k,B){return c=c.stateNode,typeof c.shouldComponentUpdate=="function"?c.shouldComponentUpdate(w,k,B):d.prototype&&d.prototype.isPureReactComponent?!Pm(m,w)||!Pm(E,k):!0}function Oj(c,d,m,w){c=d.state,typeof d.componentWillReceiveProps=="function"&&d.componentWillReceiveProps(m,w),typeof d.UNSAFE_componentWillReceiveProps=="function"&&d.UNSAFE_componentWillReceiveProps(m,w),d.state!==c&&K_.enqueueReplaceState(d,d.state,null)}function ch(c,d){var m=d;if("ref"in d){m={};for(var w in d)w!=="ref"&&(m[w]=d[w])}if(c=c.defaultProps){m===d&&(m=p({},m));for(var E in c)m[E]===void 0&&(m[E]=c[E])}return m}function Pj(c){G5(c)}function Rj(c){console.error(c)}function jj(c){G5(c)}function bb(c,d){try{var m=c.onUncaughtError;m(d.value,{componentStack:d.stack})}catch(w){setTimeout(function(){throw w})}}function Mj(c,d,m){try{var w=c.onCaughtError;w(m.value,{componentStack:m.stack,errorBoundary:d.tag===1?d.stateNode:null})}catch(E){setTimeout(function(){throw E})}}function G_(c,d,m){return m=sd(m),m.tag=3,m.payload={element:null},m.callback=function(){bb(c,d)},m}function Dj(c){return c=sd(c),c.tag=3,c}function Uj(c,d,m,w){var E=m.type.getDerivedStateFromError;if(typeof E=="function"){var k=w.value;c.payload=function(){return E(k)},c.callback=function(){Mj(d,m,w)}}var B=m.stateNode;B!==null&&typeof B.componentDidCatch=="function"&&(c.callback=function(){Mj(d,m,w),typeof E!="function"&&(hd===null?hd=new Set([this]):hd.add(this));var J=w.stack;this.componentDidCatch(w.value,{componentStack:J!==null?J:""})})}function Bde(c,d,m,w,E){if(m.flags|=32768,w!==null&&typeof w=="object"&&typeof w.then=="function"){if(d=m.alternate,d!==null&&vp(d,m,E,!0),m=va.current,m!==null){switch(m.tag){case 31:case 13:return to===null?$b():m.alternate===null&&Hr===0&&(Hr=3),m.flags&=-257,m.flags|=65536,m.lanes=E,w===sb?m.flags|=16384:(d=m.updateQueue,d===null?m.updateQueue=new Set([w]):d.add(w),vx(c,w,E)),!1;case 22:return m.flags|=65536,w===sb?m.flags|=16384:(d=m.updateQueue,d===null?(d={transitions:null,markerInstances:null,retryQueue:new Set([w])},m.updateQueue=d):(m=d.retryQueue,m===null?d.retryQueue=new Set([w]):m.add(w)),vx(c,w,E)),!1}throw Error(r(435,m.tag))}return vx(c,w,E),$b(),!1}if(mn)return d=va.current,d!==null?((d.flags&65536)===0&&(d.flags|=256),d.flags|=65536,d.lanes=E,w!==p_&&(c=Error(r(422),{cause:w}),Mm(Ja(c,m)))):(w!==p_&&(d=Error(r(423),{cause:w}),Mm(Ja(d,m))),c=c.current.alternate,c.flags|=65536,E&=-E,c.lanes|=E,w=Ja(w,m),E=G_(c.stateNode,w,E),S_(c,E),Hr!==4&&(Hr=2)),!1;var k=Error(r(520),{cause:w});if(k=Ja(k,m),ny===null?ny=[k]:ny.push(k),Hr!==4&&(Hr=2),d===null)return!0;w=Ja(w,m),m=d;do{switch(m.tag){case 3:return m.flags|=65536,c=E&-E,m.lanes|=c,c=G_(m.stateNode,w,c),S_(m,c),!1;case 1:if(d=m.type,k=m.stateNode,(m.flags&128)===0&&(typeof d.getDerivedStateFromError=="function"||k!==null&&typeof k.componentDidCatch=="function"&&(hd===null||!hd.has(k))))return m.flags|=65536,E&=-E,m.lanes|=E,E=Dj(E),Uj(E,c,m,w),S_(m,E
vendor: 13,481 bytes, line 49
49),!1}m=m.return}while(m!==null);return!1}var Y_=Error(r(461)),li=!1;function Xi(c,d,m,w){d.child=c===null?VR(d,null,m,w):oh(d,c.child,m,w)}function Bj(c,d,m,w,E){m=m.render;var k=d.ref;if("ref"in w){var B={};for(var J in w)J!=="ref"&&(B[J]=w[J])}else B=w;return rh(d),w=I_(c,d,m,B,k,E),J=N_(),c!==null&&!li?(O_(c,d,E),$c(c,d,E)):(mn&&J&&h_(d),d.flags|=1,Xi(c,d,w,E),d.child)}function Fj(c,d,m,w,E){if(c===null){var k=m.type;return typeof k=="function"&&!c_(k)&&k.defaultProps===void 0&&m.compare===null?(d.tag=15,d.type=k,zj(c,d,k,w,E)):(c=Q5(m.type,null,w,d,d.mode,E),c.ref=d.ref,c.return=d,d.child=c)}if(k=c.child,!ix(c,E)){var B=k.memoizedProps;if(m=m.compare,m=m!==null?m:Pm,m(B,w)&&c.ref===d.ref)return $c(c,d,E)}return d.flags|=1,c=Ec(k,w),c.ref=d.ref,c.return=d,d.child=c}function zj(c,d,m,w,E){if(c!==null){var k=c.memoizedProps;if(Pm(k,w)&&c.ref===d.ref)if(li=!1,d.pendingProps=w=k,ix(c,E))(c.flags&131072)!==0&&(li=!0);else return d.lanes=c.lanes,$c(c,d,E)}return J_(c,d,m,w,E)}function Vj(c,d,m,w){var E=w.children,k=c!==null?c.memoizedState:null;if(c===null&&d.stateNode===null&&(d.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),w.mode==="hidden"){if((d.flags&128)!==0){if(k=k!==null?k.baseLanes|m:m,c!==null){for(w=d.child=c.child,E=0;w!==null;)E=E|w.lanes|w.childLanes,w=w.sibling;w=E&~k}else w=0,d.child=null;return Hj(c,d,k,m,w)}if((m&536870912)!==0)d.memoizedState={baseLanes:0,cachePool:null},c!==null&&rb(d,k!==null?k.cachePool:null),k!==null?qR(d,k):k_(),ZR(d);else return w=d.lanes=536870912,Hj(c,d,k!==null?k.baseLanes|m:m,m,w)}else k!==null?(rb(d,k.cachePool),qR(d,k),ld(),d.memoizedState=null):(c!==null&&rb(d,null),k_(),ld());return Xi(c,d,E,m),d.child}function Gm(c,d){return c!==null&&c.tag===22||d.stateNode!==null||(d.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.sibling}function Hj(c,d,m,w,E){var k=__();return k=k===null?null:{parent:ai._currentValue,pool:k},d.memoizedState={baseLanes:m,cachePool:k},c!==null&&rb(d,null),k_(),ZR(d),c!==null&&vp(c,d,w,!0),d.childLanes=E,null}function wb(c,d){return d=_b({mode:d.mode,children:d.children},c.mode),d.ref=c.ref,c.child=d,d.return=c,d}function Wj(c,d,m){return oh(d,c.child,null,m),c=wb(d,d.pendingProps),c.flags|=2,_a(d),d.memoizedState=null,c}function Fde(c,d,m){var w=d.pendingProps,E=(d.flags&128)!==0;if(d.flags&=-129,c===null){if(mn){if(w.mode==="hidden")return c=wb(d,w),d.lanes=536870912,Gm(null,c);if(L_(d),(c=vr)?(c=rD(c,eo),c=c!==null&&c.data==="&"?c:null,c!==null&&(d.memoizedState={dehydrated:c,treeContext:ed!==null?{id:kl,overflow:Tl}:null,retryLane:536870912,hydrationErrors:null},m=TR(c),m.return=d,d.child=m,Yi=d,vr=null)):c=null,c===null)throw nd(d);return d.lanes=536870912,null}return wb(d,w)}var k=c.memoizedState;if(k!==null){var B=k.dehydrated;if(L_(d),E)if(d.flags&256)d.flags&=-257,d=Wj(c,d,m);else if(d.memoizedState!==null)d.child=c.child,d.flags|=128,d=null;else throw Error(r(558));else if(li||vp(c,d,m,!1),E=(m&c.childLanes)!==0,li||E){if(w=Xn,w!==null&&(B=Hn(w,m),B!==0&&B!==k.retryLane))throw k.retryLane=B,Q2(c,B),Zs(w,c,B),Y_;$b(),d=Wj(c,d,m)}else c=k.treeContext,vr=no(B.nextSibling),Yi=d,mn=!0,td=null,eo=!1,c!==null&&IR(d,c),d=wb(d,w),d.flags|=4096;return d}return c=Ec(c.child,{mode:w.mode,children:w.children}),c.ref=d.ref,d.child=c,c.return=d,c}function vb(c,d){var m=d.ref;if(m===null)c!==null&&c.ref!==null&&(d.flags|=4194816);else{if(typeof m!="function"&&typeof m!="object")throw Error(r(284));(c===null||c.ref!==m)&&(d.flags|=4194816)}}function J_(c,d,m,w,E){return rh(d),m=I_(c,d,m,w,void 0,E),w=N_(),c!==null&&!li?(O_(c,d,E),$c(c,d,E)):(mn&&w&&h_(d),d.flags|=1,Xi(c,d,m,E),d.child)}function qj(c,d,m,w,E,k){return rh(d),d.updateQueue=null,m=GR(d,w,m,E),KR(c),w=N_(),c!==null&&!li?(O_(c,d,k),$c(c,d,k)):(mn&&w&&h_(d),d.flags|=1,Xi(c,d,m,k),d.child)}function Zj(c,d,m,w,E){if(rh(d),d.stateNode===null){var k=yp,B=m.contextType;typeof B=="object"&&B!==null&&(k=Ji(B)),k=new m(w,k),d.memoizedState=k.state!==null&&k.state!==void 0?k.state:null,k.updater=K_,d.stateNode=k,k._reactInternals=d,k=d.stateNode,k.props=w,k.state=d.memoizedState,k.refs={},C_(d),B=m.contextType,k.context=typeof B=="object"&&B!==null?Ji(B):yp,k.state=d.memoizedState,B=m.getDerivedStateFromProps,typeof B=="function"&&(Z_(d,m,B,w),k.state=d.memoizedState),typeof m.getDerivedStateFromProps=="function"||typeof k.getSnapshotBeforeUpdate=="function"||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(B=k.state,typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount(),B!==k.state&&K_.enqueueReplaceState(k,k.state,null),Hm(d,w,k,E),Vm(),k.state=d.memoizedState),typeof k.componentDidMount=="function"&&(d.flags|=4194308),w=!0}else if(c===null){k=d.stateNode;var J=d.memoizedProps,ne=ch(m,J);k.props=ne;var ge=k.context,ke=m.contextType;B=yp,typeof ke=="object"&&ke!==null&&(B=Ji(ke));var Ne=m.getDerivedStateFromProps;ke=typeof Ne=="function"||typeof k.getSnapshotBeforeUpdate=="function",J=d.pendingProps!==J,ke||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(J||ge!==B)&&Oj(d,k,w,B),id=!1;var be=d.memoizedState;k.state=be,Hm(d,w,k,E),Vm(),ge=d.memoizedState,J||be!==ge||id?(typeof Ne=="function"&&(Z_(d,m,Ne,w),ge=d.memoizedState),(ne=id||Nj(d,m,ne,w,be,ge,B))?(ke||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount()),typeof k.componentDidMount=="function"&&(d.flags|=4194308)):(typeof k.componentDidMount=="function"&&(d.flags|=4194308),d.memoizedProps=w,d.memoizedState=ge),k.props=w,k.state=ge,k.context=B,w=ne):(typeof k.componentDidMount=="function"&&(d.flags|=4194308),w=!1)}else{k=d.stateNode,E_(c,d),B=d.memoizedProps,ke=ch(m,B),k.props=ke,Ne=d.pendingProps,be=k.context,ge=m.contextType,ne=yp,typeof ge=="object"&&ge!==null&&(ne=Ji(ge)),J=m.getDerivedStateFromProps,(ge=typeof J=="function"||typeof k.getSnapshotBeforeUpdate=="function")||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(B!==Ne||be!==ne)&&Oj(d,k,w,ne),id=!1,be=d.memoizedState,k.state=be,Hm(d,w,k,E),Vm();var _e=d.memoizedState;B!==Ne||be!==_e||id||c!==null&&c.dependencies!==null&&tb(c.dependencies)?(typeof J=="function"&&(Z_(d,m,J,w),_e=d.memoizedState),(ke=id||Nj(d,m,ke,w,be,_e,ne)||c!==null&&c.dependencies!==null&&tb(c.dependencies))?(ge||typeof k.UNSAFE_componentWillUpdate!="function"&&typeof k.componentWillUpdate!="function"||(typeof k.componentWillUpdate=="function"&&k.componentWillUpdate(w,_e,ne),typeof k.UNSAFE_componentWillUpdate=="function"&&k.UNSAFE_componentWillUpdate(w,_e,ne)),typeof k.componentDidUpdate=="function"&&(d.flags|=4),typeof k.getSnapshotBeforeUpdate=="function"&&(d.flags|=1024)):(typeof k.componentDidUpdate!="function"||B===c.memoizedProps&&be===c.memoizedState||(d.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||B===c.memoizedProps&&be===c.memoizedState||(d.flags|=1024),d.memoizedProps=w,d.memoizedState=_e),k.props=w,k.state=_e,k.context=ne,w=ke):(typeof k.componentDidUpdate!="function"||B===c.memoizedProps&&be===c.memoizedState||(d.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||B===c.memoizedProps&&be===c.memoizedState||(d.flags|=1024),w=!1)}return k=w,vb(c,d),w=(d.flags&128)!==0,k||w?(k=d.stateNode,m=w&&typeof m.getDerivedStateFromError!="function"?null:k.render(),d.flags|=1,c!==null&&w?(d.child=oh(d,c.child,null,E),d.child=oh(d,null,m,E)):Xi(c,d,m,E),d.memoizedState=k.state,c=d.child):c=$c(c,d,E),c}function Kj(c,d,m,w){return th(),d.flags|=256,Xi(c,d,m,w),d.child}var X_={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Q_(c){return{baseLanes:c,cachePool:MR()}}function ex(c,d,m){return c=c!==null?c.childLanes&~m:0,d&&(c|=Ca),c}function Gj(c,d,m){var w=d.pendingProps,E=!1,k=(d.flags&128)!==0,B;if((B=k)||(B=c!==null&&c.memoizedState===null?!1:(Kr.current&2)!==0),B&&(E=!0,d.flags&=-129),B=(d.flags&32)!==0,d.flags&=-33,c===null){if(mn){if(E?od(d):ld(),(c=vr)?(c=rD(c,eo),c=c!==null&&c.data!=="&"?c:null,c!==null&&(d.memoizedState={dehydrated:c,treeContext:ed!==null?{id:kl,overflow:Tl}:null,retryLane:536870912,hydrationErrors:null},m=TR(c),m.return=d,d.child=m,Yi=d,vr=null)):c=null,c===null)throw nd(d);return jx(c)?d.lanes=32:d.lanes=536870912,null}var J=w.children;return w=w.fallback,E?(ld(),E=d.mode,J=_b({mode:"hidden",children:J},E),w=eh(w,E,m,null),J.return=d,w.return=d,J.sibling=w,d.child=J,w=d.child,w.memoizedState=Q_(m),w.childLanes=ex(c,B,m),d.memoizedState=X_,Gm(null,w)):(od(d),tx(d,J))}var ne=c.memoizedState;if(ne!==null&&(J=ne.dehydrated,J!==null)){if(k)d.flags&256?(od(d),d.flags&=-257,d=nx(c,d,m)):d.memoizedState!==null?(ld(),d.child=c.child,d.flags|=128,d=null):(ld(),J=w.fallback,E=d.mode,w=_b({mode:"visible",children:w.children},E),J=eh(J,E,m,null),J.flags|=2,w.return=d,J.return=d,w.sibling=J,d.child=w,oh(d,c.child,null,m),w=d.child,w.memoizedState=Q_(m),w.childLanes=ex(c,B,m),d.memoizedState=X_,d=Gm(null,w));else if(od(d),jx(J)){if(B=J.nextSibling&&J.nextSibling.dataset,B)var ge=B.dgst;B=ge,w=Error(r(419)),w.stack="",w.digest=B,Mm({value:w,source:null,stack:null}),d=nx(c,d,m)}else if(li||vp(c,d,m,!1),B=(m&c.childLanes)!==0,li||B){if(B=Xn,B!==null&&(w=Hn(B,m),w!==0&&w!==ne.retryLane))throw ne.retryLane=w,Q2(c,w),Zs(B,c,w),Y_;Rx(J)||$b(),d=nx(c,d,m)}else Rx(J)?(d.flags|=192,d.child=c.child,d=null):(c=ne.treeContext,vr=no(J.nextSibling),Yi=d,mn=!0,td=null,eo=!1,c!==null&&IR(d,c),d=tx(d,w.children),d.flags|=4096);return d}return E?(ld(),J=w.fallback,E=d.mode,ne=c.child,ge=ne.sibling,w=Ec(ne,{mode:"hidden",children:w.children}),w.subtreeFlags=ne.subtreeFlags&65011712,ge!==null?J=Ec(ge,J):(J=eh(J,E,m,null),J.flags|=2),J.return=d,w.return=d,w.sibling=J,d.child=w,Gm(null,w),w=d.child,J=c.child.memoizedState,J===null?J=Q_(m):(E=J.cachePool,E!==null?(ne=ai._currentValue,E=E.parent!==ne?{parent:ne,pool:ne}:E):E=MR(),J={baseLanes:J.baseLanes|m,cachePool:E}),w.memoizedState=J,w.childLanes=ex(c,B,m),d.memoizedState=X_,Gm(c.child,w)):(od(d),m=c.child,c=m.sibling,m=Ec(m,{mode:"visible",children:w.children}),m.return=d,m.sibling=null,c!==null&&(B=d.deletions,B===null?(d.deletions=[c],d.flags|=16):B.push(c)),d.child=m,d.memoizedState=null,m)}function tx(c,d){return d=_b({mode:"visible",children:d},c.mode),d.return=c,c.child=d}function _b(c,d){return c=wa(22,c,null,d),c.lanes=0,c}function nx(c,d,m){return oh(d,c.child,null,m),c=tx(d,d.pendingProps.children),c.flags|=2,d.memoizedState=null,c}function Yj(c,d,m){c.lanes|=d;var w=c.alternate;w!==null&&(w.lanes|=d),g_(c.return,d,m)}function rx(c,d,m,w,E,k){var B=c.memoizedState;B===null?c.memoizedState={isBackwards:d,rendering:null,renderingStartTime:0,last:w,tail:m,tailMode:E,treeForkCount:k}:(B.isBackwards=d,B.rendering=null,B.renderingStartTime=0,B.last=w,B.tail=m,B.tailMode=E,B.treeForkCount=k)}function Jj(c,d,m){var w=d.pendingProps,E=w.revealOrder,k=w.tail;w=w.children;var B=Kr.current,J=(B&2)!==0;if(J?(B=B&1|2,d.flags|=128):B&=1,G(Kr,B),Xi(c,d,w,m),w=mn?jm:0,!J&&c!==null&&(c.flags&128)!==0)e:for(c=d.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&Yj(c,m,d);else if(c.tag===19)Yj(c,m,d);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===d)break e;for(;c.sibling===null;){if(c.return===null||c.return===d)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}switch(E){case"forwards":for(m=d.child,E=null;m!==null;)c=m.alternate,c!==null&&cb(c)===null&&(E=m),m=m.sibling;m=E,m===null?(E=d.child,d.child=null):(E=m.sibling,m.sibling=null),rx(d,!1,E,m,k,w);break;case"backwards":case"unstable_legacy-backwards":for(m=null,E=d.child,d.child=null;E!==null;){if(c=E.alternate,c!==null&&cb(c)===null){d.child=E;break}c=E.sibling,E.sibling=m,m=E,E=c}rx(d,!0,m,null,k,w);break;case"together":rx(d,!1,null,null,void 0,w);break;default:d.memoizedState=null}return d.child}function $c(c,d,m){if(c!==null&&(d.dependencies=c.dependencies),dd|=d.lanes,(m&d.childLanes)===0)if(c!==null){if(vp(c,d,m,!1),(m&d.childLanes)===0)return null}else return null;if(c!==null&&d.child!==c.child)throw Error(r(153));if(d.child!==null){for(c=d.child,m=Ec(c,c.pendingProps),d.child=m,m.return=d;c.sibling!==null;)c=c.sibling,m=m.sibling=Ec(c,c.pendingProps),m.return=d;m.sibling=null}return d.child}function ix(c,d){return(c.lanes&d)!==0?!0:(c=c.dependencies,!!(c!==null&&tb(c)))}function zde(c,d,m){switch(d.tag){case 3:se(d,d.stateNode.containerInfo),rd(d,ai,c.memoizedState.cache),th();break;case 27:case 5:Ce(d);break;case 4:se(d,d.stateNode.containerInfo);break;case 10:rd(d,d.type,d.memoizedProps.value);break;case 31:if(d.memoizedState!==null)return d.flags|=128,L_(d),null;break;case 13:var w=d.memoizedState;if(w!==null)return w.dehydrated!==null?(od(d),d.flags|=128,null):(m&d.child.childLanes)!==0?Gj(c,d,m):(od(d),c=$c(c,d,m),c!==null?c.sibling:null);od(d);break;case 19:var E=(c.flags&128)!==0;if(w=(m&d.childLanes)!==0,w||(vp(c,d,m,!1),w=(m&d.childLanes)!==0),E){if(w)return Jj(c,d,m);d.flags|=128}if(E=d.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),G(Kr,Kr.current),w)break;return null;case 22:return d.lanes=0,Vj(c,d,m,d.pendingProps);case 24:rd(d,ai,c.memoizedState.cache)}return $c(c,d,m)}function Xj(c,d,m){if(c!==null)if(c.memoizedProps!==d.pendingProps)li=!0;
vendor: 3,968 bytes, line 49
49else{if(!ix(c,m)&&(d.flags&128)===0)return li=!1,zde(c,d,m);li=(c.flags&131072)!==0}else li=!1,mn&&(d.flags&1048576)!==0&&$R(d,jm,d.index);switch(d.lanes=0,d.tag){case 16:e:{var w=d.pendingProps;if(c=sh(d.elementType),d.type=c,typeof c=="function")c_(c)?(w=ch(c,w),d.tag=1,d=Zj(null,d,c,w,m)):(d.tag=0,d=J_(null,d,c,w,m));else{if(c!=null){var E=c.$$typeof;if(E===A){d.tag=11,d=Bj(null,d,c,w,m);break e}else if(E===O){d.tag=14,d=Fj(null,d,c,w,m);break e}}throw d=W(c)||c,Error(r(306,d,""))}}return d;case 0:return J_(c,d,d.type,d.pendingProps,m);case 1:return w=d.type,E=ch(w,d.pendingProps),Zj(c,d,w,E,m);case 3:e:{if(se(d,d.stateNode.containerInfo),c===null)throw Error(r(387));w=d.pendingProps;var k=d.memoizedState;E=k.element,E_(c,d),Hm(d,w,null,m);var B=d.memoizedState;if(w=B.cache,rd(d,ai,w),w!==k.cache&&b_(d,[ai],m,!0),Vm(),w=B.element,k.isDehydrated)if(k={element:w,isDehydrated:!1,cache:B.cache},d.updateQueue.baseState=k,d.memoizedState=k,d.flags&256){d=Kj(c,d,w,m);break e}else if(w!==E){E=Ja(Error(r(424)),d),Mm(E),d=Kj(c,d,w,m);break e}else{switch(c=d.stateNode.containerInfo,c.nodeType){case 9:c=c.body;break;default:c=c.nodeName==="HTML"?c.ownerDocument.body:c}for(vr=no(c.firstChild),Yi=d,mn=!0,td=null,eo=!0,m=VR(d,null,w,m),d.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling}else{if(th(),w===E){d=$c(c,d,m);break e}Xi(c,d,w,m)}d=d.child}return d;case 26:return vb(c,d),c===null?(m=cD(d.type,null,d.pendingProps,null))?d.memoizedState=m:mn||(m=d.type,c=d.pendingProps,w=Mb(te.current).createElement(m),w[en]=d,w[Dn]=c,Qi(w,m,c),_n(w),d.stateNode=w):d.memoizedState=cD(d.type,c.memoizedProps,d.pendingProps,c.memoizedState),null;case 27:return Ce(d),c===null&&mn&&(w=d.stateNode=aD(d.type,d.pendingProps,te.current),Yi=d,eo=!0,E=vr,yd(d.type)?(Mx=E,vr=no(w.firstChild)):vr=E),Xi(c,d,d.pendingProps.children,m),vb(c,d),c===null&&(d.flags|=4194304),d.child;case 5:return c===null&&mn&&((E=w=vr)&&(w=b2e(w,d.type,d.pendingProps,eo),w!==null?(d.stateNode=w,Yi=d,vr=no(w.firstChild),eo=!1,E=!0):E=!1),E||nd(d)),Ce(d),E=d.type,k=d.pendingProps,B=c!==null?c.memoizedProps:null,w=k.children,Nx(E,k)?w=null:B!==null&&Nx(E,B)&&(d.flags|=32),d.memoizedState!==null&&(E=I_(c,d,Ode,null,null,m),uy._currentValue=E),vb(c,d),Xi(c,d,w,m),d.child;case 6:return c===null&&mn&&((c=m=vr)&&(m=w2e(m,d.pendingProps,eo),m!==null?(d.stateNode=m,Yi=d,vr=null,c=!0):c=!1),c||nd(d)),null;case 13:return Gj(c,d,m);case 4:return se(d,d.stateNode.containerInfo),w=d.pendingProps,c===null?d.child=oh(d,null,w,m):Xi(c,d,w,m),d.child;case 11:return Bj(c,d,d.type,d.pendingProps,m);case 7:return Xi(c,d,d.pendingProps,m),d.child;case 8:return Xi(c,d,d.pendingProps.children,m),d.child;case 12:return Xi(c,d,d.pendingProps.children,m),d.child;case 10:return w=d.pendingProps,rd(d,d.type,w.value),Xi(c,d,w.children,m),d.child;case 9:return E=d.type._context,w=d.pendingProps.children,rh(d),E=Ji(E),w=w(E),d.flags|=1,Xi(c,d,w,m),d.child;case 14:return Fj(c,d,d.type,d.pendingProps,m);case 15:return zj(c,d,d.type,d.pendingProps,m);case 19:return Jj(c,d,m);case 31:return Fde(c,d,m);case 22:return Vj(c,d,m,d.pendingProps);case 24:return rh(d),w=Ji(ai),c===null?(E=__(),E===null&&(E=Xn,k=w_(),E.pooledCache=k,k.refCount++,k!==null&&(E.pooledCacheLanes|=m),E=k),d.memoizedState={parent:w,cache:E},C_(d),rd(d,ai,E)):((c.lanes&m)!==0&&(E_(c,d),Hm(d,null,null,m),Vm()),E=c.memoizedState,k=d.memoizedState,E.parent!==w?(E={parent:w,cache:w},d.memoizedState=E,d.lanes===0&&(d.memoizedState=d.updateQueue.baseState=E),rd(d,ai,w)):(w=k.cache,rd(d,ai,w),w!==E.cache&&b_(d,[ai],m,!0))),Xi(c,d,d.pendingProps.children,m),d.child;case 29:throw d.pendingProps}throw Error(r(156,d.tag))}function Ic(c){c.flags|=4}function sx(c,d,m,w,E){if((d=(c.mode&32)!==0)&&(d=!1),d){if(c.flags|=16777216,(E&335544128)===E)if(c.stateNode.complete)c.flags|=8192;else if(SM())c.flags|=8192;else throw ah=sb,x_}else c.flags&=-16777217}function Qj(c,d){if(d.type!=="stylesheet"||(d.state.loading&4)!==0)c.flags&=-16777217;
vendor: 4,405 bytes, line 49
49else if(c.flags|=16777216,!pD(d))if(SM())c.flags|=8192;else throw ah=sb,x_}function xb(c,d){d!==null&&(c.flags|=4),c.flags&16384&&(d=c.tag!==22?Re():536870912,c.lanes|=d,Np|=d)}function Ym(c,d){if(!mn)switch(c.tailMode){case"hidden":d=c.tail;for(var m=null;d!==null;)d.alternate!==null&&(m=d),d=d.sibling;m===null?c.tail=null:m.sibling=null;break;case"collapsed":m=c.tail;for(var w=null;m!==null;)m.alternate!==null&&(w=m),m=m.sibling;w===null?d||c.tail===null?c.tail=null:c.tail.sibling=null:w.sibling=null}}function _r(c){var d=c.alternate!==null&&c.alternate.child===c.child,m=0,w=0;if(d)for(var E=c.child;E!==null;)m|=E.lanes|E.childLanes,w|=E.subtreeFlags&65011712,w|=E.flags&65011712,E.return=c,E=E.sibling;else for(E=c.child;E!==null;)m|=E.lanes|E.childLanes,w|=E.subtreeFlags,w|=E.flags,E.return=c,E=E.sibling;return c.subtreeFlags|=w,c.childLanes=m,d}function Vde(c,d,m){var w=d.pendingProps;switch(f_(d),d.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return _r(d),null;case 1:return _r(d),null;case 3:return m=d.stateNode,w=null,c!==null&&(w=c.memoizedState.cache),d.memoizedState.cache!==w&&(d.flags|=2048),kc(ai),pe(),m.pendingContext&&(m.context=m.pendingContext,m.pendingContext=null),(c===null||c.child===null)&&(wp(d)?Ic(d):c===null||c.memoizedState.isDehydrated&&(d.flags&256)===0||(d.flags|=1024,m_())),_r(d),null;case 26:var E=d.type,k=d.memoizedState;return c===null?(Ic(d),k!==null?(_r(d),Qj(d,k)):(_r(d),sx(d,E,null,w,m))):k?k!==c.memoizedState?(Ic(d),_r(d),Qj(d,k)):(_r(d),d.flags&=-16777217):(c=c.memoizedProps,c!==w&&Ic(d),_r(d),sx(d,E,c,w,m)),null;case 27:if(xe(d),m=te.current,E=d.type,c!==null&&d.stateNode!=null)c.memoizedProps!==w&&Ic(d);else{if(!w){if(d.stateNode===null)throw Error(r(166));return _r(d),null}c=Y.current,wp(d)?NR(d):(c=aD(E,w,m),d.stateNode=c,Ic(d))}return _r(d),null;case 5:if(xe(d),E=d.type,c!==null&&d.stateNode!=null)c.memoizedProps!==w&&Ic(d);else{if(!w){if(d.stateNode===null)throw Error(r(166));return _r(d),null}if(k=Y.current,wp(d))NR(d);else{var B=Mb(te.current);switch(k){case 1:k=B.createElementNS("http://www.w3.org/2000/svg",E);break;case 2:k=B.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;default:switch(E){case"svg":k=B.createElementNS("http://www.w3.org/2000/svg",E);break;case"math":k=B.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;case"script":k=B.createElement("div"),k.innerHTML="<script><\/script>",k=k.removeChild(k.firstChild);break;case"select":k=typeof w.is=="string"?B.createElement("select",{is:w.is}):B.createElement("select"),w.multiple?k.multiple=!0:w.size&&(k.size=w.size);break;default:k=typeof w.is=="string"?B.createElement(E,{is:w.is}):B.createElement(E)}}k[en]=d,k[Dn]=w;e:for(B=d.child;B!==null;){if(B.tag===5||B.tag===6)k.appendChild(B.stateNode);else if(B.tag!==4&&B.tag!==27&&B.child!==null){B.child.return=B,B=B.child;continue}if(B===d)break e;for(;B.sibling===null;){if(B.return===null||B.return===d)break e;B=B.return}B.sibling.return=B.return,B=B.sibling}d.stateNode=k;e:switch(Qi(k,E,w),E){case"button":case"input":case"select":case"textarea":w=!!w.autoFocus;break e;case"img":w=!0;break e;default:w=!1}w&&Ic(d)}}return _r(d),sx(d,d.type,c===null?null:c.memoizedProps,d.pendingProps,m),null;case 6:if(c&&d.stateNode!=null)c.memoizedProps!==w&&Ic(d);else{if(typeof w!="string"&&d.stateNode===null)throw Error(r(166));if(c=te.current,wp(d)){if(c=d.stateNode,m=d.memoizedProps,w=null,E=Yi,E!==null)switch(E.tag){case 27:case 5:w=E.memoizedProps}c[en]=d,c=!!(c.nodeValue===m||w!==null&&w.suppressHydrationWarning===!0||GM(c.nodeValue,m)),c||nd(d,!0)}else c=Mb(c).createTextNode(w),c[en]=d,d.stateNode=c}return _r(d),null;case 31:if(m=d.memoizedState,c===null||c.memoizedState!==null){if(w=wp(d),m!==null){if(c===null){if(!w)throw Error(r(318));if(c=d.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(r(557));c[en]=d}else th(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;_r(d),c=!1}else m=m_(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=m),c=!0;if(!c)return d.flags&256?(_a(d),d):(_a(d),null);if((d.flags&128)!==0)throw Error(r(558))}return _r(d),null;case 13:if(w=d.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(E=wp(d),w!==null&&w.dehydrated!==null){if(c===null){if(!E)throw Error(r(318));if(E=d.memoizedState,E=E!==null?E.dehydrated:null,!E)throw Error(r(317));E[en]=d}
vendor: 24,091 bytes, line 49
49else th(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;_r(d),E=!1}else E=m_(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=E),E=!0;if(!E)return d.flags&256?(_a(d),d):(_a(d),null)}return _a(d),(d.flags&128)!==0?(d.lanes=m,d):(m=w!==null,c=c!==null&&c.memoizedState!==null,m&&(w=d.child,E=null,w.alternate!==null&&w.alternate.memoizedState!==null&&w.alternate.memoizedState.cachePool!==null&&(E=w.alternate.memoizedState.cachePool.pool),k=null,w.memoizedState!==null&&w.memoizedState.cachePool!==null&&(k=w.memoizedState.cachePool.pool),k!==E&&(w.flags|=2048)),m!==c&&m&&(d.child.flags|=8192),xb(d,d.updateQueue),_r(d),null);case 4:return pe(),c===null&&kx(d.stateNode.containerInfo),_r(d),null;case 10:return kc(d.type),_r(d),null;case 19:if(q(Kr),w=d.memoizedState,w===null)return _r(d),null;if(E=(d.flags&128)!==0,k=w.rendering,k===null)if(E)Ym(w,!1);else{if(Hr!==0||c!==null&&(c.flags&128)!==0)for(c=d.child;c!==null;){if(k=cb(c),k!==null){for(d.flags|=128,Ym(w,!1),c=k.updateQueue,d.updateQueue=c,xb(d,c),d.subtreeFlags=0,c=m,m=d.child;m!==null;)kR(m,c),m=m.sibling;return G(Kr,Kr.current&1|2),mn&&Sc(d,w.treeForkCount),d.child}c=c.sibling}w.tail!==null&&$t()>kb&&(d.flags|=128,E=!0,Ym(w,!1),d.lanes=4194304)}else{if(!E)if(c=cb(k),c!==null){if(d.flags|=128,E=!0,c=c.updateQueue,d.updateQueue=c,xb(d,c),Ym(w,!0),w.tail===null&&w.tailMode==="hidden"&&!k.alternate&&!mn)return _r(d),null}else 2*$t()-w.renderingStartTime>kb&&m!==536870912&&(d.flags|=128,E=!0,Ym(w,!1),d.lanes=4194304);w.isBackwards?(k.sibling=d.child,d.child=k):(c=w.last,c!==null?c.sibling=k:d.child=k,w.last=k)}return w.tail!==null?(c=w.tail,w.rendering=c,w.tail=c.sibling,w.renderingStartTime=$t(),c.sibling=null,m=Kr.current,G(Kr,E?m&1|2:m&1),mn&&Sc(d,w.treeForkCount),c):(_r(d),null);case 22:case 23:return _a(d),T_(),w=d.memoizedState!==null,c!==null?c.memoizedState!==null!==w&&(d.flags|=8192):w&&(d.flags|=8192),w?(m&536870912)!==0&&(d.flags&128)===0&&(_r(d),d.subtreeFlags&6&&(d.flags|=8192)):_r(d),m=d.updateQueue,m!==null&&xb(d,m.retryQueue),m=null,c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(m=c.memoizedState.cachePool.pool),w=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(w=d.memoizedState.cachePool.pool),w!==m&&(d.flags|=2048),c!==null&&q(ih),null;case 24:return m=null,c!==null&&(m=c.memoizedState.cache),d.memoizedState.cache!==m&&(d.flags|=2048),kc(ai),_r(d),null;case 25:return null;case 30:return null}throw Error(r(156,d.tag))}function Hde(c,d){switch(f_(d),d.tag){case 1:return c=d.flags,c&65536?(d.flags=c&-65537|128,d):null;case 3:return kc(ai),pe(),c=d.flags,(c&65536)!==0&&(c&128)===0?(d.flags=c&-65537|128,d):null;case 26:case 27:case 5:return xe(d),null;case 31:if(d.memoizedState!==null){if(_a(d),d.alternate===null)throw Error(r(340));th()}return c=d.flags,c&65536?(d.flags=c&-65537|128,d):null;case 13:if(_a(d),c=d.memoizedState,c!==null&&c.dehydrated!==null){if(d.alternate===null)throw Error(r(340));th()}return c=d.flags,c&65536?(d.flags=c&-65537|128,d):null;case 19:return q(Kr),null;case 4:return pe(),null;case 10:return kc(d.type),null;case 22:case 23:return _a(d),T_(),c!==null&&q(ih),c=d.flags,c&65536?(d.flags=c&-65537|128,d):null;case 24:return kc(ai),null;case 25:return null;default:return null}}function eM(c,d){switch(f_(d),d.tag){case 3:kc(ai),pe();break;case 26:case 27:case 5:xe(d);break;case 4:pe();break;case 31:d.memoizedState!==null&&_a(d);break;case 13:_a(d);break;case 19:q(Kr);break;case 10:kc(d.type);break;case 22:case 23:_a(d),T_(),c!==null&&q(ih);break;case 24:kc(ai)}}function Jm(c,d){try{var m=d.updateQueue,w=m!==null?m.lastEffect:null;if(w!==null){var E=w.next;m=E;do{if((m.tag&c)===c){w=void 0;var k=m.create,B=m.inst;w=k(),B.destroy=w}m=m.next}while(m!==E)}}catch(J){Fn(d,d.return,J)}}function cd(c,d,m){try{var w=d.updateQueue,E=w!==null?w.lastEffect:null;if(E!==null){var k=E.next;w=k;do{if((w.tag&c)===c){var B=w.inst,J=B.destroy;if(J!==void 0){B.destroy=void 0,E=d;var ne=m,ge=J;try{ge()}catch(ke){Fn(E,ne,ke)}}}w=w.next}while(w!==k)}}catch(ke){Fn(d,d.return,ke)}}function tM(c){var d=c.updateQueue;if(d!==null){var m=c.stateNode;try{WR(d,m)}catch(w){Fn(c,c.return,w)}}}function nM(c,d,m){m.props=ch(c.type,c.memoizedProps),m.state=c.memoizedState;try{m.componentWillUnmount()}catch(w){Fn(c,d,w)}}function Xm(c,d){try{var m=c.ref;if(m!==null){switch(c.tag){case 26:case 27:case 5:var w=c.stateNode;break;case 30:w=c.stateNode;break;default:w=c.stateNode}typeof m=="function"?c.refCleanup=m(w):m.current=w}}catch(E){Fn(c,d,E)}}function Ll(c,d){var m=c.ref,w=c.refCleanup;if(m!==null)if(typeof w=="function")try{w()}catch(E){Fn(c,d,E)}finally{c.refCleanup=null,c=c.alternate,c!=null&&(c.refCleanup=null)}else if(typeof m=="function")try{m(null)}catch(E){Fn(c,d,E)}else m.current=null}function rM(c){var d=c.type,m=c.memoizedProps,w=c.stateNode;try{e:switch(d){case"button":case"input":case"select":case"textarea":m.autoFocus&&w.focus();break e;case"img":m.src?w.src=m.src:m.srcSet&&(w.srcset=m.srcSet)}}catch(E){Fn(c,c.return,E)}}function ax(c,d,m){try{var w=c.stateNode;h2e(w,c.type,m,d),w[Dn]=d}catch(E){Fn(c,c.return,E)}}function iM(c){return c.tag===5||c.tag===3||c.tag===26||c.tag===27&&yd(c.type)||c.tag===4}function ox(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||iM(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.tag===27&&yd(c.type)||c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function lx(c,d,m){var w=c.tag;if(w===5||w===6)c=c.stateNode,d?(m.nodeType===9?m.body:m.nodeName==="HTML"?m.ownerDocument.body:m).insertBefore(c,d):(d=m.nodeType===9?m.body:m.nodeName==="HTML"?m.ownerDocument.body:m,d.appendChild(c),m=m._reactRootContainer,m!=null||d.onclick!==null||(d.onclick=qo));else if(w!==4&&(w===27&&yd(c.type)&&(m=c.stateNode,d=null),c=c.child,c!==null))for(lx(c,d,m),c=c.sibling;c!==null;)lx(c,d,m),c=c.sibling}function Cb(c,d,m){var w=c.tag;if(w===5||w===6)c=c.stateNode,d?m.insertBefore(c,d):m.appendChild(c);else if(w!==4&&(w===27&&yd(c.type)&&(m=c.stateNode),c=c.child,c!==null))for(Cb(c,d,m),c=c.sibling;c!==null;)Cb(c,d,m),c=c.sibling}function sM(c){var d=c.stateNode,m=c.memoizedProps;try{for(var w=c.type,E=d.attributes;E.length;)d.removeAttributeNode(E[0]);Qi(d,w,m),d[en]=c,d[Dn]=m}catch(k){Fn(c,c.return,k)}}var Nc=!1,ci=!1,cx=!1,aM=typeof WeakSet=="function"?WeakSet:Set,Ri=null;function Wde(c,d){if(c=c.containerInfo,$x=Hb,c=bR(c),n_(c)){if("selectionStart"in c)var m={start:c.selectionStart,end:c.selectionEnd};else e:{m=(m=c.ownerDocument)&&m.defaultView||window;var w=m.getSelection&&m.getSelection();if(w&&w.rangeCount!==0){m=w.anchorNode;var E=w.anchorOffset,k=w.focusNode;w=w.focusOffset;try{m.nodeType,k.nodeType}catch{m=null;break e}var B=0,J=-1,ne=-1,ge=0,ke=0,Ne=c,be=null;t:for(;;){for(var _e;Ne!==m||E!==0&&Ne.nodeType!==3||(J=B+E),Ne!==k||w!==0&&Ne.nodeType!==3||(ne=B+w),Ne.nodeType===3&&(B+=Ne.nodeValue.length),(_e=Ne.firstChild)!==null;)be=Ne,Ne=_e;for(;;){if(Ne===c)break t;if(be===m&&++ge===E&&(J=B),be===k&&++ke===w&&(ne=B),(_e=Ne.nextSibling)!==null)break;Ne=be,be=Ne.parentNode}Ne=_e}m=J===-1||ne===-1?null:{start:J,end:ne}}else m=null}m=m||{start:0,end:0}}else m=null;for(Ix={focusedElem:c,selectionRange:m},Hb=!1,Ri=d;Ri!==null;)if(d=Ri,c=d.child,(d.subtreeFlags&1028)!==0&&c!==null)c.return=d,Ri=c;else for(;Ri!==null;){switch(d=Ri,k=d.alternate,c=d.flags,d.tag){case 0:if((c&4)!==0&&(c=d.updateQueue,c=c!==null?c.events:null,c!==null))for(m=0;m<c.length;m++)E=c[m],E.ref.impl=E.nextImpl;break;case 11:case 15:break;case 1:if((c&1024)!==0&&k!==null){c=void 0,m=d,E=k.memoizedProps,k=k.memoizedState,w=m.stateNode;try{var at=ch(m.type,E);c=w.getSnapshotBeforeUpdate(at,k),w.__reactInternalSnapshotBeforeUpdate=c}catch(At){Fn(m,m.return,At)}}break;case 3:if((c&1024)!==0){if(c=d.stateNode.containerInfo,m=c.nodeType,m===9)Px(c);else if(m===1)switch(c.nodeName){case"HEAD":case"HTML":case"BODY":Px(c);break;default:c.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((c&1024)!==0)throw Error(r(163))}if(c=d.sibling,c!==null){c.return=d.return,Ri=c;break}Ri=d.return}}function oM(c,d,m){var w=m.flags;switch(m.tag){case 0:case 11:case 15:Pc(c,m),w&4&&Jm(5,m);break;case 1:if(Pc(c,m),w&4)if(c=m.stateNode,d===null)try{c.componentDidMount()}catch(B){Fn(m,m.return,B)}else{var E=ch(m.type,d.memoizedProps);d=d.memoizedState;try{c.componentDidUpdate(E,d,c.__reactInternalSnapshotBeforeUpdate)}catch(B){Fn(m,m.return,B)}}w&64&&tM(m),w&512&&Xm(m,m.return);break;case 3:if(Pc(c,m),w&64&&(c=m.updateQueue,c!==null)){if(d=null,m.child!==null)switch(m.child.tag){case 27:case 5:d=m.child.stateNode;break;case 1:d=m.child.stateNode}try{WR(c,d)}catch(B){Fn(m,m.return,B)}}break;case 27:d===null&&w&4&&sM(m);case 26:case 5:Pc(c,m),d===null&&w&4&&rM(m),w&512&&Xm(m,m.return);break;case 12:Pc(c,m);break;case 31:Pc(c,m),w&4&&uM(c,m);break;case 13:Pc(c,m),w&4&&dM(c,m),w&64&&(c=m.memoizedState,c!==null&&(c=c.dehydrated,c!==null&&(m=e2e.bind(null,m),v2e(c,m))));break;case 22:if(w=m.memoizedState!==null||Nc,!w){d=d!==null&&d.memoizedState!==null||ci,E=Nc;var k=ci;Nc=w,(ci=d)&&!k?Rc(c,m,(m.subtreeFlags&8772)!==0):Pc(c,m),Nc=E,ci=k}break;case 30:break;default:Pc(c,m)}}function lM(c){var d=c.alternate;d!==null&&(c.alternate=null,lM(d)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(d=c.stateNode,d!==null&&Un(d)),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}var Lr=null,Vs=!1;function Oc(c,d,m){for(m=m.child;m!==null;)cM(c,d,m),m=m.sibling}function cM(c,d,m){if(Ze&&typeof Ze.onCommitFiberUnmount=="function")try{Ze.onCommitFiberUnmount(wt,m)}catch{}switch(m.tag){case 26:ci||Ll(m,d),Oc(c,d,m),m.memoizedState?m.memoizedState.count--:m.stateNode&&(m=m.stateNode,m.parentNode.removeChild(m));break;case 27:ci||Ll(m,d);var w=Lr,E=Vs;yd(m.type)&&(Lr=m.stateNode,Vs=!1),Oc(c,d,m),oy(m.stateNode),Lr=w,Vs=E;break;case 5:ci||Ll(m,d);case 6:if(w=Lr,E=Vs,Lr=null,Oc(c,d,m),Lr=w,Vs=E,Lr!==null)if(Vs)try{(Lr.nodeType===9?Lr.body:Lr.nodeName==="HTML"?Lr.ownerDocument.body:Lr).removeChild(m.stateNode)}catch(k){Fn(m,d,k)}else try{Lr.removeChild(m.stateNode)}catch(k){Fn(m,d,k)}break;case 18:Lr!==null&&(Vs?(c=Lr,tD(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,m.stateNode),Bp(c)):tD(Lr,m.stateNode));break;case 4:w=Lr,E=Vs,Lr=m.stateNode.containerInfo,Vs=!0,Oc(c,d,m),Lr=w,Vs=E;break;case 0:case 11:case 14:case 15:cd(2,m,d),ci||cd(4,m,d),Oc(c,d,m);break;case 1:ci||(Ll(m,d),w=m.stateNode,typeof w.componentWillUnmount=="function"&&nM(m,d,w)),Oc(c,d,m);break;case 21:Oc(c,d,m);break;case 22:ci=(w=ci)||m.memoizedState!==null,Oc(c,d,m),ci=w;break;default:Oc(c,d,m)}}function uM(c,d){if(d.memoizedState===null&&(c=d.alternate,c!==null&&(c=c.memoizedState,c!==null))){c=c.dehydrated;try{Bp(c)}catch(m){Fn(d,d.return,m)}}}function dM(c,d){if(d.memoizedState===null&&(c=d.alternate,c!==null&&(c=c.memoizedState,c!==null&&(c=c.dehydrated,c!==null))))try{Bp(c)}catch(m){Fn(d,d.return,m)}}function qde(c){switch(c.tag){case 31:case 13:case 19:var d=c.stateNode;return d===null&&(d=c.stateNode=new aM),d;case 22:return c=c.stateNode,d=c._retryCache,d===null&&(d=c._retryCache=new aM),d;default:throw Error(r(435,c.tag))}}function Eb(c,d){var m=qde(c);d.forEach(function(w){if(!m.has(w)){m.add(w);var E=t2e.bind(null,c,w);w.then(E,E)}})}function Hs(c,d){var m=d.deletions;if(m!==null)for(var w=0;w<m.length;w++){var E=m[w],k=c,B=d,J=B;e:for(;J!==null;){switch(J.tag){case 27:if(yd(J.type)){Lr=J.stateNode,Vs=!1;break e}break;case 5:Lr=J.stateNode,Vs=!1;break e;case 3:case 4:Lr=J.stateNode.containerInfo,Vs=!0;break e}J=J.return}if(Lr===null)throw Error(r(160));cM(k,B,E),Lr=null,Vs=!1,k=E.alternate,k!==null&&(k.return=null),E.return=null}if(d.subtreeFlags&13886)for(d=d.child;d!==null;)hM(d,c),d=d.sibling}var Ko=null;function hM(c,d){var m=c.alternate,w=c.flags;switch(c.tag){case 0:case 11:case 14:case 15:Hs(d,c),Ws(c),w&4&&(cd(3,c,c.return),Jm(3,c),cd(5,c,c.return));break;case 1:Hs(d,c),Ws(c),w&512&&(ci||m===null||Ll(m,m.return)),w&64&&Nc&&(c=c.updateQueue,c!==null&&(w=c.callbacks,w!==null&&(m=c.shared.hiddenCallbacks,c.shared.hiddenCallbacks=m===null?w:m.concat(w))));break;case 26:var E=Ko;if(Hs(d,c),Ws(c),w&512&&(ci||m===null||Ll(m,m.return)),w&4){var k=m!==null?m.memoizedState:null;if(w=c.memoizedState,m===null)if(w===null)if(c.stateNode===null){e:{w=c.type,m=c.memoizedProps,E=E.ownerDocument||E;t:switch(w){case"title":k=E.getElementsByTagName("title")[0],(!k||k[Wt]||k[en]||k.namespaceURI==="http://www.w3.org/2000/svg"||k.hasAttribute("itemprop"))&&(k=E.createElement(w),E.head.insertBefore(k,E.querySelector("head > title"))),Qi(k,w,m),k[en]=c,_n(k),w=k;break e;case"link":var B=hD("link","href",E).get(w+(m.href||""));if(B){for(var J=0;J<B.length;J++)if(k=B[J],k.getAttribute("href")===(m.href==null||m.href===""?null:m.href)&&k.getAttribute("rel")===(m.rel==null?null:m.rel)&&k.getAttribute("title")===(m.title==null?null:m.title)&&k.getAttribute("crossorigin")===(m.crossOrigin==null?null:m.crossOrigin)){B.splice(J,1);break t}}k=E.createElement(w),Qi(k,w,m),E.head.appendChild(k);break;case"meta":if(B=hD("meta","content",E).get(w+(m.content||""))){for(J=0;J<B.length;J++)if(k=B[J],k.getAttribute("content")===(m.content==null?null:""+m.content)&&k.getAttribute("name")===(m.name==null?null:m.name)&&k.getAttribute("property")===(m.property==null?null:m.property)&&k.getAttribute("http-equiv")===(m.httpEquiv==null?null:m.httpEquiv)&&k.getAttribute("charset")===(m.charSet==null?null:m.charSet)){B.splice(J,1);break t}}k=E.createElement(w),Qi(k,w,m),E.head.appendChild(k);break;default:throw Error(r(468,w))}k[en]=c,_n(k),w=k}c.stateNode=w}else fD(E,c.type,c.stateNode);else c.stateNode=dD(E,w,c.memoizedProps);else k!==w?(k===null?m.stateNode!==null&&(m=m.stateNode,m.parentNode.removeChild(m)):k.count--,w===null?fD(E,c.type,c.stateNode):dD(E,w,c.memoizedProps)):w===null&&c.stateNode!==null&&ax(c,c.memoizedProps,m.memoizedProps)}break;case 27:Hs(d,c),Ws(c),w&512&&(ci||m===null||Ll(m,m.return)),m!==null&&w&4&&ax(c,c.memoizedProps,m.memoizedProps);break;case 5:if(Hs(d,c),Ws(c),w&512&&(ci||m===null||Ll(m,m.return)),c.flags&32){E=c.stateNode;try{Yu(E,"")}catch(at){Fn(c,c.return,at)}}w&4&&c.stateNode!=null&&(E=c.memoizedProps,ax(c,E,m!==null?m.memoizedProps:E)),w&1024&&(cx=!0);break;case 6:if(Hs(d,c),Ws(c),w&4){if(c.stateNode===null)throw Error(r(162));w=c.memoizedProps,m=c.stateNode;try{m.nodeValue=w}catch(at){Fn(c,c.return,at)}}break;case 3:if(Bb=null,E=Ko,Ko=Db(d.containerInfo),Hs(d,c),Ko=E,Ws(c),w&4&&m!==null&&m.memoizedState.isDehydrated)try{Bp(d.containerInfo)}catch(at){Fn(c,c.return,at)}cx&&(cx=!1,fM(c));break;case 4:w=Ko,Ko=Db(c.stateNode.containerInfo),Hs(d,c),Ws(c),Ko=w;break;case 12:Hs(d,c),Ws(c);break;case 31:Hs(d,c),Ws(c),w&4&&(w=c.updateQueue,w!==null&&(c.updateQueue=null,Eb(c,w)));break;case 13:Hs(d,c),Ws(c),c.child.flags&8192&&c.memoizedState!==null!=(m!==null&&m.memoizedState!==null)&&(Ab=$t()),w&4&&(w=c.updateQueue,w!==null&&(c.updateQueue=null,Eb(c,w)));break;case 22:E=c.memoizedState!==null;var ne=m!==null&&m.memoizedState!==null,ge=Nc,ke=ci;if(Nc=ge||E,ci=ke||ne,Hs(d,c),ci=ke,Nc=ge,Ws(c),w&8192)e:for(d=c.stateNode,d._visibility=E?d._visibility&-2:d._visibility|1,E&&(m===null||ne||Nc||ci||uh(c)),m=null,d=c;;){if(d.tag===5||d.tag===26){if(m===null){ne=m=d;try{if(k=ne.stateNode,E)B=k.style,typeof B.setProperty=="function"?B.setProperty("display","none","important"):B.display="none";else{J=ne.stateNode;var Ne=ne.memoizedProps.style,be=Ne!=null&&Ne.hasOwnProperty("display")?Ne.display:null;J.style.display=be==null||typeof be=="boolean"?"":(""+be).trim()}}catch(at){Fn(ne,ne.return,at)}}}else if(d.tag===6){if(m===null){ne=d;try{ne.stateNode.nodeValue=E?"":ne.memoizedProps}catch(at){Fn(ne,ne.return,at)}}}else if(d.tag===18){if(m===null){ne=d;try{var _e=ne.stateNode;E?nD(_e,!0):nD(ne.stateNode,!1)}catch(at){Fn(ne,ne.return,at)}}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===c)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===c)break e;for(;d.sibling===null;){if(d.return===null||d.return===c)break e;m===d&&(m=null),d=d.return}m===d&&(m=null),d.sibling.return=d.return,d=d.sibling}w&4&&(w=c.updateQueue,w!==null&&(m=w.retryQueue,m!==null&&(w.retryQueue=null,Eb(c,m))));break;case 19:Hs(d,c),Ws(c),w&4&&(w=c.updateQueue,w!==null&&(c.updateQueue=null,Eb(c,w)));break;case 30:break;case 21:break;default:Hs(d,c),Ws(c)}}function Ws(c){var d=c.flags;if(d&2){try{for(var m,w=c.return;w!==null;){if(iM(w)){m=w;break}w=w.return}if(m==null)throw Error(r(160));switch(m.tag){case 27:var E=m.stateNode,k=ox(c);Cb(c,k,E);break;case 5:var B=m.stateNode;m.flags&32&&(Yu(B,""),m.flags&=-33);var J=ox(c);Cb(c,J,B);break;case 3:case 4:var ne=m.stateNode.containerInfo,ge=ox(c);lx(c,ge,ne);break;default:throw Error(r(161))}}catch(ke){Fn(c,c.return,ke)}c.flags&=-3}d&4096&&(c.flags&=-4097)}function fM(c){if(c.subtreeFlags&1024)for(c=c.child;c!==null;){var d=c;fM(d),d.tag===5&&d.flags&1024&&d.stateNode.reset(),c=c.sibling}}function Pc(c,d){if(d.subtreeFlags&8772)for(d=d.child;d!==null;)oM(c,d.alternate,d),d=d.sibling}function uh(c){for(c=c.child;c!==null;){var d=c;switch(d.tag){case 0:case 11:case 14:case 15:cd(4,d,d.return),uh(d);break;case 1:Ll(d,d.return);var m=d.stateNode;typeof m.componentWillUnmount=="function"&&nM(d,d.return,m),uh(d);break;case 27:oy(d.stateNode);case 26:case 5:Ll(d,d.return),uh(d);break;case 22:d.memoizedState===null&&uh(d);break;case 30:uh(d);break;default:uh(d)}c=c.sibling}}function Rc(c,d,m){for(m=m&&(d.subtreeFlags&8772)!==0,d=d.child;d!==null;){var w=d.alternate,E=c,k=d,B=k.flags;switch(k.tag){case 0:case 11:case 15:Rc(E,k,m),Jm(4,k);break;case 1:if(Rc(E,k,m),w=k,E=w.stateNode,typeof E.componentDidMount=="function")try{E.componentDidMount()}catch(ge){Fn(w,w.return,ge)}if(w=k,E=w.updateQueue,E!==null){var J=w.stateNode;try{var ne=E.shared.hiddenCallbacks;if(ne!==null)for(E.shared.hiddenCallbacks=null,E=0;E<ne.length;E++)HR(ne[E],J)}catch(ge){Fn(w,w.return,ge)}}m&&B&64&&tM(k),Xm(k,k.return);break;case 27:sM(k);case 26:case 5:Rc(E,k,m),m&&w===null&&B&4&&rM(k),Xm(k,k.return);break;case 12:Rc(E,k,m);break;case 31:Rc(E,k,m),m&&B&4&&uM(E,k);break;case 13:Rc(E,k,m),m&&B&4&&dM(E,k);break;case 22:k.memoizedState===null&&Rc(E,k,m),Xm(k,k.return);break;case 30:break;default:Rc(E,k,m)}d=d.sibling}}function ux(c,d){var m=null;c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(m=c.memoizedState.cachePool.pool),c=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(c=d.memoizedState.cachePool.pool),c!==m&&(c!=null&&c.refCount++,m!=null&&Dm(m))}function dx(c,d){c=null,d.alternate!==null&&(c=d.alternate.memoizedState.cache),d=d.memoizedState.cache,d!==c&&(d.refCount++,c!=null&&Dm(c))}function Go(c,d,m,w){if(d.subtreeFlags&10256)for(d=d.child;d!==null;)pM(c,d,m,w),d=d.sibling}function pM(c,d,m,w){var E=d.flags;switch(d.tag){case 0:case 11:case 15:Go(c,d,m,w),E&2048&&Jm(9,d);break;case 1:Go(c,d,m,w);break;case 3:Go(c,d,m,w),E&2048&&(c=null,d.alternate!==null&&(c=d.alternate.memoizedState.cache),d=d.memoizedState.cache,d!==c&&(d.refCount++,c!=null&&Dm(c)));break;case 12:if(E&2048){Go(c,d,m,w),c=d.stateNode;try{var k=d.memoizedProps,B=k.id,J=k.onPostCommit;typeof J=="function"&&J(B,d.alternate===null?"mount":"update",c.passiveEffectDuration,-0)}catch(ne){Fn(d,d.return,ne)}}else Go(c,d,m,w);break;case 31:Go(c,d,m,w);break;case 13:Go(c,d,m,w);break;case 23:break;case 22:k=d.stateNode,B=d.alternate,d.memoizedState!==null?k._visibility&2?Go(c,d,m,w):Qm(c,d):k._visibility&2?Go(c,d,m,w):(k._visibility|=2,Lp(c,d,m,w,(d.subtreeFlags&10256)!==0||!1)),E&2048&&ux(B,d);break;case 24:Go(c,d,m,w),E&2048&&dx(d.alternate,d);break;default:Go(c,d,m,w)}}function Lp(c,d,m,w,E){for(E=E&&((d.subtreeFlags&10256)!==0||!1),d=d.child;d!==null;){var k=c,B=d,J=m,ne=w,ge=B.flags;switch(B.tag){case 0:case 11:case 15:Lp(k,B,J,ne,E),Jm(8,B);break;case 23:break;case 22:var ke=B.stateNode;B.memoizedState!==null?ke._visibility&2?Lp(k,B,J,ne,E):Qm(k,B):(ke._visibility|=2,Lp(k,B,J,ne,E)),E&&ge&2048&&ux(B.alternate,B);break;case 24:Lp(k,B,J,ne,E),E&&ge&2048&&dx(B.alternate,B);break;default:Lp(k,B,J,ne,E)}d=d.sibling}}function Qm(c,d){if(d.subtreeFlags&10256)for(d=d.child;d!==null;){var m=c,w=d,E=w.flags;switch(w.tag){case 22:Qm(m,w),E&2048&&ux(w.alternate,w);break;case 24:Qm(m,w),E&2048&&dx(w.alternate,w);break;default:Qm(m,w)}d=d.sibling}}var ey=8192;function $p(c,d,m){if(c.subtreeFlags&ey)for(c=c.child;c!==null;)mM(c,d,m),c=c.sibling}function mM(c,d,m){switch(c.tag){case 26:$p(c,d,m),c.flags&ey&&c.memoizedState!==null&&N2e(m,Ko,c.memoizedState,c.memoizedProps);break;case 5:$p(c,d,m);break;case 3:case 4:var w=Ko;Ko=Db(c.stateNode.containerInfo),$p(c,d,m),Ko=w;break;case 22:c.memoizedState===null&&(w=c.alternate,w!==null&&w.memoizedState!==null?(w=ey,ey=16777216,$p(c,d,m),ey=w):$p(c,d,m));break;default:$p(c,d,m)}}function yM(c){var d=c.alternate;if(d!==null&&(c=d.child,c!==null)){d.child=null;do d=c.sibling,c.sibling=null,c=d;while(c!==null)}}function ty(c){var d=c.deletions;if((c.flags&16)!==0){if(d!==null)for(var m=0;m<d.length;m++){var w=d[m];Ri=w,bM(w,c)}yM(c)}if(c.subtreeFlags&10256)for(c=c.child;c!==null;)gM(c),c=c.sibling}function gM(c){switch(c.tag){case 0:case 11:case 15:ty(c),c.flags&2048&&cd(9,c,c.return);break;case 3:ty(c);break;case 12:ty(c);break;case 22:var d=c.stateNode;c.memoizedState!==null&&d._visibility&2&&(c.return===null||c.return.tag!==13)?(d._visibility&=-3,Sb(c)):ty(c);break;default:ty(c)}}function Sb(c){var d=c.deletions;if((c.flags&16)!==0){if(d!==null)for(var m=0;m<d.length;m++){var w=d[m];Ri=w,bM(w,c)}yM(c)}for(c=c.child;c!==null;){switch(d=c,d.tag){case 0:case 11:case 15:cd(8,d,d.return),Sb(d);break;case 22:m=d.stateNode,m._visibility&2&&(m._visibility&=-3,Sb(d));break;default:Sb(d)}c=c.sibling}}function bM(c,d){for(;Ri!==null;){var m=Ri;switch(m.tag){case 0:case 11:case 15:cd(8,m,d);break;case 23:case 22:if(m.memoizedState!==null&&m.memoizedState.cachePool!==null){var w=m.memoizedState.cachePool.pool;w!=null&&w.refCount++}break;case 24:Dm(m.memoizedState.cache)}if(w=m.child,w!==null)w.return=m,Ri=w;else e:for(m=c;Ri!==null;){w=Ri;var E=w.sibling,k=w.return;if(lM(w),w===m){Ri=null;break e}if(E!==null){E.return=k,Ri=E;break e}Ri=k}}}var Zde={getCacheForType:function(c){var d=Ji(ai),m=d.data.get(c);return m===void 0&&(m=c(),d.data.set(c,m)),m},cacheSignal:function(){return Ji(ai).controller.signal}},Kde=typeof WeakMap=="function"?WeakMap:Map,On=0,Xn=null,an=null,cn=0,Bn=0,xa=null,ud=!1,Ip=!1,hx=!1,jc=0,Hr=0,dd=0,dh=0,fx=0,Ca=0,Np=0,ny=null,qs=null,px=!1,Ab=0,wM=0,kb=1/0,Tb=null,hd=null,Ei=0,fd=null,Op=null,Mc=0,mx=0,yx=null,vM=null,ry=0,gx=null;function Ea(){return(On&2)!==0&&cn!==0?cn&-cn:L.T!==null?Cx():Jn()}function _M(){if(Ca===0)if((cn&536870912)===0||mn){var c=Q;Q<<=1,(Q&3932160)===0&&(Q=262144),Ca=c}else Ca=536870912;return c=va.current,c!==null&&(c.flags|=32),Ca}function Zs(c,d,m){(c===Xn&&(Bn===2||Bn===9)||c.cancelPendingCommit!==null)&&(Pp(c,0),pd(c,cn,Ca,!1)),bt(c,m),((On&2)===0||c!==Xn)&&(c===Xn&&((On&2)===0&&(dh|=m),Hr===4&&pd(c,cn,Ca,!1)),$l(c))}function xM(c,d,m){if((On&6)!==0)throw Error(r(327));var w=!m&&(d&127)===0&&(d&c.expiredLanes)===0||ye(c,d),E=w?Jde(c,d):wx(c,d,!0),k=w;do{if(E===0){Ip&&!w&&pd(c,d,0,!1);break}else{if(m=c.current.alternate,k&&!Gde(m)){E=wx(c,d,!1),k=!1;continue}if(E===2){if(k=d,c.errorRecoveryDisabledLanes&k)var B=0;else B=c.pendingLanes&-536870913,B=B!==0?B:B&536870912?536870912:0;if(B!==0){d=B;e:{var J=c;E=ny;var ne=J.current.memoizedState.isDehydrated;if(ne&&(Pp(J,B).flags|=256),B=wx(J,B,!1),B!==2){if(hx&&!ne){J.errorRecoveryDisabledLanes|=k,dh|=k,E=4;break e}k=qs,qs=E,k!==null&&(qs===null?qs=k:qs.push.apply(qs,k))}E=B}if(k=!1,E!==2)continue}}if(E===1){Pp(c,0),pd(c,d,0,!0);break}e:{switch(w=c,k=E,k){case 0:case 1:throw Error(r(345));case 4:if((d&4194048)!==d)break;case 6:pd(w,d,Ca,!ud);break e;case 2:qs=null;break;case 3:case 5:break;default:throw Error(r(329))}
vendor: 13,450 bytes, line 49
49if((d&62914560)===d&&(E=Ab+300-$t(),10<E)){if(pd(w,d,Ca,!ud),ce(w,0,!0)!==0)break e;Mc=d,w.timeoutHandle=QM(CM.bind(null,w,m,qs,Tb,px,d,Ca,dh,Np,ud,k,"Throttled",-0,0),E);break e}CM(w,m,qs,Tb,px,d,Ca,dh,Np,ud,k,null,-0,0)}}break}while(!0);$l(c)}function CM(c,d,m,w,E,k,B,J,ne,ge,ke,Ne,be,_e){if(c.timeoutHandle=-1,Ne=d.subtreeFlags,Ne&8192||(Ne&16785408)===16785408){Ne={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:qo},mM(d,k,Ne);var at=(k&62914560)===k?Ab-$t():(k&4194048)===k?wM-$t():0;if(at=O2e(Ne,at),at!==null){Mc=k,c.cancelPendingCommit=at(IM.bind(null,c,d,k,m,w,E,B,J,ne,ke,Ne,null,be,_e)),pd(c,k,B,!ge);return}}IM(c,d,k,m,w,E,B,J,ne)}function Gde(c){for(var d=c;;){var m=d.tag;if((m===0||m===11||m===15)&&d.flags&16384&&(m=d.updateQueue,m!==null&&(m=m.stores,m!==null)))for(var w=0;w<m.length;w++){var E=m[w],k=E.getSnapshot;E=E.value;try{if(!ba(k(),E))return!1}catch{return!1}}if(m=d.child,d.subtreeFlags&16384&&m!==null)m.return=d,d=m;else{if(d===c)break;for(;d.sibling===null;){if(d.return===null||d.return===c)return!0;d=d.return}d.sibling.return=d.return,d=d.sibling}}return!0}function pd(c,d,m,w){d&=~fx,d&=~dh,c.suspendedLanes|=d,c.pingedLanes&=~d,w&&(c.warmLanes|=d),w=c.expirationTimes;for(var E=d;0<E;){var k=31-bn(E),B=1<<k;w[k]=-1,E&=~B}m!==0&&St(c,m,d)}function Lb(){return(On&6)===0?(iy(0),!1):!0}function bx(){if(an!==null){if(Bn===0)var c=an.return;else c=an,Ac=nh=null,P_(c),Ep=null,Bm=0,c=an;for(;c!==null;)eM(c.alternate,c),c=c.return;an=null}}function Pp(c,d){var m=c.timeoutHandle;m!==-1&&(c.timeoutHandle=-1,m2e(m)),m=c.cancelPendingCommit,m!==null&&(c.cancelPendingCommit=null,m()),Mc=0,bx(),Xn=c,an=m=Ec(c.current,null),cn=d,Bn=0,xa=null,ud=!1,Ip=ye(c,d),hx=!1,Np=Ca=fx=dh=dd=Hr=0,qs=ny=null,px=!1,(d&8)!==0&&(d|=d&32);var w=c.entangledLanes;if(w!==0)for(c=c.entanglements,w&=d;0<w;){var E=31-bn(w),k=1<<E;d|=c[E],w&=~k}return jc=d,Y5(),m}function EM(c,d){Kt=null,L.H=Km,d===Cp||d===ib?(d=BR(),Bn=3):d===x_?(d=BR(),Bn=4):Bn=d===Y_?8:d!==null&&typeof d=="object"&&typeof d.then=="function"?6:1,xa=d,an===null&&(Hr=1,bb(c,Ja(d,c.current)))}function SM(){var c=va.current;return c===null?!0:(cn&4194048)===cn?to===null:(cn&62914560)===cn||(cn&536870912)!==0?c===to:!1}function AM(){var c=L.H;return L.H=Km,c===null?Km:c}function kM(){var c=L.A;return L.A=Zde,c}function $b(){Hr=4,ud||(cn&4194048)!==cn&&va.current!==null||(Ip=!0),(dd&134217727)===0&&(dh&134217727)===0||Xn===null||pd(Xn,cn,Ca,!1)}function wx(c,d,m){var w=On;On|=2;var E=AM(),k=kM();(Xn!==c||cn!==d)&&(Tb=null,Pp(c,d)),d=!1;var B=Hr;e:do try{if(Bn!==0&&an!==null){var J=an,ne=xa;switch(Bn){case 8:bx(),B=6;break e;case 3:case 2:case 9:case 6:va.current===null&&(d=!0);var ge=Bn;if(Bn=0,xa=null,Rp(c,J,ne,ge),m&&Ip){B=0;break e}break;default:ge=Bn,Bn=0,xa=null,Rp(c,J,ne,ge)}}Yde(),B=Hr;break}catch(ke){EM(c,ke)}while(!0);return d&&c.shellSuspendCounter++,Ac=nh=null,On=w,L.H=E,L.A=k,an===null&&(Xn=null,cn=0,Y5()),B}function Yde(){for(;an!==null;)TM(an)}function Jde(c,d){var m=On;On|=2;var w=AM(),E=kM();Xn!==c||cn!==d?(Tb=null,kb=$t()+500,Pp(c,d)):Ip=ye(c,d);e:do try{if(Bn!==0&&an!==null){d=an;var k=xa;t:switch(Bn){case 1:Bn=0,xa=null,Rp(c,d,k,1);break;case 2:case 9:if(DR(k)){Bn=0,xa=null,LM(d);break}d=function(){Bn!==2&&Bn!==9||Xn!==c||(Bn=7),$l(c)},k.then(d,d);break e;case 3:Bn=7;break e;case 4:Bn=5;break e;case 7:DR(k)?(Bn=0,xa=null,LM(d)):(Bn=0,xa=null,Rp(c,d,k,7));break;case 5:var B=null;switch(an.tag){case 26:B=an.memoizedState;case 5:case 27:var J=an;if(B?pD(B):J.stateNode.complete){Bn=0,xa=null;var ne=J.sibling;if(ne!==null)an=ne;else{var ge=J.return;ge!==null?(an=ge,Ib(ge)):an=null}break t}}Bn=0,xa=null,Rp(c,d,k,5);break;case 6:Bn=0,xa=null,Rp(c,d,k,6);break;case 8:bx(),Hr=6;break e;default:throw Error(r(462))}}Xde();break}catch(ke){EM(c,ke)}while(!0);return Ac=nh=null,L.H=w,L.A=E,On=m,an!==null?0:(Xn=null,cn=0,Y5(),Hr)}function Xde(){for(;an!==null&&!br();)TM(an)}function TM(c){var d=Xj(c.alternate,c,jc);c.memoizedProps=c.pendingProps,d===null?Ib(c):an=d}function LM(c){var d=c,m=d.alternate;switch(d.tag){case 15:case 0:d=qj(m,d,d.pendingProps,d.type,void 0,cn);break;case 11:d=qj(m,d,d.pendingProps,d.type.render,d.ref,cn);break;case 5:P_(d);default:eM(m,d),d=an=kR(d,jc),d=Xj(m,d,jc)}c.memoizedProps=c.pendingProps,d===null?Ib(c):an=d}function Rp(c,d,m,w){Ac=nh=null,P_(d),Ep=null,Bm=0;var E=d.return;try{if(Bde(c,E,d,m,cn)){Hr=1,bb(c,Ja(m,c.current)),an=null;return}}catch(k){if(E!==null)throw an=E,k;Hr=1,bb(c,Ja(m,c.current)),an=null;return}d.flags&32768?(mn||w===1?c=!0:Ip||(cn&536870912)!==0?c=!1:(ud=c=!0,(w===2||w===9||w===3||w===6)&&(w=va.current,w!==null&&w.tag===13&&(w.flags|=16384))),$M(d,c)):Ib(d)}function Ib(c){var d=c;do{if((d.flags&32768)!==0){$M(d,ud);return}c=d.return;var m=Vde(d.alternate,d,jc);if(m!==null){an=m;return}if(d=d.sibling,d!==null){an=d;return}an=d=c}while(d!==null);Hr===0&&(Hr=5)}function $M(c,d){do{var m=Hde(c.alternate,c);if(m!==null){m.flags&=32767,an=m;return}if(m=c.return,m!==null&&(m.flags|=32768,m.subtreeFlags=0,m.deletions=null),!d&&(c=c.sibling,c!==null)){an=c;return}an=c=m}while(c!==null);Hr=6,an=null}function IM(c,d,m,w,E,k,B,J,ne){c.cancelPendingCommit=null;do Nb();while(Ei!==0);if((On&6)!==0)throw Error(r(327));if(d!==null){if(d===c.current)throw Error(r(177));if(k=d.lanes|d.childLanes,k|=o_,Ut(c,m,k,B,J,ne),c===Xn&&(an=Xn=null,cn=0),Op=d,fd=c,Mc=m,mx=k,yx=E,vM=w,(d.subtreeFlags&10256)!==0||(d.flags&10256)!==0?(c.callbackNode=null,c.callbackPriority=0,n2e(In,function(){return jM(),null})):(c.callbackNode=null,c.callbackPriority=0),w=(d.flags&13878)!==0,(d.subtreeFlags&13878)!==0||w){w=L.T,L.T=null,E=M.p,M.p=2,B=On,On|=4;try{Wde(c,d,m)}finally{On=B,M.p=E,L.T=w}}Ei=1,NM(),OM(),PM()}}function NM(){if(Ei===1){Ei=0;var c=fd,d=Op,m=(d.flags&13878)!==0;if((d.subtreeFlags&13878)!==0||m){m=L.T,L.T=null;var w=M.p;M.p=2;var E=On;On|=4;try{hM(d,c);var k=Ix,B=bR(c.containerInfo),J=k.focusedElem,ne=k.selectionRange;if(B!==J&&J&&J.ownerDocument&&gR(J.ownerDocument.documentElement,J)){if(ne!==null&&n_(J)){var ge=ne.start,ke=ne.end;if(ke===void 0&&(ke=ge),"selectionStart"in J)J.selectionStart=ge,J.selectionEnd=Math.min(ke,J.value.length);else{var Ne=J.ownerDocument||document,be=Ne&&Ne.defaultView||window;if(be.getSelection){var _e=be.getSelection(),at=J.textContent.length,At=Math.min(ne.start,at),Kn=ne.end===void 0?At:Math.min(ne.end,at);!_e.extend&&At>Kn&&(B=Kn,Kn=At,At=B);var de=yR(J,At),oe=yR(J,Kn);if(de&&oe&&(_e.rangeCount!==1||_e.anchorNode!==de.node||_e.anchorOffset!==de.offset||_e.focusNode!==oe.node||_e.focusOffset!==oe.offset)){var me=Ne.createRange();me.setStart(de.node,de.offset),_e.removeAllRanges(),At>Kn?(_e.addRange(me),_e.extend(oe.node,oe.offset)):(me.setEnd(oe.node,oe.offset),_e.addRange(me))}}}}for(Ne=[],_e=J;_e=_e.parentNode;)_e.nodeType===1&&Ne.push({element:_e,left:_e.scrollLeft,top:_e.scrollTop});for(typeof J.focus=="function"&&J.focus(),J=0;J<Ne.length;J++){var $e=Ne[J];$e.element.scrollLeft=$e.left,$e.element.scrollTop=$e.top}}Hb=!!$x,Ix=$x=null}finally{On=E,M.p=w,L.T=m}}c.current=d,Ei=2}}function OM(){if(Ei===2){Ei=0;var c=fd,d=Op,m=(d.flags&8772)!==0;if((d.subtreeFlags&8772)!==0||m){m=L.T,L.T=null;var w=M.p;M.p=2;var E=On;On|=4;try{oM(c,d.alternate,d)}finally{On=E,M.p=w,L.T=m}}Ei=3}}function PM(){if(Ei===4||Ei===3){Ei=0,$n();var c=fd,d=Op,m=Mc,w=vM;(d.subtreeFlags&10256)!==0||(d.flags&10256)!==0?Ei=5:(Ei=0,Op=fd=null,RM(c,c.pendingLanes));var E=c.pendingLanes;if(E===0&&(hd=null),Nn(m),d=d.stateNode,Ze&&typeof Ze.onCommitFiberRoot=="function")try{Ze.onCommitFiberRoot(wt,d,void 0,(d.current.flags&128)===128)}catch{}if(w!==null){d=L.T,E=M.p,M.p=2,L.T=null;try{for(var k=c.onRecoverableError,B=0;B<w.length;B++){var J=w[B];k(J.value,{componentStack:J.stack})}}finally{L.T=d,M.p=E}}(Mc&3)!==0&&Nb(),$l(c),E=c.pendingLanes,(m&261930)!==0&&(E&42)!==0?c===gx?ry++:(ry=0,gx=c):ry=0,iy(0)}}function RM(c,d){(c.pooledCacheLanes&=d)===0&&(d=c.pooledCache,d!=null&&(c.pooledCache=null,Dm(d)))}function Nb(){return NM(),OM(),PM(),jM()}function jM(){if(Ei!==5)return!1;var c=fd,d=mx;mx=0;var m=Nn(Mc),w=L.T,E=M.p;try{M.p=32>m?32:m,L.T=null,m=yx,yx=null;var k=fd,B=Mc;if(Ei=0,Op=fd=null,Mc=0,(On&6)!==0)throw Error(r(331));var J=On;if(On|=4,gM(k.current),pM(k,k.current,B,m),On=J,iy(0,!1),Ze&&typeof Ze.onPostCommitFiberRoot=="function")try{Ze.onPostCommitFiberRoot(wt,k)}catch{}return!0}finally{M.p=E,L.T=w,RM(c,d)}}function MM(c,d,m){d=Ja(m,d),d=G_(c.stateNode,d,2),c=ad(c,d,2),c!==null&&(bt(c,2),$l(c))}function Fn(c,d,m){if(c.tag===3)MM(c,c,m);else for(;d!==null;){if(d.tag===3){MM(d,c,m);break}else if(d.tag===1){var w=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof w.componentDidCatch=="function"&&(hd===null||!hd.has(w))){c=Ja(m,c),m=Dj(2),w=ad(d,m,2),w!==null&&(Uj(m,w,d,c),bt(w,2),$l(w));break}}d=d.return}}function vx(c,d,m){var w=c.pingCache;if(w===null){w=c.pingCache=new Kde;var E=new Set;w.set(d,E)}else E=w.get(d),E===void 0&&(E=new Set,w.set(d,E));E.has(m)||(hx=!0,E.add(m),c=Qde.bind(null,c,d,m),d.then(c,c))}function Qde(c,d,m){var w=c.pingCache;w!==null&&w.delete(d),c.pingedLanes|=c.suspendedLanes&m,c.warmLanes&=~m,Xn===c&&(cn&m)===m&&(Hr===4||Hr===3&&(cn&62914560)===cn&&300>$t()-Ab?(On&2)===0&&Pp(c,0):fx|=m,Np===cn&&(Np=0)),$l(c)}function DM(c,d){d===0&&(d=Re()),c=Q2(c,d),c!==null&&(bt(c,d),$l(c))}function e2e(c){var d=c.memoizedState,m=0;d!==null&&(m=d.retryLane),DM(c,m)}function t2e(c,d){var m=0;switch(c.tag){case 31:case 13:var w=c.stateNode,E=c.memoizedState;E!==null&&(m=E.retryLane);break;case 19:w=c.stateNode;break;case 22:w=c.stateNode._retryCache;break;default:throw Error(r(314))}w!==null&&w.delete(d),DM(c,m)}function n2e(c,d){return et(c,d)}var Ob=null,jp=null,_x=!1,Pb=!1,xx=!1,md=0;function $l(c){c!==jp&&c.next===null&&(jp===null?Ob=jp=c:jp=jp.next=c),Pb=!0,_x||(_x=!0,i2e())}function iy(c,d){if(!xx&&Pb){xx=!0;do for(var m=!1,w=Ob;w!==null;){if(c!==0){var E=w.pendingLanes;if(E===0)var k=0;else{var B=w.suspendedLanes,J=w.pingedLanes;k=(1<<31-bn(42|c)+1)-1,k&=E&~(B&~J),k=k&201326741?k&201326741|1:k?k|2:0}k!==0&&(m=!0,zM(w,k))}else k=cn,k=ce(w,w===Xn?k:0,w.cancelPendingCommit!==null||w.timeoutHandle!==-1),(k&3)===0||ye(w,k)||(m=!0,zM(w,k));w=w.next}while(m);xx=!1}}function r2e(){UM()}function UM(){Pb=_x=!1;var c=0;md!==0&&p2e()&&(c=md);for(var d=$t(),m=null,w=Ob;w!==null;){var E=w.next,k=BM(w,d);k===0?(w.next=null,m===null?Ob=E:m.next=E,E===null&&(jp=m)):(m=w,(c!==0||(k&3)!==0)&&(Pb=!0)),w=E}Ei!==0&&Ei!==5||iy(c),md!==0&&(md=0)}function BM(c,d){for(var m=c.suspendedLanes,w=c.pingedLanes,E=c.expirationTimes,k=c.pendingLanes&-62914561;0<k;){var B=31-bn(k),J=1<<B,ne=E[B];ne===-1?((J&m)===0||(J&w)!==0)&&(E[B]=Pe(J,d)):ne<=d&&(c.expiredLanes|=J),k&=~J}if(d=Xn,m=cn,m=ce(c,c===d?m:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),w=c.callbackNode,m===0||c===d&&(Bn===2||Bn===9)||c.cancelPendingCommit!==null)return w!==null&&w!==null&&rn(w),c.callbackNode=null,c.callbackPriority=0;if((m&3)===0||ye(c,m)){if(d=m&-m,d===c.callbackPriority)return d;switch(w!==null&&rn(w),Nn(m)){case 2:case 8:m=Mr;break;case 32:m=In;break;case 268435456:m=ln;break;default:m=In}return w=FM.bind(null,c),m=et(m,w),c.callbackPriority=d,c.callbackNode=m,d}return w!==null&&w!==null&&rn(w),c.callbackPriority=2,c.callbackNode=null,2}function FM(c,d){if(Ei!==0&&Ei!==5)return c.callbackNode=null,c.callbackPriority=0,null;var m=c.callbackNode;if(Nb()&&c.callbackNode!==m)return null;var w=cn;return w=ce(c,c===Xn?w:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),w===0?null:(xM(c,w,d),BM(c,$t()),c.callbackNode!=null&&c.callbackNode===m?FM.bind(null,c):null)}function zM(c,d){if(Nb())return null;xM(c,d,!0)}function i2e(){y2e(function(){(On&6)!==0?et(ar,r2e):UM()})}function Cx(){if(md===0){var c=_p;c===0&&(c=K,K<<=1,(K&261888)===0&&(K=256)),md=c}return md}function VM(c){return c==null||typeof c=="symbol"||typeof c=="boolean"?null:typeof c=="function"?c:lp(""+c)}function HM(c,d){var m=d.ownerDocument.createElement("input");return m.name=d.name,m.value=d.value,c.id&&m.setAttribute("form",c.id),d.parentNode.insertBefore(m,d),c=new FormData(c),m.parentNode.removeChild(m),c}function s2e(c,d,m,w,E){if(d==="submit"&&m&&m.stateNode===E){var k=VM((E[Dn]||null).action),B=w.submitter;B&&(d=(d=B[Dn]||null)?VM(d.formAction):B.getAttribute("formAction"),d!==null&&(k=d,B=null));var J=new cp("action","action",null,w,E);c.push({event:J,listeners:[{instance:null,listener:function(){if(w.defaultPrevented){if(md!==0){var ne=B?HM(E,B):new FormData(E);V_(m,{pending:!0,data:ne,method:E.method,action:k},null,ne)}}else typeof k=="function"&&(J.preventDefault(),ne=B?HM(E,B):new FormData(E),V_(m,{pending:!0,data:ne,method:E.method,action:k},k,ne))},currentTarget:E}]})}}for(var Ex=0;Ex<a_.length;Ex++){var Sx=a_[Ex],a2e=Sx.toLowerCase(),o2e=Sx[0].toUpperCase()+Sx.slice(1);Zo(a2e,"on"+o2e)}Zo(_R,"onAnimationEnd"),Zo(xR,"onAnimationIteration"),Zo(CR,"onAnimationStart"),Zo("dblclick","onDoubleClick"),Zo("focusin","onFocus"),Zo("focusout","onBlur"),Zo(Cde,"onTransitionRun"),Zo(Ede,"onTransitionStart"),Zo(Sde,"onTransitionCancel"),Zo(ER,"onTransitionEnd"),Pi("onMouseEnter",["mouseout","mouseover"]),Pi("onMouseLeave",["mouseout","mouseover"]),Pi("onPointerEnter",["pointerout","pointerover"]),Pi("onPointerLeave",["pointerout","pointerover"]),si("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),si("onSelect","focusout contextmenu dragend focu
49sin keydown keyup mousedown mouseup selectionchange".split(" ")),si("onBeforeInput",["compositionend","keypress","textInput","paste"]),si("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),si("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),si("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var sy="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),l2e=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(sy));function WM(c,d){d=(d&4)!==0;for(var m=0;m<c.length;m++){var w=c[m],E=w.event;w=w.listeners;e:{var k=void 0;if(d)for(var B=w.length-1;0<=B;B--){var J=w[B],ne=J.instance,ge=J.currentTarget;if(J=J.listener,ne!==k&&E.isPropagationStopped())break e;k=J,E.currentTarget=ge;try{k(E)}catch(ke){G5(ke)}E.currentTarget=null,k=ne}else for(B=0;B<w.length;B++){if(J=w[B],ne=J.instance,ge=J.currentTarget,J=J.listener,ne!==k&&E.isPropagationStopped())break e;k=J,E.currentTarget=ge;try{k(E)}catch(ke){G5(ke)}E.currentTarget=null,k=ne}}}}function on(c,d){var m=d[zr];m===void 0&&(m=d[zr]=new Set);var w=c+"__bubble";m.has(w)||(qM(d,c,2,!1),m.add(w))}function Ax(c,d,m){var w=0;d&&(w|=4),qM(m,c,w,d)}var Rb="_reactListening"+Math.random().toString(36).slice(2);function kx(c){if(!c[Rb]){c[Rb]=!0,xc.forEach(function(m){m!=="selectionchange"&&(l2e.has(m)||Ax(m,!1,c),Ax(m,!0,c))});var d=c.nodeType===9?c:c.ownerDocument;d===null||d[Rb]||(d[Rb]=!0,Ax("selectionchange",!1,d))}}function qM(c,d,m,w){switch(_D(d)){case 2:var E=j2e;break;case 8:E=M2e;break;default:E=zx}m=E.bind(null,d,m,c),E=void 0,!Lm||d!=="touchstart"&&d!=="touchmove"&&d!=="wheel"||(E=!0),w?E!==void 0?c.addEventListener(d,m,{capture:!0,passive:E}):c.addEventListener(d,m,!0):E!==void 0?c.addEventListener(d,m,{passive:E}):c.addEventListener(d,m,!1)}function Tx(c,d,m,w,E){var k=w;if((d&1)===0&&(d&2)===0&&w!==null)e:for(;;){if(w===null)return;var B=w.tag;if(B===3||B===4){var J=w.stateNode.containerInfo;if(J===E)break;if(B===4)for(B=w.return;B!==null;){var ne=B.tag;if((ne===3||ne===4)&&B.stateNode.containerInfo===E)return;B=B.return}for(;J!==null;){if(B=Ct(J),B===null)return;if(ne=B.tag,ne===5||ne===6||ne===26||ne===27){w=k=B;continue e}J=J.parentNode}}w=w.return}W5(function(){var ge=k,ke=km(m),Ne=[];e:{var be=SR.get(c);if(be!==void 0){var _e=cp,at=c;switch(c){case"keypress":if(Zt(m)===0)break e;case"keydown":case"keyup":_e=tde;break;case"focusin":at="focus",_e=J9;break;case"focusout":at="blur",_e=J9;break;case"beforeblur":case"afterblur":_e=J9;break;case"click":if(m.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":_e=eR;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":_e=Vue;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":_e=ide;break;case _R:case xR:case CR:_e=que;break;case ER:_e=ade;break;case"scroll":case"scrollend":_e=q5;break;case"wheel":_e=lde;break;case"copy":case"cut":case"paste":_e=Kue;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":_e=nR;break;case"toggle":case"beforetoggle":_e=ude}var At=(d&4)!==0,Kn=!At&&(c==="scroll"||c==="scrollend"),de=At?be!==null?be+"Capture":null:be;At=[];for(var oe=ge,me;oe!==null;){var $e=oe;if(me=$e.stateNode,$e=$e.tag,$e!==5&&$e!==26&&$e!==27||me===null||de===null||($e=Y2(oe,de),$e!=null&&At.push(ay(oe,$e,me))),Kn)break;oe=oe.return}0<At.length&&(be=new _e(be,at,null,m,ke),Ne.push({event:be,listeners:At}))}}if((d&7)===0){e:{if(be=c==="mouseover"||c==="pointerover",_e=c==="mouseout"||c==="pointerout",be&&m!==Am&&(at=m.relatedTarget||m.fromElement)&&(Ct(at)||at[cr]))break e;if((_e||be)&&(be=ke.window===ke?ke:(be=ke.ownerDocument)?be.defaultView||be.parentWindow:window,_e?(at=m.relatedTarget||m.toElement,_e=ge,at=at?Ct(at):null,at!==null&&(Kn=s(at),At=at.tag,at!==Kn||At!==5&&At!==27&&At!==6)&&(at=null)):(_e=null,at=ge),_e!==at)){if(At=eR,$e="onMouseLeave",de="onMouseEnter",oe="mouse",(c==="pointerout"||c==="pointerover")&&(At=nR,$e="onPointerLeave",de="onPointerEnter",oe="pointer"),Kn=_e==null?be:Wn(_e),me=at==null?be:Wn(at),be=new At($e,oe+"leave",_e,m,ke),be.target=Kn,be.relatedTarget=me,$e=null,Ct(ke)===ge&&(At
vendor: 5,679 bytes, lines 49-50
49=new At(de,oe+"enter",at,m,ke),At.target=me,At.relatedTarget=Kn,$e=At),Kn=$e,_e&&at)t:{for(At=c2e,de=_e,oe=at,me=0,$e=de;$e;$e=At($e))me++;$e=0;for(var xt=oe;xt;xt=At(xt))$e++;for(;0<me-$e;)de=At(de),me--;for(;0<$e-me;)oe=At(oe),$e--;for(;me--;){if(de===oe||oe!==null&&de===oe.alternate){At=de;break t}de=At(de),oe=At(oe)}At=null}else At=null;_e!==null&&ZM(Ne,be,_e,At,!1),at!==null&&Kn!==null&&ZM(Ne,Kn,at,At,!0)}}e:{if(be=ge?Wn(ge):window,_e=be.nodeName&&be.nodeName.toLowerCase(),_e==="select"||_e==="input"&&be.type==="file")var Sn=uR;else if(lR(be))if(dR)Sn=vde;else{Sn=bde;var dt=gde}else _e=be.nodeName,!_e||_e.toLowerCase()!=="input"||be.type!=="checkbox"&&be.type!=="radio"?ge&&Sm(ge.elementType)&&(Sn=uR):Sn=wde;if(Sn&&(Sn=Sn(c,ge))){cR(Ne,Sn,m,ke);break e}dt&&dt(c,be,ge),c==="focusout"&&ge&&be.type==="number"&&ge.memoizedProps.value!=null&&Em(be,"number",be.value)}switch(dt=ge?Wn(ge):window,c){case"focusin":(lR(dt)||dt.contentEditable==="true")&&(fp=dt,r_=ge,Rm=null);break;case"focusout":Rm=r_=fp=null;break;case"mousedown":i_=!0;break;case"contextmenu":case"mouseup":case"dragend":i_=!1,wR(Ne,m,ke);break;case"selectionchange":if(xde)break;case"keydown":case"keyup":wR(Ne,m,ke)}var Yt;if(Q9)e:{switch(c){case"compositionstart":var un="onCompositionStart";break e;case"compositionend":un="onCompositionEnd";break e;case"compositionupdate":un="onCompositionUpdate";break e}un=void 0}else hp?aR(c,m)&&(un="onCompositionEnd"):c==="keydown"&&m.keyCode===229&&(un="onCompositionStart");un&&(rR&&m.locale!=="ko"&&(hp||un!=="onCompositionStart"?un==="onCompositionEnd"&&hp&&(Yt=De()):(ee=ke,re="value"in ee?ee.value:ee.textContent,hp=!0)),dt=jb(ge,un),0<dt.length&&(un=new tR(un,c,null,m,ke),Ne.push({event:un,listeners:dt}),Yt?un.data=Yt:(Yt=oR(m),Yt!==null&&(un.data=Yt)))),(Yt=hde?fde(c,m):pde(c,m))&&(un=jb(ge,"onBeforeInput"),0<un.length&&(dt=new tR("onBeforeInput","beforeinput",null,m,ke),Ne.push({event:dt,listeners:un}),dt.data=Yt)),s2e(Ne,c,ge,m,ke)}WM(Ne,d)})}function ay(c,d,m){return{instance:c,listener:d,currentTarget:m}}function jb(c,d){for(var m=d+"Capture",w=[];c!==null;){var E=c,k=E.stateNode;if(E=E.tag,E!==5&&E!==26&&E!==27||k===null||(E=Y2(c,m),E!=null&&w.unshift(ay(c,E,k)),E=Y2(c,d),E!=null&&w.push(ay(c,E,k))),c.tag===3)return w;c=c.return}return[]}function c2e(c){if(c===null)return null;do c=c.return;while(c&&c.tag!==5&&c.tag!==27);return c||null}function ZM(c,d,m,w,E){for(var k=d._reactName,B=[];m!==null&&m!==w;){var J=m,ne=J.alternate,ge=J.stateNode;if(J=J.tag,ne!==null&&ne===w)break;J!==5&&J!==26&&J!==27||ge===null||(ne=ge,E?(ge=Y2(m,k),ge!=null&&B.unshift(ay(m,ge,ne))):E||(ge=Y2(m,k),ge!=null&&B.push(ay(m,ge,ne)))),m=m.return}B.length!==0&&c.push({event:d,listeners:B})}var u2e=/\r\n?/g,d2e=/\u0000|\uFFFD/g;function KM(c){return(typeof c=="string"?c:""+c).replace(u2e,` 50`).replace(d2e,"")}function GM(c,d){return d=KM(d),KM(c)===d}function Zn(c,d,m,w,E,k){switch(m){case"children":typeof w=="string"?d==="body"||d==="textarea"&&w===""||Yu(c,w):(typeof w=="number"||typeof w=="bigint")&&d!=="body"&&Yu(c,""+w);break;case"className":ap(c,"class",w);break;case"tabIndex":ap(c,"tabindex",w);break;case"dir":case"role":case"viewBox":case"width":case"height":ap(c,m,w);break;case"style":V5(c,w,k);break;case"data":if(d!=="object"){ap(c,"data",w);break}case"src":case"href":if(w===""&&(d!=="a"||m!=="href")){c.removeAttribute(m);break}if(w==null||typeof w=="function"||typeof w=="symbol"||typeof w=="boolean"){c.removeAttribute(m);break}w=lp(""+w),c.setAttribute(m,w);break;case"action":case"formAction":if(typeof w=="function"){c.setAttribute(m,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof k=="function"&&(m==="formAction"?(d!=="input"&&Zn(c,d,"name",E.name,E,null),Zn(c,d,"formEncType",E.formEncType,E,null),Zn(c,d,"formMethod",E.formMethod,E,null),Zn(c,d,"formTarget",E.formTarget,E,null)):(Zn(c,d,"encType",E.encType,E,null),Zn(c,d,"method",E.method,E,null),Zn(c,d,"target",E.target,E,null)));if(w==null||typeof w=="symbol"||typeof w=="boolean"){c.removeAttribute(m);break}w=lp(""+w),c.setAttribute(m,w);break;case"onClick":w!=null&&(c.onclick=qo);break;case"onScroll":w!=null&&on("scroll",c);break;case"onScrollEnd":w!=null&&on("scrollend",c);break;case"dangerouslySetInnerHTML":if(w!=null){if(typeof w!="object"||!("__html"in w))throw Error(r(61));if(m=w.__html,m!=null){if(E.children!=null)throw Error(r(60));c.innerHTML=m}}break;case"multiple":c.multiple=w&&typeof w!="function"&&typeof w!="symbol";break;case"muted":c.muted=w&&typeof w!="function"&&typeof w!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(w==null||typeof w=="function"||typeof w=="boolean"||typeof w=="symbol"){c.removeAttribute("xlink:href");break}m=lp(""+w),c.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",m);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":w!=null&&typeof w!="function"&&typeof w!="symbol"?c.setAttribute(m,""+w):c.removeAttribute(m);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInl
50ine":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":w&&typeof w!="function"&&typeof w!="symbol"?c.setAttribute(m,""):c.removeAttribute(m);break;case"capture":case"download":w===!0?c.setAttribute(m,""):w!==!1&&w!=null&&typeof w!="function"&&typeof w!="symbol"?c.setAttribute(m,w):c.removeAttribute(m);break;case"cols":case"rows":case"size":case"span":w!=null&&typeof w!="function"&&typeof w!="symbol"&&!isNaN(w)&&1<=w?c.setAttribute(m,w):c.removeAttribute(m);break;case"rowSpan":case"start":w==null||typeof w=="function"||typeof w=="symbol"||isNaN(w)?c.removeAttribute(m):c.setAttribute(m,w);break;case"popover":on("beforetoggle",c),on("toggle",c),sp(c,"popover",w);break;case"xlinkActuate":Wo(c,"http://www.w3.org/1999/xlink","xlink:actuate",w);break;case"xlinkArcrole":Wo(c,"http://www.w3.org/1999/xlink","xlink:arcrole",w);break;case"xlinkRole":Wo(c,"http://www.w3.org/1999/xlink","xlink:role",w);break;case"xlinkShow":Wo(c,"http://www.w3.org/1999/xlink","xlink:show",w);break;case"xlinkTitle":Wo(c,"http://www.w3.org/1999/xlink","xlink:title",w);break;case"xlinkType":Wo(c,"http://www.w3.org/1999/xlink","xlink:type",w);break;case"xmlBase":Wo(c,"http://www.w3.org/XML/1998/namespace","xml:base",w);break;case"xmlLang":Wo(c,"http://www.w3.org/XML/1998/namespace","xml:lang",w);break;case"xmlSpace":Wo(c,"http://www.w3.org/XML/1998/namespace","xml:space",w);break;case"is":sp(c,"is",w);break;case"innerText":case"textContent":break;default:(!(2<m.length)||m[0]!=="o"&&m[0]!=="O"||m[1]!=="n"&&m[1]!=="N")&&(m=G9.get(m)||m,sp(c,m,w))}}function Lx(c,d,m,w,E,k){switch(m){case"style":V5(c,w,k);break;case"dangerouslySetInnerHTML":if(w!=null){if(typeof w!="object"||!("__html"in w))throw Error(r(61));if(m=w.__html,m!=null){if(E.children!=null)throw Error(r(60));c.innerHTML=m}}break;case"children":typeof w=="string"?Yu(c,w):(typeof w=="number"||typeof w=="bigint")&&Yu(c,""+w);break;case"onScroll":w!=null&&on("scroll",c);break;case"onScrollEnd":w!=null&&on("scrollend",c);break;case"onClick":w!=null&&(c.onclick=qo);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!pn.hasOwnProperty(m))e:{if(m[0]==="o"&&m[1]==="n"&&(E=m.endsWith("Capture"),d=m.slice(2,E?m.length-7:void 0),k=c[Dn]||null,k=k!=null?k[m]:null,typeof k=="function"&&c.removeEventListener(d,k,E),typeof w=="function")){typeof k!="function"&&k!==null&&(m in c?c[m]=null:c.hasAttribute(m)&&c.removeAttribute(m)),c.addEventListener(d,w,E);break e}m in c?c[m]=w:w===!0?c.setAttribute(m,""):sp(c,m,w)}}}function Qi(c,d,m){switch(d){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":on("error",c),on("load",c);var w=!1,E=!1,k;for(k in m)if(m.hasOwnProperty(k)){var B=m[k];if(B!=null)switch(k){case"src":w=!0;break;case"srcSet":E=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,d));default:Zn(c,d,k,B,m,null)}}E&&Zn(c,d,"srcSet",m.srcSet,m,null),w&&Zn(c,d,"src",m.src,m,null);return;case"input":on("invalid",c);var J=k=B=E=null,ne=null,ge=null;for(w in m)if(m.hasOwnProperty(w)){var ke=m[w];if(ke!=null)switch(w){case"name":E=ke;break;case"type":B=ke;break;case"checked":ne=ke;break;case"defaultChecked":ge=ke;break;case"value":k=ke;break;case"defaultValue":J=ke;break;case"children":case"dangerouslySetInnerHTML":if(ke!=null)throw Error(r(137,d));break;default:Zn(c,d,w,ke,m,null)}}U5(c,k,J,ne,ge,B,E,!1);return;case"select":on("invalid",c),w=B=k=null;for(E in m)if(m.hasOwnProperty(E)&&(J=m[E],J!=null))switch(E){case"value":k=J;break;case"defaultValue":B=J;break;case"multiple":w=J;default:Zn(c,d,E,J,m,null)}d=k,m=B,c.multiple=!!w,d!=null?Gu(c,!!w,d,!1):m!=null&&Gu(c,!!w,m,!0);return;case"textarea":on("invalid",c),k=E=w=null;for(B in m)if(m.hasOwnProperty(B)&&(J=m[B],J!=null))switch(B){case"value":w=J;break;case"defaultValue":E=J;break;case"children":k=J;break;case"dangerouslySetInnerHTML":if(J!=null)throw Error(r(91));break;default:Zn(c,d,B,J,m,null)}F5(c,w,E,k);return;case"option":for(ne in m)if(m.hasOwnProperty(ne)&&(w=m[ne],w!=null))switch(ne){case"selected":c.selected=w&&typeof w!="function"&&typeof w!="symbol";break;default:Zn(c,d,ne,w,m,null)}return;case"dialog":on("beforetoggle",c),on("toggle",c),on("cancel",c),on("close",c);break;case"iframe":case"object":on("load",c);break;case"video":case"audio":for(w=0;w<sy.length;w++)on(sy[w],c);break;case"image":on("error",c),on("load",c);break;case"details":on("toggle",c);break;case"embed":case"source":case"link":on("error",c),on("load",c);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ge in m)if(m.hasOwnProperty(ge)&&(w=m[ge],w!=null))switch(ge){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,d));default:Zn(c,d,ge,w,m,null)}return;default:if(Sm(d)){for(ke in m)m.hasOwnProperty(ke)&&(w=m[ke],w!==void 0&&Lx(c,d,ke,w,m,void 0));return}}for(J in m)m.hasOwnProperty(J)&&(w=m[J],w!=null&&Zn(c,d,J,w,m,null))}function h2e(c,d,m,w){switch(d){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var E=null,k=null,B=null,J=null,ne=null,ge=null,ke=null;for(_e in m){var Ne=m[_e];if(m.hasOwnProperty(_e)&&Ne!=null)switch(_e){case"checked":break;case"value":break;case"defaultValue":ne=Ne;default:w.hasOwnProperty(_e)||Zn(c,d,_e,null,w,Ne)}}
vendor: 7,694 bytes, line 50
50for(var be in w){var _e=w[be];if(Ne=m[be],w.hasOwnProperty(be)&&(_e!=null||Ne!=null))switch(be){case"type":k=_e;break;case"name":E=_e;break;case"checked":ge=_e;break;case"defaultChecked":ke=_e;break;case"value":B=_e;break;case"defaultValue":J=_e;break;case"children":case"dangerouslySetInnerHTML":if(_e!=null)throw Error(r(137,d));break;default:_e!==Ne&&Zn(c,d,be,_e,w,Ne)}}Cm(c,B,J,ne,ge,ke,k,E);return;case"select":_e=B=J=be=null;for(k in m)if(ne=m[k],m.hasOwnProperty(k)&&ne!=null)switch(k){case"value":break;case"multiple":_e=ne;default:w.hasOwnProperty(k)||Zn(c,d,k,null,w,ne)}for(E in w)if(k=w[E],ne=m[E],w.hasOwnProperty(E)&&(k!=null||ne!=null))switch(E){case"value":be=k;break;case"defaultValue":J=k;break;case"multiple":B=k;default:k!==ne&&Zn(c,d,E,k,w,ne)}d=J,m=B,w=_e,be!=null?Gu(c,!!m,be,!1):!!w!=!!m&&(d!=null?Gu(c,!!m,d,!0):Gu(c,!!m,m?[]:"",!1));return;case"textarea":_e=be=null;for(J in m)if(E=m[J],m.hasOwnProperty(J)&&E!=null&&!w.hasOwnProperty(J))switch(J){case"value":break;case"children":break;default:Zn(c,d,J,null,w,E)}for(B in w)if(E=w[B],k=m[B],w.hasOwnProperty(B)&&(E!=null||k!=null))switch(B){case"value":be=E;break;case"defaultValue":_e=E;break;case"children":break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(r(91));break;default:E!==k&&Zn(c,d,B,E,w,k)}B5(c,be,_e);return;case"option":for(var at in m)if(be=m[at],m.hasOwnProperty(at)&&be!=null&&!w.hasOwnProperty(at))switch(at){case"selected":c.selected=!1;break;default:Zn(c,d,at,null,w,be)}for(ne in w)if(be=w[ne],_e=m[ne],w.hasOwnProperty(ne)&&be!==_e&&(be!=null||_e!=null))switch(ne){case"selected":c.selected=be&&typeof be!="function"&&typeof be!="symbol";break;default:Zn(c,d,ne,be,w,_e)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var At in m)be=m[At],m.hasOwnProperty(At)&&be!=null&&!w.hasOwnProperty(At)&&Zn(c,d,At,null,w,be);for(ge in w)if(be=w[ge],_e=m[ge],w.hasOwnProperty(ge)&&be!==_e&&(be!=null||_e!=null))switch(ge){case"children":case"dangerouslySetInnerHTML":if(be!=null)throw Error(r(137,d));break;default:Zn(c,d,ge,be,w,_e)}return;default:if(Sm(d)){for(var Kn in m)be=m[Kn],m.hasOwnProperty(Kn)&&be!==void 0&&!w.hasOwnProperty(Kn)&&Lx(c,d,Kn,void 0,w,be);for(ke in w)be=w[ke],_e=m[ke],!w.hasOwnProperty(ke)||be===_e||be===void 0&&_e===void 0||Lx(c,d,ke,be,w,_e);return}}for(var de in m)be=m[de],m.hasOwnProperty(de)&&be!=null&&!w.hasOwnProperty(de)&&Zn(c,d,de,null,w,be);for(Ne in w)be=w[Ne],_e=m[Ne],!w.hasOwnProperty(Ne)||be===_e||be==null&&_e==null||Zn(c,d,Ne,be,w,_e)}function YM(c){switch(c){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function f2e(){if(typeof performance.getEntriesByType=="function"){for(var c=0,d=0,m=performance.getEntriesByType("resource"),w=0;w<m.length;w++){var E=m[w],k=E.transferSize,B=E.initiatorType,J=E.duration;if(k&&J&&YM(B)){for(B=0,J=E.responseEnd,w+=1;w<m.length;w++){var ne=m[w],ge=ne.startTime;if(ge>J)break;var ke=ne.transferSize,Ne=ne.initiatorType;ke&&YM(Ne)&&(ne=ne.responseEnd,B+=ke*(ne<J?1:(J-ge)/(ne-ge)))}if(--w,d+=8*(k+B)/(E.duration/1e3),c++,10<c)break}}if(0<c)return d/c/1e6}return navigator.connection&&(c=navigator.connection.downlink,typeof c=="number")?c:5}var $x=null,Ix=null;function Mb(c){return c.nodeType===9?c:c.ownerDocument}function JM(c){switch(c){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function XM(c,d){if(c===0)switch(d){case"svg":return 1;case"math":return 2;default:return 0}return c===1&&d==="foreignObject"?0:c}function Nx(c,d){return c==="textarea"||c==="noscript"||typeof d.children=="string"||typeof d.children=="number"||typeof d.children=="bigint"||typeof d.dangerouslySetInnerHTML=="object"&&d.dangerouslySetInnerHTML!==null&&d.dangerouslySetInnerHTML.__html!=null}var Ox=null;function p2e(){var c=window.event;return c&&c.type==="popstate"?c===Ox?!1:(Ox=c,!0):(Ox=null,!1)}var QM=typeof setTimeout=="function"?setTimeout:void 0,m2e=typeof clearTimeout=="function"?clearTimeout:void 0,eD=typeof Promise=="function"?Promise:void 0,y2e=typeof queueMicrotask=="function"?queueMicrotask:typeof eD<"u"?function(c){return eD.resolve(null).then(c).catch(g2e)}:QM;function g2e(c){setTimeout(function(){throw c})}function yd(c){return c==="head"}function tD(c,d){var m=d,w=0;do{var E=m.nextSibling;if(c.removeChild(m),E&&E.nodeType===8)if(m=E.data,m==="/$"||m==="/&"){if(w===0){c.removeChild(E),Bp(d);return}w--}else if(m==="$"||m==="$?"||m==="$~"||m==="$!"||m==="&")w++;else if(m==="html")oy(c.ownerDocument.documentElement);else if(m==="head"){m=c.ownerDocument.head,oy(m);for(var k=m.firstChild;k;){var B=k.nextSibling,J=k.nodeName;k[Wt]||J==="SCRIPT"||J==="STYLE"||J==="LINK"&&k.rel.toLowerCase()==="stylesheet"||m.removeChild(k),k=B}}else m==="body"&&oy(c.ownerDocument.body);m=E}while(m);Bp(d)}function nD(c,d){var m=c;c=0;do{var w=m.nextSibling;if(m.nodeType===1?d?(m._stashedDisplay=m.style.display,m.style.display="none"):(m.style.display=m._stashedDisplay||"",m.getAttribute("style")===""&&m.removeAttribute("style")):m.nodeType===3&&(d?(m._stashedText=m.nodeValue,m.nodeValue=""):m.nodeValue=m._stashedText||""),w&&w.nodeType===8)if(m=w.data,m==="/$"){if(c===0)break;c--}else m!=="$"&&m!=="$?"&&m!=="$~"&&m!=="$!"||c++;m=w}while(m)}function Px(c){var d=c.firstChild;for(d&&d.nodeType===10&&(d=d.nextSibling);d;){var m=d;switch(d=d.nextSibling,m.nodeName){case"HTML":case"HEAD":case"BODY":Px(m),Un(m);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(m.rel.toLowerCase()==="stylesheet")continue}c.removeChild(m)}}function b2e(c,d,m,w){for(;c.nodeType===1;){var E=m;if(c.nodeName.toLowerCase()!==d.toLowerCase()){if(!w&&(c.nodeName!=="INPUT"||c.type!=="hidden"))break}else if(w){if(!c[Wt])switch(d){case"meta":if(!c.hasAttribute("itemprop"))break;return c;case"link":if(k=c.getAttribute("rel"),k==="stylesheet"&&c.hasAttribute("data-precedence"))break;if(k!==E.rel||c.getAttribute("href")!==(E.href==null||E.href===""?null:E.href)||c.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin)||c.getAttribute("title")!==(E.title==null?null:E.title))break;return c;case"style":if(c.hasAttribute("data-precedence"))break;return c;case"script":if(k=c.getAttribute("src"),(k!==(E.src==null?null:E.src)||c.getAttribute("type")!==(E.type==null?null:E.type)||c.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin))&&k&&c.hasAttribute("async")&&!c.hasAttribute("itemprop"))break;return c;default:return c}}else if(d==="input"&&c.type==="hidden"){var k=E.name==null?null:""+E.name;if(E.type==="hidden"&&c.getAttribute("name")===k)return c}else return c;if(c=no(c.nextSibling),c===null)break}return null}function w2e(c,d,m){if(d==="")return null;for(;c.nodeType!==3;)if((c.nodeType!==1||c.nodeName!=="INPUT"||c.type!=="hidden")&&!m||(c=no(c.nextSibling),c===null))return null;return c}function rD(c,d){for(;c.nodeType!==8;)if((c.nodeType!==1||c.nodeName!=="INPUT"||c.type!=="hidden")&&!d||(c=no(c.nextSibling),c===null))return null;return c}function Rx(c){return c.data==="$?"||c.data==="$~"}function jx(c){return c.data==="$!"||c.data==="$?"&&c.ownerDocument.readyState!=="loading"}function v2e(c,d){var m=c.ownerDocument;if(c.data==="$~")c._reactRetry=d;else if(c.data!=="$?"||m.readyState!=="loading")d();else{var w=function(){d(),m.removeEventListener("DOMContentLoaded",w)};m.addEventListener("DOMContentLoaded",w),c._reactRetry=w}}function no(c){for(;c!=null;c=c.nextSibling){var d=c.nodeType;if(d===1||d===3)break;if(d===8){if(d=c.data,d==="$"||d==="$!"||d==="$?"||d==="$~"||d==="&"||d==="F!"||d==="F")break;
vendor: 7,180 bytes, line 50
50if(d==="/$"||d==="/&")return null}}return c}var Mx=null;function iD(c){c=c.nextSibling;for(var d=0;c;){if(c.nodeType===8){var m=c.data;if(m==="/$"||m==="/&"){if(d===0)return no(c.nextSibling);d--}else m!=="$"&&m!=="$!"&&m!=="$?"&&m!=="$~"&&m!=="&"||d++}c=c.nextSibling}return null}function sD(c){c=c.previousSibling;for(var d=0;c;){if(c.nodeType===8){var m=c.data;if(m==="$"||m==="$!"||m==="$?"||m==="$~"||m==="&"){if(d===0)return c;d--}else m!=="/$"&&m!=="/&"||d++}c=c.previousSibling}return null}function aD(c,d,m){switch(d=Mb(m),c){case"html":if(c=d.documentElement,!c)throw Error(r(452));return c;case"head":if(c=d.head,!c)throw Error(r(453));return c;case"body":if(c=d.body,!c)throw Error(r(454));return c;default:throw Error(r(451))}}function oy(c){for(var d=c.attributes;d.length;)c.removeAttributeNode(d[0]);Un(c)}var ro=new Map,oD=new Set;function Db(c){return typeof c.getRootNode=="function"?c.getRootNode():c.nodeType===9?c:c.ownerDocument}var Dc=M.d;M.d={f:_2e,r:x2e,D:C2e,C:E2e,L:S2e,m:A2e,X:T2e,S:k2e,M:L2e};function _2e(){var c=Dc.f(),d=Lb();return c||d}function x2e(c){var d=wn(c);d!==null&&d.tag===5&&d.type==="form"?Ej(d):Dc.r(c)}var Mp=typeof document>"u"?null:document;function lD(c,d,m){var w=Mp;if(w&&typeof d=="string"&&d){var E=zs(d);E='link[rel="'+c+'"][href="'+E+'"]',typeof m=="string"&&(E+='[crossorigin="'+m+'"]'),oD.has(E)||(oD.add(E),c={rel:c,crossOrigin:m,href:d},w.querySelector(E)===null&&(d=w.createElement("link"),Qi(d,"link",c),_n(d),w.head.appendChild(d)))}}function C2e(c){Dc.D(c),lD("dns-prefetch",c,null)}function E2e(c,d){Dc.C(c,d),lD("preconnect",c,d)}function S2e(c,d,m){Dc.L(c,d,m);var w=Mp;if(w&&c&&d){var E='link[rel="preload"][as="'+zs(d)+'"]';d==="image"&&m&&m.imageSrcSet?(E+='[imagesrcset="'+zs(m.imageSrcSet)+'"]',typeof m.imageSizes=="string"&&(E+='[imagesizes="'+zs(m.imageSizes)+'"]')):E+='[href="'+zs(c)+'"]';var k=E;switch(d){case"style":k=Dp(c);break;case"script":k=Up(c)}ro.has(k)||(c=p({rel:"preload",href:d==="image"&&m&&m.imageSrcSet?void 0:c,as:d},m),ro.set(k,c),w.querySelector(E)!==null||d==="style"&&w.querySelector(ly(k))||d==="script"&&w.querySelector(cy(k))||(d=w.createElement("link"),Qi(d,"link",c),_n(d),w.head.appendChild(d)))}}function A2e(c,d){Dc.m(c,d);var m=Mp;if(m&&c){var w=d&&typeof d.as=="string"?d.as:"script",E='link[rel="modulepreload"][as="'+zs(w)+'"][href="'+zs(c)+'"]',k=E;switch(w){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":k=Up(c)}if(!ro.has(k)&&(c=p({rel:"modulepreload",href:c},d),ro.set(k,c),m.querySelector(E)===null)){switch(w){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(m.querySelector(cy(k)))return}w=m.createElement("link"),Qi(w,"link",c),_n(w),m.head.appendChild(w)}}}function k2e(c,d,m){Dc.S(c,d,m);var w=Mp;if(w&&c){var E=Dr(w).hoistableStyles,k=Dp(c);d=d||"default";var B=E.get(k);if(!B){var J={loading:0,preload:null};if(B=w.querySelector(ly(k)))J.loading=5;else{c=p({rel:"stylesheet",href:c,"data-precedence":d},m),(m=ro.get(k))&&Dx(c,m);var ne=B=w.createElement("link");_n(ne),Qi(ne,"link",c),ne._p=new Promise(function(ge,ke){ne.onload=ge,ne.onerror=ke}),ne.addEventListener("load",function(){J.loading|=1}),ne.addEventListener("error",function(){J.loading|=2}),J.loading|=4,Ub(B,d,w)}B={type:"stylesheet",instance:B,count:1,state:J},E.set(k,B)}}}function T2e(c,d){Dc.X(c,d);var m=Mp;if(m&&c){var w=Dr(m).hoistableScripts,E=Up(c),k=w.get(E);k||(k=m.querySelector(cy(E)),k||(c=p({src:c,async:!0},d),(d=ro.get(E))&&Ux(c,d),k=m.createElement("script"),_n(k),Qi(k,"link",c),m.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},w.set(E,k))}}function L2e(c,d){Dc.M(c,d);var m=Mp;if(m&&c){var w=Dr(m).hoistableScripts,E=Up(c),k=w.get(E);k||(k=m.querySelector(cy(E)),k||(c=p({src:c,async:!0,type:"module"},d),(d=ro.get(E))&&Ux(c,d),k=m.createElement("script"),_n(k),Qi(k,"link",c),m.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},w.set(E,k))}}function cD(c,d,m,w){var E=(E=te.current)?Db(E):null;if(!E)throw Error(r(446));switch(c){case"meta":case"title":return null;case"style":return typeof m.precedence=="string"&&typeof m.href=="string"?(d=Dp(m.href),m=Dr(E).hoistableStyles,w=m.get(d),w||(w={type:"style",instance:null,count:0,state:null},m.set(d,w)),w):{type:"void",instance:null,count:0,state:null};case"link":if(m.rel==="stylesheet"&&typeof m.href=="string"&&typeof m.precedence=="string"){c=Dp(m.href);var k=Dr(E).hoistableStyles,B=k.get(c);if(B||(E=E.ownerDocument||E,B={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},k.set(c,B),(k=E.querySelector(ly(c)))&&!k._p&&(B.instance=k,B.state.loading=5),ro.has(c)||(m={rel:"preload",as:"style",href:m.href,crossOrigin:m.crossOrigin,integrity:m.integrity,media:m.media,hrefLang:m.hrefLang,referrerPolicy:m.referrerPolicy},ro.set(c,m),k||$2e(E,c,m,B.state))),d&&w===null)throw Error(r(528,""));return B}if(d&&w!==null)throw Error(r(529,""));return null;case"script":return d=m.async,m=m.src,typeof m=="string"&&d&&typeof d!="function"&&typeof d!="symbol"?(d=Up(m),m=Dr(E).hoistableScripts,w=m.get(d),w||(w={type:"script",instance:null,count:0,state:null},m.set(d,w)),w):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,c))}}function Dp(c){return'href="'+zs(c)+'"'}function ly(c){return'link[rel="stylesheet"]['+c+"]"}function uD(c){return p({},c,{"data-precedence":c.precedence,precedence:null})}function $2e(c,d,m,w){c.querySelector('link[rel="preload"][as="style"]['+d+"]")?w.loading=1:(d=c.createElement("link"),w.preload=d,d.addEventListener("load",function(){return w.loading|=1}),d.addEventListener("error",function(){return w.loading|=2}),Qi(d,"link",m),_n(d),c.head.appendChild(d))}function Up(c){return'[src="'+zs(c)+'"]'}function cy(c){return"script[async]"+c}function dD(c,d,m){if(d.count++,d.instance===null)switch(d.type){case"style":var w=c.querySelector('style[data-href~="'+zs(m.href)+'"]');if(w)return d.instance=w,_n(w),w;var E=p({},m,{"data-href":m.href,"data-precedence":m.precedence,href:null,precedence:null});return w=(c.ownerDocument||c).createElement("style"),_n(w),Qi(w,"style",E),Ub(w,m.precedence,c),d.instance=w;case"stylesheet":E=Dp(m.href);var k=c.querySelector(ly(E));if(k)return d.state.loading|=4,d.instance=k,_n(k),k;w=uD(m),(E=ro.get(E))&&Dx(w,E),k=(c.ownerDocument||c).createElement("link"),_n(k);var B=k;return B._p=new Promise(function(J,ne){B.onload=J,B.onerror=ne}),Qi(k,"link",w),d.state.loading|=4,Ub(k,m.precedence,c),d.instance=k;case"script":return k=Up(m.src),(E=c.querySelector(cy(k)))?(d.instance=E,_n(E),E):(w=m,(E=ro.get(k))&&(w=p({},m),Ux(w,E)),c=c.ownerDocument||c,E=c.createElement("script"),_n(E),Qi(E,"link",w),c.head.appendChild(E),d.instance=E);case"void":return null;default:throw Error(r(443,d.type))}else d.type==="stylesheet"&&(d.state.loading&4)===0&&(w=d.instance,d.state.loading|=4,Ub(w,m.precedence,c));return d.instance}function Ub(c,d,m){for(var w=m.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),E=w.length?w[w.length-1]:null,k=E,B=0;B<w.length;B++){var J=w[B];if(J.dataset.precedence===d)k=J;else if(k!==E)break}
vendor: 6,234 bytes, line 50
50k?k.parentNode.insertBefore(c,k.nextSibling):(d=m.nodeType===9?m.head:m,d.insertBefore(c,d.firstChild))}function Dx(c,d){c.crossOrigin==null&&(c.crossOrigin=d.crossOrigin),c.referrerPolicy==null&&(c.referrerPolicy=d.referrerPolicy),c.title==null&&(c.title=d.title)}function Ux(c,d){c.crossOrigin==null&&(c.crossOrigin=d.crossOrigin),c.referrerPolicy==null&&(c.referrerPolicy=d.referrerPolicy),c.integrity==null&&(c.integrity=d.integrity)}var Bb=null;function hD(c,d,m){if(Bb===null){var w=new Map,E=Bb=new Map;E.set(m,w)}else E=Bb,w=E.get(m),w||(w=new Map,E.set(m,w));if(w.has(c))return w;for(w.set(c,null),m=m.getElementsByTagName(c),E=0;E<m.length;E++){var k=m[E];if(!(k[Wt]||k[en]||c==="link"&&k.getAttribute("rel")==="stylesheet")&&k.namespaceURI!=="http://www.w3.org/2000/svg"){var B=k.getAttribute(d)||"";B=c+B;var J=w.get(B);J?J.push(k):w.set(B,[k])}}return w}function fD(c,d,m){c=c.ownerDocument||c,c.head.insertBefore(m,d==="title"?c.querySelector("head > title"):null)}function I2e(c,d,m){if(m===1||d.itemProp!=null)return!1;switch(c){case"meta":case"title":return!0;case"style":if(typeof d.precedence!="string"||typeof d.href!="string"||d.href==="")break;return!0;case"link":if(typeof d.rel!="string"||typeof d.href!="string"||d.href===""||d.onLoad||d.onError)break;switch(d.rel){case"stylesheet":return c=d.disabled,typeof d.precedence=="string"&&c==null;default:return!0}case"script":if(d.async&&typeof d.async!="function"&&typeof d.async!="symbol"&&!d.onLoad&&!d.onError&&d.src&&typeof d.src=="string")return!0}return!1}function pD(c){return!(c.type==="stylesheet"&&(c.state.loading&3)===0)}function N2e(c,d,m,w){if(m.type==="stylesheet"&&(typeof w.media!="string"||matchMedia(w.media).matches!==!1)&&(m.state.loading&4)===0){if(m.instance===null){var E=Dp(w.href),k=d.querySelector(ly(E));if(k){d=k._p,d!==null&&typeof d=="object"&&typeof d.then=="function"&&(c.count++,c=Fb.bind(c),d.then(c,c)),m.state.loading|=4,m.instance=k,_n(k);return}k=d.ownerDocument||d,w=uD(w),(E=ro.get(E))&&Dx(w,E),k=k.createElement("link"),_n(k);var B=k;B._p=new Promise(function(J,ne){B.onload=J,B.onerror=ne}),Qi(k,"link",w),m.instance=k}c.stylesheets===null&&(c.stylesheets=new Map),c.stylesheets.set(m,d),(d=m.state.preload)&&(m.state.loading&3)===0&&(c.count++,m=Fb.bind(c),d.addEventListener("load",m),d.addEventListener("error",m))}}var Bx=0;function O2e(c,d){return c.stylesheets&&c.count===0&&Vb(c,c.stylesheets),0<c.count||0<c.imgCount?function(m){var w=setTimeout(function(){if(c.stylesheets&&Vb(c,c.stylesheets),c.unsuspend){var k=c.unsuspend;c.unsuspend=null,k()}},6e4+d);0<c.imgBytes&&Bx===0&&(Bx=62500*f2e());var E=setTimeout(function(){if(c.waitingForImages=!1,c.count===0&&(c.stylesheets&&Vb(c,c.stylesheets),c.unsuspend)){var k=c.unsuspend;c.unsuspend=null,k()}},(c.imgBytes>Bx?50:800)+d);return c.unsuspend=m,function(){c.unsuspend=null,clearTimeout(w),clearTimeout(E)}}:null}function Fb(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Vb(this,this.stylesheets);else if(this.unsuspend){var c=this.unsuspend;this.unsuspend=null,c()}}}var zb=null;function Vb(c,d){c.stylesheets=null,c.unsuspend!==null&&(c.count++,zb=new Map,d.forEach(P2e,c),zb=null,Fb.call(c))}function P2e(c,d){if(!(d.state.loading&4)){var m=zb.get(c);if(m)var w=m.get(null);else{m=new Map,zb.set(c,m);for(var E=c.querySelectorAll("link[data-precedence],style[data-precedence]"),k=0;k<E.length;k++){var B=E[k];(B.nodeName==="LINK"||B.getAttribute("media")!=="not all")&&(m.set(B.dataset.precedence,B),w=B)}w&&m.set(null,w)}E=d.instance,B=E.getAttribute("data-precedence"),k=m.get(B)||w,k===w&&m.set(null,E),m.set(B,E),this.count++,w=Fb.bind(this),E.addEventListener("load",w),E.addEventListener("error",w),k?k.parentNode.insertBefore(E,k.nextSibling):(c=c.nodeType===9?c.head:c,c.insertBefore(E,c.firstChild)),d.state.loading|=4}}var uy={$$typeof:x,Provider:null,Consumer:null,_currentValue:Z,_currentValue2:Z,_threadCount:0};function R2e(c,d,m,w,E,k,B,J,ne){this.tag=1,this.containerInfo=c,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=it(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=it(0),this.hiddenUpdates=it(null),this.identifierPrefix=w,this.onUncaughtError=E,this.onCaughtError=k,this.onRecoverableError=B,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ne,this.incompleteTransitions=new Map}function mD(c,d,m,w,E,k,B,J,ne,ge,ke,Ne){return c=new R2e(c,d,m,B,ne,ge,ke,Ne,J),d=1,k===!0&&(d|=24),k=wa(3,null,null,d),c.current=k,k.stateNode=c,d=w_(),d.refCount++,c.pooledCache=d,d.refCount++,k.memoizedState={element:w,isDehydrated:m,cache:d},C_(k),c}function yD(c){return c?(c=yp,c):yp}function gD(c,d,m,w,E,k){E=yD(E),w.context===null?w.context=E:w.pendingContext=E,w=sd(d),w.payload={element:m},k=k===void 0?null:k,k!==null&&(w.callback=k),m=ad(c,w,d),m!==null&&(Zs(m,c,d),zm(m,c,d))}function bD(c,d){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var m=c.retryLane;c.retryLane=m!==0&&m<d?m:d}}function Fx(c,d){bD(c,d),(c=c.alternate)&&bD(c,d)}function wD(c){if(c.tag===13||c.tag===31){var d=Q2(c,67108864);d!==null&&Zs(d,c,67108864),Fx(c,67108864)}}function vD(c){if(c.tag===13||c.tag===31){var d=Ea();d=ot(d);var m=Q2(c,d);m!==null&&Zs(m,c,d),Fx(c,d)}}var Hb=!0;function j2e(c,d,m,w){var E=L.T;L.T=null;var k=M.p;try{M.p=2,zx(c,d,m,w)}finally{M.p=k,L.T=E}}function M2e(c,d,m,w){var E=L.T;L.T=null;var k=M.p;try{M.p=8,zx(c,d,m,w)}finally{M.p=k,L.T=E}}function zx(c,d,m,w){if(Hb){var E=Vx(w);if(E===null)Tx(c,d,w,Wb,m),xD(c,w);else if(U2e(E,c,d,m,w))w.stopPropagation();else if(xD(c,w),d&4&&-1<D2e.indexOf(c)){for(;E!==null;){var k=wn(E);if(k!==null)switch(k.tag){case 3:if(k=k.stateNode,k.current.memoizedState.isDehydrated){var B=ae(k.pendingLanes);if(B!==0){var J=k;for(J.pendingLanes|=2,J.entangledLanes|=2;B;){var ne=1<<31-bn(B);J.entanglements[1]|=ne,B&=~ne}$l(k),(On&6)===0&&(kb=$t()+500,iy(0))}}break;case 31:case 13:J=Q2(k,2),J!==null&&Zs(J,k,2),Lb(),Fx(k,2)}
vendor: 5,991 bytes, line 50
50if(k=Vx(w),k===null&&Tx(c,d,w,Wb,m),k===E)break;E=k}E!==null&&w.stopPropagation()}else Tx(c,d,w,null,m)}}function Vx(c){return c=km(c),Hx(c)}var Wb=null;function Hx(c){if(Wb=null,c=Ct(c),c!==null){var d=s(c);if(d===null)c=null;else{var m=d.tag;if(m===13){if(c=a(d),c!==null)return c;c=null}else if(m===31){if(c=o(d),c!==null)return c;c=null}else if(m===3){if(d.stateNode.current.memoizedState.isDehydrated)return d.tag===3?d.stateNode.containerInfo:null;c=null}else d!==c&&(c=null)}}return Wb=c,null}function _D(c){switch(c){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(jr()){case ar:return 2;case Mr:return 8;case In:case Tr:return 32;case ln:return 268435456;default:return 32}default:return 32}}var Wx=!1,gd=null,bd=null,wd=null,dy=new Map,hy=new Map,vd=[],D2e="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function xD(c,d){switch(c){case"focusin":case"focusout":gd=null;break;case"dragenter":case"dragleave":bd=null;break;case"mouseover":case"mouseout":wd=null;break;case"pointerover":case"pointerout":dy.delete(d.pointerId);break;case"gotpointercapture":case"lostpointercapture":hy.delete(d.pointerId)}}function fy(c,d,m,w,E,k){return c===null||c.nativeEvent!==k?(c={blockedOn:d,domEventName:m,eventSystemFlags:w,nativeEvent:k,targetContainers:[E]},d!==null&&(d=wn(d),d!==null&&wD(d)),c):(c.eventSystemFlags|=w,d=c.targetContainers,E!==null&&d.indexOf(E)===-1&&d.push(E),c)}function U2e(c,d,m,w,E){switch(d){case"focusin":return gd=fy(gd,c,d,m,w,E),!0;case"dragenter":return bd=fy(bd,c,d,m,w,E),!0;case"mouseover":return wd=fy(wd,c,d,m,w,E),!0;case"pointerover":var k=E.pointerId;return dy.set(k,fy(dy.get(k)||null,c,d,m,w,E)),!0;case"gotpointercapture":return k=E.pointerId,hy.set(k,fy(hy.get(k)||null,c,d,m,w,E)),!0}return!1}function CD(c){var d=Ct(c.target);if(d!==null){var m=s(d);if(m!==null){if(d=m.tag,d===13){if(d=a(m),d!==null){c.blockedOn=d,Fr(c.priority,function(){vD(m)});return}}else if(d===31){if(d=o(m),d!==null){c.blockedOn=d,Fr(c.priority,function(){vD(m)});return}}else if(d===3&&m.stateNode.current.memoizedState.isDehydrated){c.blockedOn=m.tag===3?m.stateNode.containerInfo:null;return}}}c.blockedOn=null}function qb(c){if(c.blockedOn!==null)return!1;for(var d=c.targetContainers;0<d.length;){var m=Vx(c.nativeEvent);if(m===null){m=c.nativeEvent;var w=new m.constructor(m.type,m);Am=w,m.target.dispatchEvent(w),Am=null}else return d=wn(m),d!==null&&wD(d),c.blockedOn=m,!1;d.shift()}return!0}function ED(c,d,m){qb(c)&&m.delete(d)}function B2e(){Wx=!1,gd!==null&&qb(gd)&&(gd=null),bd!==null&&qb(bd)&&(bd=null),wd!==null&&qb(wd)&&(wd=null),dy.forEach(ED),hy.forEach(ED)}function Zb(c,d){c.blockedOn===d&&(c.blockedOn=null,Wx||(Wx=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,B2e)))}var Kb=null;function SD(c){Kb!==c&&(Kb=c,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Kb===c&&(Kb=null);for(var d=0;d<c.length;d+=3){var m=c[d],w=c[d+1],E=c[d+2];if(typeof w!="function"){if(Hx(w||m)===null)continue;break}var k=wn(m);k!==null&&(c.splice(d,3),d-=3,V_(k,{pending:!0,data:E,method:m.method,action:w},w,E))}}))}function Bp(c){function d(ne){return Zb(ne,c)}gd!==null&&Zb(gd,c),bd!==null&&Zb(bd,c),wd!==null&&Zb(wd,c),dy.forEach(d),hy.forEach(d);for(var m=0;m<vd.length;m++){var w=vd[m];w.blockedOn===c&&(w.blockedOn=null)}for(;0<vd.length&&(m=vd[0],m.blockedOn===null);)CD(m),m.blockedOn===null&&vd.shift();if(m=(c.ownerDocument||c).$$reactFormReplay,m!=null)for(w=0;w<m.length;w+=3){var E=m[w],k=m[w+1],B=E[Dn]||null;if(typeof k=="function")B||SD(m);else if(B){var J=null;if(k&&k.hasAttribute("formAction")){if(E=k,B=k[Dn]||null)J=B.formAction;else if(Hx(E)!==null)continue}else J=B.action;typeof J=="function"?m[w+1]=J:(m.splice(w,3),w-=3),SD(m)}}}function AD(){function c(k){k.canIntercept&&k.info==="react-transition"&&k.intercept({handler:function(){return new Promise(function(B){return E=B})},focusReset:"manual",scroll:"manual"})}function d(){E!==null&&(E(),E=null),w||setTimeout(m,20)}function m(){if(!w&&!navigation.transition){var k=navigation.currentEntry;k&&k.url!=null&&navigation.navigate(k.url,{state:k.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var w=!1,E=null;return navigation.addEventListener("navigate",c),navigation.addEventListener("navigatesuccess",d),navigation.addEventListener("navigateerror",d),setTimeout(m,100),function(){w=!0,navigation.removeEventListener("navigate",c),navigation.removeEventListener("navigatesuccess",d),navigation.removeEventListener("navigateerror",d),E!==null&&(E(),E=null)}}}function qx(c){this._internalRoot=c}Gb.prototype.render=qx.prototype.render=function(c){var d=this._internalRoot;if(d===null)throw Error(r(409));var m=d.current,w=Ea();
50gD(m,w,c,d,null,null)},Gb.prototype.unmount=qx.prototype.unmount=function(){var c=this._internalRoot;if(c!==null){this._internalRoot=null;var d=c.containerInfo;gD(c.current,2,null,c,null,null),Lb(),d[cr]=null}};function Gb(c){this._internalRoot=c}Gb.prototype.unstable_scheduleHydration=function(c){if(c){var d=Jn();c={blockedOn:null,target:c,priority:d};for(var m=0;m<vd.length&&d!==0&&d<vd[m].priority;m++);vd.splice(m,0,c),m===0&&CD(c)}};var kD=e.version;if(kD!=="19.2.4")throw Error(r(527,kD,"19.2.4"));M.findDOMNode=function(c){var d=c._reactInternals;if(d===void 0)throw typeof c.render=="function"?Error(r(188)):(c=Object.keys(c).join(","),Error(r(268,c)));return c=u(d),c=c!==null?f(c):null,c=c===null?null:c.stateNode,c};var F2e={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:L,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Yb=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yb.isDisabled&&Yb.supportsFiber)try{wt=Yb.inject(F2e),Ze=Yb}catch{}}return my.createRoot=function(c,d){if(!i(c))throw Error(r(299));var m=!1,w="",E=Pj,k=Rj,B=jj;return d!=null&&(d.unstable_strictMode===!0&&(m=!0),d.identifierPrefix!==void 0&&(w=d.identifierPrefix),d.onUncaughtError!==void 0&&(E=d.onUncaughtError),d.onCaughtError!==void 0&&(k=d.onCaughtError),d.onRecoverableError!==void 0&&(B=d.onRecoverableError)),d=mD(c,1,!1,null,null,m,w,null,E,k,B,AD),c[cr]=d.current,kx(c),new qx(d)},my.hydrateRoot=function(c,d,m){if(!i(c))throw Error(r(299));var w=!1,E="",k=Pj,B=Rj,J=jj,ne=null;return m!=null&&(m.unstable_strictMode===!0&&(w=!0),m.identifierPrefix!==void 0&&(E=m.identifierPrefix),m.onUncaughtError!==void 0&&(k=m.onUncaughtError),m.onCaughtError!==void 0&&(B=m.onCaughtError),m.onRecoverableError!==void 0&&(J=m.onRecoverableError),m.formState!==void 0&&(ne=m.formState)),d=mD(c,1,!0,d,m??null,w,E,ne,k,B,J,AD),d.context=yD(null),m=d.current,w=Ea(),w=ot(w),E=sd(w),E.callback=null,ad(m,E,w),m=w,d.current.lanes=m,bt(d,m),$l(d),c[cr]=d.current,kx(c),new Gb(d)},my.version="19.2.4",my}var BD;function Q2e(){if(BD)return Jx.exports;BD=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Jx.exports=X2e(),Jx.exports}var ehe=Q2e();const the=Wa(ehe);/** 51 * react-router v7.13.1 52 * 53 * Copyright (c) Remix Software Inc. 54 * 55 * This source code is licensed under the MIT license found in the 56 * LICENSE.md file in the root directory of this source tree. 57 * 58 * @license MIT 59 */var FD="popstate";function zD(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function nhe(t={}){function e(r,i){var u;let s=(u=i.state)==null?void 0:u.masked,{pathname:a,search:o,hash:l}=s||r.location;return DA("",{pathname:a,search:o,hash:l},i.state&&i.state.usr||null,i.state&&i.state.key||"default",s?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,i){return typeof i=="string"?i:Jg(i)}return ihe(e,n,null,t)}function Pr(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function Lo(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function rhe(){return Math.random().toString(36).substring(2,10)}function VD(t,e){return{usr:t.state,key:t.key,idx:e,masked:t.unstable_mask?{pathname:t.pathname,search:t.search,hash:t.hash}:void 0}}function DA(t,e,n=null,r,i){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?F1(e):e,state:n,key:e&&e.key||r||rhe(),unstable_mask:i}}function Jg({pathname:t="/",search:e="",hash:n=""}){return e&&e!=="?"&&(t+=e.charAt(0)==="?"?e:"?"+e),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function F1(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substring(n),t=t.substring(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substring(r),t=t.substring(0,r)),t&&(e.pathname=t)}return e}function ihe(t,e,n,r={}){let{window:i=document.defaultView,v5Compat:s=!1}=r,a=i.history,o="POP",l=null,u=f();u==null&&(u=0,a.replaceState({...a.state,idx:u},""));function f(){return(a.state||{idx:null}).idx}function p(){o="POP";
59let _=f(),C=_==null?null:_-u;u=_,l&&l({action:o,location:v.location,delta:C})}function y(_,C){o="PUSH";let S=zD(_)?_:DA(v.location,_,C);u=f()+1;let x=VD(S,u),A=v.createHref(S.unstable_mask||S);try{a.pushState(x,"",A)}catch(I){if(I instanceof DOMException&&I.name==="DataCloneError")throw I;i.location.assign(A)}s&&l&&l({action:o,location:v.location,delta:1})}function g(_,C){o="REPLACE";let S=zD(_)?_:DA(v.location,_,C);u=f();let x=VD(S,u),A=v.createHref(S.unstable_mask||S);a.replaceState(x,"",A),s&&l&&l({action:o,location:v.location,delta:0})}function b(_){return she(_)}let v={get action(){return o},get location(){return t(i,a)},listen(_){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(FD,p),l=_,()=>{i.removeEventListener(FD,p),l=null}},createHref(_){return e(i,_)},createURL:b,encodeLocation(_){let C=b(_);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:y,replace:g,go(_){return a.go(_)}};return v}function she(t,e=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Pr(n,"No window.location.(origin|href) available to create URL");let r=typeof t=="string"?t:Jg(t);return r=r.replace(/ $/,"%20"),!e&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function TY(t,e,n="/"){return ahe(t,e,n,!1)}function ahe(t,e,n,r){let i=typeof e=="string"?F1(e):e,s=Lu(i.pathname||"/",n);if(s==null)return null;let a=LY(t);ohe(a);let o=null;for(let l=0;o==null&&l<a.length;++l){let u=bhe(s);o=yhe(a[l],u,r)}return o}function LY(t,e=[],n=[],r="",i=!1){let s=(a,o,l=i,u)=>{let f={relativePath:u===void 0?a.path||"":u,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};if(f.relativePath.startsWith("/")){if(!f.relativePath.startsWith(r)&&l)return;Pr(f.relativePath.startsWith(r),`Absolute route path "${f.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),f.relativePath=f.relativePath.slice(r.length)}let p=Ql([r,f.relativePath]),y=n.concat(f);a.children&&a.children.length>0&&(Pr(a.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),LY(a.children,e,y,p,l)),!(a.path==null&&!a.index)&&e.push({path:p,score:phe(p,a.index),routesMeta:y})};return t.forEach((a,o)=>{var l;if(a.path===""||!((l=a.path)!=null&&l.includes("?")))s(a,o);else for(let u of $Y(a.path))s(a,o,!0,u)}),e}function $Y(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let a=$Y(r.join("/")),o=[];return o.push(...a.map(l=>l===""?s:[s,l].join("/"))),i&&o.push(...a),o.map(l=>t.startsWith("/")&&l===""?"/":l)}function ohe(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:mhe(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var lhe=/^:[\w-]+$/,che=3,uhe=2,dhe=1,hhe=10,fhe=-2,HD=t=>t==="*";function phe(t,e){let n=t.split("/"),r=n.length;return n.some(HD)&&(r+=fhe),e&&(r+=uhe),n.filter(i=>!HD(i)).reduce((i,s)=>i+(lhe.test(s)?che:s===""?dhe:hhe),r)}function mhe(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function yhe(t,e,n=!1){let{routesMeta:r}=t,i={},s="/",a=[];for(let o=0;o<r.length;++o){let l=r[o],u=o===r.length-1,f=s==="/"?e:e.slice(s.length)||"/",p=t8({path:l.relativePath,caseSensitive:l.caseSensitive,end:u},f),y=l.route;if(!p&&u&&n&&!r[r.length-1].route.index&&(p=t8({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},f)),!p)return null;
59Object.assign(i,p.params),a.push({params:i,pathname:Ql([s,p.pathname]),pathnameBase:xhe(Ql([s,p.pathnameBase])),route:y}),p.pathnameBase!=="/"&&(s=Ql([s,p.pathnameBase]))}return a}function t8(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=ghe(t.path,t.caseSensitive,t.end),i=e.match(n);if(!i)return null;let s=i[0],a=s.replace(/(.)\/+$/,"$1"),o=i.slice(1);return{params:r.reduce((u,{paramName:f,isOptional:p},y)=>{if(f==="*"){let b=o[y]||"";a=s.slice(0,s.length-b.length).replace(/(.)\/+$/,"$1")}const g=o[y];return p&&!g?u[f]=void 0:u[f]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:a,pattern:t}}function ghe(t,e=!1,n=!0){Lo(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,o,l,u,f)=>{if(r.push({paramName:o,isOptional:l!=null}),l){let p=f.charAt(u+a.length);return p&&p!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function bhe(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Lo(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),t}}function Lu(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}var whe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function vhe(t,e="/"){let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?F1(t):t,s;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?s=WD(n.substring(1),"/"):s=WD(n,e)):s=e,{pathname:s,search:Che(r),hash:Ehe(i)}}function WD(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function tC(t,e,n,r){return`Cannot include a '${t}' character in a manually specified \`to.${e}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function _he(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function Z$(t){let e=_he(t);return e.map((n,r)=>r===e.length-1?n.pathname:n.pathnameBase)}function Jv(t,e,n,r=!1){let i;typeof t=="string"?i=F1(t):(i={...t},Pr(!i.pathname||!i.pathname.includes("?"),tC("?","pathname","search",i)),Pr(!i.pathname||!i.pathname.includes("#"),tC("#","pathname","hash",i)),Pr(!i.search||!i.search.includes("#"),tC("#","search","hash",i)));let s=t===""||i.pathname==="",a=s?"/":i.pathname,o;if(a==null)o=n;else{let p=e.length-1;if(!r&&a.startsWith("..")){let y=a.split("/");for(;y[0]==="..";)y.shift(),p-=1;i.pathname=y.join("/")}o=p>=0?e[p]:"/"}let l=vhe(i,o),u=a&&a!=="/"&&a.endsWith("/"),f=(s||a===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||f)&&(l.pathname+="/"),l}var Ql=t=>t.join("/").replace(/\/\/+/g,"/"),xhe=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),Che=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,Ehe=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,She=class{constructor(t,e,n,r=!1){this.status=t,this.statusText=e||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Ahe(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function khe(t){return t.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var IY=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function NY(t,e){let n=t;
59if(typeof n!="string"||!whe.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(IY)try{let s=new URL(window.location.href),a=n.startsWith("//")?new URL(s.protocol+n):new URL(n),o=Lu(a.pathname,e);a.origin===s.origin&&o!=null?n=o+a.search+a.hash:i=!0}catch{Lo(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var OY=["POST","PUT","PATCH","DELETE"];new Set(OY);var The=["GET",...OY];new Set(The);var z1=N.createContext(null);z1.displayName="DataRouter";var Xv=N.createContext(null);Xv.displayName="DataRouterState";var Lhe=N.createContext(!1),PY=N.createContext({isTransitioning:!1});PY.displayName="ViewTransition";var $he=N.createContext(new Map);$he.displayName="Fetchers";var Ihe=N.createContext(null);Ihe.displayName="Await";var qa=N.createContext(null);qa.displayName="Navigation";var $6=N.createContext(null);$6.displayName="Location";var Ro=N.createContext({outlet:null,matches:[],isDataRoute:!1});Ro.displayName="Route";var K$=N.createContext(null);K$.displayName="RouteError";var RY="REACT_ROUTER_ERROR",Nhe="REDIRECT",Ohe="ROUTE_ERROR_RESPONSE";function Phe(t){if(t.startsWith(`${RY}:${Nhe}:{`))try{let e=JSON.parse(t.slice(28));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.location=="string"&&typeof e.reloadDocument=="boolean"&&typeof e.replace=="boolean")return e}catch{}}function Rhe(t){if(t.startsWith(`${RY}:${Ohe}:{`))try{let e=JSON.parse(t.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new She(e.status,e.statusText,e.data)}catch{}}function jhe(t,{relative:e}={}){Pr(V1(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=N.useContext(qa),{hash:i,pathname:s,search:a}=I6(t,{relative:e}),o=s;return n!=="/"&&(o=s==="/"?n:Ql([n,s])),r.createHref({pathname:o,search:a,hash:i})}function V1(){return N.useContext($6)!=null}function Zi(){return Pr(V1(),"useLocation() may be used only in the context of a <Router> component."),N.useContext($6).location}var jY="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function MY(t){N.useContext(qa).static||N.useLayoutEffect(t)}function Bu(){let{isDataRoute:t}=N.useContext(Ro);return t?Jhe():Mhe()}function Mhe(){Pr(V1(),"useNavigate() may be used only in the context of a <Router> component.");let t=N.useContext(z1),{basename:e,navigator:n}=N.useContext(qa),{matches:r}=N.useContext(Ro),{pathname:i}=Zi(),s=JSON.stringify(Z$(r)),a=N.useRef(!1);return MY(()=>{a.current=!0}),N.useCallback((l,u={})=>{if(Lo(a.current,jY),!a.current)return;if(typeof l=="number"){n.go(l);return}let f=Jv(l,JSON.parse(s),i,u.relative==="path");t==null&&e!=="/"&&(f.pathname=f.pathname==="/"?e:Ql([e,f.pathname])),(u.replace?n.replace:n.push)(f,u.state,u)},[e,n,s,i,t])}var Dhe=N.createContext(null);function Uhe(t){let e=N.useContext(Ro).outlet;return N.useMemo(()=>e&&N.createElement(Dhe.Provider,{value:t},e),[e,t])}function Lmt(){let{matches:t}=N.useContext(Ro),e=t[t.length-1];return e?e.params:{}}function I6(t,{relative:e}={}){let{matches:n}=N.useContext(Ro),{pathname:r}=Zi(),i=JSON.stringify(Z$(n));return N.useMemo(()=>Jv(t,JSON.parse(i),r,e==="path"),[t,i,r,e])}function Bhe(t,e){return DY(t,e)}function DY(t,e,n){var _;Pr(V1(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=N.useContext(qa),{matches:i}=N.useContext(Ro),s=i[i.length-1],a=s?s.params:{},o=s?s.pathname:"/",l=s?s.pathnameBase:"/",u=s&&s.route;{let C=u&&u.path||"";BY(o,!u||C.endsWith("*")||C.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${o}" (under <Route path="${C}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. 60 61Please change the parent <Route path="${C}"> to <Route path="${C==="/"?"*":`${C}/*`}">.`)}let f=Zi(),p;if(e){let C=typeof e=="string"?F1(e):e;Pr(l==="/"||((_=C.pathname)==null?void 0:_.startsWith(l)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${l}" but pathname "${C.pathname}" was given in the \`location\` prop.`),p=C}else p=f;let y=p.pathname||"/",g=y;if(l!=="/"){let C=l.replace(/^\//,"").split("/");g="/"+y.replace(/^\//,"").split("/").slice(C.length).join("/")}let b=TY(t,{pathname:g});Lo(u||b!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),Lo(b==null||b[b.length-1].route.element!==void 0||b[b.length-1].route.Component!==void 0||b[b.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let v=Whe(b&&b.map(C=>Object.assign({},C,{params:Object.assign({},a,C.params),pathname:Ql([l,r.encodeLocation?r.encodeLocation(C.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?l:Ql([l,r.encodeLocation?r.encodeLocation(C.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathnameBase])})),i,n);return e&&v?N.createElement($6.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...p},navigationType:"POP"}},v):v}function Fhe(){let t=Yhe(),e=Ahe(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},a=null;return console.error("Error handled by React Router default ErrorBoundary:",t),a=N.createElement(N.Fragment,null,N.createElement("p",null,"ð¿ Hey developer ð"),N.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",N.createElement("code",{style:s},"ErrorBoundary")," or"," ",N.createElement("code",{style:s},"errorElement")," prop on your route.")),N.createElement(N.Fragment,null,N.createElement("h2",null,"Unexpected Application
61Error!"),N.createElement("h3",{style:{fontStyle:"italic"}},e),n?N.createElement("pre",{style:i},n):null,a)}var zhe=N.createElement(Fhe,null),UY=class extends N.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||e.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){this.props.onError?this.props.onError(t,e):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const n=Rhe(t.digest);n&&(t=n)}let e=t!==void 0?N.createElement(Ro.Provider,{value:this.props.routeContext},N.createElement(K$.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?N.createElement(Vhe,{error:t},e):e}};UY.contextType=Lhe;var nC=new WeakMap;function Vhe({children:t,error:e}){let{basename:n}=N.useContext(qa);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let r=Phe(e.digest);if(r){let i=nC.get(e);if(i)throw i;let s=NY(r.location,n);if(IY&&!nC.get(e))if(s.isExternal||r.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const a=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:r.replace}));throw nC.set(e,a),a}return N.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return t}function Hhe({routeContext:t,match:e,children:n}){let r=N.useContext(z1);return r&&r.static&&r.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=e.route.id),N.createElement(Ro.Provider,{value:t},n)}function Whe(t,e=[],n){let r=n==null?void 0:n.state;if(t==null){if(!r)return null;if(r.errors)t=r.matches;else if(e.length===0&&!r.initialized&&r.matches.length>0)t=r.matches;else return null}let i=t,s=r==null?void 0:r.errors;if(s!=null){let f=i.findIndex(p=>p.route.id&&(s==null?void 0:s[p.route.id])!==void 0);Pr(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),i=i.slice(0,Math.min(i.length,f+1))}let a=!1,o=-1;if(n&&r){a=r.renderFallback;for(let f=0;f<i.length;f++){let p=i[f];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(o=f),p.route.id){let{loaderData:y,errors:g}=r,b=p.route.loader&&!y.hasOwnProperty(p.route.id)&&(!g||g[p.route.id]===void 0);if(p.route.lazy||b){n.isStatic&&(a=!0),o>=0?i=i.slice(0,o+1):i=[i[0]];break}}}}let l=n==null?void 0:n.onError,u=r&&l?(f,p)=>{var y,g;l(f,{location:r.location,params:((g=(y=r.matches)==null?void 0:y[0])==null?void 0:g.params)??{},unstable_pattern:khe(r.matches),errorInfo:p})}:void 0;return i.reduceRight((f,p,y)=>{let g,b=!1,v=null,_=null;r&&(g=s&&p.route.id?s[p.route.id]:void 0,v=p.route.errorElement||zhe,a&&(o<0&&y===0?(BY("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,_=null):o===y&&(b=!0,_=p.route.hydrateFallbackElement||null)));let C=e.concat(i.slice(0,y+1)),S=()=>{let x;return g?x=v:b?x=_:p.route.Component?x=N.createElement(p.route.Component,null):p.route.element?x=p.route.element:x=f,N.createElement(Hhe,{match:p,routeContext:{outlet:f,matches:C,isDataRoute:r!=null},children:x})};return r&&(p.route.ErrorBoundary||p.route.errorElement||y===0)?N.createElement(UY,{location:r.location,revalidation:r.revalidation,component:v,error:g,children:S(),routeC
61ontext:{outlet:null,matches:C,isDataRoute:!0},onError:u}):S()},null)}function G$(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function qhe(t){let e=N.useContext(z1);return Pr(e,G$(t)),e}function Zhe(t){let e=N.useContext(Xv);return Pr(e,G$(t)),e}function Khe(t){let e=N.useContext(Ro);return Pr(e,G$(t)),e}function Y$(t){let e=Khe(t),n=e.matches[e.matches.length-1];return Pr(n.route.id,`${t} can only be used on routes that contain a unique "id"`),n.route.id}function Ghe(){return Y$("useRouteId")}function Yhe(){var r;let t=N.useContext(K$),e=Zhe("useRouteError"),n=Y$("useRouteError");return t!==void 0?t:(r=e.errors)==null?void 0:r[n]}function Jhe(){let{router:t}=qhe("useNavigate"),e=Y$("useNavigate"),n=N.useRef(!1);return MY(()=>{n.current=!0}),N.useCallback(async(i,s={})=>{Lo(n.current,jY),n.current&&(typeof i=="number"?await t.navigate(i):await t.navigate(i,{fromRouteId:e,...s}))},[t,e])}var qD={};function BY(t,e,n){!e&&!qD[t]&&(qD[t]=!0,Lo(!1,n))}N.memo(Xhe);function Xhe({routes:t,future:e,state:n,isStatic:r,onError:i}){return DY(t,void 0,{state:n,isStatic:r,onError:i})}function xs({to:t,replace:e,state:n,relative:r}){Pr(V1(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=N.useContext(qa);Lo(!i,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:s}=N.useContext(Ro),{pathname:a}=Zi(),o=Bu(),l=Jv(t,Z$(s),a,r==="path"),u=JSON.stringify(l);return N.useEffect(()=>{o(JSON.parse(u),{replace:e,state:n,relative:r})},[o,u,r,e,n]),null}function Qhe(t){return Uhe(t.context)}function we(t){Pr(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function efe({basename:t="/",children:e=null,location:n,navigationType:r="POP",navigator:i,static:s=!1,unstable_useTransitions:a}){Pr(!V1(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let o=t.replace(/^\/*/,"/"),l=N.useMemo(()=>({basename:o,navigator:i,static:s,unstable_useTransitions:a,future:{}}),[o,i,s,a]);typeof n=="string"&&(n=F1(n));let{pathname:u="/",search:f="",hash:p="",state:y=null,key:g="default",unstable_mask:b}=n,v=N.useMemo(()=>{let _=Lu(u,o);return _==null?null:{location:{pathname:_,search:f,hash:p,state:y,key:g,unstable_mask:b},navigationType:r}},[o,u,f,p,y,g,r,b]);return Lo(v!=null,`<Router basename="${o}"> is not able to match the URL "${u}${f}${p}" because it does not start with the basename, so the <Router> won't render anything.`),v==null?null:N.createElement(qa.Provider,{value:l},N.createElement($6.Provider,{children:e,value:v}))}function tfe({children:t,location:e}){return Bhe(UA(t),e)}function UA(t,e=[]){let n=[];return N.Children.forEach(t,(r,i)=>{if(!N.isValidElement(r))return;let s=[...e,i];if(r.type===N.Fragment){n.push.apply(n,UA(r.props.children,s));return}Pr(r.type===we,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Pr(!r.props.index||!r.props.children,"An index route cannot have child routes.");let a={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(a.children=UA(r.props.children,s)),n.push(a)}),n}var bw="get",ww="application/x-www-form-urlencoded";function Qv(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function nfe(t){return Qv(t)&&t.tagName.toLowerCase()==="button"}function rfe(t){return Qv(t)&&t.tagName.toLowerCase()==="form"}function ife(t){return Qv(t)&&t.tagName.toLowerCase()==="input"}function sfe(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function afe(t,e){return t.button===0&&(!e||e==="_self")&&!sfe(t)}
61function BA(t=""){return new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,n)=>{let r=t[n];return e.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function ofe(t,e){let n=BA(t);return e&&e.forEach((r,i)=>{n.has(i)||e.getAll(i).forEach(s=>{n.append(i,s)})}),n}var Jb=null;function lfe(){if(Jb===null)try{new FormData(document.createElement("form"),0),Jb=!1}catch{Jb=!0}return Jb}var cfe=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function rC(t){return t!=null&&!cfe.has(t)?(Lo(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ww}"`),null):t}function ufe(t,e){let n,r,i,s,a;if(rfe(t)){let o=t.getAttribute("action");r=o?Lu(o,e):null,n=t.getAttribute("method")||bw,i=rC(t.getAttribute("enctype"))||ww,s=new FormData(t)}else if(nfe(t)||ife(t)&&(t.type==="submit"||t.type==="image")){let o=t.form;if(o==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=t.getAttribute("formaction")||o.getAttribute("action");if(r=l?Lu(l,e):null,n=t.getAttribute("formmethod")||o.getAttribute("method")||bw,i=rC(t.getAttribute("formenctype"))||rC(o.getAttribute("enctype"))||ww,s=new FormData(o,t),!lfe()){let{name:u,type:f,value:p}=t;if(f==="image"){let y=u?`${u}.`:"";s.append(`${y}x`,"0"),s.append(`${y}y`,"0")}else u&&s.append(u,p)}}else{if(Qv(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=bw,r=null,i=ww,a=t}return s&&i==="text/plain"&&(a=s,s=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:s,body:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function J$(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function dfe(t,e,n,r){let i=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return n?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname==="/"?i.pathname=`_root.${r}`:e&&Lu(i.pathname,e)==="/"?i.pathname=`${e.replace(/\/$/,"")}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${r}`,i}async function hfe(t,e){if(t.id in e)return e[t.id];try{let n=await import(t.module);return e[t.id]=n,n}catch(n){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function ffe(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function pfe(t,e,n){let r=await Promise.all(t.map(async i=>{let s=e.routes[i.route.id];if(s){let a=await hfe(s,n);return a.links?a.links():[]}return[]}));return bfe(r.flat(1).filter(ffe).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function ZD(t,e,n,r,i,s){let a=(l,u)=>n[u]?l.route.id!==n[u].route.id:!0,o=(l,u)=>{var f;return n[u].pathname!==l.pathname||((f=n[u].route.path)==null?void 0:f.endsWith("*"))&&n[u].params["*"]!==l.params["*"]};return s==="assets"?e.filter((l,u)=>a(l,u)||o(l,u)):s==="data"?e.filter((l,u)=>{var p;let f=r.routes[l.route.id];if(!f||!f.hasLoader)return!1;if(a(l,u)||o(l,u))return!0;if(l.route.shouldRevalidate){let y=l.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((p=n[0])==null?void 0:p.params)||{},nextUrl:new URL(t,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function mfe(t,e,{includeHydrateFallback:n}={}){return yfe(t.map(r=>{let i=e.routes[r.route.id];if(!i)return[];let s=[i.module];return i.clientActionModule&&(s=s.concat(i.clientActionModule)),i.clientLoaderModule&&(s=s.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(s=s.concat(i.hydrateFallbackModule)),i.imports&&(s=s.concat(i.imports)),s}).flat(1))}function yfe(t){return[...new Set(t)]}function gfe(t){let e={},n=Object.keys(t).sort();for(let r of n)e[r]=t[r];return e}function bfe(t,e){let n=new Set;return new Set(e),t.reduce((r,i)=>{let s=JSON.stringify(gfe(i));return n.has(s)||(n.add(s),r.push({key:s,link:i})),r},[])}function FY(){let t=N.useContext(z1);return J$(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function wfe(){let t=N.useContext(Xv);return J$(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var X$=N.createContext(void 0);X$.displayName="FrameworkContext";function zY(){let t=N.useContext(X$);return J$(t,"You must render this element inside a <HydratedRouter> element"),t}function vfe(t,e){let n=N.useContext(X$),[r,i]=N.useState(!1),[s,a]=N.useState(!1),{onFocus:o,onBlur:l,onMouseEnter:u,onMouseLeave:f,onTouchStart:p}=e,y=N.useRef(null);N.useEffect(()=>{if(t==="render"&&a(!0),t==="viewport"){let v=C=>
61{C.forEach(S=>{a(S.isIntersecting)})},_=new IntersectionObserver(v,{threshold:.5});return y.current&&_.observe(y.current),()=>{_.disconnect()}}},[t]),N.useEffect(()=>{if(r){let v=setTimeout(()=>{a(!0)},100);return()=>{clearTimeout(v)}}},[r]);let g=()=>{i(!0)},b=()=>{i(!1),a(!1)};return n?t!=="intent"?[s,y,{}]:[s,y,{onFocus:yy(o,g),onBlur:yy(l,b),onMouseEnter:yy(u,g),onMouseLeave:yy(f,b),onTouchStart:yy(p,g)}]:[!1,y,{}]}function yy(t,e){return n=>{t&&t(n),n.defaultPrevented||e(n)}}function _fe({page:t,...e}){let{router:n}=FY(),r=N.useMemo(()=>TY(n.routes,t,n.basename),[n.routes,t,n.basename]);return r?N.createElement(Cfe,{page:t,matches:r,...e}):null}function xfe(t){let{manifest:e,routeModules:n}=zY(),[r,i]=N.useState([]);return N.useEffect(()=>{let s=!1;return pfe(t,e,n).then(a=>{s||i(a)}),()=>{s=!0}},[t,e,n]),r}function Cfe({page:t,matches:e,...n}){let r=Zi(),{future:i,manifest:s,routeModules:a}=zY(),{basename:o}=FY(),{loaderData:l,matches:u}=wfe(),f=N.useMemo(()=>ZD(t,e,u,s,r,"data"),[t,e,u,s,r]),p=N.useMemo(()=>ZD(t,e,u,s,r,"assets"),[t,e,u,s,r]),y=N.useMemo(()=>{if(t===r.pathname+r.search+r.hash)return[];let v=new Set,_=!1;if(e.forEach(S=>{var A;let x=s.routes[S.route.id];!x||!x.hasLoader||(!f.some(I=>I.route.id===S.route.id)&&S.route.id in l&&((A=a[S.route.id])!=null&&A.shouldRevalidate)||x.hasClientLoader?_=!0:v.add(S.route.id))}),v.size===0)return[];let C=dfe(t,o,i.unstable_trailingSlashAwareDataRequests,"data");return _&&v.size>0&&C.searchParams.set("_routes",e.filter(S=>v.has(S.route.id)).map(S=>S.route.id).join(",")),[C.pathname+C.search]},[o,i.unstable_trailingSlashAwareDataRequests,l,r,s,f,e,t,a]),g=N.useMemo(()=>mfe(p,s),[p,s]),b=xfe(p);return N.createElement(N.Fragment,null,y.map(v=>N.createElement("link",{key:v,rel:"prefetch",as:"fetch",href:v,...n})),g.map(v=>N.createElement("link",{key:v,rel:"modulepreload",href:v,...n})),b.map(({key:v,link:_})=>N.createElement("link",{key:v,nonce:n.nonce,..._,crossOrigin:_.crossOrigin??n.crossOrigin})))}function Efe(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var Sfe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Sfe&&(window.__reactRouterVersion="7.13.1")}catch{}function Afe({basename:t,children:e,unstable_useTransitions:n,window:r}){let i=N.useRef();i.current==null&&(i.current=nhe({window:r,v5Compat:!0}));let s=i.current,[a,o]=N.useState({action:s.action,location:s.location}),l=N.useCallback(u=>{n===!1?o(u):N.startTransition(()=>o(u))},[n]);return N.useLayoutEffect(()=>s.listen(l),[s,l]),N.createElement(efe,{basename:t,children:e,location:a.location,navigationType:a.action,navigator:s,unstable_useTransitions:n})}var VY=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Q$=N.forwardRef(function({onClick:e,discover:n="render",prefetch:r="none",relative:i,reloadDocument:s,replace:a,unstable_mask:o,state:l,target:u,to:f,preventScrollReset:p,viewTransition:y,unstable_defaultShouldRevalidate:g,...b},v){let{basename:_,navigator:C,unstable_useTransitions:S}=N.useContext(qa),x=typeof f=="string"&&VY.test(f),A=NY(f,_);f=A.to;let I=jhe(f,{relative:i}),$=Zi(),O=null;if(o){let T=Jv(o,[],$.unstable_mask?$.unstable_mask.pathname:"/",!0);_!=="/"&&(T.pathname=T.pathname==="/"?_:Ql([_,T.pathname])),O=C.createHref(T)}let[P,j,U]=vfe(r,b),z=$fe(f,{replace:a,unstable_mask:o,state:l,target:u,preventScrollReset:p,relative:i,viewTransition:y,unstable_defaultShouldRevalidate:g,unstable_useTransitions:S});function D(T){e&&e(T),T.defaultPrevented||z(T)}let R=!(A.isExternal||s),W=N.createElement("a",{...b,...U,href:(R?O:void 0)||A.absoluteURL||I,onClick:R?D:e,ref:Efe(v,j),target:u,"data-discover":!x&&n==="render"?"true":void 0});return P&&!x?N.createElement(N.Fragment,null,W,N.createElement(_fe,{page:I})):W});Q$.displayName="Link";var kfe=N.forwardRef(function({"aria-current":e="page",caseSensitive:n=!1,className:r="",end:i=!1,style:s,to:a,viewTransition:o,children:l,...u},f){let p=I6(a,{relative:u.relative}),y=Zi(),g=N.useContext(Xv),{navigator:b,basename:v}=N.useContext(qa),_=g!=null&&Rfe(p)&&o===!0,C=b.encodeLocation?b.encodeLocation(p).pathname:p.pathname,S=y.pathname,x=g&&g.n
61avigation&&g.navigation.location?g.navigation.location.pathname:null;n||(S=S.toLowerCase(),x=x?x.toLowerCase():null,C=C.toLowerCase()),x&&v&&(x=Lu(x,v)||x);const A=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let I=S===C||!i&&S.startsWith(C)&&S.charAt(A)==="/",$=x!=null&&(x===C||!i&&x.startsWith(C)&&x.charAt(C.length)==="/"),O={isActive:I,isPending:$,isTransitioning:_},P=I?e:void 0,j;typeof r=="function"?j=r(O):j=[r,I?"active":null,$?"pending":null,_?"transitioning":null].filter(Boolean).join(" ");let U=typeof s=="function"?s(O):s;return N.createElement(Q$,{...u,"aria-current":P,className:j,ref:f,style:U,to:a,viewTransition:o},typeof l=="function"?l(O):l)});kfe.displayName="NavLink";var Tfe=N.forwardRef(({discover:t="render",fetcherKey:e,navigate:n,reloadDocument:r,replace:i,state:s,method:a=bw,action:o,onSubmit:l,relative:u,preventScrollReset:f,viewTransition:p,unstable_defaultShouldRevalidate:y,...g},b)=>{let{unstable_useTransitions:v}=N.useContext(qa),_=Ofe(),C=Pfe(o,{relative:u}),S=a.toLowerCase()==="get"?"get":"post",x=typeof o=="string"&&VY.test(o),A=I=>{if(l&&l(I),I.defaultPrevented)return;I.preventDefault();let $=I.nativeEvent.submitter,O=($==null?void 0:$.getAttribute("formmethod"))||a,P=()=>_($||I.currentTarget,{fetcherKey:e,method:O,navigate:n,replace:i,state:s,relative:u,preventScrollReset:f,viewTransition:p,unstable_defaultShouldRevalidate:y});v&&n!==!1?N.startTransition(()=>P()):P()};return N.createElement("form",{ref:b,method:S,action:C,onSubmit:r?l:A,...g,"data-discover":!x&&t==="render"?"true":void 0})});Tfe.displayName="Form";function Lfe(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function HY(t){let e=N.useContext(z1);return Pr(e,Lfe(t)),e}function $fe(t,{target:e,replace:n,unstable_mask:r,state:i,preventScrollReset:s,relative:a,viewTransition:o,unstable_defaultShouldRevalidate:l,unstable_useTransitions:u}={}){let f=Bu(),p=Zi(),y=I6(t,{relative:a});return N.useCallback(g=>{if(afe(g,e)){g.preventDefault();let b=n!==void 0?n:Jg(p)===Jg(y),v=()=>f(t,{replace:b,unstable_mask:r,state:i,preventScrollReset:s,relative:a,viewTransition:o,unstable_defaultShouldRevalidate:l});u?N.startTransition(()=>v()):v()}},[p,f,y,n,r,i,e,t,s,a,o,l,u])}function $mt(t){Lo(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let e=N.useRef(BA(t)),n=N.useRef(!1),r=Zi(),i=N.useMemo(()=>ofe(r.search,n.current?null:e.current),[r.search]),s=Bu(),a=N.useCallback((o,l)=>{const u=BA(typeof o=="function"?o(new URLSearchParams(i)):o);n.current=!0,s("?"+u,l)},[s,i]);return[i,a]}var Ife=0,Nfe=()=>`__${String(++Ife)}__`;function Ofe(){let{router:t}=HY("useSubmit"),{basename:e}=N.useContext(qa),n=Ghe(),r=t.fetch,i=t.navigate;return N.useCallback(async(s,a={})=>{let{action:o,method:l,encType:u,formData:f,body:p}=ufe(s,e);if(a.navigate===!1){let y=a.fetcherKey||Nfe();await r(y,n,a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:f,body:p,formMethod:a.method||l,formEncType:a.encType||u,flushSync:a.flushSync})}else await i(a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:f,body:p,formMethod:a.method||l,formEncType:a.encType||u,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,e,n])}function Pfe(t,{relative:e}={}){let{basename:n}=N.useContext(qa),r=N.useContext(Ro);Pr(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),s={...I6(t||".",{relative:e})},a=Zi();if(t==null){s.search=a.search;let o=new URLSearchParams(s.search),l=o.getAll("index");if(l.some(f=>f==="")){o.delete("index"),l.filter(p=>p).forEach(p=>o.append("index",p));let f=o.toString();s.search=f?`?${f}`:""}}return(!t||t===".")&&i.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:Ql([n,s.pathname])),Jg(s)}function Rfe(t,{relative:e}={}){let n=N.useContext(PY);Pr(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=HY("useViewTransitionState"),i=I6(t,{relative:e});if(!n.isTransitioning)return!1;let s=Lu(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=Lu(n.nextLocation.pathname,r)||n.nextLocation.pathname;return t8(i.pathname,a)!=null||t8(i.pathname,s)!=null}var yu=kY(),iC,KD;function jfe(){if(KD)return iC;KD=1;var t=typeof Element<"u",e=typeof Map=="function",n=typeof Set=="function",r=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function i(s,a){if(s===a)return!0;
61if(s&&a&&typeof s=="object"&&typeof a=="object"){if(s.constructor!==a.constructor)return!1;var o,l,u;if(Array.isArray(s)){if(o=s.length,o!=a.length)return!1;for(l=o;l--!==0;)if(!i(s[l],a[l]))return!1;return!0}var f;if(e&&s instanceof Map&&a instanceof Map){if(s.size!==a.size)return!1;for(f=s.entries();!(l=f.next()).done;)if(!a.has(l.value[0]))return!1;for(f=s.entries();!(l=f.next()).done;)if(!i(l.value[1],a.get(l.value[0])))return!1;return!0}if(n&&s instanceof Set&&a instanceof Set){if(s.size!==a.size)return!1;for(f=s.entries();!(l=f.next()).done;)if(!a.has(l.value[0]))return!1;return!0}if(r&&ArrayBuffer.isView(s)&&ArrayBuffer.isView(a)){if(o=s.length,o!=a.length)return!1;for(l=o;l--!==0;)if(s[l]!==a[l])return!1;return!0}if(s.constructor===RegExp)return s.source===a.source&&s.flags===a.flags;if(s.valueOf!==Object.prototype.valueOf&&typeof s.valueOf=="function"&&typeof a.valueOf=="function")return s.valueOf()===a.valueOf();if(s.toString!==Object.prototype.toString&&typeof s.toString=="function"&&typeof a.toString=="function")return s.toString()===a.toString();if(u=Object.keys(s),o=u.length,o!==Object.keys(a).length)return!1;for(l=o;l--!==0;)if(!Object.prototype.hasOwnProperty.call(a,u[l]))return!1;if(t&&s instanceof Element)return!1;for(l=o;l--!==0;)if(!((u[l]==="_owner"||u[l]==="__v"||u[l]==="__o")&&s.$$typeof)&&!i(s[u[l]],a[u[l]]))return!1;return!0}return s!==s&&a!==a}return iC=function(a,o){try{return i(a,o)}catch(l){if((l.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw l}},iC}var Mfe=jfe();const Dfe=Wa(Mfe);var sC,GD;function Ufe(){if(GD)return sC;GD=1;var t=function(e,n,r,i,s,a,o,l){if(!e){var u;if(n===void 0)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var f=[r,i,s,a,o,l],p=0;u=new Error(n.replace(/%s/g,function(){return f[p++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}};return sC=t,sC}var Bfe=Ufe();const YD=Wa(Bfe);var aC,JD;function Ffe(){return JD||(JD=1,aC=function(e,n,r,i){var s=r?r.call(i,e,n):void 0;if(s!==void 0)return!!s;if(e===n)return!0;if(typeof e!="object"||!e||typeof n!="object"||!n)return!1;var a=Object.keys(e),o=Object.keys(n);if(a.length!==o.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(n),u=0;u<a.length;u++){var f=a[u];if(!l(f))return!1;var p=e[f],y=n[f];if(s=r?r.call(i,p,y,f):void 0,s===!1||s===void 0&&p!==y)return!1}return!0}),aC}var zfe=Ffe();const Vfe=Wa(zfe);var WY=(t=>(t.BASE="base",t.BODY="body",t.HEAD="head",t.HTML="html",t.LINK="link",t.META="meta",t.NOSCRIPT="noscript",t.SCRIPT="script",t.STYLE="style",t.TITLE="title",t.FRAGMENT="Symbol(react.fragment)",t))(WY||{}),oC={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}},XD=Object.values(WY),eI={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},Hfe=Object.entries(eI).reduce((t,[e,n])=>(t[n]=e,t),{}),dl="data-rh",D0={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},U0=(t,e)=>{for(let n=t.length-1;n>=0;n-=1){const r=t[n];if(Object.prototype.hasOwnProperty.call(r,e))return r[e]}return null},Wfe=t=>{let e=U0(t,"title");const n=U0(t,D0.TITLE_TEMPLATE);if(Array.isArray(e)&&(e=e.join("")),n&&e)return n.replace(/%s/g,()=>e);const r=U0(t,D0.DEFAULT_TITLE);return e||r||void 0},qfe=t=>U0(t,D0.ON_CHANGE_CLIENT_STATE)||(()=>{}),lC=(t,e)=>e.filter(n=>typeof n[t]<"u").map(n=>n[t]).reduce((n,r)=>({...n,...r}),{}),Zfe=(t,e)=>e.filter(n=>typeof n.base<"u").map(n=>n.base).reverse().reduce((n,r)=>{if(!n.length){const i=Object.keys(r);for(let s=0;s<i.length;s+=1){const o=i[s].toLowerCase();if(t.indexOf(o)!==-1&&r[o])return n.concat(r)}}return n},[]),Kfe=t=>console&&typeof console.warn=="function"&&console.warn(t),gy=(t,e,n)=>{const r={};return n.filter(i=>Array.isArray(i[t])?!0:(typeof i[t]<"u"&&Kfe(`Helmet: ${t} should be of type "Array". Instead found type "${typeof i[t]}"`),!1)).map(i=>i[t]).reverse().reduce((i,s)=>{const a={};s.filter(l=>{let u;const f=Object.keys(l);for(let y=0;y<f.length;y+=1){const g=f[y],b=g.toLowerCase();e.indexOf(b)!==-1&&!(u==="rel"&&l[u].toLowerCase()==="canonical")&&!(b==="rel"&&l[b].toLowerCase()==="stylesheet")&&(u=b),e.indexOf(g)!==-1&&(g==="innerHTML"||g==="cssText"||g==="itemprop")&&(u=g)}if(!u||!l[u])return!1;const p=l[u].toLowerCase();return r[u]||(r[u]={}),a[u]||(a[u]={}),r[u][p]?!1:(a[u][p]=!0,!0)}
61).reverse().forEach(l=>i.push(l));const o=Object.keys(a);for(let l=0;l<o.length;l+=1){const u=o[l],f={...r[u],...a[u]};r[u]=f}return i},[]).reverse()},Gfe=(t,e)=>{if(Array.isArray(t)&&t.length){for(let n=0;n<t.length;n+=1)if(t[n][e])return!0}return!1},Yfe=t=>({baseTag:Zfe(["href"],t),bodyAttributes:lC("bodyAttributes",t),defer:U0(t,D0.DEFER),encode:U0(t,D0.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:lC("htmlAttributes",t),linkTags:gy("link",["rel","href"],t),metaTags:gy("meta",["name","charset","http-equiv","property","itemprop"],t),noscriptTags:gy("noscript",["innerHTML"],t),onChangeClientState:qfe(t),scriptTags:gy("script",["src","innerHTML"],t),styleTags:gy("style",["cssText"],t),title:Wfe(t),titleAttributes:lC("titleAttributes",t),prioritizeSeoTags:Gfe(t,D0.PRIORITIZE_SEO_TAGS)}),qY=t=>Array.isArray(t)?t.join(""):t,Jfe=(t,e)=>{const n=Object.keys(t);for(let r=0;r<n.length;r+=1)if(e[n[r]]&&e[n[r]].includes(t[n[r]]))return!0;return!1},cC=(t,e)=>Array.isArray(t)?t.reduce((n,r)=>(Jfe(r,e)?n.priority.push(r):n.default.push(r),n),{priority:[],default:[]}):{default:t,priority:[]},QD=(t,e)=>({...t,[e]:void 0}),Xfe=["noscript","script","style"],FA=(t,e=!0)=>e===!1?String(t):String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),ZY=t=>Object.keys(t).reduce((e,n)=>{const r=typeof t[n]<"u"?`${n}="${t[n]}"`:`${n}`;return e?`${e} ${r}`:r},""),Qfe=(t,e,n,r)=>{const i=ZY(n),s=qY(e);return i?`<${t} ${dl}="true" ${i}>${FA(s,r)}</${t}>`:`<${t} ${dl}="true">${FA(s,r)}</${t}>`},epe=(t,e,n=!0)=>e.reduce((r,i)=>{const s=i,a=Object.keys(s).filter(u=>!(u==="innerHTML"||u==="cssText")).reduce((u,f)=>{const p=typeof s[f]>"u"?f:`${f}="${FA(s[f],n)}"`;return u?`${u} ${p}`:p},""),o=s.innerHTML||s.cssText||"",l=Xfe.indexOf(t)===-1;return`${r}<${t} ${dl}="true" ${a}${l?"/>":`>${o}</${t}>`}`},""),KY=(t,e={})=>Object.keys(t).reduce((n,r)=>{const i=eI[r];return n[i||r]=t[r],n},e),tpe=(t,e,n)=>{const r={key:e,[dl]:!0},i=KY(n,r);return[Qe.createElement("title",i,e)]},vw=(t,e)=>e.map((n,r)=>{const i={key:r,[dl]:!0};return Object.keys(n).forEach(s=>{const o=eI[s]||s;if(o==="innerHTML"||o==="cssText"){const l=n.innerHTML||n.cssText;i.dangerouslySetInnerHTML={__html:l}}else i[o]=n[s]}),Qe.createElement(t,i)}),mo=(t,e,n=!0)=>{switch(t){case"title":return{toComponent:()=>tpe(t,e.title,e.titleAttributes),toString:()=>Qfe(t,e.title,e.titleAttributes,n)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>KY(e),toString:()=>ZY(e)};default:return{toComponent:()=>vw(t,e),toString:()=>epe(t,e,n)}}},npe=({metaTags:t,linkTags:e,scriptTags:n,encode:r})=>{const i=cC(t,oC.meta),s=cC(e,oC.link),a=cC(n,oC.script);return{priorityMethods:{toComponent:()=>[...vw("meta",i.priority),...vw("link",s.priority),...vw("script",a.priority)],toString:()=>`${mo("meta",i.priority,r)} ${mo("link",s.priority,r)} ${mo("script",a.priority,r)}`},metaTags:i.default,linkTags:s.default,scriptTags:a.default}},rpe=t=>{const{baseTag:e,bodyAttributes:n,encode:r=!0,htmlAttributes:i,noscriptTags:s,styleTags:a,title:o="",titleAttributes:l,prioritizeSeoTags:u}=t;let{linkTags:f,metaTags:p,scriptTags:y}=t,g={toComponent:()=>{},toString:()=>""};return u&&({priorityMethods:g,linkTags:f,metaTags:p,scriptTags:y}=npe(t)),{priority:g,base:mo("base",e,r),bodyAttributes:mo("bodyAttributes",n,r),htmlAttributes:mo("htmlAttributes",i,r),link:mo("link",f,r),meta:mo("meta",p,r),noscript:mo("noscript",s,r),script:mo("script",y,r),style:mo("style",a,r),title:mo("title",{title:o,titleAttributes:l},r)}},zA=rpe,Xb=[],GY=!!(typeof window<"u"&&window.document&&window.document.createElement),VA=class{constructor(t,e){fe(this,"instances",[]);fe(this,"canUseDOM",GY);fe(this,"context");fe(this,"value",{setHelmet:t=>{this.context.helmet=t},helmetInstances:{get:()=>this.canUseDOM?Xb:this.instances,add:t=>{(this.canUseDOM?Xb:this.instances).push(t)},remove:t=>{const e=(this.canUseDOM?Xb:this.instances).indexOf(t);(this.canUseDOM?Xb:this.instances).splice(e,1)}}});this.context=t,this.canUseDOM=e||!1,e||(t.helmet=zA({baseTag:[],bodyAttributes:{},htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},ipe={},YY=Qe.createContext(ipe),rf,JY=(rf=class extends N.Component{constructor(n){super(n);fe(this,"helmetData");this.helmetData=new VA(this.props.context||{},rf.canUseDOM)}render(){return Qe.createElement(YY.Provider,{value:this.helmetData.value},this.props.children)}},fe(rf,"canUseDOM",GY),rf),Fp=(t,e)=>{const n=document.head||document.querySelector("head"),r=n.querySelectorAll(`${t}[${dl}]`),i=[].slice.call(r),s=[];let a;return e&&e.length&&e.forEach(o=>{const l=document.createElement(t);for(const u in o)if(Object.prototype.hasOwnProperty.call(o,u))if(u==="innerHTML")l.innerHTML=o.innerHTML;else if(u==="cssText")l.styleSheet?l.styleSheet.cssText=o.cssText:l.appendChild(document.createTextNode(o.cssText));else{const f=u,p=typeof o[f]>"u"?"":o[f];l.setAttribute(u,p)}l.setAttribute(dl,"true"),i.some((u,f)=>(a=f,l.isEqualNode(u)))?i.splice(a,1):s.push(l)}
61),i.forEach(o=>{var l;return(l=o.parentNode)==null?void 0:l.removeChild(o)}),s.forEach(o=>n.appendChild(o)),{oldTags:i,newTags:s}},HA=(t,e)=>{const n=document.getElementsByTagName(t)[0];if(!n)return;const r=n.getAttribute(dl),i=r?r.split(","):[],s=[...i],a=Object.keys(e);for(const o of a){const l=e[o]||"";n.getAttribute(o)!==l&&n.setAttribute(o,l),i.indexOf(o)===-1&&i.push(o);const u=s.indexOf(o);u!==-1&&s.splice(u,1)}for(let o=s.length-1;o>=0;o-=1)n.removeAttribute(s[o]);i.length===s.length?n.removeAttribute(dl):n.getAttribute(dl)!==a.join(",")&&n.setAttribute(dl,a.join(","))},spe=(t,e)=>{typeof t<"u"&&document.title!==t&&(document.title=qY(t)),HA("title",e)},eU=(t,e)=>{const{baseTag:n,bodyAttributes:r,htmlAttributes:i,linkTags:s,metaTags:a,noscriptTags:o,onChangeClientState:l,scriptTags:u,styleTags:f,title:p,titleAttributes:y}=t;HA("body",r),HA("html",i),spe(p,y);const g={baseTag:Fp("base",n),linkTags:Fp("link",s),metaTags:Fp("meta",a),noscriptTags:Fp("noscript",o),scriptTags:Fp("script",u),styleTags:Fp("style",f)},b={},v={};Object.keys(g).forEach(_=>{const{newTags:C,oldTags:S}=g[_];C.length&&(b[_]=C),S.length&&(v[_]=g[_].oldTags)}),e&&e(),l(t,b,v)},by=null,ape=t=>{by&&cancelAnimationFrame(by),t.defer?by=requestAnimationFrame(()=>{eU(t,()=>{by=null})}):(eU(t),by=null)},ope=ape,tU=class extends N.Component{constructor(){super(...arguments);fe(this,"rendered",!1)}shouldComponentUpdate(e){return!Vfe(e,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:e}=this.props.context;e.remove(this),this.emitChange()}emitChange(){const{helmetInstances:e,setHelmet:n}=this.props.context;let r=null;const i=Yfe(e.get().map(s=>{const a={...s.props};return delete a.context,a}));JY.canUseDOM?ope(i):zA&&(r=zA(i)),n(r)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:e}=this.props.context;e.add(this),this.emitChange()}render(){return this.init(),null}},jA,tI=(jA=class extends N.Component{shouldComponentUpdate(t){return!Dfe(QD(this.props,"helmetData"),QD(t,"helmetData"))}mapNestedChildrenToProps(t,e){if(!e)return null;switch(t.type){case"script":case"noscript":return{innerHTML:e};case"style":return{cssText:e};default:throw new Error(`<${t.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(t,e,n,r){return{...e,[t.type]:[...e[t.type]||[],{...n,...this.mapNestedChildrenToProps(t,r)}]}}mapObjectTypeChildren(t,e,n,r){switch(t.type){case"title":return{...e,[t.type]:r,titleAttributes:{...n}};case"body":return{...e,bodyAttributes:{...n}};case"html":return{...e,htmlAttributes:{...n}};default:return{...e,[t.type]:{...n}}}}mapArrayTypeChildrenToProps(t,e){let n={...e};return Object.keys(t).forEach(r=>{n={...n,[r]:t[r]}}),n}warnOnInvalidChildren(t,e){return YD(XD.some(n=>t.type===n),typeof t.type=="function"?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${XD.join(", ")} are allowed. Helmet does not support rendering <${t.type}> elements. Refer to our API for more information.`),YD(!e||typeof e=="string"||Array.isArray(e)&&!e.some(n=>typeof n!="string"),`Helmet expects a string as a child of <${t.type}>. Did you forget to wrap your children in braces? ( <${t.type}>{\`\`}</${t.type}> ) Refer to our API for more information.`),!0}mapChildrenToProps(t,e){let n={};return Qe.Children.forEach(t,r=>{if(!r||!r.props)return;const{children:i,...s}=r.props,a=Object.keys(s).reduce((l,u)=>(l[Hfe[u]||u]=s[u],l),{});let{type:o}=r;
61switch(typeof o=="symbol"?o=o.toString():this.warnOnInvalidChildren(r,i),o){case"Symbol(react.fragment)":e=this.mapChildrenToProps(i,e);break;case"link":case"meta":case"noscript":case"script":case"style":n=this.flattenArrayTypeChildren(r,n,a,i);break;default:e=this.mapObjectTypeChildren(r,e,a,i);break}}),this.mapArrayTypeChildrenToProps(n,e)}render(){const{children:t,...e}=this.props;let n={...e},{helmetData:r}=e;if(t&&(n=this.mapChildrenToProps(t,n)),r&&!(r instanceof VA)){const i=r;r=new VA(i.context,!0),delete n.helmetData}return r?Qe.createElement(tU,{...n,context:r.value}):Qe.createElement(YY.Consumer,null,i=>Qe.createElement(tU,{...n,context:i}))}},fe(jA,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),jA);const XY=N.createContext(void 0);function lpe({children:t}){const[e,n]=N.useState(()=>localStorage.getItem("ui-theme")||"light");return N.useEffect(()=>{localStorage.setItem("ui-theme",e);const r=window.document.documentElement;e==="dark"?(r.classList.add("dark"),r.classList.remove("light")):(r.classList.add("light"),r.classList.remove("dark"))},[e]),h.jsx(XY.Provider,{value:{theme:e,setTheme:n},children:t})}function Imt(){const t=N.useContext(XY);if(t===void 0)throw new Error("useTheme must be used within a ThemeProvider");return t}var nU={};const Mt=t=>typeof t=="string",wy=()=>{let t,e;const n=new Promise((r,i)=>{t=r,e=i});return n.resolve=t,n.reject=e,n},rU=t=>t==null?"":""+t,cpe=(t,e,n)=>{t.forEach(r=>{e[r]&&(n[r]=e[r])})},upe=/###/g,iU=t=>t&&t.indexOf("###")>-1?t.replace(upe,"."):t,sU=t=>!t||Mt(t),Tg=(t,e,n)=>{const r=Mt(e)?e.split("."):e;let i=0;for(;i<r.length-1;){if(sU(t))return{};const s=iU(r[i]);!t[s]&&n&&(t[s]=new n),Object.prototype.hasOwnProperty.call(t,s)?t=t[s]:t={},++i}return sU(t)?{}:{obj:t,k:iU(r[i])}},aU=(t,e,n)=>{const{obj:r,k:i}=Tg(t,e,Object);if(r!==void 0||e.length===1){r[i]=n;return}let s=e[e.length-1],a=e.slice(0,e.length-1),o=Tg(t,a,Object);for(;o.obj===void 0&&a.length;)s=`${a[a.length-1]}.${s}`,a=a.slice(0,a.length-1),o=Tg(t,a,Object),o!=null&&o.obj&&typeof o.obj[`${o.k}.${s}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${s}`]=n},dpe=(t,e,n,r)=>{const{obj:i,k:s}=Tg(t,e,Object);i[s]=i[s]||[],i[s].push(n)},n8=(t,e)=>{const{obj:n,k:r}=Tg(t,e);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},hpe=(t,e,n)=>{const r=n8(t,n);return r!==void 0?r:n8(e,n)},QY=(t,e,n)=>{for(const r in e)r!=="__proto__"&&r!=="constructor"&&(r in t?Mt(t[r])||t[r]instanceof String||Mt(e[r])||e[r]instanceof String?n&&(t[r]=e[r]):QY(t[r],e[r],n):t[r]=e[r]);return t},hh=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var fpe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const ppe=t=>Mt(t)?t.replace(/[&<>"'\/]/g,e=>fpe[e]):t;class mpe{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const n=this.regExpMap.get(e);if(n!==void 0)return n;const r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}const ype=[" ",",","?","!",";"],gpe=new mpe(20),bpe=(t,e,n)=>{e=e||"",n=n||"";const r=ype.filter(a=>e.indexOf(a)<0&&n.indexOf(a)<0);if(r.length===0)return!0;const i=gpe.getRegExp(`(${r.map(a=>a==="?"?"\\?":a).join("|")})`);let s=!i.test(t);if(!s){const a=t.indexOf(n);a>0&&!i.test(t.substring(0,a))&&(s=!0)}return s},WA=(t,e,n=".")=>{if(!t)return;if(t[e])return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;const r=e.split(n);let i=t;for(let s=0;s<r.length;){if(!i||typeof i!="object")return;let a,o="";for(let l=s;l<r.length;++l)if(l!==s&&(o+=n),o+=r[l],a=i[o],a!==void 0){if(["string","number","boolean"].indexOf(typeof a)>-1&&l<r.length-1)continue;s+=l-s+1;break}i=a}return i},Xg=t=>t==null?void 0:t.replace(/_/g,"-"),wpe={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){var n,r;(r=(n=console==null?void 0:console[t])==null?void 0:n.apply)==null||r.call(n,console,e)}};class r8{constructor(e,n={}){this.init(e,n)}init(e,n={}){this.prefix=n.prefix||"i18next:",this.logger=e||wpe,this.options=n,this.debug=n.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,n,r,i){return i&&!this.debug?null:(Mt(e[0])&&(e[0]=`${r}${this.prefix} ${e[0]}`),this.logger[n](e))}create(e){return new r8(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new r8(this.logger,e)}}var Yl=new r8;let e7=class{constructor(){this.observers={}}on(e,n){return e.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const i=this.observers[r].get(n)||0;this.observers[r].set(n,i+1)}),this}
vendor: 3,417 bytes, line 61
61off(e,n){if(this.observers[e]){if(!n){delete this.observers[e];return}this.observers[e].delete(n)}}emit(e,...n){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([i,s])=>{for(let a=0;a<s;a++)i(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([i,s])=>{for(let a=0;a<s;a++)i.apply(i,[e,...n])})}};class oU extends e7{constructor(e,n={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}getResource(e,n,r,i={}){var u,f;const s=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,a=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;e.indexOf(".")>-1?o=e.split("."):(o=[e,n],r&&(Array.isArray(r)?o.push(...r):Mt(r)&&s?o.push(...r.split(s)):o.push(r)));const l=n8(this.data,o);return!l&&!n&&!r&&e.indexOf(".")>-1&&(e=o[0],n=o[1],r=o.slice(2).join(".")),l||!a||!Mt(r)?l:WA((f=(u=this.data)==null?void 0:u[e])==null?void 0:f[n],r,s)}addResource(e,n,r,i,s={silent:!1}){const a=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let o=[e,n];r&&(o=o.concat(a?r.split(a):r)),e.indexOf(".")>-1&&(o=e.split("."),i=n,n=o[1]),this.addNamespaces(n),aU(this.data,o,i),s.silent||this.emit("added",e,n,r,i)}addResources(e,n,r,i={silent:!1}){for(const s in r)(Mt(r[s])||Array.isArray(r[s]))&&this.addResource(e,n,s,r[s],{silent:!0});i.silent||this.emit("added",e,n,r)}addResourceBundle(e,n,r,i,s,a={silent:!1,skipCopy:!1}){let o=[e,n];e.indexOf(".")>-1&&(o=e.split("."),i=r,r=n,n=o[1]),this.addNamespaces(n);let l=n8(this.data,o)||{};a.skipCopy||(r=JSON.parse(JSON.stringify(r))),i?QY(l,r,s):l={...l,...r},aU(this.data,o,l),a.silent||this.emit("added",e,n,r)}removeResourceBundle(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}hasResourceBundle(e,n){return this.getResource(e,n)!==void 0}getResourceBundle(e,n){return n||(n=this.options.defaultNS),this.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var eJ={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,r,i){return t.forEach(s=>{var a;e=((a=this.processors[s])==null?void 0:a.process(e,n,r,i))??e}),e}};const tJ=Symbol("i18next/PATH_KEY");function vpe(){const t=[],e=Object.create(null);let n;return e.get=(r,i)=>{var s;return(s=n==null?void 0:n.revoke)==null||s.call(n),i===tJ?t:(t.push(i),n=Proxy.revocable(r,e),n.proxy)},Proxy.revocable(Object.create(null),e).proxy}function sf(t,e){const{[tJ]:n}=t(vpe()),r=(e==null?void 0:e.keySeparator)??".",i=(e==null?void 0:e.nsSeparator)??":";if(n.length>1&&i){const s=e==null?void 0:e.ns,a=Array.isArray(s)?s:null;if(a&&a.length>1&&a.slice(1).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}const lU={},uC=t=>!Mt(t)&&typeof t!="boolean"&&typeof t!="number";class i8 extends e7{constructor(e,n={}){super(),cpe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","
61i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Yl.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,n={interpolation:{}}){const r={...n};if(e==null)return!1;const i=this.resolve(e,r);if((i==null?void 0:i.res)===void 0)return!1;const s=uC(i.res);return!(r.returnObjects===!1&&s)}extractFromKey(e,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let s=n.ns||this.options.defaultNS||[];const a=r&&e.indexOf(r)>-1,o=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!bpe(e,r,i);if(a&&!o){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:Mt(s)?[s]:s};const u=e.split(r);(r!==i||r===i&&this.options.ns.indexOf(u[0])>-1)&&(s=u.shift()),e=u.join(i)}return{key:e,namespaces:Mt(s)?[s]:s}}translate(e,n,r){let i=typeof n=="object"?{...n}:n;if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i=="object"&&(i={...i}),i||(i={}),e==null)return"";typeof e=="function"&&(e=sf(e,{...this.options,...i})),Array.isArray(e)||(e=[String(e)]),e=e.map(R=>typeof R=="function"?sf(R,{...this.options,...i}):String(R));const s=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,a=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:o,namespaces:l}=this.extractFromKey(e[e.length-1],i),u=l[l.length-1];let f=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;f===void 0&&(f=":");const p=i.lng||this.language,y=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((p==null?void 0:p.toLowerCase())==="cimode")return y?s?{res:`${u}${f}${o}`,usedKey:o,exactUsedKey:o,usedLng:p,usedNS:u,usedParams:this.getUsedParamsDetails(i)}:`${u}${f}${o}`:s?{res:o,usedKey:o,exactUsedKey:o,usedLng:p,usedNS:u,usedParams:this.getUsedParamsDetails(i)}:o;const g=this.resolve(e,i);let b=g==null?void 0:g.res;const v=(g==null?void 0:g.usedKey)||o,_=(g==null?void 0:g.exactUsedKey)||o,C=["[object Number]","[object Function]","[object RegExp]"],S=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,A=i.count!==void 0&&!Mt(i.count),I=i8.hasDefaultValue(i),$=A?this.pluralResolver.getSuffix(p,i.count,i):"",O=i.ordinal&&A?this.pluralResolver.getSuffix(p,i.count,{ordinal:!1}):"",P=A&&!i.ordinal&&i.count===0,j=P&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${$}`]||i[`defaultValue${O}`]||i.defaultValue;let U=b;x&&!b&&I&&(U=j);const z=uC(U),D=Object.prototype.toString.apply(U);if(x&&U&&z&&C.indexOf(D)<0&&!(Mt(S)&&Array.isArray(U))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const R=this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,U,{...i,ns:l}):`key '${o} (${this.language})' returned an object instead of string.`;return s?(g.res=R,g.usedParams=this.getUsedParamsDetails(i),g):R}if(a){const R=Array.isArray(U),W=R?[]:{},T=R?_:v;for(const L in U)if(Object.prototype.hasOwnProperty.call(U,L)){const M=`${T}${a}${L}`;I&&!b?W[L]=this.translate(M,{...i,defaultValue:uC(j)?j[L]:void 0,joinArrays:!1,ns:l}):W[L]=this.translate(M,{...i,joinArrays:!1,ns:l}),W[L]===M&&(W[L]=U[L])}b=W}}else if(x&&Mt(S)&&Array.isArray(b))b=b.join(S),b&&(b=this.extendTranslation(b,e,i,r));else{let R=!1,W=!1;!this.isValidLookup(b)&&I&&(R=!0,b=j),this.isValidLookup(b)||(W=!0,b=o);const L=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&W?void 0:b,M=I&&j!==b&&this.options.updateMissing;if(W||R||M){if(this.logger.log(M?"updateKey":"missingKey",p,u,o,M?j:b),a){const F=this.resolve(o,{...i,keySeparator:!1});F&&F.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let Z=[];const H=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&H&&H[0])for(let F=0;F<H.length;F++)Z.push(H[F]);else this.options.saveMissingTo==="all"?Z=this.languageUtils.toResolveHierarchy(i.lng||this.language):Z.push(i.lng||this.language);const V=(F,q,G)=>{var X;const Y=I&&G!==b?G:L;this.options.missingKeyHandler?this.options.missingKeyHandler(F,u,q,Y,M,i):(X=this.backendConnector)!=null&&X.saveMissing&&this.backendConnector.saveMissing(F,u,q,Y,M,i),this.emit
vendor: 4,315 bytes, line 61
61("missingKey",F,u,q,b)};this.options.saveMissing&&(this.options.saveMissingPlurals&&A?Z.forEach(F=>{const q=this.pluralResolver.getSuffixes(F,i);P&&i[`defaultValue${this.options.pluralSeparator}zero`]&&q.indexOf(`${this.options.pluralSeparator}zero`)<0&&q.push(`${this.options.pluralSeparator}zero`),q.forEach(G=>{V([F],o+G,i[`defaultValue${G}`]||j)})}):V(Z,o,j))}b=this.extendTranslation(b,e,i,g,r),W&&b===o&&this.options.appendNamespaceToMissingKey&&(b=`${u}${f}${o}`),(W||R)&&this.options.parseMissingKeyHandler&&(b=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${f}${o}`:o,R?b:void 0,i))}return s?(g.res=b,g.usedParams=this.getUsedParamsDetails(i),g):b}extendTranslation(e,n,r,i,s){var l,u;if((l=this.i18nFormat)!=null&&l.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const f=Mt(e)&&(((u=r==null?void 0:r.interpolation)==null?void 0:u.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let p;if(f){const g=e.match(this.interpolator.nestingRegexp);p=g&&g.length}let y=r.replace&&!Mt(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(y={...this.options.interpolation.defaultVariables,...y}),e=this.interpolator.interpolate(e,y,r.lng||this.language||i.usedLng,r),f){const g=e.match(this.interpolator.nestingRegexp),b=g&&g.length;p<b&&(r.nest=!1)}!r.lng&&i&&i.res&&(r.lng=this.language||i.usedLng),r.nest!==!1&&(e=this.interpolator.nest(e,(...g)=>(s==null?void 0:s[0])===g[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${g[0]} in key: ${n[0]}`),null):this.translate(...g,n),r)),r.interpolation&&this.interpolator.reset()}const a=r.postProcess||this.options.postProcess,o=Mt(a)?[a]:a;return e!=null&&(o!=null&&o.length)&&r.applyPostProcessor!==!1&&(e=eJ.handle(o,e,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),e}resolve(e,n={}){let r,i,s,a,o;return Mt(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(l=>typeof l=="function"?sf(l,{...this.options,...n}):l)),e.forEach(l=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(l,n),f=u.key;i=f;let p=u.namespaces;this.options.fallbackNS&&(p=p.concat(this.options.fallbackNS));const y=n.count!==void 0&&!Mt(n.count),g=y&&!n.ordinal&&n.count===0,b=n.context!==void 0&&(Mt(n.context)||typeof n.context=="number")&&n.context!=="",v=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);p.forEach(_=>{var C,S;this.isValidLookup(r)||(o=_,!lU[`${v[0]}-${_}`]&&((C=this.utils)!=null&&C.hasLoadedNamespace)&&!((S=this.utils)!=null&&S.hasLoadedNamespace(o))&&(lU[`${v[0]}-${_}`]=!0,this.logger.warn(`key "${i}" for languages "${v.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),v.forEach(x=>{var $;if(this.isValidLookup(r))return;a=x;const A=[f];if(($=this.i18nFormat)!=null&&$.addLookupKeys)this.i18nFormat.addLookupKeys(A,f,x,_,n);else{let O;y&&(O=this.pluralResolver.getSuffix(x,n.count,n));const P=`${this.options.pluralSeparator}zero`,j=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(y&&(n.ordinal&&O.indexOf(j)===0&&A.push(f+O.replace(j,this.options.pluralSeparator)),A.push(f+O),g&&A.push(f+P)),b){const U=`${f}${this.options.contextSeparator||"_"}${n.context}`;A.push(U),y&&(n.ordinal&&O.indexOf(j)===0&&A.push(U+O.replace(j,this.options.pluralSeparator)),A.push(U+O),g&&A.push(U+P))}}let I;for(;I=A.pop();)this.isValidLookup(r)||(s=I,r=this.getResource(x,_,I,n))}))})}),{res:r,usedKey:i,exactUsedKey:s,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,r,i={}){var s;return(s=this.i18nFormat)!=null&&s.getResource?this.i18nFormat.getResource(e,n,r,i):this.resourceStore.getResource(e,n,r,i)}
vendor: 23,941 bytes, line 61
61getUsedParamsDetails(e={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=e.replace&&!Mt(e.replace);let i=r?e.replace:e;if(r&&typeof e.count<"u"&&(i.count=e.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(const s of n)delete i[s]}return i}static hasDefaultValue(e){const n="defaultValue";for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&n===r.substring(0,n.length)&&e[r]!==void 0)return!0;return!1}}class cU{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Yl.create("languageUtils")}getScriptPartFromCode(e){if(e=Xg(e),!e||e.indexOf("-")<0)return null;const n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(e){if(e=Xg(e),!e||e.indexOf("-")<0)return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(Mt(e)&&e.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(e)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let n;return e.forEach(r=>{if(n)return;const i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&e.forEach(r=>{if(n)return;const i=this.getScriptPartFromCode(r);if(this.isSupportedCode(i))return n=i;const s=this.getLanguagePartFromCode(r);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(a=>{if(a===s)return a;if(!(a.indexOf("-")<0&&s.indexOf("-")<0)&&(a.indexOf("-")>0&&s.indexOf("-")<0&&a.substring(0,a.indexOf("-"))===s||a.indexOf(s)===0&&s.length>1))return a})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),Mt(e)&&(e=[e]),Array.isArray(e))return e;if(!n)return e.default||[];let r=e[n];return r||(r=e[this.getScriptPartFromCode(n)]),r||(r=e[this.formatLanguageCode(n)]),r||(r=e[this.getLanguagePartFromCode(n)]),r||(r=e.default),r||[]}toResolveHierarchy(e,n){const r=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],e),i=[],s=a=>{a&&(this.isSupportedCode(a)?i.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return Mt(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(e))):Mt(e)&&s(this.formatLanguageCode(e)),r.forEach(a=>{i.indexOf(a)<0&&s(this.formatLanguageCode(a))}),i}}const uU={zero:0,one:1,two:2,few:3,many:4,other:5},dU={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class _pe{constructor(e,n={}){this.languageUtils=e,this.options=n,this.logger=Yl.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,n={}){const r=Xg(e==="dev"?"en":e),i=n.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:r,type:i});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];let a;try{a=new Intl.PluralRules(r,{type:i})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),dU;if(!e.match(/-|_/))return dU;const l=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(l,n)}return this.pluralRulesCache[s]=a,a}needsPlural(e,n={}){let r=this.getRule(e,n);return r||(r=this.getRule("dev",n)),(r==null?void 0:r.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,n,r={}){return this.getSuffixes(e,r).map(i=>`${n}${i}`)}getSuffixes(e,n={}){let r=this.getRule(e,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((i,s)=>uU[i]-uU[s]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(e,n,r={}){const i=this.getRule(e,r);return i?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",n,r))}}const hU=(t,e,n,r=".",i=!0)=>{let s=hpe(t,e,n);return!s&&i&&Mt(n)&&(s=WA(t,n,r),s===void 0&&(s=WA(e,n,r))),s},dC=t=>t.replace(/\$/g,"$$$$");class fU{constructor(e={}){var n;this.logger=Yl.create("interpolator"),this.options=e,this.format=((n=e==null?void 0:e.interpolation)==null?void 0:n.format)||(r=>r),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:i,prefix:s,prefixEscaped:a,suffix:o,suffixEscaped:l,formatSeparator:u,unescapeSuffix:f,unescapePrefix:p,nestingPrefix:y,nestingPrefixEscaped:g,nestingSuffix:b,nestingSuffixEscaped:v,nestingOptionsSeparator:_,maxReplaces:C,alwaysFormat:S}=e.interpolation;this.escape=n!==void 0?n:ppe,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=s?hh(s):a||"{{",this.suffix=o?hh(o):l||"}}",this.formatSeparator=u||",",this.unescapePrefix=f?"":p||"-",this.unescapeSuffix=this.unescapePrefix?"":f||"",this.nestingPrefix=y?hh(y):g||hh("$t("),this.nestingSuffix=b?hh(b):v||hh(")"),this.nestingOptionsSeparator=_||",",this.maxReplaces=C||1e3,this.alwaysFormat=S!==void 0?S:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,r)=>(n==null?void 0:n.source)===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,n,r,i){var g;let s,a,o;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=b=>{if(b.indexOf(this.formatSeparator)<0){const S=hU(n,l,b,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(S,void 0,r,{...i,...n,interpolationkey:b}):S}const v=b.split(this.formatSeparator),_=v.shift().trim(),C=v.join(this.formatSeparator).trim();return this.format(hU(n,l,_,this.options.keySeparator,this.options.ignoreJSONStructure),C,r,{...i,...n,interpolationkey:_})};this.resetRegExp();const f=(i==null?void 0:i.missingInterpolationHandler)||this.options.missingInterpolationHandler,p=((g=i==null?void 0:i.interpolation)==null?void 0:g.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:b=>dC(b)},{regex:this.regexp,safeValue:b=>this.escapeValue?dC(this.escape(b)):dC(b)}].forEach(b=>{for(o=0;s=b.regex.exec(e);){const v=s[1].trim();if(a=u(v),a===void 0)if(typeof f=="function"){const C=f(e,s,i);a=Mt(C)?C:""}else if(i&&Object.prototype.hasOwnProperty.call(i,v))a="";else if(p){a=s[0];continue}else this.logger.warn(`missed to pass in variable ${v} for interpolating ${e}`),a="";else!Mt(a)&&!this.useRawValueToEscape&&(a=rU(a));const _=b.safeValue(a);if(e=e.replace(s[0],_),p?(b.regex.lastIndex+=a.length,b.regex.lastIndex-=s[0].length):b.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,n,r={}){let i,s,a;const o=(l,u)=>{const f=this.nestingOptionsSeparator;if(l.indexOf(f)<0)return l;const p=l.split(new RegExp(`${hh(f)}[ ]*{`));let y=`{${p[1]}`;l=p[0],y=this.interpolate(y,a);const g=y.match(/'/g),b=y.match(/"/g);(((g==null?void 0:g.length)??0)%2===0&&!b||((b==null?void 0:b.length)??0)%2!==0)&&(y=y.replace(/'/g,'"'));try{a=JSON.parse(y),u&&(a={...u,...a})}catch(v){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,v),`${l}${f}${y}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,l};for(;i=this.nestingRegexp.exec(e);){let l=[];a={...r},a=a.replace&&!Mt(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;const u=/{.*}/.test(i[1])?i[1].lastIndexOf("}")+1:i[1].indexOf(this.formatSeparator);if(u!==-1&&(l=i[1].slice(u).split(this.formatSeparator).map(f=>f.trim()).filter(Boolean),i[1]=i[1].slice(0,u)),s=n(o.call(this,i[1].trim(),a),a),s&&i[0]===e&&!Mt(s))return s;Mt(s)||(s=rU(s)),s||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),s=""),l.length&&(s=l.reduce((f,p)=>this.format(f,p,r.lng,{...r,interpolationkey:i[1].trim()}),s.trim())),e=e.replace(i[0],s),this.regexp.lastIndex=0}return e}}const xpe=t=>{let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const r=t.split("(");e=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);e==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):e==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(a=>{if(a){const[o,...l]=a.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,""),f=o.trim();n[f]||(n[f]=u),u==="false"&&(n[f]=!1),u==="true"&&(n[f]=!0),isNaN(u)||(n[f]=parseInt(u,10))}})}return{formatName:e,formatOptions:n}},pU=t=>{const e={};return(n,r,i)=>{let s=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(s={...s,[i.interpolationkey]:void 0});const a=r+JSON.stringify(s);let o=e[a];return o||(o=t(Xg(r),i),e[a]=o),o(n)}},Cpe=t=>(e,n,r)=>t(Xg(n),r)(e);class Epe{constructor(e={}){this.logger=Yl.create("formatter"),this.options=e,this.init(e)}init(e,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const r=n.cacheInBuiltFormats?pU:Cpe;this.formats={number:r((i,s)=>{const a=new Intl.NumberFormat(i,{...s});return o=>a.format(o)}),currency:r((i,s)=>{const a=new Intl.NumberFormat(i,{...s,style:"currency"});return o=>a.format(o)}),datetime:r((i,s)=>{const a=new Intl.DateTimeFormat(i,{...s});return o=>a.format(o)}),relativetime:r((i,s)=>{const a=new Intl.RelativeTimeFormat(i,{...s});return o=>a.format(o,s.range||"day")}),list:r((i,s)=>{const a=new Intl.ListFormat(i,{...s});return o=>a.format(o)})}}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=pU(n)}format(e,n,r,i={}){const s=n.split(this.formatSeparator);if(s.length>1&&s[0].indexOf("(")>1&&s[0].indexOf(")")<0&&s.find(o=>o.indexOf(")")>-1)){const o=s.findIndex(l=>l.indexOf(")")>-1);s[0]=[s[0],...s.splice(1,o)].join(this.formatSeparator)}return s.reduce((o,l)=>{var p;const{formatName:u,formatOptions:f}=xpe(l);if(this.formats[u]){let y=o;try{const g=((p=i==null?void 0:i.formatParams)==null?void 0:p[i.interpolationkey])||{},b=g.locale||g.lng||i.locale||i.lng||r;y=this.formats[u](o,b,{...f,...i,...g})}catch(g){this.logger.warn(g)}return y}else this.logger.warn(`there was no format function for ${u}`);return o},e)}}const Spe=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class Ape extends e7{constructor(e,n,r,i={}){var s,a;super(),this.backend=e,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=Yl.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],(a=(s=this.backend)==null?void 0:s.init)==null||a.call(s,r,i.backend,i)}queueLoad(e,n,r,i){const s={},a={},o={},l={};return e.forEach(u=>{let f=!0;n.forEach(p=>{const y=`${u}|${p}`;!r.reload&&this.store.hasResourceBundle(u,p)?this.state[y]=2:this.state[y]<0||(this.state[y]===1?a[y]===void 0&&(a[y]=!0):(this.state[y]=1,f=!1,a[y]===void 0&&(a[y]=!0),s[y]===void 0&&(s[y]=!0),l[p]===void 0&&(l[p]=!0)))}),f||(o[u]=!0)}),(Object.keys(s).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(s),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(l)}}loaded(e,n,r){const i=e.split("|"),s=i[0],a=i[1];n&&this.emit("failedLoading",s,a,n),!n&&r&&this.store.addResourceBundle(s,a,r,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2,n&&r&&(this.state[e]=0);const o={};this.queue.forEach(l=>{dpe(l.loaded,[s],a),Spe(l,e),n&&l.errors.push(n),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{o[u]||(o[u]={});const f=l.loaded[u];f.length&&f.forEach(p=>{o[u][p]===void 0&&(o[u][p]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(l=>!l.done)}read(e,n,r,i=0,s=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:r,tried:i,wait:s,callback:a});return}this.readingCalls++;const o=(u,f)=>{if(this.readingCalls--,this.waitingReads.length>0){const p=this.waitingReads.shift();this.read(p.lng,p.ns,p.fcName,p.tried,p.wait,p.callback)}if(u&&f&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,e,n,r,i+1,s*2,a)},s);return}a(u,f)},l=this.backend[r].bind(this.backend);if(l.length===2){try{const u=l(e,n);u&&typeof u.then=="function"?u.then(f=>o(null,f)).catch(o):o(null,u)}catch(u){o(u)}return}return l(e,n,o)}prepareLoading(e,n,r={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();Mt(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Mt(n)&&(n=[n]);const s=this.queueLoad(e,n,r,i);if(!s.toLoad.length)return s.pending.length||i(),null;s.toLoad.forEach(a=>{this.loadOne(a)})}load(e,n,r){this.prepareLoading(e,n,{},r)}reload(e,n,r){this.prepareLoading(e,n,{reload:!0},r)}loadOne(e,n=""){const r=e.split("|"),i=r[0],s=r[1];this.read(i,s,"read",void 0,void 0,(a,o)=>{a&&this.logger.warn(`${n}loading namespace ${s} for language ${i} failed`,a),!a&&o&&this.logger.log(`${n}loaded namespace ${s} for language ${i}`,o),this.loaded(e,a,o)})}saveMissing(e,n,r,i,s,a={},o=()=>{}){var l,u,f,p,y;if((u=(l=this.services)==null?void 0:l.utils)!=null&&u.hasLoadedNamespace&&!((p=(f=this.services)==null?void 0:f.utils)!=null&&p.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if((y=this.backend)!=null&&y.create){const g={...a,isUpdate:s},b=this.backend.create.bind(this.backend);if(b.length<6)try{let v;b.length===5?v=b(e,n,r,i,g):v=b(e,n,r,i),v&&typeof v.then=="function"?v.then(_=>o(null,_)).catch(o):o(null,v)}catch(v){o(v)}else b(e,n,r,i,o,g)}!e||!e[0]||this.store.addResource(e[0],n,r,i)}}}const hC=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),Mt(t[1])&&(e.defaultValue=t[1]),Mt(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(r=>{e[r]=n[r]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),mU=t=>{var e,n;return Mt(t.ns)&&(t.ns=[t.ns]),Mt(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),Mt(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),((n=(e=t.supportedLngs)==null?void 0:e.indexOf)==null?void 0:n.call(e,"cimode"))<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),typeof t.initImmediate=="boolean"&&(t.initAsync=t.initImmediate),t},Qb=()=>{},kpe=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})},nJ="__i18next_supportNoticeShown",Tpe=()=>!!(typeof globalThis<"u"&&globalThis[nJ]||typeof process<"u"&&nU&&nU.I18NEXT_NO_SUPPORT_NOTICE),Lpe=()=>{typeof globalThis<"u"&&(globalThis[nJ]=!0)},$pe=t=>{var e,n,r,i,s,a,o,l,u,f,p,y,g;return!!(((r=(n=(e=t==null?void 0:t.modules)==null?void 0:e.backend)==null?void 0:n.name)==null?void 0:r.indexOf("Locize"))>0||((o=(a=(s=(i=t==null?void 0:t.modules)==null?void 0:i.backend)==null?void 0:s.constructor)==null?void 0:a.name)==null?void 0:o.indexOf("Locize"))>0||(u=(l=t==null?void 0:t.options)==null?void 0:l.backend)!=null&&u.backends&&t.options.backend.backends.some(b=>{var v,_,C;return((v=b==null?void 0:b.name)==null?void 0:v.indexOf("Locize"))>0||((C=(_=b==null?void 0:b.constructor)==null?void 0:_.name)==null?void 0:C.indexOf("Locize"))>0})||(p=(f=t==null?void 0:t.options)==null?void 0:f.backend)!=null&&p.projectId||(g=(y=t==null?void 0:t.options)==null?void 0:y.backend)!=null&&g.backendOptions&&t.options.backend.backendOptions.some(b=>b==null?void 0:b.projectId))};class Lg extends e7{constructor(e={},n){if(super(),this.options=mU(e),this.services={},this.logger=Yl,this.modules={external:[]},kpe(this),n&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,n),this;setTimeout(()=>{this.init(e,n)},0)}}init(e={},n){this.isInitializing=!0,typeof e=="function"&&(n=e,e={}),e.defaultNS==null&&e.ns&&(Mt(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const r=hC();this.options={...r,...this.options,...mU(e)},this.options.interpolation={...r.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=r.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!$pe(this)&&!Tpe()&&(typeof console<"u"&&typeof console.info<"u"&&console.info("ð i18next is made possible by our own product, Locize â consider powering your project with managed localization (AI, CDN, integrations): https://locize.com ð"),Lpe());const i=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?Yl.init(i(this.modules.logger),this.options):Yl.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=Epe;const f=new cU(this.options);this.store=new oU(this.options.resources,this.options);const p=this.services;p.logger=Yl,p.resourceStore=this.store,p.languageUtils=f,p.pluralResolver=new _pe(f,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),u&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(p.formatter=i(u),p.formatter.init&&p.formatter.init(p,this.options),this.options.interpolation.format=p.formatter.format.bind(p.formatter)),p.interpolator=new fU(this.options),p.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},p.backendConnector=new Ape(i(this.modules.backend),p.resourceStore,p,this.options),p.backendConnector.on("*",(g,...b)=>{this.emit(g,...b)}),this.modules.languageDetector&&(p.languageDetector=i(this.modules.languageDetector),p.languageDetector.init&&p.languageDetector.init(p,this.options.detection,this.options)),this.modules.i18nFormat&&(p.i18nFormat=i(this.modules.i18nFormat),p.i18nFormat.init&&p.i18nFormat.init(this)),this.translator=new i8(this.services,this.options),this.translator.on("*",(g,...b)=>{this.emit(g,...b)}),this.modules.external.forEach(g=>{g.init&&g.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Qb),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=(...f)=>this.store[u](...f)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...f)=>(this.store[u](...f),this)});const o=wy(),l=()=>{const u=(f,p)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(p),n(f,p)};if(this.languages&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),o}loadResources(e,n=Qb){var s,a;let r=n;const i=Mt(e)?e:this.language;if(typeof e=="function"&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if((i==null?void 0:i.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const o=[],l=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(p=>{p!=="cimode"&&o.indexOf(p)<0&&o.push(p)})};i?l(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(f=>l(f)),(a=(s=this.options.preload)==null?void 0:s.forEach)==null||a.call(s,u=>l(u)),this.services.backendConnector.load(o,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(u)})}else r(null)}reloadResources(e,n,r){const i=wy();return typeof e=="function"&&(r=e,e=void 0),typeof n=="function"&&(r=n,n=void 0),e||(e=this.languages),n||(n=this.options.ns),r||(r=Qb),this.services.backendConnector.reload(e,n,s=>{i.resolve(),r(s)}),i}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&eJ.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1)){for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,n){this.isLanguageChangingTo=e;const r=wy();
vendor: 6,801 bytes, line 61
61this.emit("languageChanging",e);const i=o=>{this.language=o,this.languages=this.services.languageUtils.toResolveHierarchy(o),this.resolvedLanguage=void 0,this.setResolvedLanguage(o)},s=(o,l)=>{l?this.isLanguageChangingTo===e&&(i(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,r.resolve((...u)=>this.t(...u)),n&&n(o,(...u)=>this.t(...u))},a=o=>{var f,p;!e&&!o&&this.services.languageDetector&&(o=[]);const l=Mt(o)?o:o&&o[0],u=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(Mt(o)?[o]:o);u&&(this.language||i(u),this.translator.language||this.translator.changeLanguage(u),(p=(f=this.services.languageDetector)==null?void 0:f.cacheUserLanguage)==null||p.call(f,u)),this.loadResources(u,y=>{s(y,u)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),r}getFixedT(e,n,r){const i=(s,a,...o)=>{let l;typeof a!="object"?l=this.options.overloadTranslationOptionHandler([s,a].concat(o)):l={...a},l.lng=l.lng||i.lng,l.lngs=l.lngs||i.lngs,l.ns=l.ns||i.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||r||i.keyPrefix);const u={...this.options,...l};typeof l.keyPrefix=="function"&&(l.keyPrefix=sf(l.keyPrefix,u));const f=this.options.keySeparator||".";let p;return l.keyPrefix&&Array.isArray(s)?p=s.map(y=>(typeof y=="function"&&(y=sf(y,u)),`${l.keyPrefix}${f}${y}`)):(typeof s=="function"&&(s=sf(s,u)),p=l.keyPrefix?`${l.keyPrefix}${f}${s}`:s),this.t(p,l)};return Mt(e)?i.lng=e:i.lngs=e,i.ns=n,i.keyPrefix=r,i}t(...e){var n;return(n=this.translator)==null?void 0:n.translate(...e)}exists(...e){var n;return(n=this.translator)==null?void 0:n.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,s=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const a=(o,l)=>{const u=this.services.backendConnector.state[`${o}|${l}`];return u===-1||u===0||u===2};if(n.precheck){const o=n.precheck(this,a);if(o!==void 0)return o}return!!(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(r,e)&&(!i||a(s,e)))}loadNamespaces(e,n){const r=wy();return this.options.ns?(Mt(e)&&(e=[e]),e.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}loadLanguages(e,n){const r=wy();Mt(e)&&(e=[e]);const i=this.options.preload||[],s=e.filter(a=>i.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return s.length?(this.options.preload=i.concat(s),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}dir(e){var i,s;if(e||(e=this.resolvedLanguage||(((i=this.languages)==null?void 0:i.length)>0?this.languages[0]:this.language)),!e)return"rtl";try{const a=new Intl.Locale(e);if(a&&a.getTextInfo){const o=a.getTextInfo();if(o&&o.direction)return o.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=((s=this.services)==null?void 0:s.languageUtils)||new cU(hC());return e.toLowerCase().indexOf("-latn")>1?"ltr":n.indexOf(r.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},n){const r=new Lg(e,n);return r.createInstance=Lg.createInstance,r}cloneInstance(e={},n=Qb){const r=e.forkResourceStore;r&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},s=new Lg(i);if((e.debug!==void 0||e.prefix!==void 0)&&(s.logger=s.logger.clone(e)),["store","services","language"].forEach(o=>{s[o]=this[o]}),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},r){const o=Object.keys(this.store.data).reduce((l,u)=>(l[u]={...this.store.data[u]},l[u]=Object.keys(l[u]).reduce((f,p)=>(f[p]={...l[u][p]},f),l[u]),l),{});s.store=new oU(o,i),s.services.resourceStore=s.store}if(e.interpolation){const l={...hC().interpolation,...this.options.interpolation,...e.interpolation},u={...i,interpolation:l};s.services.interpolator=new fU(u)}return s.translator=new i8(s.services,i),s.translator.on("*",(o,...l)=>{s.emit(o,...l)}),s.init(i,n),s.translator.options=i,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const ks=Lg.createInstance();ks.createInstance;ks.dir;ks.init;ks.loadResources;ks.reloadResources;ks.use;ks.changeLanguage;ks.getFixedT;ks.t;ks.exists;ks.setDefaultNamespace;ks.hasLoadedNamespace;ks.loadNamespaces;ks.loadLanguages;var fC,yU;function Ipe(){return yU||(yU=1,fC={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}),fC}var Npe=Ipe();const Ope=Wa(Npe);var Ppe=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function gU(t){var e={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=t.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(e.name=n[1],(Ope[n[1]]||t.charAt(t.length-2)==="/")&&(e.voidElement=!0),e.name.startsWith("!--"))){var r=t.indexOf("-->");return{type:"comment",comment:r!==-1?t.slice(4,r):""}}for(var i=new RegExp(Ppe),s=null;(s=i.exec(t))!==null;)if(s[0].trim())if(s[1]){var a=s[1].trim(),o=[a,""];a.indexOf("=")>-1&&(o=a.split("=")),e.attrs[o[0]]=o[1],i.lastIndex--}else s[2]&&(e.attrs[s[2]]=s[3].trim().substring(1,s[3].length-1));return e}var Rpe=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,jpe=/^\s*$/,Mpe=Object.create(null);function rJ(t,e){switch(e.type){case"text":return t+e.content;case"tag":return t+="<"+e.name+(e.attrs?(function(n){var r=[];for(var i in n)r.push(i+'="'+n[i]+'"');return r.length?" "+r.join(" "):""})(e.attrs):"")+(e.voidElement?"/>":">"),e.voidElement?t:t+e.children.reduce(rJ,"")+"</"+e.name+">";
vendor: 4,248 bytes, line 61
61case"comment":return t+"<!--"+e.comment+"-->"}}var Dpe={parse:function(t,e){e||(e={}),e.components||(e.components=Mpe);var n,r=[],i=[],s=-1,a=!1;if(t.indexOf("<")!==0){var o=t.indexOf("<");r.push({type:"text",content:o===-1?t:t.substring(0,o)})}return t.replace(Rpe,function(l,u){if(a){if(l!=="</"+n.name+">")return;a=!1}var f,p=l.charAt(1)!=="/",y=l.startsWith("<!--"),g=u+l.length,b=t.charAt(g);if(y){var v=gU(l);return s<0?(r.push(v),r):((f=i[s]).children.push(v),r)}if(p&&(s++,(n=gU(l)).type==="tag"&&e.components[n.name]&&(n.type="component",a=!0),n.voidElement||a||!b||b==="<"||n.children.push({type:"text",content:t.slice(g,t.indexOf("<",g))}),s===0&&r.push(n),(f=i[s-1])&&f.children.push(n),i[s]=n),(!p||n.voidElement)&&(s>-1&&(n.voidElement||n.name===l.slice(2,-1))&&(s--,n=s===-1?r:i[s]),!a&&b!=="<"&&b)){f=s===-1?r:i[s].children;var _=t.indexOf("<",g),C=t.slice(g,_===-1?void 0:_);jpe.test(C)&&(C=" "),(_>-1&&s+f.length>=0||C!==" ")&&f.push({type:"text",content:C})}}),r},stringify:function(t){return t.reduce(function(e,n){return e+rJ("",n)},"")}};const _w=(t,e,n,r)=>{var s,a,o,l;const i=[n,{code:e,...r||{}}];if((a=(s=t==null?void 0:t.services)==null?void 0:s.logger)!=null&&a.forward)return t.services.logger.forward(i,"warn","react-i18next::",!0);oa(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),(l=(o=t==null?void 0:t.services)==null?void 0:o.logger)!=null&&l.warn?t.services.logger.warn(...i):console!=null&&console.warn&&console.warn(...i)},bU={},Qg=(t,e,n,r)=>{oa(n)&&bU[n]||(oa(n)&&(bU[n]=new Date),_w(t,e,n,r))},iJ=(t,e)=>()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}},qA=(t,e,n)=>{t.loadNamespaces(e,iJ(t,n))},wU=(t,e,n,r)=>{if(oa(n)&&(n=[n]),t.options.preload&&t.options.preload.indexOf(e)>-1)return qA(t,n,r);n.forEach(i=>{t.options.ns.indexOf(i)<0&&t.options.ns.push(i)}),t.loadLanguages(e,iJ(t,r))},Upe=(t,e,n={})=>!e.languages||!e.languages.length?(Qg(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(t,{lng:n.lng,precheck:(r,i)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!i(r.isLanguageChangingTo,t))return!1}}),oa=t=>typeof t=="string",gu=t=>typeof t=="object"&&t!==null,Bpe=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Fpe={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"â¦","…":"â¦","/":"/","/":"/"},zpe=t=>Fpe[t],sJ=t=>t.replace(Bpe,zpe);let ZA={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:sJ,transDefaultProps:void 0};const Vpe=(t={})=>{ZA={...ZA,...t}},nI=()=>ZA;let aJ;const Hpe=t=>{aJ=t},rI=()=>aJ,xw=(t,e)=>{var r;if(!t)return!1;const n=((r=t.props)==null?void 0:r.children)??t.children;return e?n.length>0:!!n},Cw=t=>{var n,r;if(!t)return[];const e=((n=t.props)==null?void 0:n.children)??t.children;return(r=t.props)!=null&&r.i18nIsDynamicList?Vh(e):e},Wpe=t=>Array.isArray(t)&&t.every(N.isValidElement),Vh=t=>Array.isArray(t)?t:[t],qpe=(t,e)=>{const n={...e};return n.props={...e.props,...t.props},n},Zpe=t=>{const e={};if(!t)return e;const n=r=>{Vh(r).forEach(s=>{oa(s)||(xw(s)?n(Cw(s)):gu(s)&&!N.isValidElement(s)&&Object.assign(e,s))})};return n(t),e},oJ=(t,e,n,r)=>{if(!t)return"";let i="";const s=Vh(t),a=e!=null&&e.transSupportBasicHtmlNodes?e.transKeepBasicHtmlNodesFor??[]:[];return s.forEach((o,l)=>{if(oa(o)){i+=`${o}`;return}if(N.isValidElement(o)){const{props:u,type:f}=o,p=Object.keys(u).length,y=a.indexOf(f)>-1,g=u.children;if(!g&&y&&!p){i+=`<${f}/>`;return}if(!g&&(!y||p)||u.i18nIsDynamicList){i+=`<${l}></${l}>`;return}if(y&&p===1&&oa(g)){i+=`<${f}>${g}</${f}>`;return}const b=oJ(g,e,n,r);i+=`<${l}>${b}</${l}>`;return}if(o===null){_w(n,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:r});return}if(gu(o)){const{format:u,...f}=o,p=Object.keys(f);if(p.length===1){const y=u?`${p[0]}, ${u}
61`:p[0];i+=`{{${y}}}`;return}_w(n,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:r,child:o});return}_w(n,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:r,child:o})}),i},Kpe=(t,e=[],n={})=>{if(!t)return t;const r=Object.keys(n),i=[...e,...r];let s="",a=0;for(;a<t.length;)if(t[a]==="<"){let o=!1;const l=t.slice(a).match(/^<\/(\d+|[a-zA-Z][a-zA-Z0-9_-]*)>/);if(l){const u=l[1];(/^\d+$/.test(u)||i.includes(u))&&(o=!0,s+=l[0],a+=l[0].length)}if(!o){const u=t.slice(a).match(/^<(\d+|[a-zA-Z][a-zA-Z0-9_-]*)(\s+[\w-]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?)*\s*(\/)?>/);if(u){const f=u[1];(/^\d+$/.test(f)||i.includes(f))&&(o=!0,s+=u[0],a+=u[0].length)}}o||(s+="<",a+=1)}else s+=t[a],a+=1;return s},Gpe=(t,e,n,r,i,s,a)=>{if(n==="")return[];const o=i.transKeepBasicHtmlNodesFor||[],l=n&&new RegExp(o.map(S=>`<${S}`).join("|")).test(n);if(!t&&!e&&!l&&!a)return[n];const u=e??{},f=S=>
61{Vh(S).forEach(A=>{oa(A)||(xw(A)?f(Cw(A)):gu(A)&&!N.isValidElement(A)&&Object.assign(u,A))})};f(t);const p=Kpe(n,o,u),y=Dpe.parse(`<0>${p}</0>`),g={...u,...s},b=(S,x,A)=>{var O;const I=Cw(S),$=_(I,x.children,A);return Wpe(I)&&$.length===0||(O=S.props)!=null&&O.i18nIsDynamicList?I:$},v=(S,x,A,I,$)=>{S.dummy?(S.children=x,A.push(N.cloneElement(S,{key:I},$?void 0:x))):A.push(...N.Children.map([S],O=>{const P="data-i18n-is-dynamic-list",j={key:I,[P]:void 0};return O&&O.props&&Object.keys(O.props).forEach(U=>{U==="ref"||U==="children"||U==="i18nIsDynamicList"||U===P||(j[U]=O.props[U])}),N.cloneElement(O,j,$?null:x)}))},_=(S,x,A)=>{const I=Vh(S);return Vh(x).reduce((O,P,j)=>{var z,D;const U=((D=(z=P.children)==null?void 0:z[0])==null?void 0:D.content)&&r.services.interpolator.interpolate(P.children[0].content,g,r.language);if(P.type==="tag"){let R=I[parseInt(P.name,10)];!R&&e&&(R=e[P.name]),A.length===1&&!R&&(R=A[0][P.name]),R||(R={});const W={...P.attrs};a&&Object.keys(W).forEach(V=>{const F=W[V];oa(F)&&(W[V]=sJ(F))});const T=Object.keys(W).length!==0?qpe({props:W},R):R,L=N.isValidElement(T),M=L&&xw(P,!0)&&!P.voidElement,Z=l&&gu(T)&&T.dummy&&!L,H=gu(e)&&Object.hasOwnProperty.call(e,P.name);if(oa(T)){const V=r.services.interpolator.interpolate(T,g,r.language);O.push(V)}else if(xw(T)||M){const V=b(T,P,A);v(T,V,O,j)}else if(Z){const V=_(I,P.children,A);v(T,V,O,j)}else if(Number.isNaN(parseFloat(P.name)))if(H){const V=b(T,P,A);v(T,V,O,j,P.voidElement)}else if(i.transSupportBasicHtmlNodes&&o.indexOf(P.name)>-1)if(P.voidElement)O.push(N.createElement(P.name,{key:`${P.name}-${j}`}));else{const V=_(I,P.children,A);O.push(N.createElement(P.name,{key:`${P.name}-${j}`},V))}else if(P.voidElement)O.push(`<${P.name} />`);else{const V=_(I,P.children,A);O.push(`<${P.name}>${V}</${P.name}>`)}else if(gu(T)&&!L){const V=P.children[0]?U:null;V&&O.push(V)}else v(T,U,O,j,P.children.length!==1||!U)}else if(P.type==="text"){const R=i.transWrapTextNodes,W=typeof i.unescape=="function"?i.unescape:nI().unescape,T=a?W(r.services.interpolator.interpolate(P.content,g,r.language)):r.services.interpolator.interpolate(P.content,g,r.language);R?O.push(N.createElement(R,{key:`${P.name}-${j}`},T)):O.push(T)}return O},[])},C=_([{dummy:!0,children:t||[]}],y,Vh(t||[]));return Cw(C[0])},lJ=(t,e,n)=>{const r=t.key||e,i=N.cloneElement(t,{key:r});if(!i.props||!i.props.children||n.indexOf(`${e}/>`)<0&&n.indexOf(`${e} />`)<0)return i;function s(){return N.createElement(N.Fragment,null,i)}return N.createElement(s,{key:r})},Ype=(t,e)=>t.map((n,r)=>lJ(n,r,e)),Jpe=(t,e)=>{const n={};return Object.keys(t).forEach(r=>{Object.assign(n,{[r]:lJ(t[r],r,e)})}),n},Xpe=(t,e,n,r)=>t?Array.isArray(t)?Ype(t,e):gu(t)?Jpe(t,e):(Qg(n,"TRANS_INVALID_COMPONENTS",'<Trans /> "components" prop expects an object or array',{i18nKey:r}),null):null,Qpe=t=>!gu(t)||Array.isArray(t)?!1:Object.keys(t).reduce((e,n)=>e&&Number.isNaN(Number.parseFloat(n)),!0);function e0e({children:t,count:e,parent:n,i18nKey:r,context:i,tOptions:s={},values:a,defaults:o,components:l,ns:u,i18n:f,t:p,shouldUnescape:y,...g}){var V,F,q,G,Y,X;const b=f||rI();if(!b)return Qg(b,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using i18nextReactModule",{i18nKey:r}),t;const v=p||b.t.bind(b)||(te=>te),_={...nI(),...(V=b.options)==null?void 0:V.react};let C=u||v.ns||((F=b.options)==null?void 0:F.defaultNS);C=oa(C)?[C]:C||["translation"];const{transDefaultProps:S}=_,x=S!=null&&S.tOptions?{...S.tOptions,...s}:s,A=y??(S==null?void 0:S.shouldUnescape),I=S!=null&&S.values?{...S.values,...a}:a,$=S!=null&&S.components?{...S.components,...l}:l,O=oJ(t,_,b,r),P=o||(x==null?void 0:x.defaultValue)||O||_.transEmptyNodeValue||(typeof r=="function"?sf(r):r),{hashTransKey:j}=_,U=r||(j?j(O||P):O||P);(G=(q=b.options)==null?void 0:q.interpolation)!=null&&G.defaultVariables?a=I&&Object.keys(I).length>0?{...I,...b.options.interpolation.defaultVariables}:{...b.options.interpolation.defaultVariables}:a=I;const z=Zpe(t);z&&typeof z.count=="number"&&e===void 0&&(e=z.count);const D=a||e!==void 0&&!((X=(Y=b.options)==null?void 0:Y.interpolation)!=null&&X.alwaysFormat)||!t?x.interpolation:{interpolation:{...x.interpolation,prefix:"#$?",suffix:"?$#"}},R={...x,context:i||x.context,count:e,...a,...D,defaultValue:P,ns:C};let W=U?v(U,R):P;W===U&&P&&(W=P);const T=Xpe($,W,b,r);let L=T||t,M=null;Qpe(T)&&(M=T,L=t);const Z=Gpe(L,M,W,b,_,R,A),H=n??_.defaultTransParent;return H?N.createElement(H,g,Z):Z}const t0e={type:"3rdParty",init(t){Vpe(t.options.react),Hpe(t)}},cJ=N.createContext();
61class n0e{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function r0e({children:t,count:e,parent:n,i18nKey:r,context:i,tOptions:s={},values:a,defaults:o,components:l,ns:u,i18n:f,t:p,shouldUnescape:y,...g}){var S;const{i18n:b,defaultNS:v}=N.useContext(cJ)||{},_=f||b||rI(),C=p||(_==null?void 0:_.t.bind(_));return e0e({children:t,count:e,parent:n,i18nKey:r,context:i,tOptions:s,values:a,defaults:o,components:l,ns:u||(C==null?void 0:C.ns)||v||((S=_==null?void 0:_.options)==null?void 0:S.defaultNS),i18n:_,t:p,shouldUnescape:y,...g})}var pC={exports:{}},mC={};/** 62 * @license React 63 * use-sync-external-store-shim.production.js 64 * 65 * Copyright (c) Meta Platforms, Inc. and affiliates. 66 * 67 * This source code is licensed under the MIT license found in the 68 * LICENSE file in the root directory of this source tree. 69 */var vU;function i0e(){if(vU)return mC;vU=1;var t=B1();function e(p,y){return p===y&&(p!==0||1/p===1/y)||p!==p&&y!==y}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,i=t.useEffect,s=t.useLayoutEffect,a=t.useDebugValue;function o(p,y){var g=y(),b=r({inst:{value:g,getSnapshot:y}}),v=b[0].inst,_=b[1];return s(function(){v.value=g,v.getSnapshot=y,l(v)&&_({inst:v})},[p,g,y]),i(function(){return l(v)&&_({inst:v}),p(function(){l(v)&&_({inst:v})})},[p]),a(g),g}function l(p){var y=p.getSnapshot;p=p.value;try{var g=y();return!n(p,g)}catch{return!0}}function u(p,y){return y()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:o;return mC.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:f,mC}var _U;function s0e(){return _U||(_U=1,pC.exports=i0e()),pC.exports}var a0e=s0e();const o0e=(t,e)=>{if(oa(e))return e;if(gu(e)&&oa(e.defaultValue))return e.defaultValue;if(typeof t=="function")return"";if(Array.isArray(t)){const n=t[t.length-1];return typeof n=="function"?"":n}return t},l0e={t:o0e,ready:!1},c0e=()=>()=>{},sr=(t,e={})=>{var j,U,z;const{i18n:n}=e,{i18n:r,defaultNS:i}=N.useContext(cJ)||{},s=n||r||rI();s&&!s.reportNamespaces&&(s.reportNamespaces=new n0e),s||Qg(s,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const a=N.useMemo(()=>{var D;return{...nI(),...(D=s==null?void 0:s.options)==null?void 0:D.react,...e}},[s,e]),{useSuspense:o,keyPrefix:l}=a,u=t||i||((j=s==null?void 0:s.options)==null?void 0:j.defaultNS),f=oa(u)?[u]:u||["translation"],p=N.useMemo(()=>f,f);(z=(U=s==null?void 0:s.reportNamespaces)==null?void 0:U.addUsedNamespaces)==null||z.call(U,p);const y=N.useRef(0),g=N.useCallback(D=>{if(!s)return c0e;const{bindI18n:R,bindI18nStore:W}=a,T=()=>{y.current+=1,D()};return R&&s.on(R,T),W&&s.store.on(W,T),()=>{R&&R.split(" ").forEach(L=>s.off(L,T)),W&&W.split(" ").forEach(L=>s.store.off(L,T))}},[s,a]),b=N.useRef(),v=N.useCallback(()=>{if(!s)return l0e;const D=!!(s.isInitialized||s.initializedStoreOnce)&&p.every(Z=>Upe(Z,s,a)),R=e.lng||s.language,W=y.current,T=b.current;if(T&&T.ready===D&&T.lng===R&&T.keyPrefix===l&&T.revision===W)return T;const M={t:s.getFixedT(R,a.nsMode==="fallback"?p:p[0],l),ready:D,lng:R,keyPrefix:l,revision:W};return b.current=M,M},[s,p,l,a,e.lng]),[_,C]=N.useState(0),{t:S,ready:x}=a0e.useSyncExternalStore(g,v,v);N.useEffect(()=>{if(s&&!x&&!o){const D=()=>C(R=>R+1);e.lng?wU(s,e.lng,p,D):qA(s,p,D)}},[s,e.lng,p,x,o,_]);const A=s||{},I=N.useRef(null),$=N.useRef(),O=D=>{const R=Object.getOwnPropertyDescriptors(D);R.__original&&delete R.__original;const W=Object.create(Object.getPrototypeOf(D),R);if(!Object.prototype.hasOwnProperty.call(W,"__original"))try{Object.defineProperty(W,"__original",{value:D,writable:!1,enumerable:!1,configurable:!1})}catch{}return W},P=N.useMemo(()=>{const D=A,R=D==null?void 0:D.language;let W=D;D&&(I.current&&I.current.__original===D?$.current!==R?(W=O(D),I.current=W,$.current=R):W=I.current:(W=O(D),I.current=W,$.current=R));const T=!x&&!o?(...M)=>(Qg(s,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),S(...M)):S,L=[T,W,x];return L.t=T,L.i18n=W,L.ready=x,L},[S,A,x,A.resolvedLanguage,A.language,A.languages]);
69if(s&&o&&!x)throw new Promise(D=>{const R=()=>D();e.lng?wU(s,e.lng,p,R):qA(s,p,R)});return P},{slice:u0e,forEach:d0e}=[];function h0e(t){return d0e.call(u0e.call(arguments,1),e=>{if(e)for(const n in e)t[n]===void 0&&(t[n]=e[n])}),t}function f0e(t){return typeof t!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(n=>n.test(t))}const xU=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,p0e=function(t,e){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},i=encodeURIComponent(e);let s=`${t}=${i}`;if(r.maxAge>0){const a=r.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");s+=`; Max-Age=${Math.floor(a)}`}if(r.domain){if(!xU.test(r.domain))throw new TypeError("option domain is invalid");s+=`; Domain=${r.domain}`}if(r.path){if(!xU.test(r.path))throw new TypeError("option path is invalid");s+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invali
69d");s+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(s+="; HttpOnly"),r.secure&&(s+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r.partitioned&&(s+="; Partitioned"),s},CU={create(t,e,n,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+n*60*1e3)),r&&(i.domain=r),document.cookie=p0e(t,e,i)},read(t){const e=`${t}=`,n=document.cookie.split(";");for(let r=0;r<n.length;r++){let i=n[r];for(;i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(e)===0)return i.substring(e.length,i.length)}return null},remove(t,e){this.create(t,"",-1,e)}};var m0e={name:"cookie",lookup(t){let{lookupCookie:e}=t;if(e&&typeof document<"u")return CU.read(e)||void 0},cacheUserLanguage(t,e){let{lookupCookie:n,cookieMinutes:r,cookieDomain:i,cookieOptions:s}=e;n&&typeof document<"u"&&CU.create(n,t,r,i,s)}},y0e={name:"querystring",lookup(t){var r;let{lookupQuerystring:e}=t,n;if(typeof window<"u"){let{search:i}=window.location;!window.location.search&&((r=window.location.hash)==null?void 0:r.indexOf("?"))>-1&&(i=window.location.hash.substring(window.location.hash.indexOf("?")));const a=i.substring(1).split("&");for(let o=0;o<a.length;o++){const l=a[o].indexOf("=");l>0&&a[o].substring(0,l)===e&&(n=a[o].substring(l+1))}}return n}},g0e={name:"hash",lookup(t){var i;let{lookupHash:e,lookupFromHashIndex:n}=t,r;if(typeof window<"u"){const{hash:s}=window.location;if(s&&s.length>2){const a=s.substring(1);if(e){const o=a.split("&");for(let l=0;l<o.length;l++){const u=o[l].indexOf("=");u>0&&o[l].substring(0,u)===e&&(r=o[l].substring(u+1))}}if(r)return r;if(!r&&n>-1){const o=s.match(/\/([a-zA-Z-]*)/g);return Array.isArray(o)?(i=o[typeof n=="number"?n:0])==null?void 0:i.replace("/",""):void 0}}}return r}};let zp=null;const EU=()=>{if(zp!==null)return zp;try{if(zp=typeof window<"u"&&window.localStorage!==null,!zp)return!1;const t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{zp=!1}return zp};var b0e={name:"localStorage",lookup(t){let{lookupLocalStorage:e}=t;if(e&&EU())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupLocalStorage:n}=e;n&&EU()&&window.localStorage.setItem(n,t)}};let Vp=null;const SU=()=>
69{if(Vp!==null)return Vp;try{if(Vp=typeof window<"u"&&window.sessionStorage!==null,!Vp)return!1;const t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{Vp=!1}return Vp};var w0e={name:"sessionStorage",lookup(t){let{lookupSessionStorage:e}=t;if(e&&SU())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupSessionStorage:n}=e;n&&SU()&&window.sessionStorage.setItem(n,t)}},v0e={name:"navigator",lookup(t){const e=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:i}=navigator;if(n)for(let s=0;s<n.length;s++)e.push(n[s]);r&&e.push(r),i&&e.push(i)}return e.length>0?e:void 0}},_0e={name:"htmlTag",lookup(t){let{htmlTag:e}=t,n;const r=e||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},x0e={name:"path",lookup(t){var i;let{lookupFromPathIndex:e}=t;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?(i=n[typeof e=="number"?e:0])==null?void 0:i.replace("/",""):void 0}},C0e={name:"subdomain",lookup(t){var i,s;let{lookupFromSubdomainIndex:e}=t;const n=typeof e=="number"?e+1:1,r=typeof window<"u"&&((s=(i=window.location)==null?void 0:i.hostname)==null?void 0:s.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(r)return r[n]}};let uJ=!1;try{document.cookie,uJ=!0}catch{}const dJ=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];uJ||dJ.splice(1,1);const E0e=()=>({order:dJ,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:t=>t});class hJ{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,n)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e,this.options=h0e(n,this.options||{},E0e()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=i=>i.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(m0e),this.addDetector(y0e),this.addDetector(b0e),this.addDetector(w0e),this.addDetector(v0e),this.addDetector(_0e),this.addDetector(x0e),this.addDetector(C0e),this.addDetector(g0e)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return e.forEach(r=>{if(this.detectors[r]){let i=this.detectors[r].lookup(this.options);i&&typeof i=="string"&&(i=[i]),i&&(n=n.concat(i))}}),n=n.filter(r=>r!=null&&!f0e(r)).map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(e,this.options)}))}}hJ.type="languageDetector";function KA(t){"@babel/helpers - typeof";return KA=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},KA(t)}function fJ(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":KA(XMLHttpRequest))==="object"}function S0e(t){return!!t&&typeof t.then=="function"}function A0e(t){return S0e(t)?t:Promise.resolve(t)}const k0e="modulepreload",T0e=function(t){return"/"+t},AU={},Le=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){let a=function(u){return Promise.all(u.map(f=>Promise.resolve(f).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=a(n.map(u=>{if(u=T0e(u),u in AU)return;AU[u]=!0;const f=u.endsWith(".css"),p=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${p}`))return;const y=document.createElement("link");if(y.rel=f?"stylesheet":k0e,f||(y.as="script"),y.crossOrigin="",y.href=u,l&&y.setAttribute("nonce",l),document.head.appendChild(y),f)return new Promise((g,b)=>{y.addEventListener("load",g),y.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return i.then(a=>{for(const o of a||[])o.status==="rejected"&&s(o.reason);return e().catch(s)})};function kU(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function TU(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};
vendor: 7,838 bytes, line 69
69e%2?kU(Object(n),!0).forEach(function(r){L0e(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):kU(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function L0e(t,e,n){return(e=$0e(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function $0e(t){var e=I0e(t,"string");return mf(e)=="symbol"?e:e+""}function I0e(t,e){if(mf(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(mf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function mf(t){"@babel/helpers - typeof";return mf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mf(t)}var E2=typeof fetch=="function"?fetch:void 0;typeof global<"u"&&global.fetch?E2=global.fetch:typeof window<"u"&&window.fetch&&(E2=window.fetch);var e3;fJ()&&(typeof global<"u"&&global.XMLHttpRequest?e3=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(e3=window.XMLHttpRequest));var s8;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?s8=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(s8=window.ActiveXObject));typeof E2!="function"&&(E2=void 0);if(!E2&&!e3&&!s8)try{Le(()=>import("./browser-ponyfill-VxEnwoi4.js").then(t=>t.b),[]).then(function(t){E2=t.default}).catch(function(){})}catch{}var GA=function(e,n){if(n&&mf(n)==="object"){var r="";for(var i in n)r+="&"+encodeURIComponent(i)+"="+encodeURIComponent(n[i]);if(!r)return e;e=e+(e.indexOf("?")!==-1?"&":"?")+r.slice(1)}return e},LU=function(e,n,r,i){var s=function(l){if(!l.ok)return r(l.statusText||"Error",{status:l.status});l.text().then(function(u){r(null,{status:l.status,data:u})}).catch(r)};if(i){var a=i(e,n);if(a instanceof Promise){a.then(s).catch(r);return}}typeof fetch=="function"?fetch(e,n).then(s).catch(r):E2(e,n).then(s).catch(r)},$U=!1,N0e=function(e,n,r,i){e.queryStringParams&&(n=GA(n,e.queryStringParams));var s=TU({},typeof e.customHeaders=="function"?e.customHeaders():e.customHeaders);typeof window>"u"&&typeof global<"u"&&typeof global.process<"u"&&global.process.versions&&global.process.versions.node&&(s["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),r&&(s["Content-Type"]="application/json");var a=typeof e.requestOptions=="function"?e.requestOptions(r):e.requestOptions,o=TU({method:r?"POST":"GET",body:r?e.stringify(r):void 0,headers:s},$U?{}:a),l=typeof e.alternateFetch=="function"&&e.alternateFetch.length>=1?e.alternateFetch:void 0;try{LU(n,o,i,l)}catch(u){if(!a||Object.keys(a).length===0||!u.message||u.message.indexOf("not implemented")<0)return i(u);try{Object.keys(a).forEach(function(f){delete o[f]}),LU(n,o,i,l),$U=!0}catch(f){i(f)}}},O0e=function(e,n,r,i){r&&mf(r)==="object"&&(r=GA("",r).slice(1)),e.queryStringParams&&(n=GA(n,e.queryStringParams));try{var s=e3?new e3:new s8("MSXML2.XMLHTTP.3.0");s.open(r?"POST":"GET",n,1),e.crossDomain||s.setRequestHeader("X-Requested-With","XMLHttpRequest"),s.withCredentials=!!e.withCredentials,r&&s.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),s.overrideMimeType&&s.overrideMimeType("application/json");var a=e.customHeaders;if(a=typeof a=="function"?a():a,a)for(var o in a)s.setRequestHeader(o,a[o]);s.onreadystatechange=function(){s.readyState>3&&i(s.status>=400?s.statusText:null,{status:s.status,data:s.responseText})},s.send(r)}catch(l){console&&console.log(l)}},P0e=function(e,n,r,i){if(typeof r=="function"&&(i=r,r=void 0),i=i||function(){},E2&&n.indexOf("file:")!==0)return N0e(e,n,r,i);if(fJ()||typeof ActiveXObject=="function")return O0e(e,n,r,i);i(new Error("No fetch and no xhr implementation found!"))};function t1(t){"@babel/helpers - typeof";return t1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t1(t)}function IU(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function yC(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?IU(Object(n),!0).forEach(function(r){pJ(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):IU(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function R0e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function j0e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,mJ(r.key),r)}}function M0e(t,e,n){return e&&j0e(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function pJ(t,e,n){return(e=mJ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function mJ(t){var e=D0e(t,"string");return t1(e)=="symbol"?e:e+""}function D0e(t,e){if(t1(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(t1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var U0e=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:function(n){return JSON.parse(n)},stringify:JSON.stringify,parsePayload:function(n,r,i){return pJ({},r,i||"")},parseLoadPayload:function(n,r){},request:P0e,reloadInterval:typeof window<"u"?!1:3600*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},yJ=(function(){function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};R0e(this,t),this.services=e,this.options=n,this.allOptions=r,this.type="backend",this.init(e,n,r)}return M0e(t,[{key:"init",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.services=n,this.options=yC(yC(yC({},U0e()),this.options||{}),i),this.allOptions=s,this.services&&this.options.reloadInterval){var a=setInterval(function(){return r.reload()},this.options.reloadInterval);t1(a)==="object"&&typeof a.unref=="function"&&a.unref()}}},{key:"readMulti",value:function(n,r,i){this._readAny(n,n,r,r,i)}},{key:"read",value:function(n,r,i){this._readAny([n],n,[r],r,i)}},{key:"_readAny",value:function(n,r,i,s,a){var o=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(n,i)),l=A0e(l),l.then(function(u){if(!u)return a(null,{});var f=o.services.interpolator.interpolate(u,{lng:n.join("+"),ns:i.join("+")});o.loadUrl(f,a,r,s)})}},{key:"loadUrl",value:function(n,r,i,s){var a=this,o=typeof i=="string"?[i]:i,l=typeof s=="string"?[s]:s,u=this.options.parseLoadPayload(o,l);this.options.request(this.options,n,u,function(f,p){if(p&&(p.status>=500&&p.status<600||!p.status))return r("failed loading "+n+"; status code: "+p.status,!0);if(p&&p.status>=400&&p.status<500)return r("failed loading "+n+"; status code: "+p.status,!1);if(!p&&f&&f.message){var y=f.message.toLowerCase(),g=["failed","fetch","network","load"].find(function(_){return y.indexOf(_)>-1});if(g)return r("failed loading "+n+": "+f.message,!0)}if(f)return r(f,!1);var b,v;
69try{typeof p.data=="string"?b=a.options.parse(p.data,i,s):b=p.data}catch{v="failed parsing "+n+" to json"}if(v)return r(v,!1);r(null,b)})}},{key:"create",value:function(n,r,i,s,a){var o=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var l=this.options.parsePayload(r,i,s),u=0,f=[],p=[];n.forEach(function(y){var g=o.options.addPath;typeof o.options.addPath=="function"&&(g=o.options.addPath(y,r));var b=o.services.interpolator.interpolate(g,{lng:y,ns:r});o.options.request(o.options,b,l,function(v,_){u+=1,f.push(v),p.push(_),u===n.length&&typeof a=="function"&&a(f,p)})})}}},{key:"reload",value:function(){var n=this,r=this.services,i=r.backendConnector,s=r.languageUtils,a=r.logger,o=i.language;if(!(o&&o.toLowerCase()==="cimode")){var l=[],u=function(p){var y=s.toResolveHierarchy(p);y.forEach(function(g){l.indexOf(g)<0&&l.push(g)})};u(o),this.allOptions.preload&&this.allOptions.preload.forEach(function(f){return u(f)}),l.forEach(function(f){n.allOptions.ns.forEach(function(p){i.read(f,p,"read",null,null,function(y,g){y&&a.warn("loading namespace ".concat(p," for language ").concat(f," failed"),y),!y&&g&&a.log("loaded namespace ".concat(p," for language ").concat(f),g),i.loaded("".concat(f,"|").concat(p),y,g)})})})}}}])})();yJ.type="backend";const B0e=["common","landing"],F0e=/^\/(?:zh-TW|zh|ja|ko|es|fr|de)(?=\/|$)/i;function z0e(t){return(t||"/").replace(F0e,"")||"/"}function V0e(t){const e=z0e(t).split(/[?#]/,1)[0]||"/",n=[];return e==="/"&&n.push("landing"),(e.startsWith("/pricing")||e.startsWith("/credit-guide"))&&n.push("pricing"),e.startsWith("/blog")&&n.push("blog"),e.startsWith("/settings")&&n.push("settings"),(e.startsWith("/ai-investment-agent")||e.startsWith("/models"))&&n.push("agent"),e.startsWith("/ai-consensus-pick")&&n.push("consensus"),e.startsWith("/institution-smart-money")&&n.push("smartmoney"),e.startsWith("/ai-social-agent")&&n.push("social-agent"),e.startsWith("/ai-technical-analysis")&&n.push("technical-analysis"),e.startsWith("/copy-trade")&&n.push("copy-trade"),e.startsWith("/compare")&&n.push("compare"),e.startsWith("/whales-institution")&&n.push("whales","smartmoney"),e.startsWith("/watch")&&n.push("watch"),e.startsWith("/swing-trade-bot")&&n.push("swing-trade-bot"),e.startsWith("/day-trade-bot")&&n.push("day-trade-bot"),e.startsWith("/discover")&&n.push("swing-bot","day-trade-bot"),e.startsWith("/about")&&n.push("about"),(e.startsWith("/studio")||e.startsWith("/share/"))&&n.push("studio"),e.startsWith("/connectors")&&n.push("connector"),e.startsWith("/account")&&n.push("account"),e.startsWith("/onboarding")&&n.push("onboarding"),e.startsWith("/portfolio")&&n.push("portfolio"),["common",...new Set(n)]}const Va=["zh","zh-TW","ja","ko","es","fr","de"];function gJ(t){const e=t.split("/").filter(Boolean)[0];return e&&Va.includes(e)?e:null}const bJ=["en",...Va],gC={en:"English",zh:"ç®ä½ä¸æ","zh-TW":"ç¹é«ä¸æ",ja:"æ¥æ¬èª",ko:"íêµì´",es:"Español",fr:"Français",de:"Deutsch"};function H0e(t){return ks.loadNamespaces(V0e(t))}ks.use(yJ).use(hJ).use(t0e).init({lng:"en",fallbackLng:"en",supportedLngs:bJ,ns:[...B0e],defaultNS:"common",backend:{loadPath:"/locales/{{lng}}/{{ns}}.json"},detection:{order:["localStorage","cookie"],caches:["localStorage"],lookupLocalStorage:"tritonix_lang"},interpolation:{escapeValue:!1},react:{useSuspense:!0}});/** 70 * @license lucide-react v0.555.0 - ISC 71 * 72 * This source code is licensed under the ISC license. 73 * See the LICENSE file in the root directory of this source tree. 74 */const W0e=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),q0e=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase()),NU=t=>{const e=q0e(t);return e.charAt(0).toUpperCase()+e.slice(1)},wJ=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim(),Z0e=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};/** 75 * @license lucide-react v0.555.0 - ISC 76 * 77 * This source code is licensed under the ISC license. 78 * See the LICENSE file in the root directory of this source tree. 79 */var K0e={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** 80 * @license lucide-react v0.555.0 - ISC 81 * 82 * This source code is licensed under the ISC license. 83 * See the LICENSE file in the root directory of this source tree. 84 */const G0e=N.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:a,...o},l)=>N.createElement("svg",{ref:l,...K0e,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:wJ("lucide",i),...!s&&!Z0e(o)&&{"aria-hidden":"true"},...o},[...a.map(([u,f])=>N.createElement(u,f)),...Array.isArray(s)?s:[s]]));/** 85 * @license lucide-react v0.555.0 - ISC 86 * 87 * This source code is licensed under the ISC license. 88 * See the LICENSE file in the root directory of this source tree. 89 */const lt=(t,e)=>{const n=N.forwardRef(({className:r,...i},s)=>N.createElement(G0e,{ref:s,iconNode:e,className:wJ(`lucide-${W0e(NU(t))}`,`lucide-${t}`,r),...i}));return n.displayName=NU(t),n};/** 90 * @license lucide-react v0.555.0 - ISC 91 * 92 * This source code is licensed under the ISC license. 93 * See the LICENSE file in the root directory of this source tree. 94 */const Y0e=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],vJ=lt("arrow-down",Y0e);/** 95 * @license lucide-react v0.555.0 - ISC 96 * 97 * This source code is licensed under the ISC license. 98 * See the LICENSE file in the root directory of this source tree. 99 */const J0e=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],YA=lt("arrow-left",J0e);/** 100 * @license lucide-react v0.555.0 - ISC 101 * 102 * This source code is licensed under the ISC license. 103 * See the LICENSE file in the root directory of this source tree. 104 */const X0e=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],yf=lt("arrow-right",X0e);/** 105 * @license lucide-react v0.555.0 - ISC 106 * 107 * This source code is licensed under the ISC license. 108 * See the LICENSE file in the root directory of this source tree. 109 */const Q0e=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],e1e=lt("arrow-up-right",Q0e);/** 110 * @license lucide-react v0.555.0 - ISC 111 * 112 * This source code is licensed under the ISC license. 113 * See the LICENSE file in the root directory of this source tree. 114 */const t1e=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],_J=lt("arrow-up",t1e);/** 115 * @license lucide-react v0.555.0 - ISC 116 * 117 * This source code is licensed under the ISC license. 118 * See the LICENSE file in the root directory of this source tree. 119 */const n1e=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],l2=lt("bell",n1e);/** 120 * @license lucide-react v0.555.0 - ISC 121 * 122 * This source code is licensed under the ISC license. 123 * See the LICENSE file in the root directory of this source tree. 124 */const r1e=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],OU=lt("book-open",r1e);/** 125 * @license lucide-react v0.555.0 - ISC 126 * 127 * This source code is licensed under the ISC license. 128 * See the LICENSE file in the root directory of this source tree. 129 */const i1e=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],t3=lt("bot",i1e);/** 130 * @license lucide-react v0.555.0 - ISC 131 * 132 * This source code is licensed under the ISC license. 133 * See the LICENSE file in the root directory of this source tree. 134 */const s1e=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],a8=lt("brain",s1e);/** 135 * @license lucide-react v0.555.0 - ISC 136 * 137 * This source code is licensed under the ISC license. 138 * See the LICENSE file in the root directory of this source tree. 139 */const a1e=[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]],A0=lt("briefcase",a1e);/** 140 * @license lucide-react v0.555.0 - ISC 141 * 142 * This source code is licensed under the ISC license. 143 * See the LICENSE file in the root directory of this source tree. 144 */const o1e=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"m9 16 2 2 4-4",key:"19s6y9"}]],PU=lt("calendar-check",o1e);/** 145 * @license lucide-react v0.555.0 - ISC 146 * 147 * This source code is licensed under the ISC license. 148 * See the LICENSE file in the root directory of this source tree. 149 */const l1e=[["path",{d:"M9 5v4",key:"14uxtq"}],["rect",{width:"4",height:"6",x:"7",y:"9",rx:"1",key:"f4fvz0"}],["path",{d:"M9 15v2",key:"r5rk32"}],["path",{d:"M17 3v2",key:"1l2re6"}],["rect",{width:"4",height:"8",x:"15",y:"5",rx:"1",key:"z38je5"}],["path",{d:"M17 13v3",key:"5l0wba"}],["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}]],n1=lt("chart-candlestick",l1e);/** 150 * @license lucide-react v0.555.0 - ISC 151 * 152 * This source code is licensed under the ISC license. 153 * See the LICENSE file in the root directory of this source tree.
154 */const c1e=[["path",{d:"M5 21v-6",key:"1hz6c0"}],["path",{d:"M12 21V3",key:"1lcnhd"}],["path",{d:"M19 21V9",key:"unv183"}]],u1e=lt("chart-no-axes-column",c1e);/** 155 * @license lucide-react v0.555.0 - ISC 156 * 157 * This source code is licensed under the ISC license. 158 * See the LICENSE file in the root directory of this source tree. 159 */const d1e=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],h1e=lt("check-check",d1e);/** 160 * @license lucide-react v0.555.0 - ISC 161 * 162 * This source code is licensed under the ISC license. 163 * See the LICENSE file in the root directory of this source tree. 164 */const f1e=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],t7=lt("check",f1e);/** 165 * @license lucide-react v0.555.0 - ISC 166 * 167 * This source code is licensed under the ISC license. 168 * See the LICENSE file in the root directory of this source tree. 169 */const p1e=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Sh=lt("chevron-down",p1e);/** 170 * @license lucide-react v0.555.0 - ISC 171 * 172 * This source code is licensed under the ISC license. 173 * See the LICENSE file in the root directory of this source tree. 174 */const m1e=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],RU=lt("chevron-right",m1e);/** 175 * @license lucide-react v0.555.0 - ISC 176 * 177 * This source code is licensed under the ISC license. 178 * See the LICENSE file in the root directory of this source tree. 179 */const y1e=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],g1e=lt("circle-alert",y1e);/** 180 * @license lucide-react v0.555.0 - ISC 181 * 182 * This source code is licensed under the ISC license. 183 * See the LICENSE file in the root directory of this source tree. 184 */const b1e=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],iI=lt("circle-check",b1e);/** 185 * @license lucide-react v0.555.0 - ISC 186 * 187 * This source code is licensed under the ISC license. 188 * See the LICENSE file in the root directory of this source tree. 189 */const w1e=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],v1e=lt("circle",w1e);/** 190 * @license lucide-react v0.555.0 - ISC 191 * 192 * This source code is licensed under the ISC license. 193 * See the LICENSE file in the root directory of this source tree. 194 */const _1e=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]],x1e=lt("clipboard-list",_1e);/** 195 * @license lucide-react v0.555.0 - ISC 196 * 197 * This source code is licensed under the ISC license. 198 * See the LICENSE file in the root directory of this source tree. 199 */const C1e=[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]],E1e=lt("coins",C1e);/** 200 * @license lucide-react v0.555.0 - ISC 201 * 202 * This source code is licensed under the ISC license. 203 * See the LICENSE file in the root directory of this source tree. 204 */const S1e=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],o8=lt("copy",S1e);/** 205 * @license lucide-react v0.555.0 - ISC 206 * 207 * This source code is licensed under the ISC license. 208 * See the LICENSE file in the root directory of this source tree. 209 */const A1e=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],k1e=lt("credit-card",A1e);/** 210 * @license lucide-react v0.555.0 - ISC 211 * 212 * This source code is licensed under the ISC license. 213 * See the LICENSE file in the root directory of this source tree. 214 */const T1e=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],xJ=lt("crown",T1e);/** 215 * @license lucide-react v0.555.0 - ISC 216 * 217 * This source code is licensed under the ISC license. 218 * See the LICENSE file in the root directory of this source tree. 219 */const L1e=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],jU=lt("database",L1e);/** 220 * @license lucide-react v0.555.0 - ISC 221 * 222 * This source code is licensed under the ISC license. 223 * See the LICENSE file in the root directory of this source tree. 224 */const $1e=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],CJ=lt("external-link",$1e);/** 225 * @license lucide-react v0.555.0 - ISC 226 * 227 * This source code is licensed under the ISC license. 228 * See the LICENSE file in the root directory of this source tree. 229 */const I1e=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],MU=lt("eye-off",I1e);/** 230 * @license lucide-react v0.555.0 - ISC 231 * 232 * This source code is licensed under the ISC license. 233 * See the LICENSE file in the root directory of this source tree. 234 */const N1e=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],DU=lt("eye",N1e);/** 235 * @license lucide-react v0.555.0 - ISC 236 * 237 * This source code is licensed under the ISC license. 238 * See the LICENSE file in the root directory of this source tree. 239 */const O1e=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],P1e=lt("file-text",O1e);/** 240 * @license lucide-react v0.555.0 - ISC 241 * 242 * This source code is licensed under the ISC license. 243 * See the LICENSE file in the root directory of this source tree. 244 */const R1e=[["path",{d:"M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4",ke
244y:"1slcih"}]],j1e=lt("flame",R1e);/** 245 * @license lucide-react v0.555.0 - ISC 246 * 247 * This source code is licensed under the ISC license. 248 * See the LICENSE file in the root directory of this source tree. 249 */const M1e=[["path",{d:"M10.5 3 8 9l4 13 4-13-2.5-6",key:"b3dvk1"}],["path",{d:"M17 3a2 2 0 0 1 1.6.8l3 4a2 2 0 0 1 .013 2.382l-7.99 10.986a2 2 0 0 1-3.247 0l-7.99-10.986A2 2 0 0 1 2.4 7.8l2.998-3.997A2 2 0 0 1 7 3z",key:"7w4byz"}],["path",{d:"M2 9h20",key:"16fsjt"}]],EJ=lt("gem",M1e);/** 250 * @license lucide-react v0.555.0 - ISC 251 * 252 * This source code is licensed under the ISC license. 253 * See the LICENSE file in the root directory of this source tree. 254 */const D1e=[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]],U1e=lt("gift",D1e);/** 255 * @license lucide-react v0.555.0 - ISC 256 * 257 * This source code is licensed under the ISC license. 258 * See the LICENSE file in the root directory of this source tree. 259 */const B1e=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],JA=lt("globe",B1e);/** 260 * @license lucide-react v0.555.0 - ISC 261 * 262 * This source code is licensed under the ISC license. 263 * See the LICENSE file in the root directory of this source tree. 264 */const F1e=[["path",{d:"M3 11h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-5Zm0 0a9 9 0 1 1 18 0m0 0v5a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3Z",key:"12oyoe"}],["path",{d:"M21 16v2a4 4 0 0 1-4 4h-5",key:"1x7m43"}]],SJ=lt("headset",F1e);/** 265 * @license lucide-react v0.555.0 - ISC 266 * 267 * This source code is licensed under the ISC license. 268 * See the LICENSE file in the root directory of this source tree. 269 */const z1e=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],UU=lt("house",z1e);/** 270 * @license lucide-react v0.555.0 - ISC 271 * 272 * This source code is licensed under the ISC license. 273 * See the LICENSE file in the root directory of this source tree. 274 */const V1e=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],H1e=lt("key-round",V1e);/** 275 * @license lucide-react v0.555.0 - ISC 276 * 277 * This source code is licensed under the ISC license. 278 * See the LICENSE file in the root directory of this source tree. 279 */const W1e=[["path",{d:"M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z",key:"c2jq9f"}],["rect",{width:"4",height:"12",x:"2",y:"9",key:"mk3on5"}],["circle",{cx:"4",cy:"4",r:"2",key:"bt5ra8"}]],q1e=lt("linkedin",W1e);/** 280 * @license lucide-react v0.555.0 - ISC 281 * 282 * This source code is licensed under the ISC license. 283 * See the LICENSE file in the root directory of this source tree. 284 */const Z1e=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],sI=lt("loader-circle",Z1e);/** 285 * @license lucide-react v0.555.0 - ISC 286 * 287 * This source code is licensed under the ISC license. 288 * See the LICENSE file in the root directory of this source tree. 289 */const K1e=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],bC=lt("lock",K1e);/** 290 * @license lucide-react v0.555.0 - ISC 291 * 292 * This source code is licensed under the ISC license. 293 * See the LICENSE file in the root directory of this source tree. 294 */const G1e=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],AJ=lt("log-out",G1e);/** 295 * @license lucide-react v0.555.0 - ISC 296 * 297 * This source code is licensed under the ISC license. 298 * See the LICENSE file in the root directory of this source tree. 299 */const Y1e=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],wC=lt("mail",Y1e);/** 300 * @license lucide-react v0.555.0 - ISC 301 * 302 * This source code is licensed under the ISC license. 303 * See the LICENSE file in the root directory of this source tree. 304 */const J1e=[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",key:"q8bfy3"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14",key:"1853fq"}],["path",{d:"M8 6v8",key:"15ugcq"}]],XA=lt("megaphone",J1e);/** 305 * @license lucide-react v0.555.0 - ISC 306 * 307 * This source code is licensed under the ISC license. 308 * See the LICENSE file in the root directory of this source tree. 309 */const X1e=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],Q1e=lt("menu",X1e);/** 310 * @license lucide-react v0.555.0 - ISC 311 * 312 * This source code is licensed under the ISC license. 313 * See the LICENSE file in the root directory of this source tree. 314 */const eme=[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]],BU=lt("messages-square",eme);/** 315 * @license lucide-react v0.555.0 - ISC 316 * 317 * This source code is licensed under the ISC license. 318 * See the LICENSE file in the root directory of this source tree. 319 */const tme=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],nme=lt("refresh-cw",tme);/** 320 * @license lucide-react v0.555.0 - ISC 321 * 322 * This source code is licensed under the ISC license. 323 * See the LICENSE file in the root directory of this source tree. 324 */const rme=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],FU=lt("search",rme);/** 325 * @license lucide-react v0.555.0 - ISC 326 * 327 * This source code is licensed under the ISC license. 328 * See the LICENSE file in the root directory of this source tree. 329 */const ime=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],kJ=lt("settings",ime);/** 330 * @license lucide-react v0.555.0 - ISC 331 * 332 * This source code is licensed under the ISC license. 333 * See the LICENSE file in the root directory of this source tree. 334 */const sme=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],QA=lt("share-2",sme);/** 335 * @license lucide-react v0.555.0 - ISC 336 * 337 * This source code is licensed under the ISC license. 338 * See the LICENSE file in the root directory of this source tree. 339 */const ame=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",ke
339y:"oel41y"}]],ome=lt("shield",ame);/** 340 * @license lucide-react v0.555.0 - ISC 341 * 342 * This source code is licensed under the ISC license. 343 * See the LICENSE file in the root directory of this source tree. 344 */const lme=[["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}],["path",{d:"M3.103 6.034h17.794",key:"awc11p"}],["path",{d:"M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z",key:"o988cm"}]],cme=lt("shopping-bag",lme);/** 345 * @license lucide-react v0.555.0 - ISC 346 * 347 * This source code is licensed under the ISC license. 348 * See the LICENSE file in the root directory of this source tree. 349 */const ume=[["path",{d:"M2 20h.01",key:"4haj6o"}],["path",{d:"M7 20v-4",key:"j294jx"}],["path",{d:"M12 20v-8",key:"i3yub9"}],["path",{d:"M17 20V8",key:"1tkaf5"}],["path",{d:"M22 4v16",key:"sih9yq"}]],dme=lt("signal",ume);/** 350 * @license lucide-react v0.555.0 - ISC 351 * 352 * This source code is licensed under the ISC license. 353 * See the LICENSE file in the root directory of this source tree. 354 */const hme=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}
354],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],n3=lt("sparkles",hme);/** 355 * @license lucide-react v0.555.0 - ISC 356 * 357 * This source code is licensed under the ISC license. 358 * See the LICENSE file in the root directory of this source tree. 359 */const fme=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],l8=lt("star",fme);/** 360 * @license lucide-react v0.555.0 - ISC 361 * 362 * This source code is licensed under the ISC license. 363 * See the LICENSE file in the root directory of this source tree. 364 */const pme=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],zU=lt("trending-up",pme);/** 365 * @license lucide-react v0.555.0 - ISC 366 * 367 * This source code is licensed under the ISC license. 368 * See the LICENSE file in the root directory of this source tree. 369 */const mme=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],e4=lt("triangle-alert",mme);/** 370 * @license lucide-react v0.555.0 - ISC 371 * 372 * This source code is licensed under the ISC license. 373 * See the LICENSE file in the root directory of this source tree. 374 */const yme=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],TJ=lt("user",yme);/** 375 * @license lucide-react v0.555.0 - ISC 376 * 377 * This source code is licensed under the ISC license. 378 * See the LICENSE file in the root directory of this source tree. 379 */const gme=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],VU=lt("users",gme);/** 380 * @license lucide-react v0.555.0 - ISC 381 * 382 * This source code is licensed under the ISC license. 383 * See the LICENSE file in the root directory of this source tree. 384 */const bme=[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]],HU=lt("wallet",bme);/** 385 * @license lucide-react v0.555.0 - ISC 386 * 387 * This source code is licensed under the ISC license. 388 * See the LICENSE file in the root directory of this source tree. 389 */const wme=[["circle",{cx:"12",cy:"4.5",r:"2.5",key:"r5ysbb"}],["path",{d:"m10.2 6.3-3.9 3.9",key:"1nzqf6"}],["circle",{cx:"4.5",cy:"12",r:"2.5",key:"jydg6v"}],["path",{d:"M7 12h10",key:"b7w52i"}],["circle",{cx:"19.5",cy:"12",r:"2.5",key:"1piiel"}],["path",{d:"m13.8 17.7 3.9-3.9",key:"1wyg1y"}],["circle",{cx:"12",cy:"19.5",r:"2.5",key:"13o1pw"}]],vme=lt("waypoints",wme);/** 390 * @license lucide-react v0.555.0 - ISC 391 * 392 * This source code is licensed under the ISC license. 393 * See the LICENSE file in the root directory of this source tree. 394 */const _me=[["path",{d:"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17",key:"1q2vi4"}],["path",{d:"m10 15 5-3-5-3z",key:"1jp15x"}]],LJ=lt("youtube",_me);/** 395 * @license lucide-react v0.555.0 - ISC 396 * 397 * This source code is licensed under the ISC license. 398 * See the LICENSE file in the root directory of this source tree. 399 */const xme=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ml=lt("x",xme);/** 400 * @license lucide-react v0.555.0 - ISC 401 * 402 * This source code is licensed under the ISC license. 403 * See the LICENSE file in the root directory of this source tree. 404 */const Cme=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],bu=lt("zap",Cme);function n7(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function Eme(t,e,n,r){function i(s){return s instanceof n?s:new n(function(a){a(s)})}
404return new(n||(n=Promise))(function(s,a){function o(f){try{u(r.next(f))}catch(p){a(p)}}function l(f){try{u(r.throw(f))}catch(p){a(p)}}function u(f){f.done?s(f.value):i(f.value).then(o,l)}u((r=r.apply(t,e||[])).next())})}const Sme=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);class aI extends Error{constructor(e,n="FunctionsError",r){super(e),this.name=n,this.context=r}}class Ame extends aI{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class WU extends aI{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class qU extends aI{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var ek;(function(t){t.Any="any",t.ApNortheast1="ap-northeast-1",t.ApNortheast2="ap-northeast-2",t.ApSouth1="ap-south-1",t.ApSoutheast1="ap-southeast-1",t.ApSoutheast2="ap-southeast-2",t.CaCentral1="ca-central-1",t.EuCentral1="eu-central-1",t.EuWest1="eu-west-1",t.EuWest2="eu-west-2",t.EuWest3="eu-west-3",t.SaEast1="sa-east-1",t.UsEast1="us-east-1",t.UsWest1="us-west-1",t.UsWest2="us-west-2"})(ek||(ek={}));class kme{constructor(e,{headers:n={},customFetch:r,region:i=ek.Any}={}){this.url=e,this.headers=n,this.region=i,this.fetch=Sme(r)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return Eme(this,arguments,void 0,function*(n,r={}){var i;let s,a;
404try{const{headers:o,method:l,body:u,signal:f,timeout:p}=r;let y={},{region:g}=r;g||(g=this.region);const b=new URL(`${this.url}/${n}`);g&&g!=="any"&&(y["x-region"]=g,b.searchParams.set("forceFunctionRegion",g));let v;u&&(o&&!Object.prototype.hasOwnProperty.call(o,"Content-Type")||!o)?typeof Blob<"u"&&u instanceof Blob||u instanceof ArrayBuffer?(y["Content-Type"]="application/octet-stream",v=u):typeof u=="string"?(y["Content-Type"]="text/plain",v=u):typeof FormData<"u"&&u instanceof FormData?v=u:(y["Content-Type"]="application/json",v=JSON.stringify(u)):u&&typeof u!="string"&&!(typeof Blob<"u"&&u instanceof Blob)&&!(u instanceof ArrayBuffer)&&!(typeof FormData<"u"&&u instanceof FormData)?v=JSON.stringify(u):v=u;let _=f;p&&(a=new AbortController,s=setTimeout(()=>a.abort(),p),f?(_=a.signal,f.addEventListener("abort",()=>a.abort())):_=a.signal);const C=yield this.fetch(b.toString(),{method:l||"POST",headers:Object.assign(Object.assign(Object.assign({},y),this.headers),o),body:v,signal:_}).catch(I=>{throw new Ame(I)}),S=C.headers.get("x-relay-error");if(S&&S==="true")throw new WU(C);if(!C.ok)throw new qU(C);let x=((i=C.headers.get("Content-Type"))!==null&&i!==void 0?i:"text/plain").split(";")[0].trim(),A;return x==="application/json"?A=yield C.json():x==="application/octet-stream"||x==="application/pdf"?A=yield C.blob():x==="text/event-stream"?A=C:x==="multipart/form-data"?A=yield C.formData():A=yield C.text(),{data:A,error:null,response:C}}catch(o){return{data:null,error:o,response:o instanceof qU||o instanceof WU?o.context:void 0}}finally{s&&clearTimeout(s)}})}}var Tme=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.co
404de=t.code}},Lme=class{constructor(t){var e,n,r;this.shouldThrowOnError=!1,this.method=t.method,this.url=t.url,this.headers=new Headers(t.headers),this.schema=t.schema,this.body=t.body,this.shouldThrowOnError=(e=t.shouldThrowOnError)!==null&&e!==void 0?e:!1,this.signal=t.signal,this.isMaybeSingle=(n=t.isMaybeSingle)!==null&&n!==void 0?n:!1,this.urlLengthLimit=(r=t.urlLengthLimit)!==null&&r!==void 0?r:8e3,t.fetch?this.fetch=t.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,e){return this.headers=new Headers(this.headers),this.headers.set(t,e),this}then(t,e){var n=this;this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");const r=this.fetch;let i=r(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async s=>{let a=null,o=null,l=null,u=s.status,f=s.statusText;if(s.ok){var p,y;if(n.method!=="HEAD"){var g;const C=await s.text();C===""||(n.headers.get("Accept")==="text/csv"||n.headers.get("Accept")&&(!((g=n.headers.get("Accept"))===null||g===void 0)&&g.includes("application/vnd.pgrst.plan+text"))?o=C:o=JSON.parse(C))}const v=(p=n.headers.get("Prefer"))===null||p===void 0?void 0:p.match(/count=(exact|planned|estimated)/),_=(y=s.headers.get("content-range"))===null||y===void 0?void 0:y.split("/");v&&_&&_.length>1&&(l=parseInt(_[1])),n.isMaybeSingle&&n.method==="GET"&&Array.isArray(o)&&(o.length>1?(a={code:"PGRST116",details:`Results contain ${o.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},o=null,l=null,u=406,f="Not Acceptable"):o.length===1?o=o[0]:o=null)}else{var b;const v=await s.text();try{a=JSON.parse(v),Array.isArray(a)&&s.status===404&&(o=[],a=null,u=200,f="OK")}catch{s.status===404&&v===""?(u=204,f="No Content"):a={message:v}}if(a&&n.isMaybeSingle&&(!(a==null||(b=a.details)===null||b===void 0)&&b.includes("0 rows"))&&(a=null,u=200,f="OK"),a&&n.shouldThrowOnError)throw new Tme(a)}return{error:a,data:o,count:l,status:u,statusText:f}});return this.shouldThrowOnError||(i=i.catch(s=>{var a;let o="",l="",u="";const f=s==null?void 0:s.cause;if(f){var p,y,g,b;const C=(p=f==null?void 0:f.message)!==null&&p!==void 0?p:"",S=(y=f==null?void 0:f.code)!==null&&y!==void 0?y:"";o=`${(g=s==null?void 0:s.name)!==null&&g!==void 0?g:"FetchError"}: ${s==null?void 0:s.message}`,o+=` 405 406Caused by: ${(b=f==null?void 0:f.name)!==null&&b!==void 0?b:"Error"}: ${C}`,S&&(o+=` (${S})`),f!=null&&f.stack&&(o+=` 407${f.stack}`)}else{var v;o=(v=s==null?void 0:s.stack)!==null&&v!==void 0?v:""}const _=this.url.toString().length;return(s==null?void 0:s.name)==="AbortError"||(s==null?void 0:s.code)==="ABORT_ERR"?(u="",l="Request was aborted (timeout or manual cancellation)",_>this.urlLengthLimit&&(l+=`. Note: Your request URL is ${_} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((f==null?void 0:f.name)==="HeadersOverflowError"||(f==null?void 0:f.code)==="UND_ERR_HEADERS_OVERFLOW")&&(u="",l="HTTP headers exceeded server limits (typically 16KB)",_>this.urlLengthLimit&&(l+=`. Your request URL is ${_} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{error:{message:`${(a=s==null?void 0:s.name)!==null&&a!==void 0?a:"FetchError"}: ${s==null?void 0:s.message}`,details:o,hint:l,code:u},data:null,count:null,status:0,statusText:""}})),i.then(t,e)}returns(){return this}overrideTypes(){return this}},$me=class extends Lme{select(t){let e=!1;const n=(t??"*").split("").map(r=>/\s/.test(r)&&!e?"":(r==='"'&&(e=!e),r)).join("");return this.url.searchParams.set("select",n),this.headers.append("Prefer","return=representation"),this}order(t,{ascending:e=!0,nullsFirst:n,foreignTable:r,referencedTable:i=r}={}){const s=i?`${i}.order`:"order",a=this.url.searchParams.get(s);return this.url.searchParams.set(s,`${a?`${a},`:""}${t}.${e?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(t,{foreignTable:e,referencedTable:n=e}={}){const r=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(r,`${t}`),this}range(t,e,{foreignTable:n,referencedTable:r=n}={}){const i=typeof r>"u"?"offset":`${r}.offset`,s=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(i,`${t}`),this.url.searchParams.set(s,`${e-t+1}`),this}abortSignal(t){return this.signal=t,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}
407explain({analyze:t=!1,verbose:e=!1,settings:n=!1,buffers:r=!1,wal:i=!1,format:s="text"}={}){var a;const o=[t?"analyze":null,e?"verbose":null,n?"settings":null,r?"buffers":null,i?"wal":null].filter(Boolean).join("|"),l=(a=this.headers.get("Accept"))!==null&&a!==void 0?a:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${s}; for="${l}"; options=${o};`),s==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(t){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${t}`),this}};const ZU=new RegExp("[,()]");var y0=class extends $me{eq(t,e){return this.url.searchParams.append(t,`eq.${e}`),this}neq(t,e){return this.url.searchParams.append(t,`neq.${e}`),this}gt(t,e){return this.url.searchParams.append(t,`gt.${e}`),this}gte(t,e){return this.url.searchParams.append(t,`gte.${e}`),this}lt(t,e){return this.url.searchParams.append(t,`lt.${e}`),this}lte(t,e){return this.url.searchParams.append(t,`lte.${e}`),this}like(t,e){return this.url.searchParams.append(t,`like.${e}`),this}likeAllOf(t,e){return this.url.searchParams.append(t,`like(all).{${e.join(",")}}`),this}likeAnyOf(t,e){return this.url.searchParams.append(t,`like(any).{${e.join(",")}}`),this}ilike(t,e){return this.url.searchParams.append(t,`ilike.${e}`),this}ilikeAllOf(t,e){return this.url.searchParams.append(t,`ilike(all).{${e.join(",")}}`),this}ilikeAnyOf(t,e){return this.url.searchParams.append(t,`ilike(any).{${e.join(",")}}`),this}regexMatch(t,e){return this.url.searchParams.append(t,`match.${e}`),this}regexIMatch(t,e){return this.url.searchParams.append(t,`imatch.${e}`),this}is(t,e){return this.url.searchParams.append(t,`is.${e}`),this}isDistinct(t,e){return this.url.searchParams.append(t,`isdistinct.${e}`),this}in(t,e){const n=Array.from(new Set(e)).map(r=>typeof r=="string"&&ZU.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(t,`in.(${n})`),this}notIn(t,e){const n=Array.from(new Set(e)).map(r=>typeof r=="string"&&ZU.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(t,`not.in.(${n})`),this}contains(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cs.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cs.{${e.join(",")}}`):this.url.searchParams.append(t,`cs.${JSON.stringify(e)}`),this}containedBy(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cd.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cd.{${e.join(",")}}`):this.url.searchParams.append(t,`cd.${JSON.stringify(e)}`),this}rangeGt(t,e){return this.url.searchParams.append(t,`sr.${e}`),this}rangeGte(t,e){return this.url.searchParams.append(t,`nxl.${e}`),this}rangeLt(t,e){return this.url.searchParams.append(t,`sl.${e}`),this}rangeLte(t,e){return this.url.searchParams.append(t,`nxr.${e}`),this}rangeAdjacent(t,e){return this.url.searchParams.append(t,`adj.${e}`),this}overlaps(t,e){return typeof e=="string"?this.url.searchParams.append(t,`ov.${e}`):this.url.searchParams.append(t,`ov.{${e.join(",")}}`),this}textSearch(t,e,{config:n,type:r}={}){let i="";r==="plain"?i="pl":r==="phrase"?i="ph":r==="websearch"&&(i="w");const s=n===void 0?"":`(${n})`;return this.url.searchParams.append(t,`${i}fts${s}.${e}`),this}match(t){return Object.entries(t).forEach(([e,n])=>{this.url.searchParams.append(e,`eq.${n}`)}),this}not(t,e,n){return this.url.searchParams.append(t,`not.${e}.${n}`),this}or(t,{foreignTable:e,referencedTable:n=e}={}){const r=n?`${n}.or`:"or";return this.url.searchParams.append(r,`(${t})`),this}filter(t,e,n){return this.url.searchParams.append(t,`${e}.${n}`),this}},Ime=class{constructor(t,{headers:e={},schema:n,fetch:r,urlLengthLimit:i=8e3}){this.url=t,this.headers=new Headers(e),this.schema=n,this.fetch=r,this.urlLengthLimit=i}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(t,e){const{head:n=!1,count:r}=e??{},i=n?"HEAD":"GET";let s=!1;const a=(t??"*").split("").map(u=>/\s/.test(u)&&!s?"":(u==='"'&&(s=!s),u)).join(""),{url:o,headers:l}=this.cloneRequestState();return o.searchParams.set("select",a),r&&l.append("Prefer",`count=${r}`),new y0({method:i,url:o,headers:l,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}insert(t,{count:e,defaultToNull:n=!0}={}){var r;const i="POST",{url:s,headers:a}=this.cloneRequestState();if(e&&a.append("Prefer",`count=${e}`),n||a.append("Prefer","missing=default"),Array.isArray(t)){const o=t.reduce((l,u)=>l.concat(Object.keys(u)),[]);if(o.length>0){const l=[...new Set(o)].map(u=>`"${u}"`);s.searchParams.set("columns",l.join(","))}}return new y0({method:i,url:s,headers:a,schema:this.schema,body:t,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit})}upsert(t,{onConflict:e,ignoreDuplicates:n=!1,count:r,defaultToNull:i=!0}={}){var s;const a="POST",{url:o,headers:l}=this.cloneRequestState();if(l.append("Prefer",`resolution=${n?"ignore":"merge"}-duplicates`),e!==void 0&&o.searchParams.set("on_conflict",e),r&&l.append("Prefer",`count=${r}`),i||l.append("Prefer","missing=default"),Array.isArray(t)){const u=t.reduce((f,p)=>f.concat(Object.keys(p)),[]);if(u.length>0){const f=[...new Set(u)].map(p=>`"${p}"`);o.searchParams.set("columns",f.join(","))}}return new y0({method:a,url:o,headers:l,schema:this.schema,body:t,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch,urlLengthLimit:this.urlLengthLimit})}update(t,{count:e}={}){var n;const r="PATCH",{url:i,headers:s}=this.cloneRequestState();return e&&s.append("Prefer",`count=${e}`),new y0({method:r,url:i,headers:s,schema:this.schema,body:t,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit})}delete({count:t}={}){var e;const n="DELETE",{url:r,headers:i}=this.cloneRequestState();return t&&i.append("Prefer",`count=${t}`),new y0({method:n,url:r,headers:i,schema:this.schema,fetch:(e=this.fetch)!==null&&e!==void 0?e:fetch,urlLengthLimit:this.urlLengthLimit})}};function r3(t){"@babel/helpers - typeof";return r3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r3(t)}function Nme(t,e){if(r3(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(r3(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ome(t){var e=Nme(t,"string");return r3(e)=="symbol"?e:e+""}function Pme(t,e,n){return(e=Ome(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function KU(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function t4(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};
407e%2?KU(Object(n),!0).forEach(function(r){Pme(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):KU(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var Rme=class $J{constructor(e,{headers:n={},schema:r,fetch:i,timeout:s,urlLengthLimit:a=8e3}={}){this.url=e,this.headers=new Headers(n),this.schemaName=r,this.urlLengthLimit=a;const o=i??globalThis.fetch;s!==void 0&&s>0?this.fetch=(l,u)=>{const f=new AbortController,p=setTimeout(()=>f.abort(),s),y=u==null?void 0:u.signal;if(y){if(y.aborted)return clearTimeout(p),o(l,u);const g=()=>{clearTimeout(p),f.abort()};return y.addEventListener("abort",g,{once:!0}),o(l,t4(t4({},u),{},{signal:f.signal})).finally(()=>{clearTimeout(p),y.removeEventListener("abort",g)})}return o(l,t4(t4({},u),{},{signal:f.signal})).finally(()=>clearTimeout(p))}:this.fetch=o}from(e){if(!e||typeof e!="string"||e.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");
407return new Ime(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}schema(e){return new $J(this.url,{headers:this.headers,schema:e,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}rpc(e,n={},{head:r=!1,get:i=!1,count:s}={}){var a;let o;const l=new URL(`${this.url}/rpc/${e}`);let u;const f=g=>g!==null&&typeof g=="object"&&(!Array.isArray(g)||g.some(f)),p=r&&Object.values(n).some(f);p?(o="POST",u=n):r||i?(o=r?"HEAD":"GET",Object.entries(n).filter(([g,b])=>b!==void 0).map(([g,b])=>[g,Array.isArray(b)?`{${b.join(",")}}`:`${b}`]).forEach(([g,b])=>{l.searchParams.append(g,b)})):(o="POST",u=n);const y=new Headers(this.headers);return p?y.set("Prefer",s?`count=${s},return=minimal`:"return=minimal"):s&&y.set("Prefer",`count=${s}`),new y0({method:o,url:l,headers:y,schema:this.schemaName,body:u,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch,urlLengthLimit:this.urlLengthLimit})}};class jme{constructor(){}static detectEnvironment(){var e;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((e=navigator.userAgent)===null||e===void 0)&&e.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const n=globalThis.process;if(n){const r=n.versions;if(r&&r.node){const i=r.node,s=parseInt(i.replace(/^v/,"").split(".")[0]);return s>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${s} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${s} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option: 408import ws from "ws" 409new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const e=this.detectEnvironment();if(e.constructor)return e.constructor;let n=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(n+=` 410 411Suggested solution: ${e.workaround}`),new Error(n)}static createWebSocket(e,n){const r=this.getWebSocketConstructor();return new r(e,n)}static isWebSocketSupported(){try{const e=this.detectEnvironment();return e.type==="native"||e.type==="ws"}catch{return!1}}}const Mme="2.98.0",Dme=`realtime-js/${Mme}`,Ume="1.0.0",IJ="2.0.0",GU=IJ,tk=1e4,Bme=1e3,Fme=100;var Wd;(function(t){t[t.connecting=0]="connecting",t[t.open=1]="open",t[t.closing=2]="closing",t[t.closed=3]="closed"})(Wd||(Wd={}));var Ti;(function(t){t.closed="closed",t.errored="errored",t.joined="joined",t.joining="joining",t.leaving="leaving"})(Ti||(Ti={}));var ll;(function(t){t.close="phx_close",t.error="phx_error",t.join="phx_join",t.reply="phx_reply",t.leave="phx_leave",t.access_token="access_token"})(ll||(ll={}));var nk;(function(t){t.websocket="websocket"})(nk||(nk={}));var Oh;(function(t){t.Connecting="connecting",t.Open="open",t.Closing="closing",t.Closed="closed"})(Oh||(Oh={}));class zme{constructor(e){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=e??[]}encode(e,n){if(e.event===this.BROADCAST_EVENT&&!(e.payload instanceof ArrayBuffer)&&typeof e.payload.event=="string")return n(this._binaryEncodeUserBroadcastPush(e));let r=[e.join_ref,e.ref,e.topic,e.event,e.payload];return n(JSON.stringify(r))}_binaryEncodeUserBroadcastPush(e){var n;return this._isArrayBuffer((n=e.payload)===null||n===void 0?void 0:n.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){var n,r;const i=(r=(n=e.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,i)}_encodeJsonUserBroadcastPush(e){var n,r;const i=(r=(n=e.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:{},a=new TextEncoder().encode(JSON.stringify(i)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,a)}_encodeUserBroadcastPush(e,n,r){var i,s;const a=e.topic,o=(i=e.ref)!==null&&i!==void 0?i:"",l=(s=e.join_ref)!==null&&s!==void 0?s:"",u=e.payload.event,f=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},p=Object.keys(f).length===0?"":JSON.stringify(f);
411if(l.length>255)throw new Error(`joinRef length ${l.length} exceeds maximum of 255`);if(o.length>255)throw new Error(`ref length ${o.length} exceeds maximum of 255`);if(a.length>255)throw new Error(`topic length ${a.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`userEvent length ${u.length} exceeds maximum of 255`);if(p.length>255)throw new Error(`metadata length ${p.length} exceeds maximum of 255`);const y=this.USER_BROADCAST_PUSH_META_LENGTH+l.length+o.length+a.length+u.length+p.length,g=new ArrayBuffer(this.HEADER_LENGTH+y);let b=new DataView(g),v=0;b.setUint8(v++,this.KINDS.userBroadcastPush),b.setUint8(v++,l.length),b.setUint8(v++,o.length),b.setUint8(v++,a.length),b.setUint8(v++,u.length),b.setUint8(v++,p.length),b.setUint8(v++,n),Array.from(l,C=>b.setUint8(v++,C.charCodeAt(0))),Array.from(o,C=>b.setUint8(v++,C.charCodeAt(0))),Array.from(a,C=>b.setUint8(v++,C.charCodeAt(0))),Array.from(u,C=>b.setUint8(v++,C.charCodeAt(0))),Array.from(p,C=>b.setUint8(v++,C.charCodeAt(0)));var _=new Uint8Array(g.byteLength+r.byteLength);return _.set(new Uint8Array(g),0),_.set(new Uint8Array(r),g.byteLength),_.buffer}decode(e,n){if(this._isArrayBuffer(e)){let r=this._binaryDecode(e);return n(r)}if(typeof e=="string"){const r=JSON.parse(e),[i,s,a,o,l]=r;return n({join_ref:i,ref:s,topic:a,event:o,payload:l})}return n({})}_binaryDecode(e){const n=new DataView(e),r=n.getUint8(0),i=new TextDecoder;switch(r){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(e,n,i)}}_decodeUserBroadcast(e,n,r){const i=n.getUint8(1),s=n.getUint8(2),a=n.getUint8(3),o=n.getUint8(4);let l=this.HEADER_LENGTH+4;const u=r.decode(e.slice(l,l+i));l=l+i;const f=r.decode(e.slice(l,l+s));l=l+s;const p=r.decode(e.slice(l,l+a));l=l+a;const y=e.slice(l,e.byteLength),g=o===this.JSON_ENCODING?JSON.parse(r.decode(y)):y,b={type:this.BROADCAST_EVENT,event:f,payload:g};return a>0&&(b.meta=JSON.parse(p)),{join_ref:null,ref:null,topic:u,event:this.BROADCAST_EVENT,payload:b}}_isArrayBuffer(e){var n;return e instanceof ArrayBuffer||((n=e==null?void 0:e.constructor)===null||n===void 0?void 0:n.name)==="ArrayBuffer"}_pick(e,n){return!e||typeof e!="object"?{}:Object.fromEntries(Object.entries(e).filter(([r])=>n.includes(r)))}}class NJ{constructor(e,n){this.callback=e,this.timerCalc=n,this.timer=void 0,this.tries=0,this.callback=e,this.timerCalc=n}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var hr;(function(t){t.abstime="abstime",t.bool="bool",t.date="date",t.daterange="daterange",t.float4="float4",t.float8="float8",t.int2="int2",t.int4="int4",t.int4range="int4range",t.int8="int8",t.int8range="int8range",t.json="json",t.jsonb="jsonb",t.money="money",t.numeric="numeric",t.oid="oid",t.reltime="reltime",t.text="text",t.time="time",t.timestamp="timestamp",t.timestamptz="timestamptz",t.timetz="timetz",t.tsrange="tsrange",t.tstzrange="tstzrange"})(hr||(hr={}));const YU=(t,e,n={})=>{var r;const i=(r=n.skipTypes)!==null&&r!==void 0?r:[];return e?Object.keys(e).reduce((s,a)=>(s[a]=Vme(a,t,e,i),s),{}):{}},Vme=(t,e,n,r)=>{const i=e.find(o=>o.name===t),s=i==null?void 0:i.type,a=n[t];return s&&!r.includes(s)?OJ(s,a):rk(a)},OJ=(t,e)=>{if(t.charAt(0)==="_"){const n=t.slice(1,t.length);return Zme(e,n)}switch(t){case hr.bool:return Hme(e);case hr.float4:case hr.float8:case hr.int2:case hr.int4:case hr.int8:case hr.numeric:case hr.oid:return Wme(e);case hr.json:case hr.jsonb:return qme(e);case hr.timestamp:return Kme(e);case hr.abstime:case hr.date:case hr.daterange:case hr.int4range:case hr.int8range:case hr.money:case hr.reltime:case hr.text:case hr.time:case hr.timestamptz:case hr.timetz:case hr.tsrange:case hr.tstzrange:return rk(e);default:return rk(e)}},rk=t=>t,Hme=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}},Wme=t=>{if(typeof t=="string"){const e=parseFloat(t);if(!Number.isNaN(e))return e}return t},qme=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t},Zme=(t,e)=>{if(typeof t!="string")return t;const n=t.length-1,r=t[n];if(t[0]==="{"&&r==="}"){let s;const a=t.slice(1,n);try{s=JSON.parse("["+a+"]")}catch{s=a?a.split(","):[]}return s.map(o=>OJ(e,o))}return t},Kme=t=>typeof t=="string"?t.replace(" ","T"):t,PJ=t=>{const e=new URL(t);return e.protocol=e.protocol.replace(/^ws/i,"http"),e.pathname=e.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),e.pathname===""||e.pathname==="/"?e.pathname="/api/broadcast":e.pathname=e.pathname+"/api/broadcast",e.href};class vC{constructor(e,n,r={},i=tk){this.channel=e,this.event=n,this.payload=r,this.timeout=i,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHo
411oks=[],this.refEvent=null}resend(e){this.timeout=e,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(e){this.payload=Object.assign(Object.assign({},this.payload),e)}receive(e,n){var r;return this._hasReceived(e)&&n((r=this.receivedResp)===null||r===void 0?void 0:r.response),this.recHooks.push({status:e,callback:n}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const e=n=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=n,this._matchReceive(n)};this.channel._on(this.refEvent,{},e),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(e,n){this.refEvent&&this.channel._trigger(this.refEvent,{status:e,response:n})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:e,response:n}){this.recHooks.filter(r=>r.status===e).forEach(r=>r.callback(n))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}}var JU;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(JU||(JU={}));class $g{constructor(e,n){this.channel=e,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const r=(n==null?void 0:n.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(r.state,{},i=>{const{onJoin:s,onLeave:a,onSync:o}=this.caller;this.joinRef=this.channel._joinRef(),this.state=$g.syncState(this.state,i,s,a),this.pendingDiffs.forEach(l=>{this.state=$g.syncDiff(this.state,l,s,a)}),this.pendingDiffs=[],o()}),this.channel._on(r.diff,{},i=>{const{onJoin:s,onLeave:a,onSync:o}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(i):(this.state=$g.syncDiff(this.state,i,s,a),o())}),this.onJoin((i,s,a)=>{this.channel._trigger("presence",{event:"join",key:i,currentPresences:s,newPresences:a})}),this.onLeave((i,s,a)=>{this.channel._trigger("presence",{event:"leave",key:i,currentPresences:s,leftPresences:a})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(e,n,r,i){const s=this.cloneDeep(e),a=this.transformState(n),o={},l={};return this.map(s,(u,f)=>{a[u]||(l[u]=f)}),this.map(a,(u,f)=>{const p=s[u];if(p){const y=f.map(_=>_.presence_ref),g=p.map(_=>_.presence_ref),b=f.filter(_=>g.indexOf(_.presence_ref)<0),v=p.filter(_=>y.indexOf(_.presence_ref)<0);b.length>0&&(o[u]=b),v.length>0&&(l[u]=v)}else o[u]=f}),this.syncDiff(s,{joins:o,leaves:l},r,i)}static syncDiff(e,n,r,i){const{joins:s,leaves:a}={joins:this.transformState(n.joins),leaves:this.transformState(n.leaves)};return r||(r=()=>{}),i||(i=()=>{}),this.map(s,(o,l)=>{var u;const f=(u=e[o])!==null&&u!==void 0?u:[];if(e[o]=this.cloneDeep(l),f.length>0){const p=e[o].map(g=>g.presence_ref),y=f.filter(g=>p.indexOf(g.presence_ref)<0);e[o].unshift(...y)}r(o,f,l)}),this.map(a,(o,l)=>{let u=e[o];if(!u)return;const f=l.map(p=>p.presence_ref);u=u.filter(p=>f.indexOf(p.presence_ref)<0),e[o]=u,i(o,u,l),u.length===0&&delete e[o]}),e}static map(e,n){return Object.getOwnPropertyNames(e).map(r=>n(r,e[r]))}static transformState(e){return e=this.cloneDeep(e),Object.getOwnPropertyNames(e).reduce((n,r)=>{const i=e[r];return"metas"in i?n[r]=i.metas.map(s=>(s.presence_ref=s.phx_ref,delete s.phx_ref,delete s.phx_ref_prev,s)):n[r]=i,n},{})}static cloneDeep(e){return JSON.parse(JSON.stringify(e))}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var XU;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELETE="DELETE"})(XU||(XU={}));var Ig;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(Ig||(Ig={}));var ru;(function(t){t.SUBSCRIBED="SUBSCRIBED",t.TIMED_OUT="TIMED_OUT",t.CLOSED="CLOSED",t.CHANNEL_ERROR="CHANNEL_ERROR"})(ru||(ru={}));class k0{constructor(e,n={config:{}},r){var i,s;if(this.topic=e,this.params=n,this.socket=r,this.bindings={},this.state=Ti.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},n.config),this.timeout=this.socket.timeout,this.joinPush=new vC(this,ll.join,this.params,this.timeout),this.rejoinTimer=new NJ(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=Ti.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(a=>a.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=Ti.closed,this.socket._remove(this)}),this._onError(a=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,a),this.state=Ti.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=Ti.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",a=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,a),this.state=Ti.errored,this.rejoinTimer.scheduleTimeout())}),this._on(ll.reply,{},(a,o)=>{this._trigger(this._replyEventName(o),a)}),this.presence=new $g(this),this.broadcastEndpointURL=PJ(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(!((s=(i=this.params.config)===null||i===void 0?void 0:i.broadcast)===null||s===void 0)&&s.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(e,n=this.timeout){var r,i,s;if(this.socket.isConnected()||this.socket.connect(),this.state==Ti.closed){const{config:{broadcast:a,presence:o,private:l}}=this.params,u=(i=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(g=>g.filter))!==null&&i!==void 0?i:[],f=!!this.bindings[Ig.PRESENCE]&&this.bindings[Ig.PRESENCE].length>0||((s=this.params.config.presence)===null||s===void 0?void 0:s.enabled)===!0,p={},y={broadcast:a,presence:Object.assign(Object.assign({},o),{enabled:f}),postgres_changes:u,private:l};this.socket.accessTokenValue&&(p.access_token=this.socket.accessTokenValue),this._onError(g=>e==null?void 0:e(ru.CHANNEL_ERROR,g)),this._onClose(()=>e==null?void 0:e(ru.CLOSED)),this.updateJoinPayload(Object.assign({config:y},p)),this.joinedOnce=!0,this._rejoin(n),this.joinPush.receive("ok",async({postgres_changes:g})=>{var b;if(this.socket._isManualToken()||this.socket.setAuth(),g===void 0){e==null||e(ru.SUBSCRIBED);return}else{const v=this.bindings.postgres_changes,_=(b=v==null?void 0:v.length)!==null&&b!==void 0?b:0,C=[];for(let S=0;S<_;S++){const x=v[S],{filter:{event:A,schema:I,table:$,filter:O}}=x,P=g&&g[S];
411if(P&&P.event===A&&k0.isFilterValueEqual(P.schema,I)&&k0.isFilterValueEqual(P.table,$)&&k0.isFilterValueEqual(P.filter,O))C.push(Object.assign(Object.assign({},x),{id:P.id}));else{this.unsubscribe(),this.state=Ti.errored,e==null||e(ru.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=C,e&&e(ru.SUBSCRIBED);return}}).receive("error",g=>{this.state=Ti.errored,e==null||e(ru.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(g).join(", ")||"error")))}).receive("timeout",()=>{e==null||e(ru.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(e,n={}){return await this.send({type:"presence",event:"track",payload:e},n.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,n,r){return this.state===Ti.joined&&e===Ig.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(async()=>await this.subscribe())),this._on(e,n,r)}async httpSend(e,n,r={}){var i;if(n==null)return Promise.reject("Payload is required for httpSend()");const s={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(s.Authorization=`Bearer ${this.socket.accessTokenValue}`);const a={method:"POST",headers:s,body:JSON.stringify({messages:[{topic:this.subTopic,event:e,payload:n,private:this.private}]})},o=await this._fetchWithTimeout(this.broadcastEndpointURL,a,(i=r.timeout)!==null&&i!==void 0?i:this.timeout);if(o.status===202)return{success:!0};let l=o.statusText;try{const u=await o.json();l=u.error||u.message||l}catch{}return Promise.reject(new Error(l))}async send(e,n={}){var r,i;if(!this._canPush()&&e.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated
411in the future. Please use httpSend() explicitly for REST delivery.");const{event:s,payload:a}=e,o={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(o.Authorization=`Bearer ${this.socket.accessTokenValue}`);const l={method:"POST",headers:o,body:JSON.stringify({messages:[{topic:this.subTopic,event:s,payload:a,private:this.private}]})};try{const u=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(r=n.timeout)!==null&&r!==void 0?r:this.timeout);return await((i=u.body)===null||i===void 0?void 0:i.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(s=>{var a,o,l;const u=this._push(e.type,e,n.timeout||this.timeout);e.type==="broadcast"&&!(!((l=(o=(a=this.params)===null||a===void 0?void 0:a.config)===null||o===void 0?void 0:o.broadcast)===null||l===void 0)&&l.ack)&&s("ok"),u.receive("ok",()=>s("ok")),u.receive("error",()=>s("error")),u.receive("timeout",()=>s("timed out"))})}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=Ti.leaving;const n=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(ll.close,"leave",this._joinRef())};this.joinPush.destroy();let r=null;return new Promise(i=>{r=new vC(this,ll.leave,{},e),r.receive("ok",()=>{n(),i("ok")}).receive("timeout",()=>{n(),i("timed out")}).receive("error",()=>{i("error")}),r.send(),this._canPush()||r.trigger("ok",{})}).finally(()=>{r==null||r.destroy()})}teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Ti.closed,this.bindings={}}async _fetchWithTimeout(e,n,r){const i=new AbortController,s=setTimeout(()=>i.abort(),r),a=await this.socket.fetch(e,Object.assign(Object.assign({},n),{signal:i.signal}));return clearTimeout(s),a}_push(e,n,r=this.timeout){if(!this.joinedOnce)throw`tried to push '${e}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let i=new vC(this,e,n,r);return this._canPush()?i.send():this._addToPushBuffer(i),i}_addToPushBuffer(e){if(e.startTimeout(),this.pushBuffer.push(e),this.pushBuffer.length>Fme){const n=this.pushBuffer.shift();n&&(n.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${n.event}`,n.payload))}}_onMessage(e,n,r){return n}_isMember(e){return this.topic===e}_joinRef(){return this.joinPush.ref}_trigger(e,n,r){var i,s;const a=e.toLocaleLowerCase(),{close:o,error:l,leave:u,join:f}=ll;if(r&&[o,l,u,f].indexOf(a)>=0&&r!==this._joinRef())return;let y=this._onMessage(a,n,r);if(n&&!y)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(a)?(i=this.bindings.postgres_changes)===null||i===void 0||i.filter(g=>{var b,v,_;return((b=g.filter)===null||b===void 0?void 0:b.event)==="*"||((_=(v=g.filter)===null||v===void 0?void 0:v.event)===null||_===void 0?void 0:_.toLocaleLowerCase())===a}).map(g=>g.callback(y,r)):(s=this.bindings[a])===null||s===void 0||s.filter(g=>{var b,v,_,C,S,x;if(["broadcast","presence","postgres_changes"].includes(a))if("id"in g){const A=g.id,I=(b=g.filter)===null||b===void 0?void 0:b.event;return A&&((v=n.ids)===null||v===void 0?void 0:v.includes(A))&&(I==="*"||(I==null?void 0:I.toLocaleLowerCase())===((_=n.data)===null||_===void 0?void 0:_.type.toLocaleLowerCase()))}else{const A=(S=(C=g==null?void 0:g.filter)===null||C===void 0?void 0:C.event)===null||S===void 0?void 0:S.toLocaleLowerCase();return A==="*"||A===((x=n==null?void 0:n.event)===null||x===void 0?void 0:x.toLocaleLowerCase())}else return g.type.toLocaleLowerCase()===a}).map(g=>{if(typeof y=="object"&&"ids"in y){const b=y.data,{schema:v,table:_,commit_timestamp:C,type:S,errors:x}=b;y=Object.assign(Object.assign({},{schema:v,table:_,commit_timestamp:C,eventType:S,new:{},old:{},errors:x}),this._getPayloadRecords(b))}g.callback(y,r)})}_isClosed(){return this.state===Ti.closed}_isJoined(){return this.state===Ti.joined}_isJoining(){return this.state===Ti.joining}_isLeaving(){return this.state===Ti.leaving}_replyEventName(e){return`chan_reply_${e}`}_on(e,n,r){const i=e.toLocaleLowerCase(),s={type:i,filter:n,callback:r};return this.bindings[i]?this.bindings[i].push(s):this.bindings[i]=[s],this}_off(e,n){const r=e.toLocaleLowerCase();return this.bindings[r]&&(this.bindings[r]=this.bindings[r].filter(i=>{var s;return!(((s=i.type)===null||s===void 0?void 0:s.toLocaleLowerCase())===r&&k0.isEqual(i.filter,n))})),this}static isEqual(e,n){if(Object.keys(e).length!==Object.keys(n).length)return!1;for(const r in e)if(e[r]!==n[r])return!1;return!0}static isFilterValueEqual(e,n){return(e??void 0)===(n??void 0)}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(e){this._on(ll.close,{},e)}_onError(e){this._on(ll.error,{},n=>e(n))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=Ti.joining,this.joinPush.resend(e))}_getPayloadRecords(e){const n={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(n.new=YU(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(n.old=YU(e.columns,e.old_record)),n}}const _C=()=>{},n4={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},Gme=[1e3,2e3,5e3,1e4],Yme=1e4,Jme=` 412 addEventListener("message", (e) => { 413 if (e.data.event === "start") { 414 setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); 415 } 416 });`;class Xme{constructor(e,n){var r;if(this.accessTokenValue=null,this.apiKey=null,this._manuallySetToken=!1,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=tk,this.transport=null,this.heartbeatIntervalMs=n4.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=_C,this.ref=0,this.reconnectTimer=null,this.vsn=GU,this.logger=_C,this.conn=null,this.sendBuffer=[],this.serializer
416=new zme,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._heartbeatSentAt=null,this._resolveFetch=i=>i?(...s)=>i(...s):(...s)=>fetch(...s),!(!((r=n==null?void 0:n.params)===null||r===void 0)&&r.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=n.params.apikey,this.endPoint=`${e}/${nk.websocket}`,this.httpEndpoint=PJ(e),this._initializeOptions(n),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(n==null?void 0:n.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=jme.createWebSocket(this.endpointURL())}catch(e){this._setConnectionState("disconnected");const n=e.message;throw n.includes("Node.js")?new Error(`${n} 417 418To use Realtime in Node.js, you need to provide a WebSocket implementation: 419 420Option 1: Use Node.js 22+ which has native WebSocket support 421Option 2: Install and provide the "ws" package: 422 423 npm install ws 424 425 import ws from "ws" 426 const client = new RealtimeClient(url, { 427 ...options, 428 transport: ws 429 })`):new Error(`WebSocket not available: ${n}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:this.vsn}))}disconnect(e,n){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const r=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(r),this._setConnectionState("disconnected")},typeof this.conn.close=="function"&&(e?this.conn.close(e,n??""):this.conn.close()),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(e){const n=await e.unsubscribe();return this.channels.length===0&&this.disconnect(),n}async removeAllChannels(){const e=await Promise.all(this.channels.map(n=>n.unsubscribe()));return this.channels=[],this.disconnect(),e}log(e,n,r){this.logger(e,n,r)}connectionState(){switch(this.conn&&this.conn.readyState){case Wd.connecting:return Oh.Connecting;case Wd.open:return Oh.Open;case Wd.closing:return Oh.Closing;default:return Oh.Closed}}isConnected(){return this.connectionState()===Oh.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(e,n={config:{}}){const r=`realtime:${e}`,i=this.getChannels().find(s=>s.topic===r);if(i)return i;{const s=new k0(`realtime:${e}`,n,this);return this.channels.push(s),s}}push(e){const{topic:n,event:r,payload:i,ref:s}=e,a=()=>{this.encode(e,o=>{var l;(l=this.conn)===null||l===void 0||l.send(o)})};this.log("push",`${n} ${r} (${s})`,i),this.isConnected()?a():this.sendBuffer.push(a)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){var e;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(n){this.log("error","error in heartbeat callback",n)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this._heartbeatSentAt=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(n){this.log("error","error in heartbeat callback",n)}this._wasManualDisconnect=!1,(e=this.conn)===null||e===void 0||e.close(Bme,"heartbeat timeout"),setTimeout(()=>{var n;this.isConnected()||(n=this.reconnectTimer)===null||n===void 0||n.scheduleTimeout()},n4.HEARTBEAT_TIMEOUT_FALLBACK);return}this._heartbeatSentAt=Date.now(),this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(n){this.log("error","error in heartbeat callback",n)}this._setAuthSafely("heartbeat")}onHeartbeat(e){this.heartbeatCallback=e}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>
4290&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}_makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}_leaveOpenTopic(e){let n=this.channels.find(r=>r.topic===e&&(r._isJoined()||r._isJoining()));n&&(this.log("transport",`leaving duplicate topic "${e}"`),n.unsubscribe())}_remove(e){this.channels=this.channels.filter(n=>n.topic!==e.topic)}_onConnMessage(e){this.decode(e.data,n=>{if(n.topic==="phoenix"&&n.event==="phx_reply"&&n.ref&&n.ref===this.pendingHeartbeatRef){const u=this._heartbeatSentAt?Date.now()-this._heartbeatSentAt:void 0;try{this.heartbeatCallback(n.payload.status==="ok"?"ok":"error",u)}catch(f){this.log("error","error in heartbeat callback",f)}this._heartbeatSentAt=null,this.pendingHeartbeatRef=null}const{topic:r,event:i,payload:s,ref:a}=n,o=a?`(${a})`:"",l=s.status||"";this.log("receive",`${l} ${r} ${i} ${o}`.trim(),s),this.channels.filter(u=>u._isMember(r)).forEach(u=>u._trigger(i,s,a)),this._triggerStateCallbacks("message",n)})}_clearTimer(e){var n;e==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):e==="reconnect"&&((n=this.reconnectTimer)===null||n===void 0||n.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=e=>this._onConnError(e),this.conn.onmessage=e=>this._onConnMessage(e),this.conn.onclose=e=>this._onConnClose(e),this.conn.readyState===Wd.open&&this._onConnOpen())}_teardownConnection(){if(this.conn){if(this.conn.readyState===Wd.open||this.conn.readyState===Wd.connecting)try{this.conn.close()}catch(e){this.log("error","Error closing connection",e)}this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null}this._clearAllTimers(),this._terminateWorker(),this.channels.forEach(e=>e.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).then(()=>{this.accessTokenValue&&(this.channels.forEach(n=>{n.updateJoinPayload({access_token:this.accessTokenValue})}),this.sendBuffer=[],this.channels.forEach(n=>{n._isJoining()&&(n.joinPush.sent=!1,n.joinPush.send())})),this.flushSendBuffer()}).catch(n=>{this.log("error","error waiting for auth on connect",n),this.flushSendBuffer()}),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=n=>{this.log("worker","worker error",n.message),this._terminateWorker()},this.workerRef.onmessage=n=>{n.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_onConnClose(e){var n;this._setConnectionState("disconnected"),this.log("transport","close",e),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(n=this.reconnectTimer)===null||n===void 0||n.scheduleTimeout(),this._triggerStateCallbacks("close",e)}_onConnError(e){this._setConnectionState("disconnected"),this.log("transport",`${e}`),this._triggerChanError(),this._triggerStateCallbacks("error",e);try{this.heartbeatCallback("error")}catch(n){this.log("error","error in heartbeat callback",n)}}_triggerChanError(){this.channels.forEach(e=>e._trigger(ll.error))}_appendParams(e,n){if(Object.keys(n).length===0)return e;const r=e.match(/\?/)?"&":"?",i=new URLSearchParams(n);return`${e}${r}${i}`}_workerObjectUrl(e){let n;if(e)n=e;else{const r=new Blob([Jme],{type:"application/javascript"});n=URL.createObjectURL(r)}return n}_setConnectionState(e,n=!1){this._connectionState=e,e==="connecting"?this._wasManualDisconnect=!1:e==="disconnecting"&&(this._wasManualDisconnect=n)}async _performAuth(e=null){let n,r=!1;if(e)n=e,r=!0;else if(this.accessToken)try{n=await this.accessToken()}catch(i){this.log("error","Error fetching access token from callback",i),n=this.accessTokenValue}else n=this.accessTokenValue;r?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=n&&(this.accessTokenValue=n,this.channels.forEac
429h(i=>{const s={access_token:n,version:Dme};n&&i.updateJoinPayload(s),i.joinedOnce&&i._isJoined()&&i._push(ll.access_token,{access_token:n})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this._isManualToken()||this.setAuth().catch(n=>{this.log("error",`Error setting auth in ${e}`,n)})}_triggerStateCallbacks(e,n){try{this.stateChangeCallbacks[e].forEach(r=>{try{r(n)}catch(i){this.log("error",`error in ${e} callback`,i)}})}catch(r){this.log("error",`error triggering ${e} callbacks`,r)}}_setupReconnectionTimer(){this.reconnectTimer=new NJ(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},n4.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(e){var n,r,i,s,a,o,l,u,f,p,y,g;switch(this.transport=(n=e==null?void 0:e.transport)!==null&&n!==void 0?n:null,this.timeout=(r=e==null?void 0:e.timeout)!==null&&r!==void 0?r:tk,this.heartbeatIntervalMs=(i=e==null?void 0:e.heartbeatIntervalMs)!==null&&i!==void 0?i:n4.HEARTBEAT_INTERVAL,this.worker=(s=e==null?void 0:e.worker)!==null&&s!==void 0?s:!1,this.accessToken=(a=e==null?void 0:e.accessToken)!==null&&a!==void 0?a:null,this.heartbeatCallback=(o=e==null?void 0:e.heartbeatCallback)!==null&&o!==void 0?o:_C,this.vsn=(l=e==null?void 0:e.vsn)!==null&&l!==void 0?l:GU,e!=null&&e.params&&(this.params=e.params),e!=null&&e.logger&&(this.logger=e.logger),(e!=null&&e.logLevel||e!=null&&e.log_level)&&(this.logLevel=e.logLevel||e.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(u=e==null?void 0:e.reconnectAfterMs)!==null&&u!==void 0?u:(b=>Gme[b-1]||Yme),this.vsn){case Ume:this.encode=(f=e==null?void 0:e.encode)!==null&&f!==void 0?f:((b,v)=>v(JSON.stringify(b))),this.decode=(p=e==null?void 0:e.decode)!==null&&p!==void 0?p:((b,v)=>v(JSON.parse(b)));break;case IJ:this.encode=(y=e==null?void 0:e.encode)!==null&&y!==void 0?y:this.serializer.encode.bind(this.serializer),this.decode=(g=e==null?void 0:e.decode)!==null&&g!==void 0?g:this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${this.vsn}`)}if(this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=e==null?void 0:e.workerUrl}}}var i3=class extends Error{constructor(t,e){var n;super(t),this.name="IcebergError",this.status=e.status,this.icebergType=e.icebergType,this.icebergCode=e.icebergCode,this.details=e.details,this.isCommitStateUnknown=e.icebergType==="CommitStateUnknownException"||[500,502,504].includes(e.status)&&((n=e.icebergType)==null?void 0:n.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function Qme(t,e,n){const r=new URL(e,t);if(n)for(const[i,s]of Object.entries(n))s!==void 0&&r.searchParams.set(i,s);return r.toString()}async function eye(t){return!t||t.type==="none"?{}:t.type==="bearer"?{Authorization:`Bearer ${t.token}`}:t.type==="header"?{[t.name]:t.value}:t.type==="custom"?await t.getHeaders():{}}function tye(t){const e=t.fetchImpl??globalThis.fetch;return{async request({method:n,path:r,query:i,body:s,headers:a}){const o=Qme(t.baseUrl,r,i),l=await eye(t.auth),u=await e(o,{method:n,headers:{...s?{"Content-Type":"application/json"}:{},...l,...a},body:s?JSON.stringify(s):void 0}),f=await u.text(),p=(u.headers.get("content-type")||"").includes("application/json"),y=p&&f?JSON.parse(f):f;if(!u.ok){const g=p?y:void 0,b=g==null?void 0:g.error;throw new i3((b==null?void 0:b.message)??`Request failed with status ${u.status}`,{status:u.status,icebergType:b==null?void 0:b.type,icebergCode:b==null?void 0:b.code,details:g})}return{status:u.status,headers:u.headers,data:y}}}}function r4(t){return t.join("�")}var nye=class{constructor(t,e=""){this.client=t,this.prefix=e}async listNamespaces(t){const e=t?{parent:r4(t.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:e})).data.namespaces.map(r=>({namespace:r}))}async createNamespace(t,e){const n={namespace:t.namespace,properties:e==null?void 0:e.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:n})).data}async dropNamespace(t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${r4(t.namespace)}`})}async loadNamespaceMetadata(t){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${r4(t.namespace)}`})).data.properties}}async namespaceExists(t){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${r4(t.namespace)}`}),!0}catch(e){if(e instanceof i3&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(t,e){try{return await this.createNamespace(t,e)}catch(n){if(n instanceof i3&&n.status===409)return;throw n}}};function Hp(t){return t.join("�")}var rye=class{constructor(t,e="",n){this.client=t,this.prefix=e,this.accessDelegation=n}async listTables(t){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Hp(t.namespace)}/tables`})).data.identifiers}async createTable(t,e){const n={};return this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Hp(t.namespace)}/tables`,body:e,headers:n})).data.metadata}async updateTable(t,e){const n=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Hp(t.namespace)}
429/tables/${t.name}`,body:e});return{"metadata-location":n.data["metadata-location"],metadata:n.data.metadata}}async dropTable(t,e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Hp(t.namespace)}/tables/${t.name}`,query:{purgeRequested:String((e==null?void 0:e.purge)??!1)}})}async loadTable(t){const e={};return this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Hp(t.namespace)}/tables/${t.name}`,headers:e})).data.metadata}async tableExists(t){const e={};this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Hp(t.namespace)}/tables/${t.name}`,headers:e}),!0}catch(n){if(n instanceof i3&&n.status===404)return!1;throw n}}async createTableIfNotExists(t,e){try{return await this.createTable(t,e)}catch(n){if(n instanceof i3&&n.status===409)return await this.loadTable({namespace:t.namespace,name:e.name});throw n}}},iye=class{constructor(t){var r;let e="v1";t.catalogName&&(e+=`/${t.catalogName}`);const n=t.baseUrl.endsWith("/")?t.baseUrl:`${t.baseUrl}/`;this.client=tye({baseUrl:n,auth:t.auth,fetchImpl:t.fetch}),this.accessDelegation=(r=t.accessDelegation)==null?void 0:r.join(","),this.namespaceOps=new nye(this.client,e),this.tableOps=new rye(this.client,e,this.accessDelegation)}async listNamespaces(t){return this.namespaceOps.listNamespaces(t)}async createNamespace(t,e){return this.namespaceOps.createNamespace(t,e)}async dropNamespace(t){await this.namespaceOps.dropNamespace(t)}async loadNamespaceMetadata(t){return this.namespaceOps.loadNamespaceMetadata(t)}async listTables(t){return this.tableOps.listTables(t)}async createTable(t,e){return this.tableOps.createTable(t,e)}async updateTable(t,e){return this.tableOps.updateTable(t,e)}async dropTable(t,e){await this.tableOps.dropTable(t,e)}async loadTable(t){return this.tableOps.loadTable(t)}async namespaceExists(t){return this.namespaceOps.namespaceExists(t)}async tableExists(t){return this.tableOps.tableExists(t)}async createNamespaceIfNotExists(t,e){return this.namespaceOps.createNamespaceIfNotExists(t,e)}async createTableIfNotExists(t,e){return this.tableOps.createTableIfNotExists(t,e)}},r7=class extends Error{constructor(t,e="storage",n,r){super(t),this.__isStorageError=!0,this.namespace=e,this.name=e==="vectors"?"StorageVectorsError":"StorageError",this.status=n,this.statusCode=r}};function i7(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}var i4=class extends r7{constructor(t,e,n,r="storage"){super(t,r,e,n),this.name=r==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=e,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},RJ=class extends r7{constructor(t,e,n="storage"){super(t,n),this.name=n==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=e}};const sye=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),aye=t=>{if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},ik=t=>{if(Array.isArray(t))return t.map(n=>ik(n));if(typeof t=="function"||t!==Object(t))return t;const e={};return Object.entries(t).forEach(([n,r])=>{const i=n.replace(/([-_][a-z])/gi,s=>s.toUpperCase().replace(/[-_]/g,""));e[i]=ik(r)}),e},oye=t=>!t||typeof t!="string"||t.length===0||t.length>100||t.trim()!==t||t.includes("/")||t.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(t);function s3(t){"@babel/helpers - typeof";return s3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s3(t)}function lye(t,e){if(s3(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(s3(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function cye(t){var e=lye(t,"string");return s3(e)=="symbol"?e:e+""}function uye(t,e,n){return(e=cye(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function QU(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function kt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};
429e%2?QU(Object(n),!0).forEach(function(r){uye(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):QU(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}const eB=t=>{var e;return t.msg||t.message||t.error_description||(typeof t.error=="string"?t.error:(e=t.error)===null||e===void 0?void 0:e.message)||JSON.stringify(t)},dye=async(t,e,n,r)=>{if(t&&typeof t=="object"&&"status"in t&&"ok"in t&&typeof t.status=="number"&&!(n!=null&&n.noResolveJson)){const i=t,s=i.status||500;if(typeof i.json=="function")i.json().then(a=>{const o=(a==null?void 0:a.statusCode)||(a==null?void 0:a.code)||s+"";e(new i4(eB(a),s,o,r))}).catch(()=>{if(r==="vectors"){const a=s+"";e(new i4(i.statusText||`HTTP ${s} error`,s,a,r))}else{const a=s+"";e(new i4(i.statusText||`HTTP ${s} error`,s,a,r))}});else{const a=s+"";e(new i4(i.statusText||`HTTP ${s} error`,s,a,r))}}else e(new RJ(eB(t),t,r))},hye=(t,e,n,r)=>{const i={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"||t==="HEAD"||!r?kt(kt({},i),n):(aye(r)?(i.headers=kt({"Content-Type":"application/json"},e==null?void 0:e.headers),i.body=JSON.stringify(r)):i.body=r,e!=null&&e.duplex&&(i.duplex=e.duplex),kt(kt({},i),n))};async function vy(t,e,n,r,i,s,a){return new Promise((o,l)=>{t(n,hye(e,r,i,s)).then(u=>{if(!u.ok)throw u;if(r!=null&&r.noResolveJson)return u;if(a==="vectors"){const f=u.headers.get("content-type");if(u.headers.get("content-length")==="0"||u.status===204)return{};if(!f||!f.includes("application/json"))return{}}return u.json()}).then(u=>o(u)).catch(u=>dye(u,l,r,a))})}function jJ(t="storage"){return{get:async(e,n,r,i)=>vy(e,"GET",n,r,i,void 0,t),post:async(e,n,r,i,s)=>vy(e,"POST",n,i,s,r,t),put:async(e,n,r,i,s)=>vy(e,"PUT",n,i,s,r,t),head:async(e,n,r,i)=>vy(e,"HEAD",n,kt(kt({},r),{},{noResolveJson:!0}),i,void 0,t),remove:async(e,n,r,i,s)=>vy(e,"DELETE",n,i,s,r,t)}}const fye=jJ("storage"),{get:a3,post:al,put:sk,head:pye,remove:oI}=fye,Ua=jJ("vectors");var H1=class{constructor(t,e={},n,r="storage"){this.shouldThrowOnError=!1,this.url=t,this.headers=e,this.fetch=sye(n),this.namespace=r}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,e){return this.headers=kt(kt({},this.headers),{},{[t]:e}),this}async handleOperation(t){var e=this;try{return{data:await t(),error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(i7(n))return{data:null,error:n};throw n}}},mye=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e}then(t,e){return this.execute().then(t,e)}async execute(){var t=this;try{return{data:(await t.downloadFn()).body,error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(i7(e))return{data:null,error:e};throw e}}};let MJ;MJ=Symbol.toStringTag;var yye=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[MJ]="BlobDownloadBuilder",this.promise=null}asStream(){return new mye(this.downloadFn,this.shouldThrowOnError)}then(t,e){return this.getPromise().then(t,e)}catch(t){return this.getPromise().catch(t)}finally(t){return this.getPromise().finally(t)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var t=this;try{return{data:await(await t.downloadFn()).blob(),error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(i7(e))return{data:null,error:e};throw e}}};const gye={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},tB={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var bye=class extends H1{constructor(t,e={},n,r){super(t,e,r,"storage"),this.bucketId=n}async uploadOrUpdate(t,e,n,r){var i=this;return i.handleOperation(async()=>{let s;const a=kt(kt({},tB),r);let o=kt(kt({},i.headers),t==="POST"&&{"x-upsert":String(a.upsert)});const l=a.metadata;typeof Blob<"u"&&n instanceof Blob?(s=new FormData,s.append("cacheControl",a.cacheControl),l&&s.append("metadata",i.encodeMetadata(l)),s.append("",n)):typeof FormData<"u"&&n instanceof FormData?(s=n,s.has("cacheControl")||s.append("cacheControl",a.cacheControl),l&&!s.has("metadata")&&s.append("metadata",i.encodeMetadata(l))):(s=n,o["cache-control"]=`max-age=${a.cacheControl}`,o["content-type"]=a.contentType,l&&(o["x-metadata"]=i.toBase64(i.encodeMetadata(l))),(typeof ReadableStream<"u"&&s instanceof ReadableStream||s&&typeof s=="object"&&"pipe"in s&&typeof s.pipe=="function")&&!a.duplex&&(a.duplex="half")),r!=null&&r.headers&&(o=kt(kt({},o),r.headers));const u=i._removeEmptyFolders(e),f=i._getFinalPath(u),p=await(t=="PUT"?sk:al)(i.fetch,`${i.url}/object/${f}`,s,kt({headers:o},a!=null&&a.duplex?{duplex:a.duplex}:{}));return{path:u,id:p.Id,fullPath:p.Key}})}async upload(t,e,n){return this.uploadOrUpdate("POST",t,e,n)}async uploadToSignedUrl(t,e,n,r){var i=this;const s=i._removeEmptyFolders(t),a=i._getFinalPath(s),o=new URL(i.url+`/object/upload/sign/${a}`);return o.searchParams.set("token",e),i.handleOperation(async()=>{let l;const u=kt({upsert:tB.upsert},r),f=kt(kt({},i.headers),{"x-upsert":String(u.upsert)});return typeof Blob<"u"&&n instanceof Blob?(l=new FormData,l.append("cacheControl",u.cacheControl),l.append("",n)):typeof FormData<"u"&&n instanceof FormData?(l=n,l.append("cacheControl",u.cacheControl)):(l=n,f["cache-control"]=`max-age=${u.cacheControl}`,f["content-type"]=u.contentType),{path:s,fullPath:(await sk(i.fetch,o.toString(),l,{headers:f})).Key}})}async createSignedUploadUrl(t,e){var n=this;return n.handleOperation(async()=>{let r=n._getFinalPath(t);const i=kt({},n.headers);e!=null&&e.upsert&&(i["x-upsert"]="true");const s=await al(n.fetch,`${n.url}/object/upload/sign/${r}`,{},{headers:i}),a=new URL(n.url+s.url),o=a.searchParams.get("token");if(!o)throw new r7("No token returned by API");return{signedUrl:a.toString(),path:t,token:o}})}async update(t,e,n){return this.uploadOrUpdate("PUT",t,e,n)}async move(t,e,n){var r=this;return r.handleOperation(async()=>await al(r.fetch,`${r.url}/object/move`,{bucketId:r.bucketId,sourceKey:t,destinationKey:e,destinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers}))}async copy(t,e,n){var r=this;return r.handleOperation(async()=>({path:(await al(r.fetch,`${r.url}/object/copy`,{bucketId:r.bucketId,sourceKey:t,destinationKey:e,destinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers})).Key}))}async createSignedUrl(t,e,n){var r=this;return r.handleOperation(async()=>{let i=r._getFinalPath(t),s=await al(r.fetch,`${r.url}/object/sign/${i}
429`,kt({expiresIn:e},n!=null&&n.transform?{transform:n.transform}:{}),{headers:r.headers});const a=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return{signedUrl:encodeURI(`${r.url}${s.signedURL}${a}`)}})}async createSignedUrls(t,e,n){var r=this;return r.handleOperation(async()=>{const i=await al(r.fetch,`${r.url}/object/sign/${r.bucketId}`,{expiresIn:e,paths:t},{headers:r.headers}),s=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return i.map(a=>kt(kt({},a),{},{signedUrl:a.signedURL?encodeURI(`${r.url}${a.signedURL}${s}`):null}))})}download(t,e,n){const r=typeof(e==null?void 0:e.transform)<"u"?"render/image/authenticated":"object",i=this.transformOptsToQueryString((e==null?void 0:e.transform)||{}),s=i?`?${i}`:"",a=this._getFinalPath(t),o=()=>a3(this.fetch,`${this.url}/${r}/${a}${s}`,{headers:this.headers,noResolveJson:!0},n);return new yye(o,this.shouldThrowOnError)}async info(t){var e=this;const n=e._getFinalPath(t);return e.handleOperation(async()=>ik(await a3(e.fetch,`${e.url}/object/info/${n}`,{headers:e.headers})))}async exists(t){var e=this;const n=e._getFinalPath(t);try{return await pye(e.fetch,`${e.url}/object/${n}`,{headers:e.headers}),{data:!0,error:null}}catch(r){if(e.shouldThrowOnError)throw r;if(i7(r)&&r instanceof RJ){const i=r.originalError;if([400,404].includes(i==null?void 0:i.status))return{data:!1,error:r}}throw r}}getPublicUrl(t,e){const n=this._getFinalPath(t),r=[],i=e!=null&&e.download?`download=${e.download===!0?"":e.download}`:"";i!==""&&r.push(i);const s=typeof(e==null?void 0:e.transform)<"u"?"render/image":"object",a=this.transformOptsToQueryString((e==null?void 0:e.transform)||{});a!==""&&r.push(a);let o=r.join("&");return o!==""&&(o=`?${o}`),{data:{publicUrl:encodeURI(`${this.url}/${s}/public/${n}${o}`)}}}async remove(t){var e=this;return e.handleOperation(async()=>await oI(e.fetch,`${e.url}/object/${e.bucketId}`,{prefixes:t},{headers:e.headers}))}async list(t,e,n){var r=this;return r.handleOperation(async()=>{const i=kt(kt(kt({},gye),e),{},{prefix:t||""});return await al(r.fetch,`${r.url}/object/list/${r.bucketId}`,i,{headers:r.headers},n)})}async listV2(t,e){var n=this;return n.handleOperation(async()=>{const r=kt({},t);return await al(n.fetch,`${n.url}/object/list-v2/${n.bucketId}`,r,{headers:n.headers},e)})}encodeMetadata(t){return JSON.stringify(t)}toBase64(t){return typeof Buffer<"u"?Buffer.from(t).toString("base64"):btoa(t)}_getFinalPath(t){return`${this.bucketId}/${t.replace(/^\/+/,"")}`}_removeEmptyFolders(t){return t.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(t){const e=[];return t.width&&e.push(`width=${t.width}`),t.height&&e.push(`height=${t.height}`),t.resize&&e.push(`resize=${t.resize}`),t.format&&e.push(`format=${t.format}`),t.quality&&e.push(`quality=${t.quality}`),e.join("&")}};const wye="2.98.0",N6={"X-Client-Info":`storage-js/${wye}`};var vye=class extends H1{constructor(t,e={},n,r){const i=new URL(t);r!=null&&r.useNewHostname&&/supabase\.(co|in|red)$/.test(i.hostname)&&!i.hostname.includes("storage.supabase.")&&(i.hostname=i.hostname.replace("supabase.","storage.supabase."));const s=i.href.replace(/\/$/,""),a=kt(kt({},N6),e);super(s,a,n,"storage")}async listBuckets(t){var e=this;return e.handleOperation(async()=>{const n=e.listBucketOptionsToQueryString(t);return await a3(e.fetch,`${e.url}/bucket${n}`,{headers:e.headers})})}async getBucket(t){var e=this;return e.handleOperation(async()=>await a3(e.fetch,`${e.url}/bucket/${t}`,{headers:e.headers}))}async createBucket(t,e={public:!1}){var n=this;return n.handleOperation(async()=>await al(n.fetch,`${n.url}/bucket`,{id:t,name:t,type:e.type,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:n.headers}))}async updateBucket(t,e){var n=this;return n.handleOperation(async()=>await sk(n.fetch,`${n.url}/bucket/${t}`,{id:t,name:t,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:n.headers}))}async emptyBucket(t){var e=this;return e.handleOperation(async()=>await al(e.fetch,`${e.url}/bucket/${t}/empty`,{},{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await oI(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}listBucketOptionsToQueryString(t){const e={};return t&&("limit"in t&&(e.limit=String(t.limit)),"offset"in t&&(e.offset=String(t.offset)),t.search&&(e.search=t.search),t.sortColumn&&(e.sortColumn=t.sortColumn),t.sortOrder&&(e.sortOrder=t.sortOrder)),Object.keys(e).length>0?"?"+new URLSearchParams(e).toString():""}},_ye=class extends H1{constructor(t,e={},n){const r=t.replace(/\/$/,""),i=kt(kt({},N6),e);super(r,i,n,"storage")}async createBucket(t){var e=this;return e.handleOperation(async()=>await al(e.fetch,`${e.url}/bucket`,{name:t},{headers:e.headers}))}async listBuckets(t){var e=this;return e.handleOperation(async()=>{const n=new URLSearchParams;(t==null?void 0:t.limit)!==void 0&&n.set("limit",t.limit.toString()),(t==null?void 0:t.offset)!==void 0&&n.set("offset",t.offset.toString()),t!=null&&t.sortColumn&&n.set("sortColumn",t.sortColumn),t!=null&&t.sortOrder&&n.set("sortOrder",t.sortOrder),t!=null&&t.search&&n.set("search",t.search);const r=n.toString(),i=r?`${e.url}/bucket?${r}`:`${e.url}/bucket`;return await a3(e.fetch,i,{headers:e.headers})})}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await oI(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}from(t){var e=this;if(!oye(t))throw new r7("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const n=new iye({baseUrl:this.url,catalogName:t,auth:{type:"custom",getHeaders:async()=>e.headers},fetch:this.fetch}
429),r=this.shouldThrowOnError;return new Proxy(n,{get(i,s){const a=i[s];return typeof a!="function"?a:async(...o)=>{try{return{data:await a.apply(i,o),error:null}}catch(l){if(r)throw l;return{data:null,error:l}}}}})}},xye=class extends H1{constructor(t,e={},n){const r=t.replace(/\/$/,""),i=kt(kt({},N6),{},{"Content-Type":"application/json"},e);super(r,i,n,"vectors")}async createIndex(t){var e=this;return e.handleOperation(async()=>await Ua.post(e.fetch,`${e.url}/CreateIndex`,t,{headers:e.headers})||{})}async getIndex(t,e){var n=this;return n.handleOperation(async()=>await Ua.post(n.fetch,`${n.url}/GetIndex`,{vectorBucketName:t,indexName:e},{headers:n.headers}))}async listIndexes(t){var e=this;return e.handleOperation(async()=>await Ua.post(e.fetch,`${e.url}/ListIndexes`,t,{headers:e.headers}))}async deleteIndex(t,e){var n=this;return n.handleOperation(async()=>await Ua.post(n.fetch,`${n.url}/DeleteIndex`,{vectorBucketName:t,indexName:e},{headers:n.headers})||{})}},Cye=class extends H1{constructor(t,e={},n){const r=t.replace(/\/$/,""),i=kt(kt({},N6),{},{"Content-Type":"application/json"},e);super(r,i,n,"vectors")}async putVectors(t){var e=this;if(t.vectors.length<1||t.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return e.handleOperation(async()=>await Ua.post(e.fetch,`${e.url}/PutVectors`,t,{headers:e.headers})||{})}async getVectors(t){var e=this;return e.handleOperation(async()=>await Ua.post(e.fetch,`${e.url}/GetVectors`,t,{headers:e.headers}))}async listVectors(t){var e=this;if(t.segmentCount!==void 0){if(t.segmentCount<1||t.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(t.segmentIndex!==void 0&&(t.segmentIndex<0||t.segmentIndex>=t.segmentCount))throw new Error(`segmentIndex must be between 0 and ${t.segmentCount-1}`)}return e.handleOperation(async()=>await Ua.post(e.fetch,`${e.url}/ListVectors`,t,{headers:e.headers}))}async queryVectors(t){var e=this;return e.handleOperation(async()=>await Ua.post(e.fetch,`${e.url}/QueryVectors`,t,{headers:e.headers}))}async deleteVectors(t){var e=this;if(t.keys.length<1||t.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return e.handleOperation(async()=>await Ua.post(e.fetch,`${e.url}/DeleteVectors`,t,{headers:e.headers})||{})}},Eye=class extends H1{constructor(t,e={},n){const r=t.replace(/\/$/,""),i=kt(kt({},N6),{},{"Content-Type":"application/json"},e);super(r,i,n,"vectors")}async createBucket(t){var e=this;return e.handleOperation(async()=>await Ua.post(e.fetch,`${e.url}/CreateVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}async getBucket(t){var e=this;return e.handleOperation(async()=>await Ua.post(e.fetch,`${e.url}/GetVectorBucket`,{vectorBucketName:t},{headers:e.headers}))}async listBuckets(t={}){var e=this;return e.handleOperation(async()=>await Ua.post(e.fetch,`${e.url}/ListVectorBuckets`,t,{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await Ua.post(e.fetch,`${e.url}/DeleteVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}},Sye=class extends Eye{constructor(t,e={}){super(t,e.headers||{},e.fetch)}from(t){return new Aye(this.url,this.headers,t,this.fetch)}async createBucket(t){var e=()=>super.createBucket,n=this;return e().call(n,t)}async getBucket(t){var e=()=>super.getBucket,n=this;return e().call(n,t)}async listBuckets(t={}){var e=()=>super.listBuckets,n=this;return e().call(n,t)}async deleteBucket(t){var e=()=>super.deleteBucket,n=this;return e().call(n,t)}},Aye=class extends xye{constructor(t,e,n,r){super(t,e,r),this.vectorBucketName=n}async createIndex(t){var e=()=>super.createIndex,n=this;return e().call(n,kt(kt({},t),{},{vectorBucketName:n.vectorBucketName}))}async listIndexes(t={}){var e=()=>super.listIndexes,n=this;return e().call(n,kt(kt({},t),{},{vectorBucketName:n.vectorBucketName}))}async getIndex(t){var e=()=>super.getIndex,n=this;return e().call(n,n.vectorBucketName,t)}async deleteIndex(t){var e=()=>super.deleteIndex,n=this;return e().call(n,n.vectorBucketName,t)}index(t){return new kye(this.url,this.headers,this.vectorBucketName,t,this.fetch)}},kye=class extends Cye{constructor(t,e,n,r,i){super(t,e,i),this.vectorBucketName=n,this.indexName=r}async putVectors(t){var e=()=>super.putVectors,n=this;return e().call(n,kt(kt({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async getVectors(t){var e=()=>super.getVectors,n=this;return e().call(n,kt(kt({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async listVectors(t={}){var e=()=>super.listVectors,n=this;return e().call(n,kt(kt({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async queryVectors(t){var e=()=>super.queryVectors,n=this;return e().call(n,kt(kt({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async deleteVectors(t){var e=()=>super.deleteVectors,n=this;return e().call(n,kt(kt({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}},Tye=class extends vye{constructor(t,e={},n,r){super(t,e,n,r)}from(t){return new bye(this.url,this.headers,t,this.fetch)}get vectors(){return new Sye(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new _ye(this.url+"/iceberg",this.headers,this.fetch)}};const DJ="2.98.0",g0=30*1e3,ak=3,xC=ak*g0,Lye="http://localhost:9999",$ye="supabase.auth.token",Iye={"X-Client-Info":`gotrue-js/${DJ}`},ok="X-Supabase-Api-Version",UJ={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},Nye=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,Oye=600*1e3;
429class o3 extends Error{constructor(e,n,r){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=r}}function gt(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}class Pye extends o3{constructor(e,n,r){super(e,n,r),this.name="AuthApiError",this.status=n,this.code=r}}function Rye(t){return gt(t)&&t.name==="AuthApiError"}class Ph extends o3{constructor(e,n){super(e),this.name="AuthUnknownError",this.originalError=n}}class Fu extends o3{constructor(e,n,r,i){super(e,r,i),this.name=n,this.status=r}}class La extends Fu{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function CC(t){return gt(t)&&t.name==="AuthSessionMissingError"}class Wp extends Fu{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class s4 extends Fu{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class a4 extends Fu{constructor(e,n=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function jye(t){return gt(t)&&t.name==="AuthImplicitGrantRedirectError"}class nB extends Fu{constructor(e,n=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class Mye extends Fu{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class lk extends Fu{constructor(e,n){super(e,"AuthRetryableFetchError",n,void 0)}}function EC(t){return gt(t)&&t.name==="AuthRetryableFetchError"}class rB extends Fu{constructor(e,n,r){super(e,"AuthWeakPasswordError",n,"weak_password"),this.reasons=r}}class ck extends Fu{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const c8="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),iB=` 430\r=`.split(""),Dye=(()=>{const t=new Array(128);for(let e=0;e<t.length;e+=1)t[e]=-1;for(let e=0;e<iB.length;e+=1)t[iB[e].charCodeAt(0)]=-2;for(let e=0;e<c8.length;e+=1)t[c8[e].charCodeAt(0)]=e;return t})();function sB(t,e,n){if(t!==null)for(e.queue=e.queue<<8|t,e.queuedBits+=8;e.queuedBits>=6;){const r=e.queue>>e.queuedBits-6&63;n(c8[r]),e.queuedBits-=6}else if(e.queuedBits>0)for(e.queue=e.queue<<6-e.queuedBits,e.queuedBits=6;e.queuedBits>=6;){const r=e.queue>>e.queuedBits-6&63;n(c8[r]),e.queuedBits-=6}}function BJ(t,e,n){const r=Dye[t];if(r>-1)for(e.queue=e.queue<<6|r,e.queuedBits+=6;e.queuedBits>=8;)n(e.queue>>e.queuedBits-8&255),e.queuedBits-=8;else{if(r===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(t)}"`)}}function aB(t){const e=[],n=a=>{e.push(String.fromCodePoint(a))},r={utf8seq:0,codepoint:0},i={queue:0,queuedBits:0},s=a=>{Fye(a,r,n)};for(let a=0;a<t.length;a+=1)BJ(t.charCodeAt(a),i,s);return e.join("")}function Uye(t,e){if(t<=127){e(t);return}else if(t<=2047){e(192|t>>6),e(128|t&63);return}else if(t<=65535){e(224|t>>12),e(128|t>>6&63),e(128|t&63);return}else if(t<=1114111){e(240|t>>18),e(128|t>>12&63),e(128|t>>6&63),e(128|t&63);return}throw new Error(`Unrecognized Unicode codepoint: ${t.toString(16)}`)}function Bye(t,e){for(let n=0;n<t.length;n+=1){let r=t.charCodeAt(n);if(r>55295&&r<=56319){const i=(r-55296)*1024&65535;r=(t.charCodeAt(n+1)-56320&65535|i)+65536,n+=1}Uye(r,e)}}function Fye(t,e,n){if(e.utf8seq===0){if(t<=127){n(t);return}for(let r=1;r<6;r+=1)if((t>>7-r&1)===0){e.utf8seq=r;break}if(e.utf8seq===2)e.codepoint=t&31;else if(e.utf8seq===3)e.codepoint=t&15;else if(e.utf8seq===4)e.codepoint=t&7;else throw new Error("Invalid UTF-8 sequence");e.utf8seq-=1}else if(e.utf8seq>0){if(t<=127)throw new Error("Invalid UTF-8 sequence");e.codepoint=e.codepoint<<6|t&63,e.utf8seq-=1,e.utf8seq===0&&n(e.codepoint)}}function B0(t){const e=[],n={queue:0,queuedBits:0},r=i=>{e.push(i)};for(let i=0;i<t.length;i+=1)BJ(t.charCodeAt(i),n,r);return new Uint8Array(e)}function zye(t){const e=[];return Bye(t,n=>e.push(n)),new Uint8Array(e)}function Hh(t){const e=[],n={queue:0,queuedBits:0},r=i=>{e.push(i)};return t.forEach(i=>
430sB(i,n,r)),sB(null,n,r),e.join("")}function Vye(t){return Math.round(Date.now()/1e3)+t}function Hye(){return Symbol("auth-callback")}const as=()=>typeof window<"u"&&typeof document<"u",fh={tested:!1,writable:!1},FJ=()=>{if(!as())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(fh.tested)return fh.writable;const t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),fh.tested=!0,fh.writable=!0}catch{fh.tested=!0,fh.writable=!1}return fh.writable};function Wye(t){const e={},n=new URL(t);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEach((i,s)=>{e[s]=i})}catch{}return n.searchParams.forEach((r,i)=>{e[i]=r}),e}const zJ=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),qye=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function",b0=async(t,e,n)=>{await t.setItem(e,JSON.stringify(n))},ph=async(t,e)=>{const n=await t.getItem(e);if(!n)return null;try{return JSON.parse(n)}catch{return n}},ts=async(t,e)=>{await t.removeItem(e)};class s7{constructor(){this.promise=new s7.promiseConstructor((e,n)=>{this.resolve=e,this.reject=n})}}s7.promiseConstructor=Promise;function o4(t){const e=t.split(".");if(e.length!==3)throw new ck("Invalid JWT structure");for(let r=0;r<e.length;r++)if(!Nye.test(e[r]))throw new ck("JWT not in base64url format");return{header:JSON.parse(aB(e[0])),payload:JSON.parse(aB(e[1])),signature:B0(e[2]),raw:{header:e[0],payload:e[1]}}}async function Zye(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}function Kye(t,e){return new Promise((r,i)=>{(async()=>{for(let s=0;s<1/0;s++)try{const a=await t(s);if(!e(s,null,a)){r(a);return}}catch(a){if(!e(s,a)){i(a);return}}})()})}function Gye(t){return("0"+t.toString(16)).substr(-2)}function Yye(){const e=new Uint32Array(56);if(typeof crypto>"u"){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=n.length;let i="";for(let s=0;s<56;s++)i+=n.charAt(Math.floor(Math.random()*r));return i}return crypto.getRandomValues(e),Array.from(e,Gye).join("")}async function Jye(t){const n=new TextEncoder().encode(t),r=await crypto.subtle.digest("SHA-256",n),i=new Uint8Array(r);return Array.from(i).map(s=>String.fromCharCode(s)).join("")}async function Xye(t){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),t;const n=await Jye(t);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function qp(t,e,n=!1){const r=Yye();let i=r;n&&(i+="/PASSWORD_RECOVERY"),await b0(t,`${e}-code-verifier`,i);const s=await Xye(r);return[s,r===s?"plain":"s256"]}const Qye=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function ege(t){const e=t.headers.get(ok);if(!e||!e.match(Qye))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function tge(t){if(!t)throw new Error("Missing exp claim");const e=Math.floor(Date.now()/1e3);if(t<=e)throw new Error("JWT has expired")}function nge(t){switch(t){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const rge=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Zp(t){if(!rge.test(t))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function SC(){const t={};return new Proxy(t,{get:(e,n)=>{if(n==="__isUserNotAvailableProxy")return!0;if(typeof n=="symbol"){const r=n.toString();if(r==="Symbol(Symbol.toPrimitive)"||r==="Symbol(Symbol.toStringTag)"||r==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${n}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function ige(t,e){return new Proxy(t,{get:(n,r,i)=>{if(r==="__isInsecureUserWarningProxy")return!0;
430if(typeof r=="symbol"){const s=r.toString();if(s==="Symbol(Symbol.toPrimitive)"||s==="Symbol(Symbol.toStringTag)"||s==="Symbol(util.inspect.custom)"||s==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(n,r,i)}return!e.value&&typeof r=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),e.value=!0),Reflect.get(n,r,i)}})}function oB(t){return JSON.parse(JSON.stringify(t))}const Ah=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),sge=[502,503,504];async function lB(t){var e;if(!qye(t))throw new lk(Ah(t),0);if(sge.includes(t.status))throw new lk(Ah(t),t.status);let n;try{n=await t.json()}catch(s){throw new Ph(Ah(s),s)}let r;const i=ege(t);if(i&&i.getTime()>=UJ["2024-01-01"].timestamp&&typeof n=="object"&&n&&typeof n.code=="string"?r=n.code:typeof n=="object"&&n&&typeof n.error_code=="string"&&(r=n.error_code),r){if(r==="weak_password")throw new rB(Ah(n),t.status,((e=n.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(r==="session_not_found")throw new La}else if(typeof n=="object"&&n&&typeof n.weak_password=="object"&&n.weak_password&&Array.isArray(n.weak_password.reasons)&&n.weak_password.reasons.length&&n.weak_password.reasons.reduce((s,a)=>s&&typeof a=="string",!0))throw new rB(Ah(n),t.status,n.weak_password.reasons);throw new Pye(Ah(n),t.status||500,r)}const age=(t,e,n,r)=>{const i={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e==null?void 0:e.headers),i.body=JSON.stringify(r),Object.assign(Object.assign({},i),n))};async function Tt(t,e,n,r){var i;const s=Object.assign({},r==null?void 0:r.headers);s[ok]||(s[ok]=UJ["2024-01-01"].name),r!=null&&r.jwt&&(s.Authorization=`Bearer ${r.jwt}`);const a=(i=r==null?void 0:r.query)!==null&&i!==void 0?i:{};r!=null&&r.redirectTo&&(a.redirect_to=r.redirectTo);const o=Object.keys(a).length?"?"+new URLSearchParams(a).toString():"",l=await oge(t,e,n+o,{headers:s,noResolveJson:r==null?void 0:r.noResolveJson},{},r==null?void 0:r.body);return r!=null&&r.xform?r==null?void 0:r.xform(l):{data:Object.assign({},l),error:null}}async function oge(t,e,n,r,i,s){const a=age(e,r,i,s);let o;try{o=await t(n,Object.assign({},a))}catch(l){throw console.error(l),new lk(Ah(l),0)}if(o.ok||await lB(o),r!=null&&r.noResolveJson)return o;try{return await o.json()}catch(l){await lB(l)}}function el(t){var e;let n=null;uge(t)&&(n=Object.assign({},t),t.expires_at||(n.expires_at=Vye(t.expires_in)));const r=(e=t.user)!==null&&e!==void 0?e:t;return{data:{session:n,user:r},error:null}}function cB(t){const e=el(t);return!e.error&&t.weak_password&&typeof t.weak_password=="object"&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.message&&typeof t.weak_password.message=="string"&&t.weak_password.reasons.reduce((n,r)=>n&&typeof r=="string",!0)&&(e.data.weak_password=t.weak_password),e}function Xd(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}function lge(t){return{data:t,error:null}}function cge(t){const{action_link:e,email_otp:n,hashed_token:r,redirect_to:i,verification_type:s}=t,a=n7(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),o={action_link:e,email_otp:n,hashed_token:r,redirect_to:i,verification_type:s},l=Object.assign({},a);return{data:{properties:o,user:l},error:null}}function uB(t){return t}function uge(t){return t.access_token&&t.refresh_token&&t.expires_in}const AC=["global","local","others"];class dge{constructor({url:e="",headers:n={},fetch:r}){this.url=e,this.headers=n,this.fetch=zJ(r),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)}}
vendor: 4,781 bytes, line 430
430async signOut(e,n=AC[0]){if(AC.indexOf(n)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${AC.join(", ")}`);try{return await Tt(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(r){if(gt(r))return{data:null,error:r};throw r}}async inviteUserByEmail(e,n={}){try{return await Tt(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:Xd})}catch(r){if(gt(r))return{data:{user:null},error:r};throw r}}async generateLink(e){try{const{options:n}=e,r=n7(e,["options"]),i=Object.assign(Object.assign({},r),n);return"newEmail"in r&&(i.new_email=r==null?void 0:r.newEmail,delete i.newEmail),await Tt(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:i,headers:this.headers,xform:cge,redirectTo:n==null?void 0:n.redirectTo})}catch(n){if(gt(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(e){try{return await Tt(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:Xd})}catch(n){if(gt(n))return{data:{user:null},error:n};throw n}}async listUsers(e){var n,r,i,s,a,o,l;try{const u={nextPage:null,lastPage:0,total:0},f=await Tt(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=e==null?void 0:e.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(s=(i=e==null?void 0:e.perPage)===null||i===void 0?void 0:i.toString())!==null&&s!==void 0?s:""},xform:uB});if(f.error)throw f.error;const p=await f.json(),y=(a=f.headers.get("x-total-count"))!==null&&a!==void 0?a:0,g=(l=(o=f.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&l!==void 0?l:[];return g.length>0&&(g.forEach(b=>{const v=parseInt(b.split(";")[0].split("=")[1].substring(0,1)),_=JSON.parse(b.split(";")[1].split("=")[1]);u[`${_}Page`]=v}),u.total=parseInt(y)),{data:Object.assign(Object.assign({},p),u),error:null}}catch(u){if(gt(u))return{data:{users:[]},error:u};throw u}}async getUserById(e){Zp(e);try{return await Tt(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:Xd})}catch(n){if(gt(n))return{data:{user:null},error:n};throw n}}async updateUserById(e,n){Zp(e);try{return await Tt(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:n,headers:this.headers,xform:Xd})}catch(r){if(gt(r))return{data:{user:null},error:r};throw r}}async deleteUser(e,n=!1){Zp(e);try{return await Tt(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:n},xform:Xd})}catch(r){if(gt(r))return{data:{user:null},error:r};throw r}}async _listFactors(e){Zp(e.userId);try{const{data:n,error:r}=await Tt(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:i=>({data:{factors:i},error:null})});return{data:n,error:r}}catch(n){if(gt(n))return{data:null,error:n};throw n}}async _deleteFactor(e){Zp(e.userId),Zp(e.id);try{return{data:await Tt(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(n){if(gt(n))return{data:null,error:n};throw n}}async _listOAuthClients(e){var n,r,i,s,a,o,l;try{const u={nextPage:null,lastPage:0,total:0},f=await Tt(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=e==null?void 0:e.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(s=(i=e==null?void 0:e.perPage)===null||i===void 0?void 0:i.toString())!==null&&s!==void 0?s:""},xform:uB});if(f.error)throw f.error;const p=await f.json(),y=(a=f.headers.get("x-total-count"))!==null&&a!==void 0?a:0,g=(l=(o=f.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&l!==void 0?l:[];return g.length>0&&(g.forEach(b=>{const v=parseInt(b.split(";")[0].split("=")[1].substring(0,1)),_=JSON.parse(b.split(";")[1].split("=")[1]);u[`${_}Page`]=v}),u.total=parseInt(y)),{data:Object.assign(Object.assign({},p),u),error:null}}catch(u){if(gt(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(e){try{return await Tt(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(gt(n))return{data:null,error:n};throw n}}async _getOAuthClient(e){try{return await Tt(this.fetch,"GET",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(gt(n))return{data:null,error:n};throw n}}async _updateOAuthClient(e,n){try{return await Tt(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${e}`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(gt(r))return{data:null,error:r};throw r}}async _deleteOAuthClient(e){try{return await Tt(this.fetch,"DELET
430E",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(gt(n))return{data:null,error:n};throw n}}async _regenerateOAuthClientSecret(e){try{return await Tt(this.fetch,"POST",`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(gt(n))return{data:null,error:n};throw n}}}function dB(t={}){return{getItem:e=>t[e]||null,setItem:(e,n)=>{t[e]=n},removeItem:e=>{delete t[e]}}}const Uc={debug:!!(globalThis&&FJ()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class VJ extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class hge extends VJ{}async function fge(t,e,n){Uc.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);const r=new globalThis.AbortController;e>0&&setTimeout(()=>{r.abort(),Uc.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e),await Promise.resolve();try{return await globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},async i=>{if(i){Uc.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,i.name);try{return await n()}finally{Uc.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,i.name)}}else{if(e===0)throw Uc.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new hge(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(Uc.debug)try{const s=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(s,null," "))}catch(s){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",s)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await n()}})}catch(i){if((i==null?void 0:i.name)==="AbortError"&&e>0)return Uc.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock",t),console.warn(`@supabase/gotrue-js: Lock "${t}" was not released within ${e}ms. This may indicate an orphaned lock from a component unmount (e.g., React Strict Mode). Forcefully acquiring the lock to recover.`),await Promise.resolve().then(()=>globalThis.navigator.locks.request(t,{mode:"exclusive",steal:!0},async s=>{if(s){Uc.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",t,s.name);try{return await n()}finally{Uc.debug&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",t,s.name)}}else return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await n()}));throw i}}function pge(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function HJ(t){if(!/^0x[a-fA-F0-9]{40}$/.test(t))throw new Error(`@supabase/auth-js: Address "${t}" is invalid.`);return t.toLowerCase()}function mge(t){return parseInt(t,16)}function yge(t){const e=new TextEncoder().encode(t);return"0x"+Array.from(e,r=>r.toString(16).padStart(2,"0")).join("")}function gge(t){var e;const{chainId:n,domain:r,expirationTime:i,issuedAt:s=new Date,nonce:a,notBefore:o,requestId:l,resources:u,scheme:f,uri:p,version:y}=t;{if(!Number.isInteger(n))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${n}`);if(!r)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(a&&a.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${a}`);if(!p)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(y!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${y}`);if(!((e=t.statement)===null||e===void 0)&&e.includes(` 431`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${t.statement}`)}const g=HJ(t.address),b=f?`${f}://${r}`:r,v=t.statement?`${t.statement} 432`:"",_=`${b} wants you to sign in with your Ethereum account: 433${g} 434 435${v}`;let C=`URI: ${p} 436Version: ${y} 437Chain ID: ${n}${a?` 438Nonce: ${a}`:""} 439Issued At: ${s.toISOString()}`;if(i&&(C+=` 440Expiration Time: ${i.toISOString()}`),o&&(C+=` 441Not Before: ${o.toISOString()}`),l&&(C+=` 442Request ID: ${l}`),u){let S=` 443Resources:`;for(const x of u){if(!x||typeof x!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${x}`);S+=` 444- ${x}`}C+=S}return`${_} 445${C}`}
445class fi extends Error{constructor({message:e,code:n,cause:r,name:i}){var s;super(e,{cause:r}),this.__isWebAuthnError=!0,this.name=(s=i??(r instanceof Error?r.name:void 0))!==null&&s!==void 0?s:"Unknown Error",this.code=n}}class u8 extends fi{constructor(e,n){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:n,message:e}),this.name="WebAuthnUnknownError",this.originalError=n}}function bge({error:t,options:e}){var n,r,i;const{publicKey:s}=e;if(!s)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new fi({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else if(t.name==="ConstraintError"){if(((n=s.authenticatorSelection)===null||n===void 0?void 0:n.requireResidentKey)===!0)return new fi({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:t});if(e.mediation==="conditional"&&((r=s.authenticatorSelection)===null||r===void 0?void 0:r.userVerification)==="required")return new fi({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:t});if(((i=s.authenticatorSelection)===null||i===void 0?void 0:i.userVerification)==="required")return new fi({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:t})}else{if(t.name==="InvalidStateError")return new fi({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:t});if(t.name==="NotAllowedError")return new fi({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="NotSupportedError")return s.pubKeyCredParams.filter(o=>o.type==="public-key").length===0?new fi({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new fi({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:t});if(t.name==="SecurityError"){const a=window.location.hostname;if(WJ(a)){if(s.rp.id!==a)return new fi({message:`The RP ID "${s.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new fi({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="TypeError"){if(s.user.id.byteLength<1||s.user.id.byteLength>64)return new fi({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:t})}else if(t.name==="UnknownError")return new fi({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new fi({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}function wge({error:t,options:e}){const{publicKey:n}=e;if(!n)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new fi({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new fi({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const r=window.location.hostname;if(WJ(r)){if(n.rpId!==r)return new fi({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new fi({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new fi({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new fi({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}class vge{createNewAbortSignal(){if(this.controller){const n=new Error("Cancelling existing WebAuthn API call for new one");n.name="AbortError",this.controller.abort(n)}const e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){const e=new Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}}const _ge=new vge;function xge(t){if(!t)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(t);const{challenge:e,user:n,excludeCredentials:r}=t,i=n7(t,["challenge","user","excludeCredentials"]),s=B0(e).buffer,a=Object.assign(Object.assign({},n),{id:B0(n.id).buffer}),o=Object.assign(Object.assign({},i),{challenge:s,user:a});if(r&&r.length>0){o.excludeCredentials=new Array(r.length);for(let l=0;l<r.length;l++){const u=r[l];o.excludeCredentials[l]=Object.assign(Object.assign({},u),{id:B0(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return o}function Cge(t){if(!t)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(t);const{challenge:e,allowCredentials:n}=t,r=n7(t,["challenge","allowCredentials"]),i=B0(e).buffer,s=Object.assign(Object.assign({},r),{challenge:i});if(n&&n.length>0){s.allowCredentials=new Array(n.length);for(let a=0;a<n.length;a++){const o=n[a];s.allowCredentials[a]=Object.assign(Object.assign({},o),{id:B0(o.id).buffer,type:o.type||"public-key",transports:o.transports})}}return s}function Ege(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const n=t;return{id:t.id,rawId:t.id,response:{attestationObject:Hh(new Uint8Array(t.response.attestationObject)),clientDataJSON:Hh(new Uint8Array(t.response.clientDataJSON))},type:"public-key",clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:(e=n.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function Sge(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const n=t,r=t.getClientExtensionResults(),i=t.response;return{id:t.id,rawId:t.id,response:{authenticatorData:Hh(new Uint8Array(i.authenticatorData)),clientDataJSON:Hh(new Uint8Array(i.clientDataJSON)),signature:Hh(new Uint8Array(i.signature)),userHandle:i.userHandle?Hh(new Uint8Array(i.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:(e=n.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function WJ(t){return t==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)}function hB(){var t,e;return!!(as()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.create)=="function"&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.get)=="function")}async function Age(t){try{const e=await navigator.credentials.create(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new u8("Browser returned unexpected credential type",e)}:{data:null,error:new u8("Empty credential response",e)}}catch(e){return{data:null,error:bge({error:e,options:t})}}}async function kge(t){try{const e=await navigator.credentials.get(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new u8("Browser returned unexpected credential type",e)}:{data:null,error:new u8("Empty credential response",e)}}catch(e){return{data:null,error:wge({error:e,options:t})}}}const Tge={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},Lge={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function d8(...t){const e=i=>i!==null&&typeof i=="object"&&!Array.isArray(i),n=i=>i instanceof ArrayBuffer||ArrayBuffer.isView(i),r={};for(const i of t)if(i)for(const s in i){const a=i[s];if(a!==void 0)if(Array.isArray(a))r[s]=a;else if(n(a))r[s]=a;else if(e(a)){const o=r[s];e(o)?r[s]=d8(o,a):r[s]=d8(a)}else r[s]=a}return r}function $ge(t,e){return d8(Tge,t,e||{})}function Ige(t,e){return d8(Lge,t,e||{})}class Nge{constructor(e){this.client=e,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:"webauthn"}))}async _challenge({factorId:e,webauthn:n,friendlyName:r,signal:i},s){var a;try{const{data:o,error:l}=await this.client.mfa.challenge({factorId:e,webauthn:n});if(!o)return{data:null,error:l};const u=i??_ge.createNewAbortSignal();if(o.webauthn.type==="create"){const{user:f}=o.webauthn.credential_options.publicKey;if(!f.name){const p=r;if(p)f.name=`${f.id}:${p}`;else{const g=(await this.client.getUser()).data.user,b=((a=g==null?void 0:g.user_metadata)===null||a===void 0?void 0:a.name)||(g==null?void 0:g.email)||(g==null?void 0:g.id)||"User";f.name=`${f.id}:${b}`}}f.displayName||(f.displayName=f.name)}switch(o.webauthn.type){case"create":{const f=$ge(o.webauthn.credential_options.publicKey,s==null?void 0:s.create),{data:p,error:y}=await Age({publicKey:f,signal:u});return p?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:p}},error:null}:{data:null,error:y}}case"request":{const f=Ige(o.webauthn.credential_options.publicKey,s==null?void 0:s.request),{data:p,error:y}=await kge(Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:f,signal:u}));return p?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:p}},error:null}:{data:null,error:y}}}}catch(o){return gt(o)?{data:null,error:o}:{data:null,error:new Ph("Unexpected error in challenge",o)}}}async _verify({challengeId:e,factorId:n,webauthn:r}){return this.client.mfa.verify({factorId:n,challengeId:e,webauthn:r})}async _authenticate({factorId:e,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:i}={}},s){if(!n)return{data:null,error:new o3("rpId is required for WebAuthn authentication")};try{if(!hB())return{data:null,error:new Ph("Browser does not support WebAuthn",null)};const{data:a,error:o}=await this.challenge({factorId:e,webauthn:{rpId:n,rpOrigins:r},signal:i},{request:s});if(!a)return{data:null,error:o};const{webauthn:l}=a;return this._verify({factorId:e,challengeId:a.challengeId,webauthn:{type:l.type,rpId:n,rpOrigins:r,credential_response:l.credential_response}})}catch(a){return gt(a)?{data:null,error:a}:{data:null,error:new Ph("Unexpected error in authenticate",a)}}}async _register({friendlyName:e,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:i}={}},s){if(!n)return{data:null,error:new o3("rpId is required for WebAuthn registration")};try{if(!hB())return{data:null,error:new Ph("Browser does not support WebAuthn",null)};const{data:a,error:o}=await this._enroll({friendlyName:e});if(!a)return await this.client.mfa.listFactors().then(f=>{var p;return(p=f.data)===null||p===void 0?void 0:p.all.find(y=>y.factor_type==="webauthn"&&y.friendly_name===e&&y.status!=="unverified")}).then(f=>f?this.client.mfa.unenroll({factorId:f==null?void 0:f.id}):void 0),{data:null,error:o};const{data:l,error:u}=await this._challenge({factorId:a.id,friendlyName:a.friendly_name,webauthn:{rpId:n,rpOrigins:r},signal:i},{create:s});return l?this._verify({factorId:a.id,challengeId:l.challengeId,webauthn:{rpId:n,rpOrigins:r,type:l.webauthn.type,credential_response:l.webauthn.credential_response}}):{data:null,error:u}}catch(a){return gt(a)?{data:null,error:a}:{data:null,error:new Ph("Unexpected error in register",a)}}}}pge();const Oge={url:Lye,storageKey:$ye,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:Iye,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1};async function fB(t,e,n){return await n()}const Kp={};class l3{get jwks(){var e,n;return(n=(e=Kp[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&n!==void 0?n:{keys:[]}}set jwks(e){Kp[this.storageKey]=Object.assign(Object.assign({},Kp[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,n;return(n=(e=Kp[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&n!==void 0?n:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){Kp[this.storageKey]=Object.assign(Object.assign({},Kp[this.storageKey]),{cachedAt:e})}constructor(e){var n,r,i;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const s=Object.assign(Object.assign({},Oge),e);if(this.storageKey=s.storageKey,this.instanceID=(n=l3.nextInstanceID[this.storageKey])!==null&&n!==void 0?n:0,l3.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!s.debug,typeof s.debug=="function"&&(this.logger=s.debug),this.instanceID>0&&as()){const a=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(a),this.logDebugMessages&&console.trace(a)}if(this.persistSession=s.persistSession,this.autoRefreshToken=s.autoRefreshToken,this.admin=new dge({url:s.url,headers:s.headers,fetch:s.fetch}),this.url=s.url,this.headers=s.headers,this.fetch=zJ(s.fetch),this.lock=s.lock||fB,this.detectSessionInUrl=s.detectSessionInUrl,this.flowType=s.flowType,this.hasCustomAuthorizationHeader=s.hasCustomAuthorizationHeader,this.throwOnError=s.throwOnError,this.lockAcquireTimeout=s.lockAcquireTimeout,s.lock?this.lock=s.lock:this.persistSession&&as()&&(!((r=globalThis==null?void 0:globalThis.navigator)===null||r===void 0)&&r.locks)?this.lock=fge:this.lock=fB,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new Nge(this)}
445,this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(s.storage?this.storage=s.storage:FJ()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=dB(this.memoryStorage)),s.userStorage&&(this.userStorage=s.userStorage)):(this.memoryStorage={},this.storage=dB(this.memoryStorage)),as()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(a){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",a)}(i=this.broadcastChannel)===null||i===void 0||i.addEventListener("message",async a=>{this._debug("received broadcast notification from other tab or client",a);try{await this._notifyAllSubscribers(a.data.event,a.data.session,!1)}catch(o){this._debug("#broadcastChannel","error",o)}})}s.skipAutoInitialize||this.initialize().catch(a=>{this._debug("#initialize()","error",a)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${DJ}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var e;try{let n={},r="none";if(as()&&(n=Wye(window.location.href),this._isImplicitGrantCallback(n)?r="implicit":await this._isPKCECallback(n)&&(r="pkce")),as()&&this.detectSessionInUrl&&r!=="none"){const{data:i,error:s}=await this._getSessionFromURL(n,r);if(s){if(this._debug("#_initialize()","error detecting session from URL",s),jye(s)){const l=(e=s.details)===null||e===void 0?void 0:e.code;if(l==="identity_already_exists"||l==="identity_not_found"||l==="single_identity_not_deletable")return{error:s}}return{error:s}}const{session:a,redirectType:o}=i;return this._debug("#_initialize()","detected session in URL",a,"redirect type",o),await this._saveSession(a),setTimeout(async()=>{o==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",a):await this._notifyAllSubscribers("SIGNED_IN",a)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(n){return gt(n)?this._returnResult({error:n}):this._returnResult({error:new Ph("Unexpected error during initialization",n)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var n,r,i;try{const s=await Tt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(n=e==null?void 0:e.options)===null||n===void 0?void 0:n.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:(i=e==null?void 0:e.options)===null||i===void 0?void 0:i.captchaToken}},xform:el}),{data:a,error:o}=s;if(o||!a)return this._returnResult({data:{user:null,session:null},error:o});const l=a.session,u=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(s){if(gt(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signUp(e){var n,r,i;try{let s;if("email"in e){const{email:f,password:p,options:y}=e;let g=null,b=null;this.flowType==="pkce"&&([g,b]=await qp(this.storage,this.storageKey)),s=await Tt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:y==null?void 0:y.emailRedirectTo,body:{email:f,password:p,data:(n=y==null?void 0:y.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:y==null?void 0:y.captchaToken},code_challenge:g,code_challenge_method:b},xform:el})}else if("phone"in e){const{phone:f,password:p,options:y}=e;s=await Tt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:f,password:p,data:(r=y==null?void 0:y.data)!==null&&r!==void 0?r:{},channel:(i=y==null?void 0:y.channel)!==null&&i!==void 0?i:"sms",gotrue_meta_security:{captcha_token:y==null?void 0:y.captchaToken}},xform:el})}else throw new s4("You must provide either an email or phone number and a password");const{data:a,error:o}=s;
445if(o||!a)return await ts(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:o});const l=a.session,u=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(s){if(await ts(this.storage,`${this.storageKey}-code-verifier`),gt(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithPassword(e){try{let n;if("email"in e){const{email:s,password:a,options:o}=e;n=await Tt(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:s,password:a,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:cB})}else if("phone"in e){const{phone:s,password:a,options:o}=e;n=await Tt(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:s,password:a,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:cB})}else throw new s4("You must provide either an email or phone number and a password");const{data:r,error:i}=n;if(i)return this._returnResult({data:{user:null,session:null},error:i});if(!r||!r.session||!r.user){const s=new Wp;return this._returnResult({data:{user:null,session:null},error:s})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:i})}catch(n){if(gt(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOAuth(e){var n,r,i,s;return await this._handleProviderSignIn(e.provider,{redirectTo:(n=e.options)===null||n===void 0?void 0:n.redirectTo,scopes:(r=e.options)===null||r===void 0?void 0:r.scopes,queryParams:(i=e.options)===null||i===void 0?void 0:i.queryParams,skipBrowserRedirect:(s=e.options)===null||s===void 0?void 0:s.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){const{chain:n}=e;switch(n){case"ethereum":return await this.signInWithEthereum(e);case"solana":return await this.signInWithSolana(e);default:throw new Error(`@supabase/auth-js: Unsupported chain "${n}"`)}}async signInWithEthereum(e){var n,r,i,s,a,o,l,u,f,p,y;let g,b;if("message"in e)g=e.message,b=e.signature;else{const{chain:v,wallet:_,statement:C,options:S}=e;let x;if(as())if(typeof _=="object")x=_;else{const j=window;if("ethereum"in j&&typeof j.ethereum=="object"&&"request"in j.ethereum&&typeof j.ethereum.request=="function")x=j.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof _!="object"||!(S!=null&&S.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");x=_}const A=new URL((n=S==null?void 0:S.url)!==null&&n!==void 0?n:window.location.href),I=await x.request({method:"eth_requestAccounts"}).then(j=>j).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!I||I.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const $=HJ(I[0]);let O=(r=S==null?void 0:S.signInWithEthereum)===null||r===void 0?void 0:r.chainId;if(!O){const j=await x.request({method:"eth_chainId"});O=mge(j)}const P={domain:A.host,address:$,statement:C,uri:A.href,version:"1",chainId:O,nonce:(i=S==null?void 0:S.signInWithEthereum)===null||i===void 0?void 0:i.nonce,issuedAt:(a=(s=S==null?void 0:S.signInWithEthereum)===null||s===void 0?void 0:s.issuedAt)!==null&&a!==void 0?a:new Date,expirationTime:(o=S==null?void 0:S.signInWithEthereum)===null||o===void 0?void 0:o.expirationTime,notBefore:(l=S==null?void 0:S.signInWithEthereum)===null||l===void 0?void 0:l.notBefore,requestId:(u=S==null?void 0:S.signInWithEthereum)===null||u===void 0?void 0:u.requestId,resources:(f=S==null?void 0:S.signInWithEthereum)===null||f===void 0?void 0:f.resources};g=gge(P),b=await x.request({method:"personal_sign",params:[yge(g),$]})}try{const{data:v,error:_}=await Tt(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:g,signature:b},!((p=e.options)===null||p===void 0)&&p.captchaToken?{gotrue_meta_security:{captcha_token:(y=e.options)===null||y===void 0?void 0:y.captchaToken}}:null),xform:el});if(_)throw _;if(!v||!v.session||!v.user){const C=new Wp;return this._returnResult({data:{user:null,session:null},error:C})}return v.session&&(await this._saveSession(v.session),await this._notifyAllSubscribers("SIGNED_IN",v.session)),this._returnResult({data:Object.assign({},v),error:_})}catch(v){if(gt(v))return this._returnResult({data:{user:null,session:null},error:v});throw v}}async signInWithSolana(e){var n,r,i,s,a,o,l,u,f,p,y,g;let b,v;if("message"in e)b=e.message,v=e.signature;else{const{chain:_,wallet:C,statement:S,options:x}=e;let A;if(as())if(typeof C=="object")A=C;else{const $=window;if("solana"in $&&typeof $.solana=="object"&&("signIn"in $.solana&&typeof $.solana.signIn=="function"||"signMessage"in $.solana&&typeof $.solana.signMessage=="function"))A=$.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof C!="object"||!(x!=null&&x.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");A=C}const I=new URL((n=x==null?void 0:x.url)!==null&&n!==void 0?n:window.location.href);if("signIn"in A&&A.signIn){const $=await A.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},x==null?void 0:x.signInWithSolana),{version:"1",domain:I.host,uri:I.href}),S?{statement:S}:null));let O;if(Array.isArray($)&&$[0]&&typeof $[0]=="object")O=$[0];else if($&&typeof $=="object"&&"signedMessage"in $&&"signature"in $)O=$;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in O&&"signature"in O&&(typeof O.signedMessage=="string"||O.signedMessage instanceof Uint8Array)&&O.signature instanceof Uint8Array)b=typeof O.signedMessage=="string"?O.signedMessage:new TextDecoder().decode(O.signedMessage),v=O.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in A)||typeof A.signMessage!="function"||!("publicKey"in A)||typeof A!="object"||!A.publicKey||!("toBase58"in A.publicKey)||typeof A.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");b=[`${I.host} wants you to sign in with your Solana account:`,A.publicKey.toBase58(),...S?["",S,""]:[""],"Version: 1",`URI: ${I.href}`,`Issued At: ${(i=(r=x==null?void 0:x.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&i!==void 0?i:new Date().toISOString()}`,...!((s=x==null?void 0:x.signInWithSolana)===null||s===void 0)&&s.notBefore?[`Not Before: ${x.signInWithSolana.notBefore}`]:[],...!((a=x==null?void 0:x.signInWithSolana)===null||a===void 0)&&a.expirationTime?[`Expiration Time: ${x.signInWithSolana.expirationTime}`]:[],...!((o=x==null?void 0:x.signInWithSolana)===null||o===void 0)&&o.chainId?[`Chain ID: ${x.signInWithSolana.chainId}`]:[],...!((l=x==null?void 0:x.signInWithSolana)===null||l===void 0)&&l.nonce?[`Nonce: ${x.signInWithSolana.nonce}`]:[],...!((u=x==null?void 0:x.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${x.signInWithSolana.requestId}`]:[],...!((p=(f=x==null?void 0:x.signInWithSolana)===null||f===void 0?void 0:f.resources)===null||p===void 0)&&p.length?["Resources",...x.signInWithSolana.resources.map(O=>`- ${O}`)]:[]].join(` 446`);const $=await A.signMessage(new TextEncoder().encode(b),"utf8");if(!$||!($ instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");v=$}}try{const{data:_,error:C}=await Tt(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:b,signature:Hh(v)},!((y=e.options)===null||y===void 0)&&y.captchaToken?{gotrue_meta_security:{captcha_token:(g=e.options)===null||g===void 0?void 0:g.captchaToken}}:null),xform:el});if(C)throw C;if(!_||!_.session||!_.user){const S=new Wp;return this._returnResult({data:{user:null,session:null},error:S})}return _.session&&(await this._saveSession(_.session),await this._notifyAllSubscribers("SIGNED_IN",_.session)),this._returnResult({data:Object.assign({},_),error:C})}catch(_){if(gt(_))return this._returnResult({data:{user:null,session:null},error:_});throw _}}async _exchangeCodeForSession(e){const n=await ph(this.storage,`${this.storageKey}-code-verifier`),[r,i]=(n??"").split("/");try{if(!r&&this.flowType==="pkce")throw new Mye;const{data:s,error:a}=await Tt(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:r},xform:el});if(await ts(this.storage,`${this.storageKey}-code-verifier`),a)throw a;if(!s||!s.session||!s.user){const o=new Wp;return this._returnResult({data:{user:null,session:null,redirectType:null},error:o})}return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",s.session)),this._returnResult({data:Object.assign(Object.assign({},s),{redirectType:i??null}),error:a})}catch(s){if(await ts(this.storage,`${this.storageKey}-code-verifier`),gt(s))return this._returnResult({data:{user:null,session:null,redirectType:null},error:s});throw s}}async signInWithIdToken(e){try{const{options:n,provider:r,token:i,access_token:s,nonce:a}=e,o=await Tt(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:i,access_token:s,nonce:a,gotrue_meta_security:{captcha_token:n==null?void 0:n.captchaToken}},xform:el}),{data:l,error:u}=o;if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!l||!l.session||!l.user){const f=new Wp;return this._returnResult({data:{user:null,session:null},error:f})}return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),this._returnResult({data:l,error:u})}catch(n){if(gt(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOtp(e){var n,r,i,s,a;try{if("email"in e){const{email:o,options:l}=e;let u=null,f=null;this.flowType==="pkce"&&([u,f]=await qp(this.storage,this.storageKey));const{error:p}=await Tt(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:o,data:(n=l==null?void 0:l.data)!==null&&n!==void 0?n:{},create_user:(r=l==null?void 0:l.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},code_challenge:u,code_challenge_method:f},redirectTo:l==null?void 0:l.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:p})}if("phone"in e){const{phone:o,options:l}=e,{data:u,error:f}=await Tt(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:o,data:(i=l==null?void 0:l.data)!==null&&i!==void 0?i:{},create_user:(s=l==null?void 0:l.shouldCreateUser)!==null&&s!==void 0?s:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},channel:(a=l==null?void 0:l.channel)!==null&&a!==void 0?a:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:f})}throw new s4("You must provide either an email or phone number.")}catch(o){if(await ts(this.storage,`${this.storageKey}-code-verifier`),gt(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async verifyOtp(e){var n,r;try{let i,s;"options"in e&&(i=(n=e.options)===null||n===void 0?void 0:n.redirectTo,s=(r=e.options)===null||r===void 0?void 0:r.captchaToken);const{data:a,error:o}=await Tt(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:s}}),redirectTo:i,xform:el});if(o)throw o;if(!a)throw new Error("An error occurred on token verification.");const l=a.session,u=a.user;return l!=null&&l.access_token&&(await this._saveSession(l),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(i){if(gt(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithSSO(e){var n,r,i,s,a;try{let o=null,l=null;this.flowType==="pkce"&&([o,l]=await qp(this.storage,this.storageKey));const u=await Tt(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(r=(n=e.options)===null||n===void 0?void 0:n.redirectTo)!==null&&r!==void 0?r:void 0}),!((i=e==null?void 0:e.options)===null||i===void 0)&&i.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}
446:null),{skip_http_redirect:!0,code_challenge:o,code_challenge_method:l}),headers:this.headers,xform:lge});return!((s=u.data)===null||s===void 0)&&s.url&&as()&&!(!((a=e.options)===null||a===void 0)&&a.skipBrowserRedirect)&&window.location.assign(u.data.url),this._returnResult(u)}catch(o){if(await ts(this.storage,`${this.storageKey}-code-verifier`),gt(o))return this._returnResult({data:null,error:o});throw o}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{const{data:{session:n},error:r}=e;if(r)throw r;if(!n)throw new La;const{error:i}=await Tt(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return this._returnResult({data:{user:null,session:null},error:i})})}catch(e){if(gt(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{const n=`${this.url}/resend`;if("email"in e){const{email:r,type:i,options:s}=e,{error:a}=await Tt(this.fetch,"POST",n,{headers:this.headers,body:{email:r,type:i,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}},redirectTo:s==null?void 0:s.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:a})}else if("phone"in e){const{phone:r,type:i,options:s}=e,{data:a,error:o}=await Tt(this.fetch,"POST",n,{headers:this.headers,body:{phone:r,type:i,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:a==null?void 0:a.message_id},error:o})}throw new s4("You must provide either an email or phone number and a type")}catch(n){if(gt(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async n=>n))}async _acquireLock(e,n){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),i=(async()=>(await r,await n()))();return this.pendingInLock.push((async()=>{try{await i}catch{}})()),i}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const r=n();for(this.pendingInLock.push((async()=>{try{await r}catch{}})()),await r;this.pendingInLock.length;){const i=[...this.pendingInLock];await Promise.all(i),this.pendingInLock.splice(0,i.length)}return await r}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{const n=await this.__loadSession();return await e(n)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null;const n=await ph(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",n),n!==null&&(this._isValidSession(n)?e=n:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};const r=e.expires_at?e.expires_at*1e3-Date.now()<xC:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",e.expires_at),!r){if(this.userStorage){const a=await ph(this.userStorage,this.storageKey+"-user");a!=null&&a.user?e.user=a.user:e.user=SC()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){const a={value:this.suppressGetSessionWarning};e.user=ige(e.user,a),a.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}const{data:i,error:s}=await this._callRefreshToken(e.refresh_token);return s?this._returnResult({data:{session:null},error:s}):this._returnResult({data:{session:i},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(e){if(e)return await this._getUser(e);await this.initializePromise;const n=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return n.data.user&&(this.suppressGetSessionWarning=!0),n}async _getUser(e){try{return e?await Tt(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:Xd}):await this._useSession(async n=>{var r,i,s;const{data:a,error:o}=n;
446if(o)throw o;return!(!((r=a.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new La}:await Tt(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(s=(i=a.session)===null||i===void 0?void 0:i.access_token)!==null&&s!==void 0?s:void 0,xform:Xd})})}catch(n){if(gt(n))return CC(n)&&(await this._removeSession(),await ts(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:n});throw n}}async updateUser(e,n={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,n))}async _updateUser(e,n={}){try{return await this._useSession(async r=>{const{data:i,error:s}=r;if(s)throw s;if(!i.session)throw new La;const a=i.session;let o=null,l=null;this.flowType==="pkce"&&e.email!=null&&([o,l]=await qp(this.storage,this.storageKey));const{data:u,error:f}=await Tt(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:n==null?void 0:n.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:o,code_challenge_method:l}),jwt:a.access_token,xform:Xd});if(f)throw f;return a.user=u.user,await this._saveSession(a),await this._notifyAllSubscribers("USER_UPDATED",a),this._returnResult({data:{user:a.user},error:null})})}catch(r){if(await ts(this.storage,`${this.storageKey}-code-verifier`),gt(r))return this._returnResult({data:{user:null},error:r});throw r}}async setSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new La;const n=Date.now()/1e3;let r=n,i=!0,s=null;const{payload:a}=o4(e.access_token);if(a.exp&&(r=a.exp,i=r<=n),i){const{data:o,error:l}=await this._callRefreshToken(e.refresh_token);if(l)return this._returnResult({data:{user:null,session:null},error:l});if(!o)return{data:{user:null,session:null},error:null};s=o}else{const{data:o,error:l}=await this._getUser(e.access_token);if(l)return this._returnResult({data:{user:null,session:null},error:l});s={access_token:e.access_token,refresh_token:e.refresh_token,user:o.user,token_type:"bearer",expires_in:r-n,expires_at:r},await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)}return this._returnResult({data:{user:s.user,session:s},error:null})}catch(n){if(gt(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async n=>{var r;if(!e){const{data:a,error:o}=n;if(o)throw o;e=(r=a.session)!==null&&r!==void 0?r:void 0}if(!(e!=null&&e.refresh_token))throw new La;const{data:i,error:s}=await this._callRefreshToken(e.refresh_token);return s?this._returnResult({data:{user:null,session:null},error:s}):i?this._returnResult({data:{user:i.user,session:i},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(n){if(gt(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async _getSessionFromURL(e,n){try{if(!as())throw new a4("No browser detected.");if(e.error||e.error_description||e.error_code)throw new a4(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(n){case"implicit":if(this.flowType==="pkce")throw new nB("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new a4("Not a valid implicit grant flow url.");break;default:}if(n==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new nB("No code detected.");const{data:S,error:x}=await this._exchangeCodeForSession(e.code);if(x)throw x;const A=new URL(window.location.href);return A.searchParams.delete("code"),window.history.replaceState(window.history.state,"",A.toString()),{data:{session:S.session,redirectType:null},error:null}}const{provider_token:r,provider_refresh_token:i,access_token:s,refresh_token:a,expires_in:o,expires_at:l,token_type:u}=e;if(!s||!o||!a||!u)throw new a4("No session defined in URL");const f=Math.round(Date.now()/1e3),p=parseInt(o);let y=f+p;l&&(y=parseInt(l));const g=y-f;
446g*1e3<=g0&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${g}s, should have been closer to ${p}s`);const b=y-p;f-b>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",b,y,f):f-b<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",b,y,f);const{data:v,error:_}=await this._getUser(s);if(_)throw _;const C={provider_token:r,provider_refresh_token:i,access_token:s,expires_in:p,expires_at:y,refresh_token:a,token_type:u,user:v.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:C,redirectType:e.type},error:null})}catch(r){if(gt(r))return this._returnResult({data:{session:null,redirectType:null},error:r});throw r}}_isImplicitGrantCallback(e){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),e):!!(e.access_token||e.error_description)}async _isPKCECallback(e){const n=await ph(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&n)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async n=>{var r;const{data:i,error:s}=n;if(s&&!CC(s))return this._returnResult({error:s});const a=(r=i.session)===null||r===void 0?void 0:r.access_token;if(a){const{error:o}=await this.admin.signOut(a,e);if(o&&!(Rye(o)&&(o.status===404||o.status===401||o.status===403)||CC(o)))return this._returnResult({error:o})}return e!=="others"&&(await this._removeSession(),await ts(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){const n=Hye(),r={id:n,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",n),this.stateChangeEmitters.delete(n)}};return this._debug("#onAuthStateChange()","registered callback with id",n),this.stateChangeEmitters.set(n,r),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(n)})))(),{data:{subscription:r}}}async _emitInitialSession(e){return await this._useSession(async n=>{var r,i;try{const{data:{session:s},error:a}=n;if(a)throw a;await((r=this.stateChangeEmitters.get(e))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",s)),this._debug("INITIAL_SESSION","callback id",e,"session",s)}catch(s){await((i=this.stateChangeEmitters.get(e))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",s),console.error(s)}})}async resetPasswordForEmail(e,n={}){let r=null,i=null;this.flowType==="pkce"&&([r,i]=await qp(this.storage,this.storageKey,!0));try{return await Tt(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:r,code_challenge_method:i,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:n.redirectTo})}catch(s){if(await ts(this.storage,`${this.storageKey}-code-verifier`),gt(s))return this._returnResult({data:null,error:s});throw s}}async getUserIdentities(){var e;try{const{data:n,error:r}=await this.getUser();if(r)throw r;return this._returnResult({data:{identities:(e=n.user.identities)!==null&&e!==void 0?e:[]},error:null})}catch(n){if(gt(n))return this._returnResult({data:null,error:n});throw n}}async linkIdentity(e){return"token"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){var n;try{const{data:r,error:i}=await this._useSession(async s=>{var a,o,l,u,f;const{data:p,error:y}=s;if(y)throw y;const g=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(a=e.options)===null||a===void 0?void 0:a.redirectTo,scopes:(o=e.options)===null||o===void 0?void 0:o.scopes,queryParams:(l=e.options)===null||l===void 0?void 0:l.queryParams,skipBrowserRedirect:!0});return await Tt(this.fetch,"GET",g,{headers:this.headers,jwt:(f=(u=p.session)===null||u===void 0?void 0:u.access_token)!==null&&f!==void 0?f:void 0})});if(i)throw i;return as()&&!(!((n=e.options)===null||n===void 0)&&n.skipBrowserRedirect)&&window.location.assign(r==null?void 0:r.url),this._returnResult({data:{provider:e.provider,url:r==null?void 0:r.url},error:null})}catch(r){if(gt(r))return this._returnResult({data:{provider:e.provider,url:null},error:r});throw r}}async linkIdentityIdToken(e){return await this._useSession(async n=>{var r;try{const{error:i,data:{session:s}}=n;
446if(i)throw i;const{options:a,provider:o,token:l,access_token:u,nonce:f}=e,p=await Tt(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(r=s==null?void 0:s.access_token)!==null&&r!==void 0?r:void 0,body:{provider:o,id_token:l,access_token:u,nonce:f,link_identity:!0,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:el}),{data:y,error:g}=p;return g?this._returnResult({data:{user:null,session:null},error:g}):!y||!y.session||!y.user?this._returnResult({data:{user:null,session:null},error:new Wp}):(y.session&&(await this._saveSession(y.session),await this._notifyAllSubscribers("USER_UPDATED",y.session)),this._returnResult({data:y,error:g}))}catch(i){if(await ts(this.storage,`${this.storageKey}-code-verifier`),gt(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}})}async unlinkIdentity(e){try{return await this._useSession(async n=>{var r,i;const{data:s,error:a}=n;if(a)throw a;return await Tt(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(i=(r=s.session)===null||r===void 0?void 0:r.access_token)!==null&&i!==void 0?i:void 0})})}catch(n){if(gt(n))return this._returnResult({data:null,error:n});throw n}}async _refreshAccessToken(e){const n=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(n,"begin");try{const r=Date.now();return await Kye(async i=>(i>0&&await Zye(200*Math.pow(2,i-1)),this._debug(n,"refreshing attempt",i),await Tt(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:el})),(i,s)=>{const a=200*Math.pow(2,i);return s&&EC(s)&&Date.now()+a-r<g0})}catch(r){if(this._debug(n,"error",r),gt(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}finally{this._debug(n,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,n){const r=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:n.redirectTo,scopes:n.scopes,queryParams:n.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",n,"url",r),as()&&!n.skipBrowserRedirect&&window.location.assign(r),{data:{provider:e,url:r},error:null}}async _recoverAndRefresh(){var e,n;const r="#_recoverAndRefresh()";this._debug(r,"begin");try{const i=await ph(this.storage,this.storageKey);if(i&&this.userStorage){let a=await ph(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!a&&(a={user:i.user},await b0(this.userStorage,this.storageKey+"-user",a)),i.user=(e=a==null?void 0:a.user)!==null&&e!==void 0?e:SC()}else if(i&&!i.user&&!i.user){const a=await ph(this.storage,this.storageKey+"-user");a&&(a!=null&&a.user)?(i.user=a.user,await ts(this.storage,this.storageKey+"-user"),await b0(this.storage,this.storageKey,i)):i.user=SC()}if(this._debug(r,"session from storage",i),!this._isValidSession(i)){this._debug(r,"session is not valid"),i!==null&&await this._removeSession();return}const s=((n=i.expires_at)!==null&&n!==void 0?n:1/0)*1e3-Date.now()<xC;if(this._debug(r,`session has${s?"":" not"} expired with margin of ${xC}s`),s){if(this.autoRefreshToken&&i.refresh_token){const{error:a}=await this._callRefreshToken(i.refresh_token);a&&(console.error(a),EC(a)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",a),await this._removeSession()))}}else if(i.user&&i.user.__isUserNotAvailableProxy===!0)try{const{data:a,error:o}=await this._getUser(i.access_token);!o&&(a!=null&&a.user)?(i.user=a.user,await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(a){console.error("Error getting user data:",a),this._debug(r,"error getting user data, skipping SIGNED_IN notification",a)}else await this._notifyAllSubscribers("SIGNED_IN",i)}catch(i){this._debug(r,"error",i),console.error(i);return}finally{this._debug(r,"end")}}async _callRefreshToken(e){var n,r;if(!e)throw new La;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const i=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(i,"begin");try{this.refreshingDeferred=new s7;const{data:s,error:a}=await this._refreshAccessToken(e);if(a)throw a;if(!s.session)throw new La;await this._saveSession(s.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",s.session);const o={data:s.session,error:null};return this.refreshingDeferred.resolve(o),o}catch(s){if(this._debug(i,"error",s),gt(s)){const a={data:null,error:s};return EC(s)||await this._removeSession(),(n=this.refreshingDeferred)===null||n===void 0||n.resolve(a),a}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(s),s}finally{this.refreshingDeferred=null,this._debug(i,"end")}}async _notifyAllSubscribers(e,n,r=!0){const i=`#_notifyAllSubscribers(${e})`;this._debug(i,"begin",n,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:e,session:n});const s=[],a=Array.from(this.stateChangeEmitters.values()).map(async o=>{try{await o.callback(e,n)}catch(l){s.push(l)}});if(await Promise.all(a),s.length>0){for(let o=0;o<s.length;o+=1)console.error(s[o]);throw s[0]}}finally{this._debug(i,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await ts(this.storage,`${this.storageKey}-code-verifier`);const n=Object.assign({},e),r=n.user&&n.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!r&&n.user&&await b0(this.userStorage,this.storageKey+"-user",{user:n.user});const i=Object.assign({},n);delete i.user;const s=oB(i);await b0(this.storage,this.storageKey,s)}else{const i=oB(n);await b0(this.storage,this.storageKey,i)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await ts(this.storage,this.storageKey),await ts(this.storage,this.storageKey+"-code-verifier"),await ts(this.storage,this.storageKey+"-user"),this.userStorage&&await ts(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&as()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}
446catch(n){console.error("removing visibilitychange callback failed",n)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const e=setInterval(()=>this._autoRefreshTokenTick(),g0);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e);const n=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=n,n&&typeof n=="object"&&typeof n.unref=="function"?n.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(n)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);const n=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,n&&clearTimeout(n)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const e=Date.now();try{return await this._useSession(async n=>{const{data:{session:r}}=n;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const i=Math.floor((r.expires_at*1e3-e)/g0);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${g0}ms, refresh threshold is ${ak} ticks`),i<=ak&&await this._callRefreshToken(r.refresh_token)})}catch(n){console.error("Auto refresh tick failed with error. This is likely a transient error.",n)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof VJ)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!as()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(e){this._debug("#visibilityChangedCallback","error",e)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){const n=`#_onVisibilityChanged(${e})`;this._debug(n,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(n,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,n,r){const i=[`provider=${encodeURIComponent(n)}`];if(r!=null&&r.redirectTo&&i.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r!=null&&r.scopes&&i.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[s,a]=await qp(this.storage,this.storageKey),o=new URLSearchParams({code_challenge:`${encodeURIComponent(s)}`,code_challenge_method:`${encodeURIComponent(a)}`});i.push(o.toString())}if(r!=null&&r.queryParams){const s=new URLSearchParams(r.queryParams);i.push(s.toString())}return r!=null&&r.skipBrowserRedirect&&i.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${e}?${i.join("&")}`}async _unenroll(e){try{return await this._useSession(async n=>{var r;const{data:i,error:s}=n;return s?this._returnResult({data:null,error:s}):await Tt(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(gt(n))return this._returnResult({data:null,error:n});throw n}}async _enroll(e){try{return await this._useSession(async n=>{var r,i;const{data:s,error:a}=n;
446if(a)return this._returnResult({data:null,error:a});const o=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:e.factorType==="totp"?{issuer:e.issuer}:{}),{data:l,error:u}=await Tt(this.fetch,"POST",`${this.url}/factors`,{body:o,headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token});return u?this._returnResult({data:null,error:u}):(e.factorType==="totp"&&l.type==="totp"&&(!((i=l==null?void 0:l.totp)===null||i===void 0)&&i.qr_code)&&(l.totp.qr_code=`data:image/svg+xml;utf-8,${l.totp.qr_code}`),this._returnResult({data:l,error:null}))})}catch(n){if(gt(n))return this._returnResult({data:null,error:n});throw n}}async _verify(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async n=>{var r;const{data:i,error:s}=n;if(s)return this._returnResult({data:null,error:s});const a=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type==="create"?Ege(e.webauthn.credential_response):Sge(e.webauthn.credential_response)})}:{code:e.code}),{data:o,error:l}=await Tt(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:a,headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token});return l?this._returnResult({data:null,error:l}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+o.expires_in},o)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",o),this._returnResult({data:o,error:l}))})}catch(n){if(gt(n))return this._returnResult({data:null,error:n});throw n}})}async _challenge(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async n=>{var r;const{data:i,error:s}=n;if(s)return this._returnResult({data:null,error:s});const a=await Tt(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token});if(a.error)return a;const{data:o}=a;if(o.type!=="webauthn")return{data:o,error:null};switch(o.webauthn.type){case"create":return{data:Object.assign(Object.assign({},o),{webauthn:Object.assign(Object.assign({},o.webauthn),{credential_options:Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:xge(o.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},o),{webauthn:Object.assign(Object.assign({},o.webauthn),{credential_options:Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:Cge(o.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(n){if(gt(n))return this._returnResult({data:null,error:n});throw n}})}async _challengeAndVerify(e){const{data:n,error:r}=await this._challenge({factorId:e.factorId});return r?this._returnResult({data:null,error:r}):await this._verify({factorId:e.factorId,challengeId:n.id,code:e.code})}async _listFactors(){var e;const{data:{user:n},error:r}=await this.getUser();if(r)return{data:null,error:r};const i={all:[],phone:[],totp:[],webauthn:[]};for(const s of(e=n==null?void 0:n.factors)!==null&&e!==void 0?e:[])i.all.push(s),s.status==="verified"&&i[s.factor_type].push(s);return{data:i,error:null}}async _getAuthenticatorAssuranceLevel(e){var n,r,i,s;if(e)try{const{payload:g}=o4(e);let b=null;g.aal&&(b=g.aal);let v=b;const{data:{user:_},error:C}=await this.getUser(e);if(C)return this._returnResult({data:null,error:C});((r=(n=_==null?void 0:_.factors)===null||n===void 0?void 0:n.filter(A=>A.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(v="aal2");const x=g.amr||[];return{data:{currentLevel:b,nextLevel:v,currentAuthenticationMethods:x},error:null}}catch(g){if(gt(g))return this._returnResult({data:null,error:g});throw g}const{data:{session:a},error:o}
446=await this.getSession();if(o)return this._returnResult({data:null,error:o});if(!a)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:l}=o4(a.access_token);let u=null;l.aal&&(u=l.aal);let f=u;((s=(i=a.user.factors)===null||i===void 0?void 0:i.filter(g=>g.status==="verified"))!==null&&s!==void 0?s:[]).length>0&&(f="aal2");const y=l.amr||[];return{data:{currentLevel:u,nextLevel:f,currentAuthenticationMethods:y},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async n=>{const{data:{session:r},error:i}=n;return i?this._returnResult({data:null,error:i}):r?await Tt(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:r.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new La})})}catch(n){if(gt(n))return this._returnResult({data:null,error:n});throw n}}async _approveAuthorization(e,n){try{return await this._useSession(async r=>{const{data:{session:i},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!i)return this._returnResult({data:null,error:new La});const a=await Tt(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"approve"},xform:o=>({data:o,error:null})});return a.data&&a.data.redirect_url&&as()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(a.data.redirect_url),a})}catch(r){if(gt(r))return this._returnResult({data:null,error:r});throw r}}async _denyAuthorization(e,n){try{return await this._useSession(async r=>{const{data:{session:i},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!i)return this._returnResult({data:null,error:new La});const a=await Tt(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"deny"},xform:o=>({data:o,error:null})});return a.data&&a.data.redirect_url&&as()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(a.data.redirect_url),a})}catch(r){if(gt(r))return this._returnResult({data:null,error:r});throw r}}async _listOAuthGrants(){try{return await this._useSession(async e=>{const{data:{session:n},error:r}=e;return r?this._returnResult({data:null,error:r}):n?await Tt(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,xform:i=>({data:i,error:null})}):this._returnResult({data:null,error:new La})})}catch(e){if(gt(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async n=>{const{data:{session:r},error:i}=n;return i?this._returnResult({data:null,error:i}):r?(await Tt(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new La})})}catch(n){if(gt(n))return this._returnResult({data:null,error:n});throw n}}async fetchJwk(e,n={keys:[]}){let r=n.keys.find(o=>o.kid===e);if(r)return r;const i=Date.now();if(r=this.jwks.keys.find(o=>o.kid===e),r&&this.jwks_cached_at+Oye>i)return r;const{data:s,error:a}=await Tt(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(a)throw a;return!s.keys||s.keys.length===0||(this.jwks=s,this.jwks_cached_at=i,r=s.keys.find(o=>o.kid===e),!r)?null:r}async getClaims(e,n={}){try{let r=e;if(!r){const{data:g,error:b}
446=await this.getSession();if(b||!g.session)return this._returnResult({data:null,error:b});r=g.session.access_token}const{header:i,payload:s,signature:a,raw:{header:o,payload:l}}=o4(r);n!=null&&n.allowExpired||tge(s.exp);const u=!i.alg||i.alg.startsWith("HS")||!i.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(i.kid,n!=null&&n.keys?{keys:n.keys}:n==null?void 0:n.jwks);if(!u){const{error:g}=await this.getUser(r);if(g)throw g;return{data:{claims:s,header:i,signature:a},error:null}}const f=nge(i.alg),p=await crypto.subtle.importKey("jwk",u,f,!0,["verify"]);if(!await crypto.subtle.verify(f,p,a,zye(`${o}.${l}`)))throw new ck("Invalid JWT signature");return{data:{claims:s,header:i,signature:a},error:null}}catch(r){if(gt(r))return this._returnResult({data:null,error:r});throw r}}}l3.nextInstanceID={};const Pge=l3,Rge="2.98.0";let ng="";typeof Deno<"u"?ng="deno":typeof document<"u"?ng="web":typeof navigator<"u"&&navigator.product==="ReactNative"?ng="react-native":ng="node";const jge={"X-Client-Info":`supabase-js-${ng}/${Rge}`},Mge={headers:jge},Dge={schema:"public"},Uge={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},Bge={};function c3(t){"@babel/helpers - typeof";return c3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c3(t)}function Fge(t,e){if(c3(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(c3(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function zge(t){var e=Fge(t,"string");return c3(e)=="symbol"?e:e+""}function Vge(t,e,n){return(e=zge(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pB(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Wr(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?pB(Object(n),!0).forEach(function(r){Vge(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):pB(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}const Hge=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),Wge=()=>Headers,qge=(t,e,n)=>{const r=Hge(n),i=Wge();return async(s,a)=>{var o;const l=(o=await e())!==null&&o!==void 0?o:t;let u=new i(a==null?void 0:a.headers);return u.has("apikey")||u.set("apikey",t),u.has("Authorization")||u.set("Authorization",`Bearer ${l}`),r(s,Wr(Wr({},a),{},{headers:u}))}};function Zge(t){return t.endsWith("/")?t:t+"/"}function Kge(t,e){var n,r;const{db:i,auth:s,realtime:a,global:o}=t,{db:l,auth:u,realtime:f,global:p}=e,y={db:Wr(Wr({},l),i),auth:Wr(Wr({},u),s),realtime:Wr(Wr({},f),a),storage:{},global:Wr(Wr(Wr({},p),o),{},{headers:Wr(Wr({},(n=p==null?void 0:p.headers)!==null&&n!==void 0?n:{}),(r=o==null?void 0:o.headers)!==null&&r!==void 0?r:{})}),accessToken:async()=>""};return t.accessToken?y.accessToken=t.accessToken:delete y.accessToken,y}function Gge(t){const e=t==null?void 0:t.trim();if(!e)throw new Error("supabaseUrl is required.");if(!e.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(Zge(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var Yge=class extends Pge{constructor(t){super(t)}},Jge=class{constructor(t,e,n){var r,i;this.supabaseUrl=t,this.supabaseKey=e;const s=Gge(t);if(!e)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",s),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",s),this.storageUrl=new URL("storage/v1",s),this.functionsUrl=new URL("functions/v1",s);const a=`sb-${s.hostname.split(".")[0]}-auth-token`,o={db:Dge,realtime:Bge,auth:Wr(Wr({},Uge),{},{storageKey:a}),global:Mge},l=Kge(n??{},o);if(this.storageKey=(r=l.auth.storageKey)!==null&&r!==void 0?r:"",this.headers=(i=l.global.headers)!==null&&i!==void 0?i:{},l.accessToken)this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(f,p)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(p)} is not possible`)}});else{var u;this.auth=this._initSupabaseAuthClient((u=l.auth)!==null&&u!==void 0?u:{},this.headers,l.global.fetch)}this.fetch=qge(e,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(Wr({headers:this.headers,accessToken:this._getAccessToken.bind(this)},l.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(f=>this.realtime.setAuth(f)).catch(f=>console.warn("Failed to set initial Realtime auth token:",f)),this.rest=new Rme(new
446URL("rest/v1",s).href,{headers:this.headers,schema:l.db.schema,fetch:this.fetch,timeout:l.db.timeout,urlLengthLimit:l.db.urlLengthLimit}),this.storage=new Tye(this.storageUrl.href,this.headers,this.fetch,n==null?void 0:n.storage),l.accessToken||this._listenForAuthEvents()}get functions(){return new kme(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(t){return this.rest.from(t)}schema(t){return this.rest.schema(t)}rpc(t,e={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(t,e,n)}channel(t,e={config:{}}){return this.realtime.channel(t,e)}getChannels(){return this.realtime.getChannels()}removeChannel(t){return this.realtime.removeChannel(t)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var t=this,e,n;if(t.accessToken)return await t.accessToken();const{data:r}=await t.auth.getSession();return(e=(n=r.session)===null||n===void 0?void 0:n.access_token)!==null&&e!==void 0?e:t.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:e,detectSessionInUrl:n,storage:r,userStorage:i,storageKey:s,flowType:a,lock:o,debug:l,throwOnError:u},f,p){const y={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new Yge({url:this.authUrl.href,headers:Wr(Wr({},y),f),storageKey:s,autoRefreshToken:t,persistSession:e,detectSessionInUrl:n,storage:r,userStorage:i,flowType:a,lock:o,debug:l,throwOnError:u,fetch:p,hasCustomAuthorizationHeader:Object.keys(this.headers).some(g=>g.toLowerCase()==="authorization")})}_initRealtimeClient(t){return new Xme(this.realtimeUrl.href,Wr(Wr({},t),{},{params:Wr(Wr({},{apikey:this.supabaseKey}),t==null?void 0:t.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((t,e)=>{this._handleTokenChanged(t,"CLIENT",e==null?void 0:e.access_token)})}_handleTokenChanged(t,e,n){(t==="TOKEN_REFRESHED"||t==="SIGNED_IN")&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):t==="SIGNED_OUT"&&(this.realtime.setAuth(),e=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const Xge=(t,e,n)=>new Jge(t,e,n);function Qge(){if(typeof window<"u")return!1;const t=globalThis.process;if(!t)return!1;const e=t.version;if(e==null)return!1;const n=e.match(/^v(\d+)\./);return n?parseInt(n[1],10)<=18:!1}Qge()&&console.warn("â ï¸ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const Omt=(()=>{if(typeof window>"u")return!1;const t=window.location.hash||"",e=window.location.search||"";return t.includes("type=recovery")||e.includes("type=recovery")})(),e3e="https://orxjyttejsgrinpotlvz.supabase.co",t3e="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im9yeGp5dHRlanNncmlucG90bHZ6Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjQ0NzA4MTUsImV4cCI6MjA4MDA0NjgxNX0.urGgcGXqhXTJCifPBhP5VcoqWtTiHHMS5McrzUJhWUc",Mn=Xge(e3e,t3e),n3e=60;function r3e(t){return t.expires_at?t.expires_at-Math.floor(Date.now()/1e3)<=n3e:!1}async function lI(){const{data:t}=await Mn.auth.getSession();return t.session??null}async function a7(){const t=await lI();if(t!=null&&t.access_token&&!r3e(t))return{ok:!0,session:t,accessToken:t.access_token};const{data:e,error:n}=await Mn.auth.refreshSession();if(n)return{ok:!1,reason:"refresh_failed"};const r=e.session;return r!=null&&r.access_token?{ok:!0,session:r,accessToken:r.access_token}:{ok:!1,reason:"no_session"}}async function gf(){const t=await a7();return t.ok?t.accessToken:null}async function u3(t,e={}){var l;const n=await a7();if(!n.ok)return new Response(JSON.stringify({error:"auth_expired"}),{status:401,headers:{"Content-Type":"application/json"}});const r=u=>{const f=new Headers(e.headers);return f.set("Authorization",`Bearer ${u}`),{...e,headers:f}},i=await fetch(t,r(n.accessToken));if(i.status!==401)return i;const{data:s,error:a}=await Mn.auth.refreshSession(),o=(l=s.session)==null?void 0:l.access_token;return a||!o?i:fetch(t,r(o))}const Pmt=Object.freeze(Object.defineProperty({__proto__:null,authedFetch:u3,getCurrentSession:lI,getValidAccessToken:gf,getValidSession:a7},Symbol.toStringTag,{value:"Module"})),qJ=N.createContext({user:null,session:null,loading:!0,signOut:async()=>{}}),i3e=3e3,s3e=3e4,a3e=({children:t})=>{const[e,n]=N.useState(null),[r,i]=N.useState(null),[s,a]=N.useState(!0),o=N.useRef(0),l=f=>
446{i(f),n((f==null?void 0:f.user)??null)};N.useEffect(()=>{let f=!1;const{data:{subscription:p}}=Mn.auth.onAuthStateChange((g,b)=>{f=!0,l(b),a(!1)}),y=setTimeout(()=>{f||(console.warn("[AuthContext] onAuthStateChange did not fire within timeout; assuming no session."),a(!1))},i3e);return()=>{clearTimeout(y),p.unsubscribe()}},[]),N.useEffect(()=>{const f=async()=>{if(typeof document<"u"&&document.visibilityState!=="visible")return;const g=Date.now();if(g-o.current<s3e)return;o.current=g;const b=await lI();if(!b){l(null);return}const v=await a7();v.ok?l(v.session):l(b)},p=()=>{document.visibilityState==="visible"&&f()},y=()=>{f()};return document.addEventListener("visibilitychange",p),window.addEventListener("pageshow",y),()=>{document.removeEventListener("visibilitychange",p),window.removeEventListener("pageshow",y)}},[]);const u=async()=>{try{const{error:f}=await Mn.auth.signOut();if(f)throw f;l(null)}catch(f){console.error("[AuthContext] signOut failed:",f)}};return h.jsx(qJ.Provider,{value:{user:e,session:r,loading:s,signOut:u},children:t})},fc=()=>{const t=N.useContext(qJ);if(t===void 0)throw new Error("useAuth must be used within an AuthProvider");return t};function Vf(){const t=Zi(),{i18n:e}=sr(),n=t.pathname.split("/").filter(Boolean);if(n.length>0&&Va.includes(n[0]))return`/${n[0]}`;const r=e.language;return Va.includes(r)?`/${r}`:""}const ZJ="tritonix_cookie_consent",o3e=1,uk="tritonix:open-cookie-preferences",rg="tritonix:consent-updated";function l3e(){try{return typeof navigator<"u"&&navigator.globalPrivacyControl===!0}catch{return!1}}function c3e(){try{const t=localStorage.getItem(ZJ);
446if(!t)return null;const e=JSON.parse(t);return{analytics:!!e.analytics,ads:!!e.ads}}catch{return null}}function ec(){const t=c3e();return t||{analytics:!0,ads:!l3e()}}function KJ(t){var r,i;const e=t.analytics?"granted":"denied",n=t.ads?"granted":"denied";try{(r=window.gtag)==null||r.call(window,"consent","update",{analytics_storage:e,ad_storage:n,ad_user_data:n,ad_personalization:n})}catch{}try{(i=window.clarity)==null||i.call(window,"consent",t.analytics)}catch{}}function kC(t){try{localStorage.setItem(ZJ,JSON.stringify({v:o3e,analytics:t.analytics,ads:t.ads,decidedAt:Date.now()}))}catch{}KJ(t);try{window.dispatchEvent(new CustomEvent(rg,{detail:t}))}catch{}}function u3e(){try{window.dispatchEvent(new CustomEvent(uk))}catch{}}const d3e=/^G-[A-Z0-9]+$/i,h3e=/^AW-\d+$/,f3e=/^AW-\d+\/[A-Za-z0-9_-]+$/,mB="tritonix-google-tag",Ew="AW-18310327577".trim()||"AW-18310327577",p3e="fjCeCMDwk9AcEJnahZtE".trim()||"fjCeCMDwk9AcEJnahZtE",m3e="Br0zCOG0_c8cEJnahZtE",y3e="QUrVCIqRl9AcEJnahZtE",g3e="jL2zCJ2IxtMcEJnahZtE",b3e="4rpmCNu84dEcEJnahZtE";let bf=!1,af=null,yB=null,gB=0,dk=0,r1=null,i1=null;const w3e=new Set(["sign_up","subscribe","purchase"]),cI=500;function v3e(){return typeof navigator<"u"&&typeof navigator.sendBeacon=="function"}function GJ(t){return v3e()?{...t,transport_type:"beacon"}:t}function YJ(t=cI){let e=!1,n,r=()=>{};const i=new Promise(a=>{r=a}),s=()=>{e||(e=!0,n!==void 0&&clearTimeout(n),r())};return n=setTimeout(s,t),{promise:i,onHit:s,event_timeout:t}}function JJ(t){const e=t.filter(n=>typeof n=="function");if(e.length!==0)return()=>{for(const n of e)n()}}function O6(){if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search).get("debug_mode");return t==="1"||t==="true"}function qr(t,e){O6()&&(e===void 0?console.warn(`[analytics] ${t}`):console.warn(`[analytics] ${t}`,e))}function _3e(t){if(typeof window>"u"||typeof document>"u")return;if(window.dataLayer=window.dataLayer||[],window.gtag=window.gtag||((...n)=>{var r;(r=window.dataLayer)==null||r.push(n)}),!document.getElementById(mB)){const n=document.createElement("script");n.id=mB,n.async=!0,n.src=`https://www.googletagmanager.com/gtag/js?id=${encodeURIComponent(t)}`,n.addEventListener("error",()=>{qr("Google Tag script failed to load; check content blockers and network policy")}),document.head.appendChild(n)}}async function x3e(t){var e;if(!((e=globalThis.crypto)!=null&&e.subtle)||typeof TextEncoder>"u")return qr("Web Crypto is unavailable; enhanced conversion email was not prepared"),null;try{const n=new TextEncoder().encode(t),r=await globalThis.crypto.subtle.digest("SHA-256",n);return Array.from(new Uint8Array(r),i=>i.toString(16).padStart(2,"0")).join("")}catch(n){return qr("Failed to hash enhanced conversion email",n),null}}function C3e(t){var e;af&&((e=window.gtag)==null||e.call(window,"config",af,{send_page_view:!1,debug_mode:O6(),user_id:t}))}async function d3(t,e){var l;const n=++gB,r=ec(),i=typeof t=="string"&&t.trim()?t.trim():null,s=typeof e=="string"?e.trim().toLowerCase():"";if(r1=r.analytics?i:null,i1=null,dk+=1,(l=window.gtag)==null||l.call(window,"set","user_data",null),bf&&C3e(r1),!bf||!r.ads||!s)return;const a=await x3e(s);!a||n!==gB||!ec().ads||(i1=a)}const bB=t=>{var n,r,i;const e=t.trim();if(!d3e.test(e))return qr(`Invalid GA4 measurement ID: "${e||"(empty)"}"`),!1;if(bf)return af!==e&&qr(`GA4 is already initialized with ${af}; ignored ${e}`),!0;try{return _3e(e),(n=window.gtag)==null||n.call(window,"js",new Date),(r=window.gtag)==null||r.call(window,"config",e,{send_page_view:!1,debug_mode:O6()}),h3e.test(Ew)?(i=window.gtag)==null||i.call(window,"config",Ew,{send_page_view:!1}):qr(`Invalid Google Ads ID: "${Ew||"(empty)"}"`),bf=!0,af=e,!0}catch(s){return qr("GA4 initialization failed",s),!1}},wB=(t=!1)=>{var r;const e=ec();if(!e.analytics&&!e.ads)return qr("Skipped page_view because analytics and Ads consent are denied"),!1;if(!bf||typeof window>"u")return qr("Skipped page_view because Google Tag is not initialized"),!1;const n=window.location.pathname+window.location.search;if(!t&&yB===n)return!1;try{let i=!1;return e.analytics?((r=window.gtag)==null||r.call(window,"event","page_view",{page_path:n,...r1?{user_id:r1}:{},send_to:af,debug_mode:O6()}),i=!0):qr("Skipped GA4 page_view because analytics consent is denied"),e.ads?
446i=P6(b3e,"page_view")||i:qr("Skipped Google Ads page_view because Ads consent is denied"),yB=n,i}catch(i){return qr("page_view failed",i),!1}};function XJ(t,e,n){var r;if(!ec().analytics)return qr(`Skipped ${t} because analytics consent is denied`),n!=null&&n.waitForHit?Promise.resolve(!1):!1;if(!bf)return qr(`Skipped ${t} because GA4 is not initialized`),n!=null&&n.waitForHit?Promise.resolve(!1):!1;try{const i=w3e.has(t)&&i1,s=n!=null&&n.waitForHit?YJ():null,a=JJ([s==null?void 0:s.onHit,n==null?void 0:n.event_callback]);return(r=window.gtag)==null||r.call(window,"event",t,GJ({...e??{},...r1?{user_id:r1}:{},...i?{user_data:{sha256_email_address:i1}}:{},send_to:af,debug_mode:O6(),...a?{event_callback:a,event_timeout:(s==null?void 0:s.event_timeout)??cI}:{}})),s?s.promise.then(()=>!0):!0}catch(i){return qr(`${t} failed`,i),n!=null&&n.waitForHit?Promise.resolve(!1):!1}}function P6(t,e,n={},r){var s,a;if(!ec().ads)return qr(`Skipped Google Ads ${e} because Ads consent is denied`),r!=null&&r.waitForHit?Promise.resolve(!1):!1;if(!bf||typeof window>"u")return qr(`Skipped Google Ads ${e} because Google Tag is not initialized`),r!=null&&r.waitForHit?Promise.resolve(!1):!1;const i=`${Ew}/${t}`;if(!f3e.test(i))return qr(`Skipped Google Ads ${e} because its destination is invalid`),r!=null&&r.waitForHit?Promise.resolve(!1):!1;try{let o;if(i1){const f=++dk;(s=window.gtag)==null||s.call(window,"set","user_data",{sha256_email_address:i1}),o=()=>{var p;f===dk&&((p=window.gtag)==null||p.call(window,"set","user_data",null))}}const l=r!=null&&r.waitForHit?YJ():null,u=JJ([l==null?void 0:l.onHit,r==null?void 0:r.event_callback,o]);return(a=window.gtag)==null||a.call(window,"event","conversion",GJ({send_to:i,...n,...u?{event_callback:u,event_timeout:(l==null?void 0:l.event_timeout)??(o?2e3:cI)}:{}})),o&&window.setTimeout(o,2500),l?l.promise.then(()=>!0):!0}catch(o){return qr(`Google Ads ${e} conversion failed`,o),r!=null&&r.waitForHit?Promise.resolve(!1):!1}}const E3e=({value:t,currency:e,transactionId:n})=>{const r=e.trim().toUpperCase();return!Number.isFinite(t)||t<0||!/^[A-Z]{3}$/.test(r)||!n.trim()?(qr("Skipped Google Ads purchase because conversion parameters are invalid"),!1):P6(p3e,"purchase",{value:t,currency:r,transaction_id:n.trim()})},S3e=t=>P6(m3e,"sign-up",{},t),A3e=t=>{const e=t.trim();return e?P6(g3e,"subscribe",{value:1,currency:"USD",transaction_id:e}):(qr("Skipped Google Ads subscribe because transaction ID is missing"),!1)},QJ=({value:t,currency:e})=>{const n=e.trim().toUpperCase();return!Number.isFinite(t)||t<0||!/^[A-Z]{3}$/.test(n)?(qr("Skipped Google Ads begin checkout because conversion parameters are invalid"),!1):P6(y3e,"begin checkout",{value:t,currency:n})},Ie={SIGN_UP:"sign_up",LOGIN:"login",CTA_CLICK:"cta_click",NAV_CLICK:"nav_click",ONBOARDING_START:"onboarding_start",ONBOARDING_STEP_VIEW:"onboarding_step_view",ONBOARDING_STEP_COMPLETE:"onboarding_step_complete",ONBOARDING_COMPLETE:"onboarding_complete",ONBOARDING_DISMISSED:"onboarding_dismissed",ONBOARDING_SKIPPED:"onboarding_skipped",ONBOARDING_OPTION_SELECT:"onboarding_option_select",ONBOARDING_SKILL_IMPORT_RESULT:"onboarding_skill_import_result",FEATURE_SPOTLIGHT_VIEW:"feature_spotlight_view",FEATURE_SPOTLIGHT_DISMISS:"feature_spotlight_dismiss",FEATURE_SPOTLIGHT_CTA_CLICK:"feature_spotlight_cta_click",CHECKOUT_SUCCESS_VIEW:"checkout_success_view",CHECKOUT_SUCCESS_DISMISS:"checkout_success_dismiss",CHECKOUT_SUCCESS_CTA_CLICK:"checkout_success_cta_click",VIEW_ITEM_LIST:"view_item_list",SELECT_ITEM:"select_item",BEGIN_CHECKOUT:"begin_checkout",CHECKOUT_CANCELLED:"checkout_cancelled",CHECKOUT_FAILED:"checkout_failed",SUBSCRIBE:"subscribe",PURCHASE:"purchase",PAYWALL_VIEWED:"paywall_viewed",SUBSCRIPTION_PORTAL_OPENED:"subscription_portal_opened",UPGRADE_INTENT:"upgrade_intent",DOWNGRADE_INTENT:"downgrade_intent",CONNECTOR_CONNECT_START:"connector_connect_start",CONNECTOR_CONNECT_SUCCESS:"connector_connect_success",CONNECTOR_CONNECT_FAIL:"connector_connect_fail",PAGE_VIEW:"page_view",STUDIO_PROMPT_SUBMIT:"studio_prompt_submit",WATCHLIST_ITEM_ADDED:"watchlist_item_added",WATCHLIST_ITEM_REMOVED:"watchlist_item_removed",STUDIO_PANEL_OPENED:"studio_panel_opened",SCREENER_RUN:"screener_run",CALENDAR_QUERY:"calendar_query",STRATEGY_VIEWED:"strategy_viewed",STRATEGY_COPY_STARTED:"strategy_copy_started",STRATEGY_COPY_COMPLETED:"strategy_copy_completed",FEATURE_INTERACTION:"feature_interaction",LEARNING_CENTER_OPEN:"learning_center_open",LEARNING_CENTER_CLOSE:"learning_center_close",LEARNING_CENTER_LESSON_START:"learning_center_lesson_start",LEARNING_CENTER_LESSON_COMPLETE:"learning_center_lesson_complete",LEARNING_CENTER_LESSON_EXIT:"learning_center_lesson_exit",LEARNING_CENTER_REWARD_CLAIMED:"learning_center_reward_claimed"},k3e=1,T3e=new Set([Ie.CTA_CLICK,Ie.NAV_CLICK,Ie.ONBOARDING_START,Ie.ONBOARDING_STEP_VIEW,Ie.ONBOARDING_STEP_COMPLETE,Ie.ONBOARDING_COMPLETE,Ie.ONBOARDING_DISMISSED,Ie.ONBOARDING_SKIPPED,Ie.ONBOARDING_OPTION_SELECT,Ie.ONBOARDING_SKILL_IMPORT_RESULT,Ie.FEATURE_SPOTLIGHT_VIEW,Ie.FEATURE_SPOTLIGHT_DISMISS,Ie.FEATURE_SPOTLIGHT_CTA_CLICK,Ie.CHECKOUT_SUCCESS_VIEW,Ie.CHECKOUT_SUCCESS_DISMISS,Ie.CHECKOUT_SUCCESS_CTA_CLICK,Ie.VIEW_ITEM_LIST,Ie.
446SELECT_ITEM,Ie.BEGIN_CHECKOUT,Ie.CHECKOUT_CANCELLED,Ie.CHECKOUT_FAILED,Ie.SUBSCRIBE,Ie.PURCHASE,Ie.PAYWALL_VIEWED,Ie.SUBSCRIPTION_PORTAL_OPENED,Ie.UPGRADE_INTENT,Ie.DOWNGRADE_INTENT,Ie.CONNECTOR_CONNECT_START,Ie.CONNECTOR_CONNECT_FAIL,Ie.PAGE_VIEW,Ie.STUDIO_PROMPT_SUBMIT,Ie.WATCHLIST_ITEM_ADDED,Ie.WATCHLIST_ITEM_REMOVED,Ie.STUDIO_PANEL_OPENED,Ie.SCREENER_RUN,Ie.CALENDAR_QUERY,Ie.STRATEGY_VIEWED,Ie.STRATEGY_COPY_STARTED,Ie.STRATEGY_COPY_COMPLETED,Ie.FEATURE_INTERACTION,Ie.LEARNING_CENTER_OPEN,Ie.LEARNING_CENTER_CLOSE,Ie.LEARNING_CENTER_LESSON_START,Ie.LEARNING_CENTER_LESSON_COMPLETE,Ie.LEARNING_CENTER_LESSON_EXIT,Ie.LEARNING_CENTER_REWARD_CLAIMED]),L3e=new Set([Ie.CONNECTOR_CONNECT_START,Ie.CONNECTOR_CONNECT_FAIL,Ie.PAGE_VIEW,Ie.STUDIO_PROMPT_SUBMIT,Ie.WATCHLIST_ITEM_ADDED,Ie.WATCHLIST_ITEM_REMOVED,Ie.STUDIO_PANEL_OPENED,Ie.SCREENER_RUN,Ie.CALENDAR_QUERY,Ie.STRATEGY_VIEWED,Ie.STRATEGY_COPY_STARTED,Ie.STRATEGY_COPY_COMPLETED,Ie.FEATURE_INTERACTION,Ie.LEARNING_CENTER_OPEN,Ie.LEARNING_CENTER_CLOSE,Ie.LEARNING_CENTER_LESSON_START,Ie.LEARNING_CENTER_LESSON_COMPLETE,Ie.LEARNING_CENTER_LESSON_EXIT,Ie.LEARNING_CENTER_REWARD_CLAIMED]),vB="tx_anon_id";function $3e(){var t,e;try{let n=localStorage.getItem(vB);return n||(n=((e=(t=globalThis.crypto)==null?void 0:t.randomUUID)==null?void 0:e.call(t))??`anon-${Date.now()}-${Math.random().toString(16).slice(2)}`,localStorage.setItem(vB,n)),n}catch{return"anon-unknown"}}const _B="tx_product_event_session",I3e=1800*1e3;function hk(){var n,r;if((n=globalThis.crypto)!=null&&n.randomUUID)return globalThis.crypto.randomUUID();const t=new Uint8Array(16);if((r=globalThis.crypto)!=null&&r.getRandomValues)globalThis.crypto.getRandomValues(t);else for(let i=0;i<t.length;i+=1)t[i]=Math.floor(Math.random()*256);t[6]=t[6]&15|64,t[8]=t[8]&63|128;const e=Array.from(t,i=>i.toString(16).padStart(2,"0")).join("");return`${e.slice(0,8)}-${e.slice(8,12)}-${e.slice(12,16)}-${e.slice(16,20)}-${e.slice(20)}`}function N3e(t,e,n){return{id:typeof(t==null?void 0:t.id)=="string"&&typeof t.activeAt=="number"&&e>=t.activeAt&&e-t.activeAt<=I3e?t.id:n(),activeAt:e}}function O3e(){const t=Date.now();try{const e=JSON.parse(localStorage.getItem(_B)||"{}"),n=N3e(e,t,hk);return localStorage.setItem(_B,JSON.stringify(n)),n.id}catch{return hk()}}function uI(t){return((t||"/").split(/[?#]/,1)[0]||"/").replace(/^\/(?:zh|zh-TW|ja|ko|es|fr|de)(?=\/|$)/i,"")||"/"}async function eX(t,e){try{if(!ec().analytics)return;const n=await gf().catch(()=>null);if(L3e.has(t)&&!n)return;const r={"Content-Type":"application/json"};n&&(r.Authorization=`Bearer ${n}`),(await fetch("/api/product-event",{method:"POST",headers:r,keepalive:!0,body:JSON.stringify({eventName:t,eventId:hk(),sessionId:O3e(),schemaVersion:k3e,anonymousId:$3e(),path:typeof window<"u"?uI(window.location.pathname):void 0,params:e})})).ok}catch{}}function It(t,e){const n=e,r=XJ(t,n);return T3e.has(t)&&eX(t,n),r}const P3e="tx_ads_signup_";async function dI(t,e){const n=Promise.resolve(XJ(Ie.SIGN_UP,{method:t},{waitForHit:!0})),r=e==null?void 0:e.trim();if(!r){await n;return}const i=`${P3e}${r}`;try{if(localStorage.getItem(i)==="1"){await n;return}}catch{}const s=Promise.resolve(S3e({waitForHit:!0})),[,a]=await Promise.all([n,s]);if(a)try{localStorage.setItem(i,"1")}catch{}}function hI(t){It(Ie.LOGIN,{method:t})}function ig(t,e){It(Ie.CTA_CLICK,{location:t,cta:e})}function tX(t,e){It(Ie.NAV_CLICK,{nav_item:t,area:e})}function Hf(t,e){return e?{...t,onboarding_variant:e}:t}function Rmt(t,e){It(Ie.ONBOARDING_START,Hf({investor_profile:null},e))}function jmt(t,e,n,r){It(Ie.ONBOARDING_STEP_VIEW,Hf({step_index:t,step_name:e,investor_profile:null},r))}function Mmt(t,e,n,r){It(Ie.ONBOARDING_STEP_COMPLETE,Hf({step_index:t,step_name:e,investor_profile:n??null},r))}function Dmt(t,e,n){It(Ie.ONBOARDING_COMPLETE,Hf({investor_profile:t??null,subscribed_in_flow:e},n))}function Umt(t,e,n,r,i){It(Ie.ONBOARDING_DISMISSED,Hf({step_index:t,step_name:e,investor_profile:null,reason:r},i))}function Bmt(t,e,n,r){It(Ie.ONBOARDING_SKIPPED,Hf({step_index:t,step_name:e,investor_profile:null,reason:"continue_free"},r))}function Fmt(t,e){It(Ie.ONBOARDING_OPTION_SELECT,Hf({object_type:"trade_method",object_id:t},e))}function zmt(t){It(Ie.FEATURE_SPOTLIGHT_VIEW,{spotlight_id:t})}function Vmt(t,e){It(Ie.FEATURE_SPOTLIGHT_DISMISS,{spotlight_id:t,reason:e})}function Hmt(t,e){It(Ie.FEATURE_SPOTLIGHT_CTA_CLICK,{spotlight_id:t,cta_href:e})}function Wmt(t){It(Ie.CHECKOUT_SUCCESS_VIEW,{kind:t})}function qmt(t,e="explore"){It(Ie.CHECKOUT_SUCCESS_DISMISS,{kind:t,reason:e})}function Zmt(t,e){It(Ie.CHECKOUT_SUCCESS_CTA_CLICK,{kind:t,cta:e})}function W1({plan:t,billingCycle:e,value:n,currency:r,trialMode:i,trialDays:s,entry_point:a,source_surface:o,onboarding_variant:l}){return{purchase_type:"subscription",plan:t,billing_cycle:e,trial_mode:i,trial_days:s,entry_point:a,source_surface:o,onboarding_variant:l,value:n,currency:r??"USD",items:[{item_id:`${t}_${e}`,item_name:t,item_category:"subscription",price:n,quantity:1}]}}function R6({packageId:t,credits:e,value:n,currency:r,entry_point:i,source_surface:s}){return{purchase_type:"topup",package_id:t,credits:e,entry_point:i,source_surface:s,value:n,currency:r??"USD",items:[{item_id:t,item_name:`${e.toLocaleStr
446ing()} Credits`,item_category:"topup",price:n,quantity:1}]}}function Kmt(t,e,n={}){It(Ie.VIEW_ITEM_LIST,{item_list_name:t,items:e,...n})}function R3e(t){It(Ie.SELECT_ITEM,W1(t))}function j3e(t){It(Ie.SELECT_ITEM,R6(t))}function M3e(t){const e=W1(t);It(Ie.BEGIN_CHECKOUT,e),QJ({value:e.value??Number.NaN,currency:e.currency})}const D3e="tx_ga4_subscribe_",U3e="tx_ads_subscribe_";function Gmt(t){const e=t.transactionId.trim();if(!e)return!1;const n=`${D3e}${e}`,r=`${U3e}${e}`;let i=!1,s=!1;try{i=localStorage.getItem(n)==="1",s=localStorage.getItem(r)==="1"}catch{}const a=i?!1:It(Ie.SUBSCRIBE,{...W1({...t,value:1,currency:"USD"}),transaction_id:e,trial_days:7}),o=s?!1:A3e(e);if(a||o)try{a&&localStorage.setItem(n,"1"),o&&localStorage.setItem(r,"1")}catch{}return a||o}function B3e(t){const e=R6(t);It(Ie.BEGIN_CHECKOUT,e),QJ({value:e.value,currency:e.currency})}function Ymt(t){It(Ie.CHECKOUT_CANCELLED,W1(t))}function F3e(t){It(Ie.CHECKOUT_CANCELLED,R6(t))}function mh(t,e){It(Ie.CHECKOUT_FAILED,{...W1(t),failure_stage:e})}function TC(t,e){It(Ie.CHECKOUT_FAILED,{...R6(t),failure_stage:e})}function z3e(t){It(Ie.PAYWALL_VIEWED,{required_plan:t.requiredPlan,object_type:t.objectType,object_id:t.objectId?q1(t.objectId):void 0,entry_point:t.entry_point,source_surface:t.source_surface})}function V3e(t){It(Ie.SUBSCRIPTION_PORTAL_OPENED,{plan:t.plan,billing_cycle:t.billingCycle,trial_mode:t.trialMode,entry_point:t.entry_point,source_surface:t.source_surface,onboarding_variant:t.onboarding_variant})}function H3e(t){It(t.direction==="upgrade"?Ie.UPGRADE_INTENT:Ie.DOWNGRADE_INTENT,{current_plan:t.currentPlan,target_plan:t.targetPlan,billing_cycle:t.billingCycle,trial_mode:t.trialMode,entry_point:t.entry_point,source_surface:t.source_surface,onboarding_variant:t.onboarding_variant})}const W3e="tx_ga4_purchase_",q3e="tx_ads_purchase_";function nX(t,e){const n=`${W3e}${e}`,r=`${q3e}${e}`;let i=!1,s=!1;try{i=localStorage.getItem(n)==="1",s=localStorage.getItem(r)==="1"}catch{}const a=i?!1:It(Ie.PURCHASE,t),o=typeof t.value=="number"?t.value:Number.NaN,l=typeof t.currency=="string"?t.currency:"",u=s?!1:E3e({value:o,currency:l,transactionId:e});if(a||u)try{a&&localStorage.setItem(n,"1"),u&&localStorage.setItem(r,"1")}catch{}return a||u}function Jmt(t){const e=W1(t);return nX({...e,transaction_id:t.transactionId,value:t.value,currency:t.currency},t.transactionId)}function Xmt(t){const e=R6(t);return nX({...e,transaction_id:t.transactionId,value:t.value,currency:t.currency},t.transactionId)}function Qmt(t,e){It(Ie.CONNECTOR_CONNECT_START,{connector:t,category:e??null})}function eyt(t,e){It(Ie.CONNECTOR_CONNECT_SUCCESS,{connector:t,category:e??null})}function Z3e(t){const e=(t==null?void 0:t.toLowerCase())??"";return e.includes("timeout")||e.includes("timed out")?"timeout":e.includes("denied")||e.includes("cancel")?"cancelled":e.includes("network")||e.includes("fetch")?"network_error":e.includes("unauthorized")||e.includes("forbidden")||e.includes("permission")?"authorization_failed":e.includes("token_exchange")||e.includes("invalid_state")||e.includes("auth")||e.includes("credential")||e.includes("api key")?"authentication_failed":e.includes("config")||e.includes("missing")?"configuration_error":"unknown"}function tyt(t,e,n){It(Ie.CONNECTOR_CONNECT_FAIL,{connector:t,category:e??null,reason:Z3e(n)})}function K3e(t){eX(Ie.PAGE_VIEW,{path:uI(t)})}function nyt(){It(Ie.STUDIO_PROMPT_SUBMIT,{})}function ryt(t,e="control"){It(Ie.STUDIO_PANEL_OPENED,{panel:t,source:e})}function iyt(t){It(Ie.SCREENER_RUN,{outcome:t})}function syt(t){It(Ie.CALENDAR_QUERY,{outcome:t})}function q1(t){return String(t).trim().toUpperCase().slice(0,128)}function G3e(t){const e=String(t).trim().toUpperCase();return e.length>0&&e.length<=128&&/^[A-Z0-9][A-Z0-9_.:-]*$/.test(e)?e:void 0}function Y3e(t){const e=t.objectId===void 0?void 0:G3e(t.objectId);It(Ie.FEATURE_INTERACTION,{feature_name:t.featureName,action:t.action,source_surface:t.sourceSurface,object_type:t.objectType,object_id:e,outcome:t.outcome})}function ayt(t,e,n){It(Ie.WATCHLIST_ITEM_ADDED,{asset_type:t,asset_id:q1(e),source:n})}function oyt(t,e,n){It(Ie.WATCHLIST_ITEM_REMOVED,{asset_type:t,asset_id:q1(e),source:n})}function lyt(){It(Ie.LEARNING_CENTER_OPEN,{})}function cyt(){It(Ie.LEARNING_CENTER_CLOSE,{})}function uyt(t,e){It(Ie.LEARNING_CENTER_LESSON_START,{module_id:t,lesson_id:e})}function dyt(t,e){It(Ie.LEARNING_CENTER_LESSON_COMPLETE,{module_id:t,lesson_id:e})}function hyt(t,e){It(Ie.LEARNING_CENTER_LESSON_EXIT,{module_id:t,lesson_id:e})}function fyt(t){It(Ie.LEARNING_CENTER_REWARD_CLAIMED,{credits:t})}function pyt(t,e,n){It(Ie.STRATEGY_VIEWED,{strategy_type:t,strategy_id:q1(e),section:n})}function myt(t,e,n){It(Ie.STRATEGY_COPY_STARTED,{strategy_type:t,strategy_id:q1(e),section:n})}function yyt(t,e,n,r){It(Ie.STRATEGY_COPY_COMPLETED,{strategy_type:t,strategy_id:q1(e),section:n,outcome:r})}const xB="https://tritonix.ai",J3e=["/blog","/news","/ideas","/whales-institution","/stock","/dr"],X3e=["/blog","/stock","/dr"];function rX(t){if(!t)return"/";const e=t.startsWith("/")?t:`/${t}`;return e==="/"?"/":e.replace(/\/+$/,"")}function Q3e(t){const e=rX(t);return J3e.some(n=>e===n||e.startsWith(`${n}/`))}function iX(t){const e=rX(t);return X3e.some(n=>e===n||e.startsWith(`${n}/`))}function e6e(t,e){const n=e.trim();return iX(t)&&n!=="en"&&!n.startsWith("en-")}function fk(t,e){const n=e.startsWith("/")?e:`/${e}`;return t==="en"?`${xB}${n}`:`${xB}/${t}${n}`}function t6e(t,e){return fk(Q3e(t)?"en":e,t)}const $u="https://tritonix.ai",Ao=`${$u}/#organization`,j6=`${$u}/#website`,CB="seo-jsonld",n6e=["https://x.com/tritonix_ai","https://www.linkedin.com/company/tr
446itonix-ai","https://www.youtube.com/@AITritonix"],r6e="2026-08-19T00:00:00.000Z";function fI(){return{"@type":"Organization","@id":Ao,name:"Tritonix",alternateName:["Tritonix.ai","Tritonix AI"],url:$u,logo:{"@type":"ImageObject",url:`${$u}/logo.png`},sameAs:n6e}}function pI(){return{"@type":"WebSite","@id":j6,url:$u,name:"Tritonix",alternateName:"Tritonix.ai",publisher:{"@id":Ao},inLanguage:"en"}}function sX(t){return{"@type":"BreadcrumbList",itemListElement:t.map((e,n)=>({"@type":"ListItem",position:n+1,name:e.name,item:e.path.startsWith("http")?e.path:`${$u}${e.path}`}))}}function gyt(t){return Array.isArray(t)?t.flatMap(e=>{if(!e||typeof e!="object")return[];const n=String(e.question||"").trim(),r=String(e.answer||"").trim();return n&&r?[{question:n,answer:r}]:[]}):[]}function i6e(t){if(t.length)return{"@type":"FAQPage",mainEntity:t.map(e=>({"@type":"Question",name:e.question,acceptedAnswer:{"@type":"Answer",text:e.answer}}))}}function mI(t){return{"@context":"https://schema.org","@graph":t.filter(Boolean)}}function s6e(t){const e=yI(t.canonical);return{"@type":"WebPage","@id":`${e}#webpage`,url:e,name:t.name,description:t.description||void 0,dateModified:t.dateModified,isPartOf:{"@id":j6},publisher:{"@id":Ao},about:{"@id":Ao}}}function yI(t){return t.startsWith("http")?t:`${$u}${t.startsWith("/")?t:`/${t}`}`}function byt(t){var o;const e=yI(t.canonical),n=`${e}#author`,r=`${e}#article`,i=e.replace($u,"")||"/",s=[fI(),pI(),{"@type":["Article","BlogPosting"],"@id":r,headline:t.headline,description:t.description,image:t.image,datePublished:t.datePublished,dateModified:t.dateModified,url:e,keywords:(o=t.keywords)!=null&&o.length?t.keywords.join(", "):void 0,inLanguage:"en",isAccessibleForFree:!0,author:t.author?{"@id":n}:{"@id":Ao},publisher:{"@id":Ao},mainEntityOfPage:{"@type":"WebPage","@id":e,url:e,isPartOf:{"@id":j6}}},sX([{name:"Home",path:"/"},{name:"Blog",path:"/blog"},{name:t.headline,path:i}])];t.author&&s.push({...t.author,"@id":n,worksFor:{"@id":Ao}});const a=i6e(t.faqs||[]);return a&&s.push(a),mI(s)}function wyt(t){var o;const e=yI(t.canonical),n=(t.authorName||"").trim(),r=`${e}#author`,i=`${e}#article`,s=e.replace($u,"")||"/",a=[fI(),pI(),{"@type":"Article","@id":i,headline:t.headline,description:t.description,image:t.image,datePublished:t.datePublished,dateModified:t.dateModified,url:e,keywords:(o=t.keywords)!=null&&o.length?t.keywords.join(", "):void 0,about:t.about||void 0,inLanguage:"en",isAccessibleForFree:!0,author:n?{"@id":r}:{"@id":Ao},publisher:{"@id":Ao},mainEntityOfPage:{"@type":"WebPage","@id":e,url:e,isPartOf:{"@id":j6}}},sX([{name:"Home",path:"/"},{name:"Ideas",path:"/ideas"},{name:t.headline,path:s}])];return n&&a.push({"@type":"Person","@id":r,name:n,worksFor:{"@id":Ao}}),mI(a)}function Pa(t){if(t.length<=1)return t[0]||null;const e=t.filter(r=>r.hasAttribute("data-rh")),n=e[e.length-1]||t[0];return t.forEach(r=>{r!==n&&r.remove()}),n}function sg(t,e){var r;const n=Array.from(document.head.querySelectorAll(`meta[name="${t}"]`));if(n.length===0){const i=document.createElement("meta");i.setAttribute("name",t),i.setAttribute("content",e),document.head.appendChild(i);return}(r=Pa(n))==null||r.setAttribute("content",e)}function a6e(t,e){var r;const n=Array.from(document.head.querySelectorAll(`meta[property="${t}"]`));if(n.length===0){const i=document.createElement("meta");i.setAttribute("property",t),i.setAttribute("content",e),document.head.appendChild(i);return}(r=Pa(n))==null||r.setAttribute("content",e)}function aX(){typeof document>"u"||(Pa(Array.from(document.head.querySelectorAll('meta[name="description"]'))),Pa(Array.from(document.head.querySelectorAll('meta[name="robots"]'))),Pa(Array.from(document.head.querySelectorAll('meta[name="keywords"]'))),Pa(Array.from(document.head.querySelectorAll('meta[name="author"]'))),Pa(Array.from(document.head.querySelectorAll('link[rel="canonical"]'))),Pa(Array.from(document.head.querySelectorAll('meta[property="og:image"]'))),Pa(Array.from(document.head.querySelectorAll('meta[name="twitter:image"]'))),Pa(Array.from(document.head.querySelectorAll('meta[property="article:author"]'))),Pa(Array.from(document.head.querySelectorAll('meta[property="article:published_time"]'))),Pa(Array.from(document.head.querySelectorAll('meta[property="article:modified_time"]'))))}function o6e(t){const e=document.getElementById(CB);if(!t){e==null||e.remove();return}const n=e instanceof HTMLScriptElement?e:document.createElement("script");n.setAttribute("type","application/ld+json"),n.id=CB,n.textContent=JSON.stringify(t),e||document.head.appendChild(n)}function l6e(t){var n;const e=Array.from(document.head.querySelectorAll('link[rel="canonical"]'));if(e.length===0){const r=document.createElement("link");r.setAttribute("rel","canonical"),r.setAttribute("href",t),document.head.appendChild(r);return}(n=Pa(e))==null||n.setAttribute("href",t)}const T0="https://tritonix.ai";function EB(t){return t?typeof t=="string"?t:t.name:"Tritonix"}function c6e(t){var n;if(!t||typeof t=="string")return{"@type":"Person",name:t||"Tritonix"};const e={"@type":t.type||"Person",name:t.name};return t.url&&(e.url=t.url),t.image&&(e.image=t.image),t.jobTitle&&(e.jobTitle=t.jobTitle),t.description&&(e.description=t.description),(n=t.sameAs)!=null&&n.length&&(e.sameAs=t.sameAs),(t.type||"Person")==="Person"&&(e.works
446For={"@type":"Organization",name:"Tritonix",url:T0}),e}function l4(t){if(t)return t.startsWith("http")?t:`${T0}${t}`}const Ir=({title:t,description:e,canonical:n,keywords:r,image:i,twitterTitle:s,twitterDescription:a,twitterImage:o,type:l="website",author:u,publishedTime:f,modifiedTime:p,faqs:y,breadcrumbs:g,entity:b,newsArticle:v,dataset:_,noindex:C=!1,localeOverride:S,jsonLd:x,disableJsonLd:A=!1})=>{const{i18n:I}=sr(),$=Zi(),O=S||I.language||"en",P=S||gJ($.pathname)||"en",j=n||"/",U=n?t6e(j,O):T0,z=l4(i),D=l4(o)||z,R=s||t,W=a||e||"",T=[];if(l==="article"||l==="news"){const V=v!=null&&v.image?(Array.isArray(v.image)?v.image:[v.image]).map(te=>l4(te)).filter(Boolean):z?[z]:[],F=(v==null?void 0:v.author)??u??"Tritonix",q=c6e(F),G=l4(v==null?void 0:v.mainEntityOfPage)||U,Y=`${G}#author`,X=`${G}#article`;T.push({"@type":l==="news"?"NewsArticle":["Article","BlogPosting"],"@id":X,headline:(v==null?void 0:v.headline)||t,description:e,image:V,datePublished:(v==null?void 0:v.datePublished)||f,dateModified:(v==null?void 0:v.dateModified)||p||f,url:G,inLanguage:O,author:{"@id":Y},publisher:{"@id":Ao},mainEntityOfPage:{"@type":"WebPage","@id":G,url:G,isPartOf:{"@id":j6}}}),T.push({...q,"@id":Y,worksFor:{"@id":Ao}})}y&&y.length>0&&T.push({"@type":"FAQPage",mainEntity:y.map(V=>({"@type":"Question",name:V.question,acceptedAnswer:{"@type":"Answer",text:V.answer}}))}),g&&g.length>0&&T.push({"@type":"BreadcrumbList",itemListElement:g.map((V,F)=>({"@type":"ListItem",position:F+1,name:V.name,item:V.path.startsWith("http")?V.path:`${T0}${V.path}`}))}),l==="profile"&&b&&T.push({"@type":"ProfilePage",mainEntity:{"@type":b.type,name:b.name,description:b.description,identifier:b.identifier,image:b.image?b.image.startsWith("http")?b.image:`${T0}${b.image}`:void 0,parentOrganization:b.parentOrganization?{"@type":"Organization",name:b.parentOrganization.name}:void 0,founder:b.founder?{"@type":"Person",name:b.founder.name}:void 0,sameAs:b.sameAs}}),_&&T.push({"@type":"WebPage","@id":U,name:t,description:e,url:U,dateModified:_.dateModified||p,mainEntity:{"@id":`${U}#dataset`}},{"@type":"Dataset","@id":`${U}#dataset`,name:_.name,description:_.description,identifier:_.identifier,url:U,dateModified:_.dateModified||p,temporalCoverage:_.temporalCoverage,variableMeasured:_.variableMeasured,creator:{"@type":"Organization",name:"Tritonix",url:T0}});const L=C||e6e(j,P)?"noindex, nofollow":"index, follow",M=iX(j)?["en"]:bJ,Z=x??mI([fI(),pI(),s6e({canonical:U,name:t,description:e,dateModified:p||(l==="website"?r6e:void 0)}),...T]),H=JSON.stringify(Z);return N.useEffect(()=>{document.title=t,sg("description",e||""),sg("robots",L),n&&l6e(U),r&&r.length>0&&sg("keywords",r.join(", ")),z&&a6e("og:image",z),D&&sg("twitter:image",D),A||o6e(JSON.parse(H)),aX()},[t,e,n,U,r,L,z,D,A,H]),h.jsxs(tI,{prioritizeSeoTags:!0,children:[h.jsx("html",{lang:O}),h.jsx("title",{children:t}),h.jsx("meta",{name:"description",content:e||""}),h.jsx("meta",{name:"robots",content:L}),n&&h.jsx("link",{rel:"canonical",href:U}),r&&r.length>0&&h.jsx("meta",{name:"keywords",content:r.join(", ")}),h.jsx("meta",{name:"author",content:EB(u)}),(l==="article"||l==="news")&&h.jsx("meta",{property:"article:author",content:EB((v==null?void 0:v.author)??u)}),n&&M.map(V=>h.jsx("link",{rel:"alternate",hrefLang:V,href:fk(V,j)},V)),n&&h.jsx("link",{rel:"alternate",hrefLang:"x-default",href:fk("en",j)}),h.jsx("meta",{property:"og:title",content:t}),h.jsx("meta",{property:"og:description",content:e||""}),h.jsx("meta",{property:"og:type",content:l==="article"||l==="news"?"article":"website"}),h.jsx("meta",{property:"og:site_name",content:"Tritonix"}),h.jsx("meta",{property:"og:url",content:U}),h.jsx("meta",{property:"og:locale",content:O.replace("-","_")}),z&&h.jsx("meta",{property:"og:image",content:z}),f&&h.jsx("meta",{property:"article:published_time",content:f}),p&&h.jsx("meta",{property:"article:modified_time",content:p}),h.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),h.jsx("meta",{name:"twitter:title",content:R}),h.jsx("meta",{name:"twitter:description",content:W}),D&&h.jsx("meta",{name:"twitter:image",content:D})]})};function u6e(){return N.useEffect(()=>{sg("robots","index, follow"),aX()},[]),h.jsx(tI,{prioritizeSeoTags:!0,children:h.jsx("meta",{name:"robots",content:"index, follow"})})}
446const oX=.5,vyt=({label:t,onClick:e,tone:n="light"})=>{const[r,i]=N.useState(!1);N.useEffect(()=>{if(typeof window>"u")return;const o=document.getElementById("main-scroll"),l=o??window,u=()=>{var g;const f=window.innerWidth<768,p=(o==null?void 0:o.clientHeight)??((g=window.visualViewport)==null?void 0:g.height)??window.innerHeight??document.documentElement.clientHeight??0,y=(o==null?void 0:o.scrollTop)??window.scrollY??document.documentElement.scrollTop??0;if(!f){i(!1);return}if(p<=0){i(!1);return}i(y>p*oX)};return u(),l.addEventListener("scroll",u,{passive:!0}),window.addEventListener("resize",u),()=>{l.removeEventListener("scroll",u),window.removeEventListener("resize",u)}},[]);const s=n==="dark"?"border border-white/10 bg-[#05050A]/88 shadow-[0_-10px_60px_rgba(0,0,0,0.45)]":"border border-gray-200/80 bg-white/92 shadow-[0_-10px_40px_rgba(15,23,42,0.10)]",a=n==="dark"?"group inline-flex w-full items-center justify-center gap-2 rounded-full bg-white px-6 py-4 text-base font-bold text-black transition-all hover:bg-cyan-50":"group inline-flex w-full items-center justify-center gap-2 rounded-full bg-gray-950 px-6 py-4 text-base font-bold text-white transition-all hover:bg-gray-800";return h.jsx("div",{className:`fixed inset-x-0 bottom-0 z-40 px-4 pb-[calc(env(safe-area-inset-bottom,0px)+1rem)] pt-4 transition-all duration-300 md:hidden ${r?"pointer-events-auto translate-y-0 opacity-100":"pointer-events-none translate-y-6 opacity-0"}`,children:h.jsx("div",{className:`mx-auto max-w-md rounded-[2rem] p-2 backdrop-blur-2xl ${s}`,children:h.jsxs("button",{type:"button",onClick:e,className:a,children:[t,h.jsx(yf,{className:"h-5 w-5 transition-transform group-hover:translate-x-1"})]})})})},na=({to:t,...e})=>{const n=Vf(),r=typeof t=="string"&&t.startsWith("/")?`${n}${t}`:t;return h.jsx(Q$,{to:r,...e})},io="h-7 w-7 shrink-0",SB=[{name:"Bridgewater",slug:"bridgewater-associates",mark:h.jsxs("svg",{viewBox:"0 0 28 28",className:io,"aria-hidden":"true",children:[h.jsx("circle",{cx:"14",cy:"14",r:"10",fill:"none",stroke:"currentColor",strokeWidth:"1.6"}),h.jsx("path",{d:"M6 8.5 L22 19.5",stroke:"currentColor",strokeWidth:"3.2",strokeLinecap:"round"})]})},{name:"Renaissance",slug:"renaissance-technologies-corp",mark:h.jsx("svg",{viewBox:"0 0 28 28",className:io,"aria-hidden":"true",children:h.jsx("path",{d:"M7 21 L11 7 H15.2 C18.8 7 21 9.1 21 12.4 C21 15.8 18.7 17.8 15.1 17.8 H12.4 L11.2 21 H7 Z M12.2 14.6 H14.6 C16.3 14.6 17.3 13.7 17.3 12.3 C17.3 10.9 16.3 10.1 14.6 10.1 H13.1 Z",fill:"currentColor"})})},{name:"Citadel",slug:"citadel-securities-llc",mark:h.jsx("svg",{viewBox:"0 0 28 28",className:io,"aria-hidden":"true",children:h.jsx("path",{d:"M4 21 H24 V18.6 H4 Z M4 17.4 H12.2 V14.8 H4 Z M15.8 17.4 H24 V14.8 H15.8 Z M4 13.6 H8.8 V8.8 H4 Z M11.6 13.6 H16.4 V8.8 H11.6 Z M19.2 13.6 H24 V8.8 H19.2 Z",fill:"currentColor"})})},{name:"Pershing Square",slug:"pershing-square-capital-management-lp",mark:h.jsxs("svg",{viewBox:"0 0 28 28",className:io,"aria-hidden":"true",children:[h.jsx("rect",{x:"6",y:"6",width:"16",height:"16",rx:"1.2",fill:"none",stroke:"currentColor",strokeWidth:"1.8"}),h.jsx("path",{d:"M10 18 V10 H14.4 C16.3 10 17.4 11 17.4 12.6 C17.4 14.2 16.3 15.1 14.4 15.1 H10 Z",fill:"currentColor"})]}),wordmarkClass:"font-serif tracking-[0.08em]"},{name:"Tiger Global",slug:"tiger-global-management-llc",mark:h.jsx("svg",{viewBox:"0 0 28 28",className:io,"aria-hidden":"true",children:h.jsx("path",{d:"M6 8 H13.2 V11.1 H10.4 V20 H8.8 V11.1 H6 Z M14.6 8 H22 V11.1 H16.2 V12.8 H21.2 V15.6 H16.2 V20 H14.6 Z",fill:"currentColor"})})},{name:"Elliott",slug:"elliott-management-corporation",mark:h.jsx("svg",{viewBox:"0 0 28 28",className:io,"aria-hidden":"true",children:h.jsx("path",{d:"M8 8 H20 V10.4 H10.6 V12.8 H18.6 V15 H10.6 V17.6 H20 V20 H8 Z",fill:"currentColor"})})},{name:"Third Point",slug:"third-point-llc",mark:h.jsxs("svg",{viewBox:"0 0 28 28",className:io,"aria-hidden":"true",children:[h.jsx("rect",{x:"5",y:"5",width:"18",height:"18",rx:"2",fill:"none",stroke:"currentColor",strokeWidth:"1.6"}),h.jsx("path",{d:"M8 16.5 C10.2 13.2 12.4 13.2 14 16.5 C15.6 19.8 17.8 19.8 20 16.5",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})},{name:"Appaloosa",slug:"appaloosa-management",mark:h.jsx("svg",{viewBox:"0 0 28 28",className:io,"aria-hidden":"true",children:h.jsx("path",{d:"M5.5 19.5 C7 17.8 8.2 15.4 8.6 13.2 C9.2 10.4 11.4 8.4 14.2 8.6 C15.6 6.8 18.2 6.6 19.8 8.4 C21.6 8.6 23 10.2 22.6 12.2 C22.2 13.4 21.2 14.2 20 14.4 C19.6 16.8 17.6 18.8 15 19.6 L14.2 22 H12.4 L12.8 19.8 C10.4 19.6 8.4 18.6 7 17.2 C6.4 18.4 5.8 19.2 5.5 19.5 Z",fill:"currentColor"})})},{name:"Coatue",slug:"coatue-management",mark:h.jsx("svg",{viewBox:"0 0 28 28",className:io,"aria-hidden":"true",children:h.jsx("path",{d:"M8.4 8 H12.2 L16.6 16.2 L21 8 H24.6 L17.8 21.2 H15.2 Z",fill:"currentColor"})}),wordmarkClass:"font-serif tracking-[0.16em]"},{name:"Point72",slug:"point72-asset-management-lp",mark:h.jsxs("svg",{viewBox:"0 0 28 28",className:io,"aria-hidden":"true",children:[h.jsx("circle",{cx:"8",cy:"8",r:"1.15",fill:"currentColor"}),h.jsx("circle",{cx:"14",cy:"8",r:"1.15",fill:"currentColor"}),h.jsx("circle",{cx:"20",cy:"8",r:"1.15",fill:"currentColor"}),h.jsx("circle",{cx:"8",cy:"14",r:"1.15",fill:"currentColor"}),h.jsx("circle",{cx:"20",cy:"14",r:"1.15",fill:"currentColor"}),h.jsx("circle",{cx:"8",cy:"20",r:"1.15",fill:"currentColor"}),h.jsx("circle",{cx:"14",cy:"20",r:"1.15",fill:"currentColor"}),h.jsx("circle",{cx:"20",cy:"20",r:"1.15",fill:"currentColor"})]})},{name:"Two Sigma",slug:"two-sigma-investments",mark:h.jsxs("svg",{viewBox:"0 0 28 28",className:io,"aria-hidden":"true",children:[h.jsx("path",{d:"M14 4.5 L23.5 14 L14 23.5 L4.5 14 Z",fill:"none",stroke:"currentColor",strokeWidth:"1.6"}
446),h.jsx("text",{x:"14",y:"17.2",textAnchor:"middle",fill:"currentColor",fontSize:"8.5",fontWeight:"700",fontFamily:"Inter, sans-serif",children:"2Ï"})]})},{name:"Viking Global",slug:"viking-global-investors-lp",mark:h.jsxs("svg",{viewBox:"0 0 28 28",className:io,"aria-hidden":"true",children:[h.jsx("path",{d:"M5 19.5 H23 L20.6 14.2 H18.8 L16.6 8.8 H11.4 L9.2 14.2 H7.4 Z",fill:"currentColor"}),h.jsx("path",{d:"M12.2 8.8 L14 5.6 L15.8 8.8 Z",fill:"currentColor"})]})}];function d6e({institution:t,itemClass:e}){return h.jsxs(na,{to:`/whales-institution/${t.slug}`,className:e,children:[t.mark,h.jsx("span",{className:`text-[13px] font-semibold uppercase tracking-[0.14em] ${t.wordmarkClass??""}`,children:t.name})]})}function h6e(){const{t}=sr("smartmoney");return h.jsx(h.Fragment,{children:t("hero.trackedLabel")})}function f6e({variant:t="light",label:e,className:n=""}){const r=[...SB,...SB],i=t==="dark";return h.jsxs("div",{className:n||(i?"mt-8 border-t border-white/10 pt-8":"mt-12 border-t border-gray-100 pt-8 md:mt-16 md:pt-10"),"aria-label":e,children:[h.jsx("p",{className:`text-center text-[11px] font-semibold uppercase tracking-[0.22em] ${i?"text-slate-500":"text-gray-400"}`,children:e??h.jsx(h6e,{})}),h.jsxs("div",{className:"relative mt-5 overflow-hidden",children:[h.jsx("div",{className:`pointer-events-none absolute inset-y-0 left-0 z-10 w-12 md:w-24 ${i?"bg-gradient-to-r from-[#05050A] to-transparent":"bg-gradient-to-r from-white to-transparent"}`}),h.jsx("div",{className:`pointer-events-none absolute inset-y-0 right-0 z-10 w-12 md:w-24 ${i?"bg-gradient-to-l from-[#05050A] to-transparent":"bg-gradient-to-l from-white to-transparent"}`}),h.jsx("div",{className:"flex w-max animate-logo-marquee motion-reduce:animate-none hover:[animation-play-state:paused]",children:r.map((s,a)=>h.jsx("div",{className:`flex items-center border-r ${i?"border-white/10":"border-gray-200/80"}`,children:h.jsx(d6e,{institution:s,itemClass:i?"group flex h-12 shrink-0 items-center gap-2.5 px-7 text-slate-300 transition-colors hover:text-white":"group flex h-12 shrink-0 items-center gap-2.5 px-7 text-gray-700 transition-colors hover:text-gray-950"})},`${s.slug}-${a}`))})]})]})}const lX="/images/hero-studio-screenshot.png",p6e=1920,m6e=1080,c4={"copy-trading":{src:"/images/hero-copy-trading.png",alt:"Tritonix strategy tracking marketplace and research dashboard",windowLabel:"Strategy Tracking"},"ai-strategies":{src:"/images/hero-ai-strategies.png",alt:"Tritonix AI Consensus Pick strategy performance dashboard",windowLabel:"AI Strategies"},"automated-trading":{src:"/images/hero-automated-trading.png",alt:"Tritonix automated market monitoring task and alert workflow",windowLabel:"Smart Market Monitoring"},"advanced-indicators":{src:"/images/hero-advanced-indicators.png",alt:"Tritonix advanced technical indicators with buy and sell signals on the live chart",windowLabel:"Advanced Indicators"}},AB=[{id:"agentic-trading",label:"AI Research"},{id:"copy-trading",label:"Strategy Tracking"},{id:"ai-strategies",label:"AI Strategies"},{id:"automated-trading",label:"Smart Market Monitoring"},{id:"advanced-indicators",label:"Advanced Indicators"}],o7="rounded-[2rem] border border-white/10 bg-white/[0.045] shadow-[0_24px_90px_rgba(0,0,0,0.45)] backdrop-blur-xl";function u4({icon:t,children:e}){return h.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full border border-white/10 bg-white/[0.04] px-3.5 py-1.5 text-[11px] font-bold uppercase tracking-[0.22em] text-cyan-100/80 shadow-[0_0_30px_rgba(124,58,237,0.18)]",children:[h.jsx(t,{className:"h-3.5 w-3.5 text-cyan-300"}),e]})}function kB({className:t=""}){return h.jsxs("div",{className:`pointer-events-none absolute rounded-full border border-violet-300/15 ${t}`,children:[h.jsx("div",{className:"absolute inset-8 rounded-full border border-cyan-300/10"}),h.jsx("div",{className:"absolute inset-20 rounded-full bg-[radial-gradient(circle,rgba(124,58,237,0.18),transparent_62%)] blur-sm"})]})}function TB({primaryLabel:t,onPrimaryClick:e,className:n=""}){return h.jsx("div",{className:`flex flex-col items-center justify-center gap-3 sm:flex-row ${n}`,children:h.jsxs("button",{onClick:e,className:"group inline-flex w-full items-center justify-center gap-2 rounded-full bg-white px-7 py-3.5 text-base font-bold text-black shadow-[0_0_40px_rgba(255,255,255,0.16)] transition-all hover:scale-[1.02] hover:bg-cyan-50 sm:w-auto md:min-w-[236px] md:gap-2.5 md:px-9 md:py-4 md:text-lg",children:[t,h.jsx(yf,{className:"h-5 w-5 transition-transform group-hover:translate-x-1 md:h-
4465.5 md:w-5.5"})]})})}function LB({imageSrc:t=lX,imageAlt:e,windowLabel:n,priority:r=!1}){const{t:i}=sr("landing");return h.jsxs("div",{className:`${o7} animate-fade-in overflow-hidden`,children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-white/10 bg-white/[0.035] px-5 py-3",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"h-2.5 w-2.5 rounded-full bg-rose-400/90"}),h.jsx("span",{className:"h-2.5 w-2.5 rounded-full bg-amber-300/90"}),h.jsx("span",{className:"h-2.5 w-2.5 rounded-full bg-emerald-300/90"})]}),n?h.jsx("div",{className:"hidden text-[11px] font-medium tracking-wide text-slate-500 sm:block",children:n}):h.jsxs("div",{className:"hidden items-center gap-2 rounded-full border border-emerald-300/20 bg-emerald-300/10 px-3 py-1 text-[11px] font-mono text-emerald-200 sm:flex",children:[h.jsx("span",{className:"h-1.5 w-1.5 animate-pulse rounded-full bg-emerald-300"}),i("visuals.hero.liveLoop")]})]}),h.jsx("div",{className:"relative aspect-[16/9] bg-[#060712]",children:h.jsx("img",{src:t,alt:e??i("visuals.hero.alt"),width:p6e,height:m6e,className:"block h-auto w-full",loading:r?"eager":"lazy",fetchPriority:r?"high":"low",decoding:"async"})})]})}function y6e({label:t}){return h.jsxs("div",{className:`${o7} overflow-hidden`,children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-white/10 bg-white/[0.035] px-5 py-3",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"h-2.5 w-2.5 rounded-full bg-rose-400/90"}),h.jsx("span",{className:"h-2.5 w-2.5 rounded-full bg-amber-300/90"}),h.jsx("span",{className:"h-2.5 w-2.5 rounded-full bg-emerald-300/90"})]}),h.jsx("div",{className:"text-xs font-medium text-slate-500",children:t}),h.jsx("div",{className:"w-16"})]}),h.jsx("div",{className:"relative aspect-[16/9] bg-[#060712]",children:h.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_50%_18%,rgba(124,58,237,0.16),transparent_28%),radial-gradient(circle_at_70%_78%,rgba(34,211,238,0.1),transparent_24%)]"})})]})}function d4(t){return`https://www.google.com/s2/favicons?domain=${t}&sz=128`}function $B({src:t,alt:e,sizeClass:n="h-10 w-10",rounded:r="rounded-xl",fit:i="cover"}){return h.jsx("div",{className:`${n} ${r} overflow-hidden bg-white`,children:h.jsx("img",{src:t,alt:e,className:`h-full w-full ${i==="contain"?"object-contain p-1":"object-cover"}`})})}const LC=[{src:"/images/swing-trade-bot-feature.png",alt:"VRT Swing Trade Bot card with entry, stop, return, and buy/sell markers"},{src:"/images/swing-trade-bot-feature-smci.png",alt:"SMCI Swing Trade Bot card with entry, stop, and open position return"},{src:"/images/swing-trade-bot-feature-tsla.png",alt:"TSLA Swing Trade Bot card with entry, stop, return, and buy/sell markers"}];function g6e(){const[t,e]=N.useState(0),[n,r]=N.useState(!1);N.useEffect(()=>{if(n)return;const s=window.setInterval(()=>{e(a=>(a+1)%LC.length)},4500);return()=>window.clearInterval(s)},[n]);const i=LC[t];return h.jsxs("div",{className:"relative mx-auto w-full max-w-[380px] lg:max-w-[400px]",onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:[h.jsx("div",{className:"pointer-events-none absolute -inset-8 rounded-[3rem] bg-gradient-to-r from-emerald-500/15 via-cyan-400/10 to-violet-500/15 blur-3xl"}),h.jsx("div",{className:"relative overflow-hidden rounded-2xl border border-white/10 bg-[#0B0B12] shadow-[0_28px_120px_rgba(0,0,0,0.45)]",children:h.jsx("img",{src:i.src,alt:i.alt,className:"block h-auto w-full",loading:"lazy",decoding:"async"})}),h.jsx("div",{className:"relative mt-4 grid grid-cols-3 gap-2",children:LC.map((s,a)=>{const o=a===t;return h.jsx("button",{type:"button",onClick:()=>e(a),className:`rounded-full border px-3 py-2 transition-all ${o?"border-emerald-300/40 bg-emerald-300/10 shadow-[0_0_18px_rgba(52,211,153,0.12)]":"border-white/10 bg-white/[0.04] hover:border-white/20 hover:bg-white/[0.07]"}`,"aria-label":`Show swing trade card ${a+1}`,"aria-pressed":o,children:h.jsxs("div",{className:"flex items-center justify-center gap-2",children:[h.jsx("div",{className:`h-2 w-2 rounded-full ${o?"bg-emerald-400":"bg-white/30"}`}),h.jsx("div",{className:`h-2 rounded-full transition-all ${o?"w-10 bg-emerald-200/80":"w-6 bg-white/20"}`})]})},s.src)})})]})}function b6e({type:t}){const{t:e}=sr("landing");if(t==="swing")return h.jsx(g6e,{});
446if(t==="consensus"){const n=[{label:e("visuals.consensus.mockTotalReturn",{defaultValue:"Backtested"}),value:"+81.8%",color:"text-violet-600"},{label:e("visuals.consensus.mockSharpe",{defaultValue:"Sharpe Ratio"}),value:"4.39",color:"text-pink-500"},{label:e("visuals.consensus.mockDrawdown",{defaultValue:"Max Drawdown"}),value:"-7.3%",color:"text-amber-500"},{label:e("visuals.consensus.mockUpdated",{defaultValue:"Updated"}),value:"Jun 9",color:"text-emerald-500"}];return h.jsxs("div",{className:"rounded-2xl border border-white/10 bg-[#0B0B12] shadow-[0_28px_120px_rgba(0,0,0,0.45)] overflow-hidden",children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-white/10 bg-white/[0.04] px-5 py-3",children:[h.jsxs("div",{className:"flex gap-1.5",children:[h.jsx("div",{className:"w-3 h-3 rounded-full bg-[#FF5F57]"}),h.jsx("div",{className:"w-3 h-3 rounded-full bg-[#FFBD2E]"}),h.jsx("div",{className:"w-3 h-3 rounded-full bg-[#28C840]"})]}),h.jsx("div",{className:"text-xs font-medium text-slate-500",children:e("visuals.consensus.windowTitle",{defaultValue:"Tritonix · AI Consensus Stock Pick"})}),h.jsx("div",{className:"w-16"})]}),h.jsxs("div",{className:"p-5",children:[h.jsx("div",{className:"mb-4 grid grid-cols-4 gap-2 sm:gap-4",children:n.map(r=>h.jsxs("div",{className:"min-w-0",children:[h.jsx("div",{className:"text-[9px] font-medium uppercase tracking-[0.06em] text-slate-500 sm:text-[10px] sm:tracking-wide",children:r.label}),h.jsx("div",{className:`mt-1 text-[0.95rem] font-black leading-none sm:text-lg ${r.color}`,children:r.value})]},r.label))}),h.jsx("div",{className:"relative rounded-xl overflow-hidden border border-white/10 bg-white/[0.03]",children:h.jsx("img",{src:"/images/ai-consensus-hero-chart-dark.svg",alt:e("visuals.consensus.alt",{defaultValue:"Tritonix AI Consensus Stock Pick performance chart compared with the S&P 500"}),className:"w-full",loading:"lazy",decoding:"async"})})]})]})}if(t==="money"){const n=e("visuals.money.rows",{returnObjects:!0}),r={NVDA:d4("nvidia.com"),MSFT:d4("microsoft.com"),AMZN:d4("amazon.com")};return h.jsxs("div",{className:`${o7} p-5`,children:[h.jsxs("div",{className:"mb-5 flex items-center justify-between",children:[h.jsxs("div",{children:[h.jsx("div",{className:"text-sm font-bold text-white",children:e("visuals.money.title")}),h.jsx("div",{className:"text-xs text-slate-500",children:e("visuals.money.sub")})]}),h.jsxs("div",{className:"inline-flex items-center gap-1.5 rounded-full border border-cyan-300/15 bg-cyan-300/10 px-3 py-1 text-[11px] font-semibold text-cyan-200",children:[h.jsx(o8,{className:"h-3.5 w-3.5"}),e("visuals.money.status")]})]}),h.jsx("div",{className:"rounded-2xl border border-white/10 bg-white/[0.035] p-4",children:h.jsxs("div",{className:"flex items-center justify-between gap-3",children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[h.jsx("div",{className:"rounded-2xl border border-cyan-300/15 bg-white p-1.5 shadow-[0_10px_24px_rgba(0,0,0,0.18)]",children:h.jsx($B,{src:"/images/alpaca.png",alt:"Alpaca",sizeClass:"h-9 w-9",rounded:"rounded-xl"})}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("div",{className:"text-sm font-semibold text-white",children:e("visuals.money.account")}),h.jsx("div",{className:"mt-1 text-xs text-slate-500",children:e("visuals.money.allocation")})]})]}),h.jsx("div",{className:"rounded-full border border-white/10 bg-white/[0.05] px-3 py-1 text-[11px] font-semibold text-slate-300",children:e("visuals.money.next")})]})}),h.jsx("div",{className:"mt-4 space-y-3",children:n.map(i=>h.jsxs("div",{className:"flex items-center justify-between rounded-2xl border border-white/10 bg-white/[0.035] p-3",children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[h.jsx("div",{className:"rounded-2xl border border-violet-300/20 bg-violet-300/10 p-1.5",children:h.jsx($B,{src:r[i.ticker]??d4("tritonix.ai"),alt:i.company,sizeClass:"h-8 w-8",rounded:"rounded-xl"})}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("div",{className:"text-sm font-semibold text-white",children:i.company}),h.jsx("div",{className:"text-xs text-slate-500",children:i.weight})]})]}),h.jsxs("div",{className:"flex items-center gap-1 text-xs font-bold text-emerald-300",children:[h.jsx(e1e,{className:"h-3.5 w-3.5"}),i.amount]})]},i.ticker))}),h.jsx("div",{className:"mt-4 rounded-2xl border border-emerald-300/15 bg-emerald-300/10 px-4 py-3",children:h.jsx("div",{className:"text-xs font-bold uppercase tracking-[0.18em] text-emerald-100/80",children:e("visual
446s.money.note")})})]})}if(t==="technical"){const n=[{label:e("visuals.technical.mockSymbol",{defaultValue:"Symbol"}),value:e("visuals.technical.mockSymbolValue",{defaultValue:"CRWV"}),color:"text-cyan-300"},{label:e("visuals.technical.mockTimeframe",{defaultValue:"Timeframe"}),value:e("visuals.technical.mockTimeframeValue",{defaultValue:"5m"}),color:"text-violet-300"},{label:e("visuals.technical.mockEntry",{defaultValue:"Entry"}),value:e("visuals.technical.mockEntryValue",{defaultValue:"103.15"}),color:"text-amber-300"},{label:e("visuals.technical.mockTarget",{defaultValue:"Target"}),value:e("visuals.technical.mockTargetValue",{defaultValue:"104.8"}),color:"text-emerald-300"}];return h.jsxs("div",{className:"rounded-2xl border border-white/10 bg-[#0B0B12] shadow-[0_28px_120px_rgba(0,0,0,0.45)] overflow-hidden",children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-white/10 bg-white/[0.04] px-5 py-3",children:[h.jsxs("div",{className:"flex gap-1.5",children:[h.jsx("div",{className:"w-3 h-3 rounded-full bg-[#FF5F57]"}),h.jsx("div",{className:"w-3 h-3 rounded-full bg-[#FFBD2E]"}),h.jsx("div",{className:"w-3 h-3 rounded-full bg-[#28C840]"})]}),h.jsx("div",{className:"text-xs font-medium text-slate-500",children:e("visuals.technical.windowTitle",{defaultValue:"Tritonix · AI Technical Analysis"})}),h.jsx("div",{className:"w-16"})]}),h.jsxs("div",{className:"p-5",children:[h.jsx("div",{className:"mb-4 grid grid-cols-4 gap-2 sm:gap-4",children:n.map(r=>h.jsxs("div",{className:"min-w-0",children:[h.jsx("div",{className:"text-[9px] font-medium uppercase tracking-[0.06em] text-slate-500 sm:text-[10px] sm:tracking-wide",children:r.label}),h.jsx("div",{className:`mt-1 text-[0.95rem] font-black leading-none sm:text-lg ${r.color}`,children:r.value})]},r.label))}),h.jsx("div",{className:"relative rounded-xl overflow-hidden border border-white/10 bg-white/[0.03]",children:h.jsx("img",{src:"/images/CRWV_2026-06-13_19-04-07.png",alt:e("visuals.technical.alt",{defaultValue:"AI technical analysis chart with indicators, drawings, and setup levels for CRWV"}),className:"w-full",loading:"lazy",decoding:"async"})})]})]})}return null}const IB=({onOpenAuth:t})=>{var D;const[e,n]=N.useState("agentic-trading"),[r,i]=N.useState(0),[s,a]=N.useState(0),[o,l]=N.useState(!1),{t:u,i18n:f}=sr("landing"),{t:p}=sr("common"),y=u("hero.headline1"),g=u("hero.headline2"),b=(f.language||"en").toLowerCase().startsWith("en"),{user:v}=fc(),_=Bu(),C=Vf(),S=()=>{ig("landing",v?"open_studio":"start_free_trial"),v?_(`${C}/studio`):t("signup")},x=[{type:"consensus",icon:zU,badge:u("consensus.badge"),line1:u("consensus.headline1"),line2:u("consensus.headline2"),desc:u("consensus.desc"),points:u("consensus.points",{returnObjects:!0}).slice(0,4)},{type:"technical",icon:n1,badge:u("technical.badge"),line1:u("technical.headline1"),line2:u("technical.headline2"),desc:u("technical.desc"),points:[u("technical.features.workspace.label"),u("technical.features.indicators.label"),u("technical.features.draw.label"),u("technical.features.idea.label")]},{type:"money",icon:o8,badge:u("smartMoney.badge"),line1:u("smartMoney.headline1"),line2:u("smartMoney.headline2"),desc:u("smartMoney.desc"),points:u("smartMoney.points",{returnObjects:!0}).slice(0,4)}],A=u("howItWorks.steps",{returnObjects:!0}),I=u("coverage.items",{returnObjects:!0}),$=u("testimonials.items",{returnObjects:!0}),O=u("faq.items",{returnObjects:!0}),P=Array.isArray(O)?O:[],j=u("seo.keywords",{returnObjects:!0}),U=$.slice(0,3).map((R,W)=>({...R,imageSrc:["/images/testimonial-sarah.jpg","/images/testimonial-marcus.jpg","/images/testimonial-david.jpg"][W]})).filter(R=>R.name),z=U[r]??U[0]??{quote:"",name:"",role:"",imageSrc:""};return N.useEffect(()=>{if(typeof window>"u")return;const R=document.getElementById("main-scroll"),W=R??window,T=()=>{var H;const L=window.innerWidth<768,M=(R==null?void 0:R.clientHeight)??((H=window.visualViewport)==null?void 0:H.height)??window.innerHeight,Z=(R==null?void 0:R.scrollTop)??window.scrollY??document.documentElement.scrollTop??0;if(!L){l(!1);return}l(Z>M*oX)};return T(),W.addEventListener("scroll",T,{passive:!0}),window.addEventListener("resize",T),()=>{W.removeEventListener("scroll",T),window.removeEventListener("resize",T)}},[]),h.jsxs("div",{className:"overflow-x-hidden bg-[#030306] text-white selection:bg-violet-300 selection:text-black",children:[h.jsx(Ir,{title:u("seo.title"),description:u("seo.description"),canonical:"/",keywords:j}),h.jsx(tI,{children:h.jsx("link",{rel:"preload",as:"image",href:lX,fetchPriority:"high"})}),h.jsxs("section",{className:"relative flex min-h-screen items-start overflow-hidden px-4 pb-12 pt-20 md:px-6 md:pt-24",children:[h.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_50%_0%,rgba(124,58,237,0.32),transparent_34%),radial-gradient(circle_at_18%_42%,rgba(37,99,235,0.2),transparent_28%),linear-gradient(180deg,#05050A_0%,#030306_70%)]"}),h.jsx("div",{className:"absolute inset-0 opacity-[0.13] bg-[linear-gradient(to_right,#ffffff_1px,transparent_1px),linear-gradient(to_bottom,#ffffff_1px,transparent_1px)] bg-[size:72px_72px]"}),h.jsx(kB,{className:"-right-48 top-20 h-[560px] w-[560px] rotate-12"}),h.jsx(kB,{className:"-bottom-64 left-1/2 h-[760px] w-[760px] -translate-x-1/2"}),h.jsxs("div",{className:"container relative z-10 mx-auto",children:[h.jsxs("div",{className:"mx-auto max-w-5xl text-center",children:[h.jsxs("div",{className:"mb-5 inline-flex items-center gap-2 rounded-full border border-violet-200/15 bg-white/[0.045] px-4 py-2 text-sm font-semibold text-violet-100 shadow-[0_0_44px_rgba(124,58,237,0.25)] backdrop-blur-xl",children:[h.jsx(bu,{className:"h-3.5 w-3.5 text-cyan-300"}),u("hero.badge")]}),h.jsx("h1",{className:"mx-auto max-w-5xl font-black leading-[1.08] tracking-[-0.05em] text-white text-[clamp(1.5rem,7vw,2rem)] sm:text-4xl md:text-5xl lg:text-6xl",children:b?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"block whitespace-nowrap sm:inline sm:whitespace-normal",children:"The Smartest"})," ",h.jsx("span",{className:"mt-1 block whitespace-nowrap sm:mt-0 sm:inline sm:whitespace-normal",children:"AI Investing Platform"})," ",h.jsx("span",{className:"mt-1 block whitespace-nowrap bg-gradient-to-r from-cyan-200 via-v
446iolet-200 to-fuchsia-200 bg-clip-text text-transparent sm:mt-1.5",children:g})]}):h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"block",children:y})," ",h.jsx("span",{className:"mt-1 block bg-gradient-to-r from-cyan-200 via-violet-200 to-fuchsia-200 bg-clip-text text-transparent sm:mt-1.5",children:g})]})}),h.jsx("div",{className:"mx-auto mt-6 flex max-w-4xl flex-col items-center justify-center gap-2.5 md:flex-row md:flex-nowrap md:gap-7",children:[u("hero.stats.investors"),u("hero.stats.credits"),u("hero.stats.models")].map(R=>h.jsxs("span",{className:"inline-flex items-center gap-2.5 whitespace-nowrap text-base font-semibold text-slate-100 md:text-[17px]",children:[h.jsx("span",{className:"h-2 w-2 rounded-full bg-cyan-300 shadow-[0_0_16px_rgba(103,232,249,0.9)]"}),R]},R))}),h.jsx("div",{className:"mt-7 flex items-center justify-center",children:h.jsx(TB,{primaryLabel:v?p("nav.openTritonix"):u("hero.cta"),onPrimaryClick:S})})]}),h.jsxs("div",{className:"relative mx-auto mt-10 max-w-6xl md:mt-12",children:[h.jsx("div",{className:"pointer-events-none absolute -inset-8 rounded-[3rem] bg-gradient-to-r from-violet-600/20 via-blue-600/10 to-cyan-400/20 blur-3xl"}),h.jsx("div",{className:"relative z-10",children:e==="agentic-trading"?h.jsx(LB,{windowLabel:"AI Research",priority:!0}):c4[e]?h.jsx(LB,{imageSrc:c4[e].src,imageAlt:c4[e].alt,windowLabel:c4[e].windowLabel}):h.jsx(y6e,{label:((D=AB.find(R=>R.id===e))==null?void 0:D.label)??""})}),h.jsx("div",{className:"no-scrollbar relative z-20 -mx-4 mt-4 flex flex-nowrap items-center justify-start gap-2 overflow-x-auto px-4 py-1 sm:mx-0 sm:mt-5 sm:flex-wrap sm:justify-center sm:gap-3 sm:px-0",children:AB.map(R=>{const W=R.id===e;return h.jsx("button",{type:"button",onClick:()=>n(R.id),onMouseEnter:()=>n(R.id),onFocus:()=>n(R.id),className:`shrink-0 rounded-full border px-3 py-1.5 text-xs font-medium transition-all sm:px-4 sm:py-2 sm:text-sm ${W?"hero-tab-active bg-emerald-300/[0.06] text-white shadow-[0_0_24px_rgba(74,222,128,0.1)]":"border-white/10 bg-white/[0.025] text-slate-300 hover:border-white/20 hover:bg-white/[0.05] hover:text-white"}`,children:R.label},R.id)})})]})]})]}),h.jsxs("section",{className:"relative overflow-hidden px-4 py-24 md:px-6",children:[h.jsx("div",{className:"absolute left-[-18rem] top-20 h-[520px] w-[520px] rounded-full bg-violet-600/15 blur-[120px]"}),h.jsx("div",{className:"container relative z-10 mx-auto space-y-28",children:x.map((R,W)=>h.jsxs("div",{className:"grid items-center gap-10 lg:grid-cols-2 lg:gap-16",children:[h.jsxs("div",{className:W%2===1?"lg:order-2":"",children:[h.jsx(u4,{icon:R.icon,children:R.badge}),h.jsxs("h2",{className:"mt-6 max-w-[32rem] text-3xl font-black leading-[1.08] tracking-[-0.04em] text-white md:text-5xl",children:[h.jsx("span",{className:"block",children:R.line1}),h.jsx("span",{className:"block",children:R.line2})]}),h.jsx("p",{className:"mt-6 max-w-xl text-lg leading-relaxed text-slate-400",children:R.desc}),h.jsx("div",{className:"mt-8 grid gap-3 sm:grid-cols-2",children:R.points.map(T=>h.jsxs("div",{className:"flex items-start gap-3 rounded-2xl border border-white/10 bg-white/[0.035] p-4",children:[h.jsx(t7,{className:"mt-0.5 h-4 w-4 shrink-0 text-cyan-300"}),h.jsx("span",{className:"text-sm leading-relaxed text-slate-300",children:T})]},T))}),h.jsx("div",{className:"mt-8",children:h.jsx(TB,{primaryLabel:v?p("nav.openTritonix"):u("hero.cta"),onPrimaryClick:S,className:"hidden md:flex"})})]}),h.jsx("div",{className:W%2===1?"lg:order-1":"",children:h.jsx(b6e,{type:R.type})})]},R.badge))})]}),h.jsx("section",{className:"relative border-y border-white/10 bg-[#05050A] px-4 py-8 md:px-6",children:h.jsxs("div",{className:"container mx-auto",children:[h.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[{value:"30+",label:u("stats.tools")},{value:"3,000+",label:u("stats.funds")},{value:"24/7",label:u("stats.alwaysOn")},{value:"13",label:u("stats.aiModels")}].map(R=>h.jsxs("div",{className:"rounded-3xl border border-white/10 bg-white/[0.035] p-6 text-center backdrop-blur-xl",children:[h.jsx("div",{className:"text-4xl font-black tracking-tight text-white",children:R.value}),h.jsx("div",{className:"mt-2 text-xs font-bold uppercase tracking-[0.18em] text-slate-500",children:R.label})]},R.label))}),h.jsx(f6e,{variant:"dark",label:u("stats.trackedLabel")})]})}),h.jsx("section",{className:"relative px-4 py-24 md:px-6",children:h.jsxs("div",{className:"container mx-auto",children:[h.jsxs("div",{className:"mx-auto mb-14 max-w-3xl text-center",children:[h.jsx(u4,{icon:zU,children:u("howItWorks.badge")}),h.jsx("h2",{className:"mt-6 text-4xl font-black tracking-[-0.04em] text-white md:text-6xl",children:u("howItWorks.headline")}),h.jsx("p",{className:"mt-5 text-lg text-slate-400",children:u("howItWorks.desc")})]}),h.jsx("div",{className:"mx-auto grid max-w-6xl gap-5 md:grid-cols-3",children:[{icon:JA},{icon:a8},{icon:P1e}].map((R,W)=>{var T,L,M;return h.jsxs("div",{className:`${o7} p-6`,children:[h.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[h.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-2xl border border-cyan-200/15 bg-cyan-200/10",children:h.jsx(R.icon,{className:"h-5 w-5 text-cyan-200"})}),h.jsxs("span",{className:"font-mono text-sm text-slate-600",children:["0",W+1]})]}),h.jsx("h3",{className:"text-xl font-black text-white",children:(T=A[W])==null?void 0:T.title}),h.jsx("p",{className:"mt-3 text-sm leading-relaxed text-slate-400",children:(L=A[W])==null?void 0:L.desc})]},((M=A[W])==null?void 0:M.title)||W)}
446)})]})}),h.jsx("section",{className:"border-y border-white/10 bg-[#05050A] px-4 py-20 md:px-6",children:h.jsxs("div",{className:"container mx-auto",children:[h.jsxs("div",{className:"mb-10 text-center",children:[h.jsx("h2",{className:"text-4xl font-black tracking-[-0.04em] text-white md:text-5xl",children:u("coverage.headline")}),h.jsx("p",{className:"mt-4 text-lg text-slate-400",children:u("coverage.desc")})]}),h.jsx("div",{className:"mx-auto grid max-w-5xl grid-cols-2 gap-4 md:grid-cols-4",children:I.map(R=>h.jsxs("div",{className:"rounded-3xl border border-white/10 bg-white/[0.035] p-5 text-center backdrop-blur-xl transition-all hover:border-cyan-200/25 hover:bg-white/[0.06]",children:[h.jsx("div",{className:"text-3xl",children:R.icon}),h.jsx("div",{className:"mt-3 text-sm font-bold text-white",children:R.label}),h.jsx("div",{className:"mt-1 text-xs leading-relaxed text-slate-500",children:R.sub})]},R.label))})]})}),h.jsxs("section",{className:"relative overflow-hidden px-4 py-24 md:px-6",children:[h.jsx("div",{className:"absolute left-[-10rem] top-14 h-[420px] w-[420px] rounded-full bg-violet-600/15 blur-[120px]"}),h.jsx("div",{className:"absolute right-[-16rem] top-0 h-[520px] w-[520px] rounded-full bg-blue-600/15 blur-[120px]"}),h.jsxs("div",{className:"container relative z-10 mx-auto",children:[h.jsxs("div",{className:"mx-auto mb-14 max-w-3xl text-center",children:[h.jsx(u4,{icon:l8,children:u("testimonials.badge")}),h.jsx("h2",{className:"mt-6 text-4xl font-black tracking-[-0.04em] text-white md:text-5xl",children:u("testimonials.headline")}),h.jsx("p",{className:"mt-4 text-lg text-slate-400",children:u("testimonials.desc")})]}),h.jsxs("div",{className:"mx-auto max-w-6xl",children:[h.jsxs("div",{className:"grid gap-6 lg:grid-cols-[0.92fr_1.08fr]",children:[h.jsxs("div",{className:"relative overflow-hidden rounded-[2.4rem] border border-white/10 bg-white/[0.04] shadow-[0_28px_120px_rgba(0,0,0,0.5)]",children:[h.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-violet-500/10 via-trans
446parent to-cyan-400/10"}),h.jsx("img",{src:z.imageSrc,alt:z.name,className:"h-[420px] w-full object-cover object-center md:h-[520px]",loading:"lazy",decoding:"async"}),h.jsx("div",{className:"absolute inset-x-0 bottom-0 bg-gradient-to-t from-[#05050A] via-[#05050A]/82 to-transparent p-6 md:p-8",children:h.jsxs("div",{className:"mt-4 max-w-md",children:[h.jsx("div",{className:"text-2xl font-black tracking-[-0.03em] text-white md:text-3xl",children:z.name}),h.jsx("div",{className:"mt-1 text-sm text-slate-400",children:z.role}),h.jsxs("p",{className:"mt-4 line-clamp-3 text-sm leading-relaxed text-slate-300",children:['"',z.quote,'"']})]})})]}),h.jsxs("div",{className:"rounded-[2.4rem] border border-white/10 bg-white/[0.045] p-7 shadow-[0_28px_120px_rgba(0,0,0,0.42)] backdrop-blur-xl md:p-10",children:[h.jsx("div",{className:"mb-6 flex items-center gap-1 text-amber-300",children:[...Array(5)].map((R,W)=>h.jsx(l8,{className:"h-4 w-4 fill-current"},W))}),h.jsxs("p",{className:"max-w-2xl text-2xl font-semibold leading-[1.35] tracking-[-0.03em] text-white md:text-[2rem]",children:['"',z.quote,'"']}),h.jsxs("div",{className:"mt-8 border-t border-white/10 pt-6",children:[h.jsx("div",{className:"text-sm font-bold text-white",children:z.name}),h.jsx("div",{className:"mt-1 text-sm text-slate-500",children:z.role})]})]})]}),h.jsx("div",{className:"mt-6 grid gap-3 md:grid-cols-3",children:U.map((R,W)=>{const T=W===r;return h.jsx("button",{type:"button",onClick:()=>i(W),"aria-pressed":T,className:`group rounded-[1.75rem] border p-3 text-left transition-all ${T?"border-cyan-300/30 bg-white/[0.08] shadow-[0_0_40px_rgba(34,211,238,0.12)]":"border-white/10 bg-white/[0.03] hover:border-white/20 hover:bg-white/[0.05]"}`,children:h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("img",{src:R.imageSrc,alt:R.name,className:"h-16 w-16 rounded-2xl object-cover object-center",loading:"lazy",decoding:"async"}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("div",{className:"text-sm font-bold text-white",children:R.name}),h.jsx("div",{className:"mt-0.5 line-clamp-1 text-xs text-slate-500",children:R.role}),h.jsx("div",{className:"mt-2 line-clamp-2 text-xs leading-relaxed text-slate-400",children:R.quote})]})]})},R.name)})})]})]})]}),P.length>0&&h.jsx("section",{className:"border-y border-white/10 bg-[#05050A] px-4 py-24 md:px-6",children:h.jsx("div",{className:"container relative z-10 mx-auto",children:h.jsxs("div",{className:"mx-auto max-w-4xl",children:[h.jsxs("div",{className:"text-center",children:[h.jsx(u4,{icon:ome,children:u("faq.badge")}),h.jsx("h2",{className:"mt-6 text-4xl font-black leading-[1.08] tracking-[-0.04em] text-white md:text-5xl",children:u("faq.headline")}),h.jsx("p",{className:"mx-auto mt-5 max-w-2xl text-base leading-relaxed text-slate-400 md:text-lg",children:u("faq.desc")})]}),h.jsx("div",{className:"mt-12 space-y-3",children:P.map((R,W)=>{const T=W===s;return h.jsxs("div",{className:`overflow-hidden rounded-2xl border transition-colors ${T?"border-white/15 bg-white/[0.06]":"border-white/10 bg-white/[0.03] hover:border-white/15"}`,children:[h.jsxs("button",{type:"button",onClick:()=>a(T?-1:W),className:"flex w-full items-start justify-between gap-4 px-5 py-5 text-left md:px-6",children:[h.jsx("div",{className:"min-w-0",children:h.jsx("h3",{className:"text-base font-semibold leading-7 text-white md:text-lg",children:R.question})}),h.jsx("span",{className:`mt-0.5 flex h-9 w-9 shrink-0 items-center justify-center rounded-full border transition-all ${T?"border-white/15 bg-white/[0.07] text-white":"border-white/10 bg-white/[0.04] text-slate-400"}`,children:h.jsx(Sh,{className:`h-5 w-5 transition-transform ${T?"rotate-180":""}`})})]}),T&&h.jsx("div",{className:"border-t border-white/10 px-5 pb-5 pt-0 md:px-6 md:pb-6",children:h.jsx("p",{className:"max-w-3xl text-sm leading-7 text-slate-400 md:text-[0.95rem]",children:R.answer})})]},R.question)})})]})})}),h.jsxs("section",{className:"relative overflow-hidden border-t border-white/10 px-4 py-28 md:px-6",children:[h.jsx("div",{className:"absolute inset-x-0 bottom-[-20rem] mx-auto h-[620px] w-[920px] rounded-[100%] border border-violet-200/15 bg-[radial-gradient(circle,rgba(124,58,237,0.22),transparent_62%)] blur-sm"}),h.jsx("div",{className:"container relative z-10 mx-auto text-center",children:h.jsxs("div",{className:"mx-auto max-w-4xl rounded-[2.5rem] border border-white/10 bg-white/[0.04] px-6 py-14 shadow-[0_32px_120px_rgba(0,0,0,0.5)] backdrop-blur-xl md:px-12",children:[h.jsxs("div",{className:"mb-7 inline-flex items-center gap-2 rounded-full border border-cyan-200/20 bg-cyan-200/10 px-4 py-2 text-sm font-semibold text-cyan-100",children:[h.jsx(n3,{className:"h-4 w-4"}),u("finalCta.badge")]}),h.jsxs("h2",{className:"text-4xl font-black leading-[1.02] tracking-[-0.05em] text-white md:text-6xl",children:[u("finalCta.headline1"),h.jsx("br",{}
446),h.jsx("span",{className:"bg-gradient-to-r from-cyan-200 via-violet-200 to-fuchsia-200 bg-clip-text text-transparent",children:u("finalCta.headline2")})]}),h.jsx("p",{className:"mx-auto mt-6 max-w-2xl text-lg leading-relaxed text-slate-400",children:u("finalCta.desc")}),h.jsx("div",{className:"mt-10 flex flex-col items-center justify-center gap-3 sm:flex-row",children:h.jsxs("button",{onClick:S,className:"group inline-flex w-full items-center justify-center gap-2 rounded-full bg-white px-9 py-4 text-base font-bold text-black transition-all hover:scale-[1.02] hover:bg-cyan-50 sm:w-auto",children:[v?p("nav.openTritonix"):u("finalCta.startFree"),h.jsx(yf,{className:"h-5 w-5 transition-transform group-hover:translate-x-1"})]})}),h.jsx("p",{className:"mt-6 text-sm text-slate-600",children:u("finalCta.footerNote")})]})})]}),h.jsx("div",{className:`fixed inset-x-0 bottom-0 z-40 px-4 pb-[calc(env(safe-area-inset-bottom,0px)+1rem)] pt-4 transition-all duration-300 md:hidden ${o?"pointer-events-auto translate-y-0 opacity-100":"pointer-events-none translate-y-6 opacity-0"}`,children:h.jsx("div",{className:"mx-auto max-w-md rounded-[2rem] border border-white/10 bg-[#05050A]/88 p-2 shadow-[0_-10px_60px_rgba(0,0,0,0.45)] backdrop-blur-2xl",children:h.jsxs("button",{onClick:S,className:"group inline-flex w-full items-center justify-center gap-2 rounded-full bg-white px-6 py-4 text-base font-bold text-black transition-all hover:bg-cyan-50",children:[v?p("nav.openTritonix"):u("hero.cta"),h.jsx(yf,{className:"h-5 w-5 transition-transform group-hover:translate-x-1"})]})})})]})},w6e=/^[A-Za-z][A-Za-z0-9_]{3,14}$/,_yt=160,xyt=50;function Cyt(t){return w6e.test(t)}function Yo(t){return typeof t=="string"?t.trim():""}function NB(t){const e=typeof t=="number"?t:Number(t);return Number.isFinite(e)&&e>0?Math.floor(e):0}function cX(t,e){return(t==null?void 0:t.displayName)||(t==null?void 0:t.username)||(e||"").trim()}function uX(t){return(t==null?void 0:t.avatarUrl)||""}function dX(t){return{id:Yo(t.id),username:Yo(t.username),displayName:Yo(t.displayName)||Yo(t.display_name),bio:Yo(t.bio),avatarUrl:Yo(t.avatarUrl)||Yo(t.avatar_url),bannerUrl:Yo(t.bannerUrl)||Yo(t.banner_url),followerCount:NB(t.followerCount??t.follower_count),followingCount:NB(t.followingCount??t.following_count),joinedAt:Yo(t.joinedAt)||Yo(t.joined_at)||null}}const hX="account.socialProfile",fX="account.connectedBrokers",pX=new Map;function l7(t,e){return`${t}.${e}`}function v6e(t){if(typeof window<"u")try{return window.localStorage.getItem(t)}catch{return null}return pX.get(t)??null}function _6e(t,e){if(typeof window<"u")try{window.localStorage.setItem(t,e);return}catch{return}pX.set(t,e)}function mX(t){const e=v6e(t);if(!e)return null;try{return JSON.parse(e)}catch{return null}}function yX(t,e){_6e(t,JSON.stringify(e))}function $C(t){if(!t)return null;const e=mX(l7(hX,t));return!e||typeof e!="object"||typeof e.id!="string"?null:e}function OB(t,e){yX(l7(hX,t),e)}function Eyt(t){if(!t)return null;const e=mX(l7(fX,t));return!e||!Array.isArray(e.keys)?null:e.keys.filter(n=>typeof n=="string"&&n.trim())}function Syt(t,e){yX(l7(fX,t),{keys:e})}async function gI(t,e){const n=await gf();if(!n)return{ok:!1,status:401,data:{error:"Unauthorized"}};const r=await fetch(t,{...e,headers:{Authorization:`Bearer ${n}`,...e!=null&&e.body?{"Content-Type":"application/json"}:{},...(e==null?void 0:e.headers)||{}}}),i=await r.json().catch(()=>({}));return{ok:r.ok,status:r.status,data:i&&typeof i=="object"?i:{}}}async function x6e(){const t=await gI("/api/social-profile");return t.ok?dX(t.data):null}async function Ayt(t){const e=await gI(`/api/social-profile?check=${encodeURIComponent(t)}`),n=e.data.status;return{status:n==="available"||n==="taken"||n==="reserved"||n==="invalid"?n:"invalid",username:typeof e.data.username=="string"?e.data.username:t}}async function kyt(t){const e=await gI("/api/social-profile",{method:"PATCH",body:JSON.stringify(t)});return e.ok?{ok:!0,profile:dX(e.data),error:null,code:null}:{ok:!1,profile:null,error:typeof e.data.error=="string"?e.data.error:"Failed to update profile",code:typeof e.data.code=="string"?e.data.code:null}}function gX(){const{user:t}=fc(),[e,n]=N.useState(()=>$C(t==null?void 0:t.id)),[r,i]=N.useState(()=>!!t&&!$C(t.id)),s=N.useCallback(o=>{n(o),t!=null&&t.id&&o&&OB(t.id,o)},[t==null?void 0:t.id]),a=N.useCallback(async()=>
446{if(!t)return n(null),i(!1),null;const o=$C(t.id);o?n(o):i(!0);const l=await x6e();return l?(n(l),OB(t.id,l)):o||n(null),i(!1),l},[t]);return N.useEffect(()=>{a()},[a]),{profile:e,loading:r,refresh:a,setProfile:s}}const C6e=N.lazy(()=>Le(()=>import("./PublicSymbolSearchOverlay-C8DQfFZA.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]))),PB=["en","es","fr","de","zh","zh-TW","ja","ko"],E6e=({currentPage:t,onNavigate:e,onOpenAuth:n,leftOffset:r=0,heroIsDark:i=!1})=>{var X;const{user:s,signOut:a}=fc(),{profile:o}=gX(),l=Bu(),u=Zi(),{t:f,i18n:p}=sr("common"),y=Vf(),[g,b]=N.useState(!1),[v,_]=N.useState(!1),[C,S]=N.useState(null),[x,A]=N.useState(null),[I,$]=N.useState(!1),[O,P]=N.useState(!1),[j,U]=N.useState(!1),z=N.useRef(null),D=N.useRef(null),R=N.useRef(null),W=p.language||"en",T=async te=>{P(!1),_(!1),localStorage.setItem("tritonix_lang",te);const ie=u.pathname.split("/").filter(Boolean),Ce=(ie.length>0&&Va.includes(ie[0])?"/"+ie.slice(1).join("/"):u.pathname)||"/",xe=te==="en"?Ce+u.search:`/${te}${Ce}`+u.search;try{await p.changeLanguage(te)}catch(Te){console.error(`Failed to switch language to "${te}":`,Te)}l(xe,{replace:!1})};N.useEffect(()=>{const te=ie=>{R.current&&!R.current.contains(ie.target)&&P(!1)};return O&&document.addEventListener("mousedown",te),()=>document.removeEventListener("mousedown",te)},[O]),N.useEffect(()=>{const te=ie=>{D.current&&!D.current.contains(ie.target)&&$(!1)};return I&&document.addEventListener("mousedown",te),()=>document.removeEventListener("mousedown",te)},[I]);const L=async()=>{$(!1),await a(),l("/")},M=cX(o,(X=s==null?void 0:s.email)==null?void 0:X.split("@")[0]),Z=uX(o)||void 0,H=(M||(s==null?void 0:s.email)||"U").charAt(0).toUpperCase();N.useEffect(()=>{const te=()=>document.getElementById("main-scroll"),ie=()=>{const Ce=te();b(((Ce==null?void 0:Ce.scrollTop)??window.scrollY)>20)},pe=te()??window;return pe.addEventListener("scroll",ie),()=>pe.removeEventListener("scroll",ie)},[]),N.useEffect(()=>(document.body.style.overflow=v?"hidden":"unset",()=>{document.body.style.overflow="unset"}),[v]),N.useEffect(()=>{const te=ie=>{(ie.metaKey||ie.ctrlKey)&&ie.key.toLowerCase()==="k"&&(ie.preventDefault(),U(!0))};return window.addEventListener("keydown",te),()=>window.removeEventListener("keydown",te)},[]);const V=(te,ie)=>{tX(String(te),"topnav"),e(te),_(!1),S(null),setTimeout(()=>{window.scrollTo({top:0,behavior:"smooth"})},100)},F=te=>{z.current&&clearTimeout(z.current),S(te)},q=()=>{z.current=setTimeout(()=>S(null),180)},G=te=>{A(x===te?null:te)},Y=!i||g||!!C||v;return h.jsxs("nav",{className:`fixed top-0 right-0 z-50 transition-all duration-300 ${v?"bg-white border-b border-gray-200":Y?"bg-white border-b border-gray-200 shadow-[0_2px_12px_rgba(0,0,0,0.08)]":"bg-transparent border-transparent"} py-2.5 md:py-3.5`,style:{left:r},children:[j?h.jsx(N.Suspense,{fallback:null,children:h.jsx(C6e,{open:j,onClose:()=>U(!1)})}):null,h.jsxs("div",{className:"container mx-auto px-4 md:px-6 flex items-center justify-between",children:[h.jsxs("button",{className:"flex items-center gap-3 relative z-50",onClick:()=>V("home"),children:[h.jsx("div",{className:"w-8 h-8 rounded-full bg-black flex items-center justify-center shrink-0",children:h.jsx("img",{src:"/favicon.png",alt:"Tritonix",className:"w-5 h-5 object-contain"})}),h.jsxs("span",{className:`text-[18px] font-bold tracking-tight hidden md:block transition-colors duration-300 ${Y?"text-gray-900":"text-white"}`,children:["Tritonix",h.jsx("span",{className:"opacity-60",children:".ai"})]})]}),h.jsxs("div",{className:"hidden md:flex items-center gap-0.5",children:[h.jsxs("button",{type:"button",onClick:()=>U(!0),className:`mr-3 inline-flex h-9 w-44 items-center gap-2 rounded-full border px-3 text-left text-xs transition-all duration-200 ${Y?"border-gray-200 bg-gray-50 text-gray-500 hover:border-gray-300 hover:bg-white hover:text-gray-900 hover:shadow-sm":"border-white/15 bg-white/10 text-gray-300 hover:border-white/30 hover:bg-white/15 hover:text-white"}`,"aria-label":"Search public symbols",children:[h.jsx(FU,{className:"h-4 w-4 shrink-0"}),h.jsx("span",{className:"flex-1 truncate",children:"Search symbols"}),h.jsx("kbd",{className:`hidden rounded px-1.5 py-0.5 text-[10px] font-medium lg:inline ${Y?"bg-white text-gray-400":"bg-white/10 text-gray-400"}`,children:"Ctrl K"})]}),h.jsxs("div",{className:"relative",onMouseEnter:()=>F("product"),onMouseLeave:q,children:[h.jsxs("button",{className:`flex items-center gap-1 px-4 py-2 text-sm font-medium rounded-lg transition-colors duration-200 ${C==="product"?Y?"text-gray-900 bg-gray-100":"text-white bg-white/10":Y?"text-gray-600 hover:text-gray-900 hover:bg-gray-100":"text-gray-300 hover:text-white hover:bg-white/10"}`,children:[f("nav.product"),h.jsx(Sh,{className:`w-3.5 h-3.5 transition-transform duration-200 ${C==="product"?"rotate-180":""}`})]}),C==="product"&&h.jsxs("div",{className:"absolute top-full left-1/2 mt-3 bg-white border border-gray-100 rounded-2xl shadow-2xl shadow-gray-200/60 p-5 w-[560px] origin-top animate-fade-in",style:{transform:"translateX(-42%)"},onMouseEnter:()=>F("product"),onMouseLeave:q,children:[h.jsx("div",{className:"absolute -top-1.5 left-[42%] translate-x-1 w-3 h-3 bg-white border-t border-l border-gray-100 rotate-45 z-10"}),h.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsxs("button",{onClick:()=>{S(null),l(`${y}/copy-trade`)},className:"flex w-full items-start gap-3 p-3.5 rounded-xl hover:bg-emerald-50/70 text-left transition-colors group border border-transparent hover:border-emerald-100",children:[h.jsx("div",{className:"w-9 h-9 rounded-xl bg-emerald-50 border border-emerald-100 flex items-center justify-center shrink-0",children:h.jsx(o8,{className:"w-[18px] h-[18px] text-emerald-600"})}),h.jsxs("div",{children:[h.jsx("div",{className:"font-semibold text-gray-900 text-[13px] leading-snug mb-1",children:f("product.copyTrade.name",{defaultValue:"Copy Trade"})}),h.jsx("div",{className:"text-[11px] text-gray-400 leading-relaxed",children:f("product.copyTrade.desc",{defaultValue:"Review strategies, compare allocations, and track rebalance updates."})})]})]}),h.jsxs("button",{onClick:()=>{S(null),l(`${y}/ai-investment-agent`)},className:"flex w-full items-start gap-3 p-3.5 rounded-xl hover:bg-indigo-50/70 text-left transition-colors group border border-transparent hover:border-indigo-100",children:[h.jsx("div",{className:"w-9 h-9 rounded-xl bg-indigo-50 border border-indigo-100 flex items-center justify-center shrink-0",children:h.jsx(a8,{className:"w-[18px] h-[18px] text-indigo-600"})}),h.jsxs("div",{children:[h.jsx("div",{className:"font-semibold text-gray-900 text-[13px] leading-snug mb-1",children:f("product.aiAgent.name")}),h.jsx("div",{className:"text-[11px] text-gray-400 leading-relaxed",children:f("product.aiAgent.desc")})]})]}),h.jsxs("button",{onClick:()=>{l(`${y}/ai-consensus-pick`),S(null)},className:"flex w-full items-start gap-3 p-3.5 rounded-xl hover:bg-indigo-50/70 text-left transition-colors group border border-transparent hover:border-indigo-100 relative overflow-hidden",children:[h.jsx("div",{className:"w-9 h-9 rounded-xl bg-gradient-to-br from-indigo-500 to-purple-600 flex items-center justify-center shrink-0",children:h.jsx(n3,{className:"w-[18px] h-[18px] text-white"})}),h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center gap-1.5 mb-1 flex-wrap",children:[h.jsx("span",{className:"font-semibold text-gray-900 text-[13px] leading-snug",children:f("product.consensus.name")}
446),h.jsx("span",{className:"text-[9px] font-bold bg-indigo-600 text-white px-1.5 py-0.5 rounded-full leading-none",children:f("product.consensus.badge")})]}),h.jsx("div",{className:"text-[11px] text-gray-400 leading-relaxed",children:f("product.consensus.desc")})]})]}),h.jsxs("button",{onClick:()=>{l(`${y}/ai-social-agent`),S(null)},className:"flex w-full items-start gap-3 p-3.5 rounded-xl hover:bg-sky-50/70 text-left transition-colors group border border-transparent hover:border-sky-100",children:[h.jsx("div",{className:"w-9 h-9 rounded-xl bg-sky-50 border border-sky-100 flex items-center justify-center shrink-0",children:h.jsx(QA,{className:"w-[18px] h-[18px] text-sky-600"})}),h.jsxs("div",{children:[h.jsx("div",{className:"font-semibold text-gray-900 text-[13px] leading-snug mb-1",children:f("product.socialAgent.name")}),h.jsx("div",{className:"text-[11px] text-gray-400 leading-relaxed",children:f("product.socialAgent.desc")})]})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs("button",{onClick:()=>{S(null),l(`${y}/swing-trade-bot`)},className:"flex w-full items-start gap-3 p-3.5 rounded-xl hover:bg-cyan-50/70 text-left transition-colors group border border-transparent hover:border-cyan-100",children:[h.jsx("div",{className:"w-9 h-9 rounded-xl bg-cyan-50 border border-cyan-100 flex items-center justify-center shrink-0",children:h.jsx(t3,{className:"w-[18px] h-[18px] text-cyan-600"})}),h.jsxs("div",{children:[h.jsx("div",{className:"font-semibold text-gray-900 text-[13px] leading-snug mb-1",children:f("product.swingTradeBot.name",{defaultValue:"Swing Trade Bot"})}),h.jsx("div",{className:"text-[11px] text-gray-400 leading-relaxed",children:f("product.swingTradeBot.desc",{defaultValue:"Confidence-ranked swing setups with backtest context."})})]})]}),h.jsxs("button",{onClick:()=>{S(null),l(`${y}/day-trade-bot`)},className:"flex w-full items-start gap-3 p-3.5 rounded-xl hover:bg-sky-50/70 text-left transition-colors group border border-transparent hover:border-sky-100",children:[h.jsx("div",{className:"w-9 h-9 rounded-xl bg-sky-50 border border-sky-100 flex items-center justify-center shrink-0",children:h.jsx(bu,{className:"w-[18px] h-[18px] text-sky-600"})}),h.jsxs("div",{children:[h.jsx("div",{className:"font-semibold text-gray-900 text-[13px] leading-snug mb-1",children:f("product.dayTradeBot.name",{defaultValue:"Day Trade Bot"})}),h.jsx("div",{className:"text-[11px] text-gray-400 leading-relaxed",children:f("product.dayTradeBot.desc",{defaultValue:"Two AI research books for short-term setups."})})]})]}),h.jsxs("button",{onClick:()=>{l(`${y}/ai-technical-analysis`),S(null)},className:"flex w-full items-start gap-3 p-3.5 rounded-xl hover:bg-rose-50/70 text-left transition-colors group border border-transparent hover:border-rose-100",children:[h.jsx("div",{className:"w-9 h-9 rounded-xl bg-rose-50 border border-rose-100 flex items-center justify-center shrink-0",children:h.jsx(n1,{className:"w-[18px] h-[18px] text-rose-600"})}),h.jsxs("div",{children:[h.jsx("div",{className:"font-semibold text-gray-900 text-[13px] leading-snug mb-1",children:f("product.technicalAnalysis.name",{defaultValue:"AI Technical Analysis"})}),h.jsx("div",{className:"text-[11px] text-gray-400 leading-relaxed",children:f("product.technicalAnalysis.desc",{defaultValue:"AI chart markup, key levels, and trade-ready setups."})})]})]}),h.jsxs("button",{onClick:()=>{l(`${y}/institution-smart-money`),S(null)},className:"flex w-full items-start gap-3 p-3.5 rounded-xl hover:bg-amber-50/70 text-left transition-colors group border border-transparent hover:border-amber-100",children:[h.jsx("div",{className:"w-9 h-9 rounded-xl bg-amber-50 border border-amber-100 flex items-center justify-center shrink-0",children:h.jsx(A0,{className:"w-[18px] h-[18px] text-amber-600"})}),h.jsxs("div",{children:[h.jsx("div",{className:"font-semibold text-gray-900 text-[13px] leading-snug mb-1",children:f("product.smartMoney.name")}),h.jsx("div",{className:"text-[11px] text-gray-400 leading-relaxed",children:f("product.smartMoney.desc")})]})]})]})]}),h.jsxs("div",{className:"mt-4 pt-3.5 border-t border-gray-100 flex items-center justify-between",children:[h.jsx("span",{className:"text-[11px] text-gray-400",children:f("product.footerNote")}),h.jsxs("button",{onClick:()=>{S(null),ig("navbar_product_menu","try_free"),n("signup")},className:"flex items-center gap-1 text-[11px] font-semibold text-indigo-600 hover:text-indigo-800 transition-colors",children:[f("product.tryFree")," ",h.jsx(yf,{className:"w-3 h-3"})]})]})]})]}),h.jsxs("div",{className:"relative",onMouseEnter:()=>F("resources"),onMouseLeave:q,children:[h.jsxs("button",{className:`flex items-center gap-1 px-4 py-2 text-sm font-medium rounded-lg transition-colors duration-200 ${C==="resources"?Y?"text-gray-900 bg-gray-100":"text-white bg-white/10":Y?"text-gray-600 hover:text-gray-900 hover:bg-gray-100":"text-gray-300 hover:text-white hover:bg-white/10"}`,children:[f("nav.resources"),h.jsx(Sh,{className:`w-3.5 h-3.5 transition-transform duration-200 ${C==="resources"?"rotate-180":""}`})]}),C==="resources"&&h.jsxs("div",{className:"absolute top-full left-0 mt-3 bg-white border border-gray-100 rounded-xl shadow-2xl shadow-gray-200/60 p-2 w-60 origin-top-left animate-fade-in",onMouseEnter:()=>F("resources"),onMouseLeave:q,children:[h.jsx("div",{className:"absolute -top-1.5 left-7 w-3 h-3 bg-white border-t border-l border-gray-100 rotate-45 z-10"}),h.jsxs("div",{className:"space-y-0.5",children:[h.jsxs("button",{onClick:()=>V("blog"),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-lg hover:bg-gray-50 transition-colors text-left group",children:[h.jsx(OU,{className:"w-4 h-4 text-gray-400 shrink-0 group-hover:text-gray-700 transition-colors"}),h.jsxs("div",{children:[h.jsx("div",{className:"text-[13px] font-medium text-gray-800",children:f("resources.blog")}),h.jsx("div",{className:"text-[11px] text-gray-400 leading-tight",children:f("resources.blogDesc")})]})]}),h.jsxs("button",{onClick:()=>
446V("press"),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-lg hover:bg-gray-50 transition-colors text-left group",children:[h.jsx(XA,{className:"w-4 h-4 text-gray-400 shrink-0 group-hover:text-gray-700 transition-colors"}),h.jsxs("div",{children:[h.jsx("div",{className:"text-[13px] font-medium text-gray-800",children:f("resources.pressRoom",{defaultValue:"Press Room"})}),h.jsx("div",{className:"text-[11px] text-gray-400 leading-tight",children:f("resources.pressRoomDesc",{defaultValue:"Official updates"})})]})]}),h.jsxs("button",{onClick:()=>V("help"),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-lg hover:bg-gray-50 transition-colors text-left group",children:[h.jsx(bu,{className:"w-4 h-4 text-gray-400 shrink-0 group-hover:text-gray-700 transition-colors"}),h.jsxs("div",{children:[h.jsx("div",{className:"text-[13px] font-medium text-gray-800",children:f("resources.helpCenter")}),h.jsx("div",{className:"text-[11px] text-gray-400 leading-tight",children:f("resources.helpDesc")})]})]}),h.jsxs("button",{onClick:()=>V("market-data"),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-lg hover:bg-gray-50 transition-colors text-left group",children:[h.jsx(jU,{className:"w-4 h-4 text-gray-400 shrink-0 group-hover:text-gray-700 transition-colors"}),h.jsxs("div",{children:[h.jsx("div",{className:"text-[13px] font-medium text-gray-800",children:f("resources.marketData")}),h.jsx("div",{className:"text-[11px] text-gray-400 leading-tight",children:f("resources.marketDataDesc")})]})]}),h.jsxs("button",{onClick:()=>V("for-business"),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-lg hover:bg-gray-50 transition-colors text-left group",children:[h.jsx(A0,{className:"w-4 h-4 text-gray-400 shrink-0 group-hover:text-gray-700 transition-colors"}),h.jsxs("div",{children:[h.jsx("div",{className:"text-[13px] font-medium text-gray-800",children:f("resources.forBusiness",{defaultValue:"For business"})}),h.jsx("div",{className:"text-[11px] text-gray-400 leading-tight",children:f("resources.forBusinessDesc",{defaultValue:"Tritonix Agent API"})})]})]}),h.jsxs("button",{onClick:()=>V("about"),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-lg hover:bg-gray-50 transition-colors text-left group",children:[h.jsx(VU,{className:"w-4 h-4 text-gray-400 shrink-0 group-hover:text-gray-700 transition-colors"}),h.jsxs("div",{children:[h.jsx("div",{className:"text-[13px] font-medium text-gray-800",children:f("resources.about")}),h.jsx("div",{className:"text-[11px] text-gray-400 leading-tight",children:f("resources.aboutDesc")})]})]})]})]})]}),h.jsx("button",{onClick:()=>V("ideas"),className:`px-4 py-2 text-sm font-medium rounded-lg transition-colors duration-200 ${t==="ideas"?Y?"text-gray-900 bg-gray-100":"text-white bg-white/10":Y?"text-gray-600 hover:text-gray-900 hover:bg-gray-100":"text-gray-300 hover:text-white hover:bg-white/10"}`,children:f("nav.ideas",{defaultValue:"Ideas"})}),h.jsx("button",{onClick:()=>V("pricing"),className:`px-4 py-2 text-sm font-medium rounded-lg transition-colors duration-200 ${t==="pricing"?Y?"text-gray-900 bg-gray-100":"text-white bg-white/10":Y?"text-gray-600 hover:text-gray-900 hover:bg-gray-100":"text-gray-300 hover:text-white hover:bg-white/10"}`,children:f("nav.pricing")})]}),h.jsxs("div",{className:"hidden md:flex items-center gap-2",children:[s?h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsxs("div",{className:"relative flex items-center",ref:D,children:[h.jsx("button",{onClick:()=>$(!I),className:"w-9 h-9 rounded-full overflow-hidden border-2 border-transparent hover:border-gray-300 transition-all focus:outline-none focus:border-brand-400 flex items-center justify-center",children:Z?h.jsx("img",{src:Z,alt:"avatar",className:"w-full h-full object-cover"}):h.jsx("div",{className:"w-full h-full bg-gradient-to-br from-brand-500 to-indigo-600 flex items-center justify-center text-white text-xs font-bold",children:H})}),I&&h.jsxs("div",{className:"absolute top-full right-0 mt-2.5 w-56 bg-white border border-gray-100 rounded-2xl shadow-2xl shadow-gray-200/60 overflow-hidden animate-fade-in z-50",children:[h.jsx("div",{className:"px-4 py-3.5 border-b border-gray-100",children:h.jsxs("div",{className:"flex items-center gap-2.5",children:[h.jsx("div",{className:"w-8 h-8 rounded-full overflow-hidden shrink-0",children:Z?h.jsx("img",{src:Z,alt:"avatar",className:"w-full h-full object-cover"}):h.jsx("div",{className:"w-full h-full bg-gradient-to-br from-brand-500 to-indigo-600 flex items-center justify-center text-white text-xs font-bold",children:H})}),h.jsxs("div",{className:"min-w-0",children:[M&&h.jsx("div",{className:"text-[13px] font-semibold text-gray-900 truncate",children:M}),h.jsx("div",{className:"text-[11px] text-gray-400 truncate",children:s==null?void 0:s.email})]})]})}),h.jsxs("div",{className:"p-1.5 space-y-0.5",children:[h.jsxs(na,{to:"/studio",onClick:()=>$(!1),className:"flex items-center gap-2.5 px-3 py-2 rounded-lg hover:bg-gray-50 transition-colors text-sm text-gray-700 font-medium",children:[h.jsx(CJ,{className:"w-4 h-4 text-gray-400"}),f("nav.openTritonix")]}),h.jsxs(na,{to:"/settings",onClick:()=>$(!1),className:"flex items-center gap-2.5 px-3 py-2 rounded-lg hover:bg-gray-50 transition-colors text-sm text-gray-700",children:[h.jsx(kJ,{className:"w-4 h-4 text-gray-400"}),f("nav.accountSettings")]}),h.jsxs(na,{to:"/settings?tab=feedback",onClick:()=>$(!1),className:"flex items-center gap-2.5 px-3 py-2 rounded-lg hover:bg-gray-50 transition-colors text-sm text-gray-700",children:[h.jsx(SJ,{className:"w-4 h-4 text-gray-400"}),f("nav.support")]})]}),h.jsx("div",{className:"p-1.5 border-t border-gray-100",children:h.jsxs("button",{onClick:L,className:"flex items-center gap-2.5 w-full px-3 py-2 rounded-lg hover:bg-red-50 transition-colors text-sm text-red-500",children:[h.jsx(AJ,{className:"w-4 h-4"}),f("nav.signOut")]})})]})]}),h.jsx(na,{to:"/studio",className:`px-5 py-2 text-sm font-semibold rounded-full transition-all duration-200 ${Y?"bg-black text-white hover:bg-gray-800":"bg-white text-gray-900 hover:bg-gray-100"}`,children:f("nav.openTritonix")})]}):h.jsxs(h.Fragment,{children:[h.jsx("button",{onClick:()=>{ig("navbar","login"),n("signin")},className:`inline-flex h-10 w-10 items-center justify-center rounded-full transition-colors duration-200 ${Y?"text-gray-600 hover:bg-gray-100 hover:text-gray-900":"text-gray-300 hover:bg-white/10 hover:text-white"}`,"aria-label":f("nav.login"),title:f("nav.login"),children:h.jsx(TJ,{className:"h-6 w-6"})}),h.jsx("button",{onClick:()=>{ig("navbar","start_free_trial"),n("signup")},className:`px-5 py-2 text-sm font-semibold rounded-full transition-all duration-200 ${Y?"bg-black text-white hover:bg-gray-800 active:scale-95":"bg-white text-gray-900 hover:bg-gray-100 active:scale-95"}`,children:f("nav.startFreeTrial")})]}),h.jsxs("div",{className:"relative",ref:R,children:[h.jsxs("button",{onClick:()=>P(!O),className:`flex items-center gap-1 px-2.5 py-2 text-sm font-medium rounded-lg transition-colors duration-200 ${Y?"text-gray-500 hover:text-gray-900 hover:bg-gray-100":"text-gray-400 hover:text-white hover:bg-white/10"}`,"aria-label":"Switch language",children:[h.jsx(JA,{className:"w-4 h-4"}),h.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide",children:W}),h.jsx(Sh,{className:`w-3 h-3 transition-transform duration-200 ${O?"rotate-180":""}`})]}),O&&h.jsx("div",{className:"absolute top-full right-0 mt-2 bg-white border border-gray-100 rounded-xl shadow-2xl shadow-gray-200/60 py-1.5 w-44 z-50 animate-fade-in",children:PB.map(te=>h.jsxs("button",{onClick:()=>T(te),className:`w-full flex items-center justify-between px-4 py-2.5 text-sm transition-colors hover:bg-gray-50 ${W===te?"text-indigo-600 font-semibold bg-indigo-50/50":"text-gray-700"}`,children:[h.jsx("span",{children:gC[te]}),W===te&&h.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-indigo-500 shrink-0"})]},te))})]})]}),h.jsxs("div",{className:"md:hidden relative z-50 flex items-center gap-2.5",children:[h.jsx("button",{type:"button",onClick:()=>U(!0),className:`p-1 transition-colors duration-200 ${Y||v?"text-gray-800":"text-white"}`,"aria-label":"Search public symbols",children:h.jsx(FU,{className:"h-5 w-5"})}),s?h.jsx(na,{to:"/studio",className:`text-xs font-bold px-4 py-2.5 rounded-full transition-all duration-200 ${Y||v?"bg-black text-white hover:bg-gray-800":"bg-white text-gray-900 hover:bg-gray-100"}`,children:f("nav.openTritonix")}):h.jsx("button",{onClick:()=>{ig("navbar_mobile","free_trial"),n("signup")},className:`text-xs font-bold px-4 py-2.5 rounded-full transition-all duration-200 ${Y||v?"bg-black text-white hover:bg-gray-800":"bg-white text-gray-900 hover:bg-gray-100"}`,children:f("nav.startFree",{defaultValue:"Start Free"})}),h.jsx("button",{onClick:()=>_(!v),className:`p-1 transition-colors duration-200 ${Y||v?"text-gray-800":"text-white"}`,"aria-label":"Toggle menu",children:v?h.jsx(ml,{className:"w-5 h-5"}):h.jsx(Q1e,{className:"w-5 h-5"})})]})]}),v&&h.jsx("div",{className:"absolute top-full left-0 right-0 h-[calc(100vh-56px)] bg-white md:hidden flex flex-col overflow-y-auto overscroll-contain border-t border-gray-100 pb-20",children:h.jsxs("div",{className:"p-5 space-y-1",children:[h.jsxs("div",{children:[h.jsxs("button",{onClick:()=>G("product"),className:"flex items-center justify-between w-full py-3 text-base font-semibold text-gray-900 border-b border-gray-100",children:[f("nav.product"),h.jsx(Sh,{className:`w-4 h-4 text-gray-400 transition-transform ${x==="product"?"rotate-180":""}`})]}),x==="product"&&h.jsxs("div",{className:"py-2 space-y-1",children:[h.jsxs("button",{onClick:()=>{_(!1),l(`${y}/copy-trade`)},className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-xl hover:bg-gray-50 text-left",children:[h.jsx("div",{className:"w-8 h-8 rounded-xl bg-emerald-50 border border-emerald-100 flex items-center justify-center shrink-0",children:h.jsx(o8,{className:"w-4 h-4 text-emerald-600"})}),h.jsxs("div",{children:[h.jsx("div",{className:"text-sm font-medium text-gray-900",children:f("product.copyTrade.name",{defaultValue:"Copy Trade"})}),h.jsx("div",{className:"text-xs text-gray-400",children:f("product.copyTrade.sub",{defaultValue:"Preview · research · tracker visibility"})})]})]}),h.jsxs("button",{onClick:()=>{_(!1),l(`${y}/swing-trade-bot`)},className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-xl hover:bg-gray-50 text-left",children:[h.jsx("div",{className:"w-8 h-8 rounded-xl bg-cyan-50 border border-cyan-100 flex items-center justify-center shrink-0",children:h.jsx(t3,{className:"w-4 h-4 text-cyan-600"})}),h.jsxs("div",{children:[h.jsx("div",{className:"text-sm font-medium text-gray-900",children:f("product.swingTradeBot.name",{defaultValue:"Swing Trade Bot"})}),h.jsx("div",{className:"text-xs text-gray-400",children:f("product.swingTradeBot.sub",{defaultValue:"Backtest · research · independent review"})})]})]}),h.jsxs("button",{onClick:()=>{_(!1),l(`${y}/day-trade-bot`)},className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-xl hover:bg-gray-50 text-left",children:[h.jsx("div",{className:"w-8 h-8 rounded-xl bg-sky-50 border border-sky-100 flex items-center justify-center shrink-0",children:h.jsx(bu,{className:"w-4 h-4 text-sky-600"})}),h.jsxs("div",{children:[h.jsx("div",{className:"text-sm font-medium text-gray-900",children:f("product.dayTradeBot.name",{defaultValue:"Day Trade Bot"})}),h.jsx("div",{className:"text-xs text-gray-400",children:f("product.dayTradeBot.sub",{defaultValue:"Terra · Sol · research preview"})})]})]}),h.jsxs("button",{onClick:()=>{_(!1),l(`${y}/ai-investment-agent`)},className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-xl hover:bg-gray-50 text-left",children:[h.jsx("div",{className:"w-8 h-8 rounded-xl bg-indigo-50 border border-indigo-100 flex items-center justify-center shrink-0",children:h.jsx(a8,{className:"w-4 h-4 text-indigo-600"})}),h.jsxs("div",{children:[h.jsx("div",{className:"text-sm font-medium text-gray-900",children:f("product.aiAgent.name")}),h.jsx("div",{className:"text-xs text-gray-400",children:f("product.aiAgent.sub")})]})]}),h.jsxs("button",{onClick:()=>{l(`${y}/ai-technical-analysis`),_(!1)},className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-xl hover:bg-gray-50 text-left",children:[h.jsx("div",{className:"w-8 h-8 rounded-xl bg-rose-50 border border-rose-100 flex items-center justify-center shrink-0",children:h.jsx(n1,{className:"w-4 h-4 text-rose-600"})}),h.jsxs("div",{children:[h.jsx("div",{className:"text-sm font-medium text-gray-900",children:f("product.technicalAnalysis.fullName",{defaultValue:"AI Technical Analysis"})}),h.jsx("div",{className:"text-xs text-gray-400",children:f("product.technicalAnalysis.sub",{defaultValue:"Chart markup · key levels · setups"})})]})]}),h.jsxs("button",{onClick:()=>{l(`${y}/ai-consensus-pick`),_(!1)},className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-xl hover:bg-gray-50 text-left",children:[h.jsx("div",{className:"w-8 h-8 rounded-xl bg-gradient-to-br from-indigo-500 to-purple-600 flex items-center justify-center shrink-0",children:h.jsx(n3,{className:"w-4 h-4 text-white"})}),h.jsxs("div",{children:[h.jsx("div",{className:"text-sm font-medium text-gray-900",children:f("product.consensus.fullName")}
446),h.jsx("div",{className:"text-xs text-gray-400",children:f("product.consensus.sub")})]})]}),h.jsxs("button",{onClick:()=>{l(`${y}/institution-smart-money`),_(!1)},className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-xl hover:bg-gray-50 text-left",children:[h.jsx("div",{className:"w-8 h-8 rounded-xl bg-amber-50 border border-amber-100 flex items-center justify-center shrink-0",children:h.jsx(A0,{className:"w-4 h-4 text-amber-600"})}),h.jsxs("div",{children:[h.jsx("div",{className:"text-sm font-medium text-gray-900",children:f("product.smartMoney.fullName")}),h.jsx("div",{className:"text-xs text-gray-400",children:f("product.smartMoney.sub")})]})]}),h.jsxs("button",{onClick:()=>{l(`${y}/ai-social-agent`),_(!1)},className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-xl hover:bg-gray-50 text-left",children:[h.jsx("div",{className:"w-8 h-8 rounded-xl bg-sky-50 border border-sky-100 flex items-center justify-center shrink-0",children:h.jsx(QA,{className:"w-4 h-4 text-sky-600"})}),h.jsxs("div",{children:[h.jsx("div",{className:"text-sm font-medium text-gray-900",children:f("product.socialAgent.fullName")}),h.jsx("div",{className:"text-xs text-gray-400",children:f("product.socialAgent.sub")})]})]})]})]}),h.jsxs("div",{children:[h.jsxs("button",{onClick:()=>G("resources"),className:"flex items-center justify-between w-full py-3 text-base font-semibold text-gray-900 border-b border-gray-100",children:[f("nav.resources"),h.jsx(Sh,{className:`w-4 h-4 text-gray-400 transition-transform ${x==="resources"?"rotate-180":""}`})]}),x==="resources"&&h.jsxs("div",{className:"py-2 space-y-1",children:[h.jsxs("button",{onClick:()=>V("blog"),className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-xl hover:bg-gray-50 text-left",children:[h.jsx(OU,{className:"w-4 h-4 text-gray-400 shrink-0"}),h.jsx("span",{className:"text-sm font-medium text-gray-800",children:f("resources.blog")})]}),h.jsxs("button",{onClick:()=>V("press"),className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-xl hover:bg-gray-50 text-left",children:[h.jsx(XA,{className:"w-4 h-4 text-gray-400 shrink-0"}),h.jsx("span",{className:"text-sm font-medium text-gray-800",children:f("resources.pressRoom",{defaultValue:"Press Room"})})]}),h.jsxs("button",{onClick:()=>V("help"),className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-xl hover:bg-gray-50 text-left",children:[h.jsx(bu,{className:"w-4 h-4 text-gray-400 shrink-0"}),h.jsx("span",{className:"text-sm font-medium text-gray-800",children:f("resources.helpCenter")})]}),h.jsxs("button",{onClick:()=>V("market-data"),className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-xl hover:bg-gray-50 text-left",children:[h.jsx(jU,{className:"w-4 h-4 text-gray-400 shrink-0"}),h.jsx("span",{className:"text-sm font-medium text-gray-800",children:f("resources.marketData")})]}),h.jsxs("button",{onClick:()=>V("for-business"),className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-xl hover:bg-gray-50 text-left",children:[h.jsx(A0,{className:"w-4 h-4 text-gray-400 shrink-0"}),h.jsx("span",{className:"text-sm font-medium text-gray-800",children:f("resources.forBusiness",{defaultValue:"For business"})})]}),h.jsxs("button",{onClick:()=>V("about"),className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-xl hover:bg-gray-50 text-left",children:[h.jsx(VU,{className:"w-4 h-4 text-gray-400 shrink-0"}),h.jsx("span",{className:"text-sm font-medium text-gray-800",children:f("resources.about")})]})]})]}),h.jsx("button",{onClick:()=>V("ideas"),className:"flex items-center justify-between w-full py-3 text-base font-semibold text-gray-900 border-b border-gray-100",children:f("nav.ideas",{defaultValue:"Ideas"})}),h.jsx("button",{onClick:()=>V("pricing"),className:"flex items-center justify-between w-full py-3 text-base font-semibold text-gray-900 border-b border-gray-100",children:f("nav.pricing")}),h.jsxs("div",{children:[h.jsxs("button",{onClick:()=>A(x==="language"?null:"language"),className:"flex items-center justify-between w-full py-3 text-base font-semibold text-gray-900 border-b border-gray-100",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(JA,{className:"w-4 h-4 text-gray-400"}),h.jsx("span",{children:gC[W]})]}),h.jsx(Sh,{className:`w-4 h-4 text-gray-400 transition-transform ${x==="language"?"rotate-180":""}`})]}),x==="language"&&h.jsx("div",{className:"py-2 grid grid-cols-2 gap-1",children:PB.map(te=>h.jsx("button",{onClick:()=>T(te),className:`flex items-center gap-2 px-3 py-2.5 rounded-xl text-left transition-colors ${W===te?"bg-indigo-50 text-indigo-700 font-semibold":"hover:bg-gray-50 text-gray-700"}`,children:h.jsx("span",{className:"text-sm",children:gC[te]})},te))})]}),s?h.jsxs("div",{className:"pt-5 flex flex-col gap-3",children:[h.jsx("button",{onClick:()=>V("settings"),className:"w-full py-3.5 border border-gray-200 text-gray-700 font-medium rounded-full text-sm hover:bg-gray-50 transition-colors",children:f("nav.accountSettings")}),h.jsx(na,{to:"/studio",onClick:()=>_(!1),className:"w-full py-3.5 bg-black text-white font-semibold rounded-full text-sm text-center",children:f("nav.openTritonix")})]}):h.jsxs("div",{className:"pt-5 flex flex-col gap-3",children:[h.jsx("button",{onClick:()=>{_(!1),n("signup")},className:"w-full py-3.5 bg-black text-white font-semibold rounded-full text-sm",children:f("nav.startFreeTrial")}),h.jsx("button",{onClick:()=>{_(!1),n("signin")},className:"w-full py-3.5 border border-gray-200 text-gray-700 font-medium rounded-full text-sm hover:bg-gray-50 transition-colors",children:f("nav.login")})]})]})})]})},S6e=({lightSurface:t=!0})=>{const{t:e}=sr("common");return h.jsxs("div",{className:"relative",children:[h.jsxs("div",{className:`relative h-24 pointer-events-none overflow-hidden ${t?"bg-white":"bg-[#030306]"}`,children:[h.jsx("div",{className:"absolute inset-x-0 bottom-0 h-20",style:{background:"radial-gradient(ellipse 55% 100% at 50% 100%, rgba(99,102,241,0.18) 0%, transparent 70%)"}}),h.jsx("svg",{viewBox:"0 0 1440 96",preserveAspectRatio:"none",xmlns:"http://www.w3.org/2000/svg",className:"absolute bottom-0 left-0 w-full h-full",children:h.jsx("path",{d:"M0,96 L0,62 C180,30 360,44 540,52 C720,60 900,28 1080,42 C1260,56 1380,48 1440,58 L1440,96 Z",fill:"#0c0c12"})})]}),h.jsxs("footer",{className:"relative bg-[#0c0c12] overflow-hidden",children:[h.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{background:"radial-gradient(ellipse 70% 50% at 50% 30%, rgba(99,102,241,0.07) 0%, transparent 70%)"}}),h.jsx("div",{"aria-hidden":"true",className:"absolute inset-x-0 top-0 flex items-start justify-center pointer-events-none select-none overflow-hidden",children:h.jsx("span",{className:"font-black tracking-[0.2em] text-white leading-none whitespace-nowrap",style:{fontSize:"clamp(28px, 11vw, 200px)",opacity:.028,marginTop:"-0.05em"},children:"TRITONIX"})}),h.jsx("div",{className:"relative container mx-auto px-6 md:px-8 pt-16 pb-12",children:h.jsxs("div",{className:"grid grid-cols-1 items-start gap-10 md:grid-cols-2 md:gap-8 xl:grid-cols-[1.45fr_1fr_1fr_1fr_1fr_1fr]",children:[h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center gap-2.5 mb-5",children:[h.jsx("img",{src:"/logo.png",alt:"Tritonix.ai logo",className:"w-8 h-8 rounded object-contain"}),h.jsx("span",{className:"text-lg font-bold tracking-tight text-white",children:"Tritonix.ai"})]}),h.jsx("p",{className:"text-[#6b6b7e] text-sm leading-relaxed max-w-xs mb-8",children:e("footer.tagline")}),h.jsxs("div",{className:"flex gap-3",children:[h.jsx("a",{href:"https://x.com/tritonix_ai","aria-label":"X (Twitter)",className:"w-9 h-9 rounded-full border border-white/10 flex items-center justify-center text-[#6b6b7e] hover:text-white hover:border-white/30 transition-all duration-200",children:h.jsx("svg",{viewBox:"0 0 24 24",className:"w-4 h-4 fill-current",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-4.714-6.231-5.401 6.23
4461H2.748l7.73-8.835L1.254 2.25H8.08l4.253 5.622 5.911-5.622zm-1.161 17.52h1.833L7.084 4.126H5.117z"})})}),h.jsx("a",{href:"https://discord.gg/Fq7c7G38Tq","aria-label":"Discord",target:"_blank",rel:"noopener noreferrer",className:"w-9 h-9 rounded-full border border-white/10 flex items-center justify-center text-[#6b6b7e] hover:text-white hover:border-white/30 transition-all duration-200",children:h.jsx("svg",{viewBox:"0 0 24 24",className:"w-4 h-4 fill-current",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057c.002.022.015.043.03.056a19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028 14.09 14.09 0 0 0 1.226-1.994.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z"})})}),h.jsx("a",{href:"https://www.youtube.com/@AITritonix","aria-label":"YouTube",target:"_blank",rel:"noopener noreferrer",className:"w-9 h-9 rounded-full border border-white/10 flex items-center justify-center text-[#6b6b7e] hover:text-white hover:border-white/30 transition-all duration-200",children:h.jsx(LJ,{className:"w-5 h-5"})}),h.jsx("a",{href:"https://www.linkedin.com/company/tritonix-ai/?viewAsMember=true","aria-label":"LinkedIn",target:"_blank",rel:"noopener noreferrer",className:"w-9 h-9 rounded-full border border-white/10 flex items-center justify-center text-[#6b6b7e] hover:text-white hover:border-white/30 transition-all duration-200",children:h.jsx(q1e,{className:"w-4 h-4"})})]}),h.jsx("a",{href:"https://peerpush.com/p/tritonixai",target:"_blank",rel:"noopener noreferrer",className:"mt-7 inline-block transition-transform duration-200 hover:scale-[1.03]",children:h.jsx("img",{src:"https://peerpush.com/p/tritonixai/badge.png",alt:"Tritonix.ai on PeerPush",className:"h-12 w-auto max-w-full"})})]}),h.jsxs("div",{children:[h.jsx("h4",{className:"text-xs font-semibold uppercase tracking-widest text-[#4e4e68] mb-5",children:e("footer.product")}),h.jsx("ul",{className:"space-y-3.5",children:[{to:"/ai-investment-agent",labelKey:"footer.links.aiAgent",Icon:a8},{to:"/ai-technical-analysis",labelKey:"footer.links.technicalAnalysis",Icon:n1},{to:"/ai-consensus-pick",labelKey:"footer.links.consensusPick",Icon:n3},{to:"/copy-trade",labelKey:"footer.links.copyTrade",Icon:A0},{to:"/swing-trade-bot",labelKey:"footer.links.swingTradeBot",Icon:t3},{to:"/day-trade-bot",labelKey:"footer.links.dayTradeBot",Icon:bu},{to:"/institution-smart-money",labelKey:"footer.links.smartMoney",Icon:A0},{to:"/ai-social-agent",labelKey:"footer.links.socialAgent",Icon:QA}].map(({to:n,labelKey:r,Icon:i})=>h.jsx("li",{children:h.jsxs(na,{to:n,className:"flex items-center gap-2 text-sm text-[#8888a0] hover:text-white transition-colors duration-200 group",children:[h.jsx(i,{className:"w-3.5 h-3.5 text-[#4e4e68] group-hover:text-brand-400 transition-colors duration-200 shrink-0"}),e(r)]})},n))})]}),h.jsxs("div",{children:[h.jsx("h4",{className:"text-xs font-semibold uppercase tracking-widest text-[#4e4e68] mb-5",children:e("footer.resources")}),h.jsx("ul",{className:"space-y-3.5",children:[{to:"/blog",labelKey:"footer.links.blog"},{to:"/press",label:e("resources.pressRoom",{defaultValue:"Press Room"})},{to:"/market-data",labelKey:"resources.marketData"},{to:"/for-business",label:e("resources.forBusiness",{defaultValue:"For business"})},{to:"/ideas",labelKey:"footer.links.ideas"},{to:"/help",labelKey:"footer.links.helpCenter"},{to:"/about",labelKey:"footer.links.about"}].map(({to:n,labelKey:r,label:i})=>h.jsx("li",{children:h.jsx(na,{to:n,className:"text-sm text-[#8888a0] hover:text-white transition-colors duration-200",children:i??e(r)})},n))})]}),h.jsxs("div",{children:[h.jsx("h4",{className:"text-xs font-semibold uppercase tracking-widest text-[#4e4e68] mb-5",children:"Supported Models"}),h.jsx("ul",{className:"space-y-3.5",children:h.jsx("li",{children:h.jsx(na,{to:"/models/gpt-6-sol",className:"text-sm text-[#8888a0] hover:text-white transition-colors duration-200",children:"GPT-6 Sol"})})})]}),h.jsxs("div",{children:[h.jsx("h4",{className:"text-xs font-semibold uppercase tracking-widest text-[#4e4e68] mb-5",children:e("footer.compare")}),h.jsx("ul",{className:"space-y-3.5",children:[{to:"/compare/vs-claude-code",label:"VS Claude Code"},{to:"/compare/vs-openclaw",label:"VS OpenClaw"},{to:"/compare/vs-tradingview",label:"VS TradingView"},{to:"/compare/vs-codex",label:"VS Codex"}].map(({to:n,label:r})=>h.jsx("li",{children:h.jsx(na,{to:n,className:"text-sm text-[#8888a0] hover:text-white transition-colors duration-200",children:r})},n))})]}),h.jsxs("div",{children:[h.jsx("h4",{className:"text-xs font-semibold uppercase tracking-widest text-[#4e4e68] mb-5",children:e("footer.company")}),h.jsxs("ul",{className:"space-y-3.5",children:[[{to:"/pricing",labelKey:"footer.links.pricing"},{to:"/credit-guide",labelKey:"footer.links.creditGuide"},{to:"/privacy",labelKey:"footer.links.privacy"},{to:"/cybersecurity-policy",labelKey:"footer.links.cybersecurity"},{to:"/terms",labelKey:"footer.links.terms"}].map(({to:n,labelKey:r})=>h.jsx("li",{children:h.jsx(na,{to:n,className:"text-sm text-[#8888a0] hover:text-white transition-colors duration-200",children:e(r,{defaultValue:"AI Technical Analysis"})})}
446,n)),h.jsx("li",{children:h.jsx("button",{type:"button",onClick:()=>u3e(),className:"text-left text-sm text-[#8888a0] hover:text-white transition-colors duration-200",children:e("cookieConsent.footerManage")})})]})]})]})}),h.jsxs("div",{className:"relative bg-[#080810]",children:[h.jsx("div",{className:"h-px w-full",style:{background:"linear-gradient(to right, transparent, rgba(99,102,241,0.3) 30%, rgba(99,102,241,0.3) 70%, transparent)"}}),h.jsxs("div",{className:"container mx-auto px-6 md:px-8 py-6 flex flex-col gap-4",children:[h.jsx("p",{className:"text-xs text-[#6b6b7e]",children:e("footer.copyright",{year:new Date().getFullYear()})}),h.jsx("p",{className:"rounded-lg border border-white/10 bg-white/[0.04] px-4 py-3 text-[13px] leading-6 text-[#C4C6D8] md:text-sm",children:"Tritonix provides data, market research, and analytical tools only. It is not investment advice, a recommendation, an offer to trade, or an asset management service. Tritonix does not custody or control client assets; all investment decisions remain yours."})]})]})]})]})},A6e=768,pk="tx_pending_signup_client";function k6e(t){return t<A6e?"h5":"web"}function T6e(t){return t==="web"||t==="h5"?t:null}function c7(){return typeof window>"u"?"web":k6e(window.innerWidth)}function L6e(){const t=c7();try{sessionStorage.setItem(pk,t)}catch{}return t}function $6e(){try{const t=T6e(sessionStorage.getItem(pk));return sessionStorage.removeItem(pk),t}catch{return null}}async function bX(t){try{const e=await gf();return e?(await fetch("/api/signup-client",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`},body:JSON.stringify({client:t})})).ok:!1}catch(e){return console.warn("[signup-client] persist failed:",e),!1}}const bI="tritonix_pending_shared_chat_fork";function I6e(t){return!!(t&&Va.includes(t))}function Tyt(t,e=""){return`${e&&e!=="/"?e.replace(/\/$/,""):""}/share/${t}`||`/share/${t}`}function Lyt(t){try{sessionStorage.setItem(bI,JSON.stringify(t))}catch{}}function N6e(){try{const t=sessionStorage.getItem(bI);if(!t)return null;const e=JSON.parse(t);return!e||typeof e.shareToken!="string"||typeof e.returnPath!="string"||typeof e.createdAt!="number"?null:e}catch{return null}}function $yt(){try{sessionStorage.removeItem(bI)}catch{}}function wX(t){const e=N6e();if(e!=null&&e.returnPath)return e.returnPath;if(typeof window<"u"){const n=window.location.pathname.split("/").filter(Boolean),r=n[0]??null,i=n[1]??null;if((I6e(r)?i:r)==="share")return`${window.location.pathname}${window.location.search}${window.location.hash}`}return t}const O6e="tx_pending_oauth",P6e=1e4,RB=5e3,jB=36;function R6e(){const t=Va,e=window.location.pathname.split("/").filter(Boolean),n=e.length>0&&t.includes(e[0])?e[0]:null,r=localStorage.getItem("tritonix_lang"),i=n??(r&&t.includes(r)?r:null);return i?`/${i}/studio`:"/studio"}function Gp(){return wX(R6e())}function j6e(){const t=Va,e=window.location.pathname.split("/").filter(Boolean),n=e.length>0&&t.includes(e[0])?e[0]:null,r=localStorage.getItem("tritonix_lang"),i=n??(r&&t.includes(r)?r:null);return i?`/${i}`:"/"}function h4(t){return t.trim().toLowerCase()}const M6e=({isOpen:t,onClose:e,initialView:n="signup"})=>{const{t:r}=sr("common"),i=Zi(),[s,a]=N.useState(n),[o,l]=N.useState(""),[u,f]=N.useState(""),[p,y]=N.useState(!1),[g,b]=N.useState(null),[v,_]=N.useState(null),[C,S]=N.useState(!1),[x,A]=N.useState(!1),I=N.useRef(null),$=N.useRef(null),O=N.useRef(null),[P,j]=N.useState(!1),[U,z]=N.useState(!1),D=[{label:r("auth.ruleMinLength",{defaultValue:"At least 8 characters"}),valid:G=>G.length>=8},{label:r("auth.ruleLettersNumbers",{defaultValue:"Letters (upper & lower) and numbers"}),valid:G=>/[a-z]/.test(G)&&/[A-Z]/.test(G)&&/[0-9]/.test(G)}],R=D.every(G=>G.valid(u)),W=N.useCallback(G=>{b(null),_(null),A(!1),a(G)},[]);if(N.useEffect(()=>{if(!t)return;O.current=`${i.pathname}${i.search}${i.hash}`,a(n),b(null),_(null),l(""),f(""),S(!1),A(!1);const G=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=G}},[n,t]),N.useEffect(()=>{if(!t){O.current=null;return}const G=`${i.pathname}${i.search}${i.hash}`;O.current&&O.current!==G&&e()},[t,i.hash,i.pathname,i.search,e]),N.useEffect(()=>{if(!t)return;const G=Y=>{Y.key==="Escape"&&e()};return window.addEventListener("keydown",G),()=>window.removeEventListener("keydown",G)},[t,e]),N.useEffect(()=>{if(!t||s!=="verification")return;let G=!1,Y=0,X=null,te=!1;j(!1);const ie=()=>{G||(G=!0,$.current=null,X&&clearTimeout(X),e(),window.location.href=Gp())},se=async()=>
446{if(!(G||te)){te=!0,Y+=1;try{const xe=$.current;if(xe){const{data:Te}=await Mn.auth.signInWithPassword({email:xe.email,password:xe.password});if(Te.session){ie();return}}else{const{data:{session:Te}}=await Mn.auth.getSession();if(Te){ie();return}}}catch{}finally{te=!1}if(!G){if(Y>=jB){j(!0);return}X=setTimeout(se,RB)}}},{data:{subscription:pe}}=Mn.auth.onAuthStateChange((xe,Te)=>{xe==="SIGNED_IN"&&Te&&ie()});Mn.auth.getSession().then(({data:{session:xe}})=>{xe&&ie()}).catch(()=>{}),X=setTimeout(se,RB);const Ce=()=>{document.visibilityState==="visible"&&!G&&(X&&clearTimeout(X),Y<jB&&se())};return document.addEventListener("visibilitychange",Ce),()=>{G=!0,X&&clearTimeout(X),pe.unsubscribe(),document.removeEventListener("visibilitychange",Ce)}},[s,t,e]),N.useEffect(()=>{s!=="verification"&&($.current=null,j(!1))},[s]),!t)return null;const T=()=>{I.current&&(clearTimeout(I.current),I.current=null)},L=async()=>{try{y(!0),b(null),T(),I.current=setTimeout(()=>{y(!1),I.current=null},P6e);try{sessionStorage.setItem(O6e,"google")}catch{}L6e();const{error:G}=await Mn.auth.signInWithOAuth({provider:"google",options:{redirectTo:`${window.location.origin}${Gp()}`}});if(G)throw G}catch(G){T(),b(G.message),y(!1)}},M=async G=>{var Y,X;G.preventDefault();try{y(!0),b(null);const te=h4(o),{data:ie,error:se}=await Mn.auth.signInWithPassword({email:te,password:u});if(se)throw se;await d3(((Y=ie.user)==null?void 0:Y.id)??null,((X=ie.user)==null?void 0:X.email)??te),hI("email"),e(),window.location.href=Gp()}catch(te){b(te.message)}finally{y(!1)}},Z=async G=>{var Y,X;if(G.preventDefault(),!R){A(!0);return}try{y(!0),b(null);const te=h4(o),{data:ie,error:se}=await Mn.auth.signUp({email:te,password:u,options:{emailRedirectTo:`${window.location.origin}${Gp()}`,data:{signup_client:c7()}}});if(se)throw se;if(Array.isArray((Y=ie.user)==null?void 0:Y.identities)&&ie.user.identities.length===0||!!ie.user&&!ie.session&&!!ie.user.email_confirmed_at){f(""),W("signin"),b(r("auth.alreadyRegistered",{defaultValue:"This email is already registered. Please sign in or reset your password."}));return}$.current={email:te,password:u},await d3(null,te),dI("email",(X=ie.user)==null?void 0:X.id),l(te),f(""),_(r("auth.confirmationSent",{email:te,defaultValue:"We've sent a confirmation link to {{email}}"})),W("verification")}catch(te){b(te.message)}finally{y(!1)}},H=async G=>{G.preventDefault();try{y(!0),b(null);const Y=h4(o),{error:X}=await Mn.auth.resetPasswordForEmail(Y,{redirectTo:`${window.location.origin}/reset-password`});if(X)throw X;l(Y),_(r("auth.resetLinkSent",{email:Y,defaultValue:"Password reset link sent to {{email}}"})),W("reset-link-sent")}catch(Y){b(Y.message)}finally{y(!1)}},V=async()=>{const G=$.current;if(!G){b(r("auth.sessionExpired",{defaultValue:"Your session has expired. Please sign in with your email and password."})),W("signin");return}try{z(!0),b(null);const{data:Y,error:X}=await Mn.auth.signInWithPassword({email:G.email,password:G.password});if(X)throw X;if(Y.session){$.current=null,e(),window.location.href=Gp();return}b(r("auth.stillCannotVerify",{defaultValue:"We still cannot verify your account. Make sure you clicked the link in the email, then try again."}))}catch(Y){b(Y.message)}finally{z(!1)}},F=async()=>{const G=h4(o);if(!G){b(r("auth.noEmailToResend",{defaultValue:"No email on file to resend to. Please go back and re-enter your email."}));return}try{y(!0),b(null);const{error:Y}=await Mn.auth.resend({type:"signup",email:G,options:{emailRedirectTo:`${window.location.origin}${Gp()}`}});if(Y)throw Y;_(r("auth.resentTo",{email:G,defaultValue:"Verification link resent to {{email}}."}))}catch(Y){b(Y.message)}finally{y(!1)}},q=()=>h.jsxs("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",children:[h.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z",fill:"#4285F4"}),h.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),h.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),h.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]});return h.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-[#0a0a0a] text-white animate-fade-in",children:h.jsxs("div",{className:"relative w-full max-w-md p-4",children:[p&&h.jsx("div",{className:"fixed top-0 left-0 h-1 bg-brand-500 w-full animate-progress z-50"}),h.jsxs("div",{className:"py-4 md:py-8",children:[h.jsx("button",{onClick:e,className:"fixed top-6 right-6 p-2 text-gray-500 hover:text-white rounded-full hover:bg-white/5 transition-colors z-50","aria-label":r("auth.close",{defaultValue:"Close"}),children:h.jsx(ml,{className:"w-6 h-6"})}),h.jsxs("a",{href:j6e(),onClick:e,className:"mb-6 flex items-center justify-center gap-2 transition-opacity hover:opacity-85 md:mb-12","aria-label":r("auth.homeAria",{defaultValue:"Go to Tritonix homepage"}),children:[h.jsx("img",{src:"/logo.png",alt:"Logo",className:"w-10 h-10 rounded-lg object-contain"}),h.jsxs("span",{className:"text-xl font-bold tracking-tight text-white",children:["Tritonix",h.jsx("span",{className:"text-brand-400",children:".ai"})]})]}),g&&h.jsxs("div",{className:"mb-6 bg-red-500/10 border border-red-500/20 text-red-200 px-4 py-3 rounded-xl text-sm flex items-start gap-2",children:[h.jsx(g1e,{className:"w-5 h-5 shrink-0"}),h.jsx("span",{children:g})]}),s==="signin"&&h.jsxs("div",{className:"animate-fade-in",children:[h.jsx("h2",{className:"text-3xl font-bold text-center text-white mb-3",children:r("auth.signInTitle",{defaultValue:"Sign in"})}),h.jsx("p",{className:"text-gray-400 text-center mb-6 md:mb-10",children:r("auth.signInSubtitle",{defaultValue:"Welcome back to Tritonix.ai"})}),h.jsxs("button",{onClick:L,className:"w-full bg-white text-black font-semibold py-3.5 rounded-xl flex items-center justify-center gap-3 hover:bg-gray-100 transition-colors mb-5 md:mb-8",disabled:p,children:[h.jsx(q,{}),r("auth.continueGoogle",{defaultValue:"Continue with Google"})]}),h.jsxs("div",{className:"relative mb-5 md:mb-8",children:[h.jsx("div",{className:"absolute inset-0 flex items-center",children:h.jsx("div",{className:"w-full border-t border-white/10"})}),h.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:h.jsx("span",{className:"bg-[#0a0a0a] px-3 text-gray-500",children:r("auth.orEmail",{defaultValue:"Or email"})})})]}),h.jsxs("form",{onSubmit:M,className:"space-y-4 md:space-y-5",children:[h.jsxs("div",{className:"space-y-1.5",children:[h.jsx("label",{className:"text-sm font-medium text-gray-400 ml-1",children:r("auth.email",{defaultValue:"Email"})}),h.jsxs("div",{className:"relative",children:[h.jsx(wC,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),h.jsx("input",{type:"email",autoComplete:"email",className:"w-full bg-zinc-900 border border-white/10 rounded-xl py-3.5 pl-10 pr-4 text-white focus:outline-none focus:border-brand-500 focus:ring-1 focus:ring-brand-500 transition-all placeholder:text-gray-600",placeholder:r("auth.emailPlaceholder",{defaultValue:"[email protected]"}),required:!0,value:o,onChange:G=>l(G.target.value)})]})]}),h.jsxs("div",{className:"space-y-1.5",children:[h.jsxs("label",{className:"text-sm font-medium text-gray-400 ml-1 flex justify-between",children:[r("auth.password",{defaultValue:"Password"}),h.jsx("button",{type:"button",onClick:()=>W("forgot-password"),className:"text-brand-400 hover:text-brand-300 text-xs",children:r("auth.forgot",{defaultValue:"Forgot?"})})]}),h.jsxs("div",{className:"relative",children:[h.jsx(bC,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),h.jsx("input",{type:C?"text":"password",autoComplete:"current-password",className:"w-full bg-zinc-900 border border-white/10 rounded-xl py-3.5 pl-10 pr-11 text-white focus:outline-none focus:border-brand-500 focus:ring-1 focus:ring-brand-500 transition-all placeholder:text-gray-600",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",required:!0,value:u,onChange:G=>f(G.target.value)}),h.jsx("button",{type:"button",onClick:()=>S(G=>
446!G),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-300 transition-colors",tabIndex:-1,"aria-label":C?r("auth.hidePassword",{defaultValue:"Hide password"}):r("auth.showPassword",{defaultValue:"Show password"}),children:C?h.jsx(MU,{className:"w-5 h-5"}):h.jsx(DU,{className:"w-5 h-5"})})]})]}),h.jsx("button",{type:"submit",disabled:p,className:"w-full bg-brand-500 text-black font-bold py-3.5 rounded-xl hover:bg-brand-400 transition-all transform hover:scale-[1.01] mt-4 disabled:opacity-50 disabled:cursor-not-allowed",children:p?r("auth.signingIn",{defaultValue:"Signing in..."}):r("auth.signIn",{defaultValue:"Sign In"})})]}),h.jsxs("div",{className:"mt-6 md:mt-8 text-center text-sm text-gray-400 pb-12 md:pb-0",children:[r("auth.noAccount",{defaultValue:"Don't have an account?"})," ",h.jsx("button",{onClick:()=>W("signup"),className:"text-brand-400 font-medium hover:text-brand-300",children:r("auth.signUp",{defaultValue:"Sign up"})})]})]}),s==="signup"&&h.jsxs("div",{className:"animate-fade-in",children:[h.jsx("h2",{className:"text-3xl font-bold text-center text-white mb-3",children:r("auth.createAccountTitle",{defaultValue:"Create account"})}),h.jsx("p",{className:"text-gray-400 text-center mb-6 md:mb-10",children:r("auth.createAccountSubtitle",{defaultValue:"Free to start. No credit card required."})}),h.jsxs("button",{onClick:L,className:"w-full bg-white text-black font-semibold py-3.5 rounded-xl flex items-center justify-center gap-3 hover:bg-gray-100 transition-colors mb-5 md:mb-8",disabled:p,children:[h.jsx(q,{}),r("auth.signUpGoogle",{defaultValue:"Sign up with Google"})]}),h.jsxs("div",{className:"relative mb-5 md:mb-8",children:[h.jsx("div",{className:"absolute inset-0 flex items-center",children:h.jsx("div",{className:"w-full border-t border-white/10"})}),h.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:h.jsx("span",{className:"bg-[#0a0a0a] px-3 text-gray-500",children:r("auth.orEmail",{defaultValue:"Or email"})})})]}),h.jsxs("form",{onSubmit:Z,className:"space-y-4 md:space-y-5",children:[h.jsxs("div",{className:"space-y-1.5",children:[h.jsx("label",{className:"text-sm font-medium text-gray-400 ml-1",children:r("auth.email",{defaultValue:"Email"})}),h.jsxs("div",{className:"relative",children:[h.jsx(wC,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),h.jsx("input",{type:"email",autoComplete:"email",className:"w-full bg-zinc-900 border border-white/10 rounded-xl py-3.5 pl-10 pr-4 text-white focus:outline-none focus:border-brand-500 focus:ring-1 focus:ring-brand-500 transition-all placeholder:text-gray-600",placeholder:r("auth.emailPlaceholder",{defaultValue:"[email protected]"}),required:!0,value:o,onChange:G=>l(G.target.value)})]})]}),h.jsxs("div",{className:"space-y-1.5",children:[h.jsx("label",{className:"text-sm font-medium text-gray-400 ml-1",children:r("auth.password",{defaultValue:"Password"})}),h.jsxs("div",{className:"relative",children:[h.jsx(bC,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),h.jsx("input",{type:C?"text":"password",autoComplete:"new-password",className:`w-full bg-zinc-900 border rounded-xl py-3.5 pl-10 pr-11 text-white focus:outline-none focus:ring-1 transition-all placeholder:text-gray-600 ${!R&&u.length>0&&x?"border-red-500/50 focus:border-red-500 focus:ring-red-500":"border-white/10 focus:border-brand-500 focus:ring-brand-500"}`,placeholder:r("auth.passwordPlaceholder",{defaultValue:"Create a password"}),required:!0,value:u,onFocus:()=>A(!0),onChange:G=>f(G.target.value)}),h.jsx("button",{type:"button",onClick:()=>S(G=>!G),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-300 transition-colors",tabIndex:-1,"aria-label":C?r("auth.hidePassword",{defaultValue:"Hide password"}):r("auth.showPassword",{defaultValue:"Show password"}),children:C?h.jsx(MU,{className:"w-5 h-5"}):h.jsx(DU,{className:"w-5 h-5"})})]}),x&&h.jsx("div",{className:"pt-2 flex flex-col gap-1.5 animate-fade-in",children:D.map((G,Y)=>{const X=G.valid(u);return h.jsxs("div",{className:`flex items-center gap-1.5 text-xs ${X?"text-green-400":"text-gray-500"}`,children:[X?h.jsx(t7,{className:"w-3 h-3"}):h.jsx(v1e,{className:"w-3 h-3"}),G.label]},Y)})})]}),h.jsx("button",{type:"submit",disabled:p||!R,className:"w-full bg-brand-500 text-black font-bold py-3.5 rounded-xl hover:bg-brand-400 transition-all transform hover:scale-[1.01] mt-4 disabled:opacity-50 disabled:cursor-not-allowed",children:p?r("auth.creatingAccount",{defaultValue:"Creating Account..."}):r("auth.createAccount",{defaultValue:"Create Account"})})]}),h.jsxs("div",{className:"mt-6 md:mt-8 text-center text-sm text-gray-400 pb-12 md:pb-0",children:[r("auth.haveAccount",{defaultValue:"Already have an account?"})," ",h.jsx("button",{onClick:()=>W("signin"),className:"text-brand-400 font-medium hover:text-brand-300",children:r("auth.signInLink",{defaultValue:"Sign in"})})]})]}),s==="forgot-password"&&h.jsxs("div",{className:"animate-fade-in text-center pt-8",children:[h.jsxs("button",{onClick:()=>W("signin"),className:"absolute top-0 left-0 text-gray-500 hover:text-white flex items-center gap-1 text-sm p-2 hover:bg-white/5 rounded-lg transition-colors",children:[h.jsx(YA,{className:"w-4 h-4"})," ",r("auth.back",{defaultValue:"Back"})]}),h.jsx("div",{className:"w-16 h-16 bg-brand-900/30 rounded-full flex items-center justify-center mx-auto mb-6",children:h.jsx(bC,{className:"w-8 h-8 text-brand-400"})}),h.jsx("h2",{className:"text-3xl font-bold text-white mb-3",children:r("auth.resetTitle",{defaultValue:"Reset Password"})}),h.jsx("p",{className:"text-gray-400 text-sm mb-6 md:mb-10 max-w-xs mx-auto",children:r("auth.resetSubtitle",{defaultValue:"Enter your email address and we'll send you a link to reset your password."})}),h.jsxs("form",{onSubmit:H,className:"space-y-4 md:space-y-5",children:[h.jsxs("div",{className:"space-y-1.5 text-left",children:[h.jsx("label",{className:"text-sm font-medium text-gray-400 ml-1",children:r("auth.email",{defaultValue:"Email"})}),h.jsxs("div",{className:"relative",children:[h.jsx(wC,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),h.jsx("input",{type:"email",autoComplete:"email",className:"w-full bg-zinc-900 border border-white/10 rounded-xl py-3.5 pl-10 pr-4 text-white focus:outline-none focus:border-brand-500 focus:ring-1 focus:ring-brand-500 transition-all placeholder:text-gray-600",placeholder:r("auth.emailPlaceholder",{defaultValue:"[email protected]"}),required:!0,value:o,onChange:G=>l(G.target.value)})]})]}),h.jsx("button",{type:"submit",disabled:p,className:"w-full bg-brand-500 text-black font-bold py-3.5 rounded-xl hover:bg-brand-400 transition-all transform hover:scale-[1.01] disabled:opacity-50 disabled:cursor-not-allowed",children:p?r("auth.sending",{defaultValue:"Sending..."}
446):r("auth.sendReset",{defaultValue:"Send Reset Link"})})]})]}),(s==="verification"||s==="reset-link-sent")&&h.jsxs("div",{className:"animate-fade-in text-center pt-8",children:[h.jsxs("button",{onClick:()=>W("signin"),className:"absolute top-0 left-0 text-gray-500 hover:text-white flex items-center gap-1 text-sm p-2 hover:bg-white/5 rounded-lg transition-colors",children:[h.jsx(YA,{className:"w-4 h-4"})," ",r("auth.backToLogin",{defaultValue:"Back to Login"})]}),h.jsx("div",{className:"w-16 h-16 bg-brand-900/30 rounded-full flex items-center justify-center mx-auto mb-6",children:h.jsx(iI,{className:"w-8 h-8 text-brand-400"})}),h.jsx("h2",{className:"text-3xl font-bold text-white mb-3",children:r("auth.checkEmail",{defaultValue:"Check your email"})}),h.jsxs("p",{className:"text-gray-400 text-sm mb-6 md:mb-4",children:[v||r("auth.sentConfirmLink",{email:o||r("auth.yourEmail",{defaultValue:"your email"}),defaultValue:"We've sent a confirmation link to {{email}}."}),h.jsx("br",{}),r("auth.clickLink",{defaultValue:"Please click the link to continue."})]}),s==="verification"&&!P&&h.jsxs("p",{className:"text-xs text-gray-500 mb-6 md:mb-10 inline-flex items-center gap-2",children:[h.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full bg-brand-400 animate-pulse"}),r("auth.waitingVerify",{defaultValue:"Waiting for verification â you can use any device."})]}),h.jsxs("div",{className:"space-y-4",children:[h.jsx("button",{onClick:()=>window.open("https://gmail.com","_blank"),className:"w-full bg-brand-500 text-black font-bold py-3.5 rounded-xl hover:bg-brand-400 transition-all transform hover:scale-[1.01]",children:r("auth.openEmailApp",{defaultValue:"Open Email App"})}),s==="verification"&&P&&$.current&&h.jsx("button",{onClick:V,type:"button",disabled:U,className:"w-full bg-zinc-900 border border-white/10 text-white font-semibold py-3.5 rounded-xl hover:bg-zinc-800 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:U?r("auth.signingInEllipsis",{defaultValue:"Signing inâ¦"}):r("auth.verifiedSignIn",{defaultValue:"I've verified â sign me in"})}),s==="verification"&&h.jsxs("p",{className:"text-sm text-gray-500",children:[r("auth.didntReceive",{defaultValue:"Didn't receive the link?"})," ",h.jsx("button",{onClick:F,type:"button",disabled:p,className:"text-brand-400 hover:underline disabled:opacity-50",children:r("auth.resend",{defaultValue:"Resend"})})]})]})]})]}),h.jsx("div",{className:"fixed bottom-0 left-0 w-full p-4 md:p-6 text-center bg-gradient-to-t from-black to-transparent pointer-events-none",children:h.jsx("p",{className:"text-xs text-gray-600 pointer-events-auto",children:h.jsx(r0e,{i18nKey:"auth.legal",defaults:"By continuing, you agree to our <terms>Terms of Service</terms> and <privacy>Privacy Policy</privacy>.",components:{terms:h.jsx("a",{href:"/terms",target:"_blank",rel:"noopener noreferrer",className:"hover:text-white underline transition-colors"}),privacy:h.jsx("a",{href:"/privacy",target:"_blank",rel:"noopener noreferrer",className:"hover:text-white underline transition-colors"})}})})})]})})},D6e={path:"/api/v1/analytics_events",method:"POST"},U6e={path:"/api/v1/apps/:app_id",method:"GET"},B6e={path:"/api/v1/funding/coinbase_on_ramp/init",method:"POST"},F6e={path:"/api/v1/funding/coinbase_on_ramp/status",method:"GET"},z6e={path:"/api/v1/apps/:app_id/cross-app/connections",method:"GET"},V6e={path:"/api/v1/custom_jwt_account/authenticate",method:"POST"},H6e={path:"/api/v1/custom_jwt_account/link",method:"POST"},W6e={path:"/api/v1/farcaster/init",method:"POST"},q6e={path:"/api/v1/farcaster/authenticate",method:"POST"},Z6e={path:"/api/v1/farcaster/link",method:"POST"},K6e={path:"/api/v1/farcaster/unlink",method:"POST"},G6e={path:"/api/v1/farcaster/status",method:"GET"},Y6e={path:"/api/v2/farcaster/init",method:"POST"},J6e={path:"/api/v2/farcaster/authenticate",method:"POST"},X6e={path:"/api/v1/guest/authenticate",method:"POST"},Q6e={path:"/api/v1/mfa/passkeys/init",method:"POST"},e5e={path:"/api/v1/mfa/passwordless_sms/init",method:"POST"},t5e={path:"/api/v1/oauth/authenticate",method:"POST"},n5e={path:"/api/v1/oauth/init",method:"POST"},r5e={path:"/api/v1/oauth/link",method:"POST"},i5e={path:"/api/v1/oauth/unlink",method:"POST"},s5e={path:"/api/v1/passkeys/link",method:"POST"},a5e={path:"/api/v1/passkeys/authenticate",method:"POST"},o5e={path:"/api/v1/passkeys/register",method:"POST"},l5e={path:"/api/v1/passkeys/authenticate/init",method:"POST"},c5e={path:"/api/v1/passkeys/register/init",method:"POST"},u5e={path:"/api/v1/passkeys/link/init",method:"POST"},d5e={path:"/api/v1/passwordless/authenticate",method:"POST"},h5e={path:"/api/v1/passwordless/init",method:"POST"},f5e={path:"/api/v1/passwordless/link",method:"POST"},p5e={path:"/api/v1/passwordless/unlink",method:"POST"},m5e={path:"/api/v1/passwordless/update",method:"POST"},y5e={path:"/api/v1/passwordless_sms/authenticate",method:"POST"},g5e={path:"/api/v1/passwordless_sms/init",method:"POST"},b5e={path:"/api/v1/passwordless_sms/link",method:"POST"},w5e={path:"/api/v1/passwordless_sms/unlink",method:"POST"},v5e={path:"/api/v1/passwordless_sms/update",method:"POST"},_5e={path:"/api/v1/embedded_wallets/:address/recovery/key_material",method:"POST"},x5e={path:"/api/v1/recovery/oauth/init",method:"POST"},C5e={path:"/api/v1/recovery/oauth/authenticate",method:"POST"},E5e={path:"/api/v1/recovery/oauth/init_icloud",method:"POST"},S5e={path:"/api/v1/recovery/configuration_icloud",method:"POST"},A5e={path:"/api/v1/onramp/deposit_addresses/quote",method:"POST"},wI={path:"/api/v1/onramp/deposit_addresses/orders/:order_id",method:"GET"},k5e={path:"/api/v1/onramp/deposit_addresses/:deposit_address_id/next_order",method:"GET"},vX={path:"/api/v1/onramp/deposit_addresses/deposit_config",method:"GET"}
446,IC={path:"/api/v1/wallets/:wallet_id/deposit_accounts/crypto",method:"POST"},T5e={path:"/api/v1/deposit_accounts/crypto/quote",method:"POST"},L5e=(t,e)=>e?Object.entries(e).reduce((n,[r,i])=>n.replace(`:${r}`,`${i}`),t):t,MB={path:"/api/v1/sessions",method:"POST"},$5e={path:"/api/v1/sessions/logout",method:"POST"},I5e={path:"/api/v1/apps/:app_id/smart_wallets",method:"GET"},_X={path:"/api/v1/siwe/init",method:"POST"},N5e={path:"/api/v1/siwe/authenticate",method:"POST"},O5e={path:"/api/v1/siwe/link",method:"POST"},P5e={path:"/api/v1/siwe/link_smart_wallet",method:"POST"},R5e={path:"/api/v1/siwe/unlink",method:"POST"},j5e={path:"/api/v1/siws/init",method:"POST"},M5e={path:"/api/v1/siws/authenticate",method:"POST"},D5e={path:"/api/v1/siws/link",method:"POST"},U5e={path:"/api/v1/siws/unlink",method:"POST"},B5e={path:"/api/v1/users/me/accept_terms",method:"POST"},F5e={path:"/api/v1/telegram/authenticate",method:"POST"},z5e={path:"/api/v1/telegram/link",method:"POST"},V5e={path:"/api/v1/telegram/unlink",method:"POST"},H5e={path:"/api/v1/plugins/moonpay_on_ramp/sign",method:"POST"},W5e={path:"/api/v1/onramp/fiat/quotes",method:"PUT"},q5e={path:"/api/v1/onramp/fiat/provider_session_url",method:"POST"},Z5e={path:"/api/v1/onramp/fiat/status",method:"GET"},Iyt={path:"/api/v1/onramp/stripe/create_link_auth_intent",method:"POST"},Nyt={path:"/api/v1/onramp/stripe/exchange_tokens",method:"POST"},Oyt={path:"/api/v1/onramp/stripe/customer",method:"GET"},Pyt={path:"/api/v1/onramp/stripe/customer/wallets",method:"GET"},Ryt={path:"/api/v1/onramp/stripe/customer/payment_tokens",method:"GET"},jyt={path:"/api/v1/onramp/stripe/create_onramp_session",method:"POST"},Myt={path:"/api/v1/onramp/stripe/quote/:session_id",method:"POST"},Dyt={path:"/api/v1/onramp/stripe/checkout/:session_id",method:"POST"},K5e={path:"/api/v1/users/me",method:"GET"},xX={path:"/api/v1/wallets",method:"POST"},NC={path:"/api/v1/wallets/:wallet_id/rpc",method:"POST"},G5e={path:"/api/v1/wallets/revoke",method:"POST"},Y5e=new TextEncoder,CX=new TextDecoder,J5e=t=>{let e=t;typeof e=="string"&&(e=Y5e.encode(e));const n=32768,r=[];for(let i=0;i<e.length;i+=n)r.push(String.fromCharCode.apply(null,e.subarray(i,i+n)));return btoa(r.join(""))},X5e=t=>J5e(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),Q5e=t=>{const e=atob(t),n=new Uint8Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r);return n},ebe=t=>{let e=t;e instanceof Uint8Array&&(e=CX.decode(e)),e=e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return Q5e(e)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}};let tbe=class extends Error{static get code(){return"ERR_JOSE_GENERIC"}constructor(e){var n;super(e),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,(n=Error.captureStackTrace)===null||n===void 0||n.call(Error,this,this.constructor)}},yh=class extends tbe{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}static get code(){return"ERR_JWT_INVALID"}};function nbe(t){return typeof t=="object"&&t!==null}function rbe(t){if(!nbe(t)||Object.prototype.toString.call(t)!=="[object Object]")return!1;if(Object.getPrototypeOf(t)===null)return!0;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}const vI=X5e,ibe=ebe;function sbe(t){if(typeof t!="string")throw new yh("JWTs must use Compact JWS serialization, JWT must be a string");const{1:e,length:n}=t.split(".");
446if(n===5)throw new yh("Only JWTs using Compact JWS serialization can be decoded");if(n!==3)throw new yh("Invalid JWT");if(!e)throw new yh("JWTs must contain a payload");let r;try{r=ibe(e)}catch{throw new yh("Failed to base64url decode the payload")}let i;try{i=JSON.parse(CX.decode(r))}catch{throw new yh("Failed to parse the decoded payload as JSON")}if(!rbe(i))throw new yh("Invalid JWT Claims Set");return i}function abe(t,e){return{...t,rpcUrls:{...t.rpcUrls,privy:{http:[e]}}}}const zu={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-mainnet.rpc.privy.systems"]},alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}}},_I={id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-sepolia.rpc.privy.systems"]}
446,default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]},public:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-explorer.arbitrum.io"}},testnet:!0},Vu={id:43114,name:"Avalanche",network:"avalanche",nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]},public:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://snowtrace.io"},default:{name:"SnowTrace",url:"https://snowtrace.io"}}},xI={id:43113,name:"Avalanche Fuji",network:"avalanche-fuji",nativeCurrency:{decimals:18,name:"Avalanche Fuji",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax-test.network/ext/bc/C/rpc"]},public:{http:["https://api.avax-test.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://testnet.snowtrace.io"},default:{name:"SnowTrace",url:"https://testnet.snowtrace.io"}},testnet:!0},Hu={id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-mainnet.rpc.privy.systems"]},default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://basescan.org"},default:{name:"Basescan",url:"https://basescan.org"}}},CI={id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"}},testnet:!0},obe={id:80085,network:"berachain-artio",name:"Berachain Artio",nativeCurrency:{name:"BERA",symbol:"BERA",decimals:18},rpcUrls:{default:{http:["https://berachain-artio.rpc.privy.systems"]},public:{http:["https://berachain-artio.rpc.privy.systems"]}},blockExplorers:{default:{name:"Beratrail",url:"https://artio.beratrail.io"}},testnet:!0},lbe={id:56,network:"bsc",name:"Binance Smart Chain",nativeCurrency:{name:"BNB",symbol:"BNB",decimals:18},rpcUrls:{privy:{http:["https://bsc-mainnet.rpc.privy.systems"]},default:{http:["https://56.rpc.thirdweb.com"]},public:{http:["https://56.rpc.thirdweb.com"]}},blockExplorers:{etherscan:{name:"BscScan",url:"https://bscscan.com"},default:{name:"BscScan",url:"https://bscscan.com"}}},EI={id:42220,name:"Celo Mainnet",network:"celo",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://forno.celo.org"]},infura:{http:["https://celo-mainnet.infura.io/v3"]},public:{http:["https://forno.celo.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/mainnet"},etherscan:{name:"CeloScan",url:"https://celoscan.io"}},testnet:!1},cbe={id:44787,name:"Celo Alfajores Testnet",network:"celo-alfajores",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://alfajores-forno.celo-testnet.org"]},infura:{http:["https://celo-alfajores.infura.io/v3"]},public:{http:["https://alfajores-forno.celo-testnet.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/alfajores"},etherscan:{name:"CeloScan",url:"https://alfajores.celoscan.io/"}},testnet:!0},ube={id:314,name:"Filecoin - Mainnet",network:"filecoin-mainnet",nativeCurrency:{decimals:18,name:"filecoin",symbol:"FIL"},rpcUrls:{default:{http:["https://api.node.glif.io/rpc/v1"]},public:{http:["https://api.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filfox",url:"https://filfox.info/en"},filscan:{name:"Filscan",url:"https://filscan.io"},filscout:{name:"Filscout",url:"https://filscout.io/en"},glif:{name:"Glif",url:"https://explorer.glif.io"}}},dbe={id:314159,name:"Filecoin - Calibration testnet",network:"filecoin-calibration",nativeCurrency:{decimals:18,name:"testnet filecoin",symbol:"tFIL"},rpcUrls:{default:{http:["https://api.calibration.node.glif.io/rpc/v1"]},public:{http:["https://api.calibration.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filscan",url:"https://calibration.filscan.io"}}},hbe={id:17069,name:"Garnet Holesky",network:"garnet-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18}
446,rpcUrls:{default:{http:["https://rpc.garnetchain.com"]},public:{http:["https://rpc.garnetchain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.garnetchain.com"}}},fbe={id:43419,name:"Gunz Mainnet",network:"gunz",nativeCurrency:{name:"GUN",symbol:"GUN",decimals:18},rpcUrls:{privy:{http:["https://gunz-mainnet.rpc.privy.systems"]},default:{http:["https://rpc.gunzchain.io/ext/bc/2M47TxWHGnhNtq6pM5zPXdATBtuqubxn5EPFgFmEawCQr9WFML/rpc"]},public:{http:["https://rpc.gunzchain.io/ext/bc/2M47TxWHGnhNtq6pM5zPXdATBtuqubxn5EPFgFmEawCQr9WFML/rpc"]}},blockExplorers:{default:{name:"Gunz Explorer",url:"https://gunzscan.io"}}},pbe={id:17e3,name:"Holesky",network:"holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://ethereum-holesky.publicnode.com"]},public:{http:["https://ethereum-holesky.publicnode.com"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://holesky.etherscan.io"},default:{name:"EtherScan",url:"https://holesky.etherscan.io"}}},mbe={id:13371,name:"Immutable zkEVM",network:"immutable-zkevm",nativeCurrency:{name:"Immutable Coin",symbol:"IMX",decimals:18},rpcUrls:{privy:{http:["https://immutable-mainnet.rpc.privy.systems"]},default:{http:["https://rpc.immutable.com"]},public:{http:["https://rpc.immutable.com"]}},blockExplorers:{default:{name:"Immutable Explorer",url:"https://explorer.immutable.com"}}},ybe={id:59144,network:"linea-mainnet",name:"Linea Mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]},public:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build"},etherscan:{name:"Etherscan",url:"https://lineascan.build"}},testnet:!1},gbe={id:59140,network:"linea-testnet",name:"Linea Goerli Testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-goerli.infura.io/v3"],webSocket:["wss://linea-goerli.infura.io/ws/v3"]},default:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]},public:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.lineascan.build"},etherscan:{name:"Etherscan",url:"https://goerli.lineascan.build"}},testnet:!0},bbe={id:42,network:"lukso",name:"LUKSO",nativeCurrency:{name:"LUKSO",symbol:"LYX",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.lukso.network"],webSocket:["wss://ws-rpc.mainnet.lukso.network"]}},blockExplorers:{default:{name:"LUKSO Mainnet Explorer",url:"https://explorer.execution.mainnet.lukso.network"}}},pc={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://mainnet.rpc.privy.systems"]},alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}}},wbe={id:1088,name:"Metis Andromeda",network:"metis",nativeCurrency:{name:"Metis",symbol:"METIS",decimals:18},rpcUrls:{privy:{http:["https://metis-mainnet.rpc.privy.systems"]},default:{http:["https://andromeda.metis.io/?owner=1088","https://metis-mainnet.public.blastapi.io"]},public:{http:["https://andromeda.metis.io/?owner=1088","https://metis-mainnet.public.blastapi.io"]}},blockExplorers:{default:{name:"Metis Explorer",url:"https://explorer.metis.io"}}},Wf={id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-mainnet.rpc.privy.systems"]},alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}}},SI={id:11155420,name:"Optimism Sepolia",network:"optimism-sepolia",nativeCurrency:{name:"Sepolia Ether",symbol
446:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.optimism.io"]},public:{http:["https://sepolia.optimism.io"]},infura:{http:["https://optimism-sepolia.infura.io/v3"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com"}},testnet:!0},mc={id:137,name:"Polygon Mainnet",network:"polygon",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-mainnet.rpc.privy.systems"]},alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}}},AI={id:80002,name:"Polygon Amoy",network:"polygon-amoy",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-amoy.rpc.privy.systems"]},infura:{http:["https://polygon-amoy.infura.io/v3"],webSocket:["wss://polygon-amoy.infura.io/ws/v3"]},default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"OK LINK",url:"https://www.oklink.com/amoy"}},testnet:!0},vbe={id:690,name:"Redstone",network:"redstone",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.redstonechain.com"]},public:{http:["https://rpc.redstonechain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.redstone.xyz/"}}},kI={id:11155111,network:"sepolia",name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"SEP",decimals:18},rpcUrls:{privy:{http:["https://sepolia.rpc.privy.systems"]},alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"],webSocket:["wss://eth-sepolia.g.alchemy.com/v2"]},infura:{http:["https://sepolia.infura.io/v3"],webSocket:["wss://sepolia.infura.io/ws/v3"]},default:{http:["https://rpc.sepolia.org"]},public:{http:["https://rpc.sepolia.org"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://sepolia.etherscan.io"},default:{name:"Etherscan",url:"https://sepolia.etherscan.io"}},testnet:!0},_be={id:1868,name:"Soneium Mainnet",network:"soneium",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://soneium-mainnet.rpc.privy.systems"]},default:{http:["https://rpc.soneium.org"]},public:{http:["https://rpc.soneium.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://soneium.blockscout.com"}}},xbe={id:130,name:"Unichain",network:"unichain",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://unichain-mainnet.rpc.privy.systems"]},default:{http:["https://mainnet.unichain.org"]},public:{http:["https://mainnet.unichain.org"]}},blockExplorers:{default:{name:"Uniscan",url:"https://uniscan.xyz"}}},Cbe={id:7777777,name:"Zora",network:"zora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{privy:{http:["https://zora-mainnet.rpc.privy.systems"]},default:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]},public:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.zora.energy"}}},Ebe={id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]},public:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/"}},testnet:!0},Sbe={id:999,name:"Zora Goerli Testnet",network:"zora-testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]},public:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy"}},testnet:!0},M6=[pc,kI,pbe,zu,_I,Wf,SI,mc,AI,EI,cbe,ube,dbe,Hu,CI,obe,lbe,fbe,mbe,bbe,ybe,gbe,wbe,Vu,xI,_be,xbe,Cbe,Sbe,Ebe,vbe,hbe],EX=new Set(M6.map(t=>
446t.id));function Fyt(t){let e=t.filter(n=>!EX.has(n.id));return M6.concat(e)}const SX=t=>t.map(e=>{var r,i;if(e.rpcUrls.privyWalletOverride)return e;let n=(i=(r=M6.find(s=>s.id===e.id))==null?void 0:r.rpcUrls.privy)==null?void 0:i.http[0];return n?abe(e,n):e}),Abe={id:999},Z1={id:143};var OC={exports:{}},DB;function kbe(){return DB||(DB=1,(function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(l,u,f){this.fn=l,this.context=u,this.once=f||!1}function s(l,u,f,p,y){if(typeof f!="function")throw new TypeError("The listener must be a function");var g=new i(f,p||l,y),b=n?n+u:u;return l._events[b]?l._events[b].fn?l._events[b]=[l._events[b],g]:l._events[b].push(g):(l._events[b]=g,l._eventsCount++),l}function a(l,u){--l._eventsCount===0?l._events=new r:delete l._events[u]}function o(){this._events=new r,this._eventsCount=0}o.prototype.eventNames=function(){var u=[],f,p;if(this._eventsCount===0)return u;for(p in f=this._events)e.call(f,p)&&u.push(n?p.slice(1):p);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(f)):u},o.prototype.listeners=function(u){var f=n?n+u:u,p=this._events[f];if(!p)return[];if(p.fn)return[p.fn];for(var y=0,g=p.length,b=new Array(g);y<g;y++)b[y]=p[y].fn;return b},o.prototype.listenerCount=function(u){var f=n?n+u:u,p=this._events[f];return p?p.fn?1:p.length:0},o.prototype.emit=function(u,f,p,y,g,b){var v=n?n+u:u;if(!this._events[v])return!1;var _=this._events[v],C=arguments.length,S,x;if(_.fn){switch(_.once&&this.removeListener(u,_.fn,void 0,!0),C){case 1:return _.fn.call(_.context),!0;case 2:return _.fn.call(_.context,f),!0;case 3:return _.fn.call(_.context,f,p),!0;case 4:return _.fn.call(_.context,f,p,y),!0;case 5:return _.fn.call(_.context,f,p,y,g),!0;case 6:return _.fn.call(_.context,f,p,y,g,b),!0}for(x=1,S=new Array(C-1);x<C;x++)S[x-1]=arguments[x];_.fn.apply(_.context,S)}else{var A=_.length,I;for(x=0;x<A;x++)switch(_[x].once&&this.removeListener(u,_[x].fn,void 0,!0),C){case 1:_[x].fn.call(_[x].context);break;case 2:_[x].fn.call(_[x].context,f);break;case 3:_[x].fn.call(_[x].context,f,p);break;case 4:_[x].fn.call(_[x].context,f,p,y);break;default:if(!S)for(I=1,S=new Array(C-1);I<C;I++)S[I-1]=arguments[I];_[x].fn.apply(_[x].context,S)}}return!0},o.prototype.on=function(u,f,p){return s(this,u,f,p,!1)},o.prototype.once=function(u,f,p){return s(this,u,f,p,!0)},o.prototype.removeListener=function(u,f,p,y){var g=n?n+u:u;if(!this._events[g])return this;if(!f)return a(this,g),this;var b=this._events[g];if(b.fn)b.fn===f&&(!y||b.once)&&(!p||b.context===p)&&a(this,g);else{for(var v=0,_=[],C=b.length;v<C;v++)(b[v].fn!==f||y&&!b[v].once||p&&b[v].context!==p)&&_.push(b[v]);_.length?this._events[g]=_.length===1?_[0]:_:a(this,g)}return this},o.prototype.removeAllListeners=function(u){var f;return u?(f=n?n+u:u,this._events[f]&&a(this,f)):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=n,o.EventEmitter=o,t.exports=o})(OC)),OC.exports}var Tbe=kbe();const qf=Wa(Tbe),Lbe="1.2.3";let ha=class mk extends Error{constructor(e,n={}){var a;const r=n.cause instanceof mk?n.cause.details:(a=n.cause)!=null&&a.message?n.cause.message:n.details,i=n.cause instanceof mk&&n.cause.docsPath||n.docsPath,s=[e||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...i?[`Docs: https://abitype.dev${i}`]:[],...r?[`Details: ${r}`]:[],`Version: abitype@${Lbe}`].join(` 447`);super(s),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,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=i,this.metaMessages=n.metaMessages,this.shortMessage=e}};function Wu(t,e){const n=t.exec(e);return n==null?void 0:n.groups}const AX=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,kX=/^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)?$/,TX=/^\(.+?\).*?$/,UB=/^tuple(?<array>(\[(\d*)\])*)$/;function yk(t){let e=t.type;if(UB.test(t.type)&&"components"in t){e="(";const n=t.components.length;for(let i=0;i<n;i++){const s=t.components[i];e+=yk(s),i<n-1&&(e+=", ")}const r=Wu(UB,t.type);return e+=`)${(r==null?void 0:r.array)||""}`,yk({...t,type:e})}return"indexed"in t&&t.indexed&&(e=`${e}
447 indexed`),t.name?`${e} ${t.name}`:e}function w0(t){let e="";const n=t.length;for(let r=0;r<n;r++){const i=t[r];e+=yk(i),r!==n-1&&(e+=", ")}return e}function h8(t){var e;return t.type==="function"?`function ${t.name}(${w0(t.inputs)})${t.stateMutability&&t.stateMutability!=="nonpayable"?` ${t.stateMutability}`:""}${(e=t.outputs)!=null&&e.length?` returns (${w0(t.outputs)})`:""}`:t.type==="event"?`event ${t.name}(${w0(t.inputs)})`:t.type==="error"?`error ${t.name}(${w0(t.inputs)})`:t.type==="constructor"?`constructor(${w0(t.inputs)})${t.stateMutability==="payable"?" payable":""}`:t.type==="fallback"?`fallback() external${t.stateMutability==="payable"?" payable":""}`:"receive() external payable"}const LX=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function $be(t){return LX.test(t)}function Ibe(t){return Wu(LX,t)}const $X=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function Nbe(t){return $X.test(t)}function Obe(t){return Wu($X,t)}const IX=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function Pbe(t){return IX.test(t)}function Rbe(t){return Wu(IX,t)}const NX=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function u7(t){return NX.test(t)}function jbe(t){return Wu(NX,t)}const OX=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function Mbe(t){return OX.test(t)}function Dbe(t){return Wu(OX,t)}const PX=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function Ube(t){return PX.test(t)}function Bbe(t){return Wu(PX,t)}const Fbe=/^receive\(\) external payable$/;function zbe(t){return Fbe.test(t)}const BB=new Set(["memory","indexed","storage","calldata"]),Vbe=new Set(["indexed"]),gk=new Set(["calldata","memory","storage"]);class Hbe extends ha{constructor({signature:e}){super("Failed to parse ABI item.",{details:`parseAbiItem(${JSON.stringify(e,null,2)})`,docsPath:"/api/human#parseabiitem-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiItemError"})}}class Wbe extends ha{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class qbe extends ha{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class Zbe extends ha{constructor({params:e}){super("Failed to parse ABI parameters.",{details:`parseAbiParameters(${JSON.stringify(e,null,2)})`,docsPath:"/api/human#parseabiparameters-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParametersError"})}}class Kbe extends ha{constructor({param:e}){super("Invalid ABI parameter.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class Gbe extends ha{constructor({param:e,name:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`"${n}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class Ybe extends ha{constructor({param:e,type:n,modifier:r}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class Jbe extends ha{constructor({param:e,type:n,modifier:r}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${r}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class Xbe extends ha{constructor({abiParameter:e}){super("Invalid ABI parameter.",{details:JSON.stringify(e,null,2),metaMessages:["ABI parameter type is invali
447d."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class K1 extends ha{constructor({signature:e,type:n}){super(`Invalid ${n} signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class Qbe extends ha{constructor({signature:e}){super("Unknown signature.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class e4e extends ha{constructor({signature:e}){super("Invalid struct signature.",{details:e,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class t4e extends ha{constructor({type:e}){super("Circular reference detected.",{metaMessages:[`Struct "${e}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class n4e extends ha{constructor({current:e,depth:n}){super("Unbalanced parentheses.",{metaMessages:[`"${e.trim()}" has too many ${n>0?"opening":"closing"} parentheses.`],details:`Depth "${n}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}function r4e(t,e,n){let r="";if(n)for(const i of Object.entries(n)){if(!i)continue;let s="";for(const a of i[1])s+=`[${a.type}${a.name?`:${a.name}`:""}]`;r+=`(${i[0]}{${s}})`}return e?`${e}:${t}${r}`:`${t}${r}`}const PC=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function bk(t,e={}){if(Pbe(t))return i4e(t,e);if(Nbe(t))return s4e(t,e);if($be(t))return a4e(t,e);if(Mbe(t))return o4e(t,e);if(Ube(t))return l4e(t);if(zbe(t))return{type:"receive",stateMutability:"payable"};throw new Qbe({signature:t})}function i4e(t,e={}){const n=Rbe(t);if(!n)throw new K1({signature:t,type:"function"});const r=Ba(n.parameters),i=[],s=r.length;for(let o=0;o<s;o++)i.push(Iu(r[o],{modifiers:gk,structs:e,type:"function"}));const a=[];if(n.returns){const o=Ba(n.returns),l=o.length;for(let u=0;u<l;u++)a.push(Iu(o[u],{modifiers:gk,structs:e,type:"function"}))}return{name:n.name,type:"function",stateMutability:n.stateMutability??"nonpayable",inputs:i,outputs:a}}function s4e(t,e={}){const n=Obe(t);if(!n)throw new K1({signature:t,type:"event"});const r=Ba(n.parameters),i=[],s=r.length;for(let a=0;a<s;a++)i.push(Iu(r[a],{modifiers:Vbe,structs:e,type:"event"}));return{name:n.name,type:"event",inputs:i}}function a4e(t,e={}){const n=Ibe(t);if(!n)throw new K1({signature:t,type:"error"});const r=Ba(n.parameters),i=[],s=r.length;for(let a=0;a<s;a++)i.push(Iu(r[a],{structs:e,type:"error"}));return{name:n.name,type:"error",inputs:i}}function o4e(t,e={}){const n=Dbe(t);if(!n)throw new K1({signature:t,type:"constructor"});const r=Ba(n.parameters),i=[],s=r.length;for(let a=0;a<s;a++)i.push(Iu(r[a],{structs:e,type:"constructor"}));return{type:"constructor",stateMutability:n.stateMutability??"nonpayable",inputs:i}}function l4e(t){const e=Bbe(t);if(!e)throw new K1({signature:t,type:"fallback"});return{type:"fallback",stateMutability:e.stateMutability??"nonpayable"}}const c4e=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,u4e=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,d4e=/^u?int$/;function Iu(t,e){var p,y;const n=r4e(t,e==null?void 0:e.type,e==null?void 0:e.structs);if(PC.has(n))return PC.get(n);const r=TX.test(t),i=Wu(r?u4e:c4e,t);if(!i)throw new Kbe({param:t});if(i.name&&f4e(i.name))throw new Gbe({param:t,name:i.name});const s=i.name?{name:i.name}:{},a=i.modifier==="indexed"?{indexed:!0}:{},o=(e==null?void 0:e.structs)??{};let l,u={};
447if(r){l="tuple";const g=Ba(i.type),b=[],v=g.length;for(let _=0;_<v;_++)b.push(Iu(g[_],{structs:o}));u={components:b}}else if(i.type in o)l="tuple",u={components:o[i.type]};else if(d4e.test(i.type))l=`${i.type}256`;else if(i.type==="address payable")l="address";else if(l=i.type,(e==null?void 0:e.type)!=="struct"&&!RX(l))throw new qbe({type:l});if(i.modifier){if(!((y=(p=e==null?void 0:e.modifiers)==null?void 0:p.has)!=null&&y.call(p,i.modifier)))throw new Ybe({param:t,type:e==null?void 0:e.type,modifier:i.modifier});if(gk.has(i.modifier)&&!p4e(l,!!i.array))throw new Jbe({param:t,type:e==null?void 0:e.type,modifier:i.modifier})}const f={type:`${l}${i.array??""}`,...s,...a,...u};return PC.set(n,f),f}function Ba(t,e=[],n="",r=0){const i=t.trim().length;for(let s=0;s<i;s++){const a=t[s],o=t.slice(s+1);switch(a){case",":return r===0?Ba(o,[...e,n.trim()]):Ba(o,e,`${n}${a}`,r);case"(":return Ba(o,e,`${n}${a}`,r+1);case")":return Ba(o,e,`${n}${a}`,r-1);default:return Ba(o,e,`${n}${a}`,r)}}if(n==="")return e;if(r!==0)throw new n4e({current:n,depth:r});return e.push(n.trim()),e}function RX(t){return t==="address"||t==="bool"||t==="function"||t==="string"||AX.test(t)||kX.test(t)}const h4e=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;function f4e(t){return t==="address"||t==="bool"||t==="function"||t==="string"||t==="tuple"||AX.test(t)||kX.test(t)||h4e.test(t)}function p4e(t,e){return e||t==="bytes"||t==="string"||t==="tuple"}function TI(t){const e={},n=t.length;for(let a=0;a<n;a++){const o=t[a];if(!u7(o))continue;const l=jbe(o);if(!l)throw new K1({signature:o,type:"struct"});const u=l.properties.split(";"),f=[],p=u.length;for(let y=0;y<p;y++){const b=u[y].trim();if(!b)continue;const v=Iu(b,{type:"struct"});f.push(v)}if(!f.length)throw new e4e({signature:o});e[l.name]=f}const r={},i=Object.entries(e),s=i.length;for(let a=0;a<s;a++){const[o,l]=i[a];r[o]=jX(l,e)}return r}const m4e=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function jX(t=[],e={},n=new Set){const r=[],i=t.length;for(let s=0;s<i;s++){const a=t[s];if(TX.test(a.type))r.push(a);else{const l=Wu(m4e,a.type);if(!(l!=null&&l.type))throw new Xbe({abiParameter:a});const{array:u,type:f}=l;if(f in e){if(n.has(f))throw new t4e({type:f});r.push({...a,type:`tuple${u??""}`,components:jX(e[f],e,new Set([...n,f]))})}else if(RX(f))r.push(a);else throw new Wbe({type:f})}}return r}function MX(t){const e=TI(t),n=[],r=t.length;for(let i=0;i<r;i++){const s=t[i];u7(s)||n.push(bk(s,e))}return n}function FB(t){let e;if(typeof t=="string")e=bk(t);else{const n=TI(t),r=t.length;for(let i=0;i<r;i++){const s=t[i];if(!u7(s)){e=bk(s,n);break}}}if(!e)throw new Hbe({signature:t});return e}function zB(t){const e=[];if(typeof t=="string"){const n=Ba(t),r=n.length;for(let i=0;i<r;i++)e.push(Iu(n[i],{modifiers:BB}))}else{const n=TI(t),r=t.length;for(let i=0;i<r;i++){const s=t[i];if(u7(s))continue;const a=Ba(s),o=a.length;for(let l=0;l<o;l++)e.push(Iu(a[l],{modifiers:BB,structs:n}
447))}}if(e.length===0)throw new Zbe({params:t});return e}function Ye(t,e,n){const r=t[e.name];if(typeof r=="function")return r;const i=t[n];return typeof i=="function"?i:s=>e(t,s)}function wl(t,{includeName:e=!1}={}){if(t.type!=="function"&&t.type!=="event"&&t.type!=="error")throw new T4e(t.type);return`${t.name}(${d7(t.inputs,{includeName:e})})`}function d7(t,{includeName:e=!1}={}){return t?t.map(n=>y4e(n,{includeName:e})).join(e?", ":","):""}function y4e(t,{includeName:e}){return t.type.startsWith("tuple")?`(${d7(t.components,{includeName:e})})${t.type.slice(5)}`:t.type+(e&&t.name?` ${t.name}`:"")}function Ss(t,{strict:e=!0}={}){return!t||typeof t!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(t):t.startsWith("0x")}function Ar(t){return Ss(t,{strict:!1})?Math.ceil((t.length-2)/2):t.length}const DX="2.56.0";let _y={getDocsUrl:({docsBaseUrl:t,docsPath:e="",docsSlug:n})=>e?`${t??"https://viem.sh"}${e}${n?`#${n}`:""}`:void 0,version:`viem@${DX}`},Se=class wk extends Error{constructor(e,n={}){var o;const r=(()=>{var l;return n.cause instanceof wk?n.cause.details:(l=n.cause)!=null&&l.message?n.cause.message:n.details})(),i=n.cause instanceof wk&&n.cause.docsPath||n.docsPath,s=(o=_y.getDocsUrl)==null?void 0:o.call(_y,{...n,docsPath:i}),a=[e||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: ${s}`]:[],...r?[`Details: ${r}`]:[],..._y.version?[`Version: ${_y.version}`]:[]].join(` 448`);super(a,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=r,this.docsPath=i,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=e,this.version=DX}walk(e){return UX(this,e)}};function UX(t,e){return e!=null&&e(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause!==void 0?UX(t.cause,e):e?null:t}class BX extends Se{constructor({docsPath:e}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(` 449`),{docsPath:e,name:"AbiConstructorNotFoundError"})}}class f8 extends Se{constructor({docsPath:e}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(` 450`),{docsPath:e,name:"AbiConstructorParamsNotFoundError"})}}class FX extends Se{constructor({data:e,params:n,size:r}){super([`Data size of ${r} bytes is too small for given parameters.`].join(` 451`),{metaMessages:[`Params: (${d7(n,{includeName:!0})})`,`Data: ${e} (${r} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e,this.params=n,this.size=r}}class D6 extends Se{constructor({cause:e}={}){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError",cause:e})}}class g4e extends Se{constructor({expectedLength:e,givenLength:n,type:r}){super([`ABI encoding array length mismatch for type ${r}.`,`Expected length: ${e}`,`Given length: ${n}`].join(` 452`),{name:"AbiEncodingArrayLengthMismatchError"})}}class b4e extends Se{constructor({expectedSize:e,value:n}){super(`Size of bytes "${n}" (bytes${Ar(n)}) does not match expected size (bytes${e}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class w4e extends Se{constructor({expectedLength:e,givenLength:n}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${n}`].join(` 453`),{name:"AbiEncodingLengthMismatchError"})}}class v4e extends Se{constructor(e,{docsPath:n}){super([`Arguments (\`args\`) were provided to "${e}", but "${e}" on the ABI does not contain any parameters (\`inputs\`).`,"Cannot encode error result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the inputs exist on it."].join(` 454`),{docsPath:n,name:"AbiErrorInputsNotFoundError"})}}class VB extends Se{constructor(e,{docsPath:n}={}){super([`Error ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it."].join(` 455`),{docsPath:n,name:"AbiErrorNotFoundError"})}}class zX extends Se{constructor(e,{docsPath:n,cause:r}){super([`Encoded error signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://4byte.sourcify.dev/?q=${e}.`].join(` 456`),{docsPath:n,name:"AbiErrorSignatureNotFoundError",cause:r}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=e}}class _4e extends Se{constructor({docsPath:e}){super("Cannot extract event signature from empty topics.",{docsPath:e,name:"AbiEventSignatureEmptyTopicsError"})}}class x4e extends Se{constructor(e,{docsPath:n}){super([`Encoded event signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://4byte.sourcify.dev/?q=${e}.`].join(` 457`),{docsPath:n,name:"AbiEventSignatureNotFoundError"})}}class HB extends Se{constructor(e,{docsPath:n}={}){super([`Event ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join(` 458`),{docsPath:n,name:"AbiEventNotFoundError"})}}class s1 extends Se{constructor(e,{docsPath:n}={}){super([`Function ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(` 459`),{docsPath:n,name:"AbiFunctionNotFoundError"})}}class VX extends Se{constructor(e,{docsPath:n}){super([`Function "${e}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(` 460`),{docsPath:n,name:"AbiFunctionOutputsNotFoundError"})}}class C4e extends Se{constructor(e,{docsPath:n}){super([`Encoded function signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it.",`You can look up the signature here: https://4byte.sourcify.dev/?q=${e}.`].join(` 461`),{docsPath:n,name:"AbiFunctionSignatureNotFoundError"})}}class E4e extends Se{constructor(e,n){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${wl(e.abiItem)}\`, and`,`\`${n.type}\` in \`${wl(n.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}let S4e=class extends Se{constructor({expectedSize:e,givenSize:n}){super(`Expected bytes${e}, got bytes${n}.`,{name:"BytesSizeMismatchError"})}};class p8 extends Se{constructor({abiItem:e,data:n,params:r,size:i}){super([`Data size of ${i} bytes is too small for non-indexed event parameters.`].join(` 462`),{metaMessages:[`Params: (${d7(r,{includeName:!0})})`,`Data: ${n} (${i} bytes)`],name:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e,this.data=n,this.params=r,this.size=i}}class LI extends Se{constructor({abiItem:e,param:n}){super([`Expected a topic for indexed event parameter${n.name?` "${n.name}"`:""} on event "${wl(e,{includeName:!0})}".`].join(` 463`),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e}}class A4e extends Se{constructor(e,{docsPath:n}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(` 464`),{docsPath:n,name:"InvalidAbiEncodingType"})}}class k4e extends Se{constructor(e,{docsPath:n}){super([`Type "${e}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(` 465`),{docsPath:n,name:"InvalidAbiDecodingType"})}}let HX=class extends Se{constructor(e){super([`Value "${e}" is not a valid array.`].join(` 466`),{name:"InvalidArrayError"})}};class T4e extends Se{constructor(e){super([`"${e}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(` 467`),{name:"InvalidDefinitionTypeError"})}}class Hyt extends Se{constructor(e){super(`Type "${e}" is not supported for packed encoding.`,{name:"UnsupportedPackedAbiType"})}}class L4e extends Se{constructor(e){super(`Filter type "${e}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}let WX=class extends Se{constructor({offset:e,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}},qX=class extends Se{constructor({size:e,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${e}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}};class WB extends Se{constructor({size:e,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} is expected to be ${n} ${r} long, but is ${e} ${r} long.`,{name:"InvalidBytesLengthError"})}}function D2(t,{dir:e,size:n=32}={}){return typeof t=="string"?g2(t,{dir:e,size:n}):$4e(t,{dir:e,size:n})}function g2(t,{dir:e,size:n=32}={}){if(n===null)return t;const r=t.replace("0x","");if(r.length>n*2)throw new qX({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[e==="right"?"padEnd":"padStart"](n*2,"0")}`}function $4e(t,{dir:e,size:n=32}={}){if(n===null)return t;if(t.length>n)throw new qX({size:t.length,targetSize:n,type:"bytes"});
467const r=new Uint8Array(n);for(let i=0;i<n;i++){const s=e==="right";r[s?i:n-i-1]=t[s?i:t.length-i-1]}return r}let $I=class extends Se{constructor({max:e,min:n,signed:r,size:i,value:s}){super(`Number "${s}" is not in safe ${i?`${i*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${e?`(${n} to ${e})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}},I4e=class extends Se{constructor(e){super(`Bytes value "${e}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}};class N4e extends Se{constructor(e){super(`Hex value "${e}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}}let O4e=class extends Se{constructor({givenSize:e,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}};function za(t,{dir:e="left"}={}){let n=typeof t=="string"?t.replace("0x",""):t,r=0;for(let i=0;i<n.length-1&&n[e==="left"?i:n.length-i-1].toString()==="0";i++)r++;return n=e==="left"?n.slice(r):n.slice(0,n.length-r),typeof t=="string"?(n.length===1&&e==="right"&&(n=`${n}0`),`0x${n.length%2===1?`0${n}`:n}`):n}function jo(t,{size:e}){if(Ar(t)>e)throw new O4e({givenSize:Ar(t),maxSize:e})}function Rn(t,e={}){const{signed:n}=e;e.size&&jo(t,{size:e.size});const r=BigInt(t);if(!n)return r;const i=(t.length-2)/2,s=(1n<<BigInt(i)*8n-1n)-1n;return r<=s?r:r-BigInt(`0x${"f".padStart(i*2,"f")}`)-1n}function P4e(t,e={}){let n=t;if(e.size&&(jo(n,{size:e.size}),n=za(n)),za(n)==="0x00")return!1;if(za(n)==="0x01")return!0;throw new N4e(n)}function da(t,e={}){const n=Rn(t,e),r=Number(n);if(!Number.isSafeInteger(r))throw new $I({max:`${Number.MAX_SAFE_INTEGER}`,min:`${Number.MIN_SAFE_INTEGER}`,signed:e.signed,size:e.size,value:`${n}n`});return r}function Yyt(t,e={}){let n=Os(t);return e.size&&(jo(n,{size:e.size}),n=za(n,{dir:"right"})),new TextDecoder().decode(n)}const R4e=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Dt(t,e={}){return typeof t=="number"||typeof t=="bigint"?ze(t,e):typeof t=="string"?h3(t,e):typeof t=="boolean"?ZX(t,e):_i(t,e)}function ZX(t,e={}){const n=`0x${Number(t)}`;return typeof e.size=="number"?(jo(n,{size:e.size}),D2(n,{size:e.size})):n}function _i(t,e={}){let n="";for(let i=0;i<t.length;i++)n+=R4e[t[i]];const r=`0x${n}`;return typeof e.size=="number"?(jo(r,{size:e.size}),D2(r,{dir:"right",size:e.size})):r}function ze(t,e={}){const{signed:n,size:r}=e,i=BigInt(t);let s;r?n?s=(1n<<BigInt(r)*8n-1n)-1n:s=2n**(BigInt(r)*8n)-1n:typeof t=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));const a=typeof s=="bigint"&&n?-s-1n:0;if(s&&i>s||i<a){const l=typeof t=="bigint"?"n":"";throw new $I({max:s?`${s}${l}`:void 0,min:`${a}${l}`,signed:n,size:r,value:`${t}${l}`})}const o=`0x${(n&&i<0?(1n<<BigInt(r*8))+BigInt(i):i).toString(16)}`;return r?D2(o,{size:r}):o}const j4e=new TextEncoder;function h3(t,e={}){const n=j4e.encode(t);return _i(n,e)}const M4e=new TextEncoder;function xu(t,e={}){return typeof t=="number"||typeof t=="bigint"?U4e(t,e):typeof t=="boolean"?D4e(t,e):Ss(t)?Os(t,e):of(t,e)}function D4e(t,e={}){const n=new Uint8Array(1);return n[0]=Number(t),typeof e.size=="number"?(jo(n,{size:e.size}),D2(n,{size:e.size})):n}const Bc={zero:48,nine:57,A:65,F:70,a:97,f:102};function qB(t){if(t>=Bc.zero&&t<=Bc.nine)return t-Bc.zero;if(t>=Bc.A&&t<=Bc.F)return t-(Bc.A-10);if(t>=Bc.a&&t<=Bc.f)return t-(Bc.a-10)}function Os(t,e={}){let n=t;e.size&&(jo(n,{size:e.size}),n=D2(n,{dir:"right",size:e.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const i=r.length/2,s=new Uint8Array(i);for(let a=0,o=0;a<i;a++){const l=qB(r.charCodeAt(o++)),u=qB(r.charCodeAt(o++));if(l===void 0||u===void 0)throw new Se(`Invalid byte sequence ("${r[o-2]}${r[o-1]}" in "${r}").`);s[a]=l*16+u}return s}function U4e(t,e){const n=ze(t,e);return Os(n)}function of(t,e={}){const n=M4e.encode(t);return typeof e.size=="number"?(jo(n,{size:e.size}),D2(n,{dir:"right",size:e.size})):n}const f4=BigInt(2**32-1),ZB=BigInt(32);function B4e(t,e=!1){return e?{h:Number(t&f4),l:Number(t>>ZB&f4)}:{h:Number(t>>ZB&f4)|0,l:Number(t&f4)|0}}function KX(t,e=!1){const n=t.length;let r=new Uint32Array(n),i=new Uint32Array(n);for(let s=0;s<n;s++){const{h:a,l:o}=B4e(t[s],e);[r[s],i[s]]=[a,o]}return[r,i]}const KB=(t,e,n)=>t>>>n,GB=(t,e,n)=>t<<32-n|e>>>n,Yp=(t,e,n)=>t>>>n|e<<32-n,Jp=(t,e,n)=>t<<32-n|e>>>n,p4=(t,e,n)=>t<<64-n|e>>>n-32,m4=(t,e,n)=>t>>>n-32|e<<64-n,F4e=(t,e,n)=>t<<n|e>>>32-n,z4e=(t,e,n)=>e<<n|t>>>32-n,V4e=(t,e,n)=>e<<n-32|t>>>64-n,H4e=(t,e,n)=>t<<n-32|e>>>64-n;function Fc(t,e,n,r){const i=(e>>>0)+(r>>>0);return{h:t+n+(i/2**32|0)|0,l:i|0}}const W4e=(t,e,n)=>(t>>>0)+(e>>>0)+(n>>>0),q4e=(t,e,n,r)=>e+n+r+(t/2**32|0)|0,Z4e=(t,e,n,r)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0),K4e=(t,e,n,r,i)=>e+n+r+i+(t/2**32|0)|0,G4e=(t,e,n,r,i)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0)+(i>>>0),Y4e=(t,e,n,r,i,s)=>e+n+r+i+s+(t/2**32|0)|0,Xp=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function J4e(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function f3(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function wf(t,...e){if(!J4e(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function X4e(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");f3(t.outputLen),f3(t.blockLen)}function a1(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function GX(t,e){wf(t);const n=e.outputLen;if(t.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function Q4e(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function S2(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function RC(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function Il(t,e){return t<<32-e|t>>>e}const ewe=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function twe(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function nwe(t){for(let e=0;e<t.length;e++)t[e]=twe(t[e]);return t}const YB=ewe?t=>t:nwe;function rwe(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function h7(t){return typeof t=="string"&&(t=rwe(t)),wf(t),t}function iwe(...t){let e=0;for(let r=0;r<t.length;r++){const i=t[r];wf(i),e+=i.length}const n=new Uint8Array(e);for(let r=0,i=0;r<t.length;r++){const s=t[r];n.set(s,i),i+=s.length}return n}let II=class{};function f7(t){const e=r=>t().update(h7(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function swe(t=32){if(Xp&&typeof Xp.getRandomValues=="function")return Xp.getRandomValues(new Uint8Array(t));if(Xp&&typeof Xp.randomBytes=="function")return Uint8Array.from(Xp.randomBytes(t));throw new Error("crypto.getRandomValues must be defined")}const awe=BigInt(0),xy=BigInt(1),owe=BigInt(2),lwe=BigInt(7),cwe=BigInt(256),uwe=BigInt(113),YX=[],JX=[],XX=[];for(let t=0,e=xy,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],YX.push(2*(5*r+n)),JX.push((t+1)*(t+2)/2%64);let i=awe;for(let s=0;s<7;s++)e=(e<<xy^(e>>lwe)*uwe)%cwe,e&owe&&(i^=xy<<(xy<<BigInt(s))-xy);XX.push(i)}const QX=KX(XX,!0),dwe=QX[0],hwe=QX[1],JB=(t,e,n)=>n>
46732?V4e(t,e,n):F4e(t,e,n),XB=(t,e,n)=>n>32?H4e(t,e,n):z4e(t,e,n);function fwe(t,e=24){const n=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let a=0;a<10;a++)n[a]=t[a]^t[a+10]^t[a+20]^t[a+30]^t[a+40];for(let a=0;a<10;a+=2){const o=(a+8)%10,l=(a+2)%10,u=n[l],f=n[l+1],p=JB(u,f,1)^n[o],y=XB(u,f,1)^n[o+1];for(let g=0;g<50;g+=10)t[a+g]^=p,t[a+g+1]^=y}let i=t[2],s=t[3];for(let a=0;a<24;a++){const o=JX[a],l=JB(i,s,o),u=XB(i,s,o),f=YX[a];i=t[f],s=t[f+1],t[f]=l,t[f+1]=u}for(let a=0;a<50;a+=10){for(let o=0;o<10;o++)n[o]=t[a+o];for(let o=0;o<10;o++)t[a+o]^=~n[(o+2)%10]&n[(o+4)%10]}t[0]^=dwe[r],t[1]^=hwe[r]}S2(n)}let pwe=class eQ extends II{constructor(e,n,r,i=!1,s=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=n,this.outputLen=r,this.enableXOF=i,this.rounds=s,f3(r),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=Q4e(this.state)}clone(){return this._cloneInto()}keccak(){YB(this.state32),fwe(this.state32,this.rounds),YB(this.state32),this.posOut=0,this.pos=0}update(e){a1(this),e=h7(e),wf(e);const{blockLen:n,state:r}=this,i=e.length;for(let s=0;s<i;){const a=Math.min(n-this.pos,i-s);for(let o=0;o<a;o++)r[this.pos++]^=e[s++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:n,pos:r,blockLen:i}=this;e[r]^=n,(n&128)!==0&&r===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){a1(this,!1),wf(e),this.finish();const n=this.state,{blockLen:r}=this;for(let i=0,s=e.length;i<s;){this.posOut>=r&&this.keccak();const a=Math.min(r-this.posOut,s-i);e.set(n.subarray(this.posOut,this.posOut+a),i),this.posOut+=a,i+=a}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return f3(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(GX(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,S2(this.state)}_cloneInto(e){const{blockLen:n,suffix:r,outputLen:i,rounds:s,enableXOF:a}=this;return e||(e=new eQ(n,r,i,a,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=r,e.outputLen=i,e.enableXOF=a,e.destroyed=this.destroyed,e}};const mwe=(t,e,n)=>f7(()=>new pwe(e,t,n)),tQ=mwe(1,136,256/8);function Ni(t,e){const n=e||"hex",r=tQ(Ss(t,{strict:!1})?xu(t):t);return n==="bytes"?r:Dt(r)}const ywe=t=>Ni(xu(t));function gwe(t){return ywe(t)}function bwe(t){let e=!0,n="",r=0,i="",s=!1;for(let a=0;a<t.length;a++){const o=t[a];if(["(",")",","].includes(o)&&(e=!0),o==="("&&r++,o===")"&&r--,!!e){if(r===0){if(o===" "&&["event","function",""].includes(i))i="";else if(i+=o,o===")"){s=!0;break}continue}if(o===" "){t[a-1]!==","&&n!==","&&n!==",("&&(n="",e=!1);continue}i+=o,n+=o}}if(!s)throw new Se("Unable to normalize signature.");return i}const wwe=t=>{const e=typeof t=="string"?t:h8(t);return bwe(e)};function nQ(t){return gwe(wwe(t))}const p7=nQ;let vi=class extends Se{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}},G1=class extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const n=super.get(e);return super.has(e)&&(super.delete(e),super.set(e,n)),n}set(e,n){if(super.has(e)&&super.delete(e),super.set(e,n),this.maxSize&&this.size>this.maxSize){const r=super.keys().next().value;r!==void 0&&super.delete(r)}return this}};const jC=new G1(8192);function U6(t,e){if(jC.has(`${t}.${e}`))return jC.get(`${t}.${e}`);const n=t.substring(2).toLowerCase(),r=Ni(of(n),"bytes"),i=n.split("");for(let a=0;a<40;a+=2)r[a>>
4671]>>4>=8&&i[a]&&(i[a]=i[a].toUpperCase()),(r[a>>1]&15)>=8&&i[a+1]&&(i[a+1]=i[a+1].toUpperCase());const s=`0x${i.join("")}`;return jC.set(`${t}.${e}`,s),s}function Vi(t,e){if(!Yn(t,{strict:!1}))throw new vi({address:t});return U6(t,e)}const vwe=/^0x[a-fA-F0-9]{40}$/,MC=new G1(8192);function Yn(t,e){const{strict:n=!0}=e??{},r=`${t}.${n}`;if(MC.has(r))return MC.get(r);const i=vwe.test(t)?t.toLowerCase()===t?!0:n?U6(t)===t:!0:!1;return MC.set(r,i),i}function ac(t){return typeof t[0]=="string"?Wi(t):_we(t)}function _we(t){let e=0;for(const i of t)e+=i.length;const n=new Uint8Array(e);let r=0;for(const i of t)n.set(i,r),r+=i.length;return n}function Wi(t){return`0x${t.reduce((e,n)=>e+n.replace("0x",""),"")}`}function A2(t,e,n,{strict:r}={}){return Ss(t,{strict:!1})?vk(t,e,n,{strict:r}):sQ(t,e,n,{strict:r})}function rQ(t,e){if(typeof e=="number"&&e>0&&e>Ar(t)-1)throw new WX({offset:e,position:"start",size:Ar(t)})}function iQ(t,e,n){if(typeof e=="number"&&typeof n=="number"&&Ar(t)!==n-e)throw new WX({offset:n,position:"end",size:Ar(t)})}function sQ(t,e,n,{strict:r}={}){rQ(t,e);const i=t.slice(e,n);return r&&iQ(i,e,n),i}function vk(t,e,n,{strict:r}={}){rQ(t,e);const i=`0x${t.replace("0x","").slice((e??0)*2,(n??t.length)*2)}`;return r&&iQ(i,e,n),i}const egt=/^(.*)\[([0-9]*)\]$/,xwe=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,aQ=/^(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 U2(t,e){if(t.length!==e.length)throw new w4e({expectedLength:t.length,givenLength:e.length});const n=Cwe({params:t,values:e});return OI(n)}function Cwe({params:t,values:e}){const n=[];for(let r=0;r<t.length;r++)n.push(NI({param:t[r],value:e[r]}));return n}function NI({param:t,value:e}){const n=m7(t.type);if(n){const[r,i]=n;return Swe(e,{length:r,param:{...t,type:i}})}if(t.type==="tuple")return $we(e,{param:t});if(t.type==="address")return Ewe(e);if(t.type==="bool")return kwe(e);if(t.type.startsWith("uint")||t.type.startsWith("int")){const r=t.type.startsWith("int"),[,,i="256"]=aQ.exec(t.type)??[];return Twe(e,{signed:r,size:Number(i)})}if(t.type.startsWith("bytes"))return Awe(e,{param:t});if(t.type==="string")return Lwe(e);throw new A4e(t.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function OI(t){let e=0;for(let s=0;s<t.length;s++){const{dynamic:a,encoded:o}=t[s];a?e+=32:e+=Ar(o)}const n=[],r=[];let i=0;for(let s=0;s<t.length;s++){const{dynamic:a,encoded:o}=t[s];a?(n.push(ze(e+i,{size:32})),r.push(o),i+=Ar(o)):n.push(o)}return Wi([...n,...r])}function Ewe(t){if(!Yn(t))throw new vi({address:t});return{dynamic:!1,encoded:g2(t.toLowerCase())}}function Swe(t,{length:e,param:n}){const r=e===null;if(!Array.isArray(t))throw new HX(t);if(!r&&t.length!==e)throw new g4e({expectedLength:e,givenLength:t.length,type:`${n.type}[${e}]`});let i=t.length===0&&_k(n);const s=[];for(let a=0;a<t.length;a++){const o=NI({param:n,value:t[a]});o.dynamic&&(i=!0),s.push(o)}if(r||i){const a=OI(s);if(r){const o=ze(s.length,{size:32});return{dynamic:!0,encoded:Wi([o,a])}}if(i)return{dynamic:!0,encoded:a}}return{dynamic:!1,encoded:Wi(s.map(({encoded:a})=>a))}}function Awe(t,{param:e}){const[,n]=e.type.split("bytes"),r=Ar(t);if(!n){let i=t;return r%32!==0&&(i=g2(i,{dir:"right",size:Math.ceil((t.length-2)/2/32)*32})),{dynamic:!0,encoded:Wi([g2(ze(r,{size:32})),i])}}if(r!==Number.parseInt(n,10))throw new b4e({expectedSize:Number.parseInt(n,10),value:t});return{dynamic:!1,encoded:g2(t,{dir:"right"})}}function kwe(t){if(typeof t!="boolean")throw new Se(`Invalid boolean value: "${t}" (type: ${typeof t}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:g2(ZX(t))}}function Twe(t,{signed:e,size:n=256}){if(typeof n=="number"){const r=2n**(BigInt(n)-(e?1n:0n))-1n,i=e?-r-1n:0n;if(t>r||t<i)throw new $I({max:r.toString(),min:i.toString(),signed:e,size:n/8,value:t.toString()})}return{dynamic:!1,encoded:ze(t,{size:32,signed:e})}}function Lwe(t){const e=h3(t),n=Math.ceil(Ar(e)/32),r=[];for(let i=0;i<n;i++)r.push(g2(A2(e,i*32,(i+1)*32),{dir:"right"}));return{dynamic:!0,encoded:Wi([g2(ze(Ar(e),{size:32})),...r])}}function $we(t,{param:e}){let n=!1;const r=[];for(let i=0;i<e.components.length;i++){const s=e.components[i],a=Array.isArray(t)?i:s.name,o=NI({param:s,value:t[a]});r.push(o),o.dynamic&&(n=!0)}return{dynamic:n,encoded:n?OI(r):Wi(r.map(({encoded:i})=>i))}}function m7(t){const e=t.match(/^(.*)\[(\d+)?\]$/);return e?[e[2]?Number(e[2]):null,e[1]]:void 0}function _k(t){const{type:e}=t;if(e==="string"||e==="bytes"||e.endsWith("[]"))return!0;
467if(e==="tuple")return t.components.some(_k);const n=m7(e);return n?_k({...t,type:n[1]}):!1}const B6=t=>A2(nQ(t),0,4);function Zf(t){const{abi:e,args:n=[],name:r}=t,i=Ss(r,{strict:!1}),s=e.filter(o=>i?o.type==="function"?B6(o)===r:o.type==="event"?p7(o)===r:!1:"name"in o&&o.name===r);if(s.length===0)return;if(s.length===1)return s[0];let a;for(const o of s){if(!("inputs"in o))continue;if(!n||n.length===0){if(!o.inputs||o.inputs.length===0)return o;continue}if(!o.inputs||o.inputs.length===0||o.inputs.length!==n.length)continue;if(n.every((u,f)=>{const p="inputs"in o&&o.inputs[f];return p?xk(u,p):!1})){if(a&&"inputs"in a&&a.inputs){const u=oQ(o.inputs,a.inputs,n);if(u)throw new E4e({abiItem:o,type:u[0]},{abiItem:a,type:u[1]})}a=o}}return a||s[0]}function xk(t,e){const n=typeof t,r=e.type;switch(r){case"address":return Yn(t,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in e?Object.values(e.components).every((i,s)=>n==="object"&&xk(Object.values(t)[s],i)):/^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(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||t instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(t)&&t.every(i=>xk(i,{...e,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function oQ(t,e,n){for(const r in t){const i=t[r],s=e[r];if(i.type==="tuple"&&s.type==="tuple"&&"components"in i&&"components"in s)return oQ(i.components,s.components,n[r]);const a=[i.type,s.type];if(a.includes("address")&&a.includes("bytes20")?!0:a.includes("address")&&a.includes("string")?Yn(n[r],{strict:!1}):a.includes("address")&&a.includes("bytes")?Yn(n[r],{strict:!1}):!1)return a}}const QB="/docs/contract/encodeEventTopics";function F6(t){var l;const{abi:e,eventName:n,args:r}=t;let i=e[0];if(n){const u=Zf({abi:e,name:n});if(!u)throw new HB(n,{docsPath:QB});i=u}if(i.type!=="event")throw new HB(void 0,{docsPath:QB});let s=[];if(r&&"inputs"in i){const u=(l=i.inputs)==null?void 0:l.filter(p=>"indexed"in p&&p.indexed),f=Array.isArray(r)?r:Object.values(r).length>0?(u==null?void 0:u.map(p=>r[p.name]))??[]:[];f.length>0&&(s=(u==null?void 0:u.map((p,y)=>Array.isArray(f[y])?f[y].map((g,b)=>eF({param:p,value:f[y][b]})):typeof f[y]<"u"&&f[y]!==null?eF({param:p,value:f[y]}):null))??[])}if(i.anonymous)return s;const a=wl(i);return[p7(a),...s]}function eF({param:t,value:e}){if(t.type==="string"||t.type==="bytes")return Ni(xu(e));if(t.type==="tuple"||t.type.match(/^(.*)\[(\d+)?\]$/))throw new L4e(t.type);return U2([t],[e])}function y7(t,{method:e}){var r,i;const n={};return t.transport.type==="fallback"&&((i=(r=t.transport).onResponse)==null||i.call(r,({method:s,response:a,status:o,transport:l})=>{o==="success"&&e===s&&(n[a]=l.request)})),(s=>n[s]||t.request)}async function lQ(t,e){const{address:n,abi:r,args:i,eventName:s,fromBlock:a,strict:o,toBlock:l}=e,u=y7(t,{method:"eth_newFilter"}),f=s?F6({abi:r,args:i,eventName:s}):void 0,p=await t.request({method:"eth_newFilter",params:[{address:n,fromBlock:typeof a=="bigint"?ze(a):a,toBlock:typeof l=="bigint"?ze(l):l,topics:f}]});return{abi:r,args:i,eventName:s,id:p,request:u(p),strict:!!o,type:"event"}}function hn(t){return typeof t=="string"?{address:t,type:"json-rpc"}:t}const tF="/docs/contract/encodeFunctionData";function Iwe(t){const{abi:e,args:n,functionName:r}=t;let i=e[0];if(r){const s=Zf({abi:e,args:n,name:r});if(!s)throw new s1(r,{docsPath:tF});i=s}if(i.type!=="function")throw new s1(void 0,{docsPath:tF});return{abi:[i],functionName:B6(wl(i))}}function cs(t){const{args:e}=t,{abi:n,functionName:r}=(()=>{var o;return t.abi.length===1&&((o=t.functionName)!=null&&o.startsWith("0x"))?t:Iwe(t)})(),i=n[0],s=r,a="inputs"in i&&i.inputs?U2(i.inputs,e??[]):void 0;return Wi([s,a??"0x"])}const Nwe={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invali
467d type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},cQ={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},Owe={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};let nF=class extends Se{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`,{name:"NegativeOffsetError"})}},uQ=class extends Se{constructor({length:e,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${e}\`).`,{name:"PositionOutOfBoundsError"})}},Pwe=class extends Se{constructor({count:e,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${e}\`).`,{name:"RecursiveReadLimitExceededError"})}};const Rwe={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 Pwe({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(t){if(t<0||t>this.bytes.length-1)throw new uQ({length:this.bytes.length,position:t})},decrementPosition(t){if(t<0)throw new nF({offset:t});const e=this.position-t;this.assertPosition(e),this.position=e},getReadCount(t){return this.positionReadCount.get(t||this.position)||0},incrementPosition(t){if(t<0)throw new nF({offset:t});const e=this.position+t;this.assertPosition(e),this.position=e},inspectByte(t){const e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectBytes(t,e){const n=e??this.position;return this.assertPosition(n+t-1),this.bytes.subarray(n,n+t)},inspectUint8(t){const e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectUint16(t){const e=t??this.position;return this.assertPosition(e+1),this.dataView.getUint16(e)},inspectUint24(t){const e=t??this.position;return this.assertPosition(e+2),(this.dataView.getUint16(e)<<8)+this.dataView.getUint8(e+2)},inspectUint32(t){const e=t??this.position;return this.assertPosition(e+3),this.dataView.getUint32(e)},pushByte(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushBytes(t){this.assertPosition(this.position+t.length-1),this.bytes.set(t,this.position),this.position+=t.length},pushUint8(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushUint16(t){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,t),this.position+=2},pushUint24(t){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,t>>8),this.dataView.setUint8(this.position+2,t&255),this.position+=3},pushUint32(t){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,t),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const t=this.inspectByte();return this.position++,t},readBytes(t,e){this.assertReadLimit(),this._touch();const n=this.inspectBytes(t);return this.position+=e??t,n},readUint8(){this.assertReadLimit(),this._touch();const t=this.inspectUint8();return this.position+=1,t},readUint16(){this.assertReadLimit(),this._touch();const t=this.inspectUint16();return this.position+=2,t},readUint24(){this.assertReadLimit(),this._touch();const t=this.inspectUint24();return this.position+=3,t},readUint32(){this.assertReadLimit(),this._touch();const t=this.inspectUint32();return this.position+=4,t},get remaining(){return this.bytes.length-this.position},setPosition(t){const e=this.position;return this.assertPosition(t),this.position=t,()=>this.position=e},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const t=this.getReadCount();this.positionReadCount.set(this.position,t+1),t>0&&this.recursiveReadCount++}};function PI(t,{recursiveReadLimit:e=8192}={}){const n=Object.create(Rwe);return n.bytes=t,n.dataView=new DataView(t.buffer??t,t.byteOffset,t.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=e,n}function jwe(t,e={}){typeof e.size<"u"&&jo(t,{size:e.size});const n=_i(t);return Rn(n,e)}function Mwe(t,e={}){let n=t;if(typeof e.size<"u"&&(jo(n,{size:e.size}),n=za(n)),n.length>1||n[0]>1)throw new I4e(n);return!!n[0]}function Cu(t,e={}){typeof e.size<"u"&&jo(t,{size:e.size});const n=_i(t);return da(n,e)}function Dwe(t,e={}){let n=t;return typeof e.size<"u"&&(jo(n,{size:e.size}),n=za(n,{dir:"right"})),new TextDecoder().decode(n)}function z6(t,e){const n=typeof e=="string"?Os(e):e,r=PI(n);if(Ar(n)===0&&t.length>0)throw new D6;if(Ar(e)&&Ar(e)<32)throw new FX({data:typeof e=="string"?e:_i(e),params:t,size:Ar(e)});let i=0;const s=[];for(let a=0;a<t.length;++a){const o=t[a];i<n.length&&r.setPosition(i);const[l,u]=F0(r,o,{staticPosition:0});i+=u,s.push(l)}return s}function F0(t,e,{staticPosition:n}){const r=m7(e.type);if(r){const[i,s]=r;return Bwe(t,{...e,type:s},{length:i,staticPosition:n})}if(e.type==="tuple")return Hwe(t,e,{staticPosition:n});if(e.type==="address")return Uwe(t);if(e.type==="bool")return Fwe(t);if(e.type.startsWith("bytes"))return zwe(t,e,{staticPosition:n});if(e.type.startsWith("uint")||e.type.startsWith("int"))return Vwe(t,e);if(e.type==="string")return Wwe(t,{staticPosition:n});throw new k4e(e.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const rF=32,Ck=32;function Uwe(t){const e=t.readBytes(32);return[U6(_i(sQ(e,-20))),32]}function Bwe(t,e,{length:n,staticPosition:r}){if(n===null){const a=Cu(t.readBytes(Ck)),o=r+a,l=o+rF;t.setPosition(o);const u=Cu(t.readBytes(rF)),f=p3(e);let p=0;const y=[];for(let g=0;g<u;++g){t.setPosition(l+(f?g*32:p));const[b,v]=F0(t,e,{staticPosition:l});p+=v,y.push(b),v===0&&(t.assertReadLimit(),t._touch())}return t.setPosition(r+32),[y,32]}if(p3(e)){const a=Cu(t.readBytes(Ck)),o=r+a,l=[];for(let u=0;u<n;++u){t.setPosition(o+u*32);const[f]=F0(t,e,{staticPosition:o});l.push(f)}return t.setPosition(r+32),[l,32]}let i=0;const s=[];for(let a=0;a<n;++a){const[o,l]=F0(t,e,{staticPosition:r+i});i+=l,s.push(o),l===0&&(t.assertReadLimit(),t._touch())}return[s,i]}function Fwe(t){return[Mwe(t.readBytes(32),{size:32}),32]}function zwe(t,e,{staticPosition:n}){const[r,i]=e.type.split("bytes");if(!i){const a=Cu(t.readBytes(32));t.setPosition(n+a);const o=Cu(t.readBytes(32));if(o===0)return t.setPosition(n+32),["0x",32];const l=t.readBytes(o);return t.setPosition(n+32),[_i(l),32]}return[_i(t.readBytes(Number.parseInt(i,10),32)),32]}function Vwe(t,e){const n=e.type.startsWith("int"),r=Number.parseInt(e.type.split("int")[1]||"256",10),i=t.readBytes(32);return[r>48?jwe(i,{signed:n}):Cu(i,{signed:n}),32]}function Hwe(t,e,{staticPosition:n}){const r=e.components.length===0||e.components.some(({name:a})=>!a),i=r?[]:{};let s=0;if(p3(e)){const a=Cu(t.readBytes(Ck)),o=n+a;for(let l=0;l<e.components.length;++l){const u=e.components[l];t.setPosition(o+s);const[f,p]=F0(t,u,{staticPosition:o});s+=p,i[r?l:u==null?void 0:u.name]=f}return t.setPosition(n+32),[i,32]}for(let a=0;a<e.components.length;++a){const o=e.components[a],[l,u]=F0(t,o,{staticPosition:n});i[r?a:o==null?void 0:o.name]=l,s+=u}return[i,s]}function Wwe(t,{staticPosition:e}){const n=Cu(t.readBytes(32)),r=e+n;t.setPosition(r);const i=Cu(t.readBytes(32));if(i===0)return t.setPosition(e+32),["",32];const s=t.readBytes(i,32),a=Dwe(s);return t.setPosition(e+32),[a,32]}function p3(t){var r;const{type:e}=t;if(e==="string"||e==="bytes"||e.endsWith("[]"))return!0;
467if(e==="tuple")return(r=t.components)==null?void 0:r.some(p3);const n=m7(t.type);return!!(n&&p3({...t,type:n[1]}))}function qwe(t){const{abi:e,data:n,cause:r}=t,i=A2(n,0,4);if(i==="0x")throw new D6({cause:r});const a=[...e||[],cQ,Owe].find(o=>o.type==="error"&&i===B6(wl(o)));if(!a)throw new zX(i,{docsPath:"/docs/contract/decodeErrorResult",cause:r});return{abiItem:a,args:"inputs"in a&&a.inputs&&a.inputs.length>0?z6(a.inputs,A2(n,4)):void 0,errorName:a.name}}const ii=(t,e,n)=>JSON.stringify(t,(r,i)=>typeof i=="bigint"?i.toString():i,n);function dQ({abiItem:t,args:e,includeFunctionName:n=!0,includeName:r=!1}){if("name"in t&&"inputs"in t&&t.inputs)return`${n?t.name:""}(${t.inputs.map((i,s)=>`${r&&i.name?`${i.name}: `:""}${typeof e[s]=="object"?ii(e[s]):e[s]}`).join(", ")})`}const o1={wei:0,gwei:9,szabo:12,finney:15,ether:18};function RI(t,e=0){if(!Number.isInteger(e)||e<0)throw new fQ({decimals:e});let n=t.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(e,"0");let[i,s]=[n.slice(0,n.length-e),n.slice(n.length-e)];return s=s.replace(/(0+)$/,""),`${r?"-":""}${i||"0"}${s?`.${s}`:""}`}function Zwe(t,e="wei"){return RI(t,o1.ether-o1[e])}function Kwe(t,e="wei"){return RI(t,o1.gwei-o1[e])}function hQ(t,e=0){if(!Number.isInteger(e)||e<0)throw new fQ({decimals:e});if(!/^-?(?:[0-9]+(?:\.[0-9]*)?|\.[0-9]+)$/.test(t))throw new Ywe({value:t});let[n="",r="0"]=t.split(".");const i=n.startsWith("-");if(i&&(n=n.slice(1)),n===""&&(n="0"),r=r.replace(/(0+)$/,""),e===0)r.length>0&&Number.parseInt(r[0],10)>=5&&(n=`${BigInt(n)+1n}`),r="";else if(r.length>e){const s=r.slice(0,e);if(Number.parseInt(r.slice(e,e+1),10)>=5){const o=Gwe(s);o.length>e?(r=o.slice(1),n=`${BigInt(n)+1n}`):r=o}else r=s}else r=r.padEnd(e,"0");return BigInt(`${i?"-":""}${n}${r}`)}function Gwe(t){const e=t.split("");let n=e.length-1;for(;n>=0;){const r=Number.parseInt(e[n],10)+1;if(r<10)return e[n]=String(r),e.join("");e[n]="0",n--}return`1${e.join("")}`}function igt(t,e="wei"){return hQ(t,o1.ether-o1[e])}class Ywe extends Error{constructor({value:e}){super(`Value \`${e}\` is not a valid decimal number.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Value.InvalidDecimalNumberError"})}}class fQ extends Error{constructor({decimals:e}){super(`\`decimals\` must be a non-negative integer. Got \`${e}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Value.InvalidDecimalsError"})}}function g7(t,e="wei"){return Zwe(t,e)}function la(t,e="wei"){return Kwe(t,e)}class Jwe extends Se{constructor({address:e}){super(`State for account "${e}" is set multiple times.`,{name:"AccountStateConflictError"})}}class Xwe extends Se{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function iF(t){return t.reduce((e,{slot:n,value:r})=>`${e} ${n}: ${r} 468`,"")}function Qwe(t){return t.reduce((e,{address:n,...r})=>{let i=`${e} ${n}: 469`;return r.nonce&&(i+=` nonce: ${r.nonce} 470`),r.balance&&(i+=` balance: ${r.balance} 471`),r.code&&(i+=` code: ${r.code} 472`),r.state&&(i+=` state: 473`,i+=iF(r.state)),r.stateDiff&&(i+=` stateDiff: 474`,i+=iF(r.stateDiff)),i},` State Override: 475`).slice(0,-1)}function V6(t){const e=Object.entries(t).map(([r,i])=>i===void 0||i===!1?null:[r,i]).filter(Boolean),n=e.reduce((r,[i])=>Math.max(r,i.length),0);return e.map(([r,i])=>` ${`${r}:`.padEnd(n+1)} ${i}`).join(` 476`)}class pQ extends Se{constructor({filledNonce:e,requestedNonce:n}){super("The filled transaction nonce does not match the requested nonce.",{metaMessages:[`Requested Nonce: ${n}`,`Filled Nonce: ${e}`],name:"FeePayerNonceMismatchError"})}}class e8e extends Se{constructor({v:e}){super(`Invalid \`v\` value "${e}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class t8e extends Se{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",V6(e),"}","","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"})}}let n8e=class extends Se{constructor({storageKey:e}){super(`Size for storage key "${e}
476" is invalid. Expected 32 bytes. Got ${Math.floor((e.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}};class r8e extends Se{constructor(e,{account:n,docsPath:r,chain:i,data:s,gas:a,gasPrice:o,maxFeePerGas:l,maxPriorityFeePerGas:u,nonce:f,to:p,value:y}){var b;const g=V6({chain:i&&`${i==null?void 0:i.name} (id: ${i==null?void 0:i.id})`,from:n==null?void 0:n.address,to:p,value:typeof y<"u"&&`${g7(y)} ${((b=i==null?void 0:i.nativeCurrency)==null?void 0:b.symbol)||"ETH"}`,data:s,gas:a,gasPrice:typeof o<"u"&&`${la(o)} gwei`,maxFeePerGas:typeof l<"u"&&`${la(l)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${la(u)} gwei`,nonce:f});super(e.shortMessage,{cause:e,docsPath:r,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Request Arguments:",g].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class jI extends Se{constructor({blockHash:e,blockNumber:n,blockTag:r,hash:i,index:s}){let a="Transaction";r&&s!==void 0&&(a=`Transaction at block time "${r}" at index "${s}"`),e&&s!==void 0&&(a=`Transaction at block hash "${e}" at index "${s}"`),n&&s!==void 0&&(a=`Transaction at block number "${n}" at index "${s}"`),i&&(a=`Transaction with hash "${i}"`),super(`${a} could not be found.`,{name:"TransactionNotFoundError"})}}class mQ extends Se{constructor({hash:e}){super(`Transaction receipt with hash "${e}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}}class Ek extends Se{constructor({receipt:e}){super(`Transaction with hash "${e.transactionHash}" reverted.`,{metaMessages:['The receipt marked the transaction as "reverted". This could mean that the function on the contract you are trying to call threw an error.'," ","You can attempt to extract the revert reason by:","- calling the `simulateContract` or `simulateCalls` Action with the `abi` and `functionName` of the contract","- using the `call` Action with raw `data`"],name:"TransactionReceiptRevertedError"}),Object.defineProperty(this,"receipt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.receipt=e}}class i8e extends Se{constructor({hash:e}){super(`Timed out while waiting for transaction with hash "${e}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}const s8e=t=>t;function k2(t){if(t!=null&&t.reason)return t.reason;if(typeof DOMException=="function")return new DOMException("This operation was aborted","AbortError");const e=new Error("This operation was aborted");return e.name="AbortError",e}function Y1(t){return typeof t=="object"&&t!==null&&"name"in t&&t.name==="AbortError"}const MI=t=>{try{const e=new URL(t);return!e.username&&!e.password?t:(e.username="",e.password="",e.toString())}catch{return t}};class DI extends Se{constructor(e,{account:n,docsPath:r,chain:i,data:s,gas:a,gasPrice:o,maxFeePerGas:l,maxPriorityFeePerGas:u,nonce:f,to:p,value:y,stateOverride:g}){var _;const b=n?hn(n):void 0;let v=V6({from:b==null?void 0:b.address,to:p,value:typeof y<"u"&&`${g7(y)} ${((_=i==null?void 0:i.nativeCurrency)==null?void 0:_.symbol)||"ETH"}`,data:s,gas:a,gasPrice:typeof o<"u"&&`${la(o)} gwei`,maxFeePerGas:typeof l<"u"&&`${la(l)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${la(u)} gwei`,nonce:f});g&&(v+=` 477${Qwe(g)}`),super(e.shortMessage,{cause:e,docsPath:r,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",v].filter(
477Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class yQ extends Se{constructor(e,{abi:n,args:r,contractAddress:i,docsPath:s,functionName:a,sender:o}){const l=Zf({abi:n,args:r,name:a}),u=l?dQ({abiItem:l,args:r,includeFunctionName:!1,includeName:!1}):void 0,f=l?wl(l,{includeName:!0}):void 0,p=V6({address:i&&s8e(i),function:f,args:u&&u!=="()"&&`${[...Array((a==null?void 0:a.length)??0).keys()].map(()=>" ").join("")}${u}`,sender:o});super(e.shortMessage||`An unknown error occurred while executing the contract function "${a}".`,{cause:e,docsPath:s,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],p&&"Contract Call:",p].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=n,this.args=r,this.cause=e,this.contractAddress=i,this.functionName=a,this.sender=o}}class m3 extends Se{constructor({abi:e,data:n,functionName:r,message:i,cause:s}){let a,o,l,u;if(n&&n!=="0x")try{o=qwe({abi:e,data:n,cause:s});const{abiItem:p,errorName:y,args:g}=o;if(y==="Error")u=g[0];else if(y==="Panic"){const[b]=g;u=Nwe[b]}else{const b=p?wl(p,{includeName:!0}):void 0,v=p&&g?dQ({abiItem:p,args:g,includeFunctionName:!1,includeName:!1}):void 0;l=[b?`Error: ${b}`:"",v&&v!=="()"?` ${[...Array((y==null?void 0:y.length)??0).keys()].map(()=>" ").join("")}${v}`:""]}}catch(p){a=p}else i&&(u=i);let f;a instanceof zX&&(f=a.signature,l=[`Unable to decode signature "${f}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://4byte.sourcify.dev/?q=${f}.`]),super(u&&u!=="execution reverted"||f?[`The contract function "${r}" reverted with the following ${f?"signature":"reason"}:`,u||f].join(` 478`):`The contract function "${r}" reverted.`,{cause:a??s,metaMessages:l,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"raw",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=o,this.raw=n,this.reason=u,this.signature=f}}class a8e extends Se{constructor({functionName:e,cause:n}){super(`The contract function "${e}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${e}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."],name:"ContractFunctionZeroDataError",cause:n})}}class o8e extends Se{constructor({factory:e}){super(`Deployment for counterfactual contract call failed${e?` for factory "${e}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}}class b7 extends Se{constructor({data:e,message:n}){super(n||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}}class Ng extends Se{constructor({body:e,cause:n,details:r,headers:i,status:s,url:a}){super("HTTP request failed.",{cause:n,details:r,metaMessages:[s&&`Status: ${s}`,`URL: ${MI(a)}`,e&&`Request body: ${ii(e)}
478`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=i,this.status=s,this.url=a}}class Sw extends Se{constructor({maxSize:e,size:n}){super("HTTP response body exceeded the size limit.",{metaMessages:[`Max: ${e} bytes`,`Received: ${n} bytes`],name:"ResponseBodyTooLargeError"}),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e,this.size=n}}class UI extends Se{constructor({body:e,error:n,url:r}){super("RPC Request failed.",{cause:n,details:n.message,metaMessages:[`URL: ${MI(r)}`,`Request body: ${ii(e)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=n.code,this.data=n.data,this.url=r}}class sF extends Se{constructor({body:e,url:n}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${MI(n)}`,`Request body: ${ii(e)}`],name:"TimeoutError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=n}}const l8e=-1;class fa extends Se{constructor(e,{code:n,docsPath:r,metaMessages:i,name:s,shortMessage:a}){super(a,{cause:e,docsPath:r,metaMessages:i||(e==null?void 0:e.metaMessages),name:s||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=s||e.name,this.code=e instanceof UI?e.code:n??l8e}}class pa extends fa{constructor(e,n){super(e,n),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=n.data}}class y3 extends fa{constructor(e){super(e,{code:y3.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(y3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class g3 extends fa{constructor(e){super(e,{code:g3.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(g3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class b3 extends fa{constructor(e,{method:n}={}){super(e,{code:b3.code,name:"MethodNotFoundRpcError",shortMessage:`The method${n?` "${n}"`:""} does not exist / is not available.`})}}Object.defineProperty(b3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class w3 extends fa{constructor(e){super(e,{code:w3.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(` 479`)})}}Object.defineProperty(w3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class vf extends fa{constructor(e){super(e,{code:vf.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(vf,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class T2 extends fa{constructor(e){super(e,{code:T2.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(` 480`)})}}Object.defineProperty(T2,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class v3 extends fa{constructor(e){super(e,{code:v3.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(v3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class _3 extends fa{constructor(e){super(e,{code:_3.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(_3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class x3 extends fa{constructor(e){super(e,{code:x3.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(x3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class Wh extends fa{constructor(e,{method:n}={}){super(e,{code:Wh.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${n?` "${n}"`:""} is not supported.`})}}Object.defineProperty(Wh,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});
480class l1 extends fa{constructor(e){super(e,{code:l1.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(l1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class C3 extends fa{constructor(e){super(e,{code:C3.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(C3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class z0 extends pa{constructor(e){super(e,{code:z0.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(z0,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class E3 extends pa{constructor(e){super(e,{code:E3.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(E3,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class S3 extends pa{constructor(e,{method:n}={}){super(e,{code:S3.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${n?` " ${n}"`:""}.`})}}Object.defineProperty(S3,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class A3 extends pa{constructor(e){super(e,{code:A3.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(A3,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class k3 extends pa{constructor(e){super(e,{code:k3.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(k3,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class T3 extends pa{constructor(e){super(e,{code:T3.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(T3,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class c1 extends pa{constructor(e){super(e,{code:c1.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}Object.defineProperty(c1,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class L3 extends pa{constructor(e){super(e,{code:L3.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}Object.defineProperty(L3,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class $3 extends pa{constructor(e){super(e,{code:$3.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}Object.defineProperty($3,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class I3 extends pa{constructor(e){super(e,{code:I3.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}Object.defineProperty(I3,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class N3 extends pa{constructor(e){super(e,{code:N3.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}Object.defineProperty(N3,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class O3 extends pa{constructor(e){super(e,{code:O3.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}Object.defineProperty(O3,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});class u1 extends pa{constructor(e){super(e,{code:u1.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}Object.defineProperty(u1,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class P3 extends pa{constructor(e){super(e,{code:P3.code,name:"WalletConnectSessionSettlementError",shortMessage:"WalletConnect session settlement failed."})}}Object.defineProperty(P3,"code",{enumerable:!0,configurable:!0,writable:!0,value:7e3});class c8e extends fa{constructor(e){super(e,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}const u8e=3;function _f(t,{abi:e,address:n,args:r,docsPath:i,functionName:s,sender:a}){const o=t instanceof b7?t:t instanceof Se?t.walk(b=>"data"in b)||t.walk():{},{code:l,data:u,details:f,message:p,shortMessage:y}=o,g=t instanceof D6?new a8e({functionName:s,cause:t}):[u8e,vf.code].includes(l)&&(u||f||p||y)||l===T2.code&&f==="execution reverted"&&u?new m3({abi:e,data:typeof u=="object"?u.data:u,functionName:s,message:o instanceof UI?f:y??p,cause:t}):t;return new yQ(g,{abi:e,args:r,contractAddress:n,docsPath:i,functionName:s,sender:a})}function gQ(t){const e=Ni(`0x${t.substring(4)}`).substring(26);return U6(`0x${e}`)}async function d8e({hash:t,signature:e}){const n=Ss(t)?t:Dt(t),{secp256k1:r}=await Le(async()=>{const{secp256k1:a}=await Promise.resolve().then(()=>p_e);return{secp256k1:a}},void 0);return`0x${(()=>{if(typeof e=="object"&&"r"in e&&"s"in e){const{r:u,s:f,v:p,yParity:y}=e,g=Number(y??p),b=aF(g);return new r.Signature(Rn(u),Rn(f)).addRecoveryBit(b)}const a=Ss(e)?e:Dt(e);
480if(Ar(a)!==65)throw new Error("invalid signature length");const o=da(`0x${a.slice(130)}`),l=aF(o);return r.Signature.fromCompact(a.substring(2,130)).addRecoveryBit(l)})().recoverPublicKey(n.substring(2)).toHex(!1)}`}function aF(t){if(t===0||t===1)return t;if(t===27)return 0;if(t===28)return 1;throw new Error("Invalid yParityOrV value")}async function Sk({hash:t,signature:e}){return gQ(await d8e({hash:t,signature:e}))}function Nu(t,e="hex"){const n=bQ(t),r=PI(new Uint8Array(n.length));return n.encode(r),e==="hex"?_i(r.bytes):r.bytes}function bQ(t){return Array.isArray(t)?h8e(t.map(e=>bQ(e))):f8e(t)}function h8e(t){const e=t.reduce((i,s)=>i+s.length,0),n=wQ(e);return{length:e<=55?1+e:1+n+e,encode(i){e<=55?i.pushByte(192+e):(i.pushByte(247+n),n===1?i.pushUint8(e):n===2?i.pushUint16(e):n===3?i.pushUint24(e):i.pushUint32(e));for(const{encode:s}of t)s(i)}}}function f8e(t){const e=typeof t=="string"?Os(t):t,n=wQ(e.length);return{length:e.length===1&&e[0]<128?1:e.length<=55?1+e.length:1+n+e.length,encode(i){e.length===1&&e[0]<128?i.pushBytes(e):e.length<=55?(i.pushByte(128+e.length),i.pushBytes(e)):(i.pushByte(183+n),n===1?i.pushUint8(e.length):n===2?i.pushUint16(e.length):n===3?i.pushUint24(e.length):i.pushUint32(e.length),i.pushBytes(e))}}}function wQ(t){if(t<2**8)return 1;if(t<2**16)return 2;if(t<2**24)return 3;if(t<2**32)return 4;throw new Se("Length is too large.")}function vQ(t){const{chainId:e,nonce:n,to:r}=t,i=t.contractAddress??t.address,s=Ni(Wi(["0x05",Nu([e?ze(e):"0x",i,n?ze(n):"0x"])]));return r==="bytes"?Os(s):s}async function w7(t){const{authorization:e,signature:n}=t;return Sk({hash:vQ(e),signature:n??e})}class p8e extends Se{constructor(e,{account:n,docsPath:r,chain:i,data:s,gas:a,gasPrice:o,maxFeePerGas:l,maxPriorityFeePerGas:u,nonce:f,to:p,value:y}){var b;const g=V6({from:n==null?void 0:n.address,to:p,value:typeof y<"u"&&`${g7(y)} ${((b=i==null?void 0:i.nativeCurrency)==null?void 0:b.symbol)||"ETH"}`,data:s,gas:a,gasPrice:typeof o<"u"&&`${la(o)} gwei`,maxFeePerGas:typeof l<"u"&&`${la(l)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${la(u)} gwei`,nonce:f});super(e.shortMessage,{cause:e,docsPath:r,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",g].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class qh extends Se{constructor({cause:e,message:n}={}){var i;const r=(i=n==null?void 0:n.replace("execution reverted: ",""))==null?void 0:i.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:e,name:"ExecutionRevertedError"})}}Object.defineProperty(qh,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(qh,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});let xf=class extends Se{constructor({cause:e,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${la(n)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e,name:"FeeCapTooHighError"})}};Object.defineProperty(xf,"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 Ak extends Se{constructor({cause:e,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${la(n)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e,name:"FeeCapTooLowError"})}}Object.defineProperty(Ak,"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 kk extends Se{constructor({cause:e,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}is higher than the next one expected.`,{cause:e,name:"NonceTooHighError"})}}Object.defineProperty(kk,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class Tk extends Se{constructor({cause:e,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(` 481`),{cause:e,name:"NonceTooLowError"})}}Object.defineProperty(Tk,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class Lk extends Se{constructor({cause:e,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}exceeds the maximum allowed nonce.`,{cause:e,name:"NonceMaxValueError"})}}Object.defineProperty(Lk,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class $k extends Se{constructor({cause:e}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(` 482`),{cause:e,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($k,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class Ik extends Se{constructor({cause:e,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(Ik,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class Nk extends Se{constructor({cause:e,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction is too low.`,{cause:e,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(Nk,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class Ok extends Se{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(Ok,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});let R3=class extends Se{constructor({cause:e,maxPriorityFeePerGas:n,maxFeePerGas:r}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${n?` = ${la(n)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${la(r)} gwei`:""}).`].join(` 483`),{cause:e,name:"TipAboveFeeCapError"})}};Object.defineProperty(R3,"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 H6 extends Se{constructor({cause:e}){super(`An error occurred while executing: ${e==null?void 0:e.shortMessage}`,{cause:e,name:"UnknownNodeError"})}}function v7(t,e){const n=(t.details||"").toLowerCase(),r=t instanceof Se?t.walk(i=>(i==null?void 0:i.code)===qh.code):t;return r instanceof Se?new qh({cause:t,message:r.details}):qh.nodeMessage.test(n)?new qh({cause:t,message:t.details}):xf.nodeMessage.test(n)?new xf({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):Ak.nodeMessage.test(n)?new Ak({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):kk.nodeMessage.test(n)?new kk({cause:t,nonce:e==null?void 0:e.nonce}):Tk.nodeMessage.test(n)?new Tk({cause:t,nonce:e==null?void 0:e.nonce}):Lk.nodeMessage.test(n)?new Lk({cause:t,nonce:e==null?void 0:e.nonce}):$k.nodeMessage.test(n)?new $k({cause:t}):Ik.nodeMessage.test(n)?new Ik({cause:t,gas:e==null?void 0:e.gas}):Nk.nodeMessage.test(n)?new Nk({cause:t,gas:e==null?void 0:e.gas}):Ok.nodeMessage.test(n)?new Ok({cause:t}):R3.nodeMessage.test(n)?new R3({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas,maxPriorityFeePerGas:e==null?void 0:e.maxPriorityFeePerGas}):new H6({cause:t})}function m8e(t,{docsPath:e,...n}){const r=(()=>{const i=v7(t,n);return i instanceof H6?t:i})();return new p8e(r,{docsPath:e,...n})}function J1(t,{format:e}){if(!e)return{};const n={};function r(s){const a=Object.keys(s);
483for(const o of a)o in t&&(n[o]=t[o]),s[o]&&typeof s[o]=="object"&&!Array.isArray(s[o])&&r(s[o])}const i=e(t||{});return r(i),n}function _7(t,e){return({exclude:n,format:r})=>({exclude:n,format:(i,s)=>{const a=e(i,s);if(n)for(const o of n)delete a[o];return{...a,...r(i,s)}},type:t})}const y8e={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function yc(t,e){const n={};return typeof t.authorizationList<"u"&&(n.authorizationList=g8e(t.authorizationList)),typeof t.accessList<"u"&&(n.accessList=t.accessList),typeof t.blobVersionedHashes<"u"&&(n.blobVersionedHashes=t.blobVersionedHashes),typeof t.blobs<"u"&&(typeof t.blobs[0]!="string"?n.blobs=t.blobs.map(r=>_i(r)):n.blobs=t.blobs),typeof t.data<"u"&&(n.data=t.data),t.account&&(n.from=t.account.address),typeof t.from<"u"&&(n.from=t.from),typeof t.gas<"u"&&(n.gas=ze(t.gas)),typeof t.gasPrice<"u"&&(n.gasPrice=ze(t.gasPrice)),typeof t.maxFeePerBlobGas<"u"&&(n.maxFeePerBlobGas=ze(t.maxFeePerBlobGas)),typeof t.maxFeePerGas<"u"&&(n.maxFeePerGas=ze(t.maxFeePerGas)),typeof t.maxPriorityFeePerGas<"u"&&(n.maxPriorityFeePerGas=ze(t.maxPriorityFeePerGas)),typeof t.nonce<"u"&&(n.nonce=ze(t.nonce)),typeof t.to<"u"&&(n.to=t.to),typeof t.type<"u"&&(n.type=y8e[t.type]),typeof t.value<"u"&&(n.value=ze(t.value)),n}const _Q=_7("transactionRequest",yc);function g8e(t){return t.map(e=>({address:e.address,r:e.r?ze(BigInt(e.r)):e.r,s:e.s?ze(BigInt(e.s)):e.s,chainId:ze(e.chainId),nonce:ze(e.nonce),...typeof e.yParity<"u"?{yParity:ze(e.yParity)}:{},...typeof e.v<"u"&&typeof e.yParity>"u"?{v:ze(e.v)}:{}}))}function oF(t){if(!(!t||t.length===0))return t.reduce((e,{slot:n,value:r})=>{if(n.length!==66)throw new WB({size:n.length,targetSize:66,type:"hex"});if(r.length!==66)throw new WB({size:r.length,targetSize:66,type:"hex"});return e[n]=r,e},{})}function b8e(t){const{balance:e,nonce:n,state:r,stateDiff:i,code:s}=t,a={};if(s!==void 0&&(a.code=s),e!==void 0&&(a.balance=ze(e)),n!==void 0&&(a.nonce=ze(n)),r!==void 0&&(a.state=oF(r)),i!==void 0){if(a.state)throw new Xwe;a.stateDiff=oF(i)}return a}function BI(t){if(!t)return;const e={};for(const{address:n,...r}of t){if(!Yn(n,{strict:!1}))throw new vi({address:n});if(e[n])throw new Jwe({address:n});e[n]=b8e(r)}return e}const w8e=2n**16n-1n,d1=2n**256n-1n;function gc(t){const{account:e,maxFeePerGas:n,maxPriorityFeePerGas:r,to:i}=t,s=e?hn(e):void 0;if(s&&!Yn(s.address))throw new vi({address:s.address});if(i&&!Yn(i))throw new vi({address:i});if(n&&n>d1)throw new xf({maxFeePerGas:n});if(r&&n&&r>n)throw new R3({maxFeePerGas:n,maxPriorityFeePerGas:r})}class xQ extends Se{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class FI extends Se{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class v8e extends Se{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${la(e)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class zI extends Se{constructor({blockHash:e,blockNumber:n}){let r="Block";e&&(r=`Block at hash "${e}"`),n&&(r=`Block at number "${n}"`),super(`${r} could not be found.`,{name:"BlockNotFoundError"})}}const CQ={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function X1(t,e){const n={...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,...t.blockTimestamp!=null&&{blockTimestamp:BigInt(t.blockTimestamp)},chainId:t.chainId?da(t.chainId):void 0,gas:t.gas?BigInt(t.gas):void 0,gasPrice:t.gasPrice?BigInt(t.gasPrice):void 0,maxFeePerBlobGas:t.maxFeePerBlobGas?BigInt(t.maxFeePerBlobGas):void 0,maxFeePerGas:t.maxFeePerGas?BigInt(t.maxFeePerGas):void 0,maxPriorityFeePerGas:t.maxPriorityFeePerGas?BigInt(t.maxPriorityFeePerGas):void 0,nonce:t.nonce?da(t.nonce):void 0,to:t.to?t.to:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,type:t.type?CQ[t.type]:void 0,typeHex:t.type?t.type:void 0,value:t.value?BigInt(t.value):void 0,v:t.v?BigInt(t.v):void 0};return t.authorizationList&&(n.authorizationList=_8e(t.authorizationList)),n.yParity=(()=>
483{if(t.yParity)return Number(t.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 VI=_7("transaction",X1);function _8e(t){return t.map(e=>({address:e.address,chainId:Number(e.chainId),nonce:Number(e.nonce),r:e.r,s:e.s,yParity:Number(e.yParity)}))}function x7(t,e){const n=(t.transactions??[]).map(r=>typeof r=="string"?r:X1(r));return{...t,baseFeePerGas:t.baseFeePerGas?BigInt(t.baseFeePerGas):null,blobGasUsed:t.blobGasUsed?BigInt(t.blobGasUsed):void 0,difficulty:t.difficulty?BigInt(t.difficulty):void 0,excessBlobGas:t.excessBlobGas?BigInt(t.excessBlobGas):void 0,gasLimit:t.gasLimit?BigInt(t.gasLimit):void 0,gasUsed:t.gasUsed?BigInt(t.gasUsed):void 0,hash:t.hash?t.hash:null,logsBloom:t.logsBloom?t.logsBloom:null,nonce:t.nonce?t.nonce:null,number:t.number?BigInt(t.number):null,size:t.size?BigInt(t.size):void 0,timestamp:t.timestamp?BigInt(t.timestamp):void 0,transactions:n,totalDifficulty:t.totalDifficulty?BigInt(t.totalDifficulty):null}}const EQ=_7("block",x7);async function Co(t,{blockHash:e,blockNumber:n,blockTag:r=t.experimental_blockTag??"latest",includeTransactions:i}={}){var u,f,p;const s=i??!1,a=n!==void 0?ze(n):void 0;let o=null;if(e?o=await t.request({method:"eth_getBlockByHash",params:[e,s]},{dedupe:!0}):o=await t.request({method:"eth_getBlockByNumber",params:[a||r,s]},{dedupe:!!a}),!o)throw new zI({blockHash:e,blockNumber:n});return(((p=(f=(u=t.chain)==null?void 0:u.formatters)==null?void 0:f.block)==null?void 0:p.format)||x7)(o,"getBlock")}async function HI(t){const e=await t.request({method:"eth_gasPrice"});return BigInt(e)}async function x8e(t,e){return SQ(t,e)}async function SQ(t,e){var s,a;const{block:n,chain:r=t.chain,request:i}=e||{};try{const o=((s=r==null?void 0:r.fees)==null?void 0:s.maxPriorityFeePerGas)??((a=r==null?void 0:r.fees)==null?void 0:a.defaultPriorityFee);if(typeof o=="function"){const u=n||await Ye(t,Co,"getBlock")({}),f=await o({block:u,client:t,request:i});if(f===null)throw new Error;return f}if(typeof o<"u")return o;const l=await t.request({method:"eth_maxPriorityFeePerGas"});return Rn(l)}catch{const[o,l]=await Promise.all([n?Promise.resolve(n):Ye(t,Co,"getBlock")({}),Ye(t,HI,"getGasPrice")({})]);if(typeof o.baseFeePerGas!="bigint")throw new FI;const u=l-o.baseFeePerGas;return u<0n?0n:u}}async function C8e(t,e){return Pk(t,e)}async function Pk(t,e){var y,g;const{block:n,chain:r=t.chain,request:i,type:s="eip1559"}=e||{},a=await(async()=>{var b,v;return typeof((b=r==null?void 0:r.fees)==null?void 0:b.baseFeeMultiplier)=="function"?r.fees.baseFeeMultiplier({block:n,client:t,request:i}):((v=r==null?void 0:r.fees)==null?void 0:v.baseFeeMultiplier)??1.2})();if(a<1)throw new xQ;const l=10**(((y=a.toString().split(".")[1])==null?void 0:y.length)??0),u=b=>b*BigInt(Math.round(a*l))/BigInt(l),f=n||await Ye(t,Co,"getBlock")({});if(typeof((g=r==null?void 0:r.fees)==null?void 0:g.estimateFeesPerGas)=="function"){const b=await r.fees.estimateFeesPerGas({block:n,client:t,multiply:u,request:i,type:s});if(b!==null)return b}if(s==="eip1559"){if(typeof f.baseFeePerGas!="bigint")throw new FI;const b=typeof(i==null?void 0:i.maxPriorityFeePerGas)=="bigint"?i.maxPriorityFeePerGas:await SQ(t,{block:f,chain:r,request:i}),v=u(f.baseFeePerGas);return{maxFeePerGas:(i==null?void 0:i.maxFeePerGas)??v+b,maxPriorityFeePerGas:b}}return{gasPrice:(i==null?void 0:i.gasPrice)??u(await Ye(t,HI,"getGasPrice")({}))}}function Kf(t){const{blockHash:e,blockNumber:n,blockTag:r,requireCanonical:i}=t;if(i!==void 0&&!e)throw new Se("`requireCanonical` can only be provided when `blockHash` is set.");return e?i?{blockHash:e,requireCanonical:i}:{blockHash:e}:typeof n=="bigint"?ze(n):r??"latest"}async function WI(t,{address:e,blockHash:n,blockNumber:r,blockTag:i="latest",requireCanonical:s}){const a=Kf({blockHash:n,blockNumber:r,blockTag:i,requireCanonical:s}),o=await t.request({method:"eth_getTransactionCount",params:[e,a]},{dedupe:typeof r=="bigint"||n!==void 0});return da(o)}function qI(t){const{kzg:e}=t,n=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),r=typeof t.blobs[0]=="string"?t.blobs.map(s=>Os(s)):t.blobs,i=[];for(const s of r)i.push(Uint8Array.from(e.blobToKzgCommitment(s)));return n==="bytes"?i:i.map(s=>_i(s))}function ZI(t){const{kzg:e}=t,n=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),r=typeof t.blobs[0]=="string"?t.blobs.map(a=>Os(a)):t.blobs,i=typeof t.commitments[0]=="string"?t.commitments.map(a=>Os(a)):t.commitments,s=[];for(let a=0;a<r.length;a++){const o=r[a],l=i[a];s.push(Uint8Array.from(e.computeBlobKzgProof(o,l)))}return n==="bytes"?s:s.map(a=>_i(a))}function E8e(t,e,n,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,r);const i=BigInt(32),s=BigInt(4294967295),a=Number(n>>i&s),o=Number(n&s),l=r?4:0,u=r?0:4;t.setUint32(e+l,a,r),t.setUint32(e+u,o,r)}function S8e(t,e,n){return t&e^~t&n}function A8e(t,e,n){return t&e^t&n^e&n}let AQ=class extends II{constructor(e,n,r,i){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=i,this.buffer=new Uint8Array(e),this.view=RC(this.buffer)}update(e){a1(this),e=h7(e),wf(e);const{view:n,buffer:r,blockLen:i}=this,s=e.length;for(let a=0;a<s;){const o=Math.min(i-this.pos,s-a);if(o===i){const l=RC(e);for(;i<=s-a;a+=i)this.process(l,a);continue}r.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===i&&(this.process(n,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){a1(this),GX(e,this),this.finished=!0;const{buffer:n,view:r,blockLen:i,isLE:s}=this;let{pos:a}=this;n[a++]=128,S2(this.buffer.subarray(a)),this.padOffset>i-a&&(this.process(r,0),a=0);for(let p=a;p<i;p++)n[p]=0;E8e(r,i-8,BigInt(this.length*8),s),this.process(r,0);const o=RC(e),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=l/4,f=this.get();if(u>f.length)throw new Error("_sha2: outputLen bigger than state");for(let p=0;p<u;p++)o.setUint32(4*p,f[p],s)}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const r=e.slice(0,n);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:n,buffer:r,length:i,finished:s,destroyed:a,pos:o}=this;return e.destroyed=a,e.finished=s,e.length=i,e.pos=o,i%n&&e.buffer.set(r),e}clone(){return this._cloneInto()}};const xd=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ms=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),ys=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),k8e=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,2756
vendor: 2,018 bytes, line 483
483734187,3204031479,3329325298]),Cd=new Uint32Array(64);let T8e=class extends AQ{constructor(e=32){super(64,e,8,!1),this.A=xd[0]|0,this.B=xd[1]|0,this.C=xd[2]|0,this.D=xd[3]|0,this.E=xd[4]|0,this.F=xd[5]|0,this.G=xd[6]|0,this.H=xd[7]|0}get(){const{A:e,B:n,C:r,D:i,E:s,F:a,G:o,H:l}=this;return[e,n,r,i,s,a,o,l]}set(e,n,r,i,s,a,o,l){this.A=e|0,this.B=n|0,this.C=r|0,this.D=i|0,this.E=s|0,this.F=a|0,this.G=o|0,this.H=l|0}process(e,n){for(let p=0;p<16;p++,n+=4)Cd[p]=e.getUint32(n,!1);for(let p=16;p<64;p++){const y=Cd[p-15],g=Cd[p-2],b=Il(y,7)^Il(y,18)^y>>>3,v=Il(g,17)^Il(g,19)^g>>>10;Cd[p]=v+Cd[p-7]+b+Cd[p-16]|0}let{A:r,B:i,C:s,D:a,E:o,F:l,G:u,H:f}=this;for(let p=0;p<64;p++){const y=Il(o,6)^Il(o,11)^Il(o,25),g=f+y+S8e(o,l,u)+k8e[p]+Cd[p]|0,v=(Il(r,2)^Il(r,13)^Il(r,22))+A8e(r,i,s)|0;f=u,u=l,l=o,o=a+g|0,a=s,s=i,i=r,r=g+v|0}r=r+this.A|0,i=i+this.B|0,s=s+this.C|0,a=a+this.D|0,o=o+this.E|0,l=l+this.F|0,u=u+this.G|0,f=f+this.H|0,this.set(r,i,s,a,o,l,u,f)}roundClean(){S2(Cd)}destroy(){this.set(0,0,0,0,0,0,0,0),S2(this.buffer)}};const kQ=KX(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e3585
4835771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),L8e=kQ[0],$8e=kQ[1],Ed=new Uint32Array(80),Sd=new Uint32Array(80);class TQ extends AQ{constructor(e=64){super(128,e,16,!1),this.Ah=ys[0]|0,this.Al=ys[1]|0,this.Bh=ys[2]|0,this.Bl=ys[3]|0,this.Ch=ys[4]|0,this.Cl=ys[5]|0,this.Dh=ys[6]|0,this.Dl=ys[7]|0,this.Eh=ys[8]|0,this.El=ys[9]|0,this.Fh=ys[10]|0,this.Fl=ys[11]|0,this.Gh=ys[12]|0,this.Gl=ys[13]|0,this.Hh=ys[14]|0,this.Hl=ys[15]|0}
483get(){const{Ah:e,Al:n,Bh:r,Bl:i,Ch:s,Cl:a,Dh:o,Dl:l,Eh:u,El:f,Fh:p,Fl:y,Gh:g,Gl:b,Hh:v,Hl:_}=this;return[e,n,r,i,s,a,o,l,u,f,p,y,g,b,v,_]}set(e,n,r,i,s,a,o,l,u,f,p,y,g,b,v,_){this.Ah=e|0,this.Al=n|0,this.Bh=r|0,this.Bl=i|0,this.Ch=s|0,this.Cl=a|0,this.Dh=o|0,this.Dl=l|0,this.Eh=u|0,this.El=f|0,this.Fh=p|0,this.Fl=y|0,this.Gh=g|0,this.Gl=b|0,this.Hh=v|0,this.Hl=_|0}process(e,n){for(let x=0;x<16;x++,n+=4)Ed[x]=e.getUint32(n),Sd[x]=e.getUint32(n+=4);for(let x=16;x<80;x++){const A=Ed[x-15]|0,I=Sd[x-15]|0,$=Yp(A,I,1)^Yp(A,I,8)^KB(A,I,7),O=Jp(A,I,1)^Jp(A,I,8)^GB(A,I,7),P=Ed[x-2]|0,j=Sd[x-2]|0,U=Yp(P,j,19)^p4(P,j,61)^KB(P,j,6),z=Jp(P,j,19)^m4(P,j,61)^GB(P,j,6),D=Z4e(O,z,Sd[x-7],Sd[x-16]),R=K4e(D,$,U,Ed[x-7],Ed[x-16]);Ed[x]=R|0,Sd[x]=D|0}let{Ah:r,Al:i,Bh:s,Bl:a,Ch:o,Cl:l,Dh:u,Dl:f,Eh:p,El:y,Fh:g,Fl:b,Gh:v,Gl:_,Hh:C,Hl:S}=this;for(let x=0;x<80;x++){const A=Yp(p,y,14)^Yp(p,y,18)^p4(p,y,41),I=Jp(p,y,14)^Jp(p,y,18)^m4(p,y,41),$=p&g^~p&v,O=y&b^~y&_,P=G4e(S,I,O,$8e[x],Sd[x]),j=Y4e(P,C,A,$,L8e[x],Ed[x]),U=P|0,z=Yp(r,i,28)^p4(r,i,34)^p4(r,i,39),D=Jp(r,i,28)^m4(r,i,34)^m4(r,i,39),R=r&s^r&o^s&o,W=i&a^i&l^a&l;C=v|0,S=_|0,v=g|0,_=b|0,g=p|0,b=y|0,{h:p,l:y}=Fc(u|0,f|0,j|0,U|0),u=o|0,f=l|0,o=s|0,l=a|0,s=r|0,a=i|0;const T=W4e(U,D,W);r=q4e(T,j,z,R),i=T|0}({h:r,l:i}=Fc(this.Ah|0,this.Al|0,r|0,i|0)),{h:s,l:a}=Fc(this.Bh|0,this.Bl|0,s|0,a|0),{h:o,l}=Fc(this.Ch|0,this.Cl|0,o|0,l|0),{h:u,l:f}=Fc(this.Dh|0,this.Dl|0,u|0,f|0),{h:p,l:y}=Fc(this.Eh|0,this.El|0,p|0,y|0),{h:g,l:b}=Fc(this.Fh|0,this.Fl|0,g|0,b|0),{h:v,l:_}=Fc(this.Gh|0,this.Gl|0,v|0,_|0),{h:C,l:S}=Fc(this.Hh|0,this.Hl|0,C|0,S|0),this.set(r,i,s,a,o,l,u,f,p,y,g,b,v,_,C,S)}roundClean(){S2(Ed,Sd)}destroy(){S2(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class I8e extends TQ{constructor(){super(48),this.Ah=ms[0]|0,this.Al=ms[1]|0,this.Bh=ms[2]|0,this.Bl=ms[3]|0,this.Ch=ms[4]|0,this.Cl=ms[5]|0,this.Dh=ms[6]|0,this.Dl=ms[7]|0,this.Eh=ms[8]|0,this.El=ms[9]|0,this.Fh=ms[10]|0,this.Fl=ms[11]|0,this.Gh=ms[12]|0,this.Gl=ms[13]|0,this.Hh=ms[14]|0,this.Hl=ms[15]|0}}const KI=f7(()=>new T8e),N8e=f7(()=>new TQ),O8e=f7(()=>new I8e),LQ=KI;function $Q(t,e){const n=e||"hex",r=LQ(Ss(t,{strict:!1})?xu(t):t);return n==="bytes"?r:Dt(r)}function P8e(t){const{commitment:e,version:n=1}=t,r=t.to??(typeof e=="string"?"hex":"bytes"),i=$Q(e,"bytes");return i.set([n],0),r==="bytes"?i:_i(i)}function IQ(t){const{commitments:e,version:n}=t,r=t.to??(typeof e[0]=="string"?"hex":"bytes"),i=[];for(const s of e)i.push(P8e({commitment:s,to:r,version:n}));return i}const lF=6,NQ=32,GI=4096,OQ=NQ*GI,cF=OQ*lF-1-1*GI*lF,PQ=1;class R8e extends Se{constructor({maxSize:e,size:n}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${n} bytes`],name:"BlobSizeTooLargeError"})}}class RQ extends Se{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class j8e extends Se{constructor({hash:e,size:n}){super(`Versioned hash "${e}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${n}`],name:"InvalidVersionedHashSizeError"})}}class M8e extends Se{constructor({hash:e,version:n}){super(`Versioned hash "${e}" version is invalid.`,{metaMessages:[`Expected: ${PQ}`,`Received: ${n}`],name:"InvalidVersionedHashVersionError"})}}function D8e(t){const e=t.to??(typeof t.data=="string"?"hex":"bytes"),n=typeof t.data=="string"?Os(t.data):t.data,r=Ar(n);if(!r)throw new RQ;if(r>cF)throw new R8e({maxSize:cF,size:r});const i=[];let s=!0,a=0;for(;s;){const o=PI(new Uint8Array(OQ));let l=0;for(;l<GI;){const u=n.slice(a,a+(NQ-1));if(o.pushByte(0),o.pushBytes(u),u.length<31){o.pushByte(128),s=!1;break}l++,a+=31}i.push(o)}return e==="bytes"?i.map(o=>o.bytes):i.map(o=>_i(o.bytes))}function jQ(t){const{data:e,kzg:n,to:r}=t,i=t.blobs??D8e({data:e,to:r}),s=t.commitments??qI({blobs:i,kzg:n,to:r}),a=t.proofs??ZI({blobs:i,commitments:s,kzg:n,to:r}),o=[];for(let l=0;l<i.length;l++)o.push({blob:i[l],commitment:s[l],proof:a[l]});return o}function YI(t){if(t.type)return t.type;if(typeof t.authorizationList<"u")return"eip7702";if(typeof t.blobs<"u"||typeof t.blobVersionedHashes<"u"||typeof t.maxFeePerBlobGas<"u"||typeof t.sidecars<"u")return"eip4844";if(typeof t.maxFeePerGas<"u"||typeof t.maxPriorityFeePerGas<"u")return"eip1559";if(typeof t.gasPrice<"u")return typeof t.accessList<"u"?"eip2930":"legacy";throw new t8e({transaction:t})}function W6(t,{docsPath:e,...n}){const r=(()=>{const i=v7(t,n);return i instanceof H6?t:i})();return new r8e(r,{docsPath:e,...n})}async function bc(t){const e=await t.request({method:"eth_chainId"},{dedupe:!0});return da(e)}async function JI(t,e){var P,j,U,z,D;const{account:n=t.account,accessList:r,authorizationList:i,chain:s=t.chain,blobVersionedHashes:a,blobs:o,data:l,gas:u,gasPrice:f,maxFeePerBlobGas:p,maxFeePerGas:y,maxPriorityFeePerGas:g,nonce:b,nonceManager:v,to:_,type:C,value:S,...x}=e,A=await(async()=>
483{if(!n||!v||typeof b<"u")return b;const R=hn(n),W=s?s.id:await Ye(t,bc,"getChainId")({});return await v.consume({address:R.address,chainId:W,client:t})})();gc(e);const I=(j=(P=s==null?void 0:s.formatters)==null?void 0:P.transactionRequest)==null?void 0:j.format,O=(I||yc)({...J1(x,{format:I}),account:n?hn(n):void 0,accessList:r,authorizationList:i,blobs:o,blobVersionedHashes:a,data:l,gas:u,gasPrice:f,maxFeePerBlobGas:p,maxFeePerGas:y,maxPriorityFeePerGas:g,nonce:A,to:_,type:C,value:S},"fillTransaction");try{const R=await t.request({method:"eth_fillTransaction",params:[O]}),T=(((z=(U=s==null?void 0:s.formatters)==null?void 0:U.transaction)==null?void 0:z.format)||X1)(R.tx);delete T.blockHash,delete T.blockNumber,delete T.r,delete T.s,delete T.transactionIndex,delete T.v,delete T.yParity,T.data=T.input;const L=typeof T.feePayerSignature<"u"&&T.feePayerSignature!==null;if(L&&typeof A<"u"&&T.nonce!==A)throw new pQ({filledNonce:T.nonce,requestedNonce:A});if(!L){T.gas&&(T.gas=e.gas??T.gas),T.gasPrice&&(T.gasPrice=e.gasPrice??T.gasPrice),T.maxFeePerBlobGas&&(T.maxFeePerBlobGas=e.maxFeePerBlobGas??T.maxFeePerBlobGas),T.maxFeePerGas&&(T.maxFeePerGas=e.maxFeePerGas??T.maxFeePerGas),T.maxPriorityFeePerGas&&(T.maxPriorityFeePerGas=e.maxPriorityFeePerGas??T.maxPriorityFeePerGas),typeof T.nonce<"u"&&(T.nonce=e.nonce??T.nonce);const M=await(async()=>{var F,q;if(typeof((F=s==null?void 0:s.fees)==null?void 0:F.baseFeeMultiplier)=="function"){const G=await Ye(t,Co,"getBlock")({});return s.fees.baseFeeMultiplier({block:G,client:t,request:e})}return((q=s==null?void 0:s.fees)==null?void 0:q.baseFeeMultiplier)??1.2})();if(M<1)throw new xQ;const H=10**(((D=M.toString().split(".")[1])==null?void 0:D.length)??0),V=F=>F*BigInt(Math.round(M*H))/BigInt(H);T.maxFeePerGas&&!e.maxFeePerGas&&(T.maxFeePerGas=V(T.maxFeePerGas)),T.gasPrice&&!e.gasPrice&&(T.gasPrice=V(T.gasPrice))}return{raw:R.raw,transaction:{from:O.from,...T},...R.capabilities?{capabilities:R.capabilities}:{}}}catch(R){throw W6(R,{...e,chain:t.chain})}}const XI=["blobVersionedHashes","chainId","fees","gas","nonce","type"],uF=new Map,DC=new G1(128);async function Q1(t,e){var A,I,$;let n=e;n.account??(n.account=t.account),n.parameters??(n.parameters=XI);const{account:r,chain:i=t.chain,nonceManager:s,parameters:a}=n,o=(()=>{if(typeof(i==null?void 0:i.prepareTransactionRequest)=="function")return{fn:i.prepareTransactionRequest,runAt:["beforeFillTransaction"]};if(Array.isArray(i==null?void 0:i.prepareTransactionRequest))return{fn:i.prepareTransactionRequest[0],runAt:i.prepareTransactionRequest[1].runAt}})();let l;async function u(){return l||(typeof n.chainId<"u"?n.chainId:i?i.id:(l=await Ye(t,bc,"getChainId")({}),l))}let f=r&&hn(r),p=n.nonce;if(o!=null&&o.fn&&((A=o.runAt)!=null&&A.includes("beforeFillTransaction"))){n=await o.fn({...n,chain:i},{client:t,phase:"beforeFillTransaction"}),p??(p=n.nonce);const O=n.account??n.from;f=O?hn(O):void 0}if(a.includes("nonce")&&typeof p>"u"&&f&&s){const O=await u();p=await s.consume({address:f.address,chainId:O,client:t})}const g=((a.includes("blobVersionedHashes")||a.includes("sidecars"))&&n.kzg&&n.blobs?!1:a.length>0&&"feePayer"in n&&n.feePayer&&!("feePayerSignature"in n&&n.feePayerSignature)?!0:DC.get(t.uid)===!1||!["fees","gas"].some(P=>a.includes(P))?!1:!!(a.includes("chainId")&&typeof n.chainId!="number"||a.includes("nonce")&&typeof p!="number"||a.includes("fees")&&typeof n.gasPrice!="bigint"&&(typeof n.maxFeePerGas!="bigint"||typeof n.maxPriorityFeePerGas!="bigint")||a.includes("gas")&&typeof n.gas!="bigint"))?await Ye(t,JI,"fillTransaction")({...n,nonce:p}).then(O=>{const{chainId:P,from:j,gas:U,gasPrice:z,nonce:D,maxFeePerBlobGas:R,maxFeePerGas:W,maxPriorityFeePerGas:T,type:L,...M}=O.transaction,Z="feeToken"in M?M.feeToken:void 0,H="feePayerSignature"in M&&M.feePayerSignature!==null&&typeof M.feePayerSignature<"u",V=typeof Z<"u"&&Z!==null&&(!("feeToken"in n)||H);return DC.set(t.uid,!0),{...n,...j?{from:j}:{},...L&&!n.type?{type:L}:{},...typeof P<"u"?{chainId:P}:{},...typeof U<"u"?{gas:U}:{},...typeof z<"u"?{gasPrice:z}:{},...typeof D<"u"?{nonce:D}:{},...typeof R<"u"&&n.type!=="legacy"&&n.type!=="eip2930"?{maxFeePerBlobGas:R}:{},...typeof W<"u"&&n.type!=="legacy"&&n.type!=="eip2930"?{maxFeePerGas:W}:{},...typeof T<"u"&&n.type!=="legacy"&&n.type!=="eip2930"?{maxPriorityFeePerGas:T}:{},..."nonceKey"in M&&typeof M.nonceKey<"u"?{nonceKey:M.nonceKey}:{},..."keyAuthorization"in M&&typeof M.keyAuthorization<"u"&&M.keyAuthorization!==null&&!("keyAuthorization"in n)?{keyAuthorization:M.keyAuthorization}:{},..."feePayerSignature"in M&&typeof M.feePayerSignature<"u"&&M.feePayerSignature!==null?{feePayerSignature:M.feePayerSignature}:{},...V?{feeToken:Z}:{},...O.capabilities?{_capabilities:O.capabilities}:{}}}).catch(O=>{var D,R,W;const P=O;if(P.name!=="TransactionExecutionError")return n;if(((D=P.walk)==null?void 0:D.call(P,T=>T instanceof pQ))||((R=P.walk)==null?void 0:R.call(P,T=>T.name==="ExecutionRevertedError")))throw O;return((W=P.walk)==null?void 0:W.call(P,T=>{var M;const L=T;return L.name==="MethodNotFoundRpcError"||L.name==="MethodNotSupportedRpcError"||((M=L.message)==null?void 0:M.includes("eth_fillTransaction is not available"))}))&&DC.set(t.uid,!1),n}):n;p??(p=g.nonce),n={...g,...f?{from:f==null?void 0:f.address}:{},...typeof p<"u"?{nonce:p}:{}};const{blobs:b,gas:v,kzg:_,type:C}=n;o!=null&&o.fn&&((I=o.runAt)!=null&&I.includes("beforeFillParameters"))&&(n=await o.fn({...n,chain:i}
483,{client:t,phase:"beforeFillParameters"}));let S;async function x(){return S||(S=await Ye(t,Co,"getBlock")({blockTag:"latest"}),S)}if(a.includes("nonce")&&typeof p>"u"&&f&&!s&&(n.nonce=await Ye(t,WI,"getTransactionCount")({address:f.address,blockTag:"pending"})),(a.includes("blobVersionedHashes")||a.includes("sidecars"))&&b&&_){const O=qI({blobs:b,kzg:_});if(a.includes("blobVersionedHashes")){const P=IQ({commitments:O,to:"hex"});n.blobVersionedHashes=P}if(a.includes("sidecars")){const P=ZI({blobs:b,commitments:O,kzg:_}),j=jQ({blobs:b,commitments:O,proofs:P,to:"hex"});n.sidecars=j}}if(a.includes("chainId")&&(n.chainId=await u()),(a.includes("fees")||a.includes("type"))&&typeof C>"u")try{n.type=YI(n)}catch{let O=uF.get(t.uid);if(typeof O>"u"){const P=await x();O=typeof(P==null?void 0:P.baseFeePerGas)=="bigint",uF.set(t.uid,O)}n.type=O?"eip1559":"legacy"}if(a.includes("fees"))if(n.type!=="legacy"&&n.type!=="eip2930"){if(typeof n.maxFeePerGas>"u"||typeof n.maxPriorityFeePerGas>"u"){const O=await x(),{maxFeePerGas:P,maxPriorityFeePerGas:j}=await Pk(t,{block:O,chain:i,request:n});if(typeof n.maxPriorityFeePerGas>"u"&&n.maxFeePerGas&&n.maxFeePerGas<j)throw new v8e({maxPriorityFeePerGas:j});n.maxPriorityFeePerGas=j,n.maxFeePerGas=P}}else{if(typeof n.maxFeePerGas<"u"||typeof n.maxPriorityFeePerGas<"u")throw new FI;if(typeof n.gasPrice>"u"){const O=await x(),{gasPrice:P}=await Pk(t,{block:O,chain:i,request:n,type:"legacy"});n.gasPrice=P}}return a.includes("gas")&&typeof v>"u"&&(n.gas=await Ye(t,QI,"estimateGas")({...n,account:f,prepare:(f==null?void 0:f.type)==="local"?[]:["blobVersionedHashes"]})),o!=null&&o.fn&&(($=o.runAt)!=null&&$.includes("afterFillParameters"))&&(n=await o.fn({...n,chain:i},{client:t,phase:"afterFillParameters"})),gc(n),delete n.parameters,n}async function QI(t,e){var a,o,l;const{account:n=t.account,prepare:r=!0}=e,i=n?hn(n):void 0,s=(()=>{if(Array.isArray(r))return r;if((i==null?void 0:i.type)!=="local")return["blobVersionedHashes"]})();try{const u=await(async()=>{if(e.to)return e.to;if(e.authorizationList&&e.authorizationList.length>0)return await w7({authorization:e.authorizationList[0]}).catch(()=>{throw new Se("`to` is required. Could not infer from `authorizationList`")})})(),{accessList:f,authorizationList:p,blobs:y,blobVersionedHashes:g,blockNumber:b,blockTag:v,data:_,gas:C,gasPrice:S,maxFeePerBlobGas:x,maxFeePerGas:A,maxPriorityFeePerGas:I,nonce:$,value:O,stateOverride:P,...j}=r?await Q1(t,{...e,parameters:s,to:u}):e;if(C&&e.gas!==C)return C;const z=(typeof b=="bigint"?ze(b):void 0)||v,D=BI(P);gc(e);const R=(l=(o=(a=t.chain)==null?void 0:a.formatters)==null?void 0:o.transactionRequest)==null?void 0:l.format,T=(R||yc)({...J1(j,{format:R}),account:i,accessList:f,authorizationList:p,blobs:y,blobVersionedHashes:g,data:_,gasPrice:S,maxFeePerBlobGas:x,maxFeePerGas:A,maxPriorityFeePerGas:I,nonce:$,to:u,value:O},"estimateGas");return BigInt(await t.request({method:"eth_estimateGas",params:D?[T,z??t.experimental_blockTag??"latest",D]:z?[T,z]:[T]}))}catch(u){throw m8e(u,{...e,account:i,chain:t.chain})}}async function eN(t,e){var u;const{abi:n,address:r,args:i,functionName:s,dataSuffix:a=typeof t.dataSuffix=="string"?t.dataSuffix:(u=t.dataSuffix)==null?void 0:u.value,...o}=e,l=cs({abi:n,args:i,functionName:s});try{return await Ye(t,QI,"estimateGas")({data:`${l}${a?a.replace("0x",""):""}`,to:r,...o})}catch(f){const p=o.account?hn(o.account):void 0;throw _f(f,{abi:n,address:r,args:i,docsPath:"/docs/contract/estimateContractGas",functionName:s,sender:p==null?void 0:p.address})}}function oc(t,e){if(!Yn(t,{strict:!1}))throw new vi({address:t});if(!Yn(e,{strict:!1}))throw new vi({address:e});return t.toLowerCase()===e.toLowerCase()}function vl(t,{args:e,eventName:n}={}){return{...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,blockTimestamp:t.blockTimestamp?BigInt(t.blockTimestamp):t.blockTimestamp===null?null:void 0,logIndex:t.logIndex?Number(t.logIndex):null,transactionHash:t.transactionHash?t.transactionHash:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,...n?{args:e,eventName:n}:{}}}const dF="/docs/contract/decodeEventLog";function m8(t){const{abi:e,data:n,strict:r,topics:i}=t,s=r??!0,[a,...o]=i;if(!a)throw new _4e({docsPath:dF});const l=e.find(C=>C.type==="event"&&a===p7(wl(C)));if(!(l&&"name"in l)||l.type!=="event")throw new x4e(a,{docsPath:dF});const{name:u,inputs:f}=l,p=f==null?void 0:f.some(C=>!("name"in C&&C.name)),y=p?[]:{},g=f.map((C,S)=>[C,S]).filter(([C])=>"indexed"in C&&C.indexed),b=[];for(let C=0;C<g.length;C++){const[S,x]=g[C],A=o[C];if(!A){if(s)throw new LI({abiItem:l,param:S});b.push([S,x]);continue}y[p?x:S.name||x]=U8e({param:S,value:A})}const v=f.filter(C=>!("indexed"in C&&C.indexed)),_=s?v:[...b.map(([C])=>C),...v];if(_.length>0){if(n&&n!=="0x")try{const C=z6(_,n);if(C){let S=0;if(!s)for(const[x,A]of b)y[p?A:x.name||A]=C[S++];if(p)for(let x=0;x<f.length;x++)y[x]===void 0&&S<C.length&&(y[x]=C[S++]);else for(let x=0;x<v.length;x++)y[v[x].name]=C[S++]}}catch(C){if(s)throw C instanceof FX||C instanceof uQ?new p8({abiItem:l,data:n,params:_,size:Ar(n)}):C}else if(s)throw new p8({abiItem:l,data:"0x",params:_,size:0})}return{eventName:u,args:Object.values(y).length>0?y:void 0}}function U8e({param:t,value:e}){return t.type==="string"||t.type==="bytes"||t.type==="tuple"||t.type.match(/^(.*)\[(\d+)?\]$/)?e:(z6([t],e)||[])[0]}function wc(t){const{abi:e,args:n,logs:r,strict:i=!0}=t,s=(()=>
483{if(t.eventName)return Array.isArray(t.eventName)?t.eventName:[t.eventName]})(),a=e.filter(o=>o.type==="event").map(o=>({abi:o,selector:p7(o)}));return r.map(o=>{var y;const l=typeof o.blockNumber=="string"?vl(o):o,u=a.filter(g=>l.topics[0]===g.selector);if(u.length===0)return null;let f,p;for(const g of u)try{f=m8({...l,abi:[g.abi],strict:!0}),p=g;break}catch{}if(!f&&!i){p=u[0];try{f=m8({data:l.data,topics:l.topics,abi:[p.abi],strict:!1})}catch{const g=(y=p.abi.inputs)==null?void 0:y.some(b=>!("name"in b&&b.name));return{...l,args:g?[]:{},eventName:p.abi.name}}}return!f||!p||s&&!s.includes(f.eventName)||!B8e({args:f.args,inputs:p.abi.inputs,matchArgs:n})?null:{...f,...l}}).filter(Boolean)}function B8e(t){const{args:e,inputs:n,matchArgs:r}=t;if(!r)return!0;if(!e)return!1;function i(s,a,o){try{return s.type==="address"?oc(a,o):s.type==="string"||s.type==="bytes"?Ni(xu(a))===o:a===o}catch{return!1}}return Array.isArray(e)&&Array.isArray(r)?r.every((s,a)=>{if(s==null)return!0;const o=n[a];return o?(Array.isArray(s)?s:[s]).some(u=>i(o,u,e[a])):!1}):typeof e=="object"&&!Array.isArray(e)&&typeof r=="object"&&!Array.isArray(r)?Object.entries(r).every(([s,a])=>{if(a==null)return!0;const o=n.find(u=>u.name===s);return o?(Array.isArray(a)?a:[a]).some(u=>i(o,u,e[s])):!1}):!1}async function tN(t,{address:e,blockHash:n,fromBlock:r,toBlock:i,event:s,events:a,args:o,strict:l}={}){const u=l??!1,f=a??(s?[s]:void 0);let p=[];f&&(p=[f.flatMap(v=>F6({abi:[v],eventName:v.name,args:a?void 0:o}))],s&&(p=p[0]));let y;n?y=await t.request({method:"eth_getLogs",params:[{address:e,topics:p,blockHash:n}]}):y=await t.request({method:"eth_getLogs",params:[{address:e,topics:p,fromBlock:typeof r=="bigint"?ze(r):r,toBlock:typeof i=="bigint"?ze(i):i}]});const g=y.map(b=>vl(b));return f?wc({abi:f,args:o,logs:g,strict:u}):g}async function MQ(t,e){const{abi:n,address:r,args:i,blockHash:s,eventName:a,fromBlock:o,toBlock:l,strict:u}=e,f=a?Zf({abi:n,name:a}):void 0,p=f?void 0:n.filter(y=>y.type==="event");return Ye(t,tN,"getLogs")({address:r,args:i,blockHash:s,event:f,events:p,fromBlock:o,toBlock:l,strict:u})}const UC="/docs/contract/decodeFunctionResult";function B2(t){const{abi:e,args:n,functionName:r,data:i}=t;let s=e[0];if(r){const o=Zf({abi:e,args:n,name:r});if(!o)throw new s1(r,{docsPath:UC});s=o}if(s.type!=="function")throw new s1(void 0,{docsPath:UC});if(!s.outputs)throw new VX(s.name,{docsPath:UC});const a=z6(s.outputs,i);if(a&&a.length>1)return a;if(a&&a.length===1)return a[0]}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const nN=BigInt(0),Rk=BigInt(1);function q6(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function rN(t){if(!q6(t))throw new Error("Uint8Array expected")}function j3(t,e){if(typeof e!="boolean")throw new Error(t+" boolean expected, got "+e)}function y4(t){const e=t.toString(16);return e.length&1?"0"+e:e}function DQ(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?nN:BigInt("0x"+t)}const UQ=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",F8e=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function M3(t){if(rN(t),UQ)return t.toHex();let e="";for(let n=0;n<t.length;n++)e+=F8e[t[n]];return e}const zc={_0:48,_9:57,A:65,F:70,a:97,f:102};function hF(t){if(t>=zc._0&&t<=zc._9)return t-zc._0;if(t>=zc.A&&t<=zc.F)return t-(zc.A-10);if(t>=zc.a&&t<=zc.f)return t-(zc.a-10)}function y8(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);if(UQ)return Uint8Array.fromHex(t);const e=t.length,n=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(n);for(let i=0,s=0;i<n;i++,s+=2){const a=hF(t.charCodeAt(s)),o=hF(t.charCodeAt(s+1));if(a===void 0||o===void 0){const l=t[s]+t[s+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+s)}r[i]=a*16+o}return r}function lf(t){return DQ(M3(t))}function BQ(t){return rN(t),DQ(M3(Uint8Array.from(t).reverse()))}function Z6(t,e){return y8(t.toString(16).padStart(e*2,"0"))}function FQ(t,e){return Z6(t,e).reverse()}function yo(t,e,n){let r;if(typeof e=="string")try{r=y8(e)}catch(s){throw new Error(t+" must be hex string or Uint8Array, cause: "+s)}else if(q6(e))r=Uint8Array.from(e);else throw new Error(t+" must be hex string or Uint8Array");const i=r.length;if(typeof n=="number"&&i!==n)throw new Error(t+" of length "+n+" expected, got "+i);return r}function g8(...t){let e=0;for(let r=0;r<t.length;r++){const i=t[r];rN(i),e+=i.length}const n=new Uint8Array(e);for(let r=0,i=0;r<t.length;r++){const s=t[r];n.set(s,i),i+=s.length}return n}function z8e(t,e){if(t.length!==e.length)return!1;let n=0;for(let r=0;r<t.length;r++)n|=t[r]^e[r];return n===0}const BC=t=>typeof t=="bigint"&&nN<=t;function iN(t,e,n){return BC(t)&&BC(e)&&BC(n)&&e<=t&&t<n}function V0(t,e,n,r){if(!iN(e,n,r))throw new Error("expected valid "+t+": "+n+" <= n < "+r+", got "+e)}function V8e(t){let e;for(e=0;t>nN;t>>=Rk,e+=1);return e}const C7=t=>(Rk<<BigInt(t))-Rk,FC=t=>new Uint8Array(t),fF=t=>Uint8Array.from(t);function H8e(t,e,n){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=FC(t),i=FC(t),s=0;const a=()=>{r.fill(1),i.fill(0),s=0},o=(...p)=>n(i,r,...p),l=(p=FC(0))=>{i=o(fF([0]),p),r=o(),p.length!==0&&(i=o(fF([1]),p),r=o())},u=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let p=0;const y=[];for(;p<e;){r=o();const g=r.slice();y.push(g),p+=r.length}return g8(...y)};return(p,y)=>{a(),l(p);let g;for(;
483!(g=y(u()));)l();return a(),g}}const W8e={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||q6(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function E7(t,e,n={}){const r=(i,s,a)=>{const o=W8e[s];if(typeof o!="function")throw new Error("invalid validator function");const l=t[i];if(!(a&&l===void 0)&&!o(l,t))throw new Error("param "+String(i)+" is invalid. Expected "+s+", got "+l)};for(const[i,s]of Object.entries(e))r(i,s,!1);for(const[i,s]of Object.entries(n))r(i,s,!0);return t}function pF(t){const e=new WeakMap;return(n,...r)=>{const i=e.get(n);if(i!==void 0)return i;const s=t(n,...r);return e.set(n,s),s}}const q8e="0.1.1";function Z8e(){return q8e}let ut=class Qc extends Error{static setStaticOptions(e){Qc.prototype.docsOrigin=e.docsOrigin,Qc.prototype.showVersion=e.showVersion,Qc.prototype.version=e.version}constructor(e,n={}){const r=(()=>{var f;if(n.cause instanceof Qc){if(n.cause.details)return n.cause.details;if(n.cause.shortMessage)return n.cause.shortMessage}return n.cause&&"details"in n.cause&&typeof n.cause.details=="string"?n.cause.details:(f=n.cause)!=null&&f.message?n.cause.message:n.details})(),i=n.cause instanceof Qc&&n.cause.docsPath||n.docsPath,s=n.docsOrigin??Qc.prototype.docsOrigin,a=`${s}${i??""}`,o=!!(n.version??Qc.prototype.showVersion),l=n.version??Qc.prototype.version,u=[e||"An error occurred.",...n.metaMessages?["",...n.metaMessages]:[],...r||i||o?["",r?`Details: ${r}`:void 0,i?`See: ${a}`:void 0,o?`Version: ${l}`:void 0]:[]].filter(f=>typeof f=="string").join(` 484`);super(u,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsOrigin",{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,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showVersion",{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,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.cause=n.cause,this.details=r,this.docs=a,this.docsOrigin=s,this.docsPath=i,this.shortMessage=e,this.showVersion=o,this.version=l}walk(e){return zQ(this,e)}};Object.defineProperty(ut,"defaultStaticOptions",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:"https://oxlib.sh",showVersion:!1,version:`ox@${Z8e()}`}});ut.setStaticOptions(ut.defaultStaticOptions);function zQ(t,e){return e!=null&&e(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause?zQ(t.cause,e):e?null:t}function em(t,e){if(L0(t)>e)throw new fve({givenSize:L0(t),maxSize:e})}const Vc={zero:48,nine:57,A:65,F:70,a:97,f:102};function mF(t){if(t>=Vc.zero&&t<=Vc.nine)return t-Vc.zero;if(t>=Vc.A&&t<=Vc.F)return t-(Vc.A-10);if(t>=Vc.a&&t<=Vc.f)return t-(Vc.a-10)}function K8e(t,e={}){const{dir:n,size:r=32}=e;if(r===0)return t;if(t.length>r)throw new pve({size:t.length,targetSize:r,type:"Bytes"});const i=new Uint8Array(r);for(let s=0;s<r;s++){const a=n==="right";i[a?s:r-s-1]=t[a?s:t.length-s-1]}return i}function VQ(t,e={}){const{dir:n="left"}=e;let r=t,i=0;for(let s=0;s<r.length-1&&r[n==="left"?s:r.length-s-1].toString()==="0";s++)i++;return r=n==="left"?r.slice(i):r.slice(0,r.length-i),r}function S7(t,e){if(Vn(t)>e)throw new bve({givenSize:Vn(t),maxSize:e})}function G8e(t,e){if(typeof e=="number"&&e>0&&e>Vn(t)-1)throw new QQ({offset:e,position:"start",size:Vn(t)})}function Y8e(t,e,n){if(typeof e=="number"&&typeof n=="number"&&Vn(t)!==n-e)throw new QQ({offset:n,position:"end",size:Vn(t)})}function HQ(t,e={}){const{dir:n,size:r=32}=e;if(r===0)return t;const i=t.replace("0x","");if(i.length>r*2)throw new wve({size:Math.ceil(i.length/2),targetSize:r,type:"Hex"});return`0x${i[n==="right"?"padEnd":"padStart"](r*2,"0")}`}function J8e(t,e={}){const{dir:n="left"}=e;let r=t.replace("0x",""),i=0;for(let s=0;s<r.length-1&&r[n==="left"?s:r.length-s-1].toString()==="0";s++)i++;return r=n==="left"?r.slice(i):r.slice(0,r.length-i),r==="0"?"0x":n==="right"&&r.length%2===1?`0x${r}0`:`0x${r}`}const X8e="#__bigint";function tm(t,e,n){return JSON.stringify(t,(r,i)=>typeof i=="bigint"?i.toString()+X8e:i,n)}const Q8e=new TextDecoder,eve=new TextEncoder;function tve(t){if(!(t instanceof Uint8Array)){if(!t)throw new g4(t);if(typeof t!="object")throw new g4(t);if(!("BYTES_PER_ELEMENT"in t))throw new g4(t);if(t.BYTES_PER_ELEMENT!==1||t.constructor.name!=="Uint8Array")throw new g4(t)}}function nve(...t){let e=0;for(const r of t)e+=r.length;const n=new Uint8Array(e);for(let r=0,i=0;r<t.length;r++){const s=t[r];n.set(s,i),i+=s.length}return n}function sN(t){return t instanceof Uint8Array?t:typeof t=="string"?F2(t):rve(t)}
484function rve(t){return t instanceof Uint8Array?t:new Uint8Array(t)}function F2(t,e={}){const{size:n}=e;let r=t;n&&(S7(t,n),r=Cf(t,n));let i=r.slice(2);i.length%2&&(i=`0${i}`);const s=i.length/2,a=new Uint8Array(s);for(let o=0,l=0;o<s;o++){const u=mF(i.charCodeAt(l++)),f=mF(i.charCodeAt(l++));if(u===void 0||f===void 0)throw new ut(`Invalid byte sequence ("${i[l-2]}${i[l-1]}" in "${i}").`);a[o]=u<<4|f}return a}function WQ(t,e={}){const{size:n}=e,r=eve.encode(t);return typeof n=="number"?(em(r,n),sve(r,n)):r}function ive(t,e){return z8e(t,e)}function sve(t,e){return K8e(t,{dir:"right",size:e})}function ave(t){return crypto.getRandomValues(new Uint8Array(t))}function L0(t){return t.length}function ove(t,e,n,r={}){const{strict:i}=r;return t.slice(e,n)}function lve(t,e={}){const{size:n}=e;typeof n<"u"&&em(t,n);const r=Oi(t,e);return nr(r,e)}function cve(t,e={}){const{size:n}=e;let r=t;if(typeof n<"u"&&(em(r,n),r=qQ(r)),r.length>1||r[0]>1)throw new hve(r);return!!r[0]}function Eu(t,e={}){const{size:n}=e;typeof n<"u"&&em(t,n);const r=Oi(t,e);return h1(r,e)}function uve(t,e={}){const{size:n}=e;let r=t;return typeof n<"u"&&(em(r,n),r=ZQ(r)),Q8e.decode(r)}function qQ(t){return VQ(t,{dir:"left"})}function ZQ(t){return VQ(t,{dir:"right"})}function dve(t){try{return tve(t),!0}catch{return!1}}class hve extends ut{constructor(e){super(`Bytes value \`${e}\` is not a valid boolean.`,{metaMessages:["The bytes array must contain a single byte of either a `0` or `1` value."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesBooleanError"})}}let g4=class extends ut{constructor(e){super(`Value \`${typeof e=="object"?tm(e):e}\` of type \`${typeof e}\` is an invalid Bytes value.`,{metaMessages:["Bytes values must be of type `Bytes`."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesTypeError"})}},fve=class extends ut{constructor({givenSize:e,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}},pve=class extends ut{constructor({size:e,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}};const mve=new TextEncoder,yve=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function KQ(t,e={}){const{strict:n=!1}=e;if(!t)throw new yF(t);if(typeof t!="string")throw new yF(t);if(n&&!/^0x[0-9a-fA-F]*$/.test(t))throw new gF(t);if(!t.startsWith("0x"))throw new gF(t)}function fr(...t){return`0x${t.reduce((e,n)=>e+n.replace("0x",""),"")}`}function K6(t){return t instanceof Uint8Array?Oi(t):Array.isArray(t)?Oi(new Uint8Array(t)):t}function GQ(t,e={}){const n=`0x${Number(t)}`;return typeof e.size=="number"?(S7(n,e.size),_l(n,e.size)):n}function Oi(t,e={}){let n="";for(let i=0;i<t.length;i++)n+=yve[t[i]];const r=`0x${n}`;return typeof e.size=="number"?(S7(r,e.size),Cf(r,e.size)):r}function He(t,e={}){const{signed:n,size:r}=e,i=BigInt(t);let s;r?n?s=(1n<<BigInt(r)*8n-1n)-1n:s=2n**(BigInt(r)*8n)-1n:typeof t=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));const a=typeof s=="bigint"&&n?-s-1n:0;if(s&&i>s||i<a){const u=typeof t=="bigint"?"n":"";throw new XQ({max:s?`${s}${u}`:void 0,min:`${a}${u}`,signed:n,size:r,value:`${t}${u}`})}const l=`0x${(n&&i<0?BigInt.asUintN(r*8,BigInt(i)):i).toString(16)}`;return r?_l(l,r):l}function z2(t,e={}){return Oi(mve.encode(t),e)}function _l(t,e){return HQ(t,{dir:"left",size:e})}function Cf(t,e){return HQ(t,{dir:"right",size:e})}function YQ(t){return Oi(ave(t))}function tn(t,e,n,r={}){const{strict:i}=r;G8e(t,e);const s=`0x${t.replace("0x","").slice((e??0)*2,(n??t.length)*2)}`;return i&&Y8e(s,e,n),s}function Vn(t){return Math.ceil((t.length-2)/2)}function jk(t){return J8e(t,{dir:"left"})}function nr(t,e={}){const{signed:n}=e;e.size&&S7(t,e.size);const r=BigInt(t);if(!n)return r;
484const i=(t.length-2)/2,s=(1n<<BigInt(i)*8n)-1n,a=s>>1n;return r<=a?r:r-s-1n}function h1(t,e={}){const{signed:n,size:r}=e;return Number(!n&&!r?t:nr(t,e))}function JQ(t,e={}){const{size:n}=e;let r=F2(t);return n&&(em(r,n),r=ZQ(r)),new TextDecoder().decode(r)}function ol(t,e={}){const{strict:n=!1}=e;try{return KQ(t,{strict:n}),!0}catch{return!1}}let XQ=class extends ut{constructor({max:e,min:n,signed:r,size:i,value:s}){super(`Number \`${s}\` is not in safe${i?` ${i*8}-bit`:""}${r?" signed":" unsigned"} integer range ${e?`(\`${n}\` to \`${e}\`)`:`(above \`${n}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}},yF=class extends ut{constructor(e){super(`Value \`${typeof e=="object"?tm(e):e}\` of type \`${typeof e}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}},gF=class extends ut{constructor(e){super(`Value \`${e}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}};class gve extends ut{constructor(e){super(`Hex value \`"${e}"\` is an odd length (${e.length-2} nibbles).`,{metaMessages:["It must be an even length."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidLengthError"})}}let bve=class extends ut{constructor({givenSize:e,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}},QQ=class extends ut{constructor({offset:e,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset \`${e}\` is out-of-bounds (size: \`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}},wve=class extends ut{constructor({size:e,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}};function vve(t){return{address:t.address,amount:He(t.amount),index:He(t.index),validatorIndex:He(t.validatorIndex)}}function eee(t){return{...typeof t.baseFeePerGas=="bigint"&&{baseFeePerGas:He(t.baseFeePerGas)},...typeof t.blobBaseFee=="bigint"&&{blobBaseFee:He(t.blobBaseFee)},...typeof t.feeRecipient=="string"&&{feeRecipient:t.feeRecipient},...typeof t.gasLimit=="bigint"&&{gasLimit:He(t.gasLimit)},...typeof t.number=="bigint"&&{number:He(t.number)},...typeof t.prevRandao=="bigint"&&{prevRandao:He(t.prevRandao)},...typeof t.time=="bigint"&&{time:He(t.time)},...t.withdrawals&&{withdrawals:t.withdrawals.map(vve)}}}const Ef=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{name:"addr",type:"address"}],name:"getEthBalance",outputs:[{name:"balance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"}],Mk=[{name:"query",type:"function",stateMutability:"view",inputs:[{type:"tuple[]",name:"queries",components:[{type:"address",name:"sender"},{type:"string[]",name:"urls"},{type:"bytes",name:"data"}]}],outputs:[{type:"bool[]",name:"failures"},{type:"bytes[]",name:"responses"}]},{name:"HttpError",type:"error",inputs:[{type:"uint16",name:"status"},{type:"string",name:"message"}]}],tee=[{inputs:[{name:"dns",type:"bytes"}],name:"DNSDecodingFailed",type:"error"},{inputs:[{name:"ens",type:"string"}],name:"DNSEncodingFailed",type:"error"},{inputs:[],name:"EmptyAddress",type:"error"},{inputs:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"HttpError",type:"error"}
vendor: 4,296 bytes, line 484
484,{inputs:[],name:"InvalidBatchGatewayResponse",type:"error"},{inputs:[{name:"errorData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{name:"name",type:"bytes"},{name:"resolver",type:"address"}],name:"ResolverNotContract",type:"error"},{inputs:[{name:"name",type:"bytes"}],name:"ResolverNotFound",type:"error"},{inputs:[{name:"primary",type:"string"},{name:"primaryAddress",type:"bytes"}],name:"ReverseAddressMismatch",type:"error"},{inputs:[{internalType:"bytes4",name:"selector",type:"bytes4"}],name:"UnsupportedResolverProfile",type:"error"}],nee=[...tee,{name:"resolveWithGateways",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],_ve=[...tee,{name:"reverseWithGateways",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"uint256",name:"coinType"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolver"},{type:"address",name:"reverseResolver"}]}],bF=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],ree=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],iee=[{name:"isValidSignature",type:"function",stateMutability:"view",inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],outputs:[{name:"",type:"bytes4"}]}],wF=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}],ko=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}],xve="0x82ad56cb",see="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b
484602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",Cve="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",Eve="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848
484603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",A7="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9
484150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033";class Dk extends Se{constructor({blockNumber:e,chain:n,contract:r}){super(`Chain "${n.name}" does not support contract "${r.name}".`,{metaMessages:["This could be due to any of the following:",...e&&r.blockCreated&&r.blockCreated>e?[`- The contract "${r.name}" was not deployed until block ${r.blockCreated} (current block ${e}).`]:[`- The chain does not have the contract "${r.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}class Sve extends Se{constructor({chain:e,currentChainId:n}){super(`The current chain of the wallet (id: ${n}) does not match the target chain for the transaction (id: ${e.id} â ${e.name}).`,{metaMessages:[`Current Chain ID: ${n}`,`Expected Chain ID: ${e.id} â ${e.name}`],name:"ChainMismatchError"})}}class Ave extends Se{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(` 485`),{name:"ChainNotFoundError"})}}class aee extends Se{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}let G6=class extends Se{constructor({chainId:e}){super(typeof e=="number"?`Chain ID "${e}
485" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}};const zC="/docs/contract/encodeDeployData";function k7(t){const{abi:e,args:n,bytecode:r}=t;if(!n||n.length===0)return r;const i=e.find(a=>"type"in a&&a.type==="constructor");if(!i)throw new BX({docsPath:zC});if(!("inputs"in i))throw new f8({docsPath:zC});if(!i.inputs||i.inputs.length===0)throw new f8({docsPath:zC});const s=U2(i.inputs,n);return Wi([r,s])}function nm({blockNumber:t,chain:e,contract:n}){var i;const r=(i=e==null?void 0:e.contracts)==null?void 0:i[n];if(!r)throw new Dk({chain:e,contract:{name:n}});if(t&&r.blockCreated&&r.blockCreated>t)throw new Dk({blockNumber:t,chain:e,contract:{name:n,blockCreated:r.blockCreated}});return r.address}function oee(t,{docsPath:e,...n}){const r=(()=>{const i=v7(t,n);return i instanceof H6?t:i})();return new DI(r,{docsPath:e,...n})}function aN(){let t=()=>{},e=()=>{};return{promise:new Promise((r,i)=>{t=r,e=i}),resolve:t,reject:e}}const VC=new Map;function oN({fn:t,id:e,shouldSplitBatch:n,wait:r=0,sort:i}){const s=async()=>{const f=l();a();const p=f.map(({args:y})=>y);p.length!==0&&t(p).then(y=>{i&&Array.isArray(y)&&y.sort(i);for(let g=0;g<f.length;g++){const{resolve:b}=f[g];b==null||b([y[g],y])}}).catch(y=>{for(let g=0;g<f.length;g++){const{reject:b}=f[g];b==null||b(y)}})},a=()=>VC.delete(e),o=()=>l().map(({args:f})=>f),l=()=>VC.get(e)||[],u=f=>VC.set(e,[...l(),f]);return{flush:a,async schedule(f){const{promise:p,resolve:y,reject:g}=aN();return(n==null?void 0:n([...o(),f]))&&s(),l().length>0?(u({args:f,resolve:y,reject:g}),p):(u({args:f,resolve:y,reject:g}),setTimeout(s,r),p)}}}async function rm(t,e){var L,M,Z,H,V,F;const{account:n=t.account,authorizationList:r,batch:i=!!((L=t.batch)!=null&&L.multicall),blockHash:s,blockNumber:a,blockTag:o=t.experimental_blockTag??"latest",requireCanonical:l,accessList:u,blobs:f,blockOverrides:p,code:y,data:g,factory:b,factoryData:v,gas:_,gasPrice:C,maxFeePerBlobGas:S,maxFeePerGas:x,maxPriorityFeePerGas:A,nonce:I,requestOptions:$,to:O,value:P,stateOverride:j,...U}=e,z=n?hn(n):void 0;if(y&&(b||v))throw new Se("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(y&&O)throw new Se("Cannot provide both `code` & `to` as parameters.");const D=y&&g,R=b&&v&&O&&g,W=D||R,T=D?cee({code:y,data:g}):R?Nve({data:g,factory:b,factoryData:v,to:O}):g;try{gc(e);const q=Kf({blockHash:s,blockNumber:a,blockTag:o,requireCanonical:l}),G=p?eee(p):void 0,Y=BI(j),X=(H=(Z=(M=t.chain)==null?void 0:M.formatters)==null?void 0:Z.transactionRequest)==null?void 0:H.format,ie=(X||yc)({...J1(U,{format:X}),accessList:u,account:z,authorizationList:r,blobs:f,data:T,gas:_,gasPrice:C,maxFeePerBlobGas:S,maxFeePerGas:x,maxPriorityFeePerGas:A,nonce:I,to:W?void 0:O,value:P},"call");if(i&&kve({request:ie})&&!G&&s===void 0)try{const{deployless:Ce=!1}=typeof((V=t.batch)==null?void 0:V.multicall)=="object"?t.batch.multicall:{},xe=lee(t,{blockNumber:a,deployless:Ce});if(!xe||!Ive(Y,xe))return await $ve(t,{...ie,blockHash:s,blockNumber:a,blockTag:o,multicallAddress:xe,requestOptions:$,requireCanonical:l,rpcStateOverride:Y})}catch(Ce){if(!(Ce instanceof aee)&&!(Ce instanceof Dk))throw Ce}const se=(()=>{const Ce=[ie,q];return Y&&G?[...Ce,Y,G]:Y?[...Ce,Y]:G?[...Ce,{},G]:Ce})(),pe=await t.request({method:"eth_call",params:se},$);return pe==="0x"?{data:void 0}:{data:pe}}catch(q){if((F=$==null?void 0:$.signal)!=null&&F.aborted)throw k2($.signal);if(Y1(q))throw q;const G=Ove(q),{offchainLookup:Y,offchainLookupSignature:X}=await Le(async()=>{const{offchainLookup:te,offchainLookupSignature:ie}=await import("./ccip-DwabYA8N.js");return{offchainLookup:te,offchainLookupSignature:ie}},[]);if(t.ccipRead!==!1&&(G==null?void 0:G.slice(0,10))===X&&O)return{data:await Y(t,{data:G,requestOptions:$,to:O})};throw W&&(G==null?void 0:G.slice(0,10))==="0x101bb98d"?new o8e({factory:b}):oee(q,{...e,account:z,chain:t.chain})}}function kve({request:t}){const{data:e,to:n,...r}=t;return!(!e||e.startsWith(xve)||!n||Object.values(r).filter(i=>typeof i<"u").length>0)}let Tve=0;const vF=new WeakMap;function Lve(t){if(!t)return"default";const e=vF.get(t);if(e!==void 0)return e;const n=Tve++;return vF.set(t,n),n}async function $ve(t,e){var I;const{batchSize:n=1024,deployless:r=!1,wait:i=0}=typeof((I=t.batch)==null?void 0:I.multicall)=="object"?t.batch.multicall:{},{blockHash:s,blockNumber:a,blockTag:o=t.experimental_blockTag??"latest",requireCanonical:l,data:u,multicallAddress:f,requestOptions:p,rpcStateOverride:y,to:g}=e,b=f!==void 0?f:lee(t,{blockNumber:a,deployless:r}),v=Kf({blockHash:s,blockNumber:a,blockTag:o,requireCanonical:l}),_=typeof v=="string"?v:JSON.stringify(v),C=y?`.${JSON.stringify(y)}`:"",{schedule:S}=oN({id:`${t.uid}.${_}.${Lve(p)}${C}`,wait:i,shouldSplitBatch($){return $.reduce((P,{data:j})=>P+(j.length-2),0)>n*2},fn:async $=>{const O=$.map(z=>
485({allowFailure:!0,callData:z.data,target:z.to})),P=cs({abi:Ef,args:[O],functionName:"aggregate3"}),j={...b===null?{data:cee({code:A7,data:P})}:{to:b,data:P}},U=await t.request({method:"eth_call",params:y?[j,v,y]:[j,v]},p);return B2({abi:Ef,args:[O],functionName:"aggregate3",data:U||"0x"})}}),[{returnData:x,success:A}]=await S({data:u,to:g});if(!A)throw new b7({data:x});return x==="0x"?{data:void 0}:{data:x}}function lee(t,e){const{blockNumber:n,deployless:r}=e;if(r)return null;if(t.chain)return nm({blockNumber:n,chain:t.chain,contract:"multicall3"});throw new aee}function Ive(t,e){return t?Object.keys(t).some(n=>oc(n,e)):!1}function cee(t){const{code:e,data:n}=t;return k7({abi:MX(["constructor(bytes, bytes)"]),bytecode:see,args:[e,n]})}function Nve(t){const{data:e,factory:n,factoryData:r,to:i}=t;return k7({abi:MX(["constructor(address, bytes, address, bytes)"]),bytecode:Cve,args:[i,e,n,r]})}function Ove(t){var n;if(!(t instanceof Se))return;const e=t.walk();return typeof(e==null?void 0:e.data)=="object"?(n=e.data)==null?void 0:n.data:e.data}async function ir(t,e){const{abi:n,address:r,args:i,functionName:s,...a}=e,o=cs({abi:n,args:i,functionName:s});try{const{data:l}=await Ye(t,rm,"call")({...a,data:o,to:r});return B2({abi:n,args:i,functionName:s,data:l||"0x"})}catch(l){throw _f(l,{abi:n,address:r,args:i,docsPath:"/docs/contract/readContract",functionName:s})}}async function lN(t,e){var f;const{abi:n,address:r,args:i,functionName:s,dataSuffix:a=typeof t.dataSuffix=="string"?t.dataSuffix:(f=t.dataSuffix)==null?void 0:f.value,...o}=e,l=o.account?hn(o.account):t.account,u=cs({abi:n,args:i,functionName:s});try{const{data:p}=await Ye(t,rm,"call")({batch:!1,data:`${u}${a?a.replace("0x",""):""}`,to:r,...o,account:l}),y=B2({abi:n,args:i,functionName:s,data:p||"0x"}),g=n.filter(b=>"name"in b&&b.name===e.functionName);return{result:y,request:{abi:g,address:r,args:i,dataSuffix:a,functionName:s,...o,account:l}}}catch(p){throw _f(p,{abi:n,address:r,args:i,docsPath:"/docs/contract/simulateContract",functionName:s,sender:l==null?void 0:l.address})}}const b4=new Map,HC=new Map;let Pve=0;function lc(t,e,n){const r=++Pve,i=()=>b4.get(t)||[],s=()=>{const p=i().filter(y=>y.id!==r);if(p.length===0){b4.delete(t),HC.delete(t);return}b4.set(t,p)},a=()=>{const f=i();if(!f.some(y=>y.id===r))return;const p=HC.get(t);if(f.length===1&&p){const y=p();
485y instanceof Promise&&y.catch(()=>{})}s()},o=i();if(b4.set(t,[...o,{id:r,fns:e}]),o&&o.length>0)return a;const l={};for(const f in e)l[f]=((...p)=>{var g,b;const y=i();if(y.length!==0)for(const v of y)(b=(g=v.fns)[f])==null||b.call(g,...p)});const u=n(l);return typeof u=="function"&&HC.set(t,u),a}async function Uk(t,{signal:e}={}){return new Promise((n,r)=>{if(e!=null&&e.aborted){r(k2(e));return}const i=()=>e==null?void 0:e.removeEventListener("abort",a),s=setTimeout(()=>{i(),n()},t),a=()=>{clearTimeout(s),i(),r(k2(e))};e==null||e.addEventListener("abort",a,{once:!0})})}function im(t,{emitOnBegin:e,initialWaitTime:n,interval:r}){let i=!0;const s=()=>i=!1;return(async()=>{let o;e&&(o=await t({unpoll:s}));const l=await(n==null?void 0:n(o))??r;await Uk(l);const u=async()=>{i&&(await t({unpoll:s}),await Uk(r),u())};u()})(),s}const Rve=new Map,jve=new Map;function Mve(t){const e=(i,s)=>({clear:()=>s.delete(i),get:()=>s.get(i),set:a=>s.set(i,a)}),n=e(t,Rve),r=e(t,jve);return{clear:()=>{n.clear(),r.clear()},promise:n,response:r}}async function Dve(t,{cacheKey:e,cacheTime:n=Number.POSITIVE_INFINITY}){const r=Mve(e),i=r.response.get();if(i&&n>0&&Date.now()-i.created.getTime()<n)return i.data;let s=r.promise.get();s||(s=t(),r.promise.set(s));try{const a=await s;return r.response.set({created:new Date,data:a}),a}finally{r.promise.clear()}}const Uve=t=>`blockNumber.${t}`;async function sm(t,{cacheTime:e=t.cacheTime}={}){const n=await Dve(()=>t.request({method:"eth_blockNumber"}),{cacheKey:Uve(t.uid),cacheTime:e});return BigInt(n)}async function T7(t,{filter:e}){const n="strict"in e&&e.strict,r=await e.request({method:"eth_getFilterChanges",params:[e.id]});if(typeof r[0]=="string")return r;const i=r.map(s=>vl(s));return!("abi"in e)||!e.abi?i:wc({abi:e.abi,logs:i,strict:n})}async function L7(t,{filter:e}){return e.request({method:"eth_uninstallFilter",params:[e.id]})}function Bve(t,e){const{abi:n,address:r,args:i,batch:s=!0,eventName:a,fromBlock:o,onError:l,onLogs:u,poll:f,pollingInterval:p=t.pollingInterval,strict:y}=e;return(typeof f<"u"?f:typeof o=="bigint"?!0:!(t.transport.type==="webSocket"||t.transport.type==="ipc"||t.transport.type==="fallback"&&(t.transport.transports[0].c
485onfig.type==="webSocket"||t.transport.transports[0].config.type==="ipc")))?(()=>{const _=y??!1,C=ii(["watchContractEvent",r,i,s,t.uid,a,p,_,o]);return lc(C,{onLogs:u,onError:l},S=>{let x;o!==void 0&&(x=o-1n);let A,I=!1;const $=im(async()=>{var O;if(!I){try{A=await Ye(t,lQ,"createContractEventFilter")({abi:n,address:r,args:i,eventName:a,strict:_,fromBlock:o})}catch{}I=!0;return}try{let P;if(A)P=await Ye(t,T7,"getFilterChanges")({filter:A});else{const j=await Ye(t,sm,"getBlockNumber")({});x&&x<j?P=await Ye(t,MQ,"getContractEvents")({abi:n,address:r,args:i,eventName:a,fromBlock:x+1n,toBlock:j,strict:_}):P=[],x=j}if(P.length===0)return;if(s)S.onLogs(P);else for(const j of P)S.onLogs([j])}catch(P){A&&P instanceof T2&&(I=!1),(O=S.onError)==null||O.call(S,P)}},{emitOnBegin:!0,interval:p});return async()=>{A&&await Ye(t,L7,"uninstallFilter")({filter:A}),$()}})})():(()=>{const _=y??!1,C=ii(["watchContractEvent",r,i,s,t.uid,a,p,_]);let S=!0,x=()=>S=!1;return lc(C,{onLogs:u,onError:l},A=>((async()=>{try{const I=(()=>{if(t.transport.type==="fallback"){const P=t.transport.transports.find(j=>j.config.type==="webSocket"||j.config.type==="ipc");return P?P.value:t.transport}return t.transport})(),$=a?F6({abi:n,eventName:a,args:i}):[],{unsubscribe:O}=await I.subscribe({params:["logs",{address:r,topics:$}],onData(P){var U;if(!S)return;const j=P.result;try{const{eventName:z,args:D}=m8({abi:n,data:j.data,topics:j.topics,strict:y}),R=vl(j,{args:D,eventName:z});A.onLogs([R])}catch(z){let D,R;if(z instanceof p8||z instanceof LI){if(y)return;D=z.abiItem.name,R=(U=z.abiItem.inputs)==null?void 0:U.some(T=>!("name"in T&&T.name))}const W=vl(j,{args:R?[]:{},eventName:D});A.onLogs([W])}},onError(P){var j;(j=A.onError)==null||j.call(A,P)}});x=O,S||x()}catch(I){l==null||l(I)}})(),()=>x()))})()}class Mo extends Se{constructor({docsPath:e}={}){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(` 486`),{docsPath:e,docsSlug:"account",name:"AccountNotFoundError"})}}class cf extends Se{constructor({docsPath:e,metaMessages:n,type:r}){super(`Account type "${r}" is not supported.`,{docsPath:e,metaMessages:n,name:"AccountTypeNotSupportedError"})}}function Y6({chain:t,currentChainId:e}){if(!t)throw new Ave;if(e!==t.id)throw new Sve({chain:t,currentChainId:e})}async function $7(t,{serializedTransaction:e}){return t.request({method:"eth_sendRawTransaction",params:[e]},{retryCount:0})}const WC=new G1(128);async function am(t,e){var I,$,O,P,j,U;const{account:n=t.account,assertChainId:r=!0,chain:i=t.chain,accessList:s,authorizationList:a,blobs:o,data:l,dataSuffix:u=typeof t.dataSuffix=="string"?t.dataSuffix:(I=t.dataSuffix)==null?void 0:I.value,gas:f,gasPrice:p,maxFeePerBlobGas:y,maxFeePerGas:g,maxPriorityFeePerGas:b,nonce:v,type:_,value:C,...S}=e;if(typeof n>"u")throw new Mo({docsPath:"/docs/actions/wallet/sendTransaction"});const x=n?hn(n):null;let A;try{gc(e);const z=await(async()=>{if(e.to)return e.to;if(e.to!==null&&a&&a.length>0)return await w7({authorization:a[0]}).catch(()=>{throw new Se("`to` is required. Could not infer from `authorizationList`.")})})();if((x==null?void 0:x.type)==="json-rpc"||x===null){let D;i!==null&&(D=await Ye(t,bc,"getChainId")({}),r&&Y6({currentChainId:D,chain:i}));const R=(P=(O=($=t.chain)==null?void 0:$.formatters)==null?void 0:O.transactionRequest)==null?void 0:P.format,T=(R||yc)({...J1(S,{format:R}),accessList:s,account:x,authorizationList:a,blobs:o,chainId:D,data:u?ac([l??"0x",u]):l,gas:f,gasPrice:p,maxFeePerBlobGas:y,maxFeePerGas:g,maxPriorityFeePerGas:b,nonce:v,to:z,type:_,value:C},"sendTransaction"),L=WC.get(t.uid),M=L?"wallet_sendTransaction":"eth_sendTransaction";try{return await t.request({method:M,params:[T]},{retryCount:0})}catch(Z){if(L===!1)throw Z;const H=Z;if(H.name==="InvalidInputRpcError"||H.name==="InvalidParamsRpcError"||H.name==="MethodNotFoundRpcError"||H.name==="MethodNotSupportedRpcError")return await t.request({method:"wallet_sendTransaction",params:[T]},{retryCount:0}).then(V=>(WC.set(t.uid,!0),V)).catch(V=>{const F=V;throw F.name==="MethodNotFoundRpcError"||F.name==="MethodNotSupportedRpcError"?(WC.set(t.uid,!1),H):F});throw H}}if((x==null?void 0:x.type)==="local"){const D=(()=>
486{if(!x.nonceManager||typeof v<"u")return x.nonceManager;const L=x.nonceManager;return{consume(M){return A={address:M.address,chainId:M.chainId},L.consume(M)},get(M){return L.get(M)},increment(M){return L.increment(M)},reset(M){return L.reset(M)}}})(),R=await Ye(t,Q1,"prepareTransactionRequest")({account:x,accessList:s,authorizationList:a,blobs:o,chain:i,data:u?ac([l??"0x",u]):l,gas:f,gasPrice:p,maxFeePerBlobGas:y,maxFeePerGas:g,maxPriorityFeePerGas:b,nonce:v,nonceManager:D,parameters:[...XI,"sidecars"],type:_,value:C,...S,to:z}),W=(j=i==null?void 0:i.serializers)==null?void 0:j.transaction,T=await x.signTransaction(R,{serializer:W});return await Ye(t,$7,"sendRawTransaction")({serializedTransaction:T})}throw(x==null?void 0:x.type)==="smart"?new cf({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new cf({docsPath:"/docs/actions/wallet/sendTransaction",type:x==null?void 0:x.type})}catch(z){throw z instanceof cf?z:(A&&((U=x==null?void 0:x.nonceManager)==null||U.reset(A)),W6(z,{...e,account:x,chain:e.chain||void 0}))}}async function $o(t,e){return $o.internal(t,am,"sendTransaction",e)}(function(t){async function e(n,r,i,s){const{abi:a,account:o=n.account,address:l,args:u,functionName:f,...p}=s;if(typeof o>"u")throw new Mo({docsPath:"/docs/contract/writeContract"});const y=o?hn(o):null,g=cs({abi:a,args:u,functionName:f});try{return await Ye(n,r,i)({data:g,to:l,account:y,...p})}catch(b){throw _f(b,{abi:a,address:l,args:u,docsPath:"/docs/contract/writeContract",functionName:f,sender:y==null?void 0:y.address})}}t.internal=e})($o||($o={}));class Fve extends Se{constructor(e){super(`Call bundle failed with status: ${e.statusCode}`,{name:"BundleFailedError"}),Object.defineProperty(this,"result",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.result=e}}function b8(t,{delay:e=100,retryCount:n=2,shouldRetry:r=()=>!0,signal:i}={}){return new Promise((s,a)=>{const o=async({count:l=0}={})=>{if(i!=null&&i.aborted){a(k2(i));return}const u=async({error:f})=>{const p=typeof e=="function"?e({count:l,error:f}):e;if(p)try{await Uk(p,{signal:i})}catch(y){a(y);return}return o({count:l+1})};try{const f=await t();s(f)}catch(f){if(i!=null&&i.aborted){a(k2(i));return}if(Y1(f)){a(f);return}if(l<n&&await r({count:l,error:f}))return u({error:f});a(f)}};o().catch(a)})}const uee={"0x0":"reverted","0x1":"success"};function J6(t,e){const n={...t,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,contractAddress:t.contractAddress?t.contractAddress:null,cumulativeGasUsed:t.cumulativeGasUsed?BigInt(t.cumulativeGasUsed):null,effectiveGasPrice:t.effectiveGasPrice?BigInt(t.effectiveGasPrice):null,gasUsed:t.gasUsed?BigInt(t.gasUsed):null,logs:t.logs?t.logs.map(r=>vl(r)):null,to:t.to?t.to:null,transactionIndex:t.transactionIndex?da(t.transactionIndex):null,status:t.status?uee[t.status]:null,type:t.type?CQ[t.type]||t.type:null};return t.blobGasPrice&&(n.blobGasPrice=BigInt(t.blobGasPrice)),t.blobGasUsed&&(n.blobGasUsed=BigInt(t.blobGasUsed)),n}const cN=_7("transactionReceipt",J6),dee="0x5792579257925792579257925792579257925792579257925792579257925792",hee=ze(0,{size:32});async function fee(t,e){var y;const{account:n=t.account,chain:r=t.chain,experimental_fallback:i,experimental_fallbackDelay:s=32,forceAtomic:a=!1,id:o,version:l="2.0.0"}=e,u=n?hn(n):null;let f=e.capabilities;t.dataSuffix&&!((y=e.capabilities)!=null&&y.dataSuffix)&&(typeof t.dataSuffix=="string"?f={...e.capabilities,dataSuffix:{value:t.dataSuffix,optional:!0}}:f={...e.capabilities,dataSuffix:{value:t.dataSuffix.value,...t.dataSuffix.required?{}:{optional:!0}}});const p=e.calls.map(g=>{const b=g,v=b.abi?cs({abi:b.abi,functionName:b.functionName,args:b.args}):b.data;return{data:b.dataSuffix&&v?ac([v,b.dataSuffix]):v,to:b.to,value:b.value?ze(b.value):void 0}});try{const g=await t.request({method:"wallet_sendCalls",params:[{atomicRequired:a,calls:p,capabilities:f,chainId:ze(r.id),from:u==null?void 0:u.address,id:o,version:l}]},{retryCount:0});return typeof g=="string"?{id:g}:g}catch(g){const b=g;if(i&&(b.name==="MethodNotFoundRpcError"||b.name==="MethodNotSupportedRpcError"||b.name==="UnknownRpcError"||b.details.toLowerCase().includes("does not exist / is not available")||b.details.toLowerCase().includes("missing or invalid. request()")||b.details.toLowerCase().includes("did n
486ot match any variant of untagged enum")||b.details.toLowerCase().includes("account upgraded to unsupported contract")||b.details.toLowerCase().includes("eip-7702 not supported")||b.details.toLowerCase().includes("unsupported wc_ method")||b.details.toLowerCase().includes("feature toggled misconfigured")||b.details.toLowerCase().includes("jsonrpcengine: response has no error or result for request"))){if(f&&Object.values(f).some(S=>!S.optional)){const S="non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.";throw new c1(new Se(S,{details:S}))}if(a&&p.length>1){const C="`forceAtomic` is not supported on fallback to `eth_sendTransaction`.";throw new u1(new Se(C,{details:C}))}const v=[];for(const C of p){try{const S=await am(t,{account:u,chain:r,data:C.data,to:C.to,value:C.value?Rn(C.value):void 0});v.push({status:"fulfilled",value:S})}catch(S){v.push({reason:S,status:"rejected"})}s>0&&await new Promise(S=>setTimeout(S,s))}if(v.every(C=>C.status==="rejected"))throw v[0].reason;const _=v.map(C=>C.status==="fulfilled"?C.value:hee);return{id:ac([..._,ze(r.id,{size:32}),dee])}}throw W6(g,{...e,account:u,chain:e.chain})}}async function pee(t,e){async function n(f){if(f.endsWith(dee.slice(2))){const y=za(vk(f,-64,-32)),g=vk(f,0,-64).slice(2).match(/.{1,64}/g),b=await Promise.all(g.map(_=>hee.slice(2)!==_?t.request({method:"eth_getTransactionReceipt",params:[`0x${_}`]},{dedupe:!0}):void 0)),v=b.some(_=>_===null)?100:b.every(_=>(_==null?void 0:_.status)==="0x1")?200:b.every(_=>(_==null?void 0:_.status)==="0x0")?500:600;return{atomic:!1,chainId:da(y),receipts:b.filter(Boolean),status:v,version:"2.0.0"}}return t.request({method:"wallet_getCallsStatus",params:[f]})}const{atomic:r=!1,chainId:i,receipts:s,version:a="2.0.0",...o}=await n(e.id),[l,u]=(()=>{const f=o.status;return f>=100&&f<200?["pending",f]:f>=200&&f<300?["success",f]:f>=300&&f<700?["failure",f]:f==="CONFIRMED"?["success",200]:f==="PENDING"?["pending",100]:[void 0,f]})();return{...o,atomic:r,chainId:i?da(i):void 0,receipts:(s==null?void 0:s.map(f=>({...f,blockNumber:Rn(f.blockNumber),gasUsed:Rn(f.gasUsed),status:uee[f.status]})))??[],statusCode:u,status:l,version:a}}async function mee(t,e){const{id:n,pollingInterval:r=t.pollingInterval,status:i=({statusCode:v})=>v===200||v>=300,retryCount:s=4,retryDelay:a=({count:v})=>~~(1<<v)*200,timeout:o=6e4,throwOnFailure:l=!1}=e,u=ii(["waitForCallsStatus",t.uid,n]),{promise:f,resolve:p,reject:y}=aN();let g;const b=lc(u,{resolve:p,reject:y},v=>{const _=im(async()=>{const C=S=>{clearTimeout(g),_(),S(),b()};try{const S=await b8(async()=>{const x=await Ye(t,pee,"getCallsStatus")({id:n});if(l&&x.status==="failure")throw new Fve(x);return x},{retryCount:s,delay:a});if(!i(S))return;C(()=>v.resolve(S))}catch(S){C(()=>v.reject(S))}},{interval:r,emitOnBegin:!0});return _});return g=o?setTimeout(()=>{b(),clearTimeout(g),y(new zve({id:n}))},o):void 0,await f}class zve extends Se{constructor({id:e}){super(`Timed out while waiting for call bundle with id "${e}" to be confirmed.`,{name:"WaitForCallsStatusTimeoutError"})}}const Bk=256;let w4=Bk,v4;function yee(t=11){if(!v4||w4+t>Bk*2){v4="",w4=0;for(let e=0;e<Bk;e++)v4+=(256+Math.random()*256|0).toString(16).substring(1)}return v4.substring(w4,w4+++t)}function gee(t){const{batch:e,chain:n,ccipRead:r,dataSuffix:i,key:s="base",name:a="Base Client",tokens:o,type:l="base"}=t,u=t.experimental_blockTag??(typeof(n==null?void 0:n.experimental_preconfirmationTime)=="number"?"pending":void 0),f=(n==null?void 0:n.blockTime)??12e3,p=Math.min(Math.max(Math.floor(f/2),500),4e3),y=t.pollingInterval??p,g=t.cacheTime??y,b=t.account?hn(t.account):void 0,{config:v,request:_,value:C}=t.transport({account:b,chain:n,pollingInterval:y}),S={...v,...C},x={account:b,batch:e,cacheTime:g,ccipRead:r,chain:n,dataSuffix:i,key:s,name:a,pollingInterval:y,request:_,tokens:o,transport:S,type:l,uid:yee(),...u?{experimental_blockTag:u}:{}};function A(I){return $=>{const O=$(I);for(const j in x)delete O[j];const P={...I,...O};for(const j in O){const U=I[j],z=O[j];_F(U)&&_F(z)&&(P[j]={...U,...z})}return Object.assign(P,{extend:A(P)})}}return Object.assign(x,{extend:A(x)})}function _F(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return e===Object.prototype||e===null}function c2(t,e){const n=(r={})=>e(t,r);for(const r of["call","calls","callWithPeriod","estimateGas","prepare","prepareRecipient","predict","simulate"])if(Object.hasOwn(e,r)){const i=e[r];n[r]=(s={})=>i.length===1?i(s):i(t,s)}for(const r of["extractEvent","extractEvents"])Object.hasOwn(e,r)&&(n[r]=e[r]);return n}function uN(t){var n,r,i,s,a,o;if(!(t instanceof Se))return!1;const e=t.walk(l=>l instanceof m3);return e instanceof m3?((n=e.data)==null?void 0:n.errorName)==="HttpError"||((r=e.data)==null?void 0:r.errorName)==="ResolverError"||((i=e.data)==null?void 0:i.errorName)==="ResolverNotContract"||((s=e.data)==null?void 0:s.errorName)==="ResolverNotFound"||((a=e.data)==null?void 0:a.errorName)==="ReverseAddressMismatch"||((o=e.data)==null?void 0:o.errorName)==="UnsupportedResolverProfile":!1}function Vve(t){const{abi:e,data:n}=t,r=A2(n,0,4),i=e.find(s=>
486s.type==="function"&&r===B6(wl(s)));if(!i)throw new C4e(r,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:i.name,args:"inputs"in i&&i.inputs&&i.inputs.length>0?z6(i.inputs,A2(n,4)):void 0}}const qC="/docs/contract/encodeErrorResult";function xF(t){const{abi:e,errorName:n,args:r}=t;let i=e[0];if(n){const l=Zf({abi:e,args:r,name:n});if(!l)throw new VB(n,{docsPath:qC});i=l}if(i.type!=="error")throw new VB(void 0,{docsPath:qC});const s=wl(i),a=B6(s);let o="0x";if(r&&r.length>0){if(!i.inputs)throw new v4e(i.name,{docsPath:qC});o=U2(i.inputs,r)}return Wi([a,o])}const ZC="/docs/contract/encodeFunctionResult";function Hve(t){const{abi:e,functionName:n,result:r}=t;let i=e[0];if(n){const a=Zf({abi:e,name:n});if(!a)throw new s1(n,{docsPath:ZC});i=a}if(i.type!=="function")throw new s1(void 0,{docsPath:ZC});if(!i.outputs)throw new VX(i.name,{docsPath:ZC});const s=(()=>{if(i.outputs.length===0)return[];if(i.outputs.length===1)return[r];if(Array.isArray(r))return r;throw new HX(r)})();return U2(i.outputs,s)}const I7="x-batch-gateway:true";async function Wve(t){const{data:e,ccipRequest:n}=t,{args:[r]}=Vve({abi:Mk,data:e}),i=[],s=[];return await Promise.all(r.map(async(a,o)=>{try{s[o]=a.urls.includes(I7)?await Wve({data:a.data,ccipRequest:n}):await n(a),i[o]=!1}catch(l){i[o]=!0,s[o]=qve(l)}})),Hve({abi:Mk,functionName:"query",result:[i,s]})}function qve(t){return t.name==="HttpRequestError"&&t.status?xF({abi:Mk,errorName:"HttpError",args:[t.status,t.shortMessage]}):xF({abi:[cQ],errorName:"Error",args:["shortMessage"in t?t.shortMessage:t.message]})}function bee(t){if(t.length!==66||t.indexOf("[")!==0||t.indexOf("]")!==65)return null;const e=`0x${t.slice(1,65)}`;return Ss(e)?e:null}function Fk(t){let e=new Uint8Array(32).fill(0);if(!t)return _i(e);const n=t.split(".");for(let r=n.length-1;r>=0;r-=1){const i=bee(n[r]),s=i?xu(i):Ni(of(n[r]),"bytes");e=Ni(ac([e,s]),"bytes")}return _i(e)}function Zve(t){return`[${t.slice(2)}]`}function Kve(t){const e=new Uint8Array(32).fill(0);return t?bee(t)||Ni(of(t)):_i(e)}function dN(t){const e=t.replace(/^\.|\.$/gm,"");if(e.length===0)return new Uint8Array(1);const n=new Uint8Array(of(e).byteLength+2);let r=0;const i=e.split(".");for(let s=0;s<i.length;s++){let a=of(i[s]);a.byteLength>255&&(a=of(Zve(Kve(i[s])))),n[r]=a.length,n.set(a,r+1),r+=a.length+1}return n.byteLength!==r+1?n.slice(0,r+1):n}async function Gve(t,e){const{blockNumber:n,blockTag:r,coinType:i,name:s,gatewayUrls:a,strict:o}=e,{chain:l}=t,u=(()=>{if(e.universalResolverAddress)return e.universalResolverAddress;if(!l)throw new Error("client chain not configured. universalResolverAddress is required.");return nm({blockNumber:n,chain:l,contract:"ensUniversalResolver"})})(),f=l==null?void 0:l.ensTlds;if(f&&!f.some(y=>s.endsWith(y)))return null;const p=i!=null?[Fk(s),BigInt(i)]:[Fk(s)];try{const y=cs({abi:ree,functionName:"addr",args:p}),g={address:u,abi:nee,functionName:"resolveWithGateways",args:[Dt(dN(s)),y,a??[I7]],blockNumber:n,blockTag:r},v=await Ye(t,ir,"readContract")(g);if(v[0]==="0x")return null;const _=Yve({coinType:i,data:v[0],args:p});return _==="0x"||za(_)==="0x00"?null:_}catch(y){if(o)throw y;if(uN(y))return null;throw y}}function Yve({coinType:t,data:e,args:n}){try{return B2({abi:ree,args:n,functionName:"addr",data:e})}catch(r){if(t==null)throw r;const i=za(e);if(Ar(i)===20)return Vi(i);throw r}}class Jve extends Se{constructor({data:e}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(e)}`],name:"EnsAvatarInvalidMetadataError"})}}class Cy extends Se{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`,{name:"EnsAvatarInvalidNftUriError"})}}class hN extends Se{constructor({uri:e}){super(`Unable to resolve ENS avatar URI "${e}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class Xve extends Se{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const Qve=/(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,e7e=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,t7e=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,n7e=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function r7e(t){try{const e=await fetch(t,{method:"HEAD"});if(e.status===200){const n=e.headers.get("content-type");return n==null?void 0:n.startsWith("image/")}return!1}catch(e){return typeof e=="object"&&typeof e.response<"u"||!Object.hasOwn(globalThis,"Image")?!1:new Promise(n=>{const r=new Image;r.onload=()=>{n(!0)},r.onerror=()=>{n(!1)},r.src=t})}}function CF(t,e){return t?t.endsWith("/")?t.slice(0,-1):t:e}function wee({uri:t,gatewayUrls:e}){const n=t7e.test(t);if(n)return{uri:t,isOnChain:!0,isEncoded:n};const r=CF(e==null?void 0:e.ipfs,"https://ipfs.io"),i=CF(e==null?void 0:e.arweave,"https://arweave.net"),s=t.match(Qve),{protocol:a,subpath:o,target:l,subtarget:u=""}=(s==null?void 0:s.groups)||{},f=a==="ipns:/"||o==="ipns/",p=a==="ipfs:/"||o==="ipfs/"||e7e.test(t);if(t.startsWith("http")&&!f&&!p){let g=t;return e!=null&&e.arweave&&(g=t.replace(/https:\/\/arweave.net/g,e==null?void 0:e.arweave)),{uri:g,isOnChain:!1,isEncoded:!1}}if((f||p)&&l)return{uri:`${r}/${f?"ipns":"ipfs"}/${l}${u}`,isOnChain:!1,isEncoded:!1};if(a==="ar:/"&&l)return{uri:`${i}/${l}${u||""}`,isOnChain:!1,isEncoded:!1};let y=t.replace(n7e,"");if(y.startsWith("<svg")&&(y=`data:image/svg+xml;base64,${btoa(y)}`),y.startsWith("data:")||y.startsWith("{"))return{uri:y,isOnChain:!0,isEncoded:!1};throw new hN({uri:t})}function vee(t){if(typeof t!="object"||!("image"in t)&&!("image_url"in t)&&!("image_data"in t))throw new Jve({data:t});return t.image||t.image_url||t.image_data}async function i7e({gatewayUrls:t,uri:e}){try{const n=await fetch(e).then(i=>i.json());return await fN({gatewayUrls:t,uri:vee(n)})}catch{throw new hN({uri:e})}}async function fN({gatewayUrls:t,uri:e}){const{uri:n,isOnChain:r}
486=wee({uri:e,gatewayUrls:t});if(r||await r7e(n))return n;throw new hN({uri:e})}function s7e(t){let e=t;e.startsWith("did:nft:")&&(e=e.replace("did:nft:","").replace(/_/g,"/"));const[n,r,i]=e.split("/"),[s,a]=n.split(":"),[o,l]=r.split(":");if(!s||s.toLowerCase()!=="eip155")throw new Cy({reason:"Only EIP-155 supported"});if(!a)throw new Cy({reason:"Chain ID not found"});if(!l)throw new Cy({reason:"Contract address not found"});if(!i)throw new Cy({reason:"Token ID not found"});if(!o)throw new Cy({reason:"ERC namespace not found"});return{chainID:Number.parseInt(a,10),namespace:o.toLowerCase(),contractAddress:l,tokenID:i}}async function a7e(t,{nft:e}){if(e.namespace==="erc721")return ir(t,{address:e.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(e.tokenID)]});if(e.namespace==="erc1155")return ir(t,{address:e.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(e.tokenID)]});throw new Xve({namespace:e.namespace})}async function o7e(t,{gatewayUrls:e,record:n}){return/eip155:/i.test(n)?l7e(t,{gatewayUrls:e,record:n}):fN({uri:n,gatewayUrls:e})}async function l7e(t,{gatewayUrls:e,record:n}){const r=s7e(n),i=await a7e(t,{nft:r}),{uri:s,isOnChain:a,isEncoded:o}=wee({uri:i,gatewayUrls:e});if(a&&(s.includes("data:application/json;base64,")||s.startsWith("{"))){const u=o?atob(s.replace("data:application/json;base64,","")):s,f=JSON.parse(u);return fN({uri:vee(f),gatewayUrls:e})}let l=r.tokenID;return r.namespace==="erc1155"&&(l=l.replace("0x","").padStart(64,"0")),i7e({gatewayUrls:e,uri:s.replace(/(?:0x)?{id}/,l)})}async function _ee(t,e){const{blockNumber:n,blockTag:r,key:i,name:s,gatewayUrls:a,strict:o}=e,{chain:l}=t,u=(()=>{if(e.universalResolverAddress)return e.universalResolverAddress;if(!l)throw new Error("client chain not configured. universalResolverAddress is required.");return nm({blockNumber:n,chain:l,contract:"ensUniversalResolver"})})(),f=l==null?void 0:l.ensTlds;if(f&&!f.some(p=>s.endsWith(p)))return null;try{const p={address:u,abi:nee,args:[Dt(dN(s)),cs({abi:bF,functionName:"text",args:[Fk(s),i]}),a??[I7]],functionName:"resolveWithGateways",blockNumber:n,blockTag:r},g=await Ye(t,ir,"readContract")(p);if(g[0]==="0x")return null;const b=B2({abi:bF,functionName:"text",data:g[0]});return b===""?null:b}catch(p){if(o)throw p;if(uN(p))return null;throw p}}async function c7e(t,{blockNumber:e,blockTag:n,assetGatewayUrls:r,name:i,gatewayUrls:s,strict:a,universalResolverAddress:o}){const l=await Ye(t,_ee,"getEnsText")({blockNumber:e,blockTag:n,key:"avatar",name:i,universalResolverAddress:o,gatewayUrls:s,strict:a});if(!l)return null;try{return await o7e(t,{record:l,gatewayUrls:r})}catch{return null}}async function u7e(t,e){const{address:n,blockNumber:r,blockTag:i,coinType:s=60n,gatewayUrls:a,strict:o}=e,{chain:l}=t,u=(()=>{if(e.universalResolverAddress)return e.universalResolverAddress;if(!l)throw new Error("client chain not configured. universalResolverAddress is required.");return nm({blockNumber:r,chain:l,contract:"ensUniversalResolver"})})();try{const f={address:u,abi:_ve,args:[n,s,a??[I7]],functionName:"reverseWithGateways",blockNumber:r,blockTag:i},p=Ye(t,ir,"readContract"),[y]=await p(f);return y||null}catch(f){if(o)throw f;if(uN(f))return null;throw f}}async function d7e(t,e){const{blockNumber:n,blockTag:r,name:i}=e,{chain:s}=t,a=(()=>
486{if(e.universalResolverAddress)return e.universalResolverAddress;if(!s)throw new Error("client chain not configured. universalResolverAddress is required.");return nm({blockNumber:n,chain:s,contract:"ensUniversalResolver"})})(),o=s==null?void 0:s.ensTlds;if(o&&!o.some(u=>i.endsWith(u)))throw new Error(`${i} is not a valid ENS TLD (${o==null?void 0:o.join(", ")}) for chain "${s.name}" (id: ${s.id}).`);const[l]=await Ye(t,ir,"readContract")({address:a,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[Dt(dN(i))],blockNumber:n,blockTag:r});return l}async function h7e(t,e){var _,C,S;const{account:n=t.account,blockNumber:r,blockTag:i="latest",blobs:s,data:a,gas:o,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:f,maxPriorityFeePerGas:p,to:y,value:g,...b}=e,v=n?hn(n):void 0;try{gc(e);const A=(typeof r=="bigint"?ze(r):void 0)||i,I=(S=(C=(_=t.chain)==null?void 0:_.formatters)==null?void 0:C.transactionRequest)==null?void 0:S.format,O=(I||yc)({...J1(b,{format:I}),account:v,blobs:s,data:a,gas:o,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:f,maxPriorityFeePerGas:p,to:y,value:g},"createAccessList"),P=await t.request({method:"eth_createAccessList",params:[O,A]});if(P.error)throw new Se(P.error,{details:P.error});return{accessList:P.accessList,gasUsed:BigInt(P.gasUsed)}}catch(x){throw oee(x,{...e,account:v,chain:t.chain})}}async function f7e(t){const e=y7(t,{method:"eth_newBlockFilter"}),n=await t.request({method:"eth_newBlockFilter"});return{id:n,request:e(n),type:"block"}}async function xee(t,{address:e,args:n,event:r,events:i,fromBlock:s,strict:a,toBlock:o}={}){const l=i??(r?[r]:void 0),u=y7(t,{method:"eth_newFilter"});let f=[];l&&(f=[l.flatMap(g=>F6({abi:[g],eventName:g.name,args:n}))],r&&(f=f[0]));const p=await t.request({method:"eth_newFilter",params:[{address:e,fromBlock:typeof s=="bigint"?ze(s):s,toBlock:typeof o=="bigint"?ze(o):o,...f.length?{topics:f}:{}}]});return{abi:l,args:n,eventName:r?r.name:void 0,fromBlock:s,id:p,request:u(p),strict:!!a,toBlock:o,type:"event"}}async function Cee(t){const e=y7(t,{method:"eth_newPendingTransactionFilter"}),n=await t.request({method:"eth_newPendingTransactionFilter"});return{id:n,request:e(n),type:"transaction"}}async function p7e(t,{address:e,blockHash:n,blockNumber:r,blockTag:i=t.experimental_blockTag??"latest",requireCanonical:s}){var l,u,f;const a=Kf({blockHash:n,blockNumber:r,blockTag:i,requireCanonical:s});if((l=t.batch)!=null&&l.multicall&&((f=(u=t.chain)==null?void 0:u.contracts)!=null&&f.multicall3)){const p=t.chain.contracts.multicall3.address,y=cs({abi:Ef,functionName:"getEthBalance",args:[e]}),{data:g}=await Ye(t,rm,"call")({to:p,data:y,blockHash:n,blockNumber:r,blockTag:i,requireCanonical:s});return B2({abi:Ef,functionName:"getEthBalance",args:[e],data:g||"0x"})}const o=await t.request({method:"eth_getBalance",params:[e,a]});return BigInt(o)}async function m7e(t){const e=await t.request({method:"eth_blobBaseFee"});return BigInt(e)}async function y7e(t,{blockHash:e,blockNumber:n,blockTag:r=t.experimental_blockTag??"latest"}={}){var o,l,u;const i=n!==void 0?ze(n):void 0,s=await t.request({method:"eth_getBlockReceipts",params:[e||i||r]},{dedupe:!!(e||i)});if(!s)throw new zI({blockHash:e,blockNumber:n});const a=((u=(l=(o=t.chain)==null?void 0:o.formatters)==null?void 0:l.transactionReceipt)==null?void 0:u.format)||J6;return s.map(f=>a(f,"getBlockReceipts"))}async function g7e(t,{blockHash:e,blockNumber:n,blockTag:r="latest"}={}){const i=n!==void 0?ze(n):void 0;let s;return e?s=await t.request({method:"eth_getBlockTransactionCountByHash",params:[e]},{dedupe:!0}):s=await t.request({method:"eth_getBlockTransactionCountByNumber",params:[i||r]},{dedupe:!!i}),da(s)}async function D3(t,{address:e,blockHash:n,blockNumber:r,blockTag:i="latest",requireCanonical:s}){const a=Kf({blockHash:n,blockNumber:r,blockTag:i,requireCanonical:s}),o=await t.request({method:"eth_getCode",params:[e,a]},{dedupe:typeof r=="bigint"||n!==void 0});if(o!=="0x")return o}async function b7e(t,{address:e,blockNumber:n,blockTag:r="latest"}){const i=await D3(t,{address:e,...n!==void 0?{blockNumber:n}:{blockTag:r}});if(i&&Ar(i)===23&&i.startsWith("0xef0100"))return Vi(A2(i,3,23))}class w7e extends Se{constructor({address:e}){super(`No EIP-712 domain found on contract "${e}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${e}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}async function v7e(t,e){const{address:n,factory:r,factoryData:i}=e;try{const[s,a,o,l,u,f,p]=await Ye(t,ir,"readContract")({abi:_7e,address:n,functionName:"eip712Domain",factory:r,factoryData:i});return{domain:{name:a,version:o,chainId:Number(l),verifyingContract:u,salt:f},extensions:p,fields:s}}catch(s){const a=s;throw a.name==="ContractFunctionExecutionError"&&a.cause.name==="ContractFunctionZeroDataError"?new w7e({address:n}):a}}const _7e=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];function x7e(t){var e;return{baseFeePerGas:t.baseFeePerGas.map(n=>BigInt(n)),gasUsedRatio:t.gasUsedRatio,oldestBlock:BigInt(t.oldestBlock),reward:(e=t.reward)==null?void 0:e.map(n=>n.map(r=>BigInt(r)))}}async function C7e(t,{blockCount:e,blockNumber:n,blockTag:r="latest",rewardPercentiles:i}){const s=typeof n=="bigint"?ze(n):void 0,a=await t.request({method:"eth_feeHistory",params:[ze(e),s||r,i]},{dedupe:!!s});return x7e(a)}async function E7e(t,{filter:e}){const n=e.strict??!1,i=(await e.request({method:"eth_getFilterLogs",params:[e.id]})).map(s=>vl(s));return e.abi?wc({abi:e.abi,logs:i,strict:n}):i}function S7e(t){const{authorizationList:e}=t;if(e)for(const n of e){const{chainId:r}=n,i=n.address;if(!Yn(i))throw new vi({address:i});if(r<0)throw new G6({chainId:r})}pN(t)}function A7e(t){const{blobVersionedHashes:e}=t;if(e){if(e.length===0)throw new RQ;for(const n of e){const r=Ar(n),i=da(A2(n,0,1));if(r!==32)throw new j8e({hash:n,size:r});if(i!==PQ)throw new M8e({hash:n,version:i})}}pN(t)}function pN(t){const{chainId:e,maxPriorityFeePerGas:n,maxFeePerGas:r,to:i}=t;if(e<=0)throw new G6({chainId:e});if(i&&!Yn(i))throw new vi({address:i});if(r&&r>d1)throw new xf({maxFeePerGas:r});if(n&&r&&n>r)throw new R3({maxFeePerGas:r,maxPriorityFeePerGas:n})}function k7e(t){const{chainId:e,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:i,to:s}=t;if(e<=0)throw new G6({chainId:e});if(s&&!Yn(s))throw new vi({address:s});if(n||i)throw new Se("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(r&&r>d1)throw new xf({maxFeePerGas:r})}function T7e(t){const{chainId:e,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:i,to:s}=t;if(s&&!Yn(s))throw new vi({address:s});if(typeof e<"u"&&e<=0)throw new G6({chainId:e});if(n||i)throw new Se("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(r&&r>d1)throw new xf({maxFeePerGas:r})}function N7(t){if(!t||t.length===0)return[];const e=[];for(let n=0;n<t.length;n++){const{address:r,storageKeys:i}=t[n];for(let s=0;s<i.length;s++)if(i[s].length-2!==64)throw new n8e({storageKey:i[s]});if(!Yn(r,{strict:!1}))throw new vi({address:r});e.push([r,i])}return e}function U3(t,e){const n=YI(t);return n==="eip1559"?I7e(t,e):n==="eip2930"?N7e(t,e):n==="eip4844"?$7e(t,e):n==="eip7702"?L7e(t,e):O7e(t,e)}function L7e(t,e){const{authorizationList:n,chainId:r,gas:i,nonce:s,to:a,value:o,maxFeePerGas:l,maxPriorityFeePerGas:u,accessList:f,data:p}=t;S7e(t);const y=N7(f),g=P7e(n);return Wi(["0x04",Nu([ze(r),s?ze(s):"0x",u?ze(u):"0x",l?ze(l):"0x",i?ze(i):"0x",a??"0x",o?ze(o):"0x",p??"0x",y,g,...X6(t,e)])])}function $7e(t,e){const{chainId:n,gas:r,nonce:i,to:s,value:a,maxFeePerBlobGas:o,maxFeePerGas:l,maxPriorityFeePerGas:u,accessList:f,data:p}=t;A7e(t);let y=t.blobVersionedHashes,g=t.sidecars;if(t.blobs&&(typeof y>"u"||typeof g>"u")){const x=typeof t.blobs[0]=="string"?t.blobs:t.blobs.map($=>_i($)),A=t.kzg,I=qI({blobs:x,kzg:A});if(typeof y>"u"&&(y=IQ({commitments:I})),typeof g>"u"){const $=ZI({blobs:x,commitments:I,kzg:A});g=jQ({blobs:x,commitments:I,proofs:$})}}const b=N7(f),v=[ze(n),i?ze(i):"0x",u?ze(u):"0x",l?ze(l):"0x",r?ze(r):"0x",s??"0x",a?ze(a):"0x",p??"0x",b,o?ze(o):"0x",y??[],...X6(t,e)],_=[],C=[],S=[];if(g)for(let x=0;x<g.length;x++){const{blob:A,commitment:I,proof:$}=g[x];_.push(A),C.push(I),S.push($)}return Wi(["0x03",Nu(g?[v,_,C,S]:v)])}function I7e(t,e){const{chainId:n,gas:r,nonce:i,to:s,value:a,maxFeePerGas:o,maxPriorityFeePerGas:l,accessList:u,data:f}=t;pN(t);const p=N7(u),y=[ze(n),i?ze(i):"0x",l?ze(l):"0x",o?ze(o):"0x",r?ze(r):"0x",s??"0x",a?ze(a):"0x",f??"0x",p,...X6(t,e)];return Wi(["0x02",Nu(y)])}function N7e(t,e){const{chainId:n,gas:r,data:i,nonce:s,to:a,value:o,accessList:l,gasPrice:u}=t;
486k7e(t);const f=N7(l),p=[ze(n),s?ze(s):"0x",u?ze(u):"0x",r?ze(r):"0x",a??"0x",o?ze(o):"0x",i??"0x",f,...X6(t,e)];return Wi(["0x01",Nu(p)])}function O7e(t,e){const{chainId:n=0,gas:r,data:i,nonce:s,to:a,value:o,gasPrice:l}=t;T7e(t);let u=[s?ze(s):"0x",l?ze(l):"0x",r?ze(r):"0x",a??"0x",o?ze(o):"0x",i??"0x"];if(e){const f=(()=>{if(e.v>=35n)return(e.v-35n)/2n>0?e.v:27n+(e.v===35n?0n:1n);if(n>0)return BigInt(n*2)+BigInt(35n+e.v-27n);const g=27n+(e.v===27n?0n:1n);if(e.v!==g)throw new e8e({v:e.v});return g})(),p=za(e.r),y=za(e.s);u=[...u,ze(f),p==="0x00"?"0x":p,y==="0x00"?"0x":y]}else n>0&&(u=[...u,ze(n),"0x","0x"]);return Nu(u)}function X6(t,e){const n=e??t,{v:r,yParity:i}=n;if(typeof n.r>"u")return[];if(typeof n.s>"u")return[];if(typeof r>"u"&&typeof i>"u")return[];const s=za(n.r),a=za(n.s);return[typeof i=="number"?i?ze(1):"0x":r===0n?"0x":r===1n?ze(1):r===27n?"0x":ze(1),s==="0x00"?"0x":s,a==="0x00"?"0x":a]}function P7e(t){if(!t||t.length===0)return[];const e=[];for(const n of t){const{chainId:r,nonce:i,...s}=n,a=n.address;e.push([r?Dt(r):"0x",a,i?Dt(i):"0x",...X6({},s)])}return e}async function R7e({address:t,authorization:e,signature:n}){return oc(Vi(t),await w7({authorization:e,signature:n}))}const _4=new G1(8192);function j7e(t,{enabled:e=!0,id:n}){if(!e||!n)return t();if(_4.get(n))return _4.get(n);const r=t().finally(()=>_4.delete(n));return _4.set(n,r),r}function M7e(t,e={}){return async(n,r={})=>{var y;const{dedupe:i=!1,methods:s,retryDelay:a=150,retryCount:o=3,signal:l,uid:u}={...e,...r},{method:f}=n;if((y=s==null?void 0:s.exclude)!=null&&y.includes(f))throw new Wh(new Error("method not supported"),{method:f});if(s!=null&&s.include&&!s.include.includes(f))throw new Wh(new Error("method not supported"),{method:f});if(l!=null&&l.aborted)throw k2(l);const p=i?U7e(`${u}.${ii(n)}`):void 0;return j7e(()=>b8(async()=>{try{return await t(n,l?{signal:l}:void 0)}catch(g){if(l!=null&&l.aborted)throw k2(l);if(Y1(g))throw g;const b=g;switch(b.code){case y3.code:throw new y3(b);case g3.code:throw new g3(b);case b3.code:throw new b3(b,{method:n.method});case w3.code:throw new w3(b);case vf.code:throw new vf(b);case T2.code:throw new T2(b);case v3.code:throw new v3(b);case _3.code:throw new _3(b);case x3.code:throw new x3(b);case Wh.code:throw new Wh(b,{method:n.method});case l1.code:throw new l1(b);case C3.code:throw new C3(b);case z0.code:throw new z0(b);case E3.code:throw new E3(b);case S3.code:throw new S3(b);case A3.code:throw new A3(b);case k3.code:throw new k3(b);case T3.code:throw new T3(b);case c1.code:throw new c1(b);case L3.code:throw new L3(b);case $3.code:throw new $3(b);case I3.code:throw new I3(b);case N3.code:throw new N3(b);case O3.code:throw new O3(b);case u1.code:throw new u1(b);case 5e3:throw new z0(b);case P3.code:throw new P3(b);default:throw g instanceof Se?g:new c8e(b)}}},{delay:({count:g,error:b})=>{var v;if(b&&b instanceof Ng){const _=(v=b==null?void 0:b.headers)==null?void 0:v.get("Retry-After");if(_!=null&&_.match(/\d/))return Number.parseInt(_,10)*1e3}return~~(1<<g)*a},retryCount:o,signal:l,shouldRetry:({error:g})=>D7e(g)}),{enabled:i,id:p})}}function D7e(t){return Y1(t)?!1:"code"in t&&typeof t.code=="number"?t.code===-1||t.code===l1.code||t.code===vf.code||t.code===429:t instanceof Ng&&t.status?t.status===403||t.status===408||t.status===413||t.status===429||t.status===500||t.status===502||t.status===503||t.status===504:!0}function U7e(t,e=0){let n=3735928559^e,r=1103547991^e;for(let i=0;i<t.length;i++){const s=t.charCodeAt(i);n=Math.imul(n^s,2654435761),r=Math.imul(r^s,1597334677)}return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>16,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>16,3266489909),(4294967296*(2097151&r)+(n>>>0)).toString(36)}function xi(t){const e={formatters:void 0,fees:void 0,serializers:void 0,...t};function n(r){return i=>{const s=typeof i=="function"?i(r):i,a={...r,...s};return Object.assign(a,{extend:n(a)})}}return Object.assign(e,{extend:n(e)})}function B7e(){return{}}function F7e(t,{errorInstance:e=new Error("timed out"),timeout:n,signal:r}){return new Promise((i,s)=>{(async()=>{let a;const o=new AbortController;try{n>0&&(a=setTimeout(()=>{r&&o.abort()}
486,n)),i(await t({signal:(o==null?void 0:o.signal)||null}))}catch(l){if(o!=null&&o.signal.aborted&&Y1(l)){s(e);return}s(l)}finally{clearTimeout(a)}})()})}function z7e(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const EF=z7e(),V7e=10485760;function H7e(t,e={}){const{url:n,headers:r}=q7e(t);return{async request(i){var v,_,C;const{body:s,fetchFn:a=e.fetchFn??fetch,maxResponseBodySize:o=e.maxResponseBodySize??V7e,onRequest:l=e.onRequest,onResponse:u=e.onResponse,timeout:f=e.timeout??1e4}=i,p={...e.fetchOptions??{},...i.fetchOptions??{}},{headers:y,method:g,signal:b}=p;try{const S=await F7e(async({signal:I})=>{const $={...p,body:Array.isArray(s)?ii(s.map(U=>({jsonrpc:"2.0",id:U.id??EF.take(),...U}))):ii({jsonrpc:"2.0",id:s.id??EF.take(),...s}),headers:{...r,"Content-Type":"application/json",...y},method:g||"POST",signal:b||(f>0?I:null)},O=new Request(n,$),P=await(l==null?void 0:l(O,$))??{...$,url:n};return await a(P.url??n,P)},{errorInstance:new sF({body:s,url:n}),timeout:f,signal:!0});u&&await u(S);let x;const A=await W7e(S,{maxResponseBodySize:o});if((v=S.headers.get("Content-Type"))!=null&&v.startsWith("application/json"))x=JSON.parse(A);else{x=A;try{x=JSON.parse(x||"{}")}catch(I){if(S.ok)throw I;x={error:x}}}if(!S.ok){if(typeof((_=x.error)==null?void 0:_.code)=="number"&&typeof((C=x.error)==null?void 0:C.message)=="string")return x;throw new Ng({body:s,details:ii(x.error)||S.statusText,headers:S.headers,status:S.status,url:n})}return x}catch(S){throw b!=null&&b.aborted?k2(b):Y1(S)||S instanceof Ng||S instanceof Sw||S instanceof sF?S:new Ng({body:s,cause:S,url:n})}}}}async function W7e(t,{maxResponseBodySize:e}){if(e===!1)return t.text();const n=t.headers.get("Content-Length");if(n){const o=Number(n);if(o>e)throw new Sw({maxSize:e,size:o})}if(!t.body){const o=await t.text(),l=new TextEncoder().encode(o).length;if(l>e)throw new Sw({maxSize:e,size:l});return o}const r=t.body.getReader(),i=new TextDecoder;let s="",a=0;try{for(;;){const{done:o,value:l}=await r.read();if(o)break;if(a+=l.byteLength,a>e)throw await r.cancel(),new Sw({maxSize:e,size:a});s+=i.decode(l,{stream:!0})}return s+=i.decode(),s}finally{r.releaseLock()}}function q7e(t){try{const e=new URL(t),n=(()=>{if(e.username){const r=`${decodeURIComponent(e.username)}:${decodeURIComponent(e.password)}`;return e.username="",e.password="",{url:e.toString(),headers:{Authorization:`Basic ${btoa(r)}`}}}})();return{url:e.toString(),...n}}catch{return{url:t}}}const Z7e=`�Ethereum Signed Message: 487`;function K7e(t){const e=typeof t=="string"?h3(t):typeof t.raw=="string"?t.raw:_i(t.raw),n=h3(`${Z7e}${Ar(e)}`);return ac([n,e])}function mN(t,e){return Ni(K7e(t),e)}class G7e extends Se{constructor({domain:e}){super(`Invalid domain "${ii(e)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class Y7e extends Se{constructor({primaryType:e,types:n}){super(`Invalid primary type \`${e}\` must be one of \`${JSON.stringify(Object.keys(n))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class J7e extends Se{constructor({type:e}){super(`Struct type "${e}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}class X7e extends Se{constructor({type:e}){const n=e.replace(/^(u?int)/,"$&256");super(`Type "${e}" is not a valid EIP-712 type.`,{metaMessages:[`Use "${n}" instead.`],name:"InvalidTypedDataTypeError"})}}function Q7e(t){const{domain:e,message:n,primaryType:r,types:i}=t,s=(l,u)=>{const f={...u};for(const p of l){const{name:y,type:g}=p;g==="address"&&(f[y]=f[y].toLowerCase())}return f},a=i.EIP712Domain?e?s(i.EIP712Domain,e):{}:{},o=(()=>{if(r!=="EIP712Domain")return s(i[r],n)})();return ii({domain:a,message:o,primaryType:r,types:i})}function Eee(t){const{domain:e,message:n,primaryType:r,types:i}=t,s=(a,o)=>{for(const l of a){const{name:u,type:f}=l,p=o[u],y=f.replace(/(\[[0-9]*\])+$/,"");if(y==="int"||y==="uint")throw new X7e({type:f});const g=f.match(aQ);if(g&&(typeof p=="number"||typeof p=="bigint")){const[_,C,S]=g;ze(p,{signed:C==="int",size:Number.parseInt(S,10)/8})}if(f==="address"&&typeof p=="string"&&!Yn(p))throw new vi({address:p});const b=f.match(xwe);if(b){const[_,C]=b;if(C&&Ar(p)!==Number.parseInt(C,10))throw new S4e({expectedSize:Number.parseInt(C,10),givenSize:Ar(p)})}const v=i[f];v&&(e9e(f),s(v,p))}};if(i.EIP712Domain&&e){if(typeof e!="object")throw new G7e({domain:e});s(i.EIP712Domain,e)}if(r!=="EIP712Domain")if(i[r])s(i[r],n);else throw new Y7e({primaryType:r,types:i})}function See({domain:t}
487){return[typeof(t==null?void 0:t.name)=="string"&&{name:"name",type:"string"},(t==null?void 0:t.version)&&{name:"version",type:"string"},(typeof(t==null?void 0:t.chainId)=="number"||typeof(t==null?void 0:t.chainId)=="bigint")&&{name:"chainId",type:"uint256"},(t==null?void 0:t.verifyingContract)&&{name:"verifyingContract",type:"address"},(t==null?void 0:t.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}function e9e(t){if(t==="address"||t==="bool"||t==="string"||t.startsWith("bytes")||t.startsWith("uint")||t.startsWith("int"))throw new J7e({type:t})}function Aee(t){const{domain:e={},message:n,primaryType:r}=t,i={EIP712Domain:See({domain:e}),...t.types};Eee({domain:e,message:n,primaryType:r,types:i});const s=["0x1901"];return e&&s.push(t9e({domain:e,types:i})),r!=="EIP712Domain"&&s.push(kee({data:n,primaryType:r,types:i})),Ni(ac(s))}function t9e({domain:t,types:e}){return kee({data:t,primaryType:"EIP712Domain",types:e})}function kee({data:t,primaryType:e,types:n}){const r=Tee({data:t,primaryType:e,types:n});return Ni(r)}function Tee({data:t,primaryType:e,types:n}){const r=[{type:"bytes32"}],i=[n9e({primaryType:e,types:n})];for(const s of n[e]){const[a,o]=$ee({types:n,name:s.name,type:s.type,value:t[s.name]});r.push(a),i.push(o)}return U2(r,i)}function n9e({primaryType:t,types:e}){const n=Dt(r9e({primaryType:t,types:e}));return Ni(n)}function r9e({primaryType:t,types:e}){let n="";const r=Lee({primaryType:t,types:e});r.delete(t);const i=[t,...Array.from(r).sort()];for(const s of i)n+=`${s}(${e[s].map(({name:a,type:o})=>`${o} ${a}`).join(",")})`;return n}function Lee({primaryType:t,types:e},n=new Set){const r=t.match(/^\w*/u),i=r==null?void 0:r[0];if(n.has(i)||e[i]===void 0)return n;n.add(i);for(const s of e[i])Lee({primaryType:s.type,types:e},n);return n}function $ee({types:t,name:e,type:n,value:r}){if(t[n]!==void 0)return[{type:"bytes32"},Ni(Tee({data:r,primaryType:n,types:t}))];if(n==="bytes")return[{type:"bytes32"},Ni(r)];if(n==="string")return[{type:"bytes32"},Ni(Dt(r))];if(n.lastIndexOf("]")===n.length-1){const i=n.slice(0,n.lastIndexOf("[")),s=r.map(a=>$ee({name:e,type:i,types:t,value:a}));return[{type:"bytes32"},Ni(U2(s.map(([a])=>a),s.map(([,a])=>a)))]}return[{type:n},r]}const vgt="0x6492649264926492649264926492649264926492649264926492649264926492",SF="0x0000000000000000000000000000000000000000000000000000000000000000";let i9e=class extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const n=super.get(e);return super.has(e)&&n!==void 0&&(this.delete(e),super.set(e,n)),n}set(e,n){if(super.set(e,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}};const s9e={checksum:new i9e(8192)},KC=s9e.checksum;let Iee=class extends II{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,X4e(e);const r=h7(n);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,s=new Uint8Array(i);s.set(r.length>i?e.create().update(r).digest():r);for(let a=0;a<s.length;a++)s[a]^=54;this.iHash.update(s),this.oHash=e.create();for(let a=0;a<s.length;a++)s[a]^=106;this.oHash.update(s),S2(s)}update(e){return a1(this),this.iHash.update(e),this}digestInto(e){a1(this),wf(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:i,destroyed:s,blockLen:a,outputLen:o}=this;return e=e,e.finished=i,e.destroyed=s,e.blockLen=a,e.outputLen=o,e.oHash=n._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};const Nee=(t,e,n)=>new Iee(t,e).update(n).digest();Nee.create=(t,e)=>new Iee(t,e);function qu(t,e={}){const{as:n=typeof t=="string"?"Hex":"Bytes"}=e,r=tQ(sN(t));return n==="Bytes"?r:Oi(r)}function AF(t,e={}){const{as:n=typeof t=="string"?"Hex":"Bytes"}=e,r=LQ(sN(t));return n==="Bytes"?r:Oi(r)}function a9e(t){return ol(t)&&Vn(t)===32}function Oee(t,e={}){const{compressed:n}=e,{prefix:r,x:i,y:s}=t;if(n===!1||typeof i=="bigint"&&typeof s=="bigint"){if(r!==4)throw new kF({prefix:r,cause:new h9e});return}if(n===!0||typeof i=="bigint"&&typeof s>"u"){if(r!==3&&r!==2)throw new kF({prefix:r,cause:new d9e});return}throw new u9e({publicKey:t})}function o9e(t){const e=(()=>
487{if(ol(t))return yN(t);if(dve(t))return l9e(t);const{prefix:n,x:r,y:i}=t;return typeof r=="bigint"&&typeof i=="bigint"?{prefix:n??4,x:r,y:i}:{prefix:n,x:r}})();return Oee(e),e}function l9e(t){return yN(Oi(t))}function yN(t){if(t.length!==132&&t.length!==130&&t.length!==68)throw new f9e({publicKey:t});if(t.length===130){const r=BigInt(tn(t,0,32)),i=BigInt(tn(t,32,64));return{prefix:4,x:r,y:i}}if(t.length===132){const r=Number(tn(t,0,1)),i=BigInt(tn(t,1,33)),s=BigInt(tn(t,33,65));return{prefix:r,x:i,y:s}}const e=Number(tn(t,0,1)),n=BigInt(tn(t,1,33));return{prefix:e,x:n}}function c9e(t,e={}){return F2(gN(t,e))}function gN(t,e={}){Oee(t);const{prefix:n,x:r,y:i}=t,{includePrefix:s=!0}=e;return fr(s?He(n,{size:1}):"0x",He(r,{size:32}),typeof i=="bigint"?He(i,{size:32}):"0x")}let u9e=class extends ut{constructor({publicKey:e}){super(`Value \`${tm(e)}\` is not a valid public key.`,{metaMessages:["Public key must contain:","- an `x` and `prefix` value (compressed)","- an `x`, `y`, and `prefix` value (uncompressed)"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidError"})}},kF=class extends ut{constructor({prefix:e,cause:n}){super(`Prefix "${e}" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidPrefixError"})}},d9e=class extends ut{constructor(){super("Prefix must be 2 or 3 for compressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidCompressedPrefixError"})}},h9e=class extends ut{constructor(){super("Prefix must be 4 for uncompressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidUncompressedPrefixError"})}},f9e=class extends ut{constructor({publicKey:e}){super(`Value \`${e}\` is an invalid public key size.`,{metaMessages:["Expected: 33 bytes (compressed + prefix), 64 bytes (uncompressed) or 65 bytes (uncompressed + prefix).",`Received ${Vn(K6(e))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidSerializedSizeError"})}};const p9e=/^0x[a-fA-F0-9]{40}$/;function xl(t,e={}){const{strict:n=!0}=e;if(!p9e.test(t))throw new TF({address:t,cause:new m9e});if(n){if(t.toLowerCase()===t)return;if(O7(t)!==t)throw new TF({address:t,cause:new y9e})}}function O7(t){if(KC.has(t))return KC.get(t);xl(t,{strict:!1});const e=t.substring(2).toLowerCase(),n=qu(WQ(e),{as:"Bytes"}),r=e.split("");for(let s=0;s<40;s+=2)n[s>>1]>>4>=8&&r[s]&&(r[s]=r[s].toUpperCase()),(n[s>>1]&15)>=8&&r[s+1]&&(r[s+1]=r[s+1].toUpperCase());const i=`0x${r.join("")}`;return KC.set(t,i),i}function Pee(t,e={}){const{checksum:n=!1}=e;return xl(t),n?O7(t):t}function b2(t,e={}){const n=qu(`0x${gN(t).slice(4)}`).substring(26);return Pee(`0x${n}`,e)}function u2(t,e){return xl(t,{strict:!1}),xl(e,{strict:!1}),t.toLowerCase()===e.toLowerCase()}function L2(t,e={}){const{strict:n=!0}=e??{};try{return xl(t,{strict:n}),!0}catch{return!1}}let TF=class extends ut{constructor({address:e,cause:n}){super(`Address "${e}" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}},m9e=class extends ut{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}},y9e=class extends ut{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}};const g9e=/^(.*)\[([0-9]*)\]$/,b9e=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Ree=/^(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)?$/,LF=2n**256n-1n;function H0(t,e,n){const{checksumAddress:r,staticPosition:i}=n,s=vN(e.type);if(s){const[a,o]=s;return v9e(t,{...e,type:o},{checksumAddress:r,length:a,staticPosition:i})}if(e.type==="tuple")return E9e(t,e,{checksumAddress:r,staticPosition:i});if(e.type==="address")return w9e(t,{checksum:r});if(e.type==="bool")return _9e(t);if(e.type.startsWith("bytes"))return x9e(t,e,{staticPosition:i});if(e.type.startsWith("uint")||e.type.startsWith("int"))return C9e(t,e);if(e.type==="string")return S9e(t,{staticPosition:i});throw new CN(e.type)}const $F=32,zk=32;function w9e(t,e={}){const{checksum:n=!1}=e,r=t.readBytes(32);return[(s=>n?O7(s):s)(Oi(ove(r,-20))),32]}function v9e(t,e,n){const{checksumAddress:r,length:i,staticPosition:s}=n;
487if(i===null){const l=Eu(t.readBytes(zk)),u=s+l,f=u+$F;t.setPosition(u);const p=Eu(t.readBytes($F)),y=f1(e);let g=0;const b=[];for(let v=0;v<p;++v){t.setPosition(f+(y?v*32:g));const[_,C]=H0(t,e,{checksumAddress:r,staticPosition:f});g+=C,b.push(_),C===0&&(t.assertReadLimit(),t._touch())}return t.setPosition(s+32),[b,32]}if(f1(e)){const l=Eu(t.readBytes(zk)),u=s+l,f=[];for(let p=0;p<i;++p){t.setPosition(u+p*32);const[y]=H0(t,e,{checksumAddress:r,staticPosition:u});f.push(y)}return t.setPosition(s+32),[f,32]}let a=0;const o=[];for(let l=0;l<i;++l){const[u,f]=H0(t,e,{checksumAddress:r,staticPosition:s+a});a+=f,o.push(u),f===0&&(t.assertReadLimit(),t._touch())}return[o,a]}function _9e(t){return[cve(t.readBytes(32),{size:32}),32]}function x9e(t,e,{staticPosition:n}){const[r,i]=e.type.split("bytes");if(!i){const a=Eu(t.readBytes(32));t.setPosition(n+a);const o=Eu(t.readBytes(32));if(o===0)return t.setPosition(n+32),["0x",32];const l=t.readBytes(o);return t.setPosition(n+32),[Oi(l),32]}return[Oi(t.readBytes(Number.parseInt(i,10),32)),32]}function C9e(t,e){const n=e.type.startsWith("int"),r=Number.parseInt(e.type.split("int")[1]||"256",10),i=t.readBytes(32);return[r>48?lve(i,{signed:n}):Eu(i,{signed:n}),32]}function E9e(t,e,n){const{checksumAddress:r,staticPosition:i}=n,s=e.components.length===0||e.components.some(({name:l})=>!l),a=s?[]:{};let o=0;if(f1(e)){const l=Eu(t.readBytes(zk)),u=i+l;for(let f=0;f<e.components.length;++f){const p=e.components[f];t.setPosition(u+o);const[y,g]=H0(t,p,{checksumAddress:r,staticPosition:u});o+=g,a[s?f:p==null?void 0:p.name]=y}return t.setPosition(i+32),[a,32]}for(let l=0;l<e.components.length;++l){const u=e.components[l],[f,p]=H0(t,u,{checksumAddress:r,staticPosition:i});a[s?l:u==null?void 0:u.name]=f,o+=p}return[a,o]}function S9e(t,{staticPosition:e}){const n=Eu(t.readBytes(32)),r=e+n;t.setPosition(r);const i=Eu(t.readBytes(32));if(i===0)return t.setPosition(e+32),["",32];const s=t.readBytes(i,32),a=uve(qQ(s));return t.setPosition(e+32),[a,32]}function A9e({checksumAddress:t,parameters:e,values:n}){const r=[];for(let i=0;i<e.length;i++)r.push(bN({checksumAddress:t,parameter:e[i],value:n[i]}));return r}function bN({checksumAddress:t=!1,parameter:e,value:n}){const r=e,i=vN(r.type);if(i){const[s,a]=i;return T9e(n,{checksumAddress:t,length:s,parameter:{...r,type:a}})}if(r.type==="tuple")return O9e(n,{checksumAddress:t,parameter:r});if(r.type==="address")return k9e(n,{checksum:t});if(r.type==="bool")return $9e(n);if(r.type.startsWith("uint")||r.type.startsWith("int")){const s=r.type.startsWith("int"),[,,a="256"]=Ree.exec(r.type)??[];return I9e(n,{signed:s,size:Number(a)})}if(r.type.startsWith("bytes"))return L9e(n,{type:r.type});if(r.type==="string")return N9e(n);throw new CN(r.type)}function wN(t){let e=0;for(let s=0;s<t.length;s++){const{dynamic:a,encoded:o}=t[s];a?e+=32:e+=Vn(o)}const n=[],r=[];let i=0;for(let s=0;s<t.length;s++){const{dynamic:a,encoded:o}=t[s];a?(n.push(He(e+i,{size:32})),r.push(o),i+=Vn(o)):n.push(o)}return fr(...n,...r)}function k9e(t,e){const{checksum:n=!1}=e;return xl(t,{strict:n}),{dynamic:!1,encoded:_l(t.toLowerCase())}}function T9e(t,e){const{checksumAddress:n,length:r,parameter:i}=e,s=r===null;if(!Array.isArray(t))throw new B9e(t);if(!s&&t.length!==r)throw new U9e({expectedLength:r,givenLength:t.length,type:`${i.type}[${r}]`});let a=t.length===0&&f1(i);const o=[];for(let l=0;l<t.length;l++){const u=bN({checksumAddress:n,parameter:i,value:t[l]});u.dynamic&&(a=!0),o.push(u)}if(s||a){const l=wN(o);if(s){const u=He(o.length,{size:32});return{dynamic:!0,encoded:o.length>0?fr(u,l):u}}if(a)return{dynamic:!0,encoded:l}}return{dynamic:!1,encoded:fr(...o.map(({encoded:l})=>l))}}function L9e(t,{type:e}){const[,n]=e.split("bytes"),r=Vn(t);if(!n){let i=t;return r%32!==0&&(i=Cf(i,Math.ceil((t.length-2)/2/32)*32)),{dynamic:!0,encoded:fr(_l(He(r,{size:32})),i)}}if(r!==Number.parseInt(n,10))throw new Dee({expectedSize:Number.parseInt(n,10),value:t});return{dynamic:!1,encoded:Cf(t)}}function $9e(t){if(typeof t!="boolean")throw new ut(`Invalid boolean value: "${t}" (type: ${typeof t}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:_l(GQ(t))}}function I9e(t,{signed:e,size:n}){if(typeof n=="number"){const r=2n**(BigInt(n)-(e?1n:0n))-1n,i=e?-r-1n:0n;if(t>r||t<i)throw new XQ({max:r.toString(),min:i.toString(),signed:e,size:n/8,value:t.toString()})}return{dynamic:!1,encoded:He(t,{size:32,signed:e})}}function N9e(t){const e=z2(t),n=Math.ceil(Vn(e)/32),r=[];for(let i=0;i<n;
vendor: 4,415 bytes, line 487
487i++)r.push(Cf(tn(e,i*32,(i+1)*32)));return{dynamic:!0,encoded:fr(Cf(He(Vn(e),{size:32})),...r)}}function O9e(t,e){const{checksumAddress:n,parameter:r}=e;let i=!1;const s=[];for(let a=0;a<r.components.length;a++){const o=r.components[a],l=Array.isArray(t)?a:o.name,u=bN({checksumAddress:n,parameter:o,value:t[l]});s.push(u),u.dynamic&&(i=!0)}return{dynamic:i,encoded:i?wN(s):fr(...s.map(({encoded:a})=>a))}}function vN(t){const e=t.match(/^(.*)\[(\d+)?\]$/);return e?[e[2]?Number(e[2]):null,e[1]]:void 0}function f1(t){var r;const{type:e}=t;if(e==="string"||e==="bytes"||e.endsWith("[]"))return!0;if(e==="tuple")return(r=t.components)==null?void 0:r.some(f1);const n=vN(t.type);return!!(n&&f1({...t,type:n[1]}))}const P9e={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 j9e({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(t){if(t<0||t>this.bytes.length-1)throw new R9e({length:this.bytes.length,position:t})},decrementPosition(t){if(t<0)throw new IF({offset:t});const e=this.position-t;this.assertPosition(e),this.position=e},getReadCount(t){return this.positionReadCount.get(t||this.position)||0},incrementPosition(t){if(t<0)throw new IF({offset:t});const e=this.position+t;this.assertPosition(e),this.position=e},inspectByte(t){const e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectBytes(t,e){const n=e??this.position;return this.assertPosition(n+t-1),this.bytes.subarray(n,n+t)},inspectUint8(t){const e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectUint16(t){const e=t??this.position;return this.assertPosition(e+1),this.dataView.getUint16(e)},inspectUint24(t){const e=t??this.position;return this.assertPosition(e+2),(this.dataView.getUint16(e)<<8)+this.dataView.getUint8(e+2)},inspectUint32(t){const e=t??this.position;return this.assertPosition(e+3),this.dataView.getUint32(e)},pushByte(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushBytes(t){this.assertPosition(this.position+t.length-1),this.bytes.set(t,this.position),this.position+=t.length},pushUint8(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushUint16(t){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,t),this.position+=2},pushUint24(t){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,t>>8),this.dataView.setUint8(this.position+2,t&255),this.position+=3},pushUint32(t){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,t),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const t=this.inspectByte();return this.position++,t},readBytes(t,e){this.assertReadLimit(),this._touch();const n=this.inspectBytes(t);return this.position+=e??t,n},readUint8(){this.assertReadLimit(),this._touch();const t=this.inspectUint8();return this.position+=1,t},readUint16(){this.assertReadLimit(),this._touch();const t=this.inspectUint16();return this.position+=2,t},readUint24(){this.assertReadLimit(),this._touch();const t=this.inspectUint24();return this.position+=3,t},readUint32(){this.assertReadLimit(),this._touch();const t=this.inspectUint32();return this.position+=4,t},get remaining(){return this.bytes.length-this.position},setPosition(t){const e=this.position;return this.assertPosition(t),this.position=t,()=>this.position=e},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const t=this.getReadCount();this.positionReadCount.set(this.position,t+1),t>0&&this.recursiveReadCount++}};function _N(t,{recursiveReadLimit:e=8192}={}){const n=Object.create(P9e);return n.bytes=t,n.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=e,n}class IF extends ut{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class R9e extends ut{constructor({length:e,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class j9e extends ut{constructor({count:e,limit:n}
487){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}function jee(t,e,n={}){const{as:r="Array",checksumAddress:i=!1}=n,s=typeof e=="string"?F2(e):e,a=_N(s);if(L0(s)===0&&t.length>0)throw new D9e;if(L0(s)&&L0(s)<32)throw new M9e({data:typeof e=="string"?e:Oi(e),parameters:t,size:L0(s)});let o=0;const l=r==="Array"?[]:{};for(let u=0;u<t.length;++u){const f=t[u];o<s.length&&a.setPosition(o);const[p,y]=H0(a,f,{checksumAddress:i,staticPosition:0});o+=y,r==="Array"?l.push(p):l[f.name??u]=p}return l}function xN(t,e,n){const{checksumAddress:r=!1}={};if(t.length!==e.length)throw new Uee({expectedLength:t.length,givenLength:e.length});const i=A9e({checksumAddress:r,parameters:t,values:e}),s=wN(i);return s.length===0?"0x":s}function Vk(t,e){if(t.length!==e.length)throw new Uee({expectedLength:t.length,givenLength:e.length});const n=[];for(let r=0;r<t.length;r++){const i=t[r],s=e[r];n.push(Vk.encode(i,s))}return fr(...n)}(function(t){function e(n,r,i=!1){if(n==="address"){const l=r;return xl(l),_l(l.toLowerCase(),i?32:0)}if(n==="string")return z2(r);if(n==="bytes")return r;if(n==="bool")return _l(GQ(r),i?32:1);const s=n.match(Ree);if(s){const[l,u,f="256"]=s,p=Number.parseInt(f,10)/8;return He(r,{size:i?32:p,signed:u==="int"})}const a=n.match(b9e);if(a){const[l,u]=a;if(Number.parseInt(u,10)!==(r.length-2)/2)throw new Dee({expectedSize:Number.parseInt(u,10),value:r});return Cf(r,i?32:0)}const o=n.match(g9e);if(o&&Array.isArray(r)){const[l,u]=o,f=[];for(let p=0;p<r.length;p++)f.push(e(u,r[p],!0));return f.length===0?"0x":fr(...f)}throw new CN(n)}t.encode=e})(Vk||(Vk={}));function Mee(t){return Array.isArray(t)&&typeof t[0]=="string"||typeof t=="string"?zB(t):t}class M9e extends ut{constructor({data:e,parameters:n,size:r}){super(`Data size of ${r} bytes is too small for given parameters.`,{metaMessages:[`Params: (${w0(n)})`,`Data: ${e} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class D9e extends ut{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class U9e extends ut{constructor({expectedLength:e,givenLength:n,type:r}){super(`Array length mismatch for type \`${r}\`. Expected: \`${e}\`. Given: \`${n}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}class Dee extends ut{constructor({expectedSize:e,value:n}){super(`Size of bytes "${n}" (bytes${Vn(n)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class Uee extends ut{constructor({expectedLength:e,givenLength:n}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${e}`,`Given length (values): ${n}`].join(` 488`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}class B9e extends ut{constructor(e){super(`Value \`${e}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class CN extends ut{constructor(e){super(`Type \`${e}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}function Bee(t){return F9e(t,"Hex")}function F9e(t,e){const n=e,r=(()=>{if(typeof t=="string"){if(t.length>3&&t.length%2!==0)throw new gve(t);return F2(t)}return t})(),i=_N(r,{recursiveReadLimit:Number.POSITIVE_INFINITY});return Fee(i,n)}function Fee(t,e="Hex"){if(t.bytes.length===0)return e==="Hex"?Oi(t.bytes):t.bytes;const n=t.readByte();if(n<128&&t.decrementPosition(1),n<192){const i=NF(t,n,128),s=t.readBytes(i);return e==="Hex"?Oi(s):s}const r=NF(t,n,192);return z9e(t,r,e)}function NF(t,e,n){if(n===128&&e<128)return 1;if(e<=n+55)return e-n;if(e===n+55+1)return t.readUint8();if(e===n+55+2)return t.readUint16();if(e===n+55+3)return t.readUint24();if(e===n+55+4)return t.readUint32();throw new ut("Invalid RLP prefix")}function z9e(t,e,n){const r=t.position,i=[];for(;t.position-r<e;)i.push(Fee(t,n));return i}function V9e(t,e){const{as:n}=e,r=zee(t),i=_N(new Uint8Array(r.length));return r.encode(i),n==="Hex"?Oi(i.bytes):i.bytes}function EN(t,e={}){const{as:n="Hex"}=e;return V9e(t,{as:n})}function zee(t){return Array.isArray(t)?H9e(t.map(e=>zee(e))):W9e(t)}function H9e(t){const e=t.reduce((i,s)=>i+s.length,0),n=Vee(e);return{length:e<=55?1+e:1+n+e,encode(i){e<=55?i.pushByte(192+e):(i.pushByte(247+n),n===1?i.pushUint8(e):n===2?i.pushUint16(e):n===3?i.pushUint24(e):i.pushUint32(e));for(const{encode:s}of t)s(i)}}}function W9e(t){const e=typeof t=="string"?F2(t):t,n=Vee(e.length);return{length:e.length===1&&e[0]<128?1:e.length<=55?1+e.length:1+n+e.length,encode(i){e.length===1&&e[0]<128?i.pushBytes(e):e.length<=55?(i.pushByte(128+e.length),i.pushBytes(e)):(i.pushByte(183+n),n===1?i.pushUint8(e.length):n===2?i.pushUint16(e.length):n===3?i.pushUint24(e.length):i.pushUint32(e.length),i.pushBytes(e))}}}function Vee(t){if(t<=255)return 1;if(t<=65535)return 2;if(t<=16777215)return 3;
vendor: 18,852 bytes, line 488
488if(t<=4294967295)return 4;throw new ut("Length is too large.")}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ra=BigInt(0),Ps=BigInt(1),Zh=BigInt(2),q9e=BigInt(3),Hee=BigInt(4),Wee=BigInt(5),qee=BigInt(8);function Xs(t,e){const n=t%e;return n>=ra?n:e+n}function so(t,e,n){let r=t;for(;e-- >ra;)r*=r,r%=n;return r}function Hk(t,e){if(t===ra)throw new Error("invert: expected non-zero number");if(e<=ra)throw new Error("invert: expected positive modulus, got "+e);let n=Xs(t,e),r=e,i=ra,s=Ps;for(;n!==ra;){const o=r/n,l=r%n,u=i-s*o;r=n,n=l,i=s,s=u}if(r!==Ps)throw new Error("invert: does not exist");return Xs(i,e)}function Zee(t,e){const n=(t.ORDER+Ps)/Hee,r=t.pow(e,n);if(!t.eql(t.sqr(r),e))throw new Error("Cannot find square root");return r}function Z9e(t,e){const n=(t.ORDER-Wee)/qee,r=t.mul(e,Zh),i=t.pow(r,n),s=t.mul(e,i),a=t.mul(t.mul(s,Zh),i),o=t.mul(s,t.sub(a,t.ONE));if(!t.eql(t.sqr(o),e))throw new Error("Cannot find square root");return o}function K9e(t){if(t<BigInt(3))throw new Error("sqrt is not defined for small field");let e=t-Ps,n=0;for(;e%Zh===ra;)e/=Zh,n++;let r=Zh;const i=om(t);for(;OF(i,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(n===1)return Zee;let s=i.pow(r,e);const a=(e+Ps)/Zh;return function(l,u){if(l.is0(u))return u;if(OF(l,u)!==1)throw new Error("Cannot find square root");let f=n,p=l.mul(l.ONE,s),y=l.pow(u,e),g=l.pow(u,a);for(;!l.eql(y,l.ONE);){if(l.is0(y))return l.ZERO;let b=1,v=l.sqr(y);for(;!l.eql(v,l.ONE);)if(b++,v=l.sqr(v),b===f)throw new Error("Cannot find square root");const _=Ps<<BigInt(f-b-1),C=l.pow(p,_);f=b,p=l.sqr(C),y=l.mul(y,p),g=l.mul(g,C)}return g}}function G9e(t){return t%Hee===q9e?Zee:t%qee===Wee?Z9e:K9e(t)}const Y9e=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function J9e(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=Y9e.reduce((r,i)=>(r[i]="function",r),e);return E7(t,n)}function X9e(t,e,n){if(n<ra)throw new Error("invalid exponent, negatives unsupported");if(n===ra)return t.ONE;if(n===Ps)return e;let r=t.ONE,i=e;for(;n>ra;)n&Ps&&(r=t.mul(r,i)),i=t.sqr(i),n>>=Ps;return r}function Kee(t,e,n=!1){const r=new Array(e.length).fill(n?t.ZERO:void 0),i=e.reduce((a,o,l)=>t.is0(o)?a:(r[l]=a,t.mul(a,o)),t.ONE),s=t.inv(i);return e.reduceRight((a,o,l)=>t.is0(o)?a:(r[l]=t.mul(a,r[l]),t.mul(a,o)),s),r}function OF(t,e){const n=(t.ORDER-Ps)/Zh,r=t.pow(e,n),i=t.eql(r,t.ONE),s=t.eql(r,t.ZERO),a=t.eql(r,t.neg(t.ONE));if(!i&&!s&&!a)throw new Error("invalid Legendre symbol result");return i?1:s?0:-1}function Gee(t,e){e!==void 0&&f3(e);const n=e!==void 0?e:t.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function om(t,e,n=!1,r={}){if(t<=ra)throw new Error("invalid field: expected ORDER > 0, got "+t);const{nBitLength:i,nByteLength:s}=Gee(t,e);if(s>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let a;const o=Object.freeze({ORDER:t,isLE:n,BITS:i,BYTES:s,MASK:C7(i),ZERO:ra,ONE:Ps,create:l=>Xs(l,t),isValid:l=>{if(typeof l!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof l);return ra<=l&&l<t},is0:l=>l===ra,isOdd:l=>(l&Ps)===Ps,neg:l=>Xs(-l,t),eql:(l,u)=>l===u,sqr:l=>Xs(l*l,t),add:(l,u)=>Xs(l+u,t),sub:(l,u)=>Xs(l-u,t),mul:(l,u)=>Xs(l*u,t),pow:(l,u)=>X9e(o,l,u),div:(l,u)=>Xs(l*Hk(u,t),t),sqrN:l=>l*l,addN:(l,u)=>l+u,subN:(l,u)=>l-u,mulN:(l,u)=>l*u,inv:l=>Hk(l,t),sqrt:r.sqrt||(l=>(a||(a=G9e(t)),a(o,l))),toBytes:l=>n?FQ(l,s):Z6(l,s),fromBytes:l=>{if(l.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+l.length);return n?BQ(l):lf(l)},invertBatch:l=>Kee(o,l),cmov:(l,u,f)=>f?u:l});return Object.freeze(o)}function Yee(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function Jee(t){const e=Yee(t);return e+Math.ceil(e/2)}function Q9e(t,e,n=!1){const r=t.length,i=Yee(e),s=Jee(e);if(r<16||r<s||r>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+r);const a=n?BQ(t):lf(t),o=Xs(a,e-Ps)+Ps;return n?FQ(o,i):Z6(o,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const PF=BigInt(0),Wk=BigInt(1);function GC(t,e){const n=e.negate();return t?n:e}function Xee(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function YC(t,e){Xee(t,e);const n=Math.ceil(e/t)+1,r=2**(t-1),i=2**t,s=C7(t),a=BigInt(t);return{windows:n,windowSize:r,mask:s,maxNumber:i,shiftBy:a}}function RF(t,e,n){const{windowSize:r,mask:i,maxNumber:s,shiftBy:a}=n;let o=Number(t&i),l=t>>a;o>r&&(o-=s,l+=Wk);const u=e*r,f=u+Math.abs(o)-1,p=o===0,y=o<0,g=e%2!==0;return{nextN:l,offset:f,isZero:p,isNeg:y,isNegF:g,offsetF:u}}function e_e(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach((n,r)=>{if(!(n instanceof e))throw new Error("invalid point at index "+r)})}function t_e(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((n,r)=>{if(!e.isValid(n))throw new Error("invalid scalar at index "+r)})}const JC=new WeakMap,Qee=new WeakMap;function XC(t){return Qee.get(t)||1}function n_e(t,e){return{constTimeNegate:GC,hasPrecomputes(n){return XC(n)!==1},unsafeLadder(n,r,i=t.ZERO){let s=n;for(;r>PF;)r&Wk&&(i=i.add(s)),s=s.double(),r>>=Wk;return i},precomputeWindow(n,r){const{windows:i,windowSize:s}=YC(r,e),a=[];let o=n,l=o;for(let u=0;u<i;u++){l=o,a.push(l);for(let f=1;f<s;f++)l=l.add(o),a.push(l);o=l.double()}return a},wNAF(n,r,i){let s=t.ZERO,a=t.BASE;const o=YC(n,e);for(let l=0;l<o.windows;l++){const{nextN:u,offset:f,isZero:p,isNeg:y,isNegF:g,offsetF:b}=RF(i,l,o);i=u,p?a=a.add(GC(g,r[b])):s=s.add(GC(y,r[f]))}return{p:s,f:a}},wNAFUnsafe(n,r,i,s=t.ZERO){const a=YC(n,e);for(let o=0;o<a.windows&&i!==PF;o++){const{nextN:l,offset:u,isZero:f,isNeg:p}=RF(i,o,a);if(i=l,!f){const y=r[u];s=s.add(p?y.negate():y)}}return s},getPrecomputes(n,r,i){let s=JC.get(r);return s||(s=this.precomputeWindow(r,n),n!==1&&JC.set(r,i(s))),s},wNAFCached(n,r,i){const s=XC(n);return this.wNAF(s,this.getPrecomputes(s,n,i),r)},wNAFCachedUnsafe(n,r,i,s){const a=XC(n);return a===1?this.unsafeLadder(n,r,s):this.wNAFUnsafe(a,this.getPrecomputes(a,n,i),r,s)},setWindowSize(n,r){Xee(r,e),Qee.set(n,r),JC.delete(n)}}}function r_e(t,e,n,r){e_e(n,t),t_e(r,e);const i=n.length,s=r.length;if(i!==s)throw new Error("arrays of points and scalars must have equal length");const a=t.ZERO,o=V8e(BigInt(i));let l=1;o>12?l=o-3:o>4?l=o-2:o>0&&(l=2);const u=C7(l),f=new Array(Number(u)+1).fill(a),p=Math.floor((e.BITS-1)/l)*l;let y=a;for(let g=p;g>=0;g-=l){f.fill(a);for(let v=0;v<s;v++){const _=r[v],C=Number(_>>BigInt(g)&u);f[C]=f[C].add(n[v])}let b=a;for(let v=f.length-1,_=a;v>0;v--)_=_.add(f[v]),b=b.add(_);if(y=y.add(b),g!==0)for(let v=0;v<l;v++)y=y.double()}return y}function ete(t){return J9e(t.Fp),E7(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Gee(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function jF(t){t.lowS!==void 0&&j3("lowS",t.lowS),t.prehash!==void 0&&j3("prehash",t.prehash)}function i_e(t){const e=ete(t);E7(e,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});const{endo:n,Fp:r,a:i}=e;if(n){if(!r.eql(i,r.ZERO))throw new Error("invalid endo: CURVE.a must be 0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...e})}let s_e=class extends Error{constructor(e=""){super(e)}};const au={Err:s_e,_tlv:{encode:(t,e)=>{const{Err:n}=au;if(t<0||t>256)throw new n("tlv.encode: wrong tag");if(e.length&1)throw new n("tlv.encode: unpadded data");const r=e.length/2,i=y4(r);if(i.length/2&128)throw new n("tlv.encode: long form length too big");const s=r>127?y4(i.length/2|128):"";return y4(t)+s+i+e},decode(t,e){const{Err:n}=au;let r=0;if(t<0||t>256)throw new n("tlv.encode: wrong tag");if(e.length<2||e[r++]!==t)throw new n("tlv.decode: wrong tlv");const i=e[r++],s=!!(i&128);let a=0;if(!s)a=i;else{const l=i&127;if(!l)throw new n("tlv.decode(long): indefinite length not supported");if(l>4)throw new n("tlv.decode(long): byte length is too big");const u=e.subarray(r,r+l);if(u.length!==l)throw new n("tlv.decode: length bytes not complete");if(u[0]===0)throw new n("tlv.decode(long): zero leftmost byte");for(const f of u)a=a<<8|f;if(r+=l,a<128)throw new n("tlv.decode(long): not minimal encoding")}const o=e.subarray(r,r+a);if(o.length!==a)throw new n("tlv.decode: wrong value length");return{v:o,l:e.subarray(r+a)}}},_int:{encode(t){const{Err:e}=au;if(t<fu)throw new e("integer: negative integers are not allowed");let n=y4(t);if(Number.parseInt(n[0],16)&8&&(n="00"+n),n.length&1)throw new e("unexpected DER parsing assertion: unpadded hex");return n},decode(t){const{Err:e}=au;if(t[0]&128)throw new e("invalid signature integer: negative");if(t[0]===0&&!(t[1]&128))throw new e("invalid signature integer: unnecessary leading zero");return lf(t)}},toSig(t){const{Err:e,_int:n,_tlv:r}=au,i=yo("signature",t),{v:s,l:a}=r.decode(48,i);if(a.length)throw new e("invalid signature: left bytes after parsing");const{v:o,l}=r.decode(2,s),{v:u,l:f}=r.decode(2,l);if(f.length)throw new e("invalid signature: left bytes after parsing");return{r:n.decode(o),s:n.decode(u)}},hexFromSig(t){const{_tlv:e,_int:n}=au,r=e.encode(2,n.encode(t.r)),i=e.encode(2,n.encode(t.s)),s=r+i;return e.encode(48,s)}};function QC(t,e){return M3(Z6(t,e))}const fu=BigInt(0),Fi=BigInt(1);BigInt(2);const eE=BigInt(3),a_e=BigInt(4);function o_e(t){const e=i_e(t),{Fp:n}=e,r=om(e.n,e.nBitLength),i=e.toBytes||((x,A,I)=>{const $=A.toAffine();return g8(Uint8Array.from([4]),n.toBytes($.x),n.toBytes($.y))}),s=e.fromBytes||(x=>{const A=x.subarray(1),I=n.fromBytes(A.subarray(0,n.BYTES)),$=n.fromBytes(A.subarray(n.BYTES,2*n.BYTES));return{x:I,y:$}});function a(x){const{a:A,b:I}=e,$=n.sqr(x),O=n.mul($,x);return n.add(n.add(O,n.mul(x,A)),I)}function o(x,A){const I=n.sqr(A),$=a(x);return n.eql(I,$)}if(!o(e.Gx,e.Gy))throw new Error("bad curve params: generator point");const l=n.mul(n.pow(e.a,eE),a_e),u=n.mul(n.sqr(e.b),BigInt(27));if(n.is0(n.add(l,u)))throw new Error("bad curve params: a or b");function f(x){return iN(x,Fi,e.n)}function p(x){const{allowedPrivateKeyLengths:A,nByteLength:I,wrapPrivateKey:$,n:O}=e;if(A&&typeof x!="bigint"){if(q6(x)&&(x=M3(x)),typeof x!="string"||!A.includes(x.length))throw new Error("invalid private key");x=x.padStart(I*2,"0")}let P;try{P=typeof x=="bigint"?x:lf(yo("private key",x,I))}catch{throw new Error("invalid private key, expected hex or "+I+" bytes, got "+typeof x)}return $&&(P=Xs(P,O)),V0("private key",P,Fi,O),P}function y(x){if(!(x instanceof v))throw new Error("ProjectivePoint expected")}const g=pF((x,A)=>{const{px:I,py:$,pz:O}=x;if(n.eql(O,n.ONE))return{x:I,y:$};const P=x.is0();A==null&&(A=P?n.ONE:n.inv(O));const j=n.mul(I,A),U=n.mul($,A),z=n.mul(O,A);if(P)return{x:n.ZERO,y:n.ZERO};if(!n.eql(z,n.ONE))throw new Error("invZ was invalid");return{x:j,y:U}}),b=pF(x=>{if(x.is0()){if(e.allowInfinityPoint&&!n.is0(x.py))return;throw new Error("bad point: ZERO")}const{x:A,y:I}=x.toAffine();if(!n.isValid(A)||!n.isValid(I))throw new Error("bad point: x or y not FE");if(!o(A,I))throw new Error("bad point: equation left != right");if(!x.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class v{constructor(A,I,$){if(A==null||!n.isValid(A))throw new Error("x required");if(I==null||!n.isValid(I)||n.is0(I))throw new Error("y required");if($==null||!n.isValid($))throw new Error("z required");this.px=A,this.py=I,this.pz=$,Object.freeze(this)}static fromAffine(A){const{x:I,y:$}=A||{};if(!A||!n.isValid(I)||!n.isValid($))throw new Error("invalid affine point");if(A instanceof v)throw new Error("projective point not allowed");const O=P=>n.eql(P,n.ZERO);return O(I)&&O($)?v.ZERO:new v(I,$,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(A){const I=Kee(n,A.map($=>$.pz));return A.map(($,O)=>$.toAffine(I[O])).map(v.fromAffine)}static fromHex(A){const I=v.fromAffine(s(yo("pointHex",A)));return I.assertValidity(),I}static fromPrivateKey(A){return v.BASE.multiply(p(A))}static msm(A,I){return r_e(v,r,A,I)}_setWindowSize(A){S.setWindowSize(this,A)}assertValidity(){b(this)}hasEvenY(){const{y:A}=this.toAffine();if(n.isOdd)return!n.isOdd(A);throw new Error("Field doesn't support isOdd")}equals(A){y(A);const{px:I,py:$,pz:O}=this,{px:P,py:j,pz:U}=A,z=n.eql(n.mul(I,U),n.mul(P,O)),D=n.eql(n.mul($,U),n.mul(j,O));return z&&D}negate(){return new v(this.px,n.neg(this.py),this.pz)}double(){const{a:A,b:I}=e,$=n.mul(I,eE),{px:O,py:P,pz:j}=this;let U=n.ZERO,z=n.ZERO,D=n.ZERO,R=n.mul(O,O),W=n.mul(P,P),T=n.mul(j,j),L=n.mul(O,P);return L=n.add(L,L),D=n.mul(O,j),D=n.add(D,D),U=n.mul(A,D),z=n.mul($,T),z=n.add(U,z),U=n.sub(W,z),z=n.add(W,z),z=n.mul(U,z),U=n.mul(L,U),D=n.mul($,D),T=n.mul(A,T),L=n.sub(R,T),L=n.mul(A,L),L=n.add(L,D),D=n.add(R,R),R=n.add(D,R),R=n.add(R,T),R=n.mul(R,L),z=n.add(z,R),T=n.mul(P,j),T=n.add(T,T),R=n.mul(T,L),U=n.sub(U,R),D=n.mul(T,W),D=n.add(D,D),D=n.add(D,D),new v(U,z,D)}add(A){y(A);const{px:I,py:$,pz:O}=this,{px:P,py:j,pz:U}=A;let z=n.ZERO,D=n.ZERO,R=n.ZERO;const W=e.a,T=n.mul(e.b,eE);let L=n.mul(I,P),M=n.mul($,j),Z=n.mul(O,U),H=n.add(I,$),V=n.add(P,j);H=n.mul(H,V),V=n.add(L,M),H=n.sub(H,V),V=n.add(I,O);let F=n.add(P,U);return V=n.mul(V,F),F=n.add(L,Z),V=n.sub(V,F),F=n.add($,O),z=n.add(j,U),F=n.mul(F,z),z=n.add(M,Z),F=n.sub(F,z),R=n.mul(W,V),z=n.mul(T,Z),R=n.add(z,R),z=n.sub(M,R),R=n.add(M,R),D=n.mul(z,R),M=n.add(L,L),M=n.add(M,L),Z=n.mul(W,Z),V=n.mul(T,V),M=n.add(M,Z),Z=n.sub(L,Z),Z=n.mul(W,Z),V=n.add(V,Z),L=n.mul(M,V),D=n.add(D,L),L=n.mul(F,V),z=n.mul(H,z),z=n.sub(z,L),L=n.mul(H,M),R=n.mul(F,R),R=n.add(R,L),new v(z,D,R)}subtract(A){return this.add(A.negate())}is0(){return this.equals(v.ZERO)}wNAF(A){return S.wNAFCached(this,A,v.normalizeZ)}multiplyUnsafe(A){const{endo:I,n:$}=e;V0("scalar",A,fu,$);const O=v.ZERO;if(A===fu)return O;if(this.is0()||A===Fi)return this;if(!I||S.hasPrecomputes(this))return S.wNAFCachedUnsafe(this,A,v.normalizeZ);let{k1neg:P,k1:j,k2neg:U,k2:z}=I.splitScalar(A),D=O,R=O,W=this;for(;j>fu||z>fu;)j&Fi&&(D=D.add(W)),z&Fi&&(R=R.add(W)),W=W.double(),j>>=Fi,z>>=Fi;return P&&(D=D.negate()),U&&(R=R.negate()),R=new v(n.mul(R.px,I.beta),R.py,R.pz),D.add(R)}multiply(A){const{endo:I,n:$}=e;V0("scalar",A,Fi,$);let O,P;if(I){const{k1neg:j,k1:U,k2neg:z,k2:D}=I.splitScalar(A);let{p:R,f:W}=this.wNAF(U),{p:T,f:L}=this.wNAF(D);R=S.constTimeNegate(j,R),T=S.constTimeNegate(z,T),T=new v(n.mul(T.px,I.beta),T.py,T.pz),O=R.add(T),P=W.add(L)}else{const{p:j,f:U}=this.wNAF(A);O=j,P=U}return v.normalizeZ([O,P])[0]}multiplyAndAddUnsafe(A,I,$){const O=v.BASE,P=(U,z)=>z===fu||z===Fi||!U.equals(O)?U.multiplyUnsafe(z):U.multiply(z),j=P(this,I).add(P(A,$));return j.is0()?void 0:j}toAffine(A){return g(this,A)}isTorsionFree(){const{h:A,isTorsionFree:I}=e;if(A===Fi)return!0;if(I)return I(v,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:A,clearCofactor:I}=e;return A===Fi?this:I?I(v,this):this.multiplyUnsafe(e.h)}toRawBytes(A=!0){return j3("isCompressed",A),this.assertValidity(),i(v,this,A)}toHex(A=!0){return j3("isCompressed",A),M3(this.toRawBytes(A))}}v.BASE=new v(e.Gx,e.Gy,n.ONE),v.ZERO=new v(n.ZERO,n.ONE,n.ZERO);const{endo:_,nBitLength:C}=e,S=n_e(v,_?Math.ceil(C/2):C);return{CURVE:e,ProjectivePoint:v,normPrivateKeyToScalar:p,weierstrassEquation:a,isWithinCurveOrder:f}}function l_e(t){const e=ete(t);return E7(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function c_e(t){const e=l_e(t),{Fp:n,n:r,nByteLength:i,nBitLength:s}=e,a=n.BYTES+1,o=2*n.BYTES+1;function l(T){return Xs(T,r)}function u(T){return Hk(T,r)}const{ProjectivePoint:f,normPrivateKeyToScalar:p,weierstrassEquation:y,isWithinCurveOrder:g}=o_e({...e,toBytes(T,L,M){const Z=L.toAffine(),H=n.toBytes(Z.x),V=g8;return j3("isCompressed",M),M?V(Uint8Array.from([L.hasEvenY()?2:3]),H):V(Uint8Array.from([4]),H,n.toBytes(Z.y))},fromBytes(T){const L=T.length,M=T[0],Z=T.subarray(1);if(L===a&&(M===2||M===3)){const H=lf(Z);if(!iN(H,Fi,n.ORDER))throw new Error("Point is not on curve");const V=y(H);let F;try{F=n.sqrt(V)}catch(Y){const X=Y instanceof Error?": "+Y.message:"";throw new Error("Point is not on curve"+X)}const q=(F&Fi)===Fi;return(M&1)===1!==q&&(F=n.neg(F)),{x:H,y:F}}else if(L===o&&M===4){const H=n.fromBytes(Z.subarray(0,n.BYTES)),V=n.fromBytes(Z.subarray(n.BYTES,2*n.BYTES));return{x:H,y:V}}else{const H=a,V=o;throw new Error("invalid Point, expected length of "+H+", or uncompressed "+V+", got "+L)}}});function b(T){const L=r>>Fi;return T>L}function v(T){return b(T)?l(-T):T}const _=(T,L,M)=>lf(T.slice(L,M));class C{constructor(L,M,Z){V0("r",L,Fi,r),V0("s",M,Fi,r),this.r=L,this.s=M,Z!=null&&(this.recovery=Z),Object.freeze(this)}static fromCompact(L){const M=i;return L=yo("compactSignature",L,M*2),new C(_(L,0,M),_(L,M,2*M))}static fromDER(L){const{r:M,s:Z}=au.toSig(yo("DER",L));return new C(M,Z)}assertValidity(){}addRecoveryBit(L){return new C(this.r,this.s,L)}recoverPublicKey(L){const{r:M,s:Z,recovery:H}=this,V=O(yo("msgHash",L));if(H==null||![0,1,2,3].includes(H))throw new Error("recovery id invalid");const F=H===2||H===3?M+e.n:M;if(F>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const q=(H&1)===0?"02":"03",G=f.fromHex(q+QC(F,n.BYTES)),Y=u(F),X=l(-V*Y),te=l(Z*Y),ie=f.BASE.multiplyAndAddUnsafe(G,X,te);if(!ie)throw new Error("point at infinify");return ie.assertValidity(),ie}hasHighS(){return b(this.s)}normalizeS(){return this.hasHighS()?new C(this.r,l(-this.s),this.recovery):this}toDERRawBytes(){return y8(this.toDERHex())}toDERHex(){return au.hexFromSig(this)}toCompactRawBytes(){return y8(this.toCompactHex())}toCompactHex(){const L=i;return QC(this.r,L)+QC(this.s,L)}}const S={isValidPrivateKey(T){try{return p(T),!0}catch{return!1}},normPrivateKeyToScalar:p,randomPrivateKey:()=>{const T=Jee(e.n);return Q9e(e.randomBytes(T),e.n)},precompute(T=8,L=f.BASE){return L._setWindowSize(T),L.multiply(BigInt(3)),L}};function x(T,L=!0){return f.fromPrivateKey(T).toRawBytes(L)}function A(T){if(typeof T=="bigint")return!1;if(T instanceof f)return!0;const M=yo("key",T).length,Z=n.BYTES,H=Z+1,V=2*Z+1;if(!(e.allowedPrivateKeyLengths||i===H))return M===H||M===V}function I(T,L,M=!0){if(A(T)===!0)throw new Error("first arg must be private key");if(A(L)===!1)throw new Error("second arg must be public key");
488return f.fromHex(L).multiply(p(T)).toRawBytes(M)}const $=e.bits2int||function(T){if(T.length>8192)throw new Error("input is too large");const L=lf(T),M=T.length*8-s;return M>0?L>>BigInt(M):L},O=e.bits2int_modN||function(T){return l($(T))},P=C7(s);function j(T){return V0("num < 2^"+s,T,fu,P),Z6(T,i)}function U(T,L,M=z){if(["recovered","canonical"].some(pe=>pe in M))throw new Error("sign() legacy options not supported");const{hash:Z,randomBytes:H}=e;let{lowS:V,prehash:F,extraEntropy:q}=M;V==null&&(V=!0),T=yo("msgHash",T),jF(M),F&&(T=yo("prehashed msgHash",Z(T)));const G=O(T),Y=p(L),X=[j(Y),j(G)];if(q!=null&&q!==!1){const pe=q===!0?H(n.BYTES):q;X.push(yo("extraEntropy",pe))}const te=g8(...X),ie=G;function se(pe){const Ce=$(pe);if(!g(Ce))return;const xe=u(Ce),Te=f.BASE.multiply(Ce).toAffine(),Et=l(Te.x);if(Et===fu)return;const Ke=l(xe*l(ie+Et*Y));if(Ke===fu)return;let Ge=(Te.x===Et?0:2)|Number(Te.y&Fi),nn=Ke;return V&&b(Ke)&&(nn=v(Ke),Ge^=1),new C(Et,nn,Ge)}return{seed:te,k2sig:se}}const z={lowS:e.lowS,prehash:!1},D={lowS:e.lowS,prehash:!1};function R(T,L,M=z){const{seed:Z,k2sig:H}=U(T,L,M),V=e;return H8e(V.hash.outputLen,V.nByteLength,V.hmac)(Z,H)}f.BASE._setWindowSize(8);function W(T,L,M,Z=D){var Ge;const H=T;L=yo("msgHash",L),M=yo("publicKey",M);const{lowS:V,prehash:F,format:q}=Z;if(jF(Z),"strict"in Z)throw new Error("options.strict was renamed to lowS");if(q!==void 0&&q!=="compact"&&q!=="der")throw new Error("format must be compact or der");const G=typeof H=="string"||q6(H),Y=!G&&!q&&typeof H=="object"&&H!==null&&typeof H.r=="bigint"&&typeof H.s=="bigint";if(!G&&!Y)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let X,te;try{if(Y&&(X=new C(H.r,H.s)),G){try{q!=="compact"&&(X=C.fromDER(H))}catch(nn){if(!(nn instanceof au.Err))throw nn}!X&&q!=="der"&&(X=C.fromCompact(H))}te=f.fromHex(M)}catch{return!1}if(!X||V&&X.hasHighS())return!1;F&&(L=e.hash(L));const{r:ie,s:se}=X,pe=O(L),Ce=u(se),xe=l(pe*Ce),Te=l(ie*Ce),Et=(Ge=f.BASE.multiplyAndAddUnsafe(te,xe,Te))==null?void 0:Ge.toAffine();return Et?l(Et.x)===ie:!1}return{CURVE:e,getPublicKey:x,getSharedSecret:I,sign:R,verify:W,ProjectivePoint:f,Signature:C,utils:S}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function u_e(t){return{hash:t,hmac:(e,...n)=>Nee(t,e,iwe(...n)),randomBytes:swe}}function P7(t,e){const n=r=>c_e({...t,...u_e(r)});return{...n(e),create:n}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const tte=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),MF=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),d_e=BigInt(0),h_e=BigInt(1),qk=BigInt(2),DF=(t,e)=>(t+e/qk)/e;function f_e(t){const e=tte,n=BigInt(3),r=BigInt(6),i=BigInt(11),s=BigInt(22),a=BigInt(23),o=BigInt(44),l=BigInt(88),u=t*t*t%e,f=u*u*t%e,p=so(f,n,e)*f%e,y=so(p,n,e)*f%e,g=so(y,qk,e)*u%e,b=so(g,i,e)*g%e,v=so(b,s,e)*b%e,_=so(v,o,e)*v%e,C=so(_,l,e)*_%e,S=so(C,o,e)*v%e,x=so(S,n,e)*f%e,A=so(x,a,e)*b%e,I=so(A,r,e)*u%e,$=so(I,qk,e);if(!Zk.eql(Zk.sqr($),t))throw new Error("Cannot find square root");return $}const Zk=om(tte,void 0,void 0,{sqrt:f_e}),lm=P7({a:d_e,b:BigInt(7),Fp:Zk,n:MF,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=MF,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-h_e*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=n,a=BigInt("0x100000000000000000000000000000000"),o=DF(s*t,e),l=DF(-r*t,e);let u=Xs(t-o*n-l*i,e),f=Xs(-o*r-l*s,e);const p=u>a,y=f>a;if(p&&(u=e-u),y&&(f=e-f),u>a||f>a)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:p,k1:u,k2neg:y,k2:f}}}},KI),p_e=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:lm},Symbol.toStringTag,{value:"Module"}));function Q6(t,e={}){const{recovered:n}=e;if(typeof t.r>"u")throw new tE({signature:t});if(typeof t.s>"u")throw new tE({signature:t});if(n&&typeof t.yParity>"u")throw new tE({signature:t});if(t.r<0n||t.r>LF)throw new __e({value:t.r});if(t.s<0n||t.s>LF)throw new x_e({value:t.s});if(typeof t.yParity=="number"&&t.yParity!==0&&t.yParity!==1)throw new j7({value:t.yParity})}function m_e(t){return SN(Oi(t))}function SN(t){if(t.length!==130&&t.length!==132)throw new v_e({signature:t});const e=BigInt(tn(t,0,32)),n=BigInt(tn(t,32,64)),r=(()=>{const i=+`0x${t.slice(130)}`;if(!Number.isNaN(i))try{return kN(i)}catch{throw new j7({value:i})}})();return typeof r>"u"?{r:e,s:n}:{r:e,s:n,yParity:r}}function nte(t){if(!(typeof t.r>"u")&&!(typeof t.s>"u"))return R7(t)}function R7(t){const e=typeof t=="string"?SN(t):t instanceof Uint8Array?m_e(t):typeof t.r=="string"?AN(t):t.v?y_e(t):{r:t.r,s:t.s,...typeof t.yParity<"u"?{yParity:t.yParity}:{}};return Q6(e),e}function y_e(t){return{r:t.r,s:t.s,yParity:kN(t.v)}}function AN(t){const e=(()=>{const n=t.v?Number(t.v):void 0;let r=t.yParity?Number(t.yParity):void 0;if(typeof n=="number"&&typeof r!="number"&&(r=kN(n)),typeof r!="number")throw new j7({value:t.yParity});return r})();return{r:BigInt(t.r),s:BigInt(t.s),yParity:e}}function g_e(t){const[e,n,r]=t;return R7({r:n==="0x"?0n:BigInt(n),s:r==="0x"?0n:BigInt(r),yParity:e==="0x"?0:Number(e)})}function b_e(t){Q6(t);const e=t.r,n=t.s;return fr(He(e,{size:32}),He(n,{size:32}),typeof t.yParity=="number"?He(TN(t.yParity),{size:1}):"0x")}function rte(t){const{r:e,s:n,yParity:r}=t;return{r:He(e,{size:32}),s:He(n,{size:32}),yParity:r===0?"0x0":"0x1"}}function w_e(t){const{r:e,s:n,yParity:r}=t;return[r?"0x01":"0x",e===0n?"0x":jk(He(e)),n===0n?"0x":jk(He(n))]}function kN(t){if(t===0||t===27)return 0;if(t===1||t===28)return 1;if(t>=35)return t%2===0?1:0;throw new C_e({value:t})}function TN(t){if(t===0)return 27;if(t===1)return 28;throw new j7({value:t})}let v_e=class extends ut{constructor({signature:e}){super(`Value \`${e}
488\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${Vn(K6(e))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}},tE=class extends ut{constructor({signature:e}){super(`Signature \`${tm(e)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}};class __e extends ut{constructor({value:e}){super(`Value \`${e}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class x_e extends ut{constructor({value:e}){super(`Value \`${e}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}let j7=class extends ut{constructor({value:e}){super(`Value \`${e}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}},C_e=class extends ut{constructor({value:e}){super(`Value \`${e}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}};function E_e(t,e={}){return typeof t.chainId=="string"?ite(t):{...t,...e.signature}}function ite(t){const{address:e,chainId:n,nonce:r}=t,i=nte(t);return{address:e,chainId:Number(n),nonce:BigInt(r),...i}}function S_e(t){return t.map(ite)}function A_e(t){const{address:e,chainId:n,nonce:r,...i}=t;return{address:e,chainId:He(n),nonce:He(r),...rte(i)}}function k_e(t){return t.map(A_e)}function ste(t){return b2(ate(t))}function ate(t){const{payload:e,signature:n}=t,{r,s:i,yParity:s}=n,o=new lm.Signature(BigInt(r),BigInt(i)).addRecoveryBit(s).recoverPublicKey(K6(e).substring(2));return o9e(o)}function T_e(t){const{hash:e,payload:n}=t;return t.address?u2(t.address,ste({payload:n,signature:t.signature})):lm.verify(t.signature,sN(n),c9e(t.publicKey),...e?[{prehash:!0,lowS:!0}]:[])}const L_e="0x8010801080108010801080108010801080108010801080108010801080108010",$_e=Mee("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function ote(t){if(typeof t=="string"){if(tn(t,-32)!==L_e)throw new O_e(t)}else Q6(t.authorization)}function I_e(t){ote(t);const e=h1(tn(t,-64,-32)),n=tn(t,-e-64,-64),r=tn(t,0,-e-64),[i,s,a]=jee($_e,n);return{authorization:E_e({address:i.delegation,chainId:Number(i.chainId),nonce:i.nonce,yParity:i.yParity,r:i.r,s:i.s}),signature:r,...a&&a!=="0x"?{data:a,to:s}:{}}}function N_e(t){try{return ote(t),!0}catch{return!1}}let O_e=class extends ut{constructor(e){super(`Value \`${e}\` is an invalid ERC-8010 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}};function M7(t,e){return RI(t,e)}function P_e(t,e){return hQ(t,e)}function R_e(t){return t.map(e=>({...e,value:BigInt(e.value)}))}function j_e(t){return{...t,balance:t.balance?BigInt(t.balance):void 0,nonce:t.nonce?da(t.nonce):void 0,storageProof:t.storageProof?R_e(t.storageProof):void 0}}async function M_e(t,{address:e,blockHash:n,blockNumber:r,blockTag:i="latest",requireCanonical:s,storageKeys:a}){const o=Kf({blockHash:n,blockNumber:r,blockTag:i,requireCanonical:s}),l=await t.request({method:"eth_getProof",params:[e,a,o]});return j_e(l)}async function D_e(t,{hash:e}){const n=await t.request({method:"eth_getRawTransactionByHash",params:[e]},{dedupe:!0});if(!n)throw new jI({hash:e});return n}async function U_e(t,{address:e,blockHash:n,blockNumber:r,blockTag:i="latest",requireCanonical:s,slot:a}){const o=Kf({blockHash:n,blockNumber:r,blockTag:i,requireCanonical:s});return await t.request({method:"eth_getStorageAt",params:[e,a,o]})}async function LN(t,{blockHash:e,blockNumber:n,blockTag:r,hash:i,index:s,sender:a,nonce:o}){var y,g,b;const l=r||"latest",u=n!==void 0?ze(n):void 0;let f=null;if(i?f=await t.request({method:"eth_getTransactionByHash",params:[i]},{dedupe:!0}):e?f=await t.request({method:"eth_getTransactionByBlockHashAndIndex",params:[e,ze(s)]},{dedupe:!0}):typeof s=="number"?f=await t.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[u||l,ze(s)]},{dedupe:!!u}):a&&typeof o=="number"&&(f=await t.request({method:"eth_getTransactionBySenderAndNonce",params:[a,ze(o)]},{dedupe:!0})),!f)throw new jI({blockHash:e,blockNumber:n,blockTag:l,hash:i,index:s});return(((b=(g=(y=t.chain)==null?void 0:y.formatters)==null?void 0:g.transaction)==null?void 0:b.format)||X1)(f,"getTransaction")}async function B_e(t,{hash:e,transactionReceipt:n}){const[r,i]=await Promise.all([Ye(t,sm,"getBlockNumber")({}),e?Ye(t,LN,"getTransaction")({hash:e}):void 0]),s=(n==null?void 0:n.blockNumber)||(i==null?void 0:i.blockNumber);return s?r-s+1n:0n}async function Aw(t,{hash:e}){var i,s,a;const n=await t.request({method:"eth_getTransactionReceipt",params:[e]},{dedupe:!0});if(!n)throw new mQ({hash:e});return(((a=(s=(i=t.chain)==null?void 0:i.formatters)==null?void 0:s.transactionReceipt)==null?void 0:a.format)||J6)(n,"getTransactionReceipt")}async function F_e(t,e){var O,P;const{account:n,authorizationList:r,allowFailure:i=!0,blockHash:s,blockNumber:a,blockOverrides:o,blockTag:l,requireCanonical:u,stateOverride:f}=e,p=e.contracts,y=typeof((O=t.batch)==null?void 0:O.multicall)=="object"?t.batch.multicall:{},g=e.batchSize??y.batchSize??1024,b=e.deployless??y.deployless??!1,v=(()=>
488{if(e.multicallAddress)return e.multicallAddress;if(b)return null;if(t.chain)return nm({blockNumber:a,chain:t.chain,contract:"multicall3"});throw new Error("client chain not configured. multicallAddress is required.")})(),_=[[]];let C=0,S=0;for(let j=0;j<p.length;j++){const{abi:U,address:z,args:D,functionName:R}=p[j];try{const W=cs({abi:U,args:D,functionName:R});S+=(W.length-2)/2,g>0&&S>g&&_[C].length>0&&(C++,S=(W.length-2)/2,_[C]=[]),_[C]=[..._[C],{allowFailure:!0,callData:W,target:z}]}catch(W){const T=_f(W,{abi:U,address:z,args:D,docsPath:"/docs/contract/multicall",functionName:R,sender:n});if(!i)throw T;_[C]=[..._[C],{allowFailure:!0,callData:"0x",target:z}]}}const x=!!((P=t.batch)!=null&&P.multicall),A=x?_.flatMap(j=>j.map(U=>[U])):_,I=await Promise.allSettled(A.map(j=>x?z_e(t,{account:n,authorizationList:r,batchSize:g,blockHash:s,blockNumber:a,blockOverrides:o,blockTag:l,call:j[0],multicallAddress:v,requireCanonical:u,stateOverride:f}).then(U=>[U]):Ye(t,ir,"readContract")({...v===null?{code:A7}:{address:v},abi:Ef,account:n,args:[j],authorizationList:r,blockHash:s,blockNumber:a,blockOverrides:o,blockTag:l,functionName:"aggregate3",requireCanonical:u,stateOverride:f}))),$=[];for(let j=0;j<I.length;j++){const U=I[j];if(U.status==="rejected"){if(!i)throw U.reason;for(let D=0;D<A[j].length;D++)$.push({status:"failure",error:U.reason,result:void 0});continue}const z=U.value;for(let D=0;D<z.length;D++){const{returnData:R,success:W}=z[D],{callData:T}=A[j][D],{abi:L,address:M,functionName:Z,args:H}=p[$.length];try{if(T==="0x")throw new D6;if(!W)throw new b7({data:R});const V=B2({abi:L,args:H,data:R,functionName:Z});$.push(i?{result:V,status:"success"}:V)}catch(V){const F=_f(V,{abi:L,address:M,args:H,docsPath:"/docs/contract/multicall",functionName:Z});if(!i)throw F;$.push({error:F,result:void 0,status:"failure"})}}}if($.length!==p.length)throw new Se("multicall results mismatch");return $}async function z_e(t,e){var u;const{batchSize:n,call:r,multicallAddress:i,...s}=e,{wait:a=0}=typeof((u=t.batch)==null?void 0:u.multicall)=="object"?t.batch.multicall:{},{schedule:o}=oN({id:ii(["multicall",t.uid,n,i,s]),wait:a,shouldSplitBatch(f){return n===0?!1:f.reduce((y,{callData:g})=>y+(g.length-2)/2,0)>n},fn:f=>Ye(t,ir,"readContract")({...i===null?{code:A7}:{address:i},...s,abi:Ef,args:[f],functionName:"aggregate3"})}),[l]=await o(r);return l}async function w8(t,e){const{blockNumber:n,blockTag:r=t.experimental_blockTag??"latest",blocks:i,returnFullTransactions:s,traceTransfers:a,validation:o}=e;try{const l=[];for(const y of i){const g=y.blockOverrides?eee(y.blockOverrides):void 0,b=y.calls.map(_=>{const C=_,S=C.account?hn(C.account):void 0,x=C.abi?cs(C):C.data,A={...C,account:S,data:C.dataSuffix?ac([x||"0x",C.dataSuffix]):x,from:C.from??(S==null?void 0:S.address)};return gc(A),yc(A)}),v=y.stateOverrides?BI(y.stateOverrides):void 0;l.push({blockOverrides:g,calls:b,stateOverrides:v})}const f=(typeof n=="bigint"?ze(n):void 0)||r;return(await t.request({method:"eth_simulateV1",params:[{blockStateCalls:l,returnFullTransactions:s,traceTransfers:a,validation:o},f]})).map((y,g)=>({...x7(y),calls:y.calls.map((b,v)=>{var U,z;const{abi:_,args:C,functionName:S,to:x}=i[g].calls[v],A=((U=b.error)==null?void 0:U.data)??b.returnData,I=BigInt(b.gasUsed),$=(z=b.logs)==null?void 0:z.map(D=>vl(D)),O=b.status==="0x1"?"success":"failure",P=_&&O==="success"&&A!=="0x"?B2({abi:_,data:A,functionName:S}):null,j=(()=>{if(O==="success")return;let D;if(A==="0x"?D=new D6:A&&(D=new b7({data:A})),!!D)return _f(D,{abi:_??[],address:x??"0x",args:C,functionName:S??"<unknown>"})})();return{data:A,gasUsed:I,logs:$,status:O,...O==="success"?{result:P}:{error:j}}})}))}catch(l){const u=l,f=v7(u,{});throw f instanceof H6?u:f}}function Kk(t){let e=!0,n="",r=0,i="",s=!1;for(let a=0;a<t.length;a++){const o=t[a];if(["(",")",","].includes(o)&&(e=!0),o==="("&&r++,o===")"&&r--,!!e){if(r===0){if(o===" "&&["event","function","error",""].includes(i))i="";else if(i+=o,o===")"){s=!0;break}continue}if(o===" "){t[a-1]!==","&&n!==","&&n!==",("&&(n="",e=!1);continue}i+=o,n+=o}}if(!s)throw new ut("Unable to normalize signature.");return i}function Gk(t,e){const n=typeof t,r=e.type;switch(r){case"address":return L2(t,{strict:!1});case"bool":return n==="boolean";
488case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in e?Object.values(e.components).every((i,s)=>Gk(Object.values(t)[s],i)):/^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(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||t instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(t)&&t.every(i=>Gk(i,{...e,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function lte(t,e,n){for(const r in t){const i=t[r],s=e[r];if(i.type==="tuple"&&s.type==="tuple"&&"components"in i&&"components"in s)return lte(i.components,s.components,n[r]);const a=[i.type,s.type];if(a.includes("address")&&a.includes("bytes20")?!0:a.includes("address")&&a.includes("string")?L2(n[r],{strict:!1}):a.includes("address")&&a.includes("bytes")?L2(n[r],{strict:!1}):!1)return a}}function $N(t,e={}){const{prepare:n=!0}=e,r=Array.isArray(t)||typeof t=="string"?FB(t):t;return{...r,...n?{hash:Kh(r)}:{}}}function D7(t,e,n){const{args:r=[],prepare:i=!0}=n??{},s=ol(e,{strict:!1}),a=t.filter(u=>s?u.type==="function"||u.type==="error"?IN(u)===tn(e,0,4):u.type==="event"?Kh(u)===e:!1:"name"in u&&u.name===e);if(a.length===0)throw new v8({name:e});if(a.length===1)return{...a[0],...i?{hash:Kh(a[0])}:{}};let o;for(const u of a){if(!("inputs"in u))continue;if(!r||r.length===0){if(!u.inputs||u.inputs.length===0)return{...u,...i?{hash:Kh(u)}:{}};continue}if(!u.inputs||u.inputs.length===0||u.inputs.length!==r.length)continue;if(r.every((p,y)=>{const g="inputs"in u&&u.inputs[y];return g?Gk(p,g):!1})){if(o&&"inputs"in o&&o.inputs){const p=lte(u.inputs,o.inputs,r);if(p)throw new H_e({abiItem:u,type:p[0]},{abiItem:o,type:p[1]})}o=u}}const l=(()=>{if(o)return o;const[u,...f]=a;return{...u,overloads:f}})();if(!l)throw new v8({name:e});return{...l,...i?{hash:Kh(l)}:{}}}function IN(...t){const e=(()=>{if(Array.isArray(t[0])){const[n,r]=t;return D7(n,r)}return t[0]})();return tn(Kh(e),0,4)}function V_e(...t){const e=(()=>{if(Array.isArray(t[0])){const[r,i]=t;return D7(r,i)}return t[0]})(),n=typeof e=="string"?e:h8(e);return Kk(n)}function Kh(...t){const e=(()=>{if(Array.isArray(t[0])){const[n,r]=t;return D7(n,r)}return t[0]})();return typeof e!="string"&&"hash"in e&&e.hash?e.hash:qu(z2(V_e(e)))}class H_e extends ut{constructor(e,n){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${e.type}\` in \`${Kk(h8(e.abiItem))}\`, and`,`\`${n.type}\` in \`${Kk(h8(n.abiItem))}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.AmbiguityError"})}}class v8 extends ut{constructor({name:e,data:n,type:r="item"}){const i=e?` with name "${e}"`:n?` with data "${n}"`:"";super(`ABI ${r}${i} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}function W_e(...t){var s;const[e,n]=(()=>{if(Array.isArray(t[0])){const[a,o]=t;return[Z_e(a),o]}return t})(),{bytecode:r,args:i}=n;return fr(r,(s=e.inputs)!=null&&s.length&&(i!=null&&i.length)?xN(e.inputs,i):"0x")}function q_e(t){return $N(t)}function Z_e(t){const e=t.find(n=>n.type==="constructor");if(!e)throw new v8({name:"constructor"});return e}function K_e(t,e={}){return $N(t,e)}function G_e(t){return Kh(t)}function Y_e(...t){const[e,n,r={}]=(()=>{if(Array.isArray(t[0])){const[s,a,o,l]=t;return[Yk(s,a),o,l]}return t})(),i=jee(e.outputs,n,r);if(!(i&&Object.keys(i).length===0))return i&&Object.keys(i).length===1?Array.isArray(i)?i[0]:Object.values(i)[0]:i}function kh(...t){const[e,n=[]]=(()=>{if(Array.isArray(t[0])){const[u,f,p]=t;return[Yk(u,f,{args:p}),p]}const[o,l]=t;return[o,l]})(),{overloads:r}=e,i=r?Yk([e,...r],e.name,{args:n}):e,s=J_e(i),a=n.length>0?xN(i.inputs,n):void 0;return a?fr(s,a):s}function cm(t,e={}){return $N(t,e)}function Yk(t,e,n){const r=D7(t,e,n);if(r.type!=="function")throw new v8({name:e,type:"function"});return r}function J_e(t){return IN(t)}const Jk="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",Xk="0x0000000000000000000000000000000000000000",X_e="0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033",cte="0x608060405234801561000f575f5ffd5b5060043610610029575f3560e01c8063fd00430c1461002d575b5f5ffd5b6100476004803603810190610042919061012b565b610049565b005b80825f375f5f825f865afa610060573d5f5f3e3d5ffd5b3d5f5f3e3d5ff35b5f5ffd5b5f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61009982610070565b9050919050565b6100a98161008f565b81146100b3575f5ffd5b50565b5f813590506100c4816100a0565b92915050565b5f5ffd5b5f5ffd5b5f5ffd5b5f5f83601f8401126100eb576100ea6100ca565b5b8235905067ffffffffffffffff811115610108576101076100ce565b5b602083019150836001820283011115610124576101236100d2565b5b9250929050565b5f5f5f6040848603121561014257610141610068565b5b5f61014f868287016100b6565b935050602084013567ffffffffffffffff8111156101705761016f61006c565b5b61017c868287016100d6565b9250925050925092509256fea2646970667358221220635ed99185cacf3f2acba6921f23687c969cec2bbaf5f9ad599f507e6e105e6964736f6c63430008230033",Q_e=0x00000000000000000000000000000000deadbeefn,exe=G_e(K_e("event Transfer(address indexed from, address indexed to, uint256 value)")),UF=cm("function balanceOf(address) returns (uint256)"),BF=cm("function decimals() returns (uint256)"),FF=cm("function tokenURI(uint256) returns (string)"),zF=cm("function symbol() returns (string)"),txe=cm("function query(address target, bytes data)");async function nxe(t,e){const{blockNumber:n,blockTag:r,calls:i,stateOverrides:s,traceAssetChanges:a,traceTransfers:o,validation:l}=e,u=e.account?hn(e.account):void 0;if(a&&!u)throw new Se("`account` is required when `traceAssetChanges` is true");const f=u?W_e(q_e("constructor(bytes, bytes)"),{bytecode:see,args:[X_e,kh(cm("function getBalance(address)"),[u.address])]}):void 0,p=r??t.experimental_blockTag??"latest";let y=n;
488if(a&&typeof y!="bigint"&&p!=="earliest"&&p!=="pending")if(p==="latest")y=await sm(t,{cacheTime:0});else{const q=await Co(t,{blockTag:p});if(typeof q.number!="bigint")throw new Se(`Block tag \`${p}\` did not resolve to a number.`);y=q.number}const g=typeof y=="bigint"?{blockNumber:y}:{blockTag:p},b=a?await w8(t,{...g,blocks:[{calls:i.map(q=>({...q,from:u.address})),stateOverrides:s}],traceTransfers:o,validation:l}):void 0,v=b?[...new Set([...rxe(b[0].calls.flatMap(q=>q.logs??[]),u.address),...e.calls.map(q=>{var G;return(G=q.to)==null?void 0:G.toLowerCase()})])].filter(q=>!!q&&q!==Jk&&q!==Xk):[],_=ixe([...u?[u.address]:[],...v,...(s==null?void 0:s.map(({address:q})=>q))??[]]),C=[{address:_,code:cte}],[S,x]=await Promise.all([a?Promise.all([HF(t,{account:u.address,...g,data:f,stateOverride:s}),...v.map(q=>HF(t,{account:u.address,address:q,...g,data:kh(UF,[u.address]),staticCallAddress:_,stateOverride:s}))]):[],w8(t,{...g,blocks:[{calls:[...i,{to:Xk}].map(q=>({...q,from:u==null?void 0:u.address})),stateOverrides:s},...a?[{calls:[{data:f}]},{calls:v.map(q=>({to:_,data:ag(q,kh(UF,[u.address]))})),stateOverrides:C},{calls:v.map(q=>({to:_,data:ag(q,kh(BF))})),stateOverrides:C},{calls:v.map(q=>({to:_,data:ag(q,kh(FF,[0n]))})),stateOverrides:C},{calls:v.map(q=>({to:_,data:ag(q,kh(zF))})),stateOverrides:C}]:[]],traceTransfers:o,validation:l})]),A=x[0],[I,$,O,P,j]=a?x.slice(1):[],{calls:U,...z}=A,D=U.slice(0,-1),R=S.map(q=>VF(q)?Rn(q.data):null),W=(I==null?void 0:I.calls)??[],T=($==null?void 0:$.calls)??[],M=[...W,...T].map(q=>VF(q)?Rn(q.data):null),Z=((O==null?void 0:O.calls)??[]).map(q=>nE(q,BF)),H=((j==null?void 0:j.calls)??[]).map(q=>nE(q,zF)),V=((P==null?void 0:P.calls)??[]).map(q=>nE(q,FF)),F=[];for(const[q,G]of M.entries()){const Y=R[q],X=S[q],te=typeof Y=="bigint"?Y:q>0&&(X==null?void 0:X.status)==="success"&&X.data==="0x"?0n:null;if(typeof G!="bigint"||typeof te!="bigint")continue;const ie=Z[q-1],se=H[q-1],pe=V[q-1],Ce=q===0?{address:Jk,decimals:18,symbol:"ETH"}:{address:v[q-1],decimals:pe||ie?Number(ie??1):void 0,symbol:se??void 0};F.push({token:Ce,value:{pre:te,post:G,diff:G-te}})}return{assetChanges:F,block:z,results:D}}function ag(t,e){return kh(txe,[t,e])}function rxe(t,e){const n=D2(e.toLowerCase(),{size:32});return t.filter(r=>{var i,s,a;return((i=r.topics[0])==null?void 0:i.toLowerCase())!==exe||r.address.toLowerCase()===Jk?!1:((s=r.topics[1])==null?void 0:s.toLowerCase())===n||((a=r.topics[2])==null?void 0:a.toLowerCase())===n}).map(r=>r.address.toLowerCase())}function VF(t){return t.status==="success"&&/^0x[\da-f]{64}$/i.test(t.data)}function nE(t,e){if(t.status==="failure"||t.data==="0x")return null;try{return Y_e(e,t.data)}catch{return null}}async function HF(t,e){const{account:n,address:r,blockNumber:i,blockTag:s,data:a,staticCallAddress:o,stateOverride:l}=e;try{return{data:(await rm({...t,ccipRead:!1},{account:r?Xk:n,data:r?ag(r,a):a,stateOverride:r&&o?[...l??[],{address:o,code:cte}]:l,...r?{to:o}:{},...typeof i=="bigint"?{blockNumber:i}:{blockTag:s}})).data??"0x",status:"success"}}catch(u){if(!(u instanceof DI)||!(u.cause instanceof qh))throw u;return{data:"0x",status:"failure"}}}function ixe(t){const e=new Set(t.map(r=>r.toLowerCase()));let n=Q_e;for(;e.has(`0x${n.toString(16).padStart(40,"0")}`);)n++;return`0x${n.toString(16).padStart(40,"0")}`}const ute="0x6492649264926492649264926492649264926492649264926492649264926492";function sxe(t){if(tn(t,-32)!==ute)throw new lxe(t)}function axe(t){const{data:e,signature:n,to:r}=t;return fr(xN(Mee("address, bytes, bytes"),[r,e,n]),ute)}function oxe(t){try{return sxe(t),!0}catch{return!1}}class lxe extends ut{constructor(e){super(`Value \`${e}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}}function dte({r:t,s:e,to:n="hex",v:r,yParity:i}){const s=(()=>{if(i===0||i===1)return i;if(r&&(r===27n||r===28n||r>=35n))return r%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),a=`0x${new lm.Signature(Rn(t),Rn(e)).toCompactHex()}${s===0?"1b":"1c"}`;return n==="hex"?a:Os(a)}async function e5(t,e){var u,f,p,y;const{address:n,chain:r=t.chain,hash:i,erc6492VerifierAddress:s=e.universalSignatureVerifierAddress??((f=(u=r==null?void 0:r.contracts)==null?void 0:u.erc6492Verifier)==null?void 0:f.address),multicallAddress:a=e.multicallAddress??((y=(p=r==null?void 0:r.contracts)==null?void 0:p.multicall3)==null?void 0:y.address),mode:o="auto"}=e;if(r!=null&&r.verifyHash)return await r.verifyHash(t,e);const l=(()=>{const g=e.signature;return Ss(g)?g:typeof g=="object"&&"r"in g&&"s"in g?dte(g):_i(g)})();try{if(o==="eoa")try{if(oc(Vi(n),await Sk({hash:i,signature:l})))return!0}catch{}return N_e(l)?await cxe(t,{...e,multicallAddress:a,signature:l}):await uxe(t,{...e,verifierAddress:s,signature:l})}catch(g){if(o!=="eoa")try{if(oc(Vi(n),await Sk({hash:i,signature:l})))return!0}catch{}if(g instanceof Sf)return!1;throw g}}async function cxe(t,e){var S;const{address:n,blockHash:r,blockNumber:i,blockTag:s,hash:a,multicallAddress:o,requireCanonical:l}=e,{authorization:u,data:f,signature:p,to:y}=I_e(e.signature);if(await D3(t,{address:n,blockHash:r,blockNumber:i,blockTag:s,requireCanonical:l})===Wi(["0xef0100",u.address]))return await dxe(t,{...e,signature:p});const b={address:u.address,chainId:Number(u.chainId),nonce:Number(u.nonce),r:ze(u.r,{size:32}),s:ze(u.s,{size:32}),yParity:u.yParity};if(!await R7e({address:n,authorization:b}))throw new Sf;const _=await Ye(t,ir,"readContract")({...o?{address:o}:{code:A7},authorizationList:[b],abi:Ef,blockHash:r,blockNumber:i,blockTag:"pending",functionName:"aggregate3",requireCanonical:l,args:[[...f?[{allowFailure:!0,target:y??n,c
488allData:f}]:[],{allowFailure:!0,target:n,callData:cs({abi:iee,functionName:"isValidSignature",args:[a,p]})}]]}),C=(S=_[_.length-1])==null?void 0:S.returnData;if(C!=null&&C.startsWith("0x1626ba7e"))return!0;throw new Sf}async function uxe(t,e){const{address:n,factory:r,factoryData:i,hash:s,signature:a,verifierAddress:o,...l}=e,u=await(async()=>!r&&!i||oxe(a)?a:axe({data:i,signature:a,to:r}))(),f=o?{to:o,data:cs({abi:wF,functionName:"isValidSig",args:[n,s,u]}),...l}:{data:k7({abi:wF,args:[n,s,u],bytecode:Eve}),...l},{data:p}=await Ye(t,rm,"call")(f).catch(y=>{throw y instanceof DI?new Sf:y});if(P4e(p??"0x0"))return!0;throw new Sf}async function dxe(t,e){const{address:n,blockHash:r,blockNumber:i,blockTag:s,hash:a,requireCanonical:o,signature:l}=e;if((await Ye(t,ir,"readContract")({address:n,abi:iee,args:[a,l],blockHash:r,blockNumber:i,blockTag:s,functionName:"isValidSignature",requireCanonical:o}).catch(f=>{throw f instanceof yQ?new Sf:f})).startsWith("0x1626ba7e"))return!0;throw new Sf}let Sf=class extends Error{};async function hxe(t,{address:e,message:n,factory:r,factoryData:i,signature:s,...a}){const o=mN(n);return Ye(t,e5,"verifyHash")({address:e,factory:r,factoryData:i,hash:o,signature:s,...a})}async function fxe(t,e){const{address:n,factory:r,factoryData:i,signature:s,message:a,primaryType:o,types:l,domain:u,...f}=e,p=Aee({message:a,primaryType:o,types:l,domain:u});return Ye(t,e5,"verifyHash")({address:n,factory:r,factoryData:i,hash:p,signature:s,...f})}function hte(t,{emitOnBegin:e=!1,emitMissed:n=!1,onBlockNumber:r,onError:i,poll:s,pollingInterval:a=t.pollingInterval}){const o=typeof s<"u"?s:!(t.transport.type==="webSocket"||t.transport.type==="ipc"||t.transport.type==="fallback"&&(t.transport.transports[0].c
488onfig.type==="webSocket"||t.transport.transports[0].config.type==="ipc"));let l;return o?(()=>{const p=ii(["watchBlockNumber",t.uid,e,n,a]);return lc(p,{onBlockNumber:r,onError:i},y=>im(async()=>{var g;try{const b=await Ye(t,sm,"getBlockNumber")({cacheTime:0});if(l!==void 0){if(b===l)return;if(b-l>1&&n)for(let v=l+1n;v<b;v++)y.onBlockNumber(v,l),l=v}(l===void 0||b>l)&&(y.onBlockNumber(b,l),l=b)}catch(b){(g=y.onError)==null||g.call(y,b)}},{emitOnBegin:e,interval:a}))})():(()=>{const p=ii(["watchBlockNumber",t.uid,e,n]);return lc(p,{onBlockNumber:r,onError:i},y=>{let g=!0,b=()=>g=!1;return(async()=>{try{const v=(()=>{if(t.transport.type==="fallback"){const C=t.transport.transports.find(S=>S.config.type==="webSocket"||S.config.type==="ipc");return C?C.value:t.transport}return t.transport})(),{unsubscribe:_}=await v.subscribe({params:["newHeads"],onData(C){var x;if(!g)return;const S=Rn((x=C.result)==null?void 0:x.number);y.onBlockNumber(S,l),l=S},onError(C){var S;(S=y.onError)==null||S.call(y,C)}});b=_,g||b()}catch(v){i==null||i(v)}})(),()=>b()})})()}async function fte(t,e){var I;const{checkReplacement:n=((I=t.chain)==null?void 0:I.supportsTransactionReplacementDetection)??!0,confirmations:r=1,hash:i,onReplaced:s,retryCount:a=6,retryDelay:o=({count:$})=>~~(1<<$)*200,timeout:l=18e4}=e,u=ii(["waitForTransactionReceipt",t.uid,i]),f=(()=>{var $;return e.pollingInterval?e.pollingInterval:($=t.chain)!=null&&$.experimental_preconfirmationTime?t.chain.experimental_preconfirmationTime:t.pollingInterval})();let p,y,g,b=!1,v,_;const{promise:C,resolve:S,reject:x}=aN(),A=l?setTimeout(()=>{_==null||_(),v==null||v(),x(new i8e({hash:i}))},l):void 0;return v=lc(u,{onReplaced:s,resolve:S,reject:x},async $=>{if(g=await Ye(t,Aw,"getTransactionReceipt")({hash:i}).catch(()=>{}),g&&r<=1){clearTimeout(A),$.resolve(g),v==null||v();return}_=Ye(t,hte,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:f,async onBlockNumber(O){const P=U=>{clearTimeout(A),_==null||_(),U(),v==null||v()};let j=O;if(!b)try{if(g){if(r>1&&(!g.blockNumber||j-g.blockNumber+1n<r))return;P(()=>$.resolve(g));return}if(n&&!p&&(b=!0,await b8(async()=>{p=await Ye(t,LN,"getTransaction")({hash:i}),p.blockNumber&&(j=p.blockNumber)},{delay:o,retryCount:a}),b=!1),g=await Ye(t,Aw,"getTransactionReceipt")({hash:i}),r>1&&(!g.blockNumber||j-g.blockNumber+1n<r))return;P(()=>$.resolve(g))}catch(U){if(U instanceof jI||U instanceof mQ){if(!p){b=!1;return}try{y=p,b=!0;const z=await b8(()=>Ye(t,Co,"getBlock")({blockNumber:j,includeTransactions:!0}),{delay:o,retryCount:a,shouldRetry:({error:W})=>W instanceof zI});b=!1;const D=z.transactions.find(({from:W,nonce:T})=>W===y.from&&T===y.nonce);if(!D||(g=await Ye(t,Aw,"getTransactionReceipt")({hash:D.hash}),r>1&&(!g.blockNumber||j-g.blockNumber+1n<r)))return;let R="replaced";D.to===y.to&&D.value===y.value&&D.input===y.input?R="repriced":D.from===D.to&&D.value===0n&&(R="cancelled"),P(()=>{var W;(W=$.onReplaced)==null||W.call($,{reason:R,replacedTransaction:y,transaction:D,transactionReceipt:g}),$.resolve(g)})}catch(z){P(()=>$.reject(z))}}else P(()=>$.reject(U))}}})}),C}const pxe=["size","totalDifficulty","transactions","uncles","withdrawals"];function mxe(t,{onBlockHeader:e,onError:n}){let r;const i=ii(["watchBlockHeaders",t.uid]);return lc(i,{onBlockHeader:e,onError:n},s=>{let a=!0,o=!1,l=()=>a=!1;return(async()=>{var u;try{const f=(()=>{if(t.transport.type==="fallback"){const y=t.transport.transports.find(g=>g.config.type==="webSocket"||g.config.type==="ipc");return y?y.value:t.transport}return t.transport})(),{unsubscribe:p}=await f.subscribe({params:["newHeads"],onData(y){var b,v,_;if(!a)return;const g=(((_=(v=(b=t.chain)==null?void 0:b.formatters)==null?void 0:v.block)==null?void 0:_.format)||x7)(y.result,"watchBlockHeaders");for(const C of pxe)delete g[C];s.onBlockHeader(g,r),r=g},onError(y){var g;o&&((g=s.onError)==null||g.call(s,y))}});o=!0,l=p,a||l()}catch(f){(u=s.onError)==null||u.call(s,f)}})(),()=>l()})}function yxe(t,{blockTag:e=t.experimental_blockTag??"latest",emitMissed:n=!1,emitOnBegin:r=!1,onBlock:i,onError:s,includeTransactions:a,poll:o,pollingInterval:l=t.pollingInterval}){const u=typeof o<"u"?o:!(t.transport.type==="webSocket"||t.transport.type==="ipc"||t.transport.type==="fallback"&&(t.transport.transports[0].c
488onfig.type==="webSocket"||t.transport.transports[0].config.type==="ipc")),f=a??!1;let p;return u?(()=>{const b=ii(["watchBlocks",t.uid,e,n,r,f,l]);return lc(b,{onBlock:i,onError:s},v=>im(async()=>{var _;try{const C=await Ye(t,Co,"getBlock")({blockTag:e,includeTransactions:f});if(C.number!==null&&(p==null?void 0:p.number)!=null){if(C.number===p.number)return;if(C.number-p.number>1&&n)for(let S=(p==null?void 0:p.number)+1n;S<C.number;S++){const x=await Ye(t,Co,"getBlock")({blockNumber:S,includeTransactions:f});v.onBlock(x,p),p=x}}((p==null?void 0:p.number)==null||e==="pending"&&(C==null?void 0:C.number)==null||C.number!==null&&C.number>p.number)&&(v.onBlock(C,p),p=C)}catch(C){(_=v.onError)==null||_.call(v,C)}},{emitOnBegin:r,interval:l}))})():(()=>{let b=!0,v=!0,_=()=>b=!1;return(async()=>{try{r&&Ye(t,Co,"getBlock")({blockTag:e,includeTransactions:f}).then(x=>{b&&v&&(i(x,void 0),v=!1)}).catch(s);const C=(()=>{if(t.transport.type==="fallback"){const x=t.transport.transports.find(A=>A.config.type==="webSocket"||A.config.type==="ipc");return x?x.value:t.transport}return t.transport})(),{unsubscribe:S}=await C.subscribe({params:["newHeads"],async onData(x){var I;if(!b)return;const A=await Ye(t,Co,"getBlock")({blockNumber:(I=x.result)==null?void 0:I.number,includeTransactions:f}).catch(()=>{});b&&(i(A,p),v=!1,p=A)},onError(x){s==null||s(x)}});_=S,b||_()}catch(C){s==null||s(C)}})(),()=>_()})()}function gxe(t,{address:e,args:n,batch:r=!0,event:i,events:s,fromBlock:a,onError:o,onLogs:l,poll:u,pollingInterval:f=t.pollingInterval,strict:p}){const y=typeof u<"u"?u:typeof a=="bigint"?!0:!(t.transport.type==="webSocket"||t.transport.type==="ipc"||t.transport.type==="fallback"&&(t.transport.transports[0].c
488onfig.type==="webSocket"||t.transport.transports[0].config.type==="ipc")),g=p??!1;return y?(()=>{const _=ii(["watchEvent",e,n,r,t.uid,i,f,a]);return lc(_,{onLogs:l,onError:o},C=>{let S;a!==void 0&&(S=a-1n);let x,A=!1;const I=im(async()=>{var $;if(!A){try{x=await Ye(t,xee,"createEventFilter")({address:e,args:n,event:i,events:s,strict:g,fromBlock:a})}catch{}A=!0;return}try{let O;if(x)O=await Ye(t,T7,"getFilterChanges")({filter:x});else{const P=await Ye(t,sm,"getBlockNumber")({});S&&S!==P?O=await Ye(t,tN,"getLogs")({address:e,args:n,event:i,events:s,fromBlock:S+1n,toBlock:P}):O=[],S=P}if(O.length===0)return;if(r)C.onLogs(O);else for(const P of O)C.onLogs([P])}catch(O){x&&O instanceof T2&&(A=!1),($=C.onError)==null||$.call(C,O)}},{emitOnBegin:!0,interval:f});return async()=>{x&&await Ye(t,L7,"uninstallFilter")({filter:x}),I()}})})():(()=>{let _=!0,C=()=>_=!1;return(async()=>{try{const S=(()=>{if(t.transport.type==="fallback"){const $=t.transport.transports.find(O=>O.config.type==="webSocket"||O.config.type==="ipc");return $?$.value:t.transport}return t.transport})(),x=s??(i?[i]:void 0);let A=[];x&&(A=[x.flatMap(O=>F6({abi:[O],eventName:O.name,args:n}))],i&&(A=A[0]));const{unsubscribe:I}=await S.subscribe({params:["logs",{address:e,topics:A}],onData($){var P;if(!_)return;const O=$.result;try{const{eventName:j,args:U}=m8({abi:x??[],data:O.data,topics:O.topics,strict:g}),z=vl(O,{args:U,eventName:j});l([z])}catch(j){let U,z;if(j instanceof p8||j instanceof LI){if(p)return;U=j.abiItem.name,z=(P=j.abiItem.inputs)==null?void 0:P.some(R=>!("name"in R&&R.name))}const D=vl(O,{args:z?[]:{},eventName:U});l([D])}},onError($){o==null||o($)}});C=I,_||C()}catch(S){o==null||o(S)}})(),()=>C()})()}function bxe(t,{batch:e=!0,onError:n,onTransactions:r,poll:i,pollingInterval:s=t.pollingInterval}){return(typeof i<"u"?i:t.transport.type!=="webSocket"&&t.transport.type!=="ipc")?(()=>{const u=ii(["watchPendingTransactions",t.uid,e,s]);return lc(u,{onTransactions:r,onError:n},f=>{let p;const y=im(async()=>{var g;try{if(!p)try{p=await Ye(t,Cee,"createPendingTransactionFilter")({});return}catch(v){throw y(),v}const b=await Ye(t,T7,"getFilterChanges")({filter:p});if(b.length===0)return;if(e)f.onTransactions(b);else for(const v of b)f.onTransactions([v])}catch(b){(g=f.onError)==null||g.call(f,b)}},{emitOnBegin:!0,interval:s});return async()=>{p&&await Ye(t,L7,"uninstallFilter")({filter:p}),y()}})})():(()=>{let u=!0,f=()=>u=!1;return(async()=>{try{const{unsubscribe:p}=await t.transport.subscribe({params:["newPendingTransactions"],onData(y){if(!u)return;const g=y.result;r([g])},onError(y){n==null||n(y)}});f=p,u||f()}catch(p){n==null||n(p)}})(),()=>f()})()}const wxe=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})$/;function vxe(t){return wxe.test(t)?!Number.isNaN(new Date(t).getTime()):!1}function rE(t){return vxe(t)?new Date(t):new Date(Number.NaN)}function _xe(t){var p,y,g;const{scheme:e,statement:n,...r}=((p=t.match(xxe))==null?void 0:p.groups)??{},{chainId:i,expirationTime:s,issuedAt:a,notBefore:o,requestId:l,...u}=((y=t.match(Cxe))==null?void 0:y.groups)??{},f=(g=t.split("Resources:")[1])==null?void 0:g.split(` 489- `).slice(1);return{...r,...u,...i?{chainId:Number(i)}:{},...s?{expirationTime:rE(s)}:{},...a?{issuedAt:rE(a)}:{},...o?{notBefore:rE(o)}:{},...l?{requestId:l}:{},...f?{resources:f}:{},...e?{scheme:e}:{},...n?{statement:n}:{}}}const xxe=/^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/,Cxe=/(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.+))?/;function Exe(t){const{address:e,domain:n,message:r,nonce:i,scheme:s,time:a=new Date}=t;if(n&&r.domain!==n||i&&r.nonce!==i||s&&r.scheme!==s||Number.isNaN(a.getTime())||r.expirationTime&&(Number.isNaN(r.expirationTime.getTime())||a>=r.expirationTime)||r.notBefore&&(Number.isNaN(r.notBefore.getTime())||a<r.notBefore))return!1;try{if(!r.address||!Yn(r.address,{strict:!1})||e&&!oc(r.address,e))return!1}catch{return!1}return!0}async function Sxe(t,e){const{address:n,domain:r,message:i,nonce:s,scheme:a,signature:o,time:l=new Date,...u}=e,f=_xe(i);if(!f.address||!Exe({address:n,domain:r,message:f,nonce:s,scheme:a,time:l}))return!1;const y=mN(i);return e5(t,{address:f.address,hash:y,signature:o,...u})}function NN(t,e){return{amount:t,decimals:e,formatted:M7(t,e)}}function pte(t,e){if(typeof t=="bigint")return t;const n=t.decimals??e;return P_e(t.formatted,Axe(n))}function Axe(t){if(t===void 0)throw new Error("Token decimals are required. Pass `amount.decimals` or select a declared token.");return t}function mte(t,e){return typeof t=="bigint"?e:t.decimals??e}function Zu(t,e){const{decimals:n,token:r}=e,i=yte(t,r);
489if(i)return{address:i.address,decimals:n??i.decimals};if(Yn(r,{strict:!1}))return{address:r,decimals:n??Txe(t,r)};throw new Error(`Token "${r}" is not a declared ERC-20 token on the client's \`tokens\` array (with an address for the client's chain), and is not a valid address.`)}function yte(t,e){var s;const n=t.tokens,r=(s=t.chain)==null?void 0:s.id;if(!n||r===void 0)return;const i=kxe(n,e);if(i)return Qk(i,r);if(Yn(e,{strict:!1}))for(const a of n){const o=Qk(a,r);if(o&&oc(o.address,e))return o}}function Qk(t,e){const n=t.addresses[e];if(n)return{address:n,currency:t.currency,decimals:t.decimals,name:t.name,popular:t.popular,symbol:t.symbol}}function kxe(t,e){var r;const n=e.toLowerCase();for(const i of t)if(((r=i.symbol)==null?void 0:r.toLowerCase())===n)return i}function Txe(t,e){var i;const n=t.tokens,r=(i=t.chain)==null?void 0:i.id;if(n&&r!==void 0)for(const s of n){const a=Qk(s,r);if(a&&oc(a.address,e))return a.decimals}}async function ON(t,e){const{address:n,decimals:r}=Zu(t,e);return r!==void 0?{address:n,decimals:r}:{address:n,decimals:await ir(t,{abi:ko,address:n,functionName:"decimals"})}}function _8(t){const{account:e,chain:n,gas:r,maxFeePerGas:i,maxPriorityFeePerGas:s,nonce:a}=t;return{account:e,chain:n,gas:r,maxFeePerGas:i,maxPriorityFeePerGas:s,nonce:a}}function t5(t){return{...t,data:cs(t),to:t.address}}async function p1(t,e){return p1.inner($o,t,e)}(function(t){async function e(a,o,l){return await a(o,{...l,...t.call(o,l)})}t.inner=e;function n(a,o){return t5(Lxe(a,o))}t.call=n;async function r(a,o){return eN(a,{..._8(o),...t.call(a,o)})}t.estimateGas=r;async function i(a,o){return lN(a,{..._8(o),...t.call(a,o)})}t.simulate=i;function s(a){const[o]=wc({abi:ko,logs:a,eventName:"Approval",strict:!0});if(!o)throw new Error("`Approval` event not found.");return o}t.extractEvent=s})(p1||(p1={}));function Lxe(t,e){const{amount:n,spender:r,token:i}=e,{address:s,decimals:a}=Zu(t,{token:i});return{abi:ko,address:s,args:[r,pte(n,a)],functionName:"approve"}}async function PN(t,{serializedTransaction:e,throwOnReceiptRevert:n,timeout:r}){var o,l,u;const i=await t.request({method:"eth_sendRawTransactionSync",params:r?[e,r]:[e]},{retryCount:0}),a=(((u=(l=(o=t.chain)==null?void 0:o.formatters)==null?void 0:l.transactionReceipt)==null?void 0:u.format)||J6)(i);if(a.status==="reverted"&&n)throw new Ek({receipt:a});return a}const iE=new G1(128);async function gte(t,e){var P,j,U,z,D,R;const{account:n=t.account,assertChainId:r=!0,chain:i=t.chain,accessList:s,authorizationList:a,blobs:o,data:l,dataSuffix:u=typeof t.dataSuffix=="string"?t.dataSuffix:(P=t.dataSuffix)==null?void 0:P.value,gas:f,gasPrice:p,maxFeePerBlobGas:y,maxFeePerGas:g,maxPriorityFeePerGas:b,nonce:v,pollingInterval:_,throwOnReceiptRevert:C,type:S,value:x,...A}=e,I=e.timeout??Math.max(((i==null?void 0:i.blockTime)??0)*3,5e3);if(typeof n>"u")throw new Mo({docsPath:"/docs/actions/wallet/sendTransactionSync"});const $=n?hn(n):null;let O;try{gc(e);const W=await(async()=>{if(e.to)return e.to;if(e.to!==null&&a&&a.length>0)return await w7({authorization:a[0]}).catch(()=>{throw new Se("`to` is required. Could not infer from `authorizationList`.")})})();if(($==null?void 0:$.type)==="json-rpc"||$===null){let T;i!==null&&(T=await Ye(t,bc,"getChainId")({}),r&&Y6({currentChainId:T,chain:i}));const L=(z=(U=(j=t.chain)==null?void 0:j.formatters)==null?void 0:U.transactionRequest)==null?void 0:z.format,Z=(L||yc)({...J1(A,{format:L}),accessList:s,account:$,authorizationList:a,blobs:o,chainId:T,data:u?ac([l??"0x",u]):l,gas:f,gasPrice:p,maxFeePerBlobGas:y,maxFeePerGas:g,maxPriorityFeePerGas:b,nonce:v,to:W,type:S,value:x},"sendTransaction"),H=iE.get(t.uid),V=H?"wallet_sendTransaction":"eth_sendTransaction",F=await(async()=>{try{return await t.request({method:V,params:[Z]},{retryCount:0})}catch(G){if(H===!1)throw G;const Y=G;if(Y.name==="InvalidInputRpcError"||Y.name==="InvalidParamsRpcError"||Y.name==="MethodNotFoundRpcError"||Y.name==="MethodNotSupportedRpcError")return await t.request({method:"wallet_sendTransaction",params:[Z]},{retryCount:0}).then(X=>(iE.set(t.uid,!0),X)).catch(X=>{const te=X;throw te.name==="MethodNotFoundRpcError"||te.name==="MethodNotSupportedRpcError"?(iE.set(t.uid,!1),Y):te});throw Y}})(),q=await Ye(t,fte,"waitForTransactionReceipt")({checkReplacement:!1,hash:F,pollingInterval:_,timeout:I});
489if(C&&q.status==="reverted")throw new Ek({receipt:q});return q}if(($==null?void 0:$.type)==="local"){const T=(()=>{if(!$.nonceManager||typeof v<"u")return $.nonceManager;const H=$.nonceManager;return{consume(V){return O={address:V.address,chainId:V.chainId},H.consume(V)},get(V){return H.get(V)},increment(V){return H.increment(V)},reset(V){return H.reset(V)}}})(),L=await Ye(t,Q1,"prepareTransactionRequest")({account:$,accessList:s,authorizationList:a,blobs:o,chain:i,data:u?ac([l??"0x",u]):l,gas:f,gasPrice:p,maxFeePerBlobGas:y,maxFeePerGas:g,maxPriorityFeePerGas:b,nonce:v,nonceManager:T,parameters:[...XI,"sidecars"],type:S,value:x,...A,to:W}),M=(D=i==null?void 0:i.serializers)==null?void 0:D.transaction,Z=await $.signTransaction(L,{serializer:M});return await Ye(t,PN,"sendRawTransactionSync")({serializedTransaction:Z,throwOnReceiptRevert:C,timeout:e.timeout})}throw($==null?void 0:$.type)==="smart"?new cf({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new cf({docsPath:"/docs/actions/wallet/sendTransactionSync",type:$==null?void 0:$.type})}catch(W){throw W instanceof cf?W:(O&&!(W instanceof Ek)&&((R=$==null?void 0:$.nonceManager)==null||R.reset(O)),W6(W,{...e,account:$,chain:e.chain||void 0}))}}async function RN(t,e){return $o.internal(t,gte,"sendTransactionSync",e)}async function $xe(t,e){const{amount:n,token:r,throwOnReceiptRevert:i=!0}=e,{decimals:s}=Zu(t,{token:r}),a=mte(n,s),o=await p1.inner(RN,t,{...e,throwOnReceiptRevert:i}),{args:l}=p1.extractEvent(o.logs);return{...l,...a===void 0?{}:{decimals:a,formatted:M7(l.value,a)},receipt:o}}async function x8(t,e){const{account:n,decimals:r,spender:i,token:s,...a}=e,[o,{decimals:l}]=await Promise.all([ir(t,{...a,...x8.call(t,{account:n,spender:i,token:s})}),ON(t,{decimals:r,token:s})]);return NN(o,l)}(function(t){function e(n,r){return t5({address:Zu(n,r).address,abi:ko,functionName:"allowance",args:[r.account,r.spender]})}t.call=e})(x8||(x8={}));async function C8(t,e){const{account:n=t.account,decimals:r,token:i,...s}=e;if(!n)throw new Mo;const a=hn(n).address,[o,{decimals:l}]=await Promise.all([ir(t,{...s,...C8.call(t,{account:a,token:i})}),ON(t,{decimals:r,token:i})]);return NN(o,l)}(function(t){function e(n,r){const i=r.account??n.account;if(!i)throw new Mo;const s=hn(i).address;return t5({address:Zu(n,r).address,abi:ko,functionName:"balanceOf",args:[s]})}t.call=e})(C8||(C8={}));async function Ixe(t,e){const{token:n,...r}=e,{address:i}=Zu(t,{token:n}),s=yte(t,n),[a,o,l]=await Promise.all([(s==null?void 0:s.decimals)??ir(t,{...r,abi:ko,address:i,functionName:"decimals"}),(s==null?void 0:s.name)??ir(t,{...r,abi:ko,address:i,functionName:"name"}),(s==null?void 0:s.symbol)??ir(t,{...r,abi:ko,address:i,functionName:"symbol"})]);return{decimals:a,name:o,symbol:l}}async function E8(t,e){const{decimals:n,token:r,...i}=e,[s,{decimals:a}]=await Promise.all([ir(t,{...i,...E8.call(t,{token:r})}),ON(t,{decimals:n,token:r})]);return NN(s,a)}(function(t){function e(n,r){return t5({address:Zu(n,r).address,abi:ko,args:[],functionName:"totalSupply"})}t.call=e})(E8||(E8={}));async function m1(t,e){return m1.inner($o,t,e)}(function(t){async function e(a,o,l){return await a(o,{...l,...t.call(o,l)})}t.inner=e;function n(a,o){return t5(Nxe(a,o))}t.call=n;async function r(a,o){return eN(a,{..._8(o),...t.call(a,o)})}t.estimateGas=r;async function i(a,o){return lN(a,{..._8(o),...t.call(a,o)})}t.simulate=i;function s(a){const[o]=wc({abi:ko,logs:a,eventName:"Transfer",strict:!0});if(!o)throw new Error("`Transfer` event not found.");return o}t.extractEvent=s})(m1||(m1={}));function Nxe(t,e){const{amount:n,from:r,to:i,token:s}=e,{address:a,decimals:o}=Zu(t,{token:s}),l=pte(n,o);return r?{abi:ko,address:a,args:[r,i,l],functionName:"transferFrom"}:{abi:ko,address:a,args:[i,l],functionName:"transfer"}}async function Oxe(t,e){const{amount:n,token:r,throwOnReceiptRevert:i=!0}=e,{decimals:s}=Zu(t,{token:r}),a=mte(n,s),o=await m1.inner(RN,t,{...e,throwOnReceiptRevert:i}),{args:l}=m1.extractEvent(o.logs);return{...l,...a===void 0?{}:{decimals:a,formatted:M7(l.value,a)},receipt:o}}function S8(t){return{call:e=>rm(t,e),createAccessList:e=>h7e(t,e),createBlockFilter:()=>f7e(t),createContractEventFilter:e=>lQ(t,e),createEventFilter:e=>xee(t,e),createPendingTransactionFilter:()=>Cee(t),estimateContractGas:e=>eN(t,e),estimateGas:e=>QI(t,e),getBalance:e=>p7e(t,e),getBlobBaseFee:()=>m7e(t),getBlock:e=>Co(t,e),getBlockNumber:e=>sm(t,e),getBlockReceipts:e=>y7e(t,e),getBlockTransactionCount:e=>g7e(t,e),getBytecode:e=>D3(t,e),getChainId:()=>bc(t),getCode:e=>D3(t,e),getContractEvents:e=>MQ(t,e),getDelegation:e=>b7e(t,e),getEip712Domain:e=>v7e(t,e),getEnsAddress:e=>Gve(t,e),getEnsAvatar:e=>c7e(t,e),getEnsName:e=>u7e(t,e),getEnsResolver:e=>d7e(t,e),getEnsText:e=>_ee(t,e),getFeeHistory:e=>
489C7e(t,e),estimateFeesPerGas:e=>C8e(t,e),getFilterChanges:e=>T7(t,e),getFilterLogs:e=>E7e(t,e),getGasPrice:()=>HI(t),getLogs:e=>tN(t,e),getProof:e=>M_e(t,e),estimateMaxPriorityFeePerGas:e=>x8e(t,e),fillTransaction:e=>JI(t,e),getRawTransaction:e=>D_e(t,e),getStorageAt:e=>U_e(t,e),getTransaction:e=>LN(t,e),getTransactionConfirmations:e=>B_e(t,e),getTransactionCount:e=>WI(t,e),getTransactionReceipt:e=>Aw(t,e),multicall:e=>F_e(t,e),prepareTransactionRequest:e=>Q1(t,e),readContract:e=>ir(t,e),sendRawTransaction:e=>$7(t,e),sendRawTransactionSync:e=>PN(t,e),simulate:e=>w8(t,e),simulateBlocks:e=>w8(t,e),simulateCalls:e=>nxe(t,e),simulateContract:e=>lN(t,e),verifyHash:e=>e5(t,e),verifyMessage:e=>hxe(t,e),verifySiweMessage:e=>Sxe(t,e),verifyTypedData:e=>fxe(t,e),uninstallFilter:e=>L7(t,e),waitForTransactionReceipt:e=>fte(t,e),watchBlockHeaders:e=>mxe(t,e),watchBlocks:e=>yxe(t,e),watchBlockNumber:e=>hte(t,e),watchContractEvent:e=>Bve(t,e),watchEvent:e=>gxe(t,e),watchPendingTransactions:e=>bxe(t,e),token:Pxe(t)}}function Pxe(t){return{getAllowance:c2(t,x8),getBalance:c2(t,C8),getMetadata:c2(t,Ixe),getTotalSupply:c2(t,E8)}}function B3(t){const{key:e="public",name:n="Public Client"}=t;return gee({...t,key:e,name:n,type:"publicClient"}).extend(S8)}async function Rxe(t,{chain:e}){const{id:n,name:r,nativeCurrency:i,rpcUrls:s,blockExplorers:a}=e;await t.request({method:"wallet_addEthereumChain",params:[{chainId:ze(n),chainName:r,nativeCurrency:i,rpcUrls:s.default.http,blockExplorerUrls:a?Object.values(a).map(({url:o})=>o):void 0}]},{dedupe:!0,retryCount:0})}function jxe(t,e){const{abi:n,args:r,bytecode:i,...s}=e,a=k7({abi:n,args:r,bytecode:i}
489);return am(t,{...s,...s.authorizationList?{to:null}:{},data:a})}async function Mxe(t){var n;return((n=t.account)==null?void 0:n.type)==="local"?[t.account.address]:(await t.request({method:"eth_accounts"},{dedupe:!0})).map(r=>U6(r))}async function Dxe(t,e={}){const{account:n=t.account,chainId:r}=e,i=n?hn(n):void 0,s=r?[i==null?void 0:i.address,[ze(r)]]:[i==null?void 0:i.address],a=await t.request({method:"wallet_getCapabilities",params:s}),o={};for(const[l,u]of Object.entries(a)){o[Number(l)]={};for(let[f,p]of Object.entries(u))f==="addSubAccount"&&(f="unstable_addSubAccount"),o[Number(l)][f]=p}return typeof r=="number"?o[r]:o}async function Uxe(t){return await t.request({method:"wallet_getPermissions"},{dedupe:!0})}async function bte(t,e){var l;const{account:n=t.account,chainId:r,nonce:i}=e;if(!n)throw new Mo({docsPath:"/docs/eip7702/prepareAuthorization"});const s=hn(n),a=(()=>{if(e.executor)return e.executor==="self"?e.executor:hn(e.executor)})(),o={address:e.contractAddress??e.address,chainId:r,nonce:i};return typeof o.chainId>"u"&&(o.chainId=((l=t.chain)==null?void 0:l.id)??await Ye(t,bc,"getChainId")({})),typeof o.nonce>"u"&&(o.nonce=await Ye(t,WI,"getTransactionCount")({address:s.address,blockTag:"pending"}),(a==="self"||a!=null&&a.address&&oc(a.address,s.address))&&(o.nonce+=1)),o}async function Bxe(t){return(await t.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map(n=>Vi(n))}async function Fxe(t,e){return t.request({method:"wallet_requestPermissions",params:[e]},{retryCount:0})}async function zxe(t,e){const{chain:n=t.chain}=e,r=e.timeout??Math.max(((n==null?void 0:n.blockTime)??0)*3,5e3),i=await Ye(t,fee,"sendCalls")(e);return await Ye(t,mee,"waitForCallsStatus")({...e,id:i.id,timeout:r})}async function Vxe(t,e){const{id:n}=e;await t.request({method:"wallet_showCallsStatus",params:[n]})}async function Hxe(t,e){const{account:n=t.account}=e;if(!n)throw new Mo({docsPath:"/docs/eip7702/signAuthorization"});const r=hn(n);if(!r.signAuthorization)throw new cf({docsPath:"/docs/eip7702/signAuthorization",metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:r.type});const i=await bte(t,e);return r.signAuthorization(i)}async function Wxe(t,{account:e=t.account,message:n}){if(!e)throw new Mo({docsPath:"/docs/actions/wallet/signMessage"});const r=hn(e);if(r.signMessage)return r.signMessage({message:n});const i=typeof n=="string"?h3(n):n.raw instanceof Uint8Array?Dt(n.raw):n.raw;return t.request({method:"personal_sign",params:[i,r.address]},{retryCount:0})}async function wte(t,e){var u,f,p,y;const{account:n=t.account,chain:r=t.chain,...i}=e;if(!n)throw new Mo({docsPath:"/docs/actions/wallet/signTransaction"});const s=hn(n);gc({account:s,...e});const a=await Ye(t,bc,"getChainId")({});r!==null&&Y6({currentChainId:a,chain:r});const o=(r==null?void 0:r.formatters)||((u=t.chain)==null?void 0:u.formatters),l=((f=o==null?void 0:o.transactionRequest)==null?void 0:f.format)||yc;return s.signTransaction?s.signTransaction({...i,account:s,chainId:a},{serializer:(y=(p=t.chain)==null?void 0:p.serializers)==null?void 0:y.transaction}):await t.request({method:"eth_signTransaction",params:[{...l({...i,account:s},"signTransaction"),chainId:ze(a),from:s.address}]},{retryCount:0})}async function vte(t,e){const{account:n=t.account,domain:r,message:i,primaryType:s}=e;if(!n)throw new Mo({docsPath:"/docs/actions/wallet/signTypedData"});const a=hn(n),o={EIP712Domain:See({domain:r}),...e.types};if(Eee({domain:r,message:i,primaryType:s,types:o}),a.signTypedData)return a.signTypedData({domain:r,message:i,primaryType:s,types:o});const l=Q7e({domain:r,message:i,primaryType:s,types:o});return t.request({method:"eth_signTypedData_v4",params:[a.address,l]},{retryCount:0})}async function qxe(t,{id:e}){await t.request({method:"wallet_switchEthereumChain",params:[{chainId:ze(e)}]},{retryCount:0})}async function Zxe(t,e){return await t.request({method:"wallet_watchAsset",params:e},{retryCount:0})}function Kxe(t){return{addChain:e=>Rxe(t,e),deployContract:e=>jxe(t,e),fillTransaction:e=>JI(t,e),getAddresses:()=>Mxe(t),getCallsStatus:e=>pee(t,e),getCapabilities:e=>Dxe(t,e),getChainId:()=>bc(t),getPermissions:()=>Uxe(t),prepareAuthorization:e=>bte(t,e),prepareTransactionRequest:e=>Q1(t,e),requestAddresses:()=>Bxe(t),requestPermissions:e=>Fxe(t,e),sendCalls:e=>fee(t,e),sendCallsSync:e=>zxe(t,e),sendRawTransaction:e=>$7(t,e),sendRawTransactionSync:e=>PN(t,e),sendTransaction:e=>am(t,e),sendTransactionSync:e=>gte(t,e),showCallsStatus:e=>Vxe(t,e),signAuthorization:e=>Hxe(t,e),signMessage:e=>Wxe(t,e),signTransaction:e=>wte(t,e),signTypedData:e=>vte(t,e),switchChain:e=>qxe(t,e),waitForCallsStatus:e=>mee(t,e),watchAsset:e=>Zxe(t,e),writeContract:e=>$o(t,e),writeContractSync:e=>RN(t,e),token:{approve:c2(t,p1),approveSync:c2(t,$xe),transfer:c2(t,m1),transferSync:c2(t,Oxe)}}}function Gxe(t){const{key:e="wallet",name:n="Wallet Client",transport:r}=t;return gee({...t,key:e,name:n,transport:r,type:"walletClient"}).extend(Kxe)}function Yxe({key:t,methods:e,name:n,request:r,retryCount:i=3,retryDelay:s=150,timeout:a,type:o},l){const u=yee();return{config:{key:t,methods:e,name:n,request:r,retryCount:i,retryDelay:s,timeout:a,type:o},request:M7e(r,{methods:e,retryCount:i,retryDelay:s,uid:u}),value:l}}class Jxe extends Se{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}
489let Xxe=0;const WF=new WeakMap;function Qxe(t){if(!t)return"default";const e=WF.get(t);if(e!==void 0)return e;const n=Xxe++;return WF.set(t,n),n}function y1(t,e={}){const{batch:n,fetchFn:r,fetchOptions:i,key:s="http",maxResponseBodySize:a,methods:o,name:l="HTTP JSON-RPC",onFetchRequest:u,onFetchResponse:f,retryDelay:p,raw:y}=e;return({chain:g,retryCount:b,timeout:v})=>{const{batchSize:_=1e3,wait:C=0}=typeof n=="object"?n:{},S=e.retryCount??b,x=v??e.timeout??1e4,A=t||(g==null?void 0:g.rpcUrls.default.http[0]);if(!A)throw new Jxe;const I=H7e(A,{fetchFn:r,fetchOptions:i,maxResponseBodySize:a,onRequest:u,onResponse:f,timeout:x});return Yxe({key:s,methods:o,name:l,async request({method:$,params:O},P){const j={method:$,params:O},U=P!=null&&P.signal?{signal:P.signal}:void 0,{schedule:z}=oN({id:`${A}.${Qxe(P==null?void 0:P.signal)}`,wait:C,shouldSplitBatch(T){return T.length>_},fn:T=>I.request({body:T,fetchOptions:U}),sort:(T,L)=>T.id-L.id}),D=async T=>n?z(T):[await I.request({body:T,fetchOptions:U})],[{error:R,result:W}]=await D(j);if(y)return{error:R,result:W};if(R)throw new UI({body:j,error:R,url:A});return W},retryCount:S,retryDelay:p,timeout:x,type:"http"},{fetchOptions:i,url:A})}}const x4={0:"legacy",1:"eip2930",2:"eip1559",3:"eip4844",4:"eip7702"},_te={legacy:0,eip2930:1,eip1559:2,eip4844:3,eip7702:4},Ra=t=>t===void 0?void 0:BigInt(t);function A8(t){let{type:e=2,authorizationList:n,...r}=typeof t=="string"?JSON.parse(t):t,i;r.accessList&&Array.isArray(r.accessList)?i=r.accessList.map(f=>Array.isArray(f)?{address:f[0],storageKeys:f[1]}:f):r.accessList&&(i=Object.entries(r.accessList).map(f=>({address:f[0],storageKeys:f[1]})));let s=Number(r.chainId??1),a=Ss(r.data)?r.data:r.data?Dt(Uint8Array.from(r.data)):void 0,o=r.nonce?Number(r.nonce):void 0,l={chainId:s,data:a,nonce:o,value:Ra(r.value),gas:Ra(r.gas??r.gasLimit)},u=Number(e);if(u===0)return{...r,type:x4[u],...l,gasPrice:Ra(r.gasPrice),accessList:void 0,maxFeePerGas:void 0,maxPriorityFeePerGas:void 0};if(u===1)return{...r,type:x4[u],...l,gasPrice:Ra(r.gasPrice),accessList:i,maxFeePerGas:void 0,maxPriorityFeePerGas:void 0};if(u===2)return{...r,type:x4[u],...l,nonce:o,accessList:i,maxFeePerGas:Ra(r.maxFeePerGas),maxPriorityFeePerGas:Ra(r.maxPriorityFeePerGas),gasPrice:void 0,maxFeePerBlobGas:void 0};if(u===4){let f=(n??[]).map(p=>({address:p.address,chainId:Number(p.chainId),nonce:Number(p.nonce),r:p.r,s:p.s,yParity:p.yParity??(p.v===void 0?0:Number(p.v)-27)}));return{...r,type:x4[u],...l,nonce:o,accessList:i,maxFeePerGas:Ra(r.maxFeePerGas),maxPriorityFeePerGas:Ra(r.maxPriorityFeePerGas),authorizationList:f,gasPrice:void 0,maxFeePerBlobGas:void 0}}throw Error(`Unsupported transaction type: ${e}`)}const U7=118,xte="tempo",sE=(t,e)=>{if(t===void 0)return;let n=Number(t);if(!Number.isSafeInteger(n)||n<0)throw Error(`Invalid Tempo ${e}: ${String(t)}`);return n};function Gh(t){if(!t||typeof t!="object")return!1;let e=t.type;if(!(e===118||typeof e=="string"&&e.toLowerCase()==="tempo"))return!1;let n=t.calls;return Array.isArray(n)&&n.length>0}function qF(t){let e;if(typeof t=="string")try{e=JSON.parse(t)}catch(a){let o=a instanceof Error?a.message:String(a);throw Error(`Invalid Tempo transaction JSON: ${o}`)}else e=t;let n;if(e.accessList&&Array.isArray(e.accessList)?n=e.accessList.map(a=>Array.isArray(a)?{address:a[0],storageKeys:a[1]}:a):e.accessList&&(n=Object.entries(e.accessList).map(a=>({address:a[0],storageKeys:a[1]}))),e.chainId===void 0||e.chainId===null)throw Error("Tempo transactions require a chainId");let r=Number(e.chainId);if(!Number.isSafeInteger(r)||r<=0)throw Error(`Invalid Tempo chainId: ${String(e.chainId)}`);let i=sE(e.nonce,"nonce");if(!Array.isArray(e.calls)||e.calls.length===0)throw Error("Tempo transactions require at least one call");let s=e.calls.map(a=>({to:a.to,data:a.data,value:Ra(a.value)}));return{type:xte,chainId:r,from:e.from,nonce:i,gas:Ra(e.gasLimit),maxFeePerGas:Ra(e.maxFeePerGas),maxPriorityFeePerGas:Ra(e.maxPriorityFeePerGas),calls:s,feeToken:e.feeToken,nonceKey:Ra(e.nonceKey),validBefore:sE(e.validBefore,"validBefore"),validAfter:sE(e.validAfter,"validAfter"),feePayerSignature:e.feePayerSignature,accessList:n}}function eCe(t,e){let{chain:n,gas:r,...i}=t;return{...i,...r!==void 0&&e===void 0?{gasLimit:r}:{}}}var aE,ZF;function tCe(){return ZF||(ZF=1,aE=function t(e){if(typeof e=="number"&&isNaN(e))throw new Error("NaN is not allowed");if(typeof e=="number"&&!isFinite(e))throw new Error("Infinity is not allowed");return e===null||typeof e!="object"?JSON.stringify(e):e.toJSON instanceof Function?t(e.toJSON()):Array.isArray(e)?`[${e.reduce((i,s,a)=>`${i}${a===0?"":","}${t(s===void 0||typeof s=="symbol"?null:s)}`,"")}]`:`{${Object.keys(e).sort().reduce((r,i)=>{if(e[i]===void 0||typeof e[i]=="symbol")return r;const s=r.length===0?"":",";return`${r}${s}${t(i)}:${t(e[i])}`},"")}}`}),aE}var nCe=tCe();const rCe=Wa(nCe);/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function jN(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function iCe(t,...e){if(!jN(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function Cte(t,e){return Array.isArray(e)?e.length===0?!0:t?e.every(n=>typeof n=="string"):e.every(n=>Number.isSafeInteger(n)):!1}function F3(t,e){if(typeof e!="string")throw new Error(`${t}: string expected`);return!0}function n5(t){if(!Number.isSafeInteger(t))throw new Error(`invalid integer: ${t}`)}function k8(t){if(!Array.isArray(t))throw new Error("array expected")}function T8(t,e){if(!Cte(!0,e))throw new Error(`${t}
489: array of strings expected`)}function Ete(t,e){if(!Cte(!1,e))throw new Error(`${t}: array of numbers expected`)}function B7(...t){const e=s=>s,n=(s,a)=>o=>s(a(o)),r=t.map(s=>s.encode).reduceRight(n,e),i=t.map(s=>s.decode).reduce(n,e);return{encode:r,decode:i}}function F7(t){const e=typeof t=="string"?t.split(""):t,n=e.length;T8("alphabet",e);const r=new Map(e.map((i,s)=>[i,s]));return{encode:i=>(k8(i),i.map(s=>{if(!Number.isSafeInteger(s)||s<0||s>=n)throw new Error(`alphabet.encode: digit index outside alphabet "${s}". Allowed: ${t}`);return e[s]})),decode:i=>(k8(i),i.map(s=>{F3("alphabet.decode",s);const a=r.get(s);if(a===void 0)throw new Error(`Unknown letter: "${s}". Allowed: ${t}`);return a}))}}function z7(t=""){return F3("join",t),{encode:e=>(T8("join.decode",e),e.join(t)),decode:e=>(F3("join.decode",e),e.split(t))}}function Ste(t,e="="){return n5(t),F3("padding",e),{encode(n){for(T8("padding.encode",n);n.length*t%8;)n.push(e);return n},decode(n){T8("padding.decode",n);let r=n.length;if(r*t%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;r>0&&n[r-1]===e;r--)if((r-1)*t%8===0)throw new Error("padding: invalid, string has too much padding");return n.slice(0,r)}}}function KF(t,e,n){if(e<2)throw new Error(`convertRadix: invalid from=${e}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: invalid to=${n}, base cannot be less than 2`);if(k8(t),!t.length)return[];let r=0;const i=[],s=Array.from(t,o=>{if(n5(o),o<0||o>=e)throw new Error(`invalid integer: ${o}`);return o}),a=s.length;for(;;){let o=0,l=!0;for(let u=r;u<a;u++){const f=s[u],p=e*o,y=p+f;if(!Number.isSafeInteger(y)||p/e!==o||y-f!==p)throw new Error("convertRadix: carry overflow");const g=y/n;o=y%n;const b=Math.floor(g);if(s[u]=b,!Number.isSafeInteger(b)||b*n+o!==y)throw new Error("convertRadix: carry overflow");if(l)b?l=!1:r=u;else continue}if(i.push(o),l)break}for(let o=0;o<t.length-1&&t[o]===0;o++)i.push(0);return i.reverse()}const Ate=(t,e)=>e===0?t:Ate(e,t%e),L8=(t,e)=>t+(e-Ate(t,e)),oE=(()=>{let t=[];for(let e=0;e<40;e++)t.push(2**e);return t})();function GF(t,e,n,r){if(k8(t),e<=0||e>32)throw new Error(`convertRadix2: wrong from=${e}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(L8(e,n)>32)throw new Error(`convertRadix2: carry overflow from=${e} to=${n} carryBits=${L8(e,n)}`);let i=0,s=0;const a=oE[e],o=oE[n]-1,l=[];for(const u of t){if(n5(u),u>=a)throw new Error(`convertRadix2: invalid data word=${u} from=${e}`);if(i=i<<e|u,s+e>32)throw new Error(`convertRadix2: carry overflow pos=${s} from=${e}`);for(s+=e;s>=n;s-=n)l.push((i>>s-n&o)>>>0);const f=oE[s];if(f===void 0)throw new Error("invalid carry");i&=f-1}if(i=i<<n-s&o,!r&&s>=e)throw new Error("Excess padding");if(!r&&i>0)throw new Error(`Non-zero padding: ${i}`);return r&&s>0&&l.push(i>>>0),l}function sCe(t){n5(t);const e=2**8;return{encode:n=>{if(!jN(n))throw new Error("radix.encode input should be Uint8Array");return KF(Array.from(n),e,t)},decode:n=>(Ete("radix.decode",n),Uint8Array.from(KF(n,t,e)))}}function MN(t,e=!1){if(n5(t),t<=0||t>32)throw new Error("radix2: bits should be in (0..32]");if(L8(8,t)>32||L8(t,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!jN(n))throw new Error("radix2.encode input should be Uint8Array");return GF(Array.from(n),8,t,!e)},decode:n=>(Ete("radix2.decode",n),Uint8Array.from(GF(n,t,8,e)))}}const aCe=B7(MN(5),F7("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),Ste(5),z7("")),oCe=typeof Uint8Array.from([]).toBase64=="function"&&typeof Uint8Array.fromBase64=="function",lCe=(t,e)=>{F3("base64",t);const n=/^[A-Za-z0-9=+/]+$/,r="base64";if(t.length>0&&!n.test(t))throw new Error("invalid base64");return Uint8Array.fromBase64(t,{alphabet:r,lastChunkHandling:"strict"})},$0=oCe?{encode(t){return iCe(t),t.toBase64()},decode(t){return lCe(t)}}:B7(MN(6),F7("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),Ste(6),z7("")),cCe=B7(MN(6),F7("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),z7("")),uCe=t=>B7(sCe(58),F7(t),z7("")),kte=uCe("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),dCe=t=>$0.encode(t),hCe=t=>{try{return Uint8Array.from($0.decode(t))}catch(e){if(e instanceof Error&&e.message.includes("string should have whole number of bytes"))return Uint8Array.from(cCe.decode(t));throw e}},fCe=new TextEncoder,pCe=t=>Uint8Array.from(fCe.encode(t)),mCe=new TextDecoder,yCe=new TextDecoder("utf-8",{fatal:!0}),gCe=(t,e)=>(e!=null&&e.fatal?yCe:mCe).decode(t),W0={utf8:{fromBytes:gCe,toBytes:pCe},base64:{fromBytes:dCe,toBytes:hCe}},DN=50000n,YF=w8e*32n,Tte={block:EQ({format(t){var n;const e=(n=t.transactions)==null?void 0:n.map(r=>{var s;if(typeof r=="string")return r;const i=(s=Tte.transaction)==null?void 0:s.format(r);return i.typeHex==="0x71"?i.type="eip712":i.typeHex==="0xff"&&(i.type="priority"),i});return{l1BatchNumber:t.l1BatchNumber?Rn(t.l1BatchNumber):null,l1BatchTimestamp:t.l1BatchTimestamp?Rn(t.l1BatchTimestamp):null,transactions:e}}}),transaction:VI({format(t){const e={};return t.type==="0x71"?e.type="eip712":t.type==="0xff"&&(e.type="priority"),{...e,l1BatchNumber:t.l1BatchNumber?Rn(t.l1BatchNumber):null,l1BatchTxIndex:t.l1BatchTxIndex?Rn(t.l1BatchTxIndex):null}}}),transactionReceipt:cN({format(t){return{l1BatchNumber:t.l1BatchNumber?Rn(t.l1BatchNumber):null,l1BatchTxIndex:t.l1BatchTxIndex?Rn(t.l1BatchTxIndex):null,logs:t.logs.map(e=>({...vl(e),l1BatchNumber:e.l1BatchNumber?Rn(e.l1BatchNumber):null,transactionLogIndex:da(e.transactionLogIndex),logType:e.logType})),l2ToL1Logs:t.l2ToL1Logs.map(e=>({blockNumber:Rn(e.blockHash),blockHash:e.blockHash,l1BatchNumber:e.l1BatchNumber?Rn(e.l1BatchNumber):null,transactionIndex:Rn(e.transactionIndex),shardId:Rn(e.shardId),isService:e.isService,sender:e.sender,key:e.key,value:e.value,transactionHash:e.transactionHash,logIndex:Rn(e.logIndex)}))}}}),transactionRequest:_Q({exclude:["customSignature","factoryDeps","gasPerPubdata","paymaster","paymasterInput"],format(t){return t.gasPerPubdata||t.paymaster&&t.paymasterInput||t.factoryDeps||t.customSignature?{eip712Meta:{...t.gasPerPubdata?{gasPerPubdata:Dt(t.gasPerPubdata)}:{gasPerPubdata:Dt(DN)},...t.paymaster&&t.paymasterInput?{paymasterParams:{paymaster:t.paymaster,paymasterInput:Array.from(Os(t.paymasterInput))}}:{},...t.factoryDeps?{factoryDeps:t.factoryDeps.map(e=>Array.from(Os(e)))}:{},...t.customSignature?{customSignature:Array.from(Os(t.customSignature))}:{}}
489,type:"0x71"}:{}}})};class Lte extends Se{constructor(){super(["Transaction is not an EIP712 transaction.","","Transaction must:",' - include `type: "eip712"`'," - include one of the following: `customSignature`, `paymaster`, `paymasterInput`, `gasPerPubdata`, `factoryDeps`"].join(` 490`),{name:"InvalidEip712TransactionError"})}}function r5(t){return!!(t.type==="eip712"||"customSignature"in t&&t.customSignature||"paymaster"in t&&t.paymaster||"paymasterInput"in t&&t.paymasterInput||"gasPerPubdata"in t&&typeof t.gasPerPubdata=="bigint"||"factoryDeps"in t&&t.factoryDeps)}function $te(t){const{chainId:e,to:n,from:r,paymaster:i,paymasterInput:s}=t;if(!r5(t))throw new Lte;if(!e||e<=0)throw new G6({chainId:e});if(n&&!Yn(n))throw new vi({address:n});if(r&&!Yn(r))throw new vi({address:r});if(i&&!Yn(i))throw new vi({address:i});if(i&&!s)throw new Se("`paymasterInput` must be provided when `paymaster` is defined");if(!i&&s)throw new Se("`paymaster` must be provided when `paymasterInput` is defined")}function bCe(t,e){return r5(t)?vCe(t):U3(t,e)}const wCe={transaction:bCe};function vCe(t){const{chainId:e,gas:n,nonce:r,to:i,from:s,value:a,maxFeePerGas:o,maxPriorityFeePerGas:l,customSignature:u,factoryDeps:f,paymaster:p,paymasterInput:y,gasPerPubdata:g,data:b}=t;$te(t);const v=[r?Dt(r):"0x",l?Dt(l):"0x",o?Dt(o):"0x",n?Dt(n):"0x",i??"0x",a?Dt(a):"0x",b??"0x",Dt(e),Dt(""),Dt(""),Dt(e),s??"0x",Dt(g||DN),f??[],u??"0x",p&&y?[p,y]:[]];return Wi(["0x71",Nu(v)])}class _Ce extends Se{constructor({givenLength:e,maxBytecodeSize:n}){super(`Bytecode cannot be longer than ${n} bytes. Given length: ${e}`,{name:"BytecodeLengthExceedsMaxSizeError"})}}class xCe extends Se{constructor({givenLengthInWords:e}){super(`Bytecode length in 32-byte words must be odd. Given length in words: ${e}`,{name:"BytecodeLengthInWordsMustBeOddError"})}}class CCe extends Se{constructor({givenLength:e}){super(`The bytecode length in bytes must be divisible by 32. Given length: ${e}`,{name:"BytecodeLengthMustBeDivisibleBy32Error"})}}function eT(t){const e=xu(t);if(e.length%32!==0)throw new CCe({givenLength:e.length});if(e.length>YF)throw new _Ce({givenLength:e.length,maxBytecodeSize:YF});const n=$Q(e),r=xu(n),i=e.length/32;if(i%2===0)throw new xCe({givenLengthInWords:i});const s=xu(i),a=D2(s,{size:2}),o=new Uint8Array([1,0]);return r.set(o,0),r.set(a,2),r}const ECe=t=>{$te(t);const e=SCe(t);return{domain:{name:"zkSync",version:"2",chainId:t.chainId},types:{Transaction:[{name:"txType",type:"uint256"},{name:"from",type:"uint256"},{name:"to",type:"uint256"},{name:"gasLimit",type:"uint256"},{name:"gasPerPubdataByteLimit",type:"uint256"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"},{name:"paymaster",type:"uint256"},{name:"nonce",type:"uint256"},{name:"value",type:"uint256"},{name:"data",type:"bytes"},{name:"factoryDeps",type:"bytes32[]"},{name:"paymasterInput",type:"bytes"}]},primaryType:"Transaction",message:e}};function SCe(t){const{gas:e,nonce:n,to:r,from:i,value:s,maxFeePerGas:a,maxPriorityFeePerGas:o,factoryDeps:l,paymaster:u,paymasterInput:f,gasPerPubdata:p,data:y}=t;return{txType:113n,from:BigInt(i),to:r?BigInt(r):0n,gasLimit:e??0n,gasPerPubdataByteLimit:p??DN,maxFeePerGas:a??0n,maxPriorityFeePerGas:o??0n,paymaster:u?BigInt(u):0n,nonce:n?BigInt(n):0n,value:s??0n,data:y??"0x",factoryDeps:(l==null?void 0:l.map(g=>Dt(eT(g))))??[],paymasterInput:f||"0x"}}const Ite={blockTime:1e3,formatters:Tte,serializers:wCe,custom:{getEip712Domain:ECe}},ACe=xi({...Ite,blockTime:200,id:2741,name:"Abstract",nativeCurrency:{decimals:18,name:"ETH",symbol:"ETH"},rpcUrls:{default:{http:["https://api.mainnet.abs.xyz"],webSocket:["wss://api.mainnet.abs.xyz/ws"]}},blockExplorers:{default:{name:"Etherscan",url:"https://abscan.org"},native:{name:"Abstract Explorer",url:"https://explorer.mainnet.abs.xyz"}},contracts:{multicall3:{address:"0xAa4De41dba0Ca5dCBb288b7cC6b708F3aaC759E7",blockCreated:5288},erc6492Verifier:{address:"0xfB688330379976DA81eB64Fe4BF50d7401763B9C",blockCreated:5263}}}),kCe=xi({...Ite,blockTime:200,id:11124,name:"Abstract Testnet",nativeCurrency:{decimals:18,name:"ETH",symbol:"ETH"},rpcUrls:{default:{http:["https://api.testnet.abs.xyz"]}},blockExplorers:{default:{name:"Etherscan",url:"https://sepolia.abscan.org"},native:{name:"Abstract Explorer",url:"https://explorer.testnet.abs.xyz"}},testnet:!0,contracts:{multicall3:{address:"0xF9cda624FBC7e059355ce98a31693d299FACd963",blockCreated:358349},erc6492Verifier:{address:"0xfB688330379976DA81eB64Fe4BF50d7401763B9C",blockCreated:431682}}}),TCe={gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"}
490,l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}},LCe={block:EQ({format(t){var n;return{transactions:(n=t.transactions)==null?void 0:n.map(r=>{if(typeof r=="string")return r;const i=X1(r);return i.typeHex==="0x7e"&&(i.isSystemTx=r.isSystemTx,i.mint=r.mint?Rn(r.mint):void 0,i.sourceHash=r.sourceHash,i.type="deposit"),i}),stateRoot:t.stateRoot}}}),transaction:VI({format(t){const e={};return t.type==="0x7e"&&(e.isSystemTx=t.isSystemTx,e.mint=t.mint?Rn(t.mint):void 0,e.sourceHash=t.sourceHash,e.type="deposit"),e}}),transactionReceipt:cN({format(t){return{...t.depositNonce?{depositNonce:Rn(t.depositNonce)}:{},...t.depositReceiptVersion?{depositReceiptVersion:da(t.depositReceiptVersion)}:{},l1GasPrice:t.l1GasPrice?Rn(t.l1GasPrice):null,l1GasUsed:t.l1GasUsed?Rn(t.l1GasUsed):null,l1Fee:t.l1Fee?Rn(t.l1Fee):null,l1FeeScalar:t.l1FeeScalar?Number(t.l1FeeScalar):null}}})};function $Ce(t,e){return OCe(t)?NCe(t):U3(t,e)}const ICe={transaction:$Ce};function NCe(t){PCe(t);const{sourceHash:e,data:n,from:r,gas:i,isSystemTx:s,mint:a,to:o,value:l}=t,u=[e,r,o??"0x",a?Dt(a):"0x",l?Dt(l):"0x",i?Dt(i):"0x",s?"0x1":"0x",n??"0x"];return Wi(["0x7e",Nu(u)])}function OCe(t){return t.type==="deposit"||typeof t.sourceHash<"u"}function PCe(t){const{from:e,to:n}=t;if(e&&!Yn(e))throw new vi({address:e});if(n&&!Yn(n))throw new vi({address:n})}const $8={blockTime:2e3,contracts:TCe,formatters:LCe,serializers:ICe},RCe=xi({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}}}),jCe=xi({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}}}),MCe=xi({id:43113,name:"Avalanche Fuji",nativeCurrency:{decimals:18,name:"Avalanche Fuji",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax-test.network/ext/bc/C/rpc"]}},blockExplorers:{default:{name:"SnowTrace",url:"https://testnet.snowtrace.io",apiUrl:"https://api-testnet.snowtrace.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7096959}},testnet:!0}),Ey=1,UN=xi({...$8,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:{...$8.contracts,disputeGameFactory:{[Ey]:{address:"0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e"}},l2OutputOracle:{[Ey]:{address:"0x56315b90c40730925ec5485cf004d835058518A0"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:5022},portal:{[Ey]:{address:"0x49048044D57e1C92A77f79988d21Fa8fAF74E97e",blockCreated:17482143}},l1StandardBridge:{[Ey]:{address:"0x3154Cf16ccdb4C6d922629664174b904d80F2C35",blockCreated:17482143}}},sourceId:Ey});({...UN});const Sy=11155111,Nte=xi({...$8,id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://sepolia.basescan.org",apiUrl:"https://api-sepolia.basescan.org/api"}},contracts:{...$8.contracts,disputeGameFactory:{[Sy]:{address:"0xd6E6dBf4F7EA0ac412fD8b65ED297e64BB7a06E1"}},l2OutputOracle:{[Sy]:{address:"0x84457ca9D0163FbC4bbfe4Dfbb20ba46e48DF254"}},portal:{[Sy]:{address:"0x49f53e41452c74589e85ca1677426ba426459e85",blockCreated:4446677}},l1StandardBridge:{[Sy]:{address:"0xfd0Bf71F60660E2f608ed56e1659C450eB113120",blockCreated:4446677}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1059647}},testnet:!0,sourceId:Sy});({...Nte});const DCe=xi({id:41923,name:"EDU Chain",nativeCurrency:{decimals:18,name:"EDU",symbol:"EDU"},rpcUrls:{default:{http:["https://rpc.educhain.xyz"],webSocket:["wss://rpc.educhain.xyz"]}},blockExplorers:{default:{name:"EDU Chain Explorer",url:"https://explorer.educhain.xyz/"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:16410660}},testnet:!1}),UCe=xi({id:4689,name:"IoTeX",nativeCurrency:{decimals:18,name:"IoTeX",symbol:"IOTX"},rpcUrls:{default:{http:["https://babel-api.mainnet.iotex.io"],webS
490ocket:["wss://babel-api.mainnet.iotex.io"]}},blockExplorers:{default:{name:"IoTeXScan",url:"https://iotexscan.io"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:22163670}}}),BCe=xi({id:4690,name:"IoTeX Testnet",nativeCurrency:{decimals:18,name:"IoTeX",symbol:"IOTX"},rpcUrls:{default:{http:["https://babel-api.testnet.iotex.io"],webSocket:["wss://babel-api.testnet.iotex.io"]}},blockExplorers:{default:{name:"IoTeXScan",url:"https://testnet.iotexscan.io"}},contracts:{multicall3:{address:"0xb5cecD6894c6f473Ec726A176f1512399A2e355d",blockCreated:24347592}},testnet:!0}),FCe=xi({id:3338,name:"Peaq",nativeCurrency:{decimals:18,name:"peaq",symbol:"PEAQ"},rpcUrls:{default:{http:["https://quicknode1.peaq.xyz","https://quicknode2.peaq.xyz","https://quicknode3.peaq.xyz"],webSocket:["wss://quicknode1.peaq.xyz","wss://quicknode2.peaq.xyz","wss://quicknode3.peaq.xyz"]}},blockExplorers:{default:{name:"Subscan",url:"https://peaq.subscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:3566354}}}),tT=xi({id:137,name:"Polygon",blockTime:2e3,nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{default:{http:["https://polygon.drpc.org"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://polygonscan.com",apiUrl:"https://api.etherscan.io/v2/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}}}),zCe=xi({id:80002,name:"Polygon Amoy",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{default:{http:["https://polygon-amoy.drpc.org"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://amoy.polygonscan.com",apiUrl:"https://api.etherscan.io/v2/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:3127388}},testnet:!0}),VCe=xi({id:1329,name:"Sei Network",nativeCurrency:{name:"Sei",symbol:"SEI",decimals:18},rpcUrls:{default:{http:["https://evm-rpc.sei-apis.com/"],webSocket:["wss://evm-ws.sei-apis.com/"]}},blockExplorers:{default:{name:"Seiscan",url:"https://seiscan.io",apiUrl:"https://api.etherscan.io/v2/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11"}}}),HCe=xi({id:1328,name:"Sei Testnet",nativeCurrency:{name:"Sei",symbol:"SEI",decimals:18},rpcUrls:{default:{http:["https://evm-rpc-testnet.sei-apis.com"],webSocket:["wss://evm-ws-testnet.sei-apis.com"]}},blockExplorers:{default:{name:"Seiscan",url:"https://testnet.seiscan.io",apiUrl:"https://api.etherscan.io/v2/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:98697651}},testnet:!0}),WCe=xi({id:1514,name:"Data Network",nativeCurrency:{decimals:18,name:"DATA",symbol:"DATA"},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:340998},ensRegistry:{address:"0x5dc881dda4e4a8d312be3544ad13118d1a04cb17",blockCreated:648924},ensUniversalResolver:{address:"0xddfb18888a9466688235887dec2a10c4f5effee9",blockCreated:649114}},rpcUrls:{default:{http:["https://mainnet.datarpc.io"]}},blockExplorers:{default:{name:"Data Network explorer",url:"https://datanetscan.io",apiUrl:"https://datanetscan.io/api/v2"}},ensTlds:[".ip"],testnet:!1});/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ote=om(BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff")),qCe=Ote.create(BigInt("-3")),ZCe=BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),KCe=P7({a:qCe,b:ZCe,Fp:Ote,n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),Gy:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5"),h:BigInt(1),lowS:!1},KI),Pte=om(BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff")),GCe=Pte.create(BigInt("-3")),YCe=BigInt("0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef");P7({a:GCe,b:YCe,Fp:Pte,n:BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973"),Gx:BigInt("0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7"),Gy:BigInt("0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f"),h:BigInt(1),lowS:!1},O8e);const Rte=om(BigInt("0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")),JCe=Rte.create(BigInt("-3")),XCe=BigInt("0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00");P7({a:JCe,b:XCe,Fp:Rte,n:BigInt("0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409"),Gx:BigInt("0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66"),Gy:BigInt("0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650"),h:BigInt(1),lowS:!1,allowedPrivateKeyLengths:[130,131,132]},N8e);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const QCe=KCe;function jte(t){const{hash:e,payload:n,publicKey:r,signature:i}=t;return QCe.verify(i,n instanceof Uint8Array?n:F2(n),gN(r).substring(2),{lowS:!0,...e?{prehash:!0}:{}})}const eEe=new TextEncoder;Array.from("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
490+/").map((t,e)=>[e,t.charCodeAt(0)]);const C4={...Object.fromEntries(Array.from("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/").map((t,e)=>[t.charCodeAt(0),e])),61:0,45:62,95:63};function tEe(t){const e=t.replace(/=+$/,""),n=e.length,r=new Uint8Array(n+3);eEe.encodeInto(e+"===",r);for(let s=0,a=0;s<e.length;s+=4,a+=3){const o=(C4[r[s]]<<18)+(C4[r[s+1]]<<12)+(C4[r[s+2]]<<6)+C4[r[s+3]];r[a]=o>>16,r[a+1]=o>>8&255,r[a+2]=o&255}const i=(n>>2)*3+(n%4&&n%4-1);return new Uint8Array(r.buffer,0,i)}function nEe(t){const{challenge:e,metadata:n,origin:r,publicKey:i,rpId:s,signature:a}=t,{authenticatorData:o,clientDataJSON:l,userVerificationRequired:u}=n,f=F2(o);if(f.length<37)return!1;if(s!==void 0){const v=f.slice(0,32),_=AF(z2(s),{as:"Bytes"});if(!ive(v,_))return!1}const p=f[32];if((p&1)!==1||u&&(p&4)!==4||(p&8)!==8&&(p&16)===16)return!1;const y=JSON.parse(l);if(y.type!=="webauthn.get"||!y.challenge||Oi(tEe(y.challenge))!==e||r!==void 0&&!(Array.isArray(r)?r:[r]).includes(y.origin))return!1;const g=AF(WQ(l),{as:"Bytes"}),b=nve(f,g);return jte({hash:!0,payload:b,publicKey:i,signature:a})}function rEe(t){return nEe(t)}const iEe=50,Mte=8,I8=Mte,N8=2,O8=2049,sEe="0x05",um=`0x${"00".repeat(32)}`,aEe="tempo:multisig:account",oEe="tempo:multisig:signature";function V7(t){const{salt:e,threshold:n,owners:r}=t;if(typeof e<"u"&&Vn(e)!==32)throw new $a({reason:"salt must be 32 bytes"});if(r.length===0)throw new $a({reason:"owners cannot be empty"});if(r.length>iEe)throw new $a({reason:"too many owners"});if(!Number.isInteger(Number(n)))throw new $a({reason:"threshold must be an integer"});if(Number(n)<1)throw new $a({reason:"threshold cannot be zero"});if(Number(n)>Mte)throw new $a({reason:"threshold exceeds max threshold"});let i=0,s;for(const a of r){if(!L2(a.owner)||nr(a.owner)===0n)throw new $a({reason:"owner cannot be zero"});if(!Number.isInteger(Number(a.weight)))throw new $a({reason:"owner weight must be an integer"});if(Number(a.weight)<1)throw new $a({reason:"owner weight cannot be zero"});const o=nr(a.owner);if(typeof s<"u"&&s>=o)throw new $a({reason:"owners must be strictly ascending"});s=o,i+=Number(a.weight)}if(i>255)throw new $a({reason:"total owner weight exceeds u8 max"});if(Number(n)>i)throw new $a({reason:"threshold exceeds total owner weight"})}function H7(t){const e=[...t.owners].sort((r,i)=>nr(r.owner)<nr(i.owner)?-1:1),n={salt:t.salt?_l(t.salt,32):um,threshold:t.threshold,owners:e};return V7(n),n}function lEe(t){const[e,n,r]=t;return{salt:e&&e!=="0x"?_l(e,32):um,threshold:n==="0x"?0:h1(n),owners:r.map(i=>{const[s,a]=i;return{owner:s,weight:!a||a==="0x"?0:h1(a)}})}}function dm(t){V7(t);const e=qu(fr(z2(aEe),_l(t.salt??um,32),He(t.threshold,{size:1}),He(t.owners.length,{size:1}),...t.owners.flatMap(r=>[r.owner,He(r.weight,{size:1})]))),n=Pee(tn(e,12,32));if(nr(n)===0n)throw new $a({reason:"derived account cannot be zero"});return n}function BN(t){const{payload:e,version:n=0n}=t,r="account"in t&&t.account?t.account:dm(t.initialConfig);return qu(fr(z2(oEe),K6(e),r,He(n,{size:8})))}function cEe(t){V7(t);const e=t.owners.map(r=>[r.owner,He(r.weight)]);return[t.salt?_l(t.salt,32):um,He(t.threshold),e]}class $a extends ut{constructor({reason:e}){super(`Invalid native multisig config: ${e}.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MultisigConfig.InvalidConfigError"})}}const nT="0x01",rT="0x02",iT="0x03",kw="0x04",sT="0x05",Rh="0x7777777777777777777777777777777777777777777777777777777777777777";function i5(t){var n,r,i,s;const e=a5(t);if(e==="secp256k1"){Q6(t.signature);return}if(e==="p256"){const a=t,o=[];if(typeof((n=a.signature)==null?void 0:n.r)!="bigint"&&o.push("signature.r"),typeof((r=a.signature)==null?void 0:r.s)!="bigint"&&o.push("signature.s"),typeof a.prehash!="boolean"&&o.push("prehash"),a.publicKey?(typeof a.publicKey.x!="bigint"&&o.push("publicKey.x"),typeof a.publicKey.y!="bigint"&&o.push("publicKey.y")):o.push("publicKey"),o.length>0)throw new lT({envelope:t,missing:o,type:"p256"});return}if(e==="webAuthn"){const a=t,o=[];if(typeof((i=a.signature)==null?void 0:i.r)!="bigint"&&o.push("signature.r"),typeof((s=a.signature)==null?void 0:s.s)!="bigint"&&o.push("signature.s"),a.metadata?(a.metadata.authenticatorData||o.push("metadata.authenticatorData"),a.metadata.clientDataJSON||o.push("metadata.clientDataJSON")):o.push("metadata"),a.publicKey?(typeof a.publicKey.x!="bigint"&&o.push("publicKey.x"),typeof a.publicKey.y!="bigint"&&o.push("publicKey.y")):o.push("publicKey"),o.length>0)throw new lT({envelope:t,missing:o,type:"webAuthn"});return}if(e==="keychain"){i5(t.inner);return}if(e==="multisig"){FN(t,1);return}}function FN(t,e){const n=[];if(t.account||n.push("account"),Array.isArray(t.signatures)||n.push("signatures"),n.length>0)throw new lT({envelope:t,missing:n,type:"multisig"});if(e>N8)throw new Bl({reason:`multisig nesting depth exceeds ${N8}`});if(!L2(t.account))throw new Bl({reason:"multisig account is invali
490d"});if(nr(t.account)===0n)throw new Bl({reason:"multisig account cannot be zero"});if(t.signatures.length===0)throw new Bl({reason:"multisig signatures cannot be empty"});if(t.signatures.length>I8)throw new Bl({reason:`multisig signatures exceed ${I8}`});if(t.init&&(V7(t.init),!u2(dm(t.init),t.account)))throw new Bl({reason:"multisig init does not derive account"});for(const r of t.signatures){const i=a5(r);if(i==="keychain")throw new Bl({reason:"keychain owner approvals are not allowed"});if(i==="multisig"){const s=r;if(s.init)throw new Bl({reason:"nested multisig owner approvals cannot carry `init`"});FN(s,e+1)}else if(i5(r),Vn(Af(r))>O8)throw new Bl({reason:`multisig owner signature exceeds ${O8} bytes`})}}function hm(t){const{signature:e,root:n}=t;return e.type==="keychain"?n?e.userAddress:hm({...t,signature:e.inner}):e.type==="multisig"?e.account:b2(Dte(t))}function Dte(t){const{payload:e,signature:n}=t;switch(n.type){case"secp256k1":return ate({payload:e,signature:n.signature});case"p256":case"webAuthn":return n.publicKey;case"keychain":return Dte({payload:e,signature:n.inner});case"multisig":throw new g1({envelope:n})}}function s5(t){return aT(t,0)}function aT(t,e){const n=t.endsWith(Rh.slice(2))?tn(t,0,-Vn(Rh)):t;if(Vn(n)===65){const o=SN(n);return Q6(o),{signature:o,type:"secp256k1"}}const i=tn(n,0,1),s=tn(n,1),a=Vn(s);if(i===nT){if(a!==129)throw new Ia({reason:`Invalid P256 signature envelope size: expected 129 bytes, got ${a} bytes`,serialized:n});return{publicKey:{prefix:4,x:nr(tn(s,64,96)),y:nr(tn(s,96,128))},prehash:h1(tn(s,128,129))!==0,signature:{r:nr(tn(s,0,32)),s:nr(tn(s,32,64))},type:"p256"}}if(i===rT){if(a<128)throw new Ia({reason:`Invalid WebAuthn signature envelope size: expected at least 128 bytes, got ${a} bytes`,serialized:n});const o=a-128,l=tn(s,0,o);let u,f;for(let p=37;p<o;p++){const y=JQ(tn(l,p));if(y.startsWith("{")&&y.endsWith("}"))try{JSON.parse(y),u=tn(l,0,p),f=y;break}catch{}}if(!u||!f)throw new Ia({reason:"Unable to parse WebAuthn metadata: could not extract valid authenticatorData and clientDataJSON",serialized:n});return{publicKey:{prefix:4,x:nr(tn(s,o+64,o+96)),y:nr(tn(s,o+96,o+128))},metadata:{authenticatorData:u,clientDataJSON:f},signature:{r:nr(tn(s,o,o+32)),s:nr(tn(s,o+32,o+64))},type:"webAuthn"}}if(i===iT||i===kw){const o=tn(s,0,20),l=aT(tn(s,20),e);return{userAddress:o,inner:l,type:"keychain",version:i===kw?"v2":"v1"}}if(i===sT){const o=e+1;if(o>N8)throw new Ia({reason:`multisig nesting depth exceeds ${N8}`,serialized:n});const l=Bee(s);if(!Array.isArray(l)||l.length!==2)throw new Ia({reason:"invalid multisig wire shape: expected exactly two fields",serialized:n});const[u,f]=l;if(!Array.isArray(f)||f.some(Array.isArray))throw new Ia({reason:"invalid multisig signatures list",serialized:n});if(f.length===0)throw new Ia({reason:"multisig signatures cannot be empty",serialized:n});if(f.length>I8)throw new Ia({reason:`multisig signatures exceed ${I8}`,serialized:n});for(const b of f)if(Vn(b)>O8&&tn(b,0,1)!==sEe)throw new Ia({reason:`multisig owner signature exceeds ${O8} bytes`,serialized:n});if(!Array.isArray(u)&&!L2(u))throw new Ia({reason:"invalid multisig account",serialized:n});if(Array.isArray(u)){const[b,v,_]=u;if(u.length!==3||Array.isArray(b)||Vn(b)!==32||Array.isArray(v)||Vn(v)>1||!Array.isArray(_)||_.some(C=>!Array.isArray(C)||C.length!==2||C.some(Array.isArray)||Vn(C[1])>1))throw new Ia({reason:"invalid multisig init config",serialized:n})}const p=Array.isArray(u)?lEe(u):void 0,g={type:"multisig",account:p?dm(p):u,signatures:f.map(b=>aT(b,o)),...p?{init:p}:{}};return FN(g,o),g}throw new Ia({reason:`Unknown signature type identifier: ${i}. Expected ${nT} (P256), ${rT} (WebAuthn), ${iT} (Keychain V1), ${kw} (Keychain V2), or ${sT} (Multisig)`,serialized:n})}function Ns(t,e){if(typeof t=="string")return s5(t);if(typeof t=="object"&&t!==null&&"r"in t&&"s"in t&&"yParity"in t)return{signature:t,type:"secp256k1"};const n=a5(t);if(n==="multisig"){const r=t,{initialConfig:i,init:s,...a}=r,o=a.account?a.account:i?dm(i):a.account,l=s===!0?i:s||void 0;return{...a,account:o,signatures:a.signatures.map(u=>Ns(u)),...l?{init:H7(l)}:{},type:n}}return{...t,...n==="p256"?{prehash:t.prehash}:{},...n==="keychain"?{...typeof t=="object"&&t!==null&&"version"in t&&t.version?{}:{version:"v2"}
490,...typeof t=="object"&&"keyId"in t&&t.keyId?{}:(()=>{const r=t.inner;return r.type==="p256"||r.type==="webAuthn"?{keyId:b2(r.publicKey)}:(r.type==="secp256k1"&&(e!=null&&e.payload),{})})()}:{},type:n}}function z3(t){if(t.type==="secp256k1")return{signature:AN(t),type:"secp256k1"};if(t.type==="p256")return{prehash:t.preHash,publicKey:{prefix:4,x:nr(t.pubKeyX),y:nr(t.pubKeyY)},signature:{r:nr(t.r),s:nr(t.s)},type:"p256"};if(t.type==="webAuthn"){const e=t.webauthnData,n=Vn(e);let r,i;for(let s=37;s<n;s++){const a=JQ(tn(e,s));if(a.startsWith("{")&&a.endsWith("}"))try{JSON.parse(a),r=tn(e,0,s),i=a;break}catch{}}if(!r||!i)throw new Ia({reason:"Unable to parse WebAuthn metadata: could not extract valid authenticatorData and clientDataJSON",serialized:e});return{metadata:{authenticatorData:r,clientDataJSON:i},publicKey:{prefix:4,x:nr(t.pubKeyX),y:nr(t.pubKeyY)},signature:{r:nr(t.r),s:nr(t.s)},type:"webAuthn"}}if(t.type==="keychain"||"userAddress"in t&&"signature"in t){const e=t;return{type:"keychain",userAddress:e.userAddress,inner:z3(e.signature),...e.keyId?{keyId:e.keyId}:{},...e.version?{version:e.version}:{}}}if(t.type==="multisig"||"signatures"in t&&("account"in t||"init"in t)){const e=t,n=typeof e.account<"u",r=typeof e.init<"u";if(n===r)throw new Bl({reason:"RPC multisig must contain exactly one of `account` or `init`"});const i=r?H7(e.init):void 0,a={type:"multisig",account:i?dm(i):e.account,signatures:e.signatures.map(o=>z3(o)),...i?{init:i}:{}};return i5(a),a}throw new g1({envelope:t})}function a5(t){if(typeof t!="object"||t===null)throw new g1({envelope:t});if("type"in t&&t.type)return t.type;if("signature"in t&&!("publicKey"in t)&&typeof t.signature=="object"&&t.signature!==null&&"r"in t.signature&&"s"in t.signature&&"yParity"in t.signature||"r"in t&&"s"in t&&"yParity"in t)return"secp256k1";if("signature"in t&&"prehash"in t&&"publicKey"in t&&typeof t.prehash=="boolean")return"p256";if("signature"in t&&"metadata"in t&&"publicKey"in t)return"webAuthn";if("userAddress"in t&&"inner"in t)return"keychain";if(("account"in t||"initialConfig"in t||"init"in t)&&"signatures"in t)return"multisig";throw new g1({envelope:t})}function Af(t,e={}){const n=a5(t);if(n==="secp256k1")return fr(b_e(t.signature),e.magic?Rh:"0x");if(n==="p256"){const r=t;return fr(nT,He(r.signature.r,{size:32}),He(r.signature.s,{size:32}),He(r.publicKey.x,{size:32}),He(r.publicKey.y,{size:32}),He(r.prehash?1:0,{size:1}),e.magic?Rh:"0x")}if(n==="webAuthn"){const r=t,i=fr(r.metadata.authenticatorData,z2(r.metadata.clientDataJSON));return fr(rT,i,He(r.signature.r,{size:32}),He(r.signature.s,{size:32}),He(r.publicKey.x,{size:32}),He(r.publicKey.y,{size:32}),e.magic?Rh:"0x")}if(n==="keychain"){const r=t,i=r.version==="v1"?iT:kw;return fr(i,r.userAddress,Af(r.inner),e.magic?Rh:"0x")}if(n==="multisig"){const r=t;return i5(r),fr(sT,EN([r.init?cEe(r.init):r.account,r.signatures.map(i=>Af(i))]),e.magic?Rh:"0x")}throw new g1({envelope:t})}function oT(t){const{payload:e,signatures:n,version:r=0n}=t,i=BN("initialConfig"in t&&t.initialConfig?{payload:e,initialConfig:t.initialConfig,version:r}:{payload:e,account:t.account,version:r});return n.map(s=>({key:nr(hm({payload:i,signature:s})),signature:s})).sort((s,a)=>s.key<a.key?-1:s.key>a.key?1:0).map(s=>s.signature)}function P8(t){const e=a5(t);if(e==="secp256k1")return{...rte(t.signature),type:"secp256k1"};if(e==="p256"){const n=t;return{preHash:n.prehash,pubKeyX:He(n.publicKey.x,{size:32}),pubKeyY:He(n.publicKey.y,{size:32}),r:He(n.signature.r,{size:32}),s:He(n.signature.s,{size:32}),type:"p256"}}if(e==="webAuthn"){const n=t,r=fr(n.metadata.authenticatorData,z2(n.metadata.clientDataJSON));return{pubKeyX:He(n.publicKey.x,{size:32}),pubKeyY:He(n.publicKey.y,{size:32}),r:He(n.signature.r,{size:32}),s:He(n.signature.s,{size:32}),type:"webAuthn",webauthnData:r}}if(e==="keychain"){const n=t;return{type:"keychain",userAddress:n.userAddress,signature:P8(n.inner),...n.keyId?{keyId:n.keyId}:{},...n.version?{version:n.version}:{}}}if(e==="multisig"){const n=t;i5(n);const r=n.signatures.map(i=>P8(i));return n.init?{init:{...n.init,salt:n.init.salt??um,threshold:Number(n.init.threshold),owners:n.init.owners.map(s=>({...s,weight:Number(s.weight)}))},signatures:r}:{account:n.account,signatures:r}}throw new g1({envelope:t})}function JF(t,e){const{payload:n}=e,r=(()=>
490{if(e.address)return e.address;if(e.publicKey)return b2(e.publicKey)})();if(!r)return!1;const i=Ns(t);if(i.type==="secp256k1")return r?T_e({address:r,payload:n,signature:i.signature}):!1;if(i.type==="p256"){const s=b2(i.publicKey);return u2(s,r)?jte({hash:i.prehash,publicKey:i.publicKey,payload:n,signature:i.signature}):!1}if(i.type==="webAuthn"){const s=b2(i.publicKey);return u2(s,r)?rEe({challenge:K6(n),metadata:i.metadata,publicKey:i.publicKey,signature:i.signature}):!1}throw new uEe(`Unable to verify signature envelope of type "${i.type}".`)}class g1 extends ut{constructor({envelope:e}){super(`Unable to coerce value (\`${tm(e)}\`) to a valid signature envelope.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureEnvelope.CoercionError"})}}class lT extends ut{constructor({envelope:e,missing:n,type:r}){super(`Signature envelope of type "${r}" is missing required properties: ${n.map(i=>`\`${i}\``).join(", ")}. 491 492Provided: ${tm(e)}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureEnvelope.MissingPropertiesError"})}}let Ia=class extends ut{constructor({reason:e,serialized:n}){super(`Unable to deserialize signature envelope: ${e}`,{metaMessages:[`Serialized: ${n}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureEnvelope.InvalidSerializedError"})}};class Bl extends ut{constructor({reason:e}){super(`Invalid native multisig owner approval: ${e}.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureEnvelope.InvalidMultisigApprovalError"})}}class uEe extends ut{constructor(){super(...arguments),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureEnvelope.VerificationError"})}}function ia(t){return t.startsWith("tempo")?dEe(t).address:t}function dEe(t){if(!t.startsWith("tempox"))throw new hEe({address:t});const e=t.slice(6);return KQ(e,{strict:!0}),{address:O7(e)}}let hEe=class extends ut{constructor({address:e}){super(`Tempo address "${e}" has an invalid prefix. Expected "tempox".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TempoAddress.InvalidPrefixError"})}};function fEe(t,e={}){if(typeof t.chainId=="string")return Ute(t);const n={...t,address:ia(t.address)};return e.signature?{...n,signature:e.signature}:n}function Ute(t){const{address:e,chainId:n,nonce:r}=t,i=z3(t.signature);return{address:e,chainId:Number(n),nonce:BigInt(r),signature:i}}function pEe(t){return t.map(e=>Ute(e))}function mEe(t){const[e,n,r,i]=t,s={address:n,chainId:e==="0x"?0:Number(e),nonce:r==="0x"?0n:BigInt(r)};return i&&(s.signature=s5(i)),fEe(s)}function yEe(t){const e=[];for(const n of t)e.push(mEe(n));return e}function gEe(t){const{address:e,chainId:n,nonce:r,signature:i}=t;return{address:e,chainId:He(n),nonce:He(r),signature:P8(i)}}function bEe(t){return t.map(e=>gEe(e))}function wEe(t){const{address:e,chainId:n,nonce:r}=t,i=t.signature?Af(t.signature):void 0;return[n?He(n):"0x",e,r?He(r):"0x",...i?[i]:[]]}function vEe(t){if(!t||t.length===0)return[];const e=[];for(const n of t)e.push(wEe(n));return e}const _Ee="0x20c0";function Bte(t){if(typeof t=="string"){const n=ia(t);return xl(n),n}const e=He(t,{size:18});return fr(_Ee,e)}function Fte(t,e={}){if("keyId"in t)return zte(t);const n=t;n.witness!==void 0&&o5(n.witness),n.signature&&b1(n.signature);const r={...n,address:ia(n.address),...n.limits?{limits:n.limits.map(i=>({...i,token:ia(i.token)}))}:{},...n.scopes?{scopes:n.scopes.map(i=>({...i,address:ia(i.address),selector:zN(i.selector),...i.recipients?{recipients:i.recipients.map(s=>ia(s))}:{}}))}:{}};if(e.signature){const i=Ns(e.signature);return b1(i),{...r,signature:i}}return r}function zte(t){const{allowedCalls:e,chainId:n,keyId:r,expiry:i,limits:s,keyType:a}=t,o=t.witness??void 0,l=t.isAdmin??void 0,u=t.account??void 0,f=z3(t.signature);b1(f),o!==void 0&&o5(o);const p=e?e.flatMap(g=>!g.selectorRules||g.selectorRules.length===0?[{address:g.target}]:g.selectorRules.map(b=>({address:g.target,selector:kEe(b.selector),...b.recipients&&b.recipients.length>0?{recipients:b.recipients}:{}}
492))):void 0,y=u!==void 0?{account:u,isAdmin:l??!1}:{};return{address:r,chainId:n==="0x"?0n:nr(n),...i!=null?{expiry:Number(i)}:{},limits:s==null?void 0:s.map(g=>({token:g.token,limit:BigInt(g.limit),...g.period&&R8(g.period)>0?{period:R8(g.period)}:{}})),...p?{scopes:p}:{},signature:f,type:a,...o!==void 0?{witness:o}:{},...y}}function xEe(t){const[e,n]=t,[r,i,s,...a]=e,o=(()=>{switch(i){case"0x":case"0x00":return"secp256k1";case"0x01":return"p256";case"0x02":return"webAuthn";default:throw new Error(`Invalid key type: ${i}`)}})(),[l,u,f,p,y,g]=a,b=E4(l)?void 0:R8(l)||void 0,v=Array.isArray(u)&&u.length>0?u.map($=>{const[O,P,j]=$;return{token:O,limit:AEe(P),...j!==void 0?{period:R8(j)}:{}}}):void 0,_=Array.isArray(f)?f.flatMap($=>{const[O,P]=$;return!Array.isArray(P)||P.length===0?[{address:O}]:P.map(j=>{const[U,z]=j;return{address:O,selector:U,...Array.isArray(z)&&z.length>0?{recipients:z}:{}}})}):void 0,C=E4(p)?void 0:p;C!==void 0&&o5(C);const S=(()=>{if(!E4(y)){if(y!=="0x01")throw new LEe(y);return!0}})(),x=E4(g)?void 0:g,A=x!==void 0?{account:x,isAdmin:S??!1}:{},I={address:s,chainId:r==="0x"?0n:nr(r),type:o,...b!==void 0?{expiry:b}:{},...v!==void 0?{limits:v}:{},..._!==void 0?{scopes:_}:{},...C!==void 0?{witness:C}:{},...A};if(n){const $=s5(n);b1($),I.signature=$}return Fte(I)}function CEe(t){return EEe(t)}function EEe(t){const[e]=Vte(t),n=EN(e);return qu(n)}function SEe(t){const{address:e,scopes:n,chainId:r,expiry:i,limits:s,type:a,signature:o,witness:l,isAdmin:u,account:f}=t;b1(o),l!==void 0&&o5(l);const p=(()=>
492{if(!n)return;const y=new Map;for(const g of n){const b=g.address;y.has(b)||y.set(b,[]),g.selector&&y.get(b).push({selector:zN(g.selector),...g.recipients&&g.recipients.length>0?{recipients:g.recipients}:{}})}return[...y.entries()].map(([g,b])=>({target:g,...b.length>0?{selectorRules:b}:{}}))})();return{chainId:r===0n?"0x":He(r),expiry:typeof i=="number"?He(i):null,keyId:ia(e),keyType:a,limits:s==null?void 0:s.map(({token:y,limit:g,period:b})=>({token:y,limit:He(g),...b?{period:cT(b)}:{}})),signature:P8(o),...p?{allowedCalls:p}:{},...l!==void 0?{witness:l}:{},...u?{isAdmin:!0}:{},...f!==void 0?{account:f}:{}}}function Vte(t){const{address:e,chainId:n,scopes:r,expiry:i,limits:s,witness:a,isAdmin:o,account:l}=t;a!==void 0&&o5(a);const u=(()=>{if(t.signature)return b1(t.signature),Af(t.signature)})(),f=(()=>{switch(t.type){case"secp256k1":return"0x";case"p256":return"0x01";case"webAuthn":return"0x02";default:throw new Error(`Invalid key type: ${t.type}`)}})(),p=s==null?void 0:s.map(S=>{const x=[S.token,XF(S.limit)];return S.period&&S.period>0&&x.push(cT(S.period)),x}),y=(()=>{if(!r)return;const S=new Map;for(const x of r){const A=x.address;S.has(A)||S.set(A,[]),x.selector&&S.get(A).push([zN(x.selector),x.recipients??[]])}return[...S.entries()].map(([x,A])=>[x,A.map(([I,$])=>[I,$])])})(),g=a!==void 0||o||l!==void 0,b=[{value:i!=null&&i!==0?cT(i):void 0,placeholder:"0x"},{value:p,placeholder:g?"0x":[]},{value:y,placeholder:"0x"},{value:a,placeholder:"0x"},{value:o?"0x01":void 0,placeholder:"0x"},{value:l,placeholder:"0x"}];let v=-1;for(let S=b.length-1;S>=0;S--)if(b[S].value!==void 0){v=S;break}const _=b.slice(0,v+1).map(({value:S,placeholder:x})=>S??x);return[[XF(n),f,e,..._],...u?[u]:[]]}function XF(t){return t===0n?"0x":He(t)}function cT(t){return t===0?"0x":He(t)}function AEe(t){return t==="0x"?0n:BigInt(t)}function R8(t){return t==="0x"?0:h1(t)}function kEe(t){return typeof t=="string"?t:Array.isArray(t)?Oi(new Uint8Array(t)):t}function zN(t){if(t)return t.startsWith("0x")?t:IN(t)}function o5(t){if(Vn(t)!==32)throw new TEe(t)}function b1(t){if(t.type==="keychain")throw new $Ee(t.type)}function E4(t){return t===void 0||t==="0x"}class TEe extends Error{constructor(e){super(`Witness \`${e}\` must be exactly 32 bytes (got ${Vn(e)} bytes).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"KeyAuthorization.InvalidWitnessSizeError"})}}class LEe extends Error{constructor(e){super(`Admin marker \`${e}\` is invalid; expected \`0x01\` (TIP-1049).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"KeyAuthorization.InvalidAdminMarkerError"})}}class $Ee extends Error{constructor(e){super(`Signature type \`${e}\` is invalid for key authorizations; expected \`secp256k1\`, \`p256\`, \`webAuthn\`, or \`multisig\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"KeyAuthorization.InvalidSignatureTypeError"})}}const Hte={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"},Wte={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function IEe(t,e={}){if(!t)return null;const n=nte(t),r={...t,...n};return r.blockNumber=t.blockNumber?BigInt(t.blockNumber):null,"blockTimestamp"in t&&(r.blockTimestamp=t.blockTimestamp?BigInt(t.blockTimestamp):t.blockTimestamp===null?null:void 0),r.data=t.input,r.gas=BigInt(t.gas??0n),r.nonce=BigInt(t.nonce??0n),r.transactionIndex=t.transactionIndex?Number(t.transactionIndex):null,r.value=BigInt(t.value??0n),t.authorizationList&&(r.authorizationList=S_e(t.authorizationList)),t.chainId&&(r.chainId=Number(t.chainId)),t.gasPrice&&(r.gasPrice=BigInt(t.gasPrice)),t.maxFeePerBlobGas&&(r.maxFeePerBlobGas=BigInt(t.maxFeePerBlobGas)),t.maxFeePerGas&&(r.maxFeePerGas=BigInt(t.maxFeePerGas)),t.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=BigInt(t.maxPriorityFeePerGas)),t.type&&(r.type=Wte[t.type]??t.type),n&&(r.v=TN(n.yParity)),r}const qte={...Hte,tempo:"0x76"},NEe={...Wte,"0x76":"tempo"};function OEe(t,e={}){if(!t)return null;const n=IEe(t);return n.type=NEe[t.type],t.aaAuthorizationList&&(n.authorizationList=pEe(t.aaAuthorizationList),delete n.aaAuthorizationList),t.calls&&(n.calls=t.calls.map(r=>({to:r.to,value:r.value&&r.value!=="0x"?BigInt(r.value):void 0,data:r.input||r.data||"0x"}
492))),t.feeToken&&(n.feeToken=t.feeToken),t.nonceKey&&(n.nonceKey=BigInt(t.nonceKey)),t.signature&&(n.signature=z3(t.signature)),t.validAfter&&(n.validAfter=Number(t.validAfter)),t.validBefore&&(n.validBefore=Number(t.validBefore)),t.keyAuthorization&&(n.keyAuthorization=zte(t.keyAuthorization)),t.feePayerSignature&&(n.feePayerSignature=AN(t.feePayerSignature),n.feePayerSignature.v=TN(n.feePayerSignature.yParity)),n}function PEe(t){const e={};return typeof t.accessList<"u"&&(e.accessList=t.accessList),typeof t.authorizationList<"u"&&(e.authorizationList=k_e(t.authorizationList)),typeof t.blobVersionedHashes<"u"&&(e.blobVersionedHashes=t.blobVersionedHashes),typeof t.blobs<"u"&&(e.blobs=t.blobs),typeof t.chainId<"u"&&(e.chainId=He(t.chainId)),typeof t.data<"u"?(e.data=t.data,e.input=t.data):typeof t.input<"u"&&(e.data=t.input,e.input=t.input),typeof t.from<"u"&&(e.from=t.from),typeof t.gas<"u"&&(e.gas=He(t.gas)),typeof t.gasPrice<"u"&&(e.gasPrice=He(t.gasPrice)),typeof t.maxFeePerBlobGas<"u"&&(e.maxFeePerBlobGas=He(t.maxFeePerBlobGas)),typeof t.maxFeePerGas<"u"&&(e.maxFeePerGas=He(t.maxFeePerGas)),typeof t.maxPriorityFeePerGas<"u"&&(e.maxPriorityFeePerGas=He(t.maxPriorityFeePerGas)),typeof t.maxPriorityFeePerGas<"u"&&(e.maxPriorityFeePerGas=He(t.maxPriorityFeePerGas)),typeof t.nonce<"u"&&(e.nonce=He(t.nonce)),typeof t.to<"u"&&(e.to=t.to),typeof t.type<"u"&&(e.type=Hte[t.type]||t.type),typeof t.value<"u"&&(e.value=He(t.value)),e}function REe(t){const e=PEe({...t,authorizationList:void 0});t.authorizationList&&(e.authorizationList=bEe(t.authorizationList)),t.calls?e.calls=t.calls.map(r=>({to:r.to?ia(r.to):r.to,value:r.value?He(r.value):"0x",data:r.data??"0x"})):(t.to||t.data||t.value)&&(e.calls=[{to:t.to?ia(t.to):void 0,value:t.value?He(t.value):"0x",data:t.data??"0x"}]),typeof t.feeToken<"u"&&(e.feeToken=Bte(t.feeToken)),t.keyAuthorization&&(e.keyAuthorization=SEe(t.keyAuthorization)),typeof t.validBefore<"u"&&(e.validBefore=He(t.validBefore)),typeof t.validAfter<"u"&&(e.validAfter=He(t.validAfter));const n=(()=>{if(t.nonceKey==="random")return YQ(6);if(typeof t.nonceKey=="bigint")return He(t.nonceKey)})();return n&&(e.nonceKey=n),(typeof t.calls<"u"||typeof t.feePayer<"u"||typeof t.feeToken<"u"||typeof t.keyAuthorization<"u"||typeof t.nonceKey<"u"||typeof t.validBefore<"u"||typeof t.validAfter<"u"||t.type==="tempo")&&(e.type=qte.tempo,delete e.data,delete e.input,delete e.to,delete e.value),e}function jEe(t){const e=[];for(let n=0;n<t.length;n++){const[r,i]=t[n];r&&xl(r,{strict:!1}),e.push({address:r,storageKeys:i.map(s=>a9e(s)?s:jk(s))})}return e}function MEe(t){if(!t||t.length===0)return[];const e=[];for(const{address:n,storageKeys:r}of t){for(let i=0;i<r.length;i++)if(Vn(r[i])!==32)throw new DEe({storageKey:r[i]});n&&xl(n,{strict:!1}),e.push([n,r])}return e}class DEe extends ut{constructor({storageKey:e}){super(`Size for storage key "${e}" is invalid. Expected 32 bytes. Got ${Vn(e)} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccessList.InvalidStorageKeySizeError"})}}const QF={wei:0,gwei:9,szabo:12,finney:15,ether:18};function UEe(t,e=0){let n=t.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(e,"0");let[i,s]=[n.slice(0,n.length-e),n.slice(n.length-e)];return s=s.replace(/(0+)$/,""),`${r?"-":""}${i||"0"}${s?`.${s}`:""}`}function uT(t,e="wei"){return UEe(t,QF.gwei-QF[e])}class BEe extends ut{constructor({feeCap:e}={}){super(`The fee cap (\`maxFeePerGas\`/\`maxPriorityFeePerGas\`${e?` = ${uT(e)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionEnvelope.FeeCapTooHighError"})}}class FEe extends ut{constructor({chainId:e}){super(typeof e<"u"?`Chain ID "${e}
492" is invalid.`:"Chain ID is invalid."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionEnvelope.InvalidChainIdError"})}}class zEe extends ut{constructor({attributes:e,serialized:n,type:r}){const i=Object.entries(e).map(([s,a])=>typeof a>"u"?s:void 0).filter(Boolean);super(`Invalid serialized transaction of type "${r}" was provided.`,{metaMessages:[`Serialized Transaction: "${n}"`,i.length>0?`Missing Attributes: ${i.join(", ")}`:""].filter(Boolean)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionEnvelope.InvalidSerializedError"})}}class VEe extends ut{constructor({maxPriorityFeePerGas:e,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${e?` = ${uT(e)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${uT(n)} gwei`:""}).`].join(` 493`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionEnvelope.TipAboveFeeCapError"})}}const HEe="0x78",WEe="0x76",ez="tempo";function VN(t){const{calls:e,chainId:n,maxFeePerGas:r,maxPriorityFeePerGas:i,validBefore:s,validAfter:a}=t;if(!e||e.length===0)throw new YEe;if(typeof s=="number"&&typeof a=="number"&&s<=a)throw new JEe({validBefore:s,validAfter:a});if(e)for(const o of e)o.to&&xl(o.to,{strict:!1});if(n<=0)throw new FEe({chainId:n});if(r&&BigInt(r)>2n**256n-1n)throw new BEe({feeCap:r});if(i&&r&&i>r)throw new VEe({maxFeePerGas:r,maxPriorityFeePerGas:i})}function qEe(t){const e=Bee(tn(t,1)),[n,r,i,s,a,o,l,u,f,p,y,g,b,v,_]=e,C=Array.isArray(v)?v:void 0,S=C?_:v;if(!(e.length===13||e.length===14||e.length===15))throw new zEe({attributes:{authorizationList:b,chainId:n,maxPriorityFeePerGas:r,maxFeePerGas:i,gas:s,calls:a,accessList:o,keyAuthorization:C,nonceKey:l,nonce:u,validBefore:f,validAfter:p,feeToken:y,feePayerSignatureOrSender:g,...e.length>12?{signature:S}:{}},serialized:t,type:ez});let x={chainId:Number(n),type:ez};if(ol(s)&&s!=="0x"&&(x.gas=BigInt(s)),ol(u)&&(x.nonce=u==="0x"?0n:BigInt(u)),ol(i)&&i!=="0x"&&(x.maxFeePerGas=BigInt(i)),ol(r)&&r!=="0x"&&(x.maxPriorityFeePerGas=BigInt(r)),ol(l)&&(x.nonceKey=l==="0x"?0n:BigInt(l)),ol(f)&&f!=="0x"&&(x.validBefore=Number(f)),ol(p)&&p!=="0x"&&(x.validAfter=Number(p)),ol(y)&&y!=="0x"&&(x.feeToken=y),a&&a!=="0x"){const I=a;x.calls=I.map($=>{const[O,P,j]=$,U={};return O&&O!=="0x"&&(U.to=O),P&&P!=="0x"&&(U.value=BigInt(P)),j&&j!=="0x"&&(U.data=j),U})}(o==null?void 0:o.length)!==0&&o!=="0x"&&(x.accessList=jEe(o)),(b==null?void 0:b.length)!==0&&b!=="0x"&&(x.authorizationList=yEe(b)),g!=="0x"&&g!==void 0&&(g==="0x00"||L2(g)?(x.feePayerSignature=null,L2(g)&&(x.from=g)):x.feePayerSignature=g_e(g)),C&&(x.keyAuthorization=xEe(C));const A=S?s5(S):void 0;if(A&&(x={...x,signature:A}),!x.from&&A)try{x.from=hm({payload:M8(j8(x)),signature:A,root:!0})}catch{}return VN(x),x}function j8(t,e={}){const{feePayerSignature:n,signature:r}=e,i=typeof t=="string"?qEe(t):t;return i.from&&(i.from=ia(i.from)),i.calls&&(i.calls=i.calls.map(s=>({...s,...s.to?{to:ia(s.to)}:{}}))),VN(i),{...i,...r?{signature:Ns(r)}:{},...n?{feePayerSignature:R7(n)}:{},type:"tempo"}}function Qd(t,e={}){const{accessList:n,authorizationList:r,calls:i,chainId:s,feeToken:a,gas:o,keyAuthorization:l,nonce:u,nonceKey:f,maxFeePerGas:p,maxPriorityFeePerGas:y,validBefore:g,validAfter:b}=t;VN(t);const v=MEe(n),_=e.signature||t.signature,C=vEe(r),S=i.map($=>[$.to?ia($.to):"0x",$.value?He($.value):"0x",$.data??"0x"]);let x=!1;const A=(()=>{if(e.sender)return e.sender;if(e.format==="feePayer"&&_){const O=Ns(_);if(O.type==="keychain")return O.userAddress;if(O.type==="p256"||O.type==="webAuthn")return b2(O.publicKey);if(O.type==="secp256k1")return ste({payload:M8(j8(t)),signature:O.signature})}const $=typeof e.feePayerSignature<"u"?e.feePayerSignature:t.feePayerSignature;return $===null?(x=!0,"0x00"):$?w_e($):"0x"})(),I=[He(s),y?He(y):"0x",p?He(p):"0x",o?He(o):"0x",S,v,f?He(f):"0x",u?He(u):"0x",typeof g=="number"?He(g):"0x",typeof b=="number"?He(b):"0x",!x&&(typeof a=="bigint"||typeof a=="string")?Bte(a):"0x",A,C,...l?[Vte(l)]:[],..._?[Af(Ns(_))]:[]];return fr(e.format==="feePayer"?HEe:WEe,EN(I))}function ZEe(t){return Qd({...t,signature:void 0,...t.feePayerSignature!==void 0?{feePayerSignature:null}:{}})}function M8(t,e={}){const n=KEe(t,{presign:!0});return e.from?qu(fr("0x04",n,ia(e.from))):n}function KEe(t,e={}){const n=e.presign?ZEe(t):Qd(t);return qu(n)}function GEe(t,e){const n=ia(e.sender),r=Qd({...t,signature:void 0},{sender:n,format:"feePayer"});return qu(r)}class YEe extends ut{constructor(){super("Calls list cannot be empty."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TxEnvelopeTempo.CallsEmptyError"})}}class JEe extends ut{constructor({validBefore:e,validAfter:n}){super(`validBefore (${e}) must be greater than validAfter (${n}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TxEnvelopeTempo.InvalidValidityWindowError"})}}const Zte={4217:{base:4217e5,range:100261e4},42431:{base:142431e4,range:723173648}},Kte=4217;Zte[Kte].base;function Gte(t,e=Kte){const{base:n,range:r}=QEe(e);return n+t%r}class XEe extends ut{constructor({sourceId:e}){super(`Source chain ID "${e}
493" is not supported.`,{metaMessages:["Supported source chain IDs: 4217, 42431."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ZoneId.UnsupportedSourceIdError"})}}function QEe(t){if(t===4217||t===42431)return Zte[t];throw new XEe({sourceId:t})}const Ha=[{name:"authorizeKey",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"keyId"},{type:"uint8",name:"signatureType"},{type:"uint64",name:"expiry"},{type:"bool",name:"enforceLimits"},{type:"tuple[]",name:"limits",components:[{type:"address",name:"token"},{type:"uint256",name:"amount"}]}],outputs:[]},{name:"authorizeKey",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"keyId"},{type:"uint8",name:"signatureType"},{type:"tuple",name:"config",components:[{type:"uint64",name:"expiry"},{type:"bool",name:"enforceLimits"},{type:"tuple[]",name:"limits",components:[{type:"address",name:"token"},{type:"uint256",name:"amount"},{type:"uint64",name:"period"}]},{type:"bool",name:"allowAnyCalls"},{type:"tuple[]",name:"allowedCalls",components:[{type:"address",name:"target"},{type:"tuple[]",name:"selectorRules",components:[{type:"bytes4",name:"selector"},{type:"address[]",name:"recipients"}]}]}]}],outputs:[]},{name:"authorizeKey",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"keyId"},{type:"uint8",name:"signatureType"},{type:"tuple",name:"config",components:[{type:"uint64",name:"expiry"},{type:"bool",name:"enforceLimits"},{type:"tuple[]",name:"limits",components:[{type:"address",name:"token"},{type:"uint256",name:"amount"},{type:"uint64",name:"period"}]},{type:"bool",name:"allowAnyCalls"},{type:"tuple[]",name:"allowedCalls",components:[{type:"address",name:"target"},{type:"tuple[]",name:"selectorRules",components:[{type:"bytes4",name:"selector"},{type:"address[]",name:"recipients"}]}]}]},{type:"bytes32",name:"witness"}],outputs:[]},{name:"authorizeAdminKey",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"keyId"},{type:"uint8",name:"signatureType"},{type:"bytes32",name:"witness"}],outputs:[]},{name:"burnKeyAuthorizationWitness",type:"function",stateMutability:"nonpayable",inputs:[{type:"bytes32",name:"witness"}],outputs:[]},{name:"revokeKey",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"keyId"}],outputs:[]},{name:"updateSpendingLimit",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"keyId"},{type:"address",name:"token"},{type:"uint256",name:"newLimit"}],outputs:[]},{name:"setAllowedCalls",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"keyId"},{type:"tuple[]",name:"scopes",components:[{type:"address",name:"target"},{type:"tuple[]",name:"selectorRules",components:[{type:"bytes4",name:"selector"},{type:"address[]",name:"recipients"}]}]}],outputs:[]},{name:"removeAllowedCalls",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"keyId"},{type:"address",name:"target"}],outputs:[]},{name:"getKey",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"},{type:"address",name:"keyId"}],outputs:[{type:"tuple",components:[{type:"uint8",name:"signatureType"},{type:"address",name:"keyId"},{type:"uint64",name:"expiry"},{type:"bool",name:"enforceLimits"},{type:"bool",name:"isRevoked"}]}]},{name:"getRemainingLimit",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"},{type:"address",name:"keyId"},{type:"address",name:"token"}],outputs:[{type:"uint256",name:"remaining"}]},{name:"getRemainingLimitWithPeriod",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"},{type:"address",name:"keyId"},{type:"address",name:"token"}],outputs:[{type:"uint256",name:"remaining"},{type:"uint64",name:"periodEnd"}]},{name:"getAllowedCalls",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"},{type:"address",name:"keyId"}],outputs:[{type:"bool",name:"isScoped"},{type:"tuple[]",name:"scopes",components:[{type:"address",name:"target"},{type:"tuple[]",name:"selectorRules",components:[{type:"bytes4",name:"selector"},{type:"address[]",name:"recipients"}]}]}]},{name:"isKeyAuthorizationWitnessBurned",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"},{type:"bytes32",name:"witness"}],outputs:[{type:"bool"}]},{name:"isAdminKey",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"},{type:"address",name:"keyId"}],outputs:[{type:"bool"}]},{name:"getTransactionKey",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"address"}]},{name:"KeyAuthorized",type:"event",inputs:[{type:"address",name:"account",indexed:!0},{type:"address",name:"publicKey",indexed:!0},{type:"uint8",name:"signatureType"},{type:"uint64",name:"expiry"}]},{name:"AdminKeyAuthorized",type:"event",inputs:[{type:"address",name:"account",indexed:!0},{type:"address",name:"publicKey",indexed:!0}]},{name:"KeyRevoked",type:"event",inputs:[{type:"address",name:"account",indexed:!0},{type:"address",name:"publicKey",indexed:!0}]},{name:"SpendingLimitUpdated",type:"event",inputs:[{type:"address",name:"account",indexed:!0},{type:"address",name:"publicKey",indexed:!0}
493,{type:"address",name:"token",indexed:!0},{type:"uint256",name:"newLimit"}]},{name:"AccessKeySpend",type:"event",inputs:[{type:"address",name:"account",indexed:!0},{type:"address",name:"publicKey",indexed:!0},{type:"address",name:"token",indexed:!0},{type:"uint256",name:"amount"},{type:"uint256",name:"remainingLimit"}]},{name:"KeyAuthorizationWitness",type:"event",inputs:[{type:"address",name:"account",indexed:!0},{type:"bytes32",name:"witness",indexed:!0}]},{name:"KeyAuthorizationWitnessBurned",type:"event",inputs:[{type:"address",name:"account",indexed:!0},{type:"bytes32",name:"witness",indexed:!0}]},{name:"UnauthorizedCaller",type:"error",inputs:[]},{name:"KeyAlreadyExists",type:"error",inputs:[]},{name:"KeyNotFound",type:"error",inputs:[]},{name:"KeyExpired",type:"error",inputs:[]},{name:"SpendingLimitExceeded",type:"error",inputs:[]},{name:"InvalidSpendingLimit",type:"error",inputs:[]},{name:"InvalidSignatureType",type:"error",inputs:[]},{name:"ZeroPublicKey",type:"error",inputs:[]},{name:"ExpiryInPast",type:"error",inputs:[]},{name:"KeyAlreadyRevoked",type:"error",inputs:[]},{name:"SignatureTypeMismatch",type:"error",inputs:[{type:"uint8",name:"expected"},{type:"uint8",name:"actual"}]},{name:"CallNotAllowed",type:"error",inputs:[]},{name:"InvalidCallScope",type:"error",inputs:[]},{name:"InvalidKeyId",type:"error",inputs:[]},{name:"InvalidKeyAuthorizationWitness",type:"error",inputs:[]},{name:"KeyAuthorizationWitnessAlreadyBurned",type:"error",inputs:[]},{name:"LegacyAuthorizeKeySelectorChanged",type:"error",inputs:[{type:"bytes4",name:"newSelector"}]}],eSe=[{name:"registerVirtualMaster",type:"function",stateMutability:"nonpayable",inputs:[{type:"bytes32",name:"salt"}],outputs:[{type:"bytes4",name:"masterId"}]},{name:"getMaster",type:"function",stateMutability:"view",inputs:[{type:"bytes4",name:"masterId"}],outputs:[{type:"address"}]},{name:"resolveRecipient",type:"function",stateMutability:"view",inputs:[{type:"address",name:"to"}],outputs:[{type:"address",name:"effectiveRecipient"}]},{name:"resolveVirtualAddress",type:"function",stateMutability:"view",inputs:[{type:"address",name:"virtualAddr"}],outputs:[{type:"address",name:"master"}]},{name:"isVirtualAddress",type:"function",stateMutability:"pure",inputs:[{type:"address",name:"addr"}],outputs:[{type:"bool"}]},{name:"decodeVirtualAddress",type:"function",stateMutability:"pure",inputs:[{type:"address",name:"addr"}],outputs:[{type:"bool",name:"isVirtual"},{type:"bytes4",name:"masterId"},{type:"bytes6",name:"userTag"}]},{name:"isImplicitlyApproved",type:"function",stateMutability:"view",inputs:[{type:"address",name:"addr"}],outputs:[{type:"bool"}]},{name:"MasterRegistered",type:"event",inputs:[{type:"bytes4",name:"masterId",indexed:!0},{type:"address",name:"masterAddress",indexed:!0}]},{name:"MasterIdCollision",type:"error",inputs:[{type:"address",name:"master"}]},{name:"InvalidMasterAddress",type:"error",inputs:[]},{name:"ProofOfWorkFailed",type:"error",inputs:[]},{name:"VirtualAddressUnregistered",type:"error",inputs:[]}],V3=[{name:"deriveAccount",type:"function",stateMutability:"pure",inputs:[{type:"bytes32",name:"salt"},{type:"uint8",name:"threshold"},{type:"tuple[]",name:"owners",components:[{type:"address",name:"owner"},{type:"uint8",name:"weight"}]}],outputs:[{type:"address",name:"account"}]},{name:"isMultisigAccount",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"}],outputs:[{type:"bool"}]},{name:"getConfig",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"}],outputs:[{type:"tuple",components:[{type:"uint64",name:"version"},{type:"uint8",name:"threshold"},{type:"tuple[]",name:"owners",components:[{type:"address",name:"owner"},{type:"uint8",name:"weight"}]}]}]},{name:"updateConfig",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint8",name:"threshold"},{type:"tuple[]",name:"owners",components:[{type:"address",name:"owner"},{type:"uint8",name:"weight"}]}],outputs:[]},{name:"MultisigInitialized",type:"event",inputs:[{type:"address",name:"account",indexed:!0}]},{name:"MultisigConfigUpdated",type:"event",inputs:[{type:"address",name:"account",indexed:!0},{type:"uint8",name:"threshold"},{type:"tuple[]",name:"owners",components:[{type:"address",name:"owner"},{type:"uint8",name:"weight"}]}]},{name:"NotMultisigAccount",type:"error",inputs:[]},{name:"InvalidAccount",type:"error",inputs:[]},{name:"InvalidConfig",type:"error",inputs:[]},{name:"InvalidThreshold",type:"error",inputs:[]},{name:"InvalidOwner",type:"error",inputs:[]},{name:"InvalidWeight",type:"error",inputs:[]},{name:"TooManyOwners",type:"error",inputs:[]},{name:"DuplicateOwner",type:"error",inputs:[]},{name:"InvalidOwnerOrder",type:"error",inputs:[]},{name:"AccountAlreadyInitialized",type:"error",inputs:[]},{name:"UnauthorizedCaller",type:"error",inputs:[]},{name:"SameTransactionUpdateNotAllowed",type:"error",inputs:[]}],tSe=[{name:"getCommitteeMembers",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint64",name:"epoch"},{type:"bytes32[]",name:"publicKeys"}]},{name:"setCommitteeMembers",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint64",name:"epoch"},{type:"bytes32[]",name:"publicKeys"}],outputs:[]},{name:"Unauthorized",type:"error",inputs:[]}],nSe=[{name:"getNonce",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"},{type:"uint256",name:"nonceKey"}],outputs:[{type:"uint64",name:"nonce"}]},{name:"NonceIncremented",type:"event",inputs:[{type:"address",name:"account",indexed:!0},{type:"uint256",name:"nonceKey",indexed:!0},{type:"uint64",name:"newNonce"}]},{name:"ProtocolNonceNotSupported",type:"error",inputs:[]},{name:"InvalidNonceKey",type:"error",inputs:[]},{name:"NonceOverflow",type:"error",inputs:[]},{name:"ExpiringNonceReplay",type:"error",inputs:[]},{name:"ExpiringNonceSetFull",type:"error",inputs:[]},{name:"InvalidExpiringNonceExpiry",type:"error",inputs:[]}],rSe=[{name:"balanceOf",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"receipt"}],outputs:[{type:"uint256",name:"amount"}]},{name:"claim",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"to"},{type:"bytes",name:"receipt"}],outputs:[]},{name:"burnBlockedReceipt",type:"function",stateMutability:"nonpayable",inputs:[{type:"bytes",name:"receipt"}],outputs:[]},{name:"TransferBlocked",type:"event",inputs:[{type:"address",name:"token",
493indexed:!0},{type:"address",name:"receiver",indexed:!0},{type:"uint64",name:"blockedNonce",indexed:!0},{type:"uint256",name:"amount"},{type:"uint8",name:"receiptVersion"},{type:"bytes",name:"receipt"}]},{name:"ReceiptClaimed",type:"event",inputs:[{type:"address",name:"token",indexed:!0},{type:"address",name:"receiver",indexed:!0},{type:"uint64",name:"blockedNonce",indexed:!0},{type:"uint64",name:"blockedAt"},{type:"uint8",name:"receiptVersion"},{type:"address",name:"originator"},{type:"address",name:"recipient"},{type:"address",name:"recoveryAuthority"},{type:"address",name:"caller"},{type:"address",name:"to"},{type:"uint256",name:"amount"}]},{name:"ReceiptBurned",type:"event",inputs:[{type:"address",name:"token",indexed:!0},{type:"address",name:"receiver",indexed:!0},{type:"uint64",name:"blockedNonce",indexed:!0},{type:"uint64",name:"blockedAt"},{type:"uint8",name:"receiptVersion"},{type:"address",name:"originator"},{type:"address",name:"recipient"},{type:"address",name:"recoveryAuthority"},{type:"address",name:"caller"},{type:"uint256",name:"amount"}]},{name:"InvalidReceipt",type:"error",inputs:[]},{name:"InvalidClaimAddress",type:"error",inputs:[]},{name:"UnauthorizedClaimer",type:"error",inputs:[]},{name:"AddressReserved",type:"error",inputs:[]}],Yte=[{name:"recover",type:"function",stateMutability:"view",inputs:[{type:"bytes32",name:"hash"},{type:"bytes",name:"signature"}],outputs:[{type:"address",name:"signer"}]},{name:"verify",type:"function",stateMutability:"view",inputs:[{type:"address",name:"signer"},{type:"bytes32",name:"hash"},{type:"bytes",name:"signature"}],outputs:[{type:"bool"}]},{name:"verifyKeychain",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"},{type:"bytes32",name:"hash"},{type:"bytes",name:"signature"}],outputs:[{type:"bool"}]},{name:"verifyKeychainAdmin",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"},{type:"bytes32",name:"hash"},{type:"bytes",name:"signature"}],outputs:[{type:"bool"}]},{name:"InvalidFormat",type:"error",inputs:[]},{name:"InvalidSignature",type:"error",inputs:[]}],iSe=[{name:"createPair",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"base"}],outputs:[{type:"bytes32",name:"key"}]},{name:"place",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"token"},{type:"uint128",name:"amount"},{type:"bool",name:"isBid"},{type:"int16",name:"tick"}],outputs:[{type:"uint128",name:"orderId"}]},{name:"placeFlip",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"token"},{type:"uint128",name:"amount"},{type:"bool",name:"isBid"},{type:"int16",name:"tick"},{type:"int16",name:"flipTick"}],outputs:[{type:"uint128",name:"orderId"}]},{name:"cancel",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint128",name:"orderId"}],outputs:[]},{name:"cancelStaleOrder",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint128",name:"orderId"}],outputs:[]},{name:"swapExactAmountIn",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"tokenIn"},{type:"address",name:"tokenOut"},{type:"uint128",name:"amountIn"},{type:"uint128",name:"minAmountOut"}],outputs:[{type:"uint128",name:"amountOut"}]},{name:"swapExactAmountOut",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"tokenIn"},{type:"address",name:"tokenOut"},{type:"uint128",name:"amountOut"},{type:"uint128",name:"maxAmountIn"}],outputs:[{type:"uint128",name:"amountIn"}]},{name:"quoteSwapExactAmountIn",type:"function",stateMutability:"view",inputs:[{type:"address",name:"tokenIn"},{type:"address",name:"tokenOut"},{type:"uint128",name:"amountIn"}],outputs:[{type:"uint128",name:"amountOut"}]},{name:"quoteSwapExactAmountOut",type:"function",stateMutability:"view",inputs:[{type:"address",name:"tokenIn"},{type:"address",name:"tokenOut"},{type:"uint128",name:"amountOut"}],outputs:[{type:"uint128",name:"amountIn"}]},{name:"balanceOf",type:"function",stateMutability:"view",inputs:[{type:"address",name:"user"},{type:"address",name:"token"}],outputs:[{type:"uint128"}]},{name:"withdraw",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"token"},{type:"uint128",name:"amount"}],outputs:[]},{name:"getOrder",type:"function",stateMutability:"view",inputs:[{type:"uint128",name:"orderId"}],outputs:[{type:"tuple",components:[{type:"uint128",name:"orderId"},{type:"address",name:"maker"},{type:"bytes32",name:"bookKey"},{type:"bool",name:"isBid"},{type:"int16",name:"tick"},{type:"uint128",name:"amount"},{type:"uint128",name:"remaining"},{type:"uint128",name:"prev"},{type:"uint128",name:"next"},{type:"bool",name:"isFlip"},{type:"int16",name:"flipTick"}]}]},{name:"getTickLevel",type:"function",stateMutability:"view",inputs:[{type:"address",name:"base"},{type:"int16",name:"tick"},{type:"bool",name:"isBid"}],outputs:[{type:"uint128",name:"head"},{type:"uint128",name:"tail"},{type:"uint128",name:"totalLiquidity"}]},{name:"pairKey",type:"function",stateMutability:"pure",inputs:[{type:"address",name:"tokenA"},{type:"address",name:"tokenB"}],outputs:[{type:"bytes32"}]},{name:"nextOrderId",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint128"}]},{name:"books",type:"function",stateMutability:"view",inputs:[{type:"bytes32",name:"pairKey"}],outputs:[{type:"tuple",components:[{type:"address",name:"base"},{type:"address",name:"quote"},{type:"int16",name:"bestBidTick"},{type:"int16",name:"bestAskTick"}]}]},{name:"bookIndexForKey",type:"function",stateMutability:"view",inputs:[{type:"bytes32",name:"bookKey"}],outputs:[{type:"bool",name:"set"},{type:"uint32",name:"index"}]},{name:"bookKeyForIndex",type:"function",stateMutability:"view",inputs:[{type:"uint32",name:"index"}],outputs:[{type:"bytes32",name:"bookKey"}]},{name:"setBookIndex",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint32",name:"index"}],outputs:[]},{name:"storageCredits",type:"function",stateMutability:"view",inputs:[{type:"address",name:"user"}],outputs:[{type:"uint64",name:"credits"}]},{name:"MIN_TICK",type:"function",stateMutability:"pure",inputs:[],outputs:[{type:"int16"}]},{name:"MAX_TICK",type:"function",stateMutability:"pure",inputs:[],outputs:[{type:"int16"}]},{name:"TICK_SPACING",type:"function",stateMutability:"pure",inputs:[],outputs:[{type:"int16"}]},{name:"PRICE_SCALE",type:"function",stateMutability:"pure",inputs:[],outputs:[{type:"uint32"}]},{name:"MIN_ORDER_AMOUNT",type:"function",stateMutability:"pure",inputs:[],outputs:[{type:"uint128"}]},{name:"MIN_PRICE",type:"function",stateMutability:"pure",inputs:[],outputs:[{type:"uint32"}]},{name:"MAX_PRICE",type:"function",stateMutability:"pure",inputs:[],outputs:[{type:"uint32"}]},{name:"tickToPrice",type:"function",stateMutability:"pure",inputs:[{type:"int16",name:"tick"}],outputs:[{type:"uint32",name:"price"}]},{name:"priceToTick",type:"function",stateMutability:"pure",inputs:[{type:"uint32",name:"price"}],outputs:[{type:"int16",name:"tick"}]},{name:"PairCreated",type:"event",inputs:[{type:"bytes32",name:"key",indexed:!0},{type:"address",name:"base",indexed:!0},{type:"address",name:"quote",indexed:!0}]},{name:"OrderPlaced",type:"event",inputs:[{type:"uint128",name:"orderId",indexed:!0},{type:"address",name:"maker",indexed:!0}
493,{type:"address",name:"token",indexed:!0},{type:"uint128",name:"amount"},{type:"bool",name:"isBid"},{type:"int16",name:"tick"},{type:"bool",name:"isFlipOrder"},{type:"int16",name:"flipTick"}]},{name:"OrderFilled",type:"event",inputs:[{type:"uint128",name:"orderId",indexed:!0},{type:"address",name:"maker",indexed:!0},{type:"address",name:"taker",indexed:!0},{type:"uint128",name:"amountFilled"},{type:"bool",name:"partialFill"}]},{name:"OrderFlipped",type:"event",inputs:[{type:"uint128",name:"orderId",indexed:!0},{type:"address",name:"maker",indexed:!0},{type:"address",name:"token",indexed:!0},{type:"uint128",name:"amount"},{type:"bool",name:"isBid"},{type:"int16",name:"tick"},{type:"int16",name:"flipTick"}]},{name:"FlipFailed",type:"event",inputs:[{type:"uint128",name:"orderId",indexed:!0},{type:"address",name:"maker",indexed:!0},{type:"bytes4",name:"reason"}]},{name:"OrderCancelled",type:"event",inputs:[{type:"uint128",name:"orderId",indexed:!0}]},{name:"Unauthorized",type:"error",inputs:[]},{name:"PairDoesNotExist",type:"error",inputs:[]},{name:"PairAlreadyExists",type:"error",inputs:[]},{name:"OrderDoesNotExist",type:"error",inputs:[]},{name:"IdenticalTokens",type:"error",inputs:[]},{name:"InvalidToken",type:"error",inputs:[]},{name:"TickOutOfBounds",type:"error",inputs:[{type:"int16",name:"tick"}]},{name:"InvalidTick",type:"error",inputs:[]},{name:"InvalidFlipTick",type:"error",inputs:[]},{name:"InsufficientBalance",type:"error",inputs:[]},{name:"InsufficientLiquidity",type:"error",inputs:[]},{name:"InsufficientOutput",type:"error",inputs:[]},{name:"MaxInputExceeded",type:"error",inputs:[]},{name:"BelowMinimumOrderSize",type:"error",inputs:[{type:"uint128",name:"amount"}]},{name:"InvalidBaseToken",type:"error",inputs:[]},{name:"OrderNotStale",type:"error",inputs:[]},{name:"IndexAlreadySet",type:"error",inputs:[]}],sSe=[{name:"balanceOf",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"}],outputs:[{type:"uint64"}]},{name:"modeOf",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"}],outputs:[{type:"uint8"}]},{name:"budgetOf",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"}],outputs:[{type:"uint64"}]},{name:"setMode",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint8",name:"newMode"}],outputs:[]},{name:"setBudget",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint64",name:"credits"}],outputs:[]},{name:"InvalidMode",type:"error",inputs:[]},{name:"OnlyDirectCall",type:"error",inputs:[]}],aSe=[{name:"userTokens",type:"function",stateMutability:"view",inputs:[{type:"address",name:"user"}],outputs:[{type:"address"}]},{name:"validatorTokens",type:"function",stateMutability:"view",inputs:[{type:"address",name:"validator"}],outputs:[{type:"address"}]},{name:"setUserToken",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"token"}],outputs:[]},{name:"setValidatorToken",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"token"}],outputs:[]},{name:"distributeFees",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"validator"},{type:"address",name:"token"}],outputs:[]},{name:"collectedFees",type:"function",stateMutability:"view",inputs:[{type:"address",name:"validator"},{type:"address",name:"token"}],outputs:[{type:"uint256"}]},{name:"UserTokenSet",type:"event",inputs:[{type:"address",name:"user",indexed:!0},{type:"address",name:"token",indexed:!0}]},{name:"ValidatorTokenSet",type:"event",inputs:[{type:"address",name:"validator",indexed:!0},{type:"address",name:"token",indexed:!0}]},{name:"FeesDistributed",type:"event",inputs:[{type:"address",name:"validator",indexed:!0},{type:"address",name:"token",indexed:!0},{type:"uint256",name:"amount"}]},{name:"InvalidToken",type:"error",inputs:[]},{name:"InsufficientFeeTokenBalance",type:"error",inputs:[]},{name:"CannotChangeWithinBlock",type:"error",inputs:[]}],oSe=[{name:"M",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"N",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"SCALE",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"MIN_LIQUIDITY",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"getPoolId",type:"function",stateMutability:"pure",inputs:[{type:"address",name:"userToken"},{type:"address",name:"validatorToken"}],outputs:[{type:"bytes32"}]},{name:"getPool",type:"function",stateMutability:"view",inputs:[{type:"address",name:"userToken"},{type:"address",name:"validatorToken"}],outputs:[{type:"tuple",components:[{type:"uint128",name:"reserveUserToken"},{type:"uint128",name:"reserveValidatorToken"}]}]},{name:"pools",type:"function",stateMutability:"view",inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"tuple",components:[{type:"uint128",name:"reserveUserToken"},{type:"uint128",name:"reserveValidatorToken"}]}]},{name:"mint",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"userToken"},{type:"address",name:"validatorToken"},{type:"uint256",name:"amountValidatorToken"},{type:"address",name:"to"}],outputs:[{type:"uint256",name:"liquidity"}]},{name:"burn",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"userToken"},{type:"address",name:"validatorToken"},{type:"uint256",name:"liquidity"},{type:"address",name:"to"}],outputs:[{type:"uint256",name:"amountUserToken"},{type:"uint256",name:"amountValidatorToken"}]},{name:"totalSupply",type:"function",stateMutability:"view",inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"uint256"}]},{name:"liquidityBalances",type:"function",stateMutability:"view",inputs:[{type:"bytes32",name:"poolId"},{type:"address",name:"user"}],outputs:[{type:"uint256"}]},{name:"rebalanceSwap",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"userToken"},{type:"address",name:"validatorToken"},{type:"uint256",name:"amountOut"},{type:"address",name:"to"}],outputs:[{type:"uint256",name:"amountIn"}]},{name:"Mint",type:"event",inputs:[{type:"address",name:"sender"},{type:"address",name:"to",indexed:!0},{type:"address",name:"userToken",indexed:!0},{type:"address",name:"validatorToken",indexed:!0},{type:"uint256",name:"amountValidatorToken"},{type:"uint256",name:"liquidity"}]},{name:"Burn",type:"event",inputs:[{type:"address",name:"sender",indexed:!0},{type:"address",name:"userToken",indexed:!0},{type:"address",name:"validatorToken",indexed:!0},{type:"uint256",name:"amountUserToken"},{type:"uint256",name:"amountValidatorToken"},{type:"uint256",name:"liquidity"},{type:"address",name:"to"}]},{name:"RebalanceSwap",type:"event",inputs:[{type:"address",name:"userToken",indexed:!0},{type:"address",name:"validatorToken",indexed:!0},{type:"address",name:"swapper",indexed:!0},{type:"uint256",name:"amountIn"},{type:"uint256",name:"amountOut"}]},{name:"IdenticalAddresses",type:"error",inputs:[]},{name:"InvalidToken",type:"error",inputs:[]},{name:"InsufficientLiquidity",type:"error",inputs:[]},{name:"InsufficientReserves",type:"error",inputs:[]},{name:"InvalidAmount",type:"error",inputs:[]},{name:"DivisionByZero",type:"error",inputs:[]},{name:"InvalidSwapCalculation",type:"error",inputs:[]}],lSe=[{name:"CLOSE_GRACE_PERIOD",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint64"}]},{name:"VOUCHER_TYPEHASH",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"bytes32"}]},{name:"open",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"payee"},{type:"address",name:"operator"},{type:"address",name:"token"},{type:"uint96",name:"deposit"},{type:"bytes32",name:"salt"},{type:"address",name:"authorizedSigner"}],outputs:[{type:"bytes32",name:"channelId"}]},{name:"settle",type:"function",stateMutability:"nonpayable",inputs:[{type:"tuple",name:"descriptor",components:[{type:"address",name:"payer"},{type:"address",name:"payee"},{type:"address",name:"operator"},{type:"address",name:"token"},{type:"bytes32",name:"salt"},{type:"address",name:"authorizedSigner"},{type:"bytes32",name:"expiringNonceHash"}]},{type:"uint96",name:"cumulativeAmount"},{type:"bytes",name:"signature"}],outputs:[]},{name:"topUp",type:"function",stateMutability:"nonpayable",inputs:[{type:"tuple",name:"descriptor",components:[{type:"address",name:"payer"},{type:"address",name:"payee"},{type:"address",name:"operator"},{type:"address",name:"token"},{type:"bytes32",name:"salt"},{type:"address",name:"authorizedSigner"},{type:"bytes32",name:"expiringNonceHash"}]},{type:"uint96",name:"additionalDeposit"}],outputs:[]},{name:"close",type:"function",stateMutability:"nonpayable",inputs:[{type:"tuple",name:"descriptor",components:[{type:"address",name:"payer"},{type:"address",name:"payee"},{type:"address",name:"operator"},{type:"address",name:"token"},{type:"bytes32",name:"salt"},{type:"address",name:"authorizedSigner"},{type:"bytes32",name:"expiringNonceHash"}]},{type:"uint96",name:"cumulativeAmount"},{type:"uint96",name:"captureAmount"},{type:"bytes",name:"signature"}],outputs:[]},{name:"requestClose",type:"function",stateMutability:"nonpayable",inputs:[{type:"tuple",name:"descriptor",components:[{type:"address",name:"payer"},{type:"address",name:"payee"},{type:"address",name:"operator"},{type:"address",name:"token"},{type:"bytes32",name:"salt"},{type:"address",name:"authorizedSigner"},{type:"bytes32",name:"expiringNonceHash"}]}],outputs:[]},{name:"withdraw",type:"function",stateMutability:"nonpayable",inputs:[{type:"tuple",name:"descriptor",components:[{type:"address",name:"payer"},{type:"address",name:"payee"},{type:"address",name:"operator"},{type:"address",name:"token"},{type:"bytes32",name:"salt"},{type:"address",name:"authorizedSigner"},{type:"bytes32",name:"expiringNonceHash"}]}],outputs:[]},{name:"getChannel",type:"function",stateMutability:"view",inputs:[{type:"tuple",name:"descriptor",components:[{type:"address",name:"payer"},{type:"address",name:"payee"},{type:"address",name:"operator"},{type:"address",name:"token"},{type:"bytes32",name:"salt"},{type:"address",name:"authorizedSigner"},{type:"bytes32",name:"expiringNonceHash"}]}],outputs:[{type:"tuple",components:[{type:"tuple",name:"descriptor",components:[{type:"address",name:"payer"},{type:"address",name:"payee"},{type:"address",name:"operator"},{type:"address",name:"token"},{type:"bytes32",name:"salt"},{type:"address",name:"authorizedSigner"},{type:"bytes32",name:"expiringNonceHash"}]},{type:"tuple",name:"state",components:[{type:"uint96",name:"settled"},{type:"uint96",name:"deposit"},{type:"uint32",name:"closeRequestedAt"}]}]}]},{name:"getChannelState",type:"function",stateMutability:"view",inputs:[{type:"bytes32",name:"channelId"}],outputs:[{type:"tuple",components:[{type:"uint96",name:"settled"},{type:"uint96",name:"deposit"},{type:"uint32",name:"closeRequestedAt"}]}]},{name:"getChannelStatesBatch",type:"function",stateMutability:"view",inputs:[{type:"bytes32[]",name:"channelIds"}],outputs:[{type:"tuple[]",components:[{type:"uint96",name:"settled"},{type:"uint96",name:"deposit"},{type:"uint32",name:"closeRequestedAt"}]}]},{name:"computeChannelId",type:"function",stateMutability:"view",inputs:[{type:"address",name:"payer"},{type:"address",name:"payee"},{type:"address",name:"operator"},{type:"address",name:"token"},{type:"bytes32",name:"salt"},{type:"address",name:"authorizedSigner"},{type:"bytes32",name:"expiringNonceHash"}],outputs:[{type:"bytes32"}]},{name:"getVoucherDigest",type:"function",stateMutability:"view",inputs:[{type:"bytes32",name:"channelId"},{type:"uint96",name:"cumulativeAmount"}],outputs:[{type:"bytes32"}]},{name:"domainSeparator",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"bytes32"}]},{name:"storageCredits",type:"function",stateMutability:"view",inputs:[{type:"address",name:"payer"}],outputs:[{type:"uint64",name:"credits"}]},{name:"ChannelOpened",type:"event",inputs:[{type:"bytes32",name:"channelId",indexed:!0},{type:"address",name:"payer",indexed:!0},{type:"address",name:"payee",indexed:!0},{type:"address",name:"operator"},{type:"address",name:"token"},{type:"address",name:"authorizedSigner"},{type:"bytes32",name:"salt"},{type:"bytes32",name:"expiringNonceHash"},{type:"uint96",name:"deposit"}]},{name:"Settled",type:"event",inputs:[{type:"bytes32",name:"channelId",indexed:!0},{type:"address",name:"payer",indexed:!0},{type:"address",name:"payee",indexed:!0},{type:"uint96",name:"cumulativeAmount"},{type:"uint96",name:"deltaPaid"},{type:"uint96",name:"newSettled"}]},{name:"TopUp",type:"event",inputs:[{type:"bytes32",name:"channelId",indexed:!0},{type:"address",name:"payer",indexed:!0},{type:"address",name:"payee",indexed:!0},{type:"uint96",name:"additionalDeposit"},{type:"uint96",name:"newDeposit"}]},{name:"CloseRequested",type:"event",inputs:[{type:"bytes32",name:"channelId",indexed:!0},{type:"address",name:"payer",indexed:!0},{type:"address",name:"payee",indexed:!0},{type:"uint256",name:"closeGraceEnd"}]},{name:"ChannelClosed",type:"event",inputs:[{type:"bytes32",name:"channelId",indexed:!0},{type:"address",name:"payer",indexed:!0},{type:"address",name:"payee",indexed:!0},{type:"uint96",name:"settledToPayee"},{type:"uint96",name:"refundedToPayer"}]},{name:"CloseRequestCancelled",type:"event",inputs:[{type:"bytes32",name:"channelId",indexed:!0},{type:"address",name:"payer",indexed:!0},{type:"address",name:"payee",indexed:!0}]},{name:"ChannelAlreadyExists",type:"error",inputs:[]},{name:"ChannelNotFound",type:"error",inputs:[]},{name:"NotPayer",type:"error",inputs:[]},{name:"NotPayeeOrOperator",type:"error",inputs:[]},{name:"InvalidPayee",type:"error",inputs:[]},{name:"ZeroDeposit",type:"error",inputs:[]},{name:"ExpiringNonceHashNotSet",type:"error",inputs:[]},{name:"InvalidSignature",type:"error",inputs:[]},{name:"AmountExceedsDeposit",type:"error",inputs:[]},{name:"AmountNotIncreasing",type:"error",inputs:[]},{name:"CaptureAmountInvalid",type:"error",inputs:[]},{name:"CloseNotReady",type:"error",inputs:[]},{name:"DepositOverflow",type:"error",inputs:[]}],cSe=[{name:"createToken",type:"function",stateMutability:"nonpayable",inputs:[{type:"string",name:"name"},{type:"string",name:"symbol"},{type:"string",name:"currency"},{type:"address",name:"quoteToken"},{type:"address",name:"admin"},{type:"bytes32",name:"salt"}],outputs:[{type:"address"}]},{name:"createToken",type:"function",stateMutability:"nonpayable",inputs:[{type:"string",name:"name"},{type:"string",name:"symbol"},{type:"string",name:"currency"},{type:"address",name:"quoteToken"},{type:"address",name:"admin"},{type:"bytes32",name:"salt"},{type:"string",name:"logoURI"}],outputs:[{type:"address"}]},{name:"isTIP20",type:"function",stateMutability:"view",inputs:[{type:"address",name:"token"}],outputs:[{type:"bool"}]},{name:"getTokenAddress",type:"function",stateMutability:"pure",inputs:[{type:"address",name:"sender"},{type:"bytes32",name:"salt"}],outputs:[{type:"address"}]},{name:"TokenCreated",type:"event",inputs:[{type:"address",name:"token",
493indexed:!0},{type:"string",name:"name"},{type:"string",name:"symbol"},{type:"string",name:"currency"},{type:"address",name:"quoteToken"},{type:"address",name:"admin"},{type:"bytes32",name:"salt"}]},{name:"AddressReserved",type:"error",inputs:[]},{name:"AddressNotReserved",type:"error",inputs:[]},{name:"InvalidQuoteToken",type:"error",inputs:[]},{name:"TokenAlreadyExists",type:"error",inputs:[{type:"address",name:"token"}]}],uSe=[{name:"name",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{name:"symbol",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{name:"decimals",type:"function",stateMutability:"pure",inputs:[],outputs:[{type:"uint8"}]},{name:"totalSupply",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"quoteToken",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"address"}]},{name:"nextQuoteToken",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"address"}]},{name:"balanceOf",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"}],outputs:[{type:"uint256"}]},{name:"transfer",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"to"},{type:"uint256",name:"amount"}],outputs:[{type:"bool"}]},{name:"approve",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"spender"},{type:"uint256",name:"amount"}],outputs:[{type:"bool"}]},{name:"allowance",type:"function",stateMutability:"view",inputs:[{type:"address",name:"owner"},{type:"address",name:"spender"}],outputs:[{type:"uint256"}]},{name:"transferFrom",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"from"},{type:"address",name:"to"},{type:"uint256",name:"amount"}],outputs:[{type:"bool"}]},{name:"mint",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"to"},{type:"uint256",name:"amount"}],outputs:[]},{name:"burn",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint256",name:"amount"}],outputs:[]},{name:"currency",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{name:"supplyCap",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"paused",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"bool"}]},{name:"transferPolicyId",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint64"}]},{name:"logoURI",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{name:"setLogoURI",type:"function",stateMutability:"nonpayable",inputs:[{type:"string",name:"newLogoURI"}],outputs:[]},{name:"burnBlocked",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"from"},{type:"uint256",name:"amount"}],outputs:[]},{name:"mintWithMemo",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"to"},{type:"uint256",name:"amount"},{type:"bytes32",name:"memo"}],outputs:[]},{name:"burnWithMemo",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint256",name:"amount"},{type:"bytes32",name:"memo"}],outputs:[]},{name:"transferWithMemo",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"to"},{type:"uint256",name:"amount"},{type:"bytes32",name:"memo"}],outputs:[]},{name:"transferFromWithMemo",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"from"},{type:"address",name:"to"},{type:"uint256",name:"amount"},{type:"bytes32",name:"memo"}],outputs:[{type:"bool"}]},{name:"changeTransferPolicyId",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint64",name:"newPolicyId"}],outputs:[]},{name:"setSupplyCap",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint256",name:"newSupplyCap"}],outputs:[]},{name:"pause",type:"function",stateMutability:"nonpayable",inputs:[],outputs:[]},{name:"unpause",type:"function",stateMutability:"nonpayable",inputs:[],outputs:[]},{name:"setNextQuoteToken",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"newQuoteToken"}],outputs:[]},{name:"completeQuoteTokenUpdate",type:"function",stateMutability:"nonpayable",inputs:[],outputs:[]},{name:"PAUSE_ROLE",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"bytes32"}]},{name:"UNPAUSE_ROLE",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"bytes32"}]},{name:"ISSUER_ROLE",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"bytes32"}]},{name:"BURN_BLOCKED_ROLE",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"bytes32"}]},{name:"permit",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"owner"},{type:"address",name:"spender"},{type:"uint256",name:"value"},{type:"uint256",name:"deadline"},{type:"uint8",name:"v"},{type:"bytes32",name:"r"},{type:"bytes32",name:"s"}],outputs:[]},{name:"nonces",type:"function",stateMutability:"view",inputs:[{type:"address",name:"owner"}],outputs:[{type:"uint256"}]},{name:"DOMAIN_SEPARATOR",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"bytes32"}]},{name:"distributeReward",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint256",name:"amount"}],outputs:[]},{name:"setRewardRecipient",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"recipient"}],outputs:[]},{name:"claimRewards",type:"function",stateMutability:"nonpayable",inputs:[],outputs:[{type:"uint256"}]},{name:"optedInSupply",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint128"}]},{name:"globalRewardPerToken",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"userRewardInfo",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"}],outputs:[{type:"tuple",components:[{type:"address",name:"rewardRecipient"},{type:"uint256",name:"rewardPerToken"},{type:"uint256",name:"rewardBalance"}]}]},{name:"getPendingRewards",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"}],outputs:[{type:"uint128"}]},{name:"Transfer",type:"event",inputs:[{type:"address",name:"from",indexed:!0},{type:"address",name:"to",indexed:!0},{type:"uint256",name:"amount"}]},{name:"Approval",type:"event",inputs:[{type:"address",name:"owner",indexed:!0},{type:"address",name:"spender",indexed:!0},{type:"uint256",name:"amount"}]},{name:"Mint",type:"event",inputs:[{type:"address",name:"to",indexed:!0},{type:"uint256",name:"amount"}]},{name:"Burn",type:"event",inputs:[{type:"address",name:"from",indexed:!0},{type:"uint256",name:"amount"}]},{name:"BurnBlocked",type:"event",inputs:[{type:"address",name:"from",indexed:!0},{type:"uint256",name:"amount"}]},{name:"TransferWithMemo",type:"event",inputs:[{type:"address",name:"from",indexed:!0},{type:"address",name:"to",indexed:!0},{type:"uint256",name:"amount"},{type:"bytes32",name:"memo",indexed:!0}]},{name:"TransferPolicyUpdate",type:"event",inputs:[{type:"address",name:"updater",indexed:!0},{type:"uint64",name:"newPolicyId",indexed:!0}]},{name:"SupplyCapUpdate",type:"event",inputs:[{type:"address",name:"updater",indexed:!0},{type:"uint256",name:"newSupplyCap",indexed:!0}]},{name:"PauseStateUpdate",type:"event",inputs:[{type:"address",name:"updater",indexed:!0},{type:"bool",name:"isPaused"}]},{name:"NextQuoteTokenSet",type:"event",inputs:[{type:"address",name:"updater",indexed:!0},{type:"address",name:"nextQuoteToken",indexed:!0}]},{name:"QuoteTokenUpdate",type:"event",inputs:[{type:"address",name:"updater",indexed:!0},{type:"address",name:"newQuoteToken",indexed:!0}]},{name:"RewardDistributed",type:"event",inputs:[{type:"address",name:"funder",indexed:!0},{type:"uint256",name:"amount"}]},{name:"RewardRecipientSet",type:"event",inputs:[{type:"address",name:"holder",indexed:!0},{type:"address",name:"recipient",indexed:!0}]},{name:"LogoURIUpdated",type:"event",inputs:[{type:"address",name:"updater",indexed:!0},{type:"string",name:"newLogoURI"}]},{name:"InsufficientBalance",type:"error",inputs:[{type:"uint256",name:"available"},{type:"uint256",name:"required"},{type:"address",name:"token"}]},{name:"InsufficientAllowance",type:"error",inputs:[]},{name:"SupplyCapExceeded",type:"error",inputs:[]},{name:"InvalidSupplyCap",type:"error",inputs:[]},{name:"InvalidPayload",type:"error",inputs:[]},{name:"PolicyForbids",type:"error",inputs:[]},{name:"InvalidRecipient",type:"error",inputs:[]},{name:"ContractPaused",type:"error",inputs:[]},{name:"InvalidCurrency",type:"error",inputs:[]},{name:"InvalidQuoteToken",type:"error",inputs:[]},{name:"InvalidAmount",type:"error",inputs:[]},{name:"NoOptedInSupply",type:"error",inputs:[]},{name:"Unauthorized",type:"error",inputs:[]},{name:"ProtectedAddress",type:"error",inputs:[]},{name:"InvalidToken",type:"error",inputs:[]},{name:"Uninitialized",type:"error",inputs:[]},{name:"InvalidTransferPolicyId",type:"error",inputs:[]},{name:"PermitExpired",type:"error",inputs:[]},{name:"InvalidSignature",type:"error",inputs:[]},{name:"LogoURITooLong",type:"error",inputs:[]},{name:"InvalidLogoURI",type:"error",inputs:[]},{name:"hasRole",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"},{type:"bytes32",name:"role"}],outputs:[{type:"bool"}]},{name:"getRoleAdmin",type:"function",stateMutability:"view",inputs:[{type:"bytes32",name:"role"}],outputs:[{type:"bytes32"}]},{name:"grantRole",type:"function",stateMutability:"nonpayable",inputs:[{type:"bytes32",name:"role"},{type:"address",name:"account"}],outputs:[]},{name:"revokeRole",type:"function",stateMutability:"nonpayable",inputs:[{type:"bytes32",name:"role"},{type:"address",name:"account"}],outputs:[]},{name:"renounceRole",type:"function",stateMutability:"nonpayable",inputs:[{type:"bytes32",name:"role"}],outputs:[]},{name:"setRoleAdmin",type:"function",stateMutability:"nonpayable",inputs:[{type:"bytes32",name:"role"},{type:"bytes32",name:"adminRole"}],outputs:[]},{name:"RoleMembershipUpdated",type:"event",inputs:[{type:"bytes32",name:"role",indexed:!0},{type:"address",name:"account",indexed:!0},{type:"address",name:"sender",indexed:!0},{type:"bool",name:"hasRole"}]},{name:"RoleAdminUpdated",type:"event",inputs:[{type:"bytes32",name:"role",indexed:!0},{type:"bytes32",name:"newAdminRole",indexed:!0},{type:"address",name:"sender",indexed:!0}]},{name:"Unauthorized",type:"error",inputs:[]}],dSe=[{name:"policyIdCounter",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint64"}]},{name:"policyExists",type:"function",stateMutability:"view",inputs:[{type:"uint64",name:"policyId"}],outputs:[{type:"bool"}]},{name:"tokenTransferPolicyId",type:"function",stateMutability:"view",inputs:[{type:"address",name:"token"}],outputs:[{type:"bool",name:"isSet"},{type:"uint64",name:"policyId"}]},{name:"policyData",type:"function",stateMutability:"view",inputs:[{type:"uint64",name:"policyId"}],outputs:[{type:"uint8",name:"policyType"},{type:"address",name:"admin"}]},{name:"isAuthorized",type:"function",stateMutability:"view",inputs:[{type:"uint64",name:"policyId"},{type:"address",name:"user"}],outputs:[{type:"bool"}]},{name:"isAuthorizedSender",type:"function",stateMutability:"view",inputs:[{type:"uint64",name:"policyId"},{type:"address",name:"user"}],outputs:[{type:"bool"}]},{name:"isAuthorizedRecipient",type:"function",stateMutability:"view",inputs:[{type:"uint64",name:"policyId"},{type:"address",name:"user"}],outputs:[{type:"bool"}]},{name:"isAuthorizedMintRecipient",type:"function",stateMutability:"view",inputs:[{type:"uint64",name:"policyId"},{type:"address",name:"user"}],outputs:[{type:"bool"}]},{name:"compoundPolicyData",type:"function",stateMutability:"view",inputs:[{type:"uint64",name:"policyId"}],outputs:[{type:"uint64",name:"senderPolicyId"},{type:"uint64",name:"recipientPolicyId"},{type:"uint64",name:"mintRecipientPolicyId"}]},{name:"receivePolicy",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"}],outputs:[{type:"bool",name:"hasReceivePolicy"},{type:"uint64",name:"senderPolicyId"},{type:"uint8",name:"senderPolicyType"},{type:"uint64",name:"tokenFilterId"},{type:"uint8",name:"tokenFilterType"},{type:"address",name:"recoveryAuthority"}]},{name:"validateReceivePolicy",type:"function",stateMutability:"view",inputs:[{type:"address",name:"token"},{type:"address",name:"sender"},{type:"address",name:"receiver"}],outputs:[{type:"bool",name:"authorized"},{type:"uint8",name:"blockedReason"}]},{name:"createPolicy",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"admin"},{type:"uint8",name:"policyType"}],outputs:[{type:"uint64"}]},{name:"createPolicyWithAccounts",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"admin"},{type:"uint8",name:"policyType"},{type:"address[]",name:"accounts"}],outputs:[{type:"uint64"}]},{name:"setPolicyAdmin",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint64",name:"policyId"},{type:"address",name:"admin"}],outputs:[]},{name:"modifyPolicyWhitelist",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint64",name:"policyId"},{type:"address",name:"account"},{type:"bool",name:"allowed"}
493],outputs:[]},{name:"modifyPolicyBlacklist",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint64",name:"policyId"},{type:"address",name:"account"},{type:"bool",name:"restricted"}],outputs:[]},{name:"createCompoundPolicy",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint64",name:"senderPolicyId"},{type:"uint64",name:"recipientPolicyId"},{type:"uint64",name:"mintRecipientPolicyId"}],outputs:[{type:"uint64"}]},{name:"setReceivePolicy",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint64",name:"senderPolicyId"},{type:"uint64",name:"tokenFilterId"},{type:"address",name:"recoveryAuthority"}],outputs:[]},{name:"migrateTransferPolicyIds",type:"function",stateMutability:"nonpayable",inputs:[{type:"address[]",name:"tokens"}],outputs:[{type:"uint256",name:"migrated"}]},{name:"PolicyAdminUpdated",type:"event",inputs:[{type:"uint64",name:"policyId",indexed:!0},{type:"address",name:"updater",indexed:!0},{type:"address",name:"admin",indexed:!0}]},{name:"PolicyCreated",type:"event",inputs:[{type:"uint64",name:"policyId",indexed:!0},{type:"address",name:"updater",indexed:!0},{type:"uint8",name:"policyType"}]},{name:"WhitelistUpdated",type:"event",inputs:[{type:"uint64",name:"policyId",indexed:!0},{type:"address",name:"updater",indexed:!0},{type:"address",name:"account",indexed:!0},{type:"bool",name:"allowed"}]},{name:"BlacklistUpdated",type:"event",inputs:[{type:"uint64",name:"policyId",indexed:!0},{type:"address",name:"updater",indexed:!0},{type:"address",name:"account",indexed:!0},{type:"bool",name:"restricted"}]},{name:"CompoundPolicyCreated",type:"event",inputs:[{type:"uint64",name:"policyId",indexed:!0},{type:"address",name:"creator",indexed:!0},{type:"uint64",name:"senderPolicyId"},{type:"uint64",name:"recipientPolicyId"},{type:"uint64",name:"mintRecipientPolicyId"}]},{name:"ReceivePolicyUpdated",type:"event",inputs:[{type:"address",name:"account",indexed:!0},{type:"uint64",name:"senderPolicyId"},{type:"uint64",name:"tokenFilterId"},{type:"address",name:"recoveryAuthority"}]},{name:"Unauthorized",type:"error",inputs:[]},{name:"PolicyNotFound",type:"error",inputs:[]},{name:"PolicyNotSimple",type:"error",inputs:[]},{name:"InvalidPolicyType",type:"error",inputs:[]},{name:"IncompatiblePolicyType",type:"error",inputs:[]},{name:"VirtualAddressNotAllowed",type:"error",inputs:[]},{name:"InvalidReceivePolicyType",type:"error",inputs:[]},{name:"InvalidRecoveryAuthority",type:"error",inputs:[]}],hSe=[{name:"getActiveValidators",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"tuple[]",name:"validators",components:[{type:"bytes32",name:"publicKey"},{type:"address",name:"validatorAddress"},{type:"string",name:"ingress"},{type:"string",name:"egress"},{type:"address",name:"feeRecipient"},{type:"uint64",name:"index"},{type:"uint64",name:"addedAtHeight"},{type:"uint64",name:"deactivatedAtHeight"}]}]},{name:"getInitializedAtHeight",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint64"}]},{name:"owner",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"address"}]},{name:"validatorCount",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint64"}]},{name:"validatorByIndex",type:"function",stateMutability:"view",inputs:[{type:"uint64",name:"index"}],outputs:[{type:"tuple",components:[{type:"bytes32",name:"publicKey"},{type:"address",name:"validatorAddress"},{type:"string",name:"ingress"},{type:"string",name:"egress"},{type:"address",name:"feeRecipient"},{type:"uint64",name:"index"},{type:"uint64",name:"addedAtHeight"},{type:"uint64",name:"deactivatedAtHeight"}]}]},{name:"validatorByAddress",type:"function",stateMutability:"view",inputs:[{type:"address",name:"validatorAddress"}],outputs:[{type:"tuple",components:[{type:"bytes32",name:"publicKey"},{type:"address",name:"validatorAddress"},{type:"string",name:"ingress"},{type:"string",name:"egress"},{type:"address",name:"feeRecipient"},{type:"uint64",name:"index"},{type:"uint64",name:"addedAtHeight"},{type:"uint64",name:"deactivatedAtHeight"}]}]},{name:"validatorByPublicKey",type:"function",stateMutability:"view",inputs:[{type:"bytes32",name:"publicKey"}],outputs:[{type:"tuple",components:[{type:"bytes32",name:"publicKey"},{type:"address",name:"validatorAddress"},{type:"string",name:"ingress"},{type:"string",name:"egress"},{type:"address",name:"feeRecipient"},{type:"uint64",name:"index"},{type:"uint64",name:"addedAtHeight"},{type:"uint64",name:"deactivatedAtHeight"}]}]}
493,{name:"getNextNetworkIdentityRotationEpoch",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint64"}]},{name:"isInitialized",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"bool"}]},{name:"addValidator",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"validatorAddress"},{type:"bytes32",name:"publicKey"},{type:"string",name:"ingress"},{type:"string",name:"egress"},{type:"address",name:"feeRecipient"},{type:"bytes",name:"signature"}],outputs:[{type:"uint64",name:"index"}]},{name:"deactivateValidator",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint64",name:"idx"}],outputs:[]},{name:"rotateValidator",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint64",name:"idx"},{type:"bytes32",name:"publicKey"},{type:"string",name:"ingress"},{type:"string",name:"egress"},{type:"bytes",name:"signature"}],outputs:[]},{name:"setFeeRecipient",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint64",name:"idx"},{type:"address",name:"feeRecipient"}],outputs:[]},{name:"setIpAddresses",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint64",name:"idx"},{type:"string",name:"ingress"},{type:"string",name:"egress"}],outputs:[]},{name:"transferValidatorOwnership",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint64",name:"idx"},{type:"address",name:"newAddress"}],outputs:[]},{name:"transferOwnership",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"newOwner"}],outputs:[]},{name:"setNetworkIdentityRotationEpoch",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint64",name:"epoch"}],outputs:[]},{name:"migrateValidator",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint64",name:"idx"}],outputs:[]},{name:"initializeIfMigrated",type:"function",stateMutability:"nonpayable",inputs:[],outputs:[]},{name:"ValidatorAdded",type:"event",inputs:[{type:"uint64",name:"index",indexed:!0},{type:"address",name:"validatorAddress",indexed:!0},{type:"bytes32",name:"publicKey"},{type:"string",name:"ingress"},{type:"string",name:"egress"},{type:"address",name:"feeRecipient"}]},{name:"ValidatorDeactivated",type:"event",inputs:[{type:"uint64",name:"index",indexed:!0},{type:"address",name:"validatorAddress",indexed:!0}]},{name:"ValidatorRotated",type:"event",inputs:[{type:"uint64",name:"index",indexed:!0},{type:"uint64",name:"deactivatedIndex",indexed:!0},{type:"address",name:"validatorAddress",indexed:!0},{type:"bytes32",name:"oldPublicKey"},{type:"bytes32",name:"newPublicKey"},{type:"string",name:"ingress"},{type:"string",name:"egress"},{type:"address",name:"caller"}]},{name:"FeeRecipientUpdated",type:"event",inputs:[{type:"uint64",name:"index",indexed:!0},{type:"address",name:"feeRecipient"},{type:"address",name:"caller"}]},{name:"IpAddressesUpdated",type:"event",inputs:[{type:"uint64",name:"index",indexed:!0},{type:"string",name:"ingress"},{type:"string",name:"egress"},{type:"address",name:"caller"}]},{name:"ValidatorOwnershipTransferred",type:"event",inputs:[{type:"uint64",name:"index",indexed:!0},{type:"address",name:"oldAddress",indexed:!0},{type:"address",name:"newAddress",indexed:!0},{type:"address",name:"caller"}]},{name:"OwnershipTransferred",type:"event",inputs:[{type:"address",name:"oldOwner",indexed:!0},{type:"address",name:"newOwner",indexed:!0}]},{name:"ValidatorMigrated",type:"event",inputs:[{type:"uint64",name:"index",indexed:!0},{type:"address",name:"validatorAddress",indexed:!0},{type:"bytes32",name:"publicKey"}]},{name:"NetworkIdentityRotationEpochSet",type:"event",inputs:[{type:"uint64",name:"previousEpoch",indexed:!0},{type:"uint64",name:"nextEpoch",indexed:!0}]},{name:"Initialized",type:"event",inputs:[{type:"uint64",name:"height"}]},{name:"SkippedValidatorMigration",type:"event",inputs:[{type:"uint64",name:"index",indexed:!0},{type:"address",name:"validatorAddress",indexed:!0},{type:"bytes32",name:"publicKey"}]},{name:"AlreadyInitialized",type:"error",inputs:[]},{name:"IngressAlreadyExists",type:"error",inputs:[{type:"string",name:"ingress"}]},{name:"EmptyV1ValidatorSet",type:"error",inputs:[]},{name:"InvalidMigrationIndex",type:"error",inputs:[]},{name:"InvalidOwner",type:"error",inputs:[]},{name:"InvalidPublicKey",type:"error",inputs:[]},{name:"InvalidSignature",type:"error",inputs:[]},{name:"InvalidSignatureFormat",type:"error",inputs:[]},{name:"InvalidValidatorAddress",type:"error",inputs:[]},{name:"MigrationNotComplete",type:"error",inputs:[]},{name:"NotInitialized",type:"error",inputs:[]},{name:"NotIp",type:"error",inputs:[{type:"string",name:"input"},{type:"string",name:"backtrace"}]},{name:"NotIpPort",type:"error",inputs:[{type:"string",name:"input"},{type:"string",name:"backtrace"}]},{name:"PublicKeyAlreadyExists",type:"error",inputs:[]},{name:"Unauthorized",type:"error",inputs:[]},{name:"AddressAlreadyHasValidator",type:"error",inputs:[]},{name:"ValidatorAlreadyDeactivated",type:"error",inputs:[]},{name:"ValidatorNotFound",type:"error",inputs:[]}],fSe=[{name:"getValidators",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"tuple[]",name:"validators",components:[{type:"bytes32",name:"publicKey"},{type:"bool",name:"active"},{type:"uint64",name:"index"},{type:"address",name:"validatorAddress"},{type:"string",name:"inboundAddress"},{type:"string",name:"outboundAddress"}]}]},{name:"addValidator",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"newValidatorAddress"},{type:"bytes32",name:"publicKey"},{type:"bool",name:"active"},{type:"string",name:"inboundAddress"},{type:"string",name:"outboundAddress"}],outputs:[]}
493,{name:"updateValidator",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"newValidatorAddress"},{type:"bytes32",name:"publicKey"},{type:"string",name:"inboundAddress"},{type:"string",name:"outboundAddress"}],outputs:[]},{name:"changeValidatorStatus",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"validator"},{type:"bool",name:"active"}],outputs:[]},{name:"changeValidatorStatusByIndex",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint64",name:"index"},{type:"bool",name:"active"}],outputs:[]},{name:"owner",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"address"}]},{name:"changeOwner",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"newOwner"}],outputs:[]},{name:"getNextFullDkgCeremony",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint64"}]},{name:"setNextFullDkgCeremony",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint64",name:"epoch"}],outputs:[]},{name:"validatorsArray",type:"function",stateMutability:"view",inputs:[{type:"uint256",name:"index"}],outputs:[{type:"address"}]},{name:"validators",type:"function",stateMutability:"view",inputs:[{type:"address",name:"validator"}],outputs:[{type:"tuple",components:[{type:"bytes32",name:"publicKey"},{type:"bool",name:"active"},{type:"uint64",name:"index"},{type:"address",name:"validatorAddress"},{type:"string",name:"inboundAddress"},{type:"string",name:"outboundAddress"}]}]},{name:"validatorCount",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint64"}]},{name:"Unauthorized",type:"error",inputs:[]},{name:"ValidatorAlreadyExists",type:"error",inputs:[]},{name:"ValidatorNotFound",type:"error",inputs:[]},{name:"InvalidPublicKey",type:"error",inputs:[]},{name:"NotHostPort",type:"error",inputs:[{type:"string",name:"field"},{type:"string",name:"input"},{type:"string",name:"backtrace"}]},{name:"NotIpPort",type:"error",inputs:[{type:"string",name:"field"},{type:"string",name:"input"},{type:"string",name:"backtrace"}]}],pSe=[{name:"owner",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"address"}]},{name:"transferOwnership",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"newOwner"}],outputs:[]},{name:"createZone",type:"function",stateMutability:"nonpayable",inputs:[{type:"tuple",name:"params",components:[{type:"address",name:"initialToken"},{type:"bool",name:"accessMode"},{type:"bool",name:"gatewayMode"},{type:"address[]",name:"allowedAccounts"},{type:"address[]",name:"zoneGateways"},{type:"address",name:"admin"},{type:"address[]",name:"sequencers"},{type:"uint8",name:"threshold"},{type:"string",name:"rpcUrl"}]}],outputs:[{type:"uint32",name:"zoneId"},{type:"address",name:"portal"}]},{name:"nextZoneId",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint32"}]},{name:"zones",type:"function",stateMutability:"view",inputs:[{type:"uint32",name:"id"}],outputs:[{type:"tuple",name:"info",components:[{type:"uint32",name:"zoneId"},{type:"address",name:"portal"},{type:"bool",name:"accessMode"},{type:"bool",name:"gatewayMode"},{type:"address",name:"admin"},{type:"address[]",name:"sequencers"},{type:"uint8",name:"threshold"},{type:"address",name:"verifier"},{type:"string",name:"rpcUrl"}]}]},{name:"isZonePortal",type:"function",stateMutability:"view",inputs:[{type:"address",name:"portal"}],outputs:[{type:"bool"}]},{name:"OwnershipTransferred",type:"event",inputs:[{type:"address",name:"previousOwner",indexed:!0},{type:"address",name:"newOwner",indexed:!0}]},{name:"ZoneCreated",type:"event",inputs:[{type:"uint32",name:"zoneId",indexed:!0},{type:"address",name:"portal",indexed:!0},{type:"address",name:"initialToken"},{type:"bool",name:"accessMode"},{type:"bool",name:"gatewayMode"},{type:"address",name:"admin"},{type:"address[]",name:"sequencers"},{type:"uint8",name:"threshold"},{type:"address",name:"verifier"}]},{name:"InvalidToken",type:"error",inputs:[]},{name:"TokenTransferPolicyNotSet",type:"error",inputs:[]},{name:"InvalidClosedLoopConfig",type:"error",inputs:[]},{name:"NotOwner",type:"error",inputs:[]},{name:"InvalidAdmin",type:"error",inputs:[]},{name:"InvalidSequencerSet",type:"error",inputs:[]},{name:"AlreadyInitialized",type:"error",inputs:[]},{name:"TokenMetadataTooLong",type:"error",inputs:[]},{name:"DuplicateAllowedAccount",type:"error",inputs:[]},{name:"DuplicateZoneGateway",type:"error",inputs:[]},{name:"ZoneCreated",type:"event",inputs:[{type:"uint32",name:"zoneId",indexed:!0},{type:"address",name:"portal",indexed:!0},{type:"address",name:"messenger",indexed:!0},{type:"address",name:"initialToken"},{type:"address",name:"admin"},{type:"address",name:"sequencer"},{type:"address",name:"verifier"},{type:"bytes32",name:"genesisBlockHash"},{type:"bytes32",name:"genesisTempoBlockHash"},{type:"uint64",name:"genesisTempoBlockNumber"}]},{name:"createZone",type:"function",stateMutability:"nonpayable",inputs:[{type:"tuple",name:"params",components:[{type:"address",name:"initialToken"},{type:"address",name:"admin"},{type:"address",name:"sequencer"},{type:"address",name:"verifier"},{type:"tuple",name:"zoneParams",components:[{type:"bytes32",name:"genesisBlockHash"},{type:"bytes32",name:"genesisTempoBlockHash"},{type:"uint64",name:"genesisTempoBlockNumber"}]},{type:"string",name:"rpcUrl"}]}],outputs:[{type:"uint32",name:"zoneId"},{type:"address",name:"portal"}]},{name:"verifier",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"address"}]}],mSe=[{name:"SequencerSetUpdated",type:"event",inputs:[{type:"uint64",name:"nonce",indexed:!0},{type:"uint8",name:"threshold"},{type:"address[]",name:"sequencers"}]},{name:"TokenEnabled",type:"event",inputs:[{type:"address",name:"token",
493indexed:!0},{type:"string",name:"name"},{type:"string",name:"symbol"},{type:"string",name:"currency"}]},{name:"RoleUpdated",type:"event",inputs:[{type:"address",name:"account",indexed:!0},{type:"uint8",name:"prev"},{type:"uint8",name:"next"}]},{name:"EnforcementModesUpdated",type:"event",inputs:[{type:"bool",name:"accessMode"},{type:"bool",name:"gatewayMode"}]},{name:"LeaderUpdated",type:"event",inputs:[{type:"address",name:"previousLeader",indexed:!0},{type:"address",name:"newLeader",indexed:!0},{type:"uint64",name:"leaderEpoch",indexed:!0},{type:"uint64",name:"leaderActivationTempoBlock"}]},{name:"zoneId",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint32"}]},{name:"admin",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"address"}]},{name:"messenger",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"address"}]},{name:"isAccessEnforced",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"bool"}]},{name:"setAccessMode",type:"function",stateMutability:"nonpayable",inputs:[{type:"bool",name:"enforced"}],outputs:[]},{name:"isGatewayOpen",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"bool"}]},{name:"setGatewayMode",type:"function",stateMutability:"nonpayable",inputs:[{type:"bool",name:"enforced"}],outputs:[]},{name:"hasRole",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"},{type:"uint8",name:"role"}],outputs:[{type:"bool"}]},{name:"setAllowedAccount",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"account"},{type:"bool",name:"allowed"}],outputs:[]},{name:"setGateway",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"account"},{type:"bool",name:"allowed"}],outputs:[]},{name:"setPauseGuardian",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"account"},{type:"bool",name:"allowed"}],outputs:[]},{name:"setSequencerSet",type:"function",stateMutability:"nonpayable",inputs:[{type:"address[]",name:"newSequencers"},{type:"uint8",name:"newThreshold"}],outputs:[]},{name:"verifier",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"address"}]},{name:"sequencerSetVersion",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint64"}]},{name:"sequencerThreshold",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{name:"zoneHeight",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"isSequencer",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"}],outputs:[{type:"bool"}]},{name:"sequencerCount",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"sequencerAt",type:"function",stateMutability:"view",inputs:[{type:"uint256",name:"index"}],outputs:[{type:"address"}]},{name:"leader",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"address"}]},{name:"leaderEpoch",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint64"}]},{name:"leaderActivationTempoBlock",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint64"}]},{name:"setLeader",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"newLeader"},{type:"uint64",name:"expectedEpoch"}],outputs:[]},{name:"withdrawalBatchIndex",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint64"}]},{name:"blockHash",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"bytes32"}]},{name:"currentDepositQueueHash",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"bytes32"}]},{name:"lastSyncedTempoBlockNumber",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint64"}]},{name:"withdrawalQueueHead",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"withdrawalQueueTail",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"withdrawalQueueSlot",type:"function",stateMutability:"view",inputs:[{type:"uint256",name:"queueIndex"}],outputs:[{type:"bytes32"}]},{name:"calculateDepositFee",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint128",name:"fee"}]},{name:"calculateBouncebackFee",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint128",name:"fee"}]},{name:"depositCount",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint64"}]},{name:"lastProcessedDepositNumber",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint64"}]},{name:"FIXED_DEPOSIT_GAS",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint64"}]},{name:"MAX_GAS_FEE_RATE",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint128"}]},{name:"MAX_TOKENS_ENABLED_PER_TEMPO_BLOCK",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint64"}]},{name:"MAX_TOKEN_METADATA_BYTES",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"areDepositsActive",type:"function",stateMutability:"view",inputs:[{type:"address",name:"token"}],outputs:[{type:"bool"}]},{name:"tokenConfig",type:"function",stateMutability:"view",inputs:[{type:"address",name:"token"}],outputs:[{type:"tuple",components:[{type:"bool",name:"enabled"},{type:"bool",name:"depositsActive"}]}]},{name:"initialize",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint32",name:"zoneId"},{type:"address",name:"initialToken"},{type:"bool",name:"accessMode"},{type:"bool",name:"gatewayMode"},{type:"address[]",name:"allowedAccounts"},{type:"address[]",name:"zoneGateways"},{type:"address",name:"admin"},{type:"address",name:"messenger"},{type:"address[]",name:"sequencers"},{type:"uint8",name:"threshold"},{type:"address",name:"verifier"},{type:"string",name:"rpcUrl"}],outputs:[]},{name:"deliverWithdrawal",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"to"},{type:"address",name:"token"},{type:"uint128",name:"amount"},{type:"bytes32",name:"memo"},{type:"uint64",name:"gasLimit"},{type:"bytes",name:"callbackData"}],outputs:[]},{name:"MAX_DEPOSITS_PER_TEMPO_BLOCK",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint64"}]},{name:"MAX_WITHDRAWAL_GAS_LIMIT",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint64"}]},{name:"paused",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"bool"}]},{name:"pauseExpiry",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint64"}]},{name:"abdicationEffectiveAt",type:"function",stateMutability:"view",inputs:[{type:"uint8",name:"capability"}],outputs:[{type:"uint64"}]},{name:"processWithdrawals",type:"function",stateMutability:"nonpayable",inputs:[{type:"tuple[]",name:"withdrawals",components:[{type:"address",name:"token"},{type:"bytes32",name:"senderTag"},{type:"address",name:"to"},{type:"uint128",name:"amount"},{type:"bytes32",name:"memo"},{type:"uint64",name:"gasLimit"},{type:"uint64",name:"fallbackNonce"},{type:"bytes",name:"callbackData"},{type:"bytes",name:"encryptedSender"}]},{type:"bytes32",name:"remainingQueue"}],outputs:[]},{name:"pause",type:"function",stateMutability:"nonpayable",inputs:[],outputs:[]},{name:"resume",type:"function",stateMutability:"nonpayable",inputs:[],outputs:[]},{name:"abdicate",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint8",name:"capability"}],outputs:[]},{name:"submitBatch",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint64",name:"tempoBlockNumber"},{type:"uint64",name:"recentTempoBlockNumber"},{type:"tuple",name:"blockTransition",components:[{type:"bytes32",name:"prevBlockHash"},{type:"bytes32",name:"nextBlockHash"}]},{type:"tuple",name:"depositQueueTransition",components:[{type:"bytes32",name:"prevProcessedHash"},{type:"bytes32",name:"nextProcessedHash"},{type:"uint64",name:"prevDepositNumber"},{type:"uint64",name:"nextDepositNumber"}]},{type:"bytes32",name:"withdrawalQueueHash"},{type:"bytes",name:"verifierConfig"},{type:"bytes",name:"proof"},{type:"uint256",name:"nextZoneHeight"},{type:"bytes[]",name:"signatures"}],outputs:[]},{name:"enableToken",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"token"}],outputs:[]},{name:"pauseDeposits",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"token"}],outputs:[]},{name:"resumeDeposits",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"token"}],outputs:[]},{name:"setZoneGasRate",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint128",name:"newZoneGasRate"}],outputs:[]},{name:"setMaxTempoGasRate",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint128",name:"newMaxTempoGasRate"}],outputs:[]},{name:"setBouncebackGas",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint64",name:"newBouncebackGas"}],outputs:[]},{name:"transferAdmin",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"newAdmin"}],outputs:[]},{name:"acceptAdmin",type:"function",stateMutability:"nonpayable",inputs:[],outputs:[]},{name:"rpcUrl",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{name:"setRpcUrl",type:"function",stateMutability:"nonpayable",inputs:[{type:"string",name:"rpcUrl"}],outputs:[]},{name:"deposit",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"token"},{type:"uint128",name:"amount"},{type:"uint256",name:"keyIndex"},{type:"tuple",name:"encrypted",components:[{type:"bytes32",name:"ephemeralPubkeyX"},{type:"uint8",name:"ephemeralPubkeyYParity"},{type:"bytes",name:"ciphertext"},{type:"bytes12",name:"nonce"},{type:"bytes16",name:"tag"}]},{type:"address",name:"tempoRefundRecipient"}],outputs:[{type:"bytes32",name:"newCurrentDepositQueueHash"}]},{name:"depositEncrypted",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"token"},{type:"uint128",name:"amount"},{type:"uint256",name:"keyIndex"},{type:"tuple",name:"encrypted",components:[{type:"bytes32",name:"ephemeralPubkeyX"},{type:"uint8",name:"ephemeralPubkeyYParity"},{type:"bytes",name:"ciphertext"},{type:"bytes12",name:"nonce"},{type:"bytes16",name:"tag"}]},{type:"address",name:"tempoRefundRecipient"}],outputs:[{type:"bytes32",name:"newCurrentDepositQueueHash"}]},{name:"setSequencerEncryptionKey",type:"function",stateMutability:"nonpayable",inputs:[{type:"bytes32",name:"x"},{type:"uint8",name:"yParity"},{type:"uint8",name:"popV"},{type:"bytes32",name:"popR"},{type:"bytes32",name:"popS"}],outputs:[]},{name:"isTokenEnabled",type:"function",stateMutability:"view",inputs:[{type:"address",name:"token"}],outputs:[{type:"bool"}]},{name:"enabledTokenCount",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"enabledTokenAt",type:"function",stateMutability:"view",inputs:[{type:"uint256",name:"index"}],outputs:[{type:"address"}]},{name:"tokenEnablementHash",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"bytes32"}]},{name:"zoneGasRate",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint128"}]},{name:"maxTempoGasRate",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint128"}]},{name:"bouncebackGas",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint64"}]},{name:"pendingAdmin",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"address"}]},{name:"refunds",type:"function",stateMutability:"view",inputs:[{type:"address",name:"token"},{type:"address",name:"owner"}],outputs:[{type:"uint128"}]},{name:"sequencerEncryptionKey",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"bytes32",name:"x"},{type:"uint8",name:"yParity"},{type:"address",name:"pubkey"}]},{name:"encryptionKeyCount",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"encryptionKeyAt",type:"function",stateMutability:"view",inputs:[{type:"uint256",name:"index"}],outputs:[{type:"tuple",name:"entry",components:[{type:"bytes32",name:"x"},{type:"uint8",name:"yParity"},{type:"uint64",name:"activationBlock"}]}]},{name:"isEncryptionKeyValid",type:"function",stateMutability:"view",inputs:[{type:"uint256",name:"keyIndex"}],outputs:[{type:"bool",name:"valid"},{type:"uint64",name:"expiresAtBlock"}]},{name:"encryptionKeyAtBlock",type:"function",stateMutability:"view",inputs:[{type:"uint64",name:"tempoBlockNumber"}],outputs:[{type:"bytes32",name:"x"},{type:"uint8",name:"yParity"},{type:"uint256",name:"keyIndex"}]},{name:"claimRefund",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"token"}],outputs:[{type:"uint128",name:"amount"}]},{name:"DepositMade",type:"event",inputs:[{type:"bytes32",name:"newCurrentDepositQueueHash",indexed:!0},{type:"address",name:"sender",indexed:!0},{type:"address",name:"token"},{type:"uint128",name:"netAmount"},{type:"uint128",name:"fee"},{type:"uint256",name:"keyIndex"},{type:"bytes32",name:"ephemeralPubkeyX"},{type:"uint8",name:"ephemeralPubkeyYParity"},{type:"bytes",name:"ciphertext"},{type:"bytes12",name:"nonce"},{type:"bytes16",name:"tag"},{type:"address",name:"tempoRefundRecipient"},{type:"uint64",name:"depositNumber"}]},{name:"DepositsPaused",type:"event",inputs:[{type:"address",name:"token",
493indexed:!0}]},{name:"DepositsResumed",type:"event",inputs:[{type:"address",name:"token",indexed:!0}]},{name:"PortalPaused",type:"event",inputs:[{type:"address",name:"account",indexed:!0}]},{name:"PortalResumed",type:"event",inputs:[{type:"address",name:"account",indexed:!0}]},{name:"AbdicationScheduled",type:"event",inputs:[{type:"uint8",name:"capability",indexed:!0},{type:"uint64",name:"effectiveAt"}]},{name:"RpcUrlUpdated",type:"event",inputs:[{type:"string",name:"rpcUrl"}]},{name:"SequencerEncryptionKeyUpdated",type:"event",inputs:[{type:"bytes32",name:"x"},{type:"uint8",name:"yParity"},{type:"address",name:"pubkey"},{type:"uint256",name:"keyIndex"},{type:"uint64",name:"activationBlock"}]},{name:"BatchSubmitted",type:"event",inputs:[{type:"uint64",name:"withdrawalBatchIndex",indexed:!0},{type:"uint256",name:"withdrawalQueueIndex",indexed:!0},{type:"bytes32",name:"nextProcessedDepositQueueHash"},{type:"bytes32",name:"nextBlockHash"},{type:"bytes32",name:"withdrawalQueueHash"},{type:"uint64",name:"lastProcessedDepositNumber"}]},{name:"WithdrawalProcessed",type:"event",inputs:[{type:"address",name:"to",indexed:!0},{type:"bytes32",name:"senderTag",indexed:!0},{type:"address",name:"token"},{type:"uint128",name:"amount"},{type:"bool",name:"callbackSuccess"}]},{name:"WithdrawalBounceBack",type:"event",inputs:[{type:"bytes32",name:"newCurrentDepositQueueHash",indexed:!0},{type:"uint64",name:"fallbackNonce",indexed:!0},{type:"address",name:"token"},{type:"uint128",name:"amount"},{type:"uint64",name:"depositNumber"}]},{name:"DepositBounceBack",type:"event",inputs:[{type:"address",name:"tempoRefundRecipient",indexed:!0},{type:"address",name:"token"},{type:"uint128",name:"amount"},{type:"uint128",name:"bouncebackFee"}]},{name:"DepositBounceBackPending",type:"event",inputs:[{type:"address",name:"tempoRefundRecipient",indexed:!0},{type:"address",name:"token"},{type:"uint128",name:"amount"},{type:"uint128",name:"bouncebackFee"}]},{name:"RefundClaimed",type:"event",inputs:[{type:"address",name:"recipient",indexed:!0},{type:"address",name:"token",indexed:!0},{type:"uint128",name:"amount"}]},{name:"ZoneGasRateUpdated",type:"event",inputs:[{type:"uint128",name:"zoneGasRate"}]},{name:"MaxTempoGasRateUpdated",type:"event",inputs:[{type:"uint128",name:"maxTempoGasRate"}]},{name:"BouncebackGasUpdated",type:"event",inputs:[{type:"uint64",name:"bouncebackGas"}]},{name:"AdminTransferStarted",type:"event",inputs:[{type:"address",name:"currentAdmin",indexed:!0},{type:"address",name:"pendingAdmin",indexed:!0}]},{name:"AdminTransferred",type:"event",inputs:[{type:"address",name:"previousAdmin",indexed:!0},{type:"address",name:"newAdmin",indexed:!0}]},{name:"NotSequencer",type:"error",inputs:[]},{name:"NotAdmin",type:"error",inputs:[]},{name:"NotPauseAuthority",type:"error",inputs:[]},{name:"CapabilityAbdicated",type:"error",inputs:[{type:"uint8",name:"capability"}]},{name:"AbdicationAlreadyScheduled",type:"error",inputs:[{type:"uint8",name:"capability"}]},{name:"PortalIsPaused",type:"error",inputs:[]},{name:"NotPendingAdmin",type:"error",inputs:[]},{name:"InvalidProof",type:"error",inputs:[]},{name:"InvalidTempoBlockNumber",type:"error",inputs:[]},{name:"NotFactory",type:"error",inputs:[]},{name:"NotSelf",type:"error",inputs:[]},{name:"AlreadyInitialized",type:"error",inputs:[]},{name:"MustDelegateCall",type:"error",inputs:[]},{name:"CallbackRejected",type:"error",inputs:[]},{name:"TransferFailed",type:"error",inputs:[]},{name:"ReentrantWithdrawal",type:"error",inputs:[]},{name:"EncryptionKeyExpired",type:"error",inputs:[{type:"uint256",name:"keyIndex"},{type:"uint64",name:"activationBlock"},{type:"uint64",name:"supersededAtBlock"}]},{name:"InvalidEncryptionKeyIndex",type:"error",inputs:[{type:"uint256",name:"keyIndex"}]},{name:"NoEncryptionKeySet",type:"error",inputs:[]},{name:"NoEncryptionKeyAtBlock",type:"error",inputs:[{type:"uint64",name:"blockNumber"}]},{name:"InvalidEphemeralPubkey",type:"error",inputs:[]},{name:"InvalidCiphertextLength",type:"error",inputs:[{type:"uint256",name:"actual"},{type:"uint256",name:"expected"}]}
493,{name:"InvalidProofOfPossession",type:"error",inputs:[]},{name:"DepositTooSmall",type:"error",inputs:[]},{name:"TokenEnablementBlockCapacityExceeded",type:"error",inputs:[{type:"uint64",name:"maximum"}]},{name:"TokenMetadataTooLong",type:"error",inputs:[]},{name:"GasFeeRateTooHigh",type:"error",inputs:[]},{name:"DepositsNotActive",type:"error",inputs:[]},{name:"TokenAlreadyEnabled",type:"error",inputs:[]},{name:"TokenTransferPolicyNotSet",type:"error",inputs:[]},{name:"InvalidDepositTransition",type:"error",inputs:[]},{name:"InvalidSequencerSet",type:"error",inputs:[]},{name:"SequencerConfigurationUnchanged",type:"error",inputs:[]},{name:"InvalidQuorumCertificate",type:"error",inputs:[]},{name:"CallbackDidNotReturnToZone",type:"error",inputs:[]},{name:"InvalidBouncebackRecipient",type:"error",inputs:[]},{name:"TokenNotEnabled",type:"error",inputs:[]},{name:"DepositBlockCapacityExceeded",type:"error",inputs:[{type:"uint64",name:"maximum"}]},{name:"InvalidCallbackTarget",type:"error",inputs:[]},{name:"AccountNotAllowed",type:"error",inputs:[{type:"address",name:"account"}]},{name:"InvalidLeader",type:"error",inputs:[]},{name:"ActiveLeaderRemoved",type:"error",inputs:[]},{name:"LeaderAlreadyUpdatedThisBlock",type:"error",inputs:[]},{name:"StaleLeadershipEpoch",type:"error",inputs:[{type:"uint64",name:"expected"},{type:"uint64",name:"actual"}]},{name:"deposit",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"_token"},{type:"address",name:"to"},{type:"uint128",name:"amount"},{type:"bytes32",name:"memo"},{type:"address",name:"tempoRefundRecipient"}],outputs:[{type:"bytes32"}]}];[...Ha,...eSe,...tSe,...oSe,...aSe,...V3,...nSe,...rSe,...Yte,...iSe,...sSe,...uSe,...lSe,...cSe,...dSe,...fSe,...hSe,...pSe,...mSe];function Jte(t){const e=t.account;return e!=null&&e.keyType&&e.keyType!=="secp256k1"||(e==null?void 0:e.source)==="accessKey"||(e==null?void 0:e.source)==="multisig"||typeof t.calls<"u"||typeof t.feePayer<"u"||typeof t.feePayerSignature<"u"||typeof t.feeToken<"u"||typeof t.keyAuthorization<"u"||typeof t.multisig<"u"||typeof t.multisigVersion<"u"||typeof t.nonceKey<"u"||typeof t.signature<"u"||typeof t.signatures<"u"||typeof t.validBefore<"u"||typeof t.validAfter<"u"?"tempo":t.type?t.type:YI(t)}function HN(t){try{return Jte(t)==="tempo"}catch{return!1}}async function ySe(t,e){if(!HN(t)){if(e&&"type"in e&&e.type!=="secp256k1")throw new Error("Unsupported signature type. Expected `secp256k1` but got `"+e.type+"`.");if(e&&"type"in e){const{r,s:i,yParity:s}=e==null?void 0:e.signature;return U3(t,{r:He(r,{size:32}),s:He(i,{size:32}),yParity:s})}return U3(t,e)}if(Jte(t)==="tempo")return gSe(t,e);throw new Error("Unsupported transaction type")}async function gSe(t,e){var b;const n=(()=>{if(t.signature)return t.signature;if(e&&"type"in e)return e;if(e)return Ns({r:BigInt(e.r),s:BigInt(e.s),yParity:Number(e.yParity)})})(),{chainId:r,feePayer:i,nonce:s,...a}=t,o=(()=>{const v=t.feePayerSignature;if(v)return{r:BigInt(v.r),s:BigInt(v.s),yParity:Number(v.yParity)};if(v===null||i)return null})(),l=typeof t.feePayerSignature<"u"&&t.feePayerSignature!==null,u=typeof n<"u"||!!(t.multisig&&t.signatures),f=i===!0&&(!u||!o)||typeof i=="object"&&!u||!u&&l,p={...a,calls:(b=a.calls)!=null&&b.length?a.calls:[{to:a.to||(!a.data||a.data==="0x"?"0x0000000000000000000000000000000000000000":void 0),value:a.value,data:a.data}],chainId:Number(r),feePayerSignature:o,type:"tempo",...s?{nonce:BigInt(s)}:{}},y={...p};f&&delete y.feeToken;const g=(()=>{var A;if(n)return n;if(!t.multisig||!t.signatures)return;const v=M8(j8(y)),_=t.signatures.map(I=>Ns(I)),C=typeof t.multisig=="string"?oT({account:t.multisig,payload:v,signatures:_,version:t.multisigVersion}):oT({initialConfig:t.multisig,payload:v,signatures:_,version:t.multisigVersion}),S=(A=t.keyAuthorization)==null?void 0:A.signature,x=(S==null?void 0:S.type)==="multisig"&&typeof S.init<"u";return typeof t.multisig=="string"?Ns({account:t.multisig,signatures:C}):Ns({initialConfig:t.multisig,signatures:C,...s||t.nonceKey||x?{}:{init:!0}})})();if(g&&typeof t.feePayer=="object"){const v=j8(p,{signature:g}),_=t.from??hm({payload:M8(v),root:!0,signature:g}),C=GEe(v,{sender:_}),S=await t.feePayer.sign({hash:C});return Qd(v,{feePayerSignature:R7(S)})}return i===!0||!g&&l?g&&o?Qd(y,{signature:g}):g?Qd(y,{format:"feePayer",sender:t.from,signature:g}):Qd(y,{feePayerSignature:null}):Qd(y,{feePayerSignature:void 0,signature:g})}function WN(t){return t.source==="multisig"}async function Xte(t,e){const{init:n=!1,payload:r,signatures:i=[],states:s=[],version:a=0n}=e,o=s.find(g=>u2(g.account,t.address)),l=(o==null?void 0:o.config)??t.config;if(!l)throw new Error("Current multisig config is required for local signing.");const u=BN({account:t.address,payload:r,version:a}),f=[...i],p=new Set;let y=0;for(const g of i){const b=hm({payload:u,signature:g}).toLowerCase(),v=l.owners.find(_=>u2(_.owner,b));!v||p.has(b)||(p.add(b),y+=Number(v.weight))}for(const g of l.owners){const b=g.owner.toLowerCase();if(p.has(b))continue;const v=t.owners.find(_=>u2(_.address,g.owner));if(v){if(WN(v)){const _=s.find(C=>u2(C.account,v.address));if(_&&!_.initialized)throw new Error("Nested multisig owners must be initialized.");f.push(await Xte(v,{payload:u,states:s,version:_==null?void 0:_.version}))}else{if(!v.sign)throw new Error("Multisig owner account cannot sign.");f.push(Ns(await v.sign({hash:u})))}if(p.add(b),y+=Number(g.weight),y>=Number(l.threshold))break}}if(y<Number(l.threshold))throw new Error("Local multisig owners do not meet the threshold.");if(n&&!t.config)throw new Error("Initial multisig config is required for bootstrap.");return Ns({account:t.address,...n?{init:t.config}:{},signatures:oT({account:t.address,payload:r,signatures:f,version:a})})}function Qte(t){return t.source==="accessKey"&&"accessKeyAddress"in t}function ene(t,e){const{admin:n,chainId:r,expiry:i,key:s,limits:a,scopes:o,witness:l}=e,{accessKeyAddress:u,keyType:f}=tne(s),p=Qte(t)||WN(t)?{account:t.address}:{};return CEe({address:u,chainId:r,type:f,witness:l,...n?{isAdmin:!0}:{},...p,...n?{}:{expiry:i,limits:a,scopes:o}})}async function bSe(t,e){const{admin:n,chainId:r,expiry:i,key:s,limits:a,multisig:o,scopes:l,signatures:u,witness:f}=e,{accessKeyAddress:p,keyType:y}=tne(s),g=Qte(t),b=WN(t),v=g||b?{account:t.address}:{},_=n?{}:{expiry:i,limits:a,scopes:l},C=ene(t,e),S=await(async()=>
493{if(g)return t.sign({hash:C,raw:!0});if(b){if(!o)throw new Error("Multisig state is required to sign a key authorization.");return Af(await Xte(t,{init:o.init,payload:C,signatures:u==null?void 0:u.map(x=>Ns(x)),states:o.states,version:o.version}))}return t.sign({hash:C})})();return Fte({address:p,chainId:r,signature:Ns(S),type:y,...f?{witness:f}:{},...n?{isAdmin:!0}:{},...v,..._})}function tne(t){return"accessKeyAddress"in t?{accessKeyAddress:t.accessKeyAddress,keyType:t.keyType}:"publicKey"in t&&t.publicKey?{accessKeyAddress:b2(yN(t.publicKey)),keyType:t.type}:{accessKeyAddress:t.address,keyType:t.type}}Gte(0);Gte(0,42431);const $2="0xaAAAaaAA00000000000000000000000000000000",qN="0xAACC000000000000000000000000000000000000",wSe="0x5165300000000000000000000000000000000000",tz=["genesis","t0","t1","t1a","t1b","t1c","t2","t3","t4","t5","t6"];function vSe(t,e){return tz.indexOf(t)<tz.indexOf(e)}function nne(t){const e=new Map;return n=>{const r=n.toLowerCase(),i=e.get(r);if(i)return i;const s=(async()=>{var a;try{const o=await t(n);return{account:n,config:{owners:o.owners,threshold:o.threshold},initialized:!0,version:o.version}}catch(o){const l=o instanceof Se?o.walk(u=>u instanceof m3):void 0;if(!(l instanceof m3)||((a=l.data)==null?void 0:a.errorName)!=="NotMultisigAccount")throw o;return{account:n,initialized:!1,version:0n}}})();return e.set(r,s),s}}function rne(t,e){const n=[t],r=new Set([t.address.toLowerCase()]),i=s=>{for(const a of s.owners){if(a.source!=="multisig")continue;const o=a.address.toLowerCase();r.has(o)||(r.add(o),n.push(a),i(a))}};return i(t),Promise.all(n.map(s=>e(s.address)))}function Io(t){return{...t,data:cs(t),to:t.address}}async function dT(t,e){const{account:n,...r}=e;return ir(t,{...r,...dT.call({account:n})})}(function(t){function e(n){return Io({address:qN,abi:V3,args:[n.account],functionName:"isMultisigAccount"})}t.call=e})(dT||(dT={}));async function H3(t,e){const{account:n,...r}=e;return ir(t,{...r,...H3.call({account:n})})}(function(t){function e(n){return Io({address:qN,abi:V3,args:[n.account],functionName:"getConfig"})}t.call=e})(H3||(H3={}));async function hT(t,e){return hT.inner($o,t,e)}(function(t){async function e(i,s,a){const{owners:o,threshold:l,...u}=a;return await i(s,{...u,...t.call({owners:o,threshold:l})})}t.inner=e;function n(i){const s=H7(i);return Io({address:qN,abi:V3,args:[s.threshold,s.owners],functionName:"updateConfig"})}t.call=n;function r(i){const[s]=wc({abi:V3,logs:i,eventName:"MultisigConfigUpdated",strict:!0});if(!s)throw new Error("`MultisigConfigUpdated` event not found.");return s}t.extractEvent=r})(hT||(hT={}));const _Se={0:"secp256k1",1:"p256",2:"webAuthn"}
493,xSe={true:"limited",false:"unlimited"};async function fT(t,e){return fT.inner(am,t,e)}(function(t){async function e(r,i,s){var _;const{accessKey:a,admin:o,chainId:l=(_=i.chain)==null?void 0:_.id,expiry:u,limits:f,scopes:p,witness:y,...g}=s,b=g.account??i.account;if(!b)throw new Error("account is required.");if(!l)throw new Error("chainId is required.");const v=await ESe(i,{account:b,accessKey:a,chainId:l,admin:o,expiry:u,limits:f,scopes:p,witness:y});return await r(i,{...g,keyAuthorization:v})}t.inner=e;function n(r){const[i]=wc({abi:Ha,logs:r,eventName:"KeyAuthorized",strict:!0});if(!i)throw new Error("`KeyAuthorized` event not found.");return i}t.extractEvent=n})(fT||(fT={}));async function pT(t,e){return pT.inner($o,t,e)}(function(t){async function e(i,s,a){const{witness:o,...l}=a,u=t.call({witness:o});return await i(s,{...l,...u})}t.inner=e;function n(i){const{witness:s}=i;return Io({address:$2,abi:Ha,functionName:"burnKeyAuthorizationWitness",args:[s]})}t.call=n;function r(i){const[s]=wc({abi:Ha,logs:i,eventName:"KeyAuthorizationWitnessBurned",strict:!0});if(!s)throw new Error("`KeyAuthorizationWitnessBurned` event not found.");return s}t.extractEvent=r})(pT||(pT={}));async function W3(t,e){const{account:n=t.account,accessKey:r,...i}=e;if(!n)throw new Error("account is required.");const s=hn(n),a=await ir(t,{...i,account:null,...W3.call({account:s.address,accessKey:r})});return{address:a.keyId,keyType:_Se[a.signatureType]??"secp256k1",expiry:a.expiry,spendPolicy:xSe[`${a.enforceLimits}`],isRevoked:a.isRevoked}}(function(t){function e(n){const{account:r,accessKey:i}=n;return Io({address:$2,abi:Ha,functionName:"getKey",args:[r,w1(i)]})}t.call=e})(W3||(W3={}));async function D8(t,e){var f;const{account:n=t.account,accessKey:r,token:i,...s}=e;if(!n)throw new Error("account is required.");const a=hn(n),o=(f=t.chain)==null?void 0:f.hardfork;if(o&&vSe(o,"t3"))return{remaining:await ir(t,{...s,...D8.call({account:a.address,accessKey:r,token:i})}),periodEnd:void 0};const[l,u]=await ir(t,{...s,...D8.callWithPeriod({account:a.address,accessKey:r,token:i})});return{remaining:l,periodEnd:u}}(function(t){function e(r){const{account:i,accessKey:s,token:a}=r;return Io({address:$2,abi:Ha,functionName:"getRemainingLimit",args:[i,w1(s),a]})}t.call=e;function n(r){const{account:i,accessKey:s,token:a}=r;return Io({address:$2,abi:Ha,functionName:"getRemainingLimitWithPeriod",args:[i,w1(s),a]})}t.callWithPeriod=n})(D8||(D8={}));async function mT(t,e){const{account:n=t.account,accessKey:r,...i}=e;if(!n)throw new Error("account is required.");const s=hn(n);return ir(t,{...i,account:null,...mT.call({account:s.address,accessKey:r})})}(function(t){function e(n){const{account:r,accessKey:i}=n;return Io({address:$2,abi:Ha,functionName:"isAdminKey",args:[r,w1(i)]})}t.call=e})(mT||(mT={}));async function yT(t,e){const{account:n=t.account,witness:r,...i}=e;if(!n)throw new Error("account is required.");const s=hn(n);return ir(t,{...i,account:null,...yT.call({account:s.address,witness:r})})}(function(t){function e(n){const{account:r,witness:i}=n;return Io({address:$2,abi:Ha,functionName:"isKeyAuthorizationWitnessBurned",args:[r,i]})}t.call=e})(yT||(yT={}));async function gT(t,e){return gT.inner($o,t,e)}(function(t){async function e(i,s,a){const{accessKey:o,...l}=a,u=t.call({accessKey:o});return await i(s,{...l,...u})}t.inner=e;function n(i){const{accessKey:s}=i;return Io({address:$2,abi:Ha,functionName:"revokeKey",args:[w1(s)]})}t.call=n;function r(i){const[s]=wc({abi:Ha,logs:i,eventName:"KeyRevoked",strict:!0});if(!s)throw new Error("`KeyRevoked` event not found.");return s}t.extractEvent=r})(gT||(gT={}));async function CSe(t,e){var l;const{chainId:n=(l=t.chain)==null?void 0:l.id}=e,r=e.account??t.account;if(!r)throw new Error("account is required.");if(!n)throw new Error("chainId is required.");const i=hn(r),s=await(async()=>{if("multisig"in e)return e.multisig;if(i.source!=="multisig")return;const u=i,f=nne(g=>H3(t,{account:g})),p=await rne(u,f),y=p[0];return{init:!y.initialized,states:p,version:y.version}})(),a=ene(i,{...e,chainId:BigInt(n),key:e.accessKey}),o=i.source==="multisig"&&s?BN({account:i.address,payload:a,version:s.version}):a;return{...e,account:i,chainId:n,multisig:s,signPayload:o}}async function ESe(t,e){const n="multisig"in e?e:await CSe(t,e),{accessKey:r,account:i,chainId:s,multisig:a,signPayload:o,...l}=n;return bSe(i,{chainId:BigInt(s),key:r,multisig:a,...l})}async function bT(t,e){return bT.inner($o,t,e)}(function(t){async function e(i,s,a){const{accessKey:o,token:l,limit:u,...f}=a,p=t.call({accessKey:o,token:l,limit:u});return await i(s,{...f,...p})}t.inner=e;function n(i){const{accessKey:s,token:a,limit:o}=i;return Io({address:$2,abi:Ha,functionName:"updateSpendingLimit",args:[w1(s),a,o]})}t.call=n;function r(i){const[s]=wc({abi:Ha,logs:i,eventName:"SpendingLimitUpdated",strict:!0});if(!s)throw new Error("`SpendingLimitUpdated` event not found.");return s}t.extractEvent=r})(bT||(bT={}));async function wT(t,e){const{account:n,admin:r,hash:i,signature:s,...a}=e;return ir(t,{...a,...wT.call({account:n,admin:r,hash:i,signature:s})})}(function(t){function e(n){const{account:r,admin:i=!0,hash:s,signature:a}=n;return Io({address:wSe,abi:Yte,functionName:i?"verifyKeychainAdmin":"verifyKeychain",args:[r,s,a]})}t.call=e})(wT||(wT={}));function w1(t){return typeof t=="string"?t:t.accessKeyAddress}function SSe(t){if(!HN(t))return X1(t);const e=t.blockTimestamp==null?void 0:BigInt(t.blockTimestamp),{feePayerSignature:n,gasPrice:r,nonce:i,...s}=OEe(t);return{...s,accessList:s.accessList,...typeof e<"u"&&{blockTimestamp:e},feePayerSignature:n?{r:He(n.r,{size:32}),s:He(n.s,{size:32}),v:BigInt(n.v??27),yParity:n.yParity}:void 0,nonce:Number(i),typeHex:qte[s.type],type:s.type}}function ASe(t){return J6(t)}function kSe(t,e){const n=t,r=n.account?hn(n.account):void 0;if(!HN(n))return yc(t);e&&(n.calls=n.calls??[{to:t.to||(!t.data||t.data==="0x"?"0x0000000000000000000000000000000000000000":void 0),value:t.value,data:t.data}]),n.feePayer===!0&&!n.feePayerSignature&&delete n.feeToken;const{multisig:i,multisigInit:s,multisigOwnerStates:a,multisigSignatureCount:o,multisigVersion:l,signatures:u,...f}=n,p=REe({...f,type:"tempo"});e==="estimateGas"&&(p.maxFeePerGas=void 0,p.maxPriorityFeePerGas=void 0),p.to=void 0,p.data=void 0,p.value=void 0;const[y,g]=(()=>{const v=r&&"keyType"in r?r.keyType:r==null?void 0:r.source;return v?v==="webAuthn"?["webAuthn","0x0578"]:["p256","secp256k1"].includes(v)?[v,void 0]:[n.keyType,nz(n.keyData)]:[n.keyType,nz(n.keyData)]})(),b=r&&"accessKeyAddress"in r?r.accessKeyAddress:n.keyId;return r&&(p.from=r.address),{...p,...s?{multisigInit:s}:{},...typeof o<"u"?{multisigSignatureCount:o}:{},...n.capabilities?{capabilities:n.capabilities}:{},...g?{keyData:g}:{},...b?{keyId:b}:{},...y?{keyType:y}:{},...typeof n.feePayer<"u"?{feePayer:typeof n.feePayer=="object"?hn(n.feePayer):n.feePayer}:{},..."feePayerSignature"in n&&n.feePayerSignature!==void 0?{feePayerSignature:n.feePayerSignature}:{}}}function nz(t){if(!t)return t;const e=(t.length-2)/2;return e<=4?t:He(e,{size:2})}const Qp=new Map;async function TSe(t){Qp.set(t,(Qp.get(t)??0)+1),await Promise.resolve();const e=(Qp.get(t)??0)>1;return queueMicrotask(()=>{const n=Qp.get(t)??0;n<=1?Qp.delete(t):Qp.set(t,n-1)}),e}const LSe=25;function $Se(){const e=BigInt(Math.floor(Date.now()/1e3))-60n;return e<=0n?0:Number(BigInt(YQ(8))%e)}const ine={blockTime:1e3,extendSchema:B7e(),formatters:{transaction:VI({exclude:["aaAuthorizationList"],format:SSe}),transactionReceipt:cN({format:ASe}),transactionRequest:_Q({format:kSe})},prepareTransactionRequest:[async(t,{client:e,phase:n})=>{var a,o,l,u,f,p,y,g,b,v;const r=t;if(n==="afterFillParameters")return typeof r.gas<"u"&&r.feePayer&&!r.feePayerSignature&&(((a=r.keyAuthorization)==null?void 0:a.signature.type)==="webAuthn"?r.gas=(r.gas??0n)+20000n:((o=r.account)==null?void 0:o.source)==="accessKey"&&(r.gas=(r.gas??0n)+10000n)),r;const i=r.multisig??(((l=r.account)==null?void 0:l.source)==="multisig"?r.account.config??r.account.address:void 0);if(i){const _=typeof i=="string"?void 0:H7(i),C=typeof i=="string"?i:dm(_);r.multisig=_??i,r.from=C,typeof r.keyType>"u"&&(r.keyType="webAuthn",typeof r.keyData>"u"&&(r.keyData="0x0578"));const S=nne(P=>Ye(e,H3,"getConfig")({account:P})),x=((u=r.account)==null?void 0:u.source)==="multisig"?rne(r.account,S):void 0,A=x?(await x)[0]:await S(C);if(!_&&!A.initialized)throw new Error("Cannot prepare an uninitialized multisig account from an address. Provide its initial config instead.");typeof r.multisigVersion>"u"&&(r.multisigVersion=A.version);const I=(f=r.keyAuthorization)==null?void 0:f.signature;(I==null?void 0:I.type)==="multisig"&&typeof I.init<"u"&&(r.keyAuthorization={...r.keyAuthorization,signature:Ns({initialConfig:I.init,signatures:I.signatures})});const $=(p=r.keyAuthorization)==null?void 0:p.signature,O=($==null?void 0:$.type)==="multisig"&&typeof $.init<"u";if(_&&!O&&(r.multisigInit={salt:_.salt??um,threshold:Number(_.threshold),owners:_.owners.map(P=>({owner:P.owner,weight:Number(P.weight)}))}),x){const P=await x;P.length>0&&(r.multisigOwnerStates=P)}((y=r.account)==null?void 0:y.source)!=="multisig"&&delete r.account}if(await(async()=>
493{if(r.nonceKey==="expiring"||r.nonceKey===d1)return!0;if(i)return!1;if(r.feePayer&&typeof r.nonceKey>"u")return!0;const _=r.account,C=typeof _=="string"?_:_==null?void 0:_.address;return C&&typeof r.nonceKey>"u"?await TSe(C.toLowerCase()):!1})()?(r.nonceKey=d1,r.nonce=0,typeof r.validAfter>"u"&&(r.validAfter=$Se()),typeof r.validBefore>"u"&&(r.validBefore=Math.floor(Date.now()/1e3)+LSe)):typeof r.nonceKey<"u"&&(r.nonce=typeof r.nonce=="number"?r.nonce:0),!r.keyAuthorization&&((g=r.account)==null?void 0:g.source)==="accessKey"){const _=r.account.keyAuthorizationManager;if(_){const C=r.chainId??((b=r.chain)==null?void 0:b.id);if(typeof C<"u"){const S=r.account.address,x=r.account.accessKeyAddress,A={address:S,accessKey:x,chainId:C},I=await _.get(A);if(I){const $=BigInt(Math.floor(Date.now()/1e3));if(I.expiry!=null&&BigInt(I.expiry)<=$)await _.remove(A);else{const O=await Ye(e,W3,"getMetadata")({account:S,accessKey:x});oc(O.address,x)&&!O.isRevoked&&O.expiry>$?await _.remove(A):r.keyAuthorization=I}}}}}return!r.feeToken&&((v=r.chain)!=null&&v.feeToken)&&(r.feeToken=r.chain.feeToken),r},{runAt:["beforeFillTransaction","afterFillParameters"]}],serializers:{transaction:((t,e)=>ySe(t,e))},async verifyHash(t,e){const{address:n,hash:r,signature:i,mode:s}=e,a=(()=>{if(typeof i=="string")try{return s5(i)}catch{return}})();if(a){if((a==null?void 0:a.type)==="keychain"&&s==="allowAccessKey"){const o=a.version==="v2"?Ni(fr("0x04",r,n)):r,l=(()=>{try{return hm({payload:o,signature:a.inner})}catch{return}})();if(!l)return!1;const u=await W3(t,{account:n,accessKey:l,blockHash:e.blockHash,blockNumber:e.blockNumber,blockTag:e.blockTag,requireCanonical:e.requireCanonical});return u.isRevoked||u.expiry<=BigInt(Math.floor(Date.now()/1e3))?!1:JF(a.inner,{address:l,payload:o})}if(a.type==="p256"||a.type==="webAuthn"){const o=await D3(t,{address:n,blockHash:e.blockHash,blockNumber:e.blockNumber,blockTag:e.blockTag,requireCanonical:e.requireCanonical});if(!o||o==="0xef01007702c00000000000000000000000000000000000")return JF(a,{address:n,payload:r})}}return await Ye(t,e5,"verifyHash")({...e,chain:null})}},uf=xi({...ine,id:4217,blockExplorers:{default:{name:"Tempo Explorer",url:"https://explore.tempo.xyz"}},name:"Tempo Mainnet",nativeCurrency:{name:"USD",symbol:"USD",decimals:6},rpcUrls:{default:{http:["https://rpc.tempo.xyz"],webSocket:["wss://rpc.tempo.xyz"]}}}),q3=xi({...ine,id:42431,hardfork:"t5",blockExplorers:{default:{name:"Tempo Explorer",url:"https://explore.testnet.tempo.xyz"}},name:"Tempo Testnet (Moderato)",nativeCurrency:{name:"USD",symbol:"USD",decimals:6},rpcUrls:{default:{http:["https://rpc.moderato.tempo.xyz"],webSocket:["wss://rpc.moderato.tempo.xyz"]}},testnet:!0});var Ln;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const s={};for(const a of i)s[a]=a;return s},t.getValidEnumValues=i=>{const s=t.objectKeys(i).filter(o=>typeof i[i[o]]!="number"),a={};for(const o of s)a[o]=i[o];return t.objectValues(a)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&s.push(a);return s},t.find=(i,s)=>{for(const a of i)if(s(a))return a},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(s)}t.joinValues=r,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(Ln||(Ln={}));var rz;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(rz||(rz={}));const ct=Ln.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),qd=t=>{switch(typeof t){case"undefined":return ct.undefined;case"string":return ct.string;case"number":return Number.isNaN(t)?ct.nan:ct.number;case"boolean":return ct.boolean;case"function":return ct.function;case"bigint":return ct.bigint;case"symbol":return ct.symbol;case"object":return Array.isArray(t)?ct.array:t===null?ct.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ct.promise:typeof Map<"u"&&t instanceof Map?ct.map:typeof Set<"u"&&t instanceof Set?ct.set:typeof Date<"u"&&t instanceof Date?ct.date:ct.object;default:return ct.unknown}}
vendor: 4,717 bytes, line 493
493,Ve=Ln.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);let kf=class sne extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(s){return s.message},r={_errors:[]},i=s=>{for(const a of s.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let o=r,l=0;for(;l<a.path.length;){const u=a.path[l];l===a.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(n(a))):o[u]=o[u]||{_errors:[]},o=o[u],l++}}};return i(this),r}static assert(e){if(!(e instanceof sne))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ln.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const i of this.issues)if(i.path.length>0){const s=i.path[0];n[s]=n[s]||[],n[s].push(e(i))}else r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};kf.create=t=>new kf(t);const vT=(t,e)=>{let n;switch(t.code){case Ve.invalid_type:t.received===ct.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case Ve.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Ln.jsonStringifyReplacer)}`;break;case Ve.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ln.joinValues(t.keys,", ")}`;break;case Ve.invalid_union:n="Invalid input";break;case Ve.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ln.joinValues(t.options)}`;break;case Ve.invalid_enum_value:n=`Invalid enum value. Expected ${Ln.joinValues(t.options)}, received '${t.received}'`;break;case Ve.invalid_arguments:n="Invalid function arguments";break;case Ve.invalid_return_type:n="Invalid function return type";break;case Ve.invalid_date:n="Invalid date";break;case Ve.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Ln.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case Ve.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case Ve.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case Ve.custom:n="Invalid input";break;case Ve.invalid_intersection_types:n="Intersection results could not be merged";break;case Ve.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case Ve.not_finite:n="Number must be finite";break;default:n=e.defaultError,Ln.assertNever(t)}return{message:n}};let ISe=vT;function NSe(){return ISe}const OSe=t=>
vendor: 7,402 bytes, line 493
493{const{data:e,path:n,errorMaps:r,issueData:i}=t,s=[...n,...i.path||[]],a={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let o="";const l=r.filter(u=>!!u).slice().reverse();for(const u of l)o=u(a,{data:e,defaultError:o}).message;return{...i,path:s,message:o}};function tt(t,e){const n=NSe(),r=OSe({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===vT?void 0:vT].filter(i=>!!i)});t.common.issues.push(r)}let Cl=class ane{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const i of n){if(i.status==="aborted")return zt;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const i of n){const s=await i.key,a=await i.value;r.push({key:s,value:a})}return ane.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const i of n){const{key:s,value:a}=i;if(s.status==="aborted"||a.status==="aborted")return zt;s.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(r[s.value]=a.value)}return{status:e.value,value:r}}};const zt=Object.freeze({status:"aborted"}),og=t=>({status:"dirty",value:t}),Do=t=>({status:"valid",value:t}),iz=t=>t.status==="aborted",sz=t=>t.status==="dirty",v1=t=>t.status==="valid",U8=t=>typeof Promise<"u"&&t instanceof Promise;var pt;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(pt||(pt={}));let I2=class{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};const az=(t,e)=>{if(v1(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new kf(t.common.issues);return this._error=n,this._error}}};function sn(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(a,o)=>{const{message:l}=t;return a.code==="invalid_enum_value"?{message:l??o.defaultError}:typeof o.data>"u"?{message:l??r??o.defaultError}:a.code!=="invalid_type"?{message:o.defaultError}:{message:l??n??o.defaultError}},description:i}}let En=class{get description(){return this._def.description}_getType(e){return qd(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:qd(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Cl,ctx:{common:e.parent.common,data:e.data,parsedType:qd(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(U8(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:qd(e)},i=this._parseSync({data:e,path:r.path,parent:r});return az(r,i)}"~validate"(e){var r,i;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:qd(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:n});return v1(s)?{value:s.value}:{issues:n.common.issues}}catch(s){(i=(r=s==null?void 0:s.message)==null?void 0:r.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(s=>v1(s)?{value:s.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:qd(e)},i=this._parse({data:e,path:r.path,parent:r}),s=await(U8(i)?i:Promise.resolve(i));return az(r,s)}refine(e,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,s)=>{const a=e(i),o=()=>s.addIssue({code:Ve.custom,...r(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(o(),!1)):a?!0:(o(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new x1({schema:this,typeName:Vt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return w2.create(this,this._def)}nullable(){return C1.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return _1.create(this)}promise(){return z8.create(this,this._def)}or(e){return B8.create([this,e],this._def)}and(e){return F8.create(this,e,this._def)}transform(e){return new x1({...sn(this._def),schema:this,typeName:Vt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new TT({...sn(this._def),innerType:this,defaultValue:n,typeName:Vt.ZodDefault})}brand(){return new nAe({typeName:Vt.ZodBranded,type:this,...sn(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new LT({...sn(this._def),innerType:this,catchValue:n,typeName:Vt.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return rAe.create(this,e)}readonly(){return $T.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};const PSe=/^c[^\s-]{8,}$/i,RSe=/^[0-9a-z]+$/,jSe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,MSe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,DSe=/^[a-z0-9_-]{21}
vendor: 10,533 bytes, line 493
493$/i,USe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,BSe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,FSe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,zSe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let lE;const VSe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,HSe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,WSe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,qSe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ZSe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,KSe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,one="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",GSe=new RegExp(`^${one}$`);function lne(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function YSe(t){return new RegExp(`^${lne(t)}$`)}function JSe(t){let e=`${one}T${lne(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function XSe(t,e){return!!((e==="v4"||!e)&&VSe.test(t)||(e==="v6"||!e)&&WSe.test(t))}function QSe(t,e){if(!USe.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function eAe(t,e){return!!((e==="v4"||!e)&&HSe.test(t)||(e==="v6"||!e)&&qSe.test(t))}let _T=class lg extends En{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ct.string){const s=this._getOrReturnCtx(e);return tt(s,{code:Ve.invalid_type,expected:ct.string,received:s.parsedType}),zt}const r=new Cl;let i;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),tt(i,{code:Ve.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),tt(i,{code:Ve.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const a=e.data.length>s.value,o=e.data.length<s.value;(a||o)&&(i=this._getOrReturnCtx(e,i),a?tt(i,{code:Ve.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&tt(i,{code:Ve.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")FSe.test(e.data)||(i=this._getOrReturnCtx(e,i),tt(i,{validation:"email",code:Ve.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")lE||(lE=new RegExp(zSe,"u")),lE.test(e.data)||(i=this._getOrReturnCtx(e,i),tt(i,{validation:"emoji",code:Ve.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")MSe.test(e.data)||(i=this._getOrReturnCtx(e,i),tt(i,{validation:"uuid",code:Ve.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")DSe.test(e.data)||(i=this._getOrReturnCtx(e,i),tt(i,{validation:"nanoid",code:Ve.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")PSe.test(e.data)||(i=this._getOrReturnCtx(e,i),tt(i,{validation:"cuid",code:Ve.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")RSe.test(e.data)||(i=this._getOrReturnCtx(e,i),tt(i,{validation:"cuid2",code:Ve.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")jSe.test(e.data)||(i=this._getOrReturnCtx(e,i),tt(i,{validation:"ulid",code:Ve.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),tt(i,{validation:"url",code:Ve.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),tt(i,{validation:"regex",code:Ve.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),tt(i,{code:Ve.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),tt(i,{code:Ve.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),tt(i,{code:Ve.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?JSe(s).test(e.data)||(i=this._getOrReturnCtx(e,i),tt(i,{code:Ve.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?GSe.test(e.data)||(i=this._getOrReturnCtx(e,i),tt(i,{code:Ve.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?YSe(s).test(e.data)||(i=this._getOrReturnCtx(e,i),tt(i,{code:Ve.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?BSe.test(e.data)||(i=this._getOrReturnCtx(e,i),tt(i,{validation:"duration",code:Ve.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?XSe(e.data,s.version)||(i=this._getOrReturnCtx(e,i),tt(i,{validation:"ip",code:Ve.invalid_string,message:s.message}),r.dirty()):s.kind==="jwt"?QSe(e.data,s.alg)||(i=this._getOrReturnCtx(e,i),tt(i,{validation:"jwt",code:Ve.invalid_string,message:s.message}),r.dirty()):s.kind==="cidr"?eAe(e.data,s.version)||(i=this._getOrReturnCtx(e,i),tt(i,{validation:"cidr",code:Ve.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?ZSe.test(e.data)||(i=this._getOrReturnCtx(e,i),tt(i,{validation:"base64",code:Ve.invalid_string,message:s.message}),r.dirty()):s.kind==="base64url"?KSe.test(e.data)||(i=this._getOrReturnCtx(e,i),tt(i,{validation:"base64url",code:Ve.invalid_string,message:s.message}),r.dirty()):Ln.assertNever(s);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:Ve.invalid_string,...pt.errToObj(r)})}_addCheck(e){return new lg({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...pt.errToObj(e)})}url(e){return this._addCheck({kind:"url",...pt.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...pt.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...pt.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...pt.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...pt.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...pt.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...pt.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...pt.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...pt.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...pt.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...pt.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...pt.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...pt.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...pt.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...pt.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...pt.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...pt.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...pt.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...pt.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...pt.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...pt.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...pt.errToObj(n)})}nonempty(e){return this.min(1,pt.errToObj(e))}trim(){return new lg({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new lg({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new lg({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}
vendor: 13,201 bytes, line 493
493get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};_T.create=t=>new _T({checks:[],typeName:Vt.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...sn(t)});function tAe(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,s=Number.parseInt(t.toFixed(i).replace(".","")),a=Number.parseInt(e.toFixed(i).replace(".",""));return s%a/10**i}let oz=class xT extends En{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==ct.number){const s=this._getOrReturnCtx(e);return tt(s,{code:Ve.invalid_type,expected:ct.number,received:s.parsedType}),zt}let r;const i=new Cl;for(const s of this._def.checks)s.kind==="int"?Ln.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),tt(r,{code:Ve.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),tt(r,{code:Ve.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),tt(r,{code:Ve.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?tAe(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),tt(r,{code:Ve.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),tt(r,{code:Ve.not_finite,message:s.message}),i.dirty()):Ln.assertNever(s);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,pt.toString(n))}gt(e,n){return this.setLimit("min",e,!1,pt.toString(n))}lte(e,n){return this.setLimit("max",e,!0,pt.toString(n))}lt(e,n){return this.setLimit("max",e,!1,pt.toString(n))}setLimit(e,n,r,i){return new xT({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:pt.toString(i)}]})}_addCheck(e){return new xT({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:pt.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:pt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:pt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:pt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:pt.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:pt.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:pt.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:pt.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:pt.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Ln.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}};oz.create=t=>new oz({checks:[],typeName:Vt.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...sn(t)});let lz=class CT extends En{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==ct.bigint)return this._getInvalidInput(e);let r;const i=new Cl;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),tt(r,{code:Ve.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),tt(r,{code:Ve.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),tt(r,{code:Ve.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):Ln.assertNever(s);return{status:i.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return tt(n,{code:Ve.invalid_type,expected:ct.bigint,received:n.parsedType}),zt}gte(e,n){return this.setLimit("min",e,!0,pt.toString(n))}gt(e,n){return this.setLimit("min",e,!1,pt.toString(n))}lte(e,n){return this.setLimit("max",e,!0,pt.toString(n))}lt(e,n){return this.setLimit("max",e,!1,pt.toString(n))}setLimit(e,n,r,i){return new CT({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:pt.toString(i)}]})}_addCheck(e){return new CT({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:pt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:pt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:pt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:pt.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:pt.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};lz.create=t=>new lz({checks:[],typeName:Vt.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...sn(t)});let cz=class extends En{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ct.boolean){const r=this._getOrReturnCtx(e);return tt(r,{code:Ve.invalid_type,expected:ct.boolean,received:r.parsedType}),zt}return Do(e.data)}};cz.create=t=>new cz({typeName:Vt.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...sn(t)});let uz=class cne extends En{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ct.date){const s=this._getOrReturnCtx(e);return tt(s,{code:Ve.invalid_type,expected:ct.date,received:s.parsedType}),zt}if(Number.isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return tt(s,{code:Ve.invalid_date}),zt}const r=new Cl;let i;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),tt(i,{code:Ve.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),tt(i,{code:Ve.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):Ln.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new cne({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:pt.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:pt.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};uz.create=t=>new uz({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:Vt.ZodDate,...sn(t)});let dz=class extends En{_parse(e){if(this._getType(e)!==ct.symbol){const r=this._getOrReturnCtx(e);return tt(r,{code:Ve.invalid_type,expected:ct.symbol,received:r.parsedType}),zt}return Do(e.data)}};dz.create=t=>new dz({typeName:Vt.ZodSymbol,...sn(t)});let hz=class extends En{_parse(e){if(this._getType(e)!==ct.undefined){const r=this._getOrReturnCtx(e);return tt(r,{code:Ve.invalid_type,expected:ct.undefined,received:r.parsedType}),zt}return Do(e.data)}};hz.create=t=>new hz({typeName:Vt.ZodUndefined,...sn(t)});let fz=class extends En{_parse(e){if(this._getType(e)!==ct.null){const r=this._getOrReturnCtx(e);return tt(r,{code:Ve.invalid_type,expected:ct.null,received:r.parsedType}),zt}return Do(e.data)}};fz.create=t=>new fz({typeName:Vt.ZodNull,...sn(t)});let pz=class extends En{constructor(){super(...arguments),this._any=!0}_parse(e){return Do(e.data)}};pz.create=t=>new pz({typeName:Vt.ZodAny,...sn(t)});let mz=class extends En{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Do(e.data)}};mz.create=t=>new mz({typeName:Vt.ZodUnknown,...sn(t)});let N2=class extends En{_parse(e){const n=this._getOrReturnCtx(e);return tt(n,{code:Ve.invalid_type,expected:ct.never,received:n.parsedType}),zt}};N2.create=t=>new N2({typeName:Vt.ZodNever,...sn(t)});let yz=class extends En{_parse(e){if(this._getType(e)!==ct.undefined){const r=this._getOrReturnCtx(e);return tt(r,{code:Ve.invalid_type,expected:ct.void,received:r.parsedType}),zt}return Do(e.data)}};yz.create=t=>new yz({typeName:Vt.ZodVoid,...sn(t)});let _1=class Tw extends En{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==ct.array)return tt(n,{code:Ve.invalid_type,expected:ct.array,received:n.parsedType}),zt;if(i.exactLength!==null){const a=n.data.length>i.exactLength.value,o=n.data.length<i.exactLength.value;(a||o)&&(tt(n,{code:a?Ve.too_big:Ve.too_small,minimum:o?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(tt(n,{code:Ve.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(tt(n,{code:Ve.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,o)=>i.type._parseAsync(new I2(n,a,n.path,o)))).then(a=>Cl.mergeArray(r,a));const s=[...n.data].map((a,o)=>i.type._parseSync(new I2(n,a,n.path,o)));return Cl.mergeArray(r,s)}get element(){return this._def.type}min(e,n){return new Tw({...this._def,minLength:{value:e,message:pt.toString(n)}})}max(e,n){return new Tw({...this._def,maxLength:{value:e,message:pt.toString(n)}})}length(e,n){return new Tw({...this._def,exactLength:{value:e,message:pt.toString(n)}})}nonempty(e){return this.min(1,e)}};_1.create=(t,e)=>new _1({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Vt.ZodArray,...sn(e)});function v0(t){if(t instanceof Ou){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=w2.create(v0(r))}return new Ou({...t._def,shape:()=>e})}else return t instanceof _1?new _1({...t._def,type:v0(t.element)}):t instanceof w2?w2.create(v0(t.unwrap())):t instanceof C1?C1.create(v0(t.unwrap())):t instanceof Z3?Z3.create(t.items.map(e=>v0(e))):t}let Ou=class tl extends En{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Ln.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==ct.object){const u=this._getOrReturnCtx(e);return tt(u,{code:Ve.invalid_type,expected:ct.object,received:u.parsedType}),zt}const{status:r,ctx:i}=this._processInputParams(e),{shape:s,keys:a}=this._getCached(),o=[];if(!(this._def.catchall instanceof N2&&this._def.unknownKeys==="strip"))for(const u in i.data)a.includes(u)||o.push(u);const l=[];for(const u of a){const f=s[u],p=i.data[u];l.push({key:{status:"valid",value:u},value:f._parse(new I2(i,p,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof N2){const u=this._def.unknownKeys;if(u==="passthrough")for(const f of o)l.push({key:{status:"valid",value:f}
vendor: 4,148 bytes, line 493
493,value:{status:"valid",value:i.data[f]}});else if(u==="strict")o.length>0&&(tt(i,{code:Ve.unrecognized_keys,keys:o}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const f of o){const p=i.data[f];l.push({key:{status:"valid",value:f},value:u._parse(new I2(i,p,i.path,f)),alwaysSet:f in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const f of l){const p=await f.key,y=await f.value;u.push({key:p,value:y,alwaysSet:f.alwaysSet})}return u}).then(u=>Cl.mergeObjectSync(r,u)):Cl.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return pt.errToObj,new tl({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var s,a;const i=((a=(s=this._def).errorMap)==null?void 0:a.call(s,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:pt.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new tl({...this._def,unknownKeys:"strip"})}passthrough(){return new tl({...this._def,unknownKeys:"passthrough"})}extend(e){return new tl({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new tl({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Vt.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new tl({...this._def,catchall:e})}pick(e){const n={};for(const r of Ln.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new tl({...this._def,shape:()=>n})}omit(e){const n={};for(const r of Ln.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new tl({...this._def,shape:()=>n})}deepPartial(){return v0(this)}partial(e){const n={};for(const r of Ln.objectKeys(this.shape)){const i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}return new tl({...this._def,shape:()=>n})}required(e){const n={};for(const r of Ln.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof w2;)s=s._def.innerType;n[r]=s}return new tl({...this._def,shape:()=>n})}keyof(){return dne(Ln.objectKeys(this.shape))}};Ou.create=(t,e)=>new Ou({shape:()=>t,unknownKeys:"strip",catchall:N2.create(),typeName:Vt.ZodObject,...sn(e)});Ou.strictCreate=(t,e)=>new Ou({shape:()=>t,unknownKeys:"strict",catchall:N2.create(),typeName:Vt.ZodObject,...sn(e)});Ou.lazycreate=(t,e)=>new Ou({shape:t,unknownKeys:"strip",catchall:N2.create(),typeName:Vt.ZodObject,...sn(e)});let B8=class extends En{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function i(s){for(const o of s)if(o.result.status==="valid")return o.result;for(const o of s)if(o.result.status==="dirty")return n.common.issues.push(...o.ctx.common.issues),o.result;const a=s.map(o=>new kf(o.ctx.common.issues));return tt(n,{code:Ve.invalid_union,unionErrors:a}),zt}if(n.common.async)return Promise.all(r.map(async s=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(i);{let s;const a=[];for(const l of r){const u={...n,common:{...n.common,issues:[]},parent:null},f=l._parseSync({data:n.data,path:n.path,parent:u});if(f.status==="valid")return f;f.status==="dirty"&&!s&&(s={result:f,ctx:u}),u.common.issues.length&&a.push(u.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const o=a.map(l=>new kf(l));return tt(n,{code:Ve.invalid_union,unionErrors:o}),zt}}get options(){return this._def.options}};B8.create=(t,e)=>new B8({options:t,typeName:Vt.ZodUnion,...sn(e)});function ET(t,e){const n=qd(t),r=qd(e);if(t===e)return{valid:!0,data:t};if(n===ct.object&&r===ct.object){const i=Ln.objectKeys(e),s=Ln.objectKeys(t).filter(o=>i.indexOf(o)!==-1),a={...t,...e};for(const o of s){const l=ET(t[o],e[o]);if(!l.valid)return{valid:!1};a[o]=l.data}return{valid:!0,data:a}}else if(n===ct.array&&r===ct.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let s=0;s<t.length;s++){const a=t[s],o=e[s],l=ET(a,o);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===ct.date&&r===ct.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}
vendor: 13,667 bytes, line 493
493let F8=class extends En{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=(s,a)=>{if(iz(s)||iz(a))return zt;const o=ET(s.value,a.value);return o.valid?((sz(s)||sz(a))&&n.dirty(),{status:n.value,value:o.data}):(tt(r,{code:Ve.invalid_intersection_types}),zt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,a])=>i(s,a)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};F8.create=(t,e,n)=>new F8({left:t,right:e,typeName:Vt.ZodIntersection,...sn(n)});let Z3=class une extends En{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ct.array)return tt(r,{code:Ve.invalid_type,expected:ct.array,received:r.parsedType}),zt;if(r.data.length<this._def.items.length)return tt(r,{code:Ve.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),zt;!this._def.rest&&r.data.length>this._def.items.length&&(tt(r,{code:Ve.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((a,o)=>{const l=this._def.items[o]||this._def.rest;return l?l._parse(new I2(r,a,r.path,o)):null}).filter(a=>!!a);return r.common.async?Promise.all(s).then(a=>Cl.mergeArray(n,a)):Cl.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new une({...this._def,rest:e})}};Z3.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Z3({items:t,typeName:Vt.ZodTuple,rest:null,...sn(e)})};let gz=class extends En{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ct.map)return tt(r,{code:Ve.invalid_type,expected:ct.map,received:r.parsedType}),zt;const i=this._def.keyType,s=this._def.valueType,a=[...r.data.entries()].map(([o,l],u)=>({key:i._parse(new I2(r,o,r.path,[u,"key"])),value:s._parse(new I2(r,l,r.path,[u,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const l of a){const u=await l.key,f=await l.value;if(u.status==="aborted"||f.status==="aborted")return zt;(u.status==="dirty"||f.status==="dirty")&&n.dirty(),o.set(u.value,f.value)}return{status:n.value,value:o}})}else{const o=new Map;for(const l of a){const u=l.key,f=l.value;if(u.status==="aborted"||f.status==="aborted")return zt;(u.status==="dirty"||f.status==="dirty")&&n.dirty(),o.set(u.value,f.value)}return{status:n.value,value:o}}}};gz.create=(t,e,n)=>new gz({valueType:e,keyType:t,typeName:Vt.ZodMap,...sn(n)});let bz=class ST extends En{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ct.set)return tt(r,{code:Ve.invalid_type,expected:ct.set,received:r.parsedType}),zt;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(tt(r,{code:Ve.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(tt(r,{code:Ve.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const s=this._def.valueType;function a(l){const u=new Set;for(const f of l){if(f.status==="aborted")return zt;f.status==="dirty"&&n.dirty(),u.add(f.value)}return{status:n.value,value:u}}const o=[...r.data.values()].map((l,u)=>s._parse(new I2(r,l,r.path,u)));return r.common.async?Promise.all(o).then(l=>a(l)):a(o)}min(e,n){return new ST({...this._def,minSize:{value:e,message:pt.toString(n)}})}max(e,n){return new ST({...this._def,maxSize:{value:e,message:pt.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};bz.create=(t,e)=>new bz({valueType:t,minSize:null,maxSize:null,typeName:Vt.ZodSet,...sn(e)});let wz=class extends En{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};wz.create=(t,e)=>new wz({getter:t,typeName:Vt.ZodLazy,...sn(e)});let vz=class extends En{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return tt(n,{received:n.data,code:Ve.invalid_literal,expected:this._def.value}),zt}return{status:"valid",value:e.data}}get value(){return this._def.value}};vz.create=(t,e)=>new vz({value:t,typeName:Vt.ZodLiteral,...sn(e)});function dne(t,e){return new ZN({values:t,typeName:Vt.ZodEnum,...sn(e)})}let ZN=class AT extends En{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return tt(n,{expected:Ln.joinValues(r),received:n.parsedType,code:Ve.invalid_type}),zt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return tt(n,{received:n.data,code:Ve.invalid_enum_value,options:r}),zt}return Do(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return AT.create(e,{...this._def,...n})}exclude(e,n=this._def){return AT.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}};ZN.create=dne;let kT=class extends En{_parse(e){const n=Ln.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==ct.string&&r.parsedType!==ct.number){const i=Ln.objectValues(n);return tt(r,{expected:Ln.joinValues(i),received:r.parsedType,code:Ve.invalid_type}),zt}if(this._cache||(this._cache=new Set(Ln.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const i=Ln.objectValues(n);return tt(r,{received:r.data,code:Ve.invalid_enum_value,options:i}),zt}return Do(e.data)}get enum(){return this._def.values}};kT.create=(t,e)=>new kT({values:t,typeName:Vt.ZodNativeEnum,...sn(e)});let z8=class extends En{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ct.promise&&n.common.async===!1)return tt(n,{code:Ve.invalid_type,expected:ct.promise,received:n.parsedType}),zt;const r=n.parsedType===ct.promise?n.data:Promise.resolve(n.data);return Do(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}};z8.create=(t,e)=>new z8({type:t,typeName:Vt.ZodPromise,...sn(e)});let x1=class extends En{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Vt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:a=>{tt(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const a=i.transform(r.data,s);if(r.common.async)return Promise.resolve(a).then(async o=>{if(n.value==="aborted")return zt;const l=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return l.status==="aborted"?zt:l.status==="dirty"||n.value==="dirty"?og(l.value):l});{if(n.value==="aborted")return zt;const o=this._def.schema._parseSync({data:a,path:r.path,parent:r});return o.status==="aborted"?zt:o.status==="dirty"||n.value==="dirty"?og(o.value):o}}if(i.type==="refinement"){const a=o=>{const l=i.refinement(o,s);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?zt:(o.status==="dirty"&&n.dirty(),a(o.value),{status:n.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?zt:(o.status==="dirty"&&n.dirty(),a(o.value).then(()=>({status:n.value,value:o.value}))))}if(i.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!v1(a))return zt;const o=i.transform(a.value,s);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>v1(a)?Promise.resolve(i.transform(a.value,s)).then(o=>({status:n.value,value:o})):zt);Ln.assertNever(i)}};x1.create=(t,e,n)=>new x1({schema:t,typeName:Vt.ZodEffects,effect:e,...sn(n)});x1.createWithPreprocess=(t,e,n)=>new x1({schema:e,effect:{type:"preprocess",transform:t},typeName:Vt.ZodEffects,...sn(n)});let w2=class extends En{_parse(e){return this._getType(e)===ct.undefined?Do(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};w2.create=(t,e)=>new w2({innerType:t,typeName:Vt.ZodOptional,...sn(e)});let C1=class extends En{_parse(e){return this._getType(e)===ct.null?Do(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};C1.create=(t,e)=>new C1({innerType:t,typeName:Vt.ZodNullable,...sn(e)});let TT=class extends En{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===ct.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};TT.create=(t,e)=>new TT({innerType:t,typeName:Vt.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...sn(e)});let LT=class extends En{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return U8(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new kf(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new kf(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};LT.create=(t,e)=>new LT({innerType:t,typeName:Vt.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...sn(e)});let _z=class extends En{_parse(e){if(this._getType(e)!==ct.nan){const r=this._getOrReturnCtx(e);return tt(r,{code:Ve.invalid_type,expected:ct.nan,received:r.parsedType}),zt}return{status:"valid",value:e.data}}};_z.create=t=>new _z({typeName:Vt.ZodNaN,...sn(t)});let nAe=class extends En{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},rAe=class hne extends En{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?zt:s.status==="dirty"?(n.dirty(),og(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?zt:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new hne({in:e,out:n,typeName:Vt.ZodPipeline})}},$T=class extends En{_parse(e){const n=this._def.innerType._parse(e),r=i=>(v1(i)&&(i.value=Object.freeze(i.value)),i);return U8(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}};$T.create=(t,e)=>new $T({innerType:t,typeName:Vt.ZodReadonly,...sn(e)});var Vt;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Vt||(Vt={}));const xz=_T.create;N2.create;_1.create;const iAe=Ou.create;B8.create;F8.create;Z3.create;ZN.create;const sAe=kT.create;z8.create;w2.create;C1.create;let IT=(function(t){return t.OAUTH_ACCOUNT_SUSPENDED="oauth_account_suspended",t.MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",t.MISSING_OR_INVALID_PRIVY_CLIENT_ID="missing_or_invalid_privy_client_id",t.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",t.MISSING_OR_INVALID_TOKEN="missing_or_invalid_token",t.MISSING_MFA_ENROLLMENT="missing_mfa_enrollment",t.MISSING_OR_INVALID_MFA="missing_or_invalid_mfa",t.EXPIRED_OR_INVALID_MFA_TOKEN="expired_or_invalid_mfa_token",t.INVALID_DATA="invalid_data",t.INVALID_CREDENTIALS="invalid_credentials",t.PASSKEY_NOT_REGISTERED="passkey_not_registered",t.INVALID_CAPTCHA="invalid_captcha",t.LINKED_TO_ANOTHER_USER="linked_to_another_user",t.ALLOWLIST_REJECTED="allowlist_rejected",t.CANNOT_UNLINK_EMBEDDED_WALLET="cannot_unlink_embedded_wallet",t.CANNOT_UNLINK_SOLE_ACCOUNT="cannot_unlink_sole_account",t.CANNOT_LINK_MORE_OF_TYPE="cannot_link_more_of_type",t.LINKED_ACCOUNT_NOT_FOUND="linked_account_not_found",t.TOO_MANY_REQUESTS="too_many_requests",t.RESOURCE_CONFLICT="resource_conflict",t.INVA
493LID_ORIGIN="invalid_origin",t.MISSING_ORIGIN="missing_origin",t.INVALID_NATIVE_APP_ID="invalid_native_app_id",t.TOKEN_ALREADY_USED="token_already_used",t.ALREADY_LOGGED_OUT="already_logged_out",t.NOT_SUPPORTED="not_supported",t.USER_UNSUBSCRIBED="user_unsubscribed",t.MAX_APPS_REACHED="max_apps_reached",t.USER_LIMIT_REACHED="max_accounts_reached",t.DEVICE_REVOKED="device_revoked",t.WALLET_PASSWORD_EXISTS="wallet_password_exists",t.OAUTH_STATE_MISMATCH="oauth_state_mismatch",t.MAX_DENYLIST_ENTRIES_REACHED="max_denylist_entries_reached",t.MAX_TEST_ACCOUNTS_REACHED="max_test_accounts_reached",t.DISALLOWED_LOGIN_METHOD="disallowed_login_method",t.DISALLOWED_PLUS_EMAIL="disallowed_plus_email",t.DISALLOWED_RECOVERY_METHOD="disallowed_recovery_method",t.LEGACY_DASHBOARD_LOGIN_CONFIGURATION="legacy_dashboard_login_configuration",t.CANNOT_SET_PASSWORD="cannot_set_password",t.INVALID_PKCE_PARAMETERS="invalid_pkce_parameters",t.INVALID_APP_URL_SCHEME_CONFIGURATION="invalid_app_url_scheme_configuration",t.CROSS_APP_CONNECTION_NOT_ALLOWED="cross_app_connection_not_allowed",t.USER_DOES_NOT_EXIST="user_does_not_exist",t.ALREADY_EXISTS="resource_already_exists",t.ACCOUNT_TRANSFER_REQUIRED="account_transfer_required",t.USER_HAS_NOT_DELEGATED_WALLET="user_has_not_delegated_wallet",t.FEATURE_NOT_ENABLED="feature_not_enabled",t.ONRAMP_MINIMUM_IDENTITY_VERIFICATION_REQUIRED="onramp_minimum_identity_verification_required",t.ONRAMP_IDENTITY_VERIFICATION_REQUIRED="onramp_identity_verification_required",t.ONRAMP_DOCUMENT_VERIFICATION_REQUIRED="onramp_document_verification_required",t.ONRAMP_UNSUPPORTED_INFORMATION="onramp_unsupported_information",t.ONRAMP_TRANSACTION_LIMIT_REACHED="transaction_limit_reached",t.ONRAMP_QUOTE_EXPIRED="onramp_quote_expired",t.INSUFFICIENT_FUNDS="insufficient_funds",t.TRANSACTION_BROADCAST_FAILURE="transaction_broadcast_failure",t.TRANSACTION_EXECUTION_FAILURE="transaction_execution_failure",t.INVALID_SOLANA_TRANSACTION="invalid_solana_transaction",t.INVALID_POLICY_FORMAT="invalid_policy_format",t.INVA
493LID_AGGREGATION_FORMAT="invalid_aggregation_format",t.POLICY_VIOLATION="policy_violation",t.AUTHORIZATION_KEY_HAS_ASSOCIATED_WALLETS="authorization_key_has_associated_wallets",t.COMPLIANCE_BLOCKED="compliance_blocked",t.INVALID_REQUEST="invalid_request",t.SIGNUP_DISABLED="signup_disabled",t.INVALID_STATE="invalid_state",t.WALLET_ENTITY_ASSIGNMENT_FAILED="wallet_entity_assignment_failed",t.WALLET_ENTITY_LIMIT_EXCEEDED="wallet_entity_limit_exceeded",t.WALLET_ENTITY_ALREADY_SET="wallet_entity_already_set",t})({});iAe({error:xz(),cause:xz().optional(),code:sAe(IT).optional()});/*! js-cookie v3.0.8 | MIT */function S4(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)r!=="__proto__"&&(t[r]=n[r])}return t}var aAe={read:function(t){return t[0]==='"'&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function NT(t,e){function n(i,s,a){if(!(typeof document>"u")){a=S4({},e,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var o="";for(var l in a)a[l]&&(o+="; "+l,a[l]!==!0&&(o+="="+a[l].split(";")[0]));return document.cookie=i+"="+t.write(s,i)+o}}function r(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var s=document.cookie?document.cookie.split("; "):[],a={},o=0;o<s.length;o++){var l=s[o].split("="),u=l.slice(1).join("=");try{var f=decodeURIComponent(l[0]);if(f in a||(a[f]=t.read(u,f)),i===f)break}catch{}}return i?a[i]:a}}return Object.create({set:n,get:r,remove:function(i,s){n(i,"",S4({},s,{expires:-1}))},withAttributes:function(i){return NT(this.converter,S4({},this.attributes,i))},withConverter:function(i){return NT(S4({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(t)}})}var cE=NT(aAe,{path:"/"}),Lw={exports:{}},oAe=Lw.exports,Cz;function lAe(){return Cz||(Cz=1,(function(t,e){(function(n,r){t.exports=r()})(oAe,(function(){var n=function(s,a){if(a=a||{},typeof s!="function")throw new i("fetch must be a function");if(typeof a!="object")throw new i("defaults must be an object");if(a.retries!==void 0&&!r(a.retries))throw new i("retries must be a positive integer");if(a.retryDelay!==void 0&&!r(a.retryDelay)&&typeof a.retryDelay!="function")throw new i("retryDelay must be a positive integer or a function returning a positive integer");if(a.retryOn!==void 0&&!Array.isArray(a.retryOn)&&typeof a.retryOn!="function")throw new i("retryOn property expects an array or function");var o={retries:3,retryDelay:1e3,retryOn:[]};return a=Object.assign(o,a),function(u,f){var p=a.retries,y=a.retryDelay,g=a.retryOn;if(f&&f.retries!==void 0)if(r(f.retries))p=f.retries;else throw new i("retries must be a positive integer");if(f&&f.retryDelay!==void 0)if(r(f.retryDelay)||typeof f.retryDelay=="function")y=f.retryDelay;else throw new i("retryDelay must be a positive integer or a function returning a positive integer");if(f&&f.retryOn)if(Array.isArray(f.retryOn)||typeof f.retryOn=="function")g=f.retryOn;else throw new i("retryOn property expects an array or function");return new Promise(function(b,v){var _=function(S){var x=typeof Request<"u"&&u instanceof Request?u.clone():u;s(x,f).then(function(A){if(Array.isArray(g)&&g.indexOf(A.status)===-1)b(A);else if(typeof g=="function")try{return Promise.resolve(g(S,null,A)).then(function(I){I?C(S,null,A):b(A)}).catch(v)}catch(I){v(I)}else S<p?C(S,null,A):b(A)}).catch(function(A){if(typeof g=="function")try{Promise.resolve(g(S,A,null)).then(function(I){I?C(S,A,null):v(A)}).catch(function(I){v(I)})}catch(I){v(I)}else S<p?C(S,A,null):v(A)})};function C(S,x,A){var I=typeof y=="function"?y(S,x,A):y;setTimeout(function(){_(++S)},I)}_(0)})}};function r(s){return Number.isInteger(s)&&s>=0}function i(s){this.name="ArgumentError",this.message=s}return n}))})(Lw)),Lw.exports}var cAe=lAe();const uAe=Wa(cAe),dAe={AC:"40123",AD:"312345",AE:"501234567",AF:"701234567",AG:"2684641234",AI:"2642351234",AL:"672123456",AM:"77123456",AO:"923123456",AR:"91123456789",AS:"6847331234",AT:"664123456",AU:"412345678",AW:"5601234",AX:"412345678",AZ:"401234567",BA:"61123456",BB:"2462501234",BD:"1812345678",BE:"450001234",BF:"70123456",BG:"43012345",BH:"36001234",BI:"79561234",BJ:"0195123456",BL:"690001234",BM:"4413701234",BN:"7123456",BO:"71234567",BQ:"3181234",BR:"11961234567",BS:"2423591234",BT:"17123456",BW:"71123456",BY:"294911911",BZ:"6221234",CA:"5062345678",CC:"412345678",CD:"991234567",CF:"70012345",CG:"061234567",CH:"781234567",CI:"0123456789",CK:"71234",CL:"221234567",CM:"671234567",CN:"13123456789",CO:"3211234567",CR:"83123456",CU:"51234567",CV:"9911234",CW:"95181234",CX:"412345678",CY:"96123456",CZ:"601123456",DE:"15123456789",DJ:"77831001",DK:"34412345",DM:"7672251234",DO:"8092345678",DZ:"551234567",EC:"991234567",EE:"51234567",EG:"1001234567",EH:"650123456",ER:"7123456",ES:"612345678",ET:"911234567",FI:"412345678",FJ:"7012345",FK:"51234",FM:"3501234",FO:"211234",FR:"612345678",GA:"06031234",GB:"7400123456",GD:"4734031234",GE:"555123456",GF:"694201234",GG:"7781123456",GH:"231234567",GI:"57123456",GL:"221234",GM:"3012345",GN:"601123456",GP:"690001234",GQ:"222123456",GR:"6912345678",GT:"51234567",GU:"6713001234",GW:"955012345",GY:"6091234",HK:"51234567",HN:"91234567",HR:"921234567",HT:"34101234",HU:"201234567",ID:"812345678",IE:"850123456",IL:"502345678",IM:"7924123456",IN:"8123456789",IO:"3801234",IQ:"7912345678",IR:"9123456789",IS:"6111234",IT:"3123456789",JE:"7797712345",JM:"8762101234",JO:"790123456",JP:"9012345678",KE:"712123456",KG:"700123456",KH:"91234567",KI:"72001234",KM:"3212345",KN:"8697652917",KP:"1921234567",KR:"1020000000",KW:"50012345",KY:"3453231234",KZ:"7710009998",LA:"2023123456",LB:"71123456",LC:"7582845678",LI:"660234567",LK:"712345678",LR:"770123456",LS:"50123456",LT:"61234567",LU:"628123456",LV:"21234567",LY:"912345678",MA:"650123456",MC:"612345678",MD:"62112345",ME:"60123456",MF:"690001234",MG:"321234567",MH:"2351234",MK:"72345678",ML:"65012345",MM:"92123456",MN:"88123456",MO:"66123456",MP:"6702345678",MQ:"696201234",MR:"22123456",MS:"6644923456",MT:"96961234",MU:"52512345",MV:"7712345",MW:"991234567",MX:"2221234567",MY:"123456789",MZ:"821234567",NA:"811234567",NC:"751234",NE:"93123456",NF:"381234",NG:"8021234567",NI:"81234567",NL:"612345678",NO:"40612345",NP:"9841234567",NR:"5551234",NU:"8884012",NZ:"211234567",OM:"92123456",PA:"61234567",PE:"912345678",PF:"87123456",PG:"70123456",PH:"9051234567",PK:"3012345678",PL:"512345678",PM:"551234",PR:"7872345678",PS:"599123456",PT:"912345678",PW:"6201234",PY:"961456789",QA:"33123456",RE:"692123456",RO:"712034567",RS:"601234567",RU:"9123456789",RW:"720123456",SA:"512345678",SB:"7421234",SC:"2510123",SD:"911231234",SE:"701234567",SG:"81234567",SH:"51234",SI:"31234567",SJ:"41234567",SK:"912123456",SL:"25123456",SM:"66661212",SN:"701234567",SO:"71123456",SR:"7412345",SS:"977123456",ST:"9812345",SV:"70123456",SX:"7215205678",SY:"944567890",SZ:"76123456",TA:"8999",TC:"6492311234",TD:"63012345",TG:"90112345",TH:"812345678",TJ:"917123456",TK:"7290",TL:"77212345",TM:"66123456",TN:"20123456",TO:"7715123",TR:"5012345678",TT:"8682911234",TV:"901234",TW:"912345678",TZ:"621234567",UA:"501234567",UG:"712345678",US:"2015550123",UY:"94231234",UZ:"912345678",VA:"3123456789",VC:"7844301234",VE:"4121234567",VG:"2843001234",VI:"3406421234",VN:"912345678",VU:"5912345",WF:"821234",WS:"7212345",XK:"43201234",YE:"712345678",YT:"639012345",ZA:"711234567",ZM:"955123456",ZW:"712345678"},fne
vendor: 12,668 bytes, line 493
493={version:4,country_calling_codes:{1:["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],383:["XK"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],880:["BD"],886:["TW"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},countries:{AC:["247","00","(?:[01589]\\d|[2-467])\\d{4}",[5,6]],AD:["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]]],AE:["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0"],AF:["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0"],AG:["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([457]\\d{6})$|1","268$1",0,"268"],AI:["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2457]\\d{6})$|1","264$1",0,"264"],AL:["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0"],AM:["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0"],AO:["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]]],AR:["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1"],AS:["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"([267]\\d{6})$|1","684$1",0,"684"],AT:["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:48|5[0-3579]|[6-9])|7(?:20|32|8)|[89]","(?:31|4)6|51|6(?:485|5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0"],AU:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10,12],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"(183[12])|0",0,0,0,[["(?:(?:241|349)0\\d\\d|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4])|[34]\\d\\d)|91(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79]))))\\d{3}|(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|3(?:[0-3589]\\d|4[0-578]|6[1-9]|7[0-35-9])|7(?:[013-57-9]\\d|2[0-8])|8(?:55|6[0-8]|[78]\\d|9[02-9]))\\d{6}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,["163\\d{2,6}",[5,6,7,8,9]],["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],AW:["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]]],AX:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",0,"00"],AZ:["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365[45]|46","1[28]|2|365(?:4|5[02])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0"],BA:["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0"],BB:["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","246$1",0,"246"],BD:["880","00","[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]|2[23]"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0"],BE:["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0"],BF:["226","00","[024-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[024-7]"]]]],BG:["359","00","00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9,12],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0"],BH:["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[02-4679]"]]]],BI:["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]]],BJ:["229","00","(?:01\\d|8)\\d{7}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["0"]]]],BL:["590","00","7090\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["(?:59(?:0(?:2[7-9]|3[3-7]|5[12]|87)|87\\d)|80[6-9]\\d\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],["8[129]\\d{7}"],0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],BM:["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","441$1",0,"441"],BN:["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]]],BO:["591","00(?:1\\d)?","(?:[2-7]\\d\\d|8001)\\d{5}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[23]|4[46]|50"]],["(\\d{8})","$1",["[5-7]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?"],BQ:["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]"],BR:["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","[1-467]\\d{9,10}
vendor: 13,185 bytes, line 493
493|55[0-46-9]\\d{8}|[34]\\d{7}|55\\d{7,8}|(?:5[0-46-9]|[89]\\d)\\d{7,9}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37|86)","300|4(?:0(?:0|20)|370|864)"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2"],BS:["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([3-8]\\d{6})$|1","242$1",0,"242"],BT:["975","00","[178]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-6]|7[246]|8[2-4]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|[78]"]]]],BW:["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-9]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]]],BY:["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,0,"8~10"],BZ:["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]]],CA:["1","011","[2-9]\\d{9}|3\\d{6}",[7,10],0,"1",0,0,0,0,0,[["(?:2(?:04|[23]6|[48]9|5[07]|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|7[39])|9(?:0[25]|42))[2-9]\\d{6}",[10]],["",[10]],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",[10]],["900[2-9]\\d{6}",[10]],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:2[125-9]|3[23]|44|66|77|88)|6(?:22|33))[2-9]\\d{6}",[10]],0,["310\\d{4}",[7]],0,["600[2-9]\\d{6}",[10]]]],CC:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CD:["243","00","(?:(?:[189]|5\\d)\\d|2)\\d{7}|[1-68]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["5"],"0$1"]],"0"],CF:["236","00","8776\\d{4}|(?:[27]\\d|61)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-8]"]]]],CG:["242","00","222\\d{6}|(?:0\\d|80)\\d{7}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]]],CH:["41","00","8\\d{11}|[2-9]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0"],CI:["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]]],CK:["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]]],CL:["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["60|809"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-36]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9(?:10|[2-9])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-8]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]]],CM:["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]]],CN:["86","00|1(?:[12]\\d|79)\\d\\d00","(?:(?:1[03-689]|2\\d)\\d\\d|6)\\d{8}|1\\d{10}|[126]\\d{6}(?:\\d(?:\\d{2})?)?|86\\d{5,6}|(?:[3-579]\\d|8[0-57-9])\\d{5,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]|3(?:[157]|35|49|9[1-68])|4(?:1[124-9]|2[179]|6[47-9]|7|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:07|1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3|4[13]|5[1-5]|7[0-79]|9[0-35-9])|(?:4[35]|59|85)[1-9]","(?:10|2[0-57-9])(?:1[02]|9[56])|8078|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))1","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|80781|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))12","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|807812|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:078|1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"(1(?:[12]\\d|79)\\d\\d)|0",0,0,0,0,"00"],CO:["57","00(?:4(?:[14]4|56)|[579])","(?:46|60\\d\\d)\\d{6}|(?:1\\d|[39])\\d{9}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["46"]],["(\\d{3})(\\d{7})","$1 $2",["6|90"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["3[0-357]|9[14]"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0([3579]|4(?:[14]4|56))?"],CR:["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))"],CU:["53","119","(?:[2-7]|8\\d\\d)\\d{7}|[2-47]\\d{6}|[34]\\d{5}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["[56]"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0"],CV:["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]]],CW:["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]"],CX:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CY:["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]]],CZ:["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9,10,11,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["96"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]]],DE:["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[03568]","15(?:[0568]|3[13])"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8}
vendor: 5,250 bytes, line 493
493)","$1 $2 $3",["15"],"0$1"]],"0"],DJ:["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]]],DK:["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]]],DM:["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","767$1",0,"767"],DO:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9"],DZ:["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0"],EC:["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0"],EE:["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],EG:["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{8})","$1 $2",["1"],"0$1"]],"0"],EH:["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,0,[["528[89]\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[016-8]\\d|2[0-8]|3[01]|5[0-5]))\\d{6}"],["80[0-7]\\d{6}"],["89\\d{7}"],0,0,0,0,["(?:592(?:4[0-2]|93)|80[89]\\d\\d)\\d{4}"]]],ER:["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0"],ES:["34","00","(?:400|[5-9]\\d\\d)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[4-9]"]]]],ET:["251","00","(?:11|[2-57-9]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-57-9]"],"0$1"]],"0"],FI:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d{5})","$1",["20[2-59]"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["(?:[1-3]0|[68])0|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[14]|2[09]|50|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"],["(\\d)(\\d{4,9})","$1 $2",["(?:19|[2568])[1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",0,"00"],FJ:["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,0,"00"],FK:["500","00","[2-7]\\d{4}",[5]],FM:["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]]],FO:["298","00","[2-9]\\d{5}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))"],FR:["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0"],GA:["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"]],0,0,"0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})","$1"],GB:["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,"0|180020",0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0-5])|4(?:(?:[0-5]\\d|70)\\d|69[7-9])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|5[01]))\\d)|(?:2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d|1(?:[0-7]\\d|8[0-3]))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d)\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])
vendor: 9,428 bytes, line 493
493))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}",[9,10]],["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]],0," x"],GD:["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","473$1",0,"473"],GE:["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[57]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"]],"0"],GF:["594","00","(?:694\\d|7093)\\d{5}|(?:59|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]|80[6-9]|9[47]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[89]"],"0$1"]],"0"],GG:["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"([25-9]\\d{5})$|0|180020","1481$1",0,0,[["1481[25-9]\\d{5}",[10]],["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]]],GH:["233","00","[235]\\d{8}|800\\d{5,6}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2358]"],"0$1"]],"0"],GI:["350","00","(?:[25]\\d|60)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]]],GL:["299","00","(?:19|[2-689]\\d|70)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-9]"]]]],GM:["220","00","[48]\\d{8}|[2-9]\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|4(?:[0-35]|4[16-9])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[48]"]]]],GN:["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]]],GP:["590","00","7090\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]|80[6-9]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["(?:59(?:0(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1-9]|5[3-579]|[68][0-689]|7[08]|9\\d)|87\\d)|80[6-9]\\d\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],["8[129]\\d{7}"],0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],GQ:["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]]],GR:["30","00","5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}",[10,11,12],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3,4})(\\d{5})","$1 $2 $3",["8"]]]],GT:["502","00","80\\d{6}|(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-8]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],GU:["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","671$1",0,"671"],GW:["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]]],GY:["592","001","(?:[2-8]\\d{3}|9008)\\d{3}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],HK:["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,0,"00"],HN:["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]]],HR:["385","00","[2-69]\\d{8}|80\\d{5,7}|[1-79]\\d{7}|6\\d{6}",[7,8,9],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6|7[245]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-57]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0"],HT:["509","00","[2-589]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-589]"]]]],HU:["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06"],ID:["62","00[89]","00[1-9]\\d{9,14}|(?:[1-36]|8\\d{5})\\d{6}|00\\d{9}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13,14,15,16,17],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0"],IE:["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0"],IL:["972","0(?:0|1(?:05|[2-9]))","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0"],IM:["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([25-8]\\d{5})$|0|180020","1624$1",0,"74576|(?:16|7[56])24"],IN:["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-7]|80[2-46]","11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31)|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:3171|5[15][2-6]|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|8(?:16|2[014]|3[126]|6[136]|7[78]|83)(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2
vendor: 18,809 bytes, line 493
493-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|3[129]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7(?:[23569]|8[0-57-9])|8[1-6])|7(?:1(?:[013-8]|9[6-9])|3(?:17|2[0-49]|9[2-57])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|8(?:28[235-7]|3))|73179|807(?:1|9[1-3])|(?:1552|6(?:(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578])\\d|7(?:[23569]\\d|8[0-57-9])|8(?:[14-6]\\d|2[0-79]))|7(?:1(?:[013-8]\\d|9[6-9])|3(?:2[0-49]|9[2-57])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["16|[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["18[06]","18[06]0"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0"],IO:["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]]],IQ:["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],IR:["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0"],IS:["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,0,"00"],IT:["39","00","0\\d{5,11}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:43|55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?",[6,7,8,9,10,11,12],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1(?:44|[679])|[378]|43"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]|14"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[03]"]]],0,0,0,0,0,0,[["0(?:669[0-79]\\d{1,6}|831\\d{2,8})|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[2356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"],["3[2-9]\\d{7,8}|(?:31|43)\\d{8}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],["3[2-8]\\d{9,10}",[11,12]],0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],JE:["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([0-24-8]\\d{5})$|0|180020","1534$1",0,0,[["1534[0-24-8]\\d{5}"],["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97\\d))\\d{5}"],["80(?:07(?:35|81)|8901)\\d{4}"],["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"],["701511\\d{4}"],0,["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"],["56\\d{8}"]]],JM:["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876"],JO:["962","00","(?:(?:[2689]|7\\d)\\d|32|427|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[47]"],"0$1"]],"0"],JP:["81","010","00[1-9]\\d{6,14}|[25-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["3|4(?:2[09]|7[01])|6[1-9]","3|4(?:2(?:0|9[02-69])|7(?:0[019]|1))|6[1-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[25-9]"],"0$1"]],"0",0,"(000[2569]\\d{4,6})$|(?:(?:003768)0?)|0","$1"],KE:["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0"],KG:["996","00","8\\d{9}|[235-9]\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0"],KH:["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],KI:["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0"],KM:["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]]],KN:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","869$1",0,"869"],KP:["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0"],KR:["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[36]0|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?"],KW:["965","00","18\\d{5}|(?:[2569]\\d|41)\\d{6}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[245]"]]]],KY:["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","345$1",0,"345"],KZ:["7","810","8\\d{13}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"7",0,"8~10"],LA:["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["3"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0"],LB:["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-6]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0"],LC:["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"([2-8]\\d{6})$|1","758$1",0,"758"],LI:["423","00","[68]\\d{8}|(?:[2378]\\d|90)\\d{5}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2379]|8(?:0[09]|7)","[2379]|8(?:0(?:02|9)|7)"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"(1001)|0"],LK:["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0"],LR:["231","00","(?:[2457]\\d|33|88)\\d{7}|(?:2\\d|[4-6])\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["4[67]|[56]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-578]"],"0$1"]],"0"],LS:["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]]],LT:["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(0-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"0 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(0-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(0-$1)",1]],"0",0,"[08]"],LU:["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["20"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["20"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"],LV:["371","00","(?:[268]\\d|78|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2679]|8[01]"]]]],LY:["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0"],MA:["212","00","[5-8]\\d{8}",[9],[["(\\d{4})(\\d{5})","$1-$2",["892"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8(?:0[0-7]|9)"],"0$1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[5-8]"],"0$1"]],"0",0,0,0,0,"[5-8]"],MC:["377","00","(?:[3489]|[67]\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[67]"],"0$1"]],"0"],MD:["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0"],ME:["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0"],MF:["590","00","7090\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["(?:59(?:0(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)|87\\d)|80[6-9]\\d\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],["8[129]\\d{7}"],0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],MG:["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"([24-9]\\d{6})$|0","20$1"],MH:["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1"],MK:["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2|34[47]|4(?:[37]7|5[47]|64)"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0"],ML:["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]]],MM:["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["4(?:[2-46]|5[3-5])|5|6(?:[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-5]|(?:60|86)[23]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|452|678|86","[12]|452|6788|86"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0"],MN:["976","001","[12]\\d{7,9}|[5-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["11|2[16]"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[5-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0"],MO:["853","00","0800\\d{3}|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]]],MP:["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","670$1",0,"670"],MQ:["596","00","7091\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]|8(?:0[6-9]|[36])"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],MR:["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]]],MS:["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"([34]\\d{6})$|1","664$1",0,"664"],MT:["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]]],MU:["230","0(?:0|[24-7]0|3[03])","(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["[57]"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,0,"020"],MV:["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[34679]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,0,"00"],MW:["265","00","(?:[1289]\\d|31|77)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-37-9]"],"0$1"]],"0"],MX:["52","0[09]","[2-9]\\d{9}",[10],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"]]],0,0,0,0,0,0,0,"00"],MY:["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9]|53)|8","1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1(?:[367]|80)"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0"],MZ:["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],NA:["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],NC:["687","00","(?:050|[2-57-9]\\d\\d)\\d{3}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[02-57-9]"]]]],NE:["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[0467]"]]]],NF:["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1"],NG:["234","009","(?:20|9\\d)\\d{8}|[78]\\d{9,13}",[10,11,12,13,14],[["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["20[129]"],"0$1"],["(\\d{4})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0"],NI:["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]]],NL:["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}",[5,6,7,8,9,10,11],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-578]|91"],"0$1"],["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3",["9"],"0$1"]],"0"],NO:["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]"]]],0,0,0,0,0,"[02-689]|7[0-8]"],NP:["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"],"0$1"],["(\\d{3})(\\d{7})","$1-$2",["9"]]],"0"],NR:["674","00","(?:222|444|(?:55|8\\d)\\d|666|777|999)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[24-9]"]]]],NU:["683","00","(?:[4-7]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]]],NZ:["64","0(?:0|161)","[1289]\\d{9}|50\\d{5}
vendor: 23,715 bytes, line 493
493(?:\\d{2,3})?|[27-9]\\d{7,8}|(?:[34]\\d|6[0-35-9])\\d{6}|8\\d{4,6}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|8|90","50(?:[0367]|88)|8|90"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[589]"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7"],"0$1"]],"0",0,0,0,0,0,0,"00"],OM:["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]]],PA:["507","00","(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10,11],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]]],PE:["51","00|19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,0,"00"," Anexo "],PF:["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],PG:["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85[02-46-9]"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,0,"00"],PH:["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0"],PK:["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0"],PL:["48","00","(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|20|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["30|(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","30|(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]]],PM:["508","00","[78]\\d{8}|[2-9]\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],PR:["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939"],PS:["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],PT:["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]]],PW:["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],PY:["595","00","[36-8]\\d{5,8}|4\\d{6,8}|59\\d{6}|9\\d{5,10}|(?:2\\d|5[0-8])\\d{6,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["3[289]|4[246-8]|61|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0"],QA:["974","00","800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}",[7,8,9,11],[["(\\d{3})(\\d{4})","$1 $2",["2[136]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[3-7]"]]]],RE:["262","00","709\\d{6}|(?:26|[689]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-9]"],"0$1"]],"0",0,0,0,0,0,[["2631[0-6]\\d{4}|26(?:2\\d|30|88)\\d{5}"],["(?:69(?:2\\d\\d|3(?:[06][0-6]|1[0-3]|2[0-2]|3[0-39]|4\\d|5[0-5]|7[0-37]|8[0-8]|9[0-479]))|7092[0-3])\\d{4}"],["80\\d{7}"],["89[1-37-9]\\d{6}"],0,0,0,0,["9(?:399[0-3]|479[0-6]|76(?:2[278]|3[0-37]))\\d{4}"],["8(?:1[019]|2[0156]|84|90)\\d{6}"]]],RO:["40","00","(?:[236-8]\\d|90)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[236-9]"],"0$1"]],"0",0,0,0,0,0,0,0," int "],RS:["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0"],RU:["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,"[3489]",0,"8~10"],RW:["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"]],"0"],SA:["966","00","(?:[15]\\d|800|92)\\d{7}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0"],SB:["677","0[01]","[6-9]\\d{6}|[1-6]\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["6[89]|7|8[4-9]|9(?:[1-8]|9[0-8])"]]]],SC:["248","010|0[0-2]","(?:[2489]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,0,"00"],SD:["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0"],SE:["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10,12],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44|9)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0"],SG:["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-9]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],SH:["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]"],SI:["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[013]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,0,"00"],SJ:["47","00","0\\d{4}|(?:[489]\\d|79)\\d{6}",[5,8],0,0,0,0,0,0,"79"],SK:["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[3-5]"],"0$1"]],"0"],SL:["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0"],SM:["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1"],SN:["221","00","(?:[378]\\d|93)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]]],SO:["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|9[2-9]"]],["(\\d)(\\d{7})","$1 $2",["[267]|904"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[346-9]"]]],"0"],SR:["597","00","(?:[2-5]|[6-9]\\d)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-9]"]]]],SS:["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0"],ST:["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]]],SV:["503","00","[25-7]\\d{7}|(?:80\\d|900)\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[25-7]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]]],SX:["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"(5\\d{6})$|1","721$1",0,"721"],SY:["963","00","[1-359]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-4]|5[1-3]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[59]"],"0$1",1]],"0"],SZ:["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]]],TA:["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8"],TC:["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"([2-479]\\d{6})$|1","649$1",0,"649"],TD:["235","00|16","(?:22|[3689]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[236-9]"]]],0,0,0,0,0,0,0,"00"],TG:["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]]],TH:["66","00[1-9]","(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}",[8,9,10,13],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],TJ:["992","810","(?:[0-57-9]\\d|66)\\d{7}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["44[02-479]|[34]7"]],["(\\d{4})(\\d)(\\d{4})","$1 $2 $3",["3(?:[1245]|3[12])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["\\d"]]],0,0,0,0,0,0,0,"8~10"],TK:["690","00","[2-47]\\d{3,6}",[4,5,6,7]],TL:["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]]],TM:["993","810","[1-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["[67]"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],TN:["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]]],TO:["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]]],TR:["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0"],TT:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-46-8]\\d{6})$|1","868$1",0,"868"],TV:["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],TW:["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["826"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["83"],"0$1"],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["82"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[25]0|37|49|8[09]"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-478])|7[1-9]","[23568]|4(?:0[2-48]|[1-478])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,0,0,"#"],TZ:["255","00[056]","(?:[25-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["5"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0"],UA:["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])","3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|89|9[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,0,"0~0"],UG:["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024","20240"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["20[0-35-7]|4(?:6[45]|[7-9])|[7-9]","20(?:[0135-7]|2[5-9])|4(?:6[45]|[7-9])|[7-9]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[2-4]"],"0$1"]],"0"],US:["1","011","[2-9]\\d{9}|3\\d{6}",[10],[["(\\d{3})(\\d{4})","$1-$2",["310"],0,1],["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[["(?:472[2-47-9]|983[2-57-9])\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[02469]|8[13])|3(?:0[1-57-9]|1[02-9]|2[013-79]|3[0-24679]|4[167]|5[0-3]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-269])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[0-2478]|4[0378]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[0168]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-3589]|8[04-69]))[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],UY:["598","0(?:0|1[3-9]\\d)","0004\\d{2,9}|[1249]\\d{7}|2\\d{3,4}|(?:[49]\\d|80)\\d{5}",[4,5,6,7,8,9,10,11,12,13],[["(\\d{4,5})","$1",["21"]],["(\\d{3})(\\d{3,4})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[49]0|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[124]"]],["(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3 $4",["0"]]],"0",0,0,0,0,0,0,"00"," int. "],UZ:["998","00","(?:20|33|[5-9]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-9]"]]]],VA:["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11,12],0,0,0,0,0,0,"06698"],VC:["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","784$1",0,"784"],VE:["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0"],VG:["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-578]\\d{6})$|1","284$1",0,"284"],VI:["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","340$1",0,"340"],VN:["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{6,7}|7\\d{6}",[7,8,9,10],[["(\\d{4})(\\d{4,6})","$1 $2",["1(?:2[02]|[89])"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[26]|6"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[357-9]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0"],VU:["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]]],WF:["681","00","(?:40|72|8\\d{4})\\d{4}|[89]\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[47-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],WS:["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],XK:["383","00","2\\d{7,8}|3\\d{7,11}|(?:4\\d\\d|[89]00)\\d{5}",[8,9,10,11,12],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2|39"],"0$1"],["(\\d{2})(\\d{7,10})","$1 $2",["3"],"0$1"]],"0"],YE:["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7(?:[24-6]|8[0-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0"],YT:["262","00","(?:639\\d|7093)\\d{5}|(?:26|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["26(?:89\\d|9(?:0[0-467]|15|5[0-4]|6\\d|[78]0))\\d{4}"],["(?:639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])|7093[5-7])\\d{4}"],["80\\d{7}"],0,0,0,0,0,["9(?:(?:39|47)8[01]|769\\d)\\d{4}"]]],ZA:["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],ZM:["260","00","800\\d{6}|(?:21|[579]\\d|63)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[579]"],"0$1"]],"0"],ZW:["263","00","(?:13|8\\d{4})\\d{5}|[235-8]\\d{8}|[2-689]\\d{6}",[7,9,10],[["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|29|58)|67[0-46-9]|(?:55|68)[0-69]"],"0$1"],["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|[27]|48)|37|675|(?:55|68)[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["548"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[256]|39|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["3"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"]],"0"]},nonGeographic:{800:["800",0,"(?:00|[1-9]\\d)\\d{6}",[8],[["(\\d{4})(\\d{4})","$1 $2",["\\d"]]],0,0,0,0,0,0,[0,0,["(?:00|[1-9]\\d)\\d{6}"]]],808:["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],870:["870",0,"7\\d{11}|[235-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"],0,0,0,0,0,0,["2\\d{8}",[9]]]],878:["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],881:["881",0,"6\\d{9}|[0-36-9]\\d{8}",[9,10],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-37-9]"]],["(\\d)(\\d{3})(\\d{5,6})","$1 $2 $3",["6"]]],0,0,0,0,0,0,[0,["6\\d{9}|[0-36-9]\\d{8}"]]],882:["882",0,"[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["49"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["1[36]|9"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["16"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|23|3(?:[15]|4[57])|4|5[12]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-35]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|5(?:0\\d{3}|2[0-2]))\\d{7}",[7,8,9,10,12]],0,0,0,["348[57]\\d{7}",[11]],0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]],883:["883",0,"(?:[1-4]\\d|51)\\d{6,10}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,8})","$1 $2 $3",["[14]|2[24-689]|3[02-689]|51[24-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["21"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[235]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[0-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]],888:["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],979:["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}};function
vendor: 7,183 bytes, line 493
493l5(t,e){var n=Array.prototype.slice.call(e);return n.push(fne),t.apply(this,n)}function Ez(t,e){t=t.split("-"),e=e.split("-");for(var n=t[0].split("."),r=e[0].split("."),i=0;i<3;i++){var s=Number(n[i]),a=Number(r[i]);if(s>a)return 1;if(a>s)return-1;if(!isNaN(s)&&isNaN(a))return 1;if(isNaN(s)&&!isNaN(a))return-1}return t[1]&&e[1]?t[1]>e[1]?1:t[1]<e[1]?-1:0:!t[1]&&e[1]?1:t[1]&&!e[1]?-1:0}var hAe={}.constructor;function df(t){return t!=null&&t.constructor===hAe}var fAe=/^\d+$/;function pAe(t){return fAe.test(t)}function E1(t){"@babel/helpers - typeof";return E1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E1(t)}function W7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function mAe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,yAe(r.key),r)}}function q7(t,e,n){return e&&mAe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function yAe(t){var e=gAe(t,"string");return E1(e)=="symbol"?e:e+""}function gAe(t,e){if(E1(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(E1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var bAe="1.2.0",wAe="1.7.35",Sz=" ext. ",Ki=(function(){function t(e){W7(this,t),pne(e),this.metadata=e,mne.call(this,e)}return q7(t,[{key:"getCountries",value:function(){return Object.keys(this.metadata.countries).filter(function(n){return n!=="001"})}},{key:"getCountryMetadata",value:function(n){return this.metadata.countries[n]}},{key:"nonGeographic",value:function(){if(!(this.v1||this.v2||this.v3))return this.metadata.nonGeographic||this.metadata.nonGeographical}},{key:"hasCountry",value:function(n){return this.getCountryMetadata(n)!==void 0}},{key:"hasCallingCode",value:function(n){if(this.getCountryCodesForCallingCode(n))return!0;if(this.nonGeographic()){if(this.nonGeographic()[n])return!0}else{var r=this.countryCallingCodes()[n];if(r&&r.length===1&&r[0]==="001")return!0}}},{key:"isNonGeographicCallingCode",value:function(n){return this.nonGeographic()?!!this.nonGeographic()[n]:!this.getCountryCodesForCallingCode(n)}},{key:"country",value:function(n){return this.selectNumberingPlan(n)}},{key:"selectNumberingPlan",value:function(n,r){var i,s;if(n&&(pAe(n)?s=n:i=n),r&&(s=r),i&&i!=="001"){var a=this.getCountryMetadata(i);if(!a)throw new Error("Unknown country: ".concat(i));this.numberingPlan=new Az(a,this)}else if(s){if(!this.hasCallingCode(s))throw new Error("Unknown calling code: ".concat(s));this.numberingPlan=new Az(this.getNumberingPlanMetadata(s),this)}else this.numberingPlan=void 0;return this}},{key:"getCountryCodesForCallingCode",value:function(n){var r=this.countryCallingCodes()[n];if(r)return r.length===1&&r[0].length===3?void 0:r}},{key:"getCountryCodeForCallingCode",value:function(n){var r=this.getCountryCodesForCallingCode(n);if(r)return r[0]}},{key:"getNumberingPlanMetadata",value:function(n){var r=this.getCountryCodeForCallingCode(n);if(r)return this.getCountryMetadata(r);if(this.nonGeographic()){var i=this.nonGeographic()[n];if(i)return i}else{var s=this.countryCallingCodes()[n];if(s&&s.length===1&&s[0]==="001")return this.metadata.countries["001"]}}},{key:"countryCallingCode",value:function(){return this.numberingPlan.callingCode()}},{key:"IDDPrefix",value:function(){return this.numberingPlan.IDDPrefix()}},{key:"defaultIDDPrefix",value:function(){return this.numberingPlan.defaultIDDPrefix()}},{key:"nationalNumberPattern",value:function(){return this.numberingPlan.nationalNumberPattern()}},{key:"possibleLengths",value:function(){return this.numberingPlan.possibleLengths()}},{key:"formats",value:function(){return this.numberingPlan.formats()}},{key:"nationalPrefixForParsing",value:function(){return this.numberingPlan.nationalPrefixForParsing()}},{key:"nationalPrefixTransformRule",value:function(){return this.numberingPlan.nationalPrefixTransformRule()}},{key:"leadingDigits",value:function(){return this.numberingPlan.leadingDigits()}},{key:"hasTypes",value:function(){return this.numberingPlan.hasTypes()}},{key:"type",value:function(n){return this.numberingPlan.type(n)}},{key:"ext",value:function(){return this.numberingPlan.ext()}},{key:"countryCallingCodes",value:function(){return this.v1?this.metadata.country_phone_code_to_countries:this.metadata.country_calling_codes}},{key:"chooseCountryByCountryCallingCode",value:function(n){return this.selectNumberingPlan(n)}},{key:"hasSelectedNumberingPlan",value:function(){return this.numberingPlan!==void 0}}])})(),Az=(function(){function t(e,n){W7(this,t),this.globalMetadataObject=n,this.metadata=e,mne.call(this,n.metadata)}return q7(t,[{key:"callingCode",value:function(){return this.metadata[0]}},{key:"_getDefaultCountryMetadataForThisCallingCode",value:function(){return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode())}},{key:"getDefaultCountryMetadataForRegion",value:function(){return this._getDefaultCountryMetadataForThisCallingCode()}},{key:"IDDPrefix",value:function(){if(!(this.v1||this.v2))return this.metadata[1]}},{key:"defaultIDDPrefix",value:function(){if(!(this.v1||this.v2))return this.metadata[12]}},{key:"nationalNumberPattern",value:function(){return this.v1||this.v2?this.metadata[1]:this.metadata[2]}},{key:"possibleLengths",value:function(){if(!this.v1)return this.metadata[this.v2?2:3]}},{key:"_getFormats",value:function(n){return n[this.v1?2:this.v2?3:4]}},{key:"formats",value:function(){var n=this,r=this._getFormats(this.metadata)||this._getFormats(this._getDefaultCountryMetadataForThisCallingCode())||[];return r.map(function(i){return new vAe(i,n)})}},{key:"nationalPrefix",value:function(){return this.metadata[this.v1?3:this.v2?4:5]}},{key:"_getNationalPrefixFormattingRule",value:function(n){return n[this.v1?4:this.v2?5:6]}},{key:"nationalPrefixFormattingRule",value:function(){return this._getNationalPrefixFormattingRule(this.metadata)||this._getNationalPrefixFormattingRule(this._getDefaultCountryMetadataForThisCallingCode())}},{key:"_nationalPrefixForParsing",value:function(){return this.metadata[this.v1?5:this.v2?6:7]}},{key:"nationalPrefixForParsing",value:function(){return this._nationalPrefixForParsing()||this.nationalPrefix()}},{key:"nationalPrefixTransformRule",value:function(){return this.metadata[this.v1?6:this.v2?7:8]}},{key:"_getNationalPrefixIsOptionalWhenFormatting",value:function(){return!!this.metadata[this.v1?7:this.v2?8:9]}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata)||this._getNationalPrefixIsOptionalWhenFormatting(this._getDefaultCountryMetadataForThisCallingCode())}},{key:"leadingDigits",value:function(){return this.metadata[this.v1?8:this.v2?9:10]}},{key:"types",value:function(){return this.metadata[this.v1?9:this.v2?10:11]}},{key:"hasTypes",value:function(){return this.types()&&this.types().length===0?!1:!!this.types()}}
vendor: 1,355 bytes, line 493
493,{key:"type",value:function(n){if(this.hasTypes()&&kz(this.types(),n))return new xAe(kz(this.types(),n),this)}},{key:"ext",value:function(){return this.v1||this.v2?Sz:this.metadata[13]||Sz}}])})(),vAe=(function(){function t(e,n){W7(this,t),this._format=e,this.metadata=n}return q7(t,[{key:"pattern",value:function(){return this._format[0]}},{key:"format",value:function(){return this._format[1]}},{key:"leadingDigitsPatterns",value:function(){return this._format[2]||[]}},{key:"nationalPrefixFormattingRule",value:function(){return this._format[3]||this.metadata.nationalPrefixFormattingRule()}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return!!this._format[4]||this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"nationalPrefixIsMandatoryWhenFormattingInNationalFormat",value:function(){return this.usesNationalPrefix()&&!this.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"usesNationalPrefix",value:function(){return!!(this.nationalPrefixFormattingRule()&&!_Ae.test(this.nationalPrefixFormattingRule()))}},{key:"internationalFormat",value:function(){return this._format[5]||this.format()}}])})(),_Ae=/^\(?\$1\)?$/,xAe=(function(){function t(e,n){W7(this,t),this.type=e,this.metadata=n}return q7(t,[{key:"pattern",value:function(){return this.metadata.v1?this.type:this.t
vendor: 4,749 bytes, lines 493-494
493ype[0]}},{key:"possibleLengths",value:function(){if(!this.metadata.v1)return this.type[1]||this.metadata.possibleLengths()}}])})();function kz(t,e){switch(e){case"FIXED_LINE":return t[0];case"MOBILE":return t[1];case"TOLL_FREE":return t[2];case"PREMIUM_RATE":return t[3];case"PERSONAL_NUMBER":return t[4];case"VOICEMAIL":return t[5];case"UAN":return t[6];case"PAGER":return t[7];case"VOIP":return t[8];case"SHARED_COST":return t[9]}}function pne(t){if(!t)throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");if(!df(t)||!df(t.countries))throw new Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(df(t)?"an object of shape: { "+Object.keys(t).join(", ")+" }":"a "+CAe(t)+": "+t,"."))}var CAe=function(e){return E1(e)};function KN(t,e){var n=new Ki(e);if(n.hasCountry(t))return n.selectNumberingPlan(t).countryCallingCode();throw new Error("Unknown country: ".concat(t))}function EAe(t,e){return e.countries.hasOwnProperty(t)}function mne(t){var e=t.version;typeof e=="number"?(this.v1=e===1,this.v2=e===2,this.v3=e===3,this.v4=e===4):e?Ez(e,bAe)===-1?this.v2=!0:Ez(e,wAe)===-1?this.v3=!0:this.v4=!0:this.v1=!0}function c5(t,e,n){return SAe(t,void 0,e,n)}function SAe(t,e,n,r){n&&(r=new Ki(r.metadata),r.selectNumberingPlan(n));var i=r.type(e),s=i&&i.possibleLengths()||r.possibleLengths();if(!s)return"IS_POSSIBLE";var a=t.length,o=s[0];return o===a?"IS_POSSIBLE":o>a?"TOO_SHORT":s[s.length-1]<a?"TOO_LONG":s.indexOf(a,1)>=0?"IS_POSSIBLE":"INVALID_LENGTH"}function AAe(t,e,n){e===void 0&&(e={});var r=new Ki(n);if(e.v2){if(!t.countryCallingCode)throw new Error("Invalid phone number object passed");r.selectNumberingPlan(t.country||t.countryCallingCode)}else{if(!t.phone)return!1;if(t.country){if(!r.hasCountry(t.country))throw new Error("Unknown country: ".concat(t.country));r.selectNumberingPlan(t.country)}else{if(!t.countryCallingCode)throw new Error("Invalid phone number object passed");r.selectNumberingPlan(t.countryCallingCode)}}if(r.possibleLengths())return yne(t.phone||t.nationalNumber,r);if(t.countryCallingCode&&r.isNonGeographicCallingCode(t.countryCallingCode))return!0;throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}function yne(t,e){switch(c5(t,void 0,e)){case"IS_POSSIBLE":return!0;default:return!1}}function Pu(t,e){return t=t||"",new RegExp("^(?:"+e+")$").test(t)}function kAe(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=TAe(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 494In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function TAe(t,e){if(t){if(typeof t=="string")return Tz(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Tz(t,e):void 0}}function Tz(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var LAe=["MOBILE","PREMIUM_RATE","TOLL_FREE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL"];function GN(t,e,n){if(e=e||{},!(!t.country&&!t.countryCallingCode)){var r=new Ki(n);r.selectNumberingPlan(t.country||t.countryCallingCode);var i=e.v2?t.nationalNumber:t.phone;if(Pu(i,r.nationalNumberPattern())){if(uE(i,"FIXED_LINE",r))return r.type("MOBILE")&&r.type("MOBILE").pattern()===""||!r.type("MOBILE")||uE(i,"MOBILE",r)?"FIXED_LINE_OR_MOBILE":"FIXED_LINE";for(var s=kAe(LAe),a;!(a=s()).done;){var o=a.value;if(uE(i,o,r))return o}}}}function uE(t,e,n){var r=n.type(e);return!r||!r.pattern()||r.possibleLengths()&&r.possibleLengths().indexOf(t.length)<0?!1:Pu(t,r.pattern())}function $Ae(t,e,n){e=e||{};var r=new Ki(n);if(r.selectNumberingPlan(t.country||t.countryCallingCode),r.hasTypes())return GN(t,e,r.metadata)!==void 0;var i=e.v2?t.nationalNumber:t.phone;return Pu(i,r.nationalNumberPattern())}var IAe=/^[A-Z]{2}$/;function NAe(t){return IAe.test(t)}function OAe(t,e){var n,r,i=new Ki(e);return NAe(t)?(n=t,i.selectNumberingPlan(n),r=i.countryCallingCode()):r=t,{country:n,callingCode:r}}function PAe(t,e,n){var r=new Ki(n),i=r.getCountryCodesForCallingCode(t);return i?i.filter(function(s){return RAe(e,s,n)}):[]}function RAe(t,e,n){var r=new Ki(n);return r.selectNumberingPlan(e),r.numberingPlan.possibleLengths().indexOf(t.length)>=0}var YN=2,jAe=17,MAe=3,Ds="0-9ï¼-ï¼Ù -Ù©Û°-Û¹",DAe="-â-ââã¼ï¼",UAe="ï¼/",BAe="ï¼.",FAe="  Ââ
494â ã",zAe="()ï¼ï¼ï¼»ï¼½\\[\\]",VAe="~ââ¼ï½",yl="".concat(DAe).concat(UAe).concat(BAe).concat(FAe).concat(zAe).concat(VAe),Z7="+ï¼",HAe=new RegExp("(["+Ds+"])");function gne(t,e,n,r){if(e){var i=new Ki(r);i.selectNumberingPlan(e||n);var s=new RegExp(i.IDDPrefix());if(t.search(s)===0){t=t.slice(t.match(s)[0].length);var a=t.match(HAe);if(!(a&&a[1]!=null&&a[1].length>0&&a[1]==="0"))return t}}}function OT(t,e){if(t&&e.numberingPlan.nationalPrefixForParsing()){var n=new RegExp("^(?:"+e.numberingPlan.nationalPrefixForParsing()+")"),r=n.exec(t);if(r){var i,s,a=r.length-1,o=a>0&&r[a];if(e.nationalPrefixTransformRule()&&o)i=t.replace(n,e.nationalPrefixTransformRule()),a>1&&(s=r[1]);else{var l=r[0];i=t.slice(l.length),o&&(s=r[1])}var u;if(o){var f=t.indexOf(r[1]),p=t.slice(0,f);p===e.numberingPlan.nationalPrefix()&&(u=e.numberingPlan.nationalPrefix())}else u=r[0];return{nationalNumber:i,nationalPrefix:u,carrierCode:s}}}return{nationalNumber:t}}function WAe(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=qAe(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 495In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qAe(t,e){if(t){if(typeof t=="string")return Lz(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lz(t,e):void 0}}function Lz(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function bne(t,e,n){for(var r=new Ki(n),i=WAe(e),s;!(s=i()).done;){var a=s.value;if(r.selectNumberingPlan(a),r.leadingDigits()){if(t&&t.search(r.leadingDigits())===0)return a}else if(GN({phone:t,country:a},void 0,r.metadata))return a}}function JN(t,e){var n=e.nationalNumber,r=e.metadata,i=r.getCountryCodesForCallingCode(t);if(i)return i.length===1?i[0]:bne(n,i,r.metadata)}function PT(t,e,n){var r=OT(t,n),i=r.carrierCode,s=r.nationalNumber;if(s!==t){if(!ZAe(t,s,n))return{nationalNumber:t};if(n.numberingPlan.possibleLengths()&&(e||(e=JN(n.numberingPlan.callingCode(),{nationalNumber:s,metadata:n})),!KAe(s,e,n)))return{nationalNumber:t}}return{nationalNumber:s,carrierCode:i}}function ZAe(t,e,n){return!(Pu(t,n.nationalNumberPattern())&&!Pu(e,n.nationalNumberPattern()))}function KAe(t,e,n){switch(c5(t,e,n)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}function wne(t,e,n,r,i){if(!(e||n||r))return{number:t};var s=e||n?KN(e||n,i):r;if(t.indexOf(s)===0){var a=new Ki(i);a.selectNumberingPlan(e||n||r);var o=t.slice(s.length),l=PT(o,void 0,a),u=l.nationalNumber,f=PT(t,void 0,a),p=f.nationalNumber;if(!Pu(p,a.nationalNumberPattern())&&Pu(u,a.nationalNumberPattern())||c5(p,void 0,a)==="TOO_LONG")return{countryCallingCode:s,number:o}}return{number:t}}function XN(t,e,n,r,i){if(!t)return{};var s;if(t[0]!=="+"){var a=gne(t,e||n,r,i);if(a&&a!==t)s=!0,t="+"+a;else{if(e||n||r){var o=wne(t,e,n,r,i),l=o.countryCallingCode,u=o.number;if(l)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:l,number:u}}return{number:t}}}if(t[1]==="0")return{};for(var f=new Ki(i),p=2;p-1<=MAe&&p<=t.length;){var y=t.slice(1,p);if(f.hasCallingCode(y))return f.selectNumberingPlan(y),{countryCallingCodeSource:s?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:y,number:t.slice(p)};p++}return{}}function vne(t){return t.replace(new RegExp("[".concat(yl,"]+"),"g")," ").trim()}var _ne=/(\$\d)/;function xne(t,e,n){var r=n.useInternationalFormat,i=n.withNationalPrefix;n.carrierCode,n.metadata;var s=t.replace(new RegExp(e.pattern()),r?e.internationalFormat():i&&e.nationalPrefixFormattingRule()?e.format().replace(_ne,e.nationalPrefixFormattingRule()):e.format());return r?vne(s):s}var GAe=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;function YAe(t,e,n){var r=new Ki(n);if(r.selectNumberingPlan(t||e),r.defaultIDDPrefix())return r.defaultIDDPrefix();if(GAe.test(r.IDDPrefix()))return r.IDDPrefix()}var JAe=";ext=",e0=function(e){return"([".concat(Ds,"]{1,").concat(e,"})")};function Cne(t){var e="20",n="15",r="9",i="6",s="[  \\t,]*",a="[:\\.ï¼]?[  \\t,-]*",o="#?",l="(?:e?xt(?:ensi(?:oÌ?|ó))?n?|ï½ ?ï½ï½ï½?|доб|anexo)",u="(?:[xï½#ï¼~ï½]|int|ï½ï½ï½)",f="[- ]+",p="[  \\t]*",y="(?:,{2}|;)",g=JAe+e0(e),b=s+l+a+e0(e)+o,v=s+u+a+e0(r)+o,_=f+e0(i)+"#",C=p+y+a+e0(n)+o,S=p+"(?:,)+"+a+e0(r)+o;return g+"|"+b+"|"+v+"|"+_+"|"+C+"|"+S}var XAe="["+Ds+"]{"+YN+"}",QAe="["+Z7+"]{0,1}(?:["+yl+"]*["+Ds+"]){3,}["+yl+Ds+"]*",eke=new RegExp("^["+Z7+"]{0,1}(?:["+yl+"]*["+Ds+"]){1,2}$","i"),tke=QAe+"(?:"+Cne()+")?",nke=new RegExp("^"+XAe+"$|^"+tke+"$","i");function rke(t){return t.length>=YN&&nke.test(t)}function ike(t){return eke.test(t)}function ske(t){var e=t.number,n=t.ext;if(!e)return"";if(e[0]!=="+")throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(e).concat(n?";ext="+n:"")}var $z={formatExtension:function(e,n,r){return"".concat(e).concat(r.ext()).concat(n)}};function ake(t,e,n,r){n?n=cke({},$z,n):n=$z;var i=new Ki(r);if(t.country&&t.country!=="001"){if(!i.hasCountry(t.country))throw new Error("Unknown country: ".concat(t.country));i.selectNumberingPlan(t.country)}else if(t.countryCallingCode)i.selectNumberingPlan(t.countryCallingCode);else return t.phone||"";var s=i.countryCallingCode(),a=n.v2?t.nationalNumber:t.phone,o;switch(e){case"NATIONAL":return a?(o=V8(a,t.carrierCode,"NATIONAL",i,n),dE(o,t.ext,i,n.formatExtension)):"";case"INTERNATIONAL":return a?(o=V8(a,null,"INTERNATIONAL",i,n),o="+".concat(s," ").concat(o),dE(o,t.ext,i,n.formatExtension)):"+".concat(s);case"E.164":return"+".concat(s).concat(a);case"RFC3966":return ske({number:"+".concat(s).concat(a),ext:t.ext});case"IDD":if(!n.fromCountry)return;var l=lke(a,t.carrierCode,s,n.fromCountry,i);return l?dE(l,t.ext,i,n.formatExtension):void 0;default:throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(e,'"'))}}function V8(t,e,n,r,i){var s=oke(r.formats(),t);return s?xne(t,s,{useInternationalFormat:n==="INTERNATIONAL",withNationalPrefix:!(s.nationalPrefixIsOptionalWhenFormattingInNationalFormat()&&i&&i.nationalPrefix===!1),carrierCode:e,metadata:r}):t}function oke(t,e){return uke(t,function(n){if(n.leadingDigitsPatterns().length>0){var r=n.leadingDigitsPatterns()[n.leadingDigitsPatterns().length-1];if(e.search(r)!==0)return!1}return Pu(e,n.pattern())})}function dE(t,e,n,r){return e?r(t,e,n):t}function lke(t,e,n,r,i){var s=KN(r,i.metadata);if(s===n){var a=V8(t,e,"NATIONAL",i);return n==="1"?n+" "+a:a}var o=YAe(r,void 0,i.metadata);if(o)return"".concat(o," ").concat(n," ").concat(V8(t,null,"INTERNATIONAL",i))}function cke(){for(var t=1,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];for(;t<n.length;){if(n[t])for(var i in n[t])n[0][i]=n[t][i];t++}return n[0]}function uke(t,e){for(var n=0;n<t.length;){if(e(t[n]))return t[n];n++}}function K3(t){"@babel/helpers - typeof";return K3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},K3(t)}function Iz(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Nz(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};
vendor: 9,793 bytes, lines 495-497
495e%2?Iz(Object(n),!0).forEach(function(r){dke(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Iz(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function dke(t,e,n){return(e=Ene(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function hke(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function fke(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ene(r.key),r)}}function pke(t,e,n){return e&&fke(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ene(t){var e=mke(t,"string");return K3(e)=="symbol"?e:e+""}function mke(t,e){if(K3(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(K3(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var QN=(function(){function t(e,n,r){if(hke(this,t),!e)throw new TypeError("First argument is required");if(typeof e!="string")throw new TypeError("First argument must be a string");if(e[0]==="+"&&!n)throw new TypeError("`metadata` argument not passed");if(df(n)&&df(n.countries)){r=n;var i=e;if(!yke.test(i))throw new Error('Invalid `number` argument passed: must consist of a "+" followed by digits');var s=XN(i,void 0,void 0,void 0,r),a=s.countryCallingCode,o=s.number;if(n=o,e=a,!n)throw new Error("Invalid `number` argument passed: too short")}if(!n)throw new TypeError("`nationalNumber` argument is required");if(typeof n!="string")throw new TypeError("`nationalNumber` argument must be a string");pne(r);var l=OAe(e,r),u=l.country,f=l.callingCode;this.country=u,this.countryCallingCode=f,this.nationalNumber=n,this.number="+"+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return r}}return pke(t,[{key:"setExt",value:function(n){this.ext=n}},{key:"getPossibleCountries",value:function(){return this.country?[this.country]:PAe(this.countryCallingCode,this.nationalNumber,this.getMetadata())}},{key:"isPossible",value:function(){return AAe(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){return $Ae(this,{v2:!0},this.getMetadata())}},{key:"isNonGeographic",value:function(){var n=new Ki(this.getMetadata());return n.isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(n){return this.number===n.number&&this.ext===n.ext}},{key:"getType",value:function(){return GN(this,{v2:!0},this.getMetadata())}},{key:"format",value:function(n,r){return ake(this,n,r?Nz(Nz({},r),{},{v2:!0}):{v2:!0},this.getMetadata())}},{key:"formatNational",value:function(n){return this.format("NATIONAL",n)}},{key:"formatInternational",value:function(n){return this.format("INTERNATIONAL",n)}},{key:"getURI",value:function(n){return this.format("RFC3966",n)}}])})(),yke=/^\+\d+$/;function RT(t){"@babel/helpers - typeof";return RT=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},RT(t)}function gke(t,e,n){return Object.defineProperty(t,"prototype",{writable:!1}),t}function bke(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function wke(t,e,n){return e=Y3(e),vke(t,eO()?Reflect.construct(e,n||[],Y3(t).constructor):e.apply(t,n))}function vke(t,e){if(e&&(RT(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _ke(t)}function _ke(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function xke(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&G3(t,e)}function jT(t){var e=typeof Map=="function"?new Map:void 0;return jT=function(r){if(r===null||!Eke(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(r))return e.get(r);e.set(r,i)}function i(){return Cke(r,arguments,Y3(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),G3(i,r)},jT(t)}function Cke(t,e,n){if(eO())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var i=new(t.bind.apply(t,r));return n&&G3(i,n.prototype),i}function eO(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(eO=function(){return!!t})()}function Eke(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}function G3(t,e){return G3=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},G3(t,e)}function Y3(t){return Y3=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Y3(t)}var ou=(function(t){function e(n){var r;return bke(this,e),r=wke(this,e,[n]),Object.setPrototypeOf(r,e.prototype),r.name=r.constructor.name,r}return xke(e,t),gke(e)})(jT(Error)),Oz=new RegExp("(?:"+Cne()+")$","i");function Ske(t){var e=t.search(Oz);if(e<0)return{};for(var n=t.slice(0,e),r=t.match(Oz),i=1;i<r.length;){if(r[i])return{number:n,ext:r[i]};i++}}function Ake(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=kke(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 496In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kke(t,e){if(t){if(typeof t=="string")return Pz(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Pz(t,e):void 0}}function Pz(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var Tke={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","ï¼":"0","ï¼":"1","ï¼":"2","ï¼":"3","ï¼":"4","ï¼":"5","ï¼":"6","ï¼":"7","ï¼":"8","ï¼":"9","Ù ":"0","Ù¡":"1","Ù¢":"2","Ù£":"3","Ù¤":"4","Ù¥":"5","Ù¦":"6","Ù§":"7","Ù¨":"8","Ù©":"9","Û°":"0","Û±":"1","Û²":"2","Û³":"3","Û´":"4","Ûµ":"5","Û¶":"6","Û·":"7","Û¸":"8","Û¹":"9"};function Sne(t){return Tke[t]}function H8(t){for(var e="",n=Ake(t.split("")),r;!(r=n()).done;){var i=r.value,s=Sne(i);s&&(e+=s)}return e}function Lke(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=$ke(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 497In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $ke(t,e){if(t){if(typeof t=="string")return Rz(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Rz(t,e):void 0}}function Rz(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function jz(t){for(var e="",n=Lke(t.split("")),r;!(r=n()).done;){var i=r.value;e+=Ike(i,e)||""}return e}function Ike(t,e,n){return t==="+"?e?void 0:"+":Sne(t)}var Ane="+",Nke="[\\-\\.\\(\\)]?",Mz="(["+Ds+"]|"+Nke+")",Oke="^\\"+Ane+Mz+"*["+Ds+"]"+Mz+"*$",Pke=new RegExp(Oke,"g"),MT=Ds,Rke="["+MT+"]+((\\-)*["+MT+"])*",jke="a-zA-Z",Mke="["+jke+"]+((\\-)*["+MT+"])*",Dke="^("+Rke+"\\.)*"+Mke+"\\.?$",Uke=new RegExp(Dke,"g"),Dz="tel:",DT=";phone-context=",Bke=";isub=";function Fke(t){var e=t.indexOf(DT);if(e<0)return null;var n=e+DT.length;if(n>=t.length)return"";var r=t.indexOf(";",n);return r>=0?t.substring(n,r):t.substring(n)}function zke(t){return t===null?!0:t.length===0?!1:Pke.test(t)||Uke.test(t)}function Vke(t,e){var n=e.extractFormattedPhoneNumber,r=Fke(t);if(!zke(r))throw new ou("NOT_A_NUMBER");var i;if(r===null)i=n(t)||"";else{i="",r.charAt(0)===Ane&&(i+=r);var s=t.indexOf(Dz),a;s>=0?a=s+Dz.length:a=0;var o=t.indexOf(DT);i+=t.substring(a,o)}var l=i.indexOf(Bke);if(l>0&&(i=i.substring(0,l)),i!=="")return i}var Hke=250,Wke=new RegExp("["+Z7+Ds+"]"),qke=new RegExp("[^"+Ds+"#]+$");function Zke(t,e,n){e=e||{};var r=new Ki(n);if(e.defaultCountry&&!r.hasCountry(e.defaultCountry))throw e.v2?new ou("INVALID_COUNTRY"):new Error("Unknown country: ".concat(e.defaultCountry));var i=Gke(t,e.v2,e.extract),s=i.number,a=i.ext,o=i.error;if(!s){if(e.v2)throw o==="TOO_SHORT"?new ou("TOO_SHORT"):new ou("NOT_A_NUMBER");return{}}var l=Jke(s,e.defaultCountry,e.defaultCallingCode,r),u=l.country,f=l.nationalNumber,p=l.countryCallingCode,y=l.countryCallingCodeSource,g=l.carrierCode;if(!r.hasSelectedNumberingPlan()){if(e.v2)throw new ou("INVALID_COUNTRY");return{}}if(!f||f.length<YN){if(e.v2)throw new ou("TOO_SHORT");return{}}if(f.length>jAe){if(e.v2)throw new ou("TOO_LONG");return{}}if(e.v2){var b=new QN(p,f,r.metadata);return u&&(b.country=u),g&&(b.carrierCode=g),a&&(b.ext=a),b.__countryCallingCodeSource=y,b}var v=(e.extended?r.hasSelectedNumberingPlan():u)?Pu(f,r.nationalNumberPattern()):!1;return e.extended?{country:u,countryCallingCode:p,carrierCode:g,valid:v,possible:v?!0:!!(e.extended===!0&&r.possibleLengths()&&yne(f,r)),p
vendor: 4,522 bytes, lines 497-498
497hone:f,ext:a}:v?Yke(u,f,a):{}}function Kke(t,e,n){if(t){if(t.length>Hke){if(n)throw new ou("TOO_LONG");return}if(e===!1)return t;var r=t.search(Wke);if(!(r<0))return t.slice(r).replace(qke,"")}}function Gke(t,e,n){var r=Vke(t,{extractFormattedPhoneNumber:function(a){return Kke(a,n,e)}});if(!r)return{};if(!rke(r))return ike(r)?{error:"TOO_SHORT"}:{};var i=Ske(r);return i.ext?i:{number:r}}function Yke(t,e,n){var r={country:t,phone:e};return n&&(r.ext=n),r}function Jke(t,e,n,r){var i=XN(jz(t),void 0,e,n,r.metadata),s=i.countryCallingCodeSource,a=i.countryCallingCode,o=i.number,l;if(a)r.selectNumberingPlan(a);else if(o&&(e||n))e?(l=e,r.selectNumberingPlan(e),a=r.numberingPlan.callingCode()):(r.selectNumberingPlan(n),a=n);else return{};if(!o)return{countryCallingCodeSource:s,countryCallingCode:a};var u=PT(jz(o),void 0,r),f=u.nationalNumber,p=u.carrierCode,y=JN(a,{nationalNumber:f,metadata:r});return y&&(l=y,y==="001"||r.selectNumberingPlan(l)),{country:l,countryCallingCode:a,countryCallingCodeSource:s,nationalNumber:f,carrierCode:p}}function J3(t){"@babel/helpers - typeof";return J3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},J3(t)}function Uz(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Bz(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Uz(Object(n),!0).forEach(function(r){Xke(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Uz(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Xke(t,e,n){return(e=Qke(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Qke(t){var e=eTe(t,"string");return J3(e)=="symbol"?e:e+""}function eTe(t,e){if(J3(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(J3(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function tTe(t,e,n){return Zke(t,Bz(Bz({},e),{},{v2:!0}),n)}function X3(t){"@babel/helpers - typeof";return X3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},X3(t)}function Fz(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function nTe(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Fz(Object(n),!0).forEach(function(r){rTe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Fz(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function rTe(t,e,n){return(e=iTe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function iTe(t){var e=sTe(t,"string");return X3(e)=="symbol"?e:e+""}function sTe(t,e){if(X3(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(X3(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function aTe(t,e){return uTe(t)||cTe(t,e)||lTe(t,e)||oTe()}function oTe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 498In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lTe(t,e){if(t){if(typeof t=="string")return zz(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zz(t,e):void 0}}function zz(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function cTe(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(t)).next,e!==0)for(;!(l=(r=s.call(n)).done)&&(o.push(r.value),o.length!==e);l=!0);}catch(f){u=!0,i=f}
vendor: 34,388 bytes, lines 498-505
498finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function uTe(t){if(Array.isArray(t))return t}function kne(t){var e=Array.prototype.slice.call(t),n=aTe(e,4),r=n[0],i=n[1],s=n[2],a=n[3],o,l,u;if(typeof r=="string")o=r;else throw new TypeError("A text for parsing must be a string.");if(!i||typeof i=="string")a?(l=s,u=a):(l=void 0,u=s),i&&(l=nTe({defaultCountry:i},l));else if(df(i))s?(l=i,u=s):u=i;else throw new Error("Invalid second argument: ".concat(i));return{text:o,options:l,metadata:u}}function Q3(t){"@babel/helpers - typeof";return Q3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Q3(t)}function Vz(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Hz(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Vz(Object(n),!0).forEach(function(r){dTe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Vz(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function dTe(t,e,n){return(e=hTe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function hTe(t){var e=fTe(t,"string");return Q3(e)=="symbol"?e:e+""}function fTe(t,e){if(Q3(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Q3(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Tne(t,e,n){e&&e.defaultCountry&&!EAe(e.defaultCountry,n)&&(e=Hz(Hz({},e),{},{defaultCountry:void 0}));try{return tTe(t,e,n)}catch(r){if(!(r instanceof ou))throw r}}function pTe(){var t=kne(arguments),e=t.text,n=t.options,r=t.metadata;return Tne(e,n,r)}function e6(t){"@babel/helpers - typeof";return e6=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e6(t)}function Wz(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function qz(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Wz(Object(n),!0).forEach(function(r){mTe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Wz(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function mTe(t,e,n){return(e=yTe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yTe(t){var e=gTe(t,"string");return e6(e)=="symbol"?e:e+""}function gTe(t,e){if(e6(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(e6(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function bTe(){var t=kne(arguments),e=t.text,n=t.options,r=t.metadata;n=qz(qz({},n),{},{extract:!1});var i=Tne(e,n,r);return i&&i.isPossible()||!1}function t6(t){"@babel/helpers - typeof";return t6=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t6(t)}function wTe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function vTe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,xTe(r.key),r)}}function _Te(t,e,n){return e&&vTe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function xTe(t){var e=CTe(t,"string");return t6(e)=="symbol"?e:e+""}function CTe(t,e){if(t6(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(t6(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var ETe=(function(){function t(e){var n=e.onCountryChange,r=e.onCallingCodeChange;wTe(this,t),this.onCountryChange=n,this.onCallingCodeChange=r}return _Te(t,[{key:"reset",value:function(n){var r=n.country,i=n.callingCode;this.international=!1,this.missingPlus=!1,this.IDDPrefix=void 0,this.callingCode=void 0,this.digits="",this.resetNationalSignificantNumber(),this.initCountryAndCallingCode(r,i)}},{key:"resetNationalSignificantNumber",value:function(){this.nationalSignificantNumber=this.getNationalDigits(),this.nationalSignificantNumberIsModified=!1,this.nationalPrefix=void 0,this.carrierCode=void 0,this.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix=void 0}},{key:"update",value:function(n){for(var r=0,i=Object.keys(n);r<i.length;r++){var s=i[r];this[s]=n[s]}}},{key:"initCountryAndCallingCode",value:function(n,r){this.setCountry(n),this.setCallingCode(r)}},{key:"setCountry",value:function(n){this.country=n,this.onCountryChange(n)}},{key:"setCallingCode",value:function(n){this.callingCode=n,this.onCallingCodeChange(n,this.country)}},{key:"startInternationalNumber",value:function(n,r){this.international=!0,this.initCountryAndCallingCode(n,r)}},{key:"appendDigits",value:function(n){this.digits+=n}},{key:"appendNationalSignificantNumberDigits",value:function(n){this.nationalSignificantNumber+=n}},{key:"getNationalDigits",value:function(){return this.international?this.digits.slice((this.IDDPrefix?this.IDDPrefix.length:0)+(this.callingCode?this.callingCode.length:0)):this.digits}},{key:"getDigitsWithoutInternationalPrefix",value:function(){return this.international&&this.IDDPrefix?this.digits.slice(this.IDDPrefix.length):this.digits}}])})();function STe(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=ATe(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 499In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ATe(t,e){if(t){if(typeof t=="string")return Zz(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Zz(t,e):void 0}}function Zz(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var il="x",hE=new RegExp(il);function $w(t,e){if(e<1)return"";for(var n="";e>1;)e&1&&(n+=t),e>>=1,t+=t;return n+t}function Kz(t,e){return t[e]===")"&&e++,kTe(t.slice(0,e))}function kTe(t){for(var e=[],n=0;n<t.length;)t[n]==="("?e.push(n):t[n]===")"&&e.pop(),n++;var r=0,i="";e.push(t.length);for(var s=0,a=e;s<a.length;s++){var o=a[s];i+=t.slice(r,o),r=o+1}return i}function TTe(t,e,n){for(var r=STe(n.split("")),i;!(i=r()).done;){var s=i.value;if(t.slice(e+1).search(hE)<0)return;e=t.search(hE),t=t.replace(hE,s)}return[t,e]}function LTe(t,e,n){var r=n.metadata,i=n.shouldTryNationalPrefixFormattingRule,s=n.getSeparatorAfterNationalPrefix,a=new RegExp("^(?:".concat(e.pattern(),")$"));if(a.test(t.nationalSignificantNumber))return ITe(t,e,{metadata:r,shouldTryNationalPrefixFormattingRule:i,getSeparatorAfterNationalPrefix:s})}function $Te(t,e){return c5(t,void 0,e)==="IS_POSSIBLE"}function ITe(t,e,n){var r=n.metadata,i=n.shouldTryNationalPrefixFormattingRule,s=n.getSeparatorAfterNationalPrefix;if(t.nationalSignificantNumber,t.international,t.nationalPrefix,t.carrierCode,i(e)){var a=Gz(t,e,{useNationalPrefixFormattingRule:!0,getSeparatorAfterNationalPrefix:s,metadata:r});if(a)return a}return Gz(t,e,{useNationalPrefixFormattingRule:!1,getSeparatorAfterNationalPrefix:s,metadata:r})}function Gz(t,e,n){var r=n.metadata,i=n.useNationalPrefixFormattingRule,s=n.getSeparatorAfterNationalPrefix,a=xne(t.nationalSignificantNumber,e,{carrierCode:t.carrierCode,useInternationalFormat:t.international,withNationalPrefix:i,metadata:r});if(i||(t.nationalPrefix?a=t.nationalPrefix+s(e)+a:t.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix&&(a=t.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix+" "+a)),NTe(a,t))return a}function NTe(t,e){return H8(t)===e.getNationalDigits()}function n6(t){"@babel/helpers - typeof";return n6=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n6(t)}function OTe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function PTe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,jTe(r.key),r)}}function RTe(t,e,n){return e&&PTe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function jTe(t){var e=MTe(t,"string");return n6(e)=="symbol"?e:e+""}function MTe(t,e){if(n6(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(n6(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var DTe=(function(){function t(){OTe(this,t)}return RTe(t,[{key:"parse",value:function(n){if(this.context=[{or:!0,instructions:[]}],this.parsePattern(n),this.context.length!==1)throw new Error("Non-finalized contexts left when pattern parse ended");var r=this.context[0],i=r.branches,s=r.instructions;if(i)return{op:"|",args:i.concat([fE(s)])};if(s.length===0)throw new Error("Pattern is required");return s.length===1?s[0]:s}},{key:"startContext",value:function(n){this.context.push(n)}},{key:"endContext",value:function(){this.context.pop()}},{key:"getContext",value:function(){return this.context[this.context.length-1]}},{key:"parsePattern",value:function(n){if(!n)throw new Error("Pattern is required");var r=n.match(FTe);if(!r){if(BTe.test(n))throw new Error("Illegal characters found in a pattern: ".concat(n));this.getContext().instructions=this.getContext().instructions.concat(n.split(""));return}var i=r[1],s=n.slice(0,r.index),a=n.slice(r.index+i.length);switch(i){case"(?:":s&&this.parsePattern(s),this.startContext({or:!0,instructions:[],branches:[]});break;case")":if(!this.getContext().or)throw new Error('")" operator must be preceded by "(?:" operator');if(s&&this.parsePattern(s),this.getContext().instructions.length===0)throw new Error('No instructions found after "|" operator in an "or" group');var o=this.getContext(),l=o.branches;l.push(fE(this.getContext().instructions)),this.endContext(),this.getContext().instructions.push({op:"|",args:l});break;case"|":if(!this.getContext().or)throw new Error('"|" operator can only be used inside "or" groups');if(s&&this.parsePattern(s),!this.getContext().branches)if(this.context.length===1)this.getContext().branches=[];else throw new Error('"branches" not found in an "or" group context');this.getContext().branches.push(fE(this.getContext().instructions)),this.getContext().instructions=[];break;case"[":s&&this.parsePattern(s),this.startContext({oneOfSet:!0});break;case"]":if(!this.getContext().oneOfSet)throw new Error('"]" operator must be preceded by "[" operator');this.endContext(),this.getContext().instructions.push({op:"[]",args:UTe(s)});break;default:throw new Error("Unknown operator: ".concat(i))}a&&this.parsePattern(a)}}])})();function UTe(t){for(var e=[],n=0;n<t.length;){if(t[n]==="-"){if(n===0||n===t.length-1)throw new Error("Couldn't parse a one-of set pattern: ".concat(t));for(var r=t[n-1].charCodeAt(0)+1,i=t[n+1].charCodeAt(0)-1,s=r;s<=i;)e.push(String.fromCharCode(s)),s++}else e.push(t[n]);n++}return e}var BTe=/[\(\)\[\]\?\:\|]/,FTe=new RegExp("(\\||\\(\\?\\:|\\)|\\[|\\])");function fE(t){return t.length===1?t[0]:t}function Yz(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=zTe(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 500In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zTe(t,e){if(t){if(typeof t=="string")return Jz(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Jz(t,e):void 0}}function Jz(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function r6(t){"@babel/helpers - typeof";return r6=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r6(t)}function VTe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function HTe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,qTe(r.key),r)}}function WTe(t,e,n){return e&&HTe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function qTe(t){var e=ZTe(t,"string");return r6(e)=="symbol"?e:e+""}function ZTe(t,e){if(r6(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(r6(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var KTe=(function(){function t(e){VTe(this,t),this.matchTree=new DTe().parse(e)}return WTe(t,[{key:"match",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.allowOverflow;if(!n)throw new Error("String is required");var s=UT(n.split(""),this.matchTree,!0);if(s&&s.match&&delete s.matchedChars,!(s&&s.overflow&&!i))return s}}])})();function UT(t,e,n){if(typeof e=="string"){var r=t.join("");return e.indexOf(r)===0?t.length===e.length?{match:!0,matchedChars:t}:{partialMatch:!0}:r.indexOf(e)===0?n&&t.length>e.length?{overflow:!0}:{match:!0,matchedChars:t.slice(0,e.length)}:void 0}if(Array.isArray(e)){for(var i=t.slice(),s=0;s<e.length;){var a=e[s],o=UT(i,a,n&&s===e.length-1);if(o){if(o.overflow)return o;if(o.match){if(i=i.slice(o.matchedChars.length),i.length===0)return s===e.length-1?{match:!0,matchedChars:t}:{partialMatch:!0}}else{if(o.partialMatch)return{partialMatch:!0};throw new Error(`Unsupported match result: 501`.concat(JSON.stringify(o,null,2)))}}else return;s++}return n?{overflow:!0}:{match:!0,matchedChars:t.slice(0,t.length-i.length)}}switch(e.op){case"|":for(var l,u=Yz(e.args),f;!(f=u()).done;){var p=f.value,y=UT(t,p,n);if(y){if(y.overflow)return y;if(y.match)return{match:!0,matchedChars:y.matchedChars};if(y.partialMatch)l=!0;else throw new Error(`Unsupported match result: 502`.concat(JSON.stringify(y,null,2)))}}return l?{partialMatch:!0}:void 0;case"[]":for(var g=Yz(e.args),b;!(b=g()).done;){var v=b.value;if(t[0]===v)return t.length===1?{match:!0,matchedChars:t}:n?{overflow:!0}:{match:!0,matchedChars:[v]}}return;default:throw new Error("Unsupported instruction tree: ".concat(e))}}function i6(t){"@babel/helpers - typeof";return i6=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i6(t)}function Xz(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=GTe(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 503In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function GTe(t,e){if(t){if(typeof t=="string")return Qz(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Qz(t,e):void 0}}function Qz(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function YTe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function JTe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,QTe(r.key),r)}}function XTe(t,e,n){return e&&JTe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function QTe(t){var e=eLe(t,"string");return i6(e)=="symbol"?e:e+""}function eLe(t,e){if(i6(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(i6(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var BT="9",tLe=15,nLe=$w(BT,tLe),rLe=/[- ]/,iLe=function(){return/\[([^\[\]])*\]/g},sLe=function(){return/\d(?=[^,}][^,}])/g},aLe=new RegExp("["+yl+"]*\\$1["+yl+"]*(\\$\\d["+yl+"]*)*$"),eV=3,oLe=(function(){function t(e){e.state;var n=e.metadata;YTe(this,t),this.metadata=n,this.resetFormat()}return XTe(t,[{key:"resetFormat",value:function(){this.chosenFormat=void 0,this.template=void 0,this.nationalNumberTemplate=void 0,this.populatedNationalNumberTemplate=void 0,this.populatedNationalNumberTemplatePosition=-1}},{key:"reset",value:function(n,r){this.resetFormat(),n?(this.isNANP=n.callingCode()==="1",this.matchingFormats=n.formats(),r.nationalSignificantNumber&&this.narrowDownMatchingFormats(r)):(this.isNANP=void 0,this.matchingFormats=[])}},{key:"format",value:function(n,r){var i=this;if($Te(r.nationalSignificantNumber,this.metadata))for(var s=Xz(this.matchingFormats),a;!(a=s()).done;){var o=a.value,l=LTe(r,o,{metadata:this.metadata,shouldTryNationalPrefixFormattingRule:function(f){return i.shouldTryNationalPrefixFormattingRule(f,{international:r.international,nationalPrefix:r.nationalPrefix})},getSeparatorAfterNationalPrefix:function(f){return i.getSeparatorAfterNationalPrefix(f)}});if(l)return this.resetFormat(),this.chosenFormat=o,this.setNationalNumberTemplate(l.replace(/\d/g,il),r),this.populatedNationalNumberTemplate=l,this.populatedNationalNumberTemplatePosition=this.template.lastIndexOf(il),l}return this.formatNationalNumberWithNextDigits(n,r)}},{key:"formatNationalNumberWithNextDigits",value:function(n,r){var i=this.chosenFormat,s=this.chooseFormat(r);if(s)return s===i?this.formatNextNationalNumberDigits(n):this.formatNextNationalNumberDigits(r.getNationalDigits())}},{key:"narrowDownMatchingFormats",value:function(n){var r=this,i=n.nationalSignificantNumber,s=n.nationalPrefix,a=n.international,o=i,l=o.length-eV;l<0&&(l=0),this.matchingFormats=this.matchingFormats.filter(function(u){return r.formatSuits(u,a,s)&&r.formatMatches(u,o,l)}),this.chosenFormat&&this.matchingFormats.indexOf(this.chosenFormat)===-1&&this.resetFormat()}},{key:"formatSuits",value:function(n,r,i){return!(i&&!n.usesNationalPrefix()&&!n.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!r&&!i&&n.nationalPrefixIsMandatoryWhenFormattingInNationalFormat())}},{key:"formatMatches",value:function(n,r,i){var s=n.leadingDigitsPatterns().length;if(s===0)return!0;i=Math.min(i,s-1);var a=n.leadingDigitsPatterns()[i];if(r.length<eV)try{return new KTe(a).match(r,{allowOverflow:!0})!==void 0}catch(o){return console.error(o),!0}return new RegExp("^(".concat(a,")")).test(r)}},{key:"getFormatFormat",value:function(n,r){return r?n.internationalFormat():n.format()}},{key:"chooseFormat",value:function(n){for(var r=this,i=function(){var u=o.value;return r.chosenFormat===u?0:aLe.test(r.getFormatFormat(u,n.international))?r.createTemplateForFormat(u,n)?(r.chosenFormat=u,0):(r.matchingFormats=r.matchingFormats.filter(function(f){return f!==u}),1):1},s,a=Xz(this.matchingFormats.slice()),o;!(o=a()).done&&(s=i(),s!==0););return this.chosenFormat||this.resetFormat(),this.chosenFormat}},{key:"createTemplateForFormat",value:function(n,r){if(!(n.pattern().indexOf("|")>=0)){var i=this.getTemplateForFormat(n,r);if(i)return this.setNationalNumberTemplate(i,r),!0}}},{key:"getSeparatorAfterNationalPrefix",value:function(n){return this.isNANP||n&&n.nationalPrefixFormattingRule()&&rLe.test(n.nationalPrefixFormattingRule())?" ":""}},{key:"getInternationalPrefixBeforeCountryCallingCode",value:function(n,r){var i=n.IDDPrefix,s=n.missingPlus;return i?r&&r.spacing===!1?i:i+" ":s?"":"+"}},{key:"getTemplate",value:function(n){if(this.template){for(var r=-1,i=0,s=n.international?this.getInternationalPrefixBeforeCountryCallingCode(n,{spacing:!1}):"";i<s.length+n.getDigitsWithoutInternationalPrefix().length;)r=this.template.indexOf(il,r+1),i++;return Kz(this.template,r+1)}}},{key:"setNationalNumberTemplate",value:function(n,r){this.nationalNumberTemplate=n,this.populatedNationalNumberTemplate=n,this.populatedNationalNumberTemplatePosition=-1,r.international?this.template=this.getInternationalPrefixBeforeCountryCallingCode(r).replace(/[\d\+]/g,il)+$w(il,r.callingCode.length)+" "+n:this.template=n}},{key:"getTemplateForFormat",value:function(n,r){var i=r.nationalSignificantNumber,s=r.international,a=r.nationalPrefix,o=r.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix,l=n.pattern();l=l.replace(iLe(),"\\d").replace(sLe(),"\\d");var u=nLe.match(l)[0];if(!(i.length>u.length)){var f=new RegExp("^"+l+"$"),p=i.replace(/\d/g,BT);f.test(p)&&(u=p);var y=this.getFormatFormat(n,s),g;if(this.shouldTryNationalPrefixFormattingRule(n,{international:s,nationalPrefix:a})){var b=y.replace(_ne,n.nationalPrefixFormattingRule());if(H8(n.nationalPrefixFormattingRule())===(a||"")+H8("$1")&&(y=b,g=!0,a))for(var v=a.length;v>0;)y=y.replace(/\d/,il),v--}var _=u.replace(new RegExp(l),y).replace(new RegExp(BT,"g"),il);return g||(o?_=$w(il,o.length)+" "+_:a&&(_=$w(il,a.length)+this.getSeparatorAfterNationalPrefix(n)+_)),s&&(_=vne(_)),_}}},{key:"formatNextNationalNumberDigits",value:function(n){var r=TTe(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition,n);if(!r){this.resetFormat();return}return this.populatedNationalNumberTemplate=r[0],this.populatedNationalNumberTemplatePosition=r[1],Kz(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition+1)}},{key:"shouldTryNationalPrefixFormattingRule",value:function(n,r){var i=r.international,s=r.nationalPrefix;if(n.nationalPrefixFormattingRule()){var a=n.usesNationalPrefix();if(a&&s||!a&&!i)return!0}}}])})();function s6(t){"@babel/helpers - typeof";return s6=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s6(t)}function Lne(t,e){return dLe(t)||uLe(t,e)||cLe(t,e)||lLe()}function lLe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 504In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cLe(t,e){if(t){if(typeof t=="string")return tV(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?tV(t,e):void 0}}function tV(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function uLe(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(t)).next,e!==0)for(;!(l=(r=s.call(n)).done)&&(o.push(r.value),o.length!==e);l=!0);}catch(f){u=!0,i=f}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function dLe(t){if(Array.isArray(t))return t}function hLe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function fLe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,mLe(r.key),r)}}function pLe(t,e,n){return e&&fLe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function mLe(t){var e=yLe(t,"string");return s6(e)=="symbol"?e:e+""}function yLe(t,e){if(s6(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(s6(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var gLe="["+yl+Ds+"]+",bLe=new RegExp("^"+gLe+"$","i"),wLe="(?:["+Z7+"]["+yl+Ds+"]*|["+yl+Ds+"]+)",vLe=new RegExp("[^"+yl+Ds+"]+.*$"),_Le=/[^\d\[\]]/,xLe=(function(){function t(e){var n=e.defaultCountry,r=e.defaultCallingCode,i=e.metadata,s=e.onNationalSignificantNumberChange;hLe(this,t),this.defaultCountry=n,this.defaultCallingCode=r,this.metadata=i,this.onNationalSignificantNumberChange=s}return pLe(t,[{key:"input",value:function(n,r){var i=SLe(n),s=Lne(i,2),a=s[0],o=s[1],l=H8(a),u;return o&&(r.digits||(r.startInternationalNumber(void 0,void 0),l||(u=!0))),l&&this.inputDigits(l,r),{digits:l,justLeadingPlus:u}}},{key:"inputDigits",value:function(n,r){var i=r.digits,s=i.length<3&&i.length+n.length>=3;if(r.appendDigits(n),s&&this.extractIddPrefix(r),this.isWaitingForCountryCallingCode(r)){if(!this.extractCountryCallingCode(r))return}else r.appendNationalSignificantNumberDigits(n);r.international||this.hasExtractedNationalSignificantNumber||this.extractNationalSignificantNumber(r.getNationalDigits(),function(a){return r.update(a)})}},{key:"isWaitingForCountryCallingCode",value:function(n){var r=n.international,i=n.callingCode;return r&&!i}},{key:"extractCountryCallingCode",value:function(n){var r=XN("+"+n.getDigitsWithoutInternationalPrefix(),n.country,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),i=r.countryCallingCode,s=r.number;if(i)return n.setCallingCode(i),n.update({nationalSignificantNumber:s}),!0}},{key:"reset",value:function(n){if(n){this.hasSelectedNumberingPlan=!0;var r=n._nationalPrefixForParsing();this.couldPossiblyExtractAnotherNationalSignificantNumber=r&&_Le.test(r)}else this.hasSelectedNumberingPlan=void 0,this.couldPossiblyExtractAnotherNationalSignificantNumber=void 0}},{key:"extractNationalSignificantNumber",value:function(n,r){if(this.hasSelectedNumberingPlan){var i=OT(n,this.metadata),s=i.nationalPrefix,a=i.nationalNumber,o=i.carrierCode;if(a!==n)return this.onExtractedNationalNumber(s,o,a,n,r),!0}}},{key:"extractAnotherNationalSignificantNumber",value:function(n,r,i){if(!this.hasExtractedNationalSignificantNumber)return this.extractNationalSignificantNumber(n,i);if(this.couldPossiblyExtractAnotherNationalSignificantNumber){var s=OT(n,this.metadata),a=s.nationalPrefix,o=s.nationalNumber,l=s.carrierCode;if(o!==r)return this.onExtractedNationalNumber(a,l,o,n,i),!0}}},{key:"onExtractedNationalNumber",value:function(n,r,i,s,a){var o=!1,l,u=s.lastIndexOf(i);if(u<0||u!==s.length-i.length)o=!0;else{var f=s.slice(0,u);f&&f!==n&&(l=f)}a({nationalPrefix:n,carrierCode:r,nationalSignificantNumber:i,nationalSignificantNumberIsModified:o,prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix:l}),this.hasExtractedNationalSignificantNumber=!0,this.onNationalSignificantNumberChange()}},{key:"reExtractNationalSignificantNumber",value:function(n){if(this.extractAnotherNationalSignificantNumber(n.getNationalDigits(),n.nationalSignificantNumber,function(r){return n.update(r)}))return!0;if(this.extractIddPrefix(n))return this.extractCallingCodeAndNationalSignificantNumber(n),!0;if(this.fixMissingPlus(n))return this.extractCallingCodeAndNationalSignificantNumber(n),!0}},{key:"extractIddPrefix",value:function(n){var r=n.international,i=n.IDDPrefix,s=n.digits;if(n.nationalSignificantNumber,!(r||i)){var a=gne(s,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata);if(a!==void 0&&a!==s)return n.update({IDDPrefix:s.slice(0,s.length-a.length)}),this.startInternationalNumber(n,{country:void 0,callingCode:void 0}),!0}}},{key:"fixMissingPlus",value:function(n){if(!n.international){var r=wne(n.digits,n.country,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),i=r.countryCallingCode;if(i)return n.update({missingPlus:!0}),this.startInternationalNumber(n,{country:n.country,callingCode:i}),!0}}},{key:"startInternationalNumber",value:function(n,r){var i=r.country,s=r.callingCode;n.startInternationalNumber(i,s),n.nationalSignificantNumber&&(n.resetNationalSignificantNumber(),this.onNationalSignificantNumberChange(),this.hasExtractedNationalSignificantNumber=void 0)}},{key:"extractCallingCodeAndNationalSignificantNumber",value:function(n){this.extractCountryCallingCode(n)&&this.extractNationalSignificantNumber(n.getNationalDigits(),function(r){return n.update(r)})}}])})();function CLe(t){var e=t.search(wLe);if(!(e<0)){t=t.slice(e);var n;return t[0]==="+"&&(n=!0,t=t.slice(1)),t=t.replace(vLe,""),n&&(t="+"+t),t}}function ELe(t){var e=CLe(t)||"";return e[0]==="+"?[e.slice(1),!0]:[e]}function SLe(t){var e=ELe(t),n=Lne(e,2),r=n[0],i=n[1];return bLe.test(r)||(r=""),[r,i]}function a6(t){"@babel/helpers - typeof";return a6=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a6(t)}function ALe(t,e){return $Le(t)||LLe(t,e)||TLe(t,e)||kLe()}function kLe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 505In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function TLe(t,e){if(t){if(typeof t=="string")return nV(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?nV(t,e):void 0}}function nV(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function LLe(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(t)).next,e!==0)for(;!(l=(r=s.call(n)).done)&&(o.push(r.value),o.length!==e);l=!0);}catch(f){u=!0,i=f}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function $Le(t){if(Array.isArray(t))return t}function ILe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function NLe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,PLe(r.key),r)}}function OLe(t,e,n){return e&&NLe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function PLe(t){var e=RLe(t,"string");return a6(e)=="symbol"?e:e+""}function RLe(t,e){if(a6(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(a6(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var $ne=(function(){function t(e,n){ILe(this,t),this.metadata=new Ki(n);var r=this.getCountryAndCallingCode(e),i=ALe(r,2),s=i[0],a=i[1];this.defaultCountry=s,this.defaultCallingCode=a,this.reset()}return OLe(t,[{key:"getCountryAndCallingCode",value:function(n){var r,i;return n&&(df(n)?(r=n.defaultCountry,i=n.defaultCallingCode):r=n),r&&!this.metadata.hasCountry(r)&&(r=void 0),[r,i]}},{key:"input",value:function(n){var r=this.parser.input(n,this.state),i=r.digits,s=r.justLeadingPlus;if(s)this.formattedOutput="+";else if(i){this.determineTheCountryIfNeeded(),this.state.nationalSignificantNumber&&this.formatter.narrowDownMatchingFormats(this.state);var a;if(this.metadata.hasSelectedNumberingPlan()&&(a=this.formatter.format(i,this.state)),a===void 0&&this.parser.reExtractNationalSignificantNumber(this.state)){this.determineTheCountryIfNeeded();var o=this.state.getNationalDigits();o&&(a=this.formatter.format(o,this.state))}this.formattedOutput=a?this.getFullNumber(a):this.getNonFormattedNumber()}return this.formattedOutput}},{key:"reset",value:function(){var n=this;return this.state=new ETe({onCountryChange:function(i){n.country=i},onCallingCodeChange:function(i,s){n.metadata.selectNumberingPlan(s||i),n.formatter.reset(n.metadata.numberingPlan,n.state),n.parser.reset(n.metadata.numberingPlan)}}),this.formatter=new oLe({state:this.state,metadata:this.metadata}),this.parser=new xLe({defaultCountry:this.defaultCountry,defaultCallingCode:this.defaultCallingCode,metadata:this.metadata,state:this.state,onNationalSignificantNumberChange:function(){n.determineTheCountryIfNeeded(),n.formatter.reset(n.metadata.numberingPlan,n.state)}}),this.state.reset({country:this.defaultCountry,callingCode:this.defaultCallingCode}),this.formattedOutput="",this}},{key:"isInternational",value:function(){return this.state.international}},{key:"getCallingCode",value:function(){if(this.isInternational())return this.state.callingCode}},{key:"getCountryCallingCode",value:function(){return this.getCallingCode()}},{key:"getCountry",value:function(){var n=this.state.digits;if(n)return this._getCountry()}},{key:"_getCountry",value:function(){var n=this.state.country;return n}},{key:"determineTheCountryIfNeeded",value:function(){(!this.state.country||this.isCountryCallingCodeAmbiguous())&&this.determineTheCountry()}},{key:"getFullNumber",value:function(n){var r=this;if(this.isInternational()){var i=function(o){return r.formatter.getInternationalPrefixBeforeCountryCallingCode(r.state,{spacing:!!o})+o},s=this.state.callingCode;return i(s?n?"".concat(s," ").concat(n):s:"".concat(this.state.getDigitsWithoutInternationalPrefix()))}return n}},{key:"getNonFormattedNationalNumberWithPrefix",value:function(){var n=this.state,r=n.nationalSignificantNumber,i=n.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix,s=n.nationalPrefix,a=r,o=i||s;return o&&(a=o+a),a}},{key:"getNonFormattedNumber",value:function(){var n=this.state.nationalSignificantNumberIsModified;return this.getFullNumber(n?this.state.getNationalDigits():this.getNon
505FormattedNationalNumberWithPrefix())}},{key:"getNonFormattedTemplate",value:function(){var n=this.getNonFormattedNumber();if(n)return n.replace(/[\+\d]/g,il)}},{key:"isCountryCallingCodeAmbiguous",value:function(){var n=this.state.callingCode,r=this.metadata.getCountryCodesForCallingCode(n);return r&&r.length>1}},{key:"determineTheCountry",value:function(){var n=JN(this.isInternational()?this.state.callingCode:this.defaultCallingCode,{nationalNumber:this.state.nationalSignificantNumber,metadata:this.metadata});n!==this.state.country&&(this.state.setCountry(n),n&&this.metadata.selectNumberingPlan(n))}},{key:"getNumberValue",value:function(){var n=this.state,r=n.digits,i=n.callingCode,s=n.country,a=n.nationalSignificantNumber;if(r){if(this.isInternational())return i?"+"+i+a:"+"+r;if(s||i){var o=s?this.metadata.countryCallingCode():i;return"+"+o+a}}}},{key:"getNumber",value:function(){var n=this.state,r=n.nationalSignificantNumber,i=n.carrierCode,s=n.callingCode;if(r){var a=this._getCountry();if(!(!a&&!s)){if(a&&a===this.defaultCountry){var o=this.metadata.numberingPlan.callingCode(),l=jLe(o,r,this.metadata);l&&(a=l)}var u=new QN(a||s,r,this.metadata.metadata);return i&&(u.carrierCode=i),u}}}},{key:"isPossible",value:function(){var n=this.getNumber();return n?n.isPossible():!1}},{key:"isValid",value:function(){var n=this.getNumber();return n?n.isValid():!1}},{key:"validateLength",value:function(){var n=this.state,r=n.digits,i=n.nationalSignificantNumber;if(!r)return"NOT_A_NUMBER";if(!this.metadata.numberingPlan)return"INVALID_COUNTRY";if(!i)return"TOO_SHORT";var s=c5(i,void 0,this.metadata);if(s!=="IS_POSSIBLE")return s}},{key:"getNationalNumber",value:function(){return this.state.nationalSignificantNumber}},{key:"getChars",value:function(){return(this.state.international?"+":"")+this.state.digits}},{key:"getTemplate",value:function(){return this.formatter.getTemplate(this.state)||this.getNonFormattedTemplate()||""}}])})();function jLe(t,e,n){var r=n.getCountryCodesForCallingCode(t);if(r.length>1)return bne(e,r,n.metadata)}function MLe(t){return new Ki(t).getCountries()}function DLe(t,e,n){if(e[t])return new QN(t,e[t],n)}function ULe(){return l5(pTe,arguments)}function BLe(){return l5(bTe,arguments)}function o6(t){return $ne.call(this,t,fne)}o6.prototype=Object.create($ne.prototype,{});o6.prototype.constructor=o6;function FLe(){return l5(MLe,arguments)}function Ine(){return l5(KN,arguments)}function zLe(){return l5(DLe,arguments)}var rV=Object.defineProperty,u5=(t,e)=>{let n={};for(var r in t)rV(n,r,{get:t[r],enumerable:!0});return rV(n,Symbol.toStringTag,{value:"Module"}),n};function VLe(t){return{digest:(t==null?void 0:t.digest)??((e,n)=>globalThis.crypto.subtle.digest(e,n)),randomUUID:(t==null?void 0:t.randomUUID)??(()=>globalThis.crypto.randomUUID())}}const W8=t=>/^0x[0-9a-fA-F]*$/.test(t),FT=t=>Buffer.from(t,"utf8"),q8=t=>`0x${t.toString("hex")}`,zT=Symbol("data-suffix-plugin");function HLe(t=[]){return t.find(e=>e.id===zT)}var WLe=class{constructor(e){fe(this,"_privyInternal");fe(this,"_smartWalletConfig");this._privyInternal=e}getConfig(){return this._privyInternal.config}async getSmartWalletConfig(){return this._smartWalletConfig||(this._smartWalletConfig=await this._privyInternal.fetch(I5e,{params:{app_id:this.appId}})),this._smartWalletConfig}get appId(){return this._privyInternal.appId}},Th=class Nne{constructor(e){fe(this,"value");fe(this,"_decoded");this.value=e,this._decoded=sbe(e)}static parse(e){try{return new Nne(e)}catch{return null}}get subject(){return this._decoded.sub}get expiration(){return this._decoded.exp}get issuer(){return this._decoded.iss}get audience(){return this._decoded.aud}isExpired(e=0){return Date.now()>=(this.expiration-e)*1e3}},y2,qLe=(y2=class{constructor(e,n){fe(this,"_storage");fe(this,"_privyInternal");this._privyInternal=e,this._storage=n}async updateOnCrossAppAuthentication(e,n){let r=n.access_token,i=y2.providerAccessTokenStorageKey(e);await this._storage.put(i,r)}async getProviderAccessToken(e){let n=y2.providerAccessTokenStorageKey(e),r=await this._storage.get(n);if(typeof r!="string")return null;try{if(new Th(r).isExpired())throw Error("JWT is expired");return r}catch{return await this._storage.del(n),null}}async getCrossAppConnections(){return await this._privyInternal.fetch(z6e,{params:{app_id:this._privyInternal.appId}})}},fe(y2,"providerAccessTokenStorageKey",e=>`privy:cross-app:${e}`),y2),ZLe=class{constructor(e){fe(this,"_privyInternal");this._privyInternal=e}async revoke(){await this._privyInternal.fetch(G5e,{})}}
505,A4=class extends Error{constructor({error:n,code:r,status:i}){super(n);fe(this,"name","PrivyApiError");fe(this,"error");fe(this,"code");fe(this,"status");this.error=n,this.code=r,this.status=i}},yt=class extends Error{constructor({error:n,code:r}){super(n);fe(this,"error");fe(this,"code");this.code=r,this.error=n}},KLe=class extends Error{constructor({error:n,code:r,response:i}){super(n);fe(this,"error");fe(this,"code");fe(this,"response");this.code=r,this.error=n,this.response=i}};const Kl=t=>!!t.id&&t.recovery_method==="privy-v2",GLe=["error","invalid_request_arguments","wallet_not_on_device","invalid_recovery_pin","insufficient_funds","mfa_timeout","missing_or_invalid_mfa","mfa_verification_max_attempts_reached"];(function(t){return t.MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",t.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",t.INVALID_DATA="invalid_data",t.LINKED_TO_ANOTHER_USER="linked_to_another_user",t.ALLOWLIST_REJECTED="allowlist_rejected",t.OAUTH_USER_DENIED="oauth_user_denied",t.UNKNOWN_AUTH_ERROR="unknown_auth_error",t.USER_EXITED_AUTH_FLOW="exited_auth_flow",t.MUST_BE_AUTHENTICATED="must_be_authenticated",t.UNKNOWN_CONNECT_WALLET_ERROR="unknown_connect_wallet_error",t.GENERIC_CONNECT_WALLET_ERROR="generic_connect_wallet_error",t.CLIENT_REQUEST_TIMEOUT="client_request_timeout",t.INVALID_CREDENTIALS="invalid_credentials",t})({});var YLe=class extends Error{constructor(n,r,i){super(n);fe(this,"cause");fe(this,"privyErrorCode");r instanceof Error&&(this.cause=r),this.privyErrorCode=i}toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},Iw=class extends Error{constructor(n,r){super(r);fe(this,"type");this.type=n}},One=class extends YLe{constructor(n,r,i){super(n,r,i);fe(this,"type","connector_error")}},pE=class extends Error{constructor(n,r,i){super(n);fe(this,"code");fe(this,"data");this.code=r,this.data=i}};const _0={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},E4001_DEFAULT_USER_REJECTED_REQUEST:{eipCode:4001,message:"User Rejected Request",detail:"The user rejected the request.",default:!0,retryable:!0},E4100_DEFAULT_UNAUTHORIZED:{eipCode:4100,message:"Unauthorized",detail:"The requested method and/or account has not been authorized by the user.",default:!0,retryable:!1},E4200_DEFAULT_UNSUPPORTED_METHOD:{eipCode:4200,message:"Unsupported Method",detail:"The Provider does not support the requested method.",default:!0,retryable:!1},E4900_DEFAULT_DISCONNECTED:{eipCode:4900,message:"Disconnected",detail:"The Provider is disconnected from all chains.",default:!0,retryable:!0},E4901_DEFAULT_CHAIN_DISCONNECTED:{eipCode:4901,message:"Chain Disconnected",detail:"The Provider is not connected to the requested chain.",default:!0,retryable:!0},E32700_DEFAULT_PARSE_ERROR:{eipCode:-32700,message:"Parse error",detail:"Invalid JSON",default:!0,retryable:!1},E32600_DEFAULT_INVALID_REQUEST:{eipCode:-32600,message:"Invalid request",detail:"JSON is not a valid request object",default:!0,retryable:!1},E32601_DEFAULT_METHOD_NOT_FOUND:{eipCode:-32601,message:"Method not found",detail:"Method does not exist",default:!0,retryable:!1},E32602_DEFAULT_INVALID_PARAMS:{eipCode:-32602,message:"Invalid params",detail:"Invalid method parameters",default:!0,retryable:!1},E32603_DEFAULT_INTERNAL_ERROR:{eipCode:-32603,message:"Internal error",detail:"Internal JSON-RPC error",default:!0,retryable:!0},E32000_DEFAULT_INVALID_INPUT:{eipCode:-32e3,message:"Invalid input",detail:"Missing or invalid parameters",default:!0,retryable:!1},E32001_DEFAULT_RESOURCE_NOT_FOUND:{eipCode:-32001,message:"Resource not found",detail:"Requested resource not found",default:!0,retryable:!1},E32002_DEFAULT_RESOURCE_UNAVAILABLE:{eipCode:-32002,message:"Resource unavailable",detail:"Requested resource not available",default:!0,retryable:!0},E32003_DEFAULT_TRANSACTION_REJECTED:{eipCode:-32003,message:"Transaction rejected",detail:"Transaction creation failed",default:!0,retryable:!0},E32004_DEFAULT_METHOD_NOT_SUPPORTED:{eipCode:-32004,message:"Method not supported",detail
505:"Method is not implemented",default:!0,retryable:!1},E32005_DEFAULT_LIMIT_EXCEEDED:{eipCode:-32005,message:"Limit exceeded",detail:"Request exceeds defined limit",default:!0,retryable:!1},E32006_DEFAULT_JSON_RPC_VERSION_NOT_SUPPORTED:{eipCode:-32006,message:"JSON-RPC version not supported",detail:"Version of JSON-RPC protocol is not supported",default:!0,retryable:!1},E32002_CONNECTION_ALREADY_PENDING:{eipCode:-32002,message:"Connection request already pending",detail:"Donât see your wallet? Check your other browser windows.",retryable:!1},E32002_REQUEST_ALREADY_PENDING:{eipCode:-32002,message:"Resource request already pending",detail:"Donât see your wallet? Check your other browser windows.",retryable:!1},E32002_WALLET_LOCKED:{eipCode:-32002,message:"Wallet might be locked",detail:"Unlock your wallet and try again.",retryable:!0},E4001_USER_REJECTED_REQUEST:{eipCode:4001,message:"Signature rejected",detail:"Please try signing again.",retryable:!0}};function JLe(t){let e=t.type;return typeof e=="string"&&GLe.includes(e)}function tO(t){return JLe(t)&&t.type==="wallet_not_on_device"}async function Pne(t,e){let n;if(e instanceof Uint8Array)n=W0.base64.fromBytes(e);else{let i=rCe(e);if(i===void 0)throw new yt({error:"Failed to prepare the payload for signing",code:"invalid_input"});n=W0.base64.fromBytes(W0.utf8.toBytes(i))}let{signature:r}=await t({message:n});return{signature:r}}const Z8="privy-request-expiry",Rne=1800*1e3;async function xo(t,e,{wallet_id:n,headers:r,...i}){let s=t.getCompiledPath(NC,{params:{wallet_id:n}}),a=String(Date.now()+Rne),{signature:o}=await Pne(e,{version:1,url:s,method:NC.method,headers:{"privy-app-id":t.app.appId,[Z8]:a},body:{...i}});if(Date.now()>Number(a))throw new yt({error:"Wallet request expired before it could be sent. Please try again.",code:"embedded_wallet_request_expired"});return await t.fetchPrivyRoute(NC,{body:i,params:{wallet_id:n},headers:{"privy-authorization-signature":o,[Z8]:a,...r??{}}})}function jne(t){return Gh(t)?QLe(t):XLe(t)}function XLe(t){return{from:t.from,to:t.to??void 0,nonce:Es(t.nonce),chain_id:Es(t.chainId),data:r$e(t.data),value:Es(t.value),type:i$e(t.type),gas_limit:Es(t.gasLimit??t.gas),gas_price:Es(t.gasPrice),max_fee_per_gas:Es(t.maxFeePerGas),max_priority_fee_per_gas:Es(t.maxPriorityFeePerGas)}}function QLe(t){return{type:U7,from:t.from,chain_id:Es(t.chainId),nonce:Es(t.nonce),nonce_key:Es(t.nonceKey),gas_limit:Es(t.gasLimit),max_fee_per_gas:Es(t.maxFeePerGas),max_priority_fee_per_gas:Es(t.maxPriorityFeePerGas),fee_token:t.feeToken,valid_after:Es(t.validAfter),valid_before:Es(t.validBefore),fee_payer_signature:t$e(t.feePayerSignature),access_list:e$e(t.accessList),calls:t.calls.map(e=>({to:e.to,data:e.data,value:Es(e.value)}))}}function e$e(t){if(t)return Array.isArray(t)?t.map(e=>"address"in e?{address:e.address,storage_keys:[...e.storageKeys]}:{address:e[0],storage_keys:[...e[1]]}):Object.entries(t).map(([e,n])=>({address:e,storage_keys:[...n]}))}function t$e(t){if(!t)return;let e=n$e(t);if(e!==0&&e!==1)throw Error("Tempo fee payer signatures require a valid yParity value");return{r:t.r,s:t.s,y_parity:e}}function n$e(t){if(t.yParity!==void 0)return t.yParity;if(t.v!==void 0)return Number(t.v)-27}function r$e(t){if(t!==void 0)return typeof t=="string"?W8(t)?t:q8(FT(t)):q8(Buffer.from(Uint8Array.from(t)))}const Mne=[0,1,2,4];function i$e(t){if(t==null)return;let e=Number(t);if(!s$e(e))throw Error(`Invalid transaction type: expected ${Mne.join(", ")} as a number or hex string, got "${t}".`);return e}function s$e(t){return Mne.includes(t)}function Es(t){if(typeof t=="number"||typeof t=="bigint")return`0x${BigInt(t).toString(16)}`;if(typeof t=="string"){if(W8(t))return t;throw Error(`Invalid quantity string: expected a hex-prefixed value (0xâ¦), got "${t}". Use a number, bigint, or hex string instead.`)}}function a$e(t){return typeof t=="string"&&(t=JSON.parse(t)),{types:t.types,primary_type:String(t.primaryType),domain:t.domain,message:t.message}}async function Dne({context:t,account:e,rpcRequest:n}){switch(n.chainType){case"ethereum":return o$e({context:t,account:e,rpcRequest:n.request});case"solana":return l$e({context:t,account:e,rpcRequest:n.request})}}async function o$e({context:t,account:e,rpcRequest:n}){switch(n.method){case"personal_sign":{let[r]=n.params,i=await xo(t,t.signRequest,{chain_type:"ethereum",method:"personal_sign",wallet_id:e.id,params:r.startsWith("0x")?{message:r.slice(2),encoding:"hex"}:{message:r,encoding:"utf-8"}});if(i.method!=="personal_sign")throw Error("Unable to sign message");return{data:i.data.signature}}case"eth_signTransaction":{let[r]=n.params,i=await xo(t,t.signRequest,{chain_type:"ethereum",method:"eth_signTransaction",wallet_id:e.id,params:{transaction:jne(r)}});if(i.method!=="eth_signTransaction")throw Error("Unable to sign transaction");return{data:i.data.signed_transaction}}case"eth_signTypedData_v4":{let[,r]=n.params,i=await xo(t,t.signRequest,{chain_type:"ethereum",method:n.method,wallet_id:e.id,params:{typed_data:a$e(r)}});if(i.method!=="eth_signTypedData_v4")throw Error("Unable to sign typed data");return{data:i.data.signature}}case"eth_sign":{let[,r]=n.params,i=await xo(t,t.signRequest,{chain_type:"ethereum",method:"secp256k1_sign",wallet_id:e.id,params:{hash:W8(r)?r:q8(FT(r))}});if(i.method!=="secp256k1_sign")throw Error("Unable to sign message");return{data:i.data.signature}}case"secp256k1_sign":{let[r]=n.params,i=await xo(t,t.signRequest,{chain_type:"ethereum",method:"secp256k1_sign",wallet_id:e.id,params:{hash:W8(r)?r:q8(FT(r))}});if(i.method!=="secp256k1_sign")throw Error("Unable to sign message");return{data:i.data.signature}}case"csw_signUserOperation":case"eth_sendTransaction":case"eth_populateTransactionRequest":throw Error(`This wallet does not support the method: ${n.method}`)}}async function l$e({context:t,account:e,rpcRequest:n}){switch(n.method){case"signMessage":{let{message:r}=n.params,i=await xo(t,t.signRequest,{chain_type:"solana",method:"signMessage",wallet_id:e.id,params:{message:r,encoding:"base64"}});if(i.method!=="signMessage")throw Error("Unable to sign message");return{data:i.data.signature}}}}const iV=(t,e,n,r)=>{let i=Number(t),s=e.find(o=>o.id===i);if(!s)throw new One(`Unsupported chainId ${t}`,4901);let a=u$e(s,n,r.appId);if(i===uf.id||i===q3.id){let o=i===uf.id?uf:q3;return B3({transport:y1(a),chain:o})}return B3({transport:y1(a),chain:s})};function c$e(t){return t===uf.id||t===q3.id}const u$e=(t,e,n)=>{var a,o,l;let r=t.id,i=Number(t.id),s;if(t.rpcUrls.privyWalletOverride&&t.rpcUrls.privyWalletOverride.http[0])s=t.rpcUrls.privyWalletOverride.http[0];else if(e.rpcUrls&&e.rpcUrls[i])s=e.rpcUrls[i];else if((a=t.rpcUrls.privy)!=null&&a.http[0]){let u=new URL(t.rpcUrls.privy.http[0]);u.searchParams.append("privyAppId",n),s=u.toString()}else s=(o=t.rpcUrls.public)!=null&&o.http[0]?t.rpcUrls.public.http[0]:(l=t.rpcUrls.default)==null?void 0:l.http[0];if(!s)throw new One(`No RPC url found for ${r}`);return s};function d$e({currentRecoveryMethod:t,upgradeToRecoveryMethod:e}){switch(t){case"privy":case"user-passcode":case"recovery-encryption-key":return!0;case"icloud":case"google-drive":if(t===e)throw Error("Cannot upgrade to the existing cloud platform");return!0;
505default:throw Error("Unknown recovery method")}}const h$e=new Set(["eth_sign","personal_sign","eth_signTypedData_v4","csw_signUserOperation","secp256k1_sign"]);var mE=class extends qf{constructor({walletProxy:n,privyInternal:r,account:i,entropyId:s,entropyIdVerifier:a,chains:o,onNeedsRecovery:l,chainId:u=o[0].id,appApi:f,dataSuffixPlugin:p}){super();fe(this,"_walletProxy");fe(this,"_privyInternal");fe(this,"_account");fe(this,"_entropyId");fe(this,"_entropyIdVerifier");fe(this,"_chainId");fe(this,"_chains");fe(this,"_onNeedsRecovery");fe(this,"_client");fe(this,"_appApi");fe(this,"_dataSuffixPlugin");this._walletProxy=n,this._privyInternal=r,this._account=i,this._entropyId=s,this._entropyIdVerifier=a,this._chainId=u,this._chains=o,this._onNeedsRecovery=l,this._client=iV(u,o,{rpcUrls:[]},{appId:f.appId}),this._appApi=f,this._dataSuffixPlugin=p}async request(n){var r,i,s;if(h$e.has(n.method))return this.handleIFrameRpc(n);switch(n.method){case"eth_accounts":case"eth_requestAccounts":return this._account.address?[this._account.address]:[];case"eth_chainId":return`0x${this._chainId.toString(16)}`;case"wallet_switchEthereumChain":return this.handleSwitchEthereumChain(n);case"eth_estimateGas":return this.handleEstimateGas(n);case"eth_signTransaction":{let a=this.applyDataSuffix((r=n.params)==null?void 0:r[0]);return this.handleSignTransaction(a)}case"eth_sendTransaction":{let a=this.applyDataSuffix((i=n.params)==null?void 0:i[0]);return this.handleSendTransaction(a)}case"eth_populateTransactionRequest":{let a=(s=n.params)==null?void 0:s[0];return this.handlePopulateTransaction(a)}default:return this.handleJsonRpc(n)}}applyDataSuffix(n){if(!this._dataSuffixPlugin||Gh(n))return n;
505let r=typeof n.data=="string"?n.data:"0x";return{...n,data:this._dataSuffixPlugin.appendDataSuffix({data:r})}}ensureChainId(n){let r={chainId:this._chainId,...n};return this.internalSwitchEthereumChain(r.chainId),r}internalSwitchEthereumChain(n){!n||Number(n)===this._chainId||(this._chainId=Number(n),this._client=iV(this._chainId,this._chains,{rpcUrls:[]},{appId:this._privyInternal.appId}),this.emit("chainChanged",n))}async handlePopulateTransaction(n){let r=this.ensureChainId(n);if(Gh(r)){let o=qF(r),l=eCe(await this.requireTempoClient().prepareTransactionRequest({account:r.from??this._account.address,...o}),r.gasLimit);return{...r,...l,type:U7}}let i=A8(r),{gas:s,...a}=await this._client.prepareTransactionRequest({account:r.from??this._account.address,...i});return{...a,gasLimit:s,type:_te[a.type],authorizationList:r.authorizationList}}async handleSignTransaction(n){let r={...n};for(let i of Object.keys(r)){let s=r[i];typeof s=="bigint"&&(r[i]=Dt(s))}return Gh(r)&&(r.calls=r.calls.map(i=>({...i,value:typeof i.value=="bigint"?Dt(i.value):i.value}))),await this.handleIFrameRpc({method:"eth_signTransaction",params:[r]})}async handleSendTransaction(n){let r=await this.handlePopulateTransaction(n),i=await this.handleSignTransaction(r);return await this.handleJsonRpc({method:"eth_sendRawTransaction",params:[i]})}async handleEstimateGas(n){var a;if(!n.params||!Array.isArray(n.params))throw Error("Invalid params for eth_estimateGas");let r=(a=n.params)==null?void 0:a[0],i=this.ensureChainId(r);if(Gh(i)){let o=qF(i);return await this.requireTempoClient().estimateGas({account:i.from??this._account.address,...o})}let s=A8(i);return await this._client.estimateGas({account:i.from??this._account.address,...s})}handleSwitchEthereumChain(n){if(!n.params||!Array.isArray(n.params))throw new pE(`Invalid params for ${n.method}`,4200);let r;if(typeof n.params[0]=="string")r=n.params[0];else if("chainId"in n.params[0]&&typeof n.params[0].chainId=="string")r=n.params[0].chainId;else throw new pE(`Invalid params for ${n.method}`,4200);this.internalSwitchEthereumChain(r)}async handleIFrameRpc(n){try{let r=await this._privyInternal.getAccessTokenInternal();if(!r)throw Error("Missing privy token. User must be logged in");this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_rpc_started",{method:n.method,address:this._account.address});let i=this._account;if(Kl(i)){let{data:s}=await Dne({context:{app:this._appApi,fetchPrivyRoute:(...a)=>this._privyInternal.fetch(...a),getCompiledPath:(...a)=>this._privyInternal.getPath(...a),signRequest:({message:a})=>this._walletProxy.signWithUserSigner({accessToken:r,message:a})},account:i,rpcRequest:{chainType:"ethereum",request:n}});return s}try{await this._walletProxy.connect({entropyId:this._entropyId,entropyIdVerifier:this._entropyIdVerifier,accessToken:r})}catch(s){let a=tO(s);if(a&&this._account.recovery_method==="privy")await this._walletProxy.recover({entropyId:this._entropyId,entropyIdVerifier:this._entropyIdVerifier,accessToken:r});else if(a&&this._onNeedsRecovery){let o;await new Promise(async(l,u)=>{var f;o=setTimeout(()=>u(new yt({code:"embedded_wallet_recovery_error",error:"User-owned recovery timed out"})),12e4),await((f=this._onNeedsRecovery)==null?void 0:f.call(this,{recoveryMethod:this._account.recovery_method,onRecovered:()=>l(!0)}))}).finally(()=>clearTimeout(o))}else throw s}return(await this._walletProxy.rpcWallet({accessToken:r,request:n,entropyId:this._entropyId,entropyIdVerifier:this._entropyIdVerifier,hdWalletIndex:this._account.wallet_index,chainType:"ethereum"})).response.data}catch(r){console.error(r);let i=r instanceof Error?r.message:"Unable to make wallet request";throw this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_rpc_failed",{method:n.method,address:this._account.address,error:i}),new yt({code:"embedded_wallet_request_error",error:i})}}async handleJsonRpc(n){return this._client.request(n)}requireTempoClient(){if(!c$e(this._chainId))throw new pE(`Cannot send a Tempo (type 118) transaction on chain ${this._chainId}`,4901);return this._client}toJSON(){return`PrivyEIP1193Provider { address: '${this._account.address}', chainId: ${this._chainId}, request: [Function] }`}};function VT(t){return"version"in t}function sV(t,e){let n=(VT(t)?t.message:t.compileMessage()).staticAccountKeys.find(r=>r.toBase58()===e);if(!n)throw Error(`Transaction does not contain public key ${e}`);return n}var f$e=class{constructor({proxy:e,privyInternal:n,account:r,entropyId:i,entropyIdVerifier:s,onNeedsRecovery:a,app:o}){fe(this,"_proxy");fe(this,"_privyInternal");fe(this,"_app");fe(this,"_entropyId");fe(this,"_entropyIdVerifier");
505fe(this,"_account");fe(this,"_onNeedsRecovery");this._proxy=e,this._privyInternal=n,this._account=r,this._entropyId=i,this._entropyIdVerifier=s,this._onNeedsRecovery=a,this._app=o}async request(e){if(!await this._privyInternal.getAccessTokenInternal())throw new yt({error:"Missing access token",code:"attempted_rpc_call_before_logged_in"});switch(e.method){case"signAndSendTransaction":return await this.handleSignAndSendTransaction(e);case"signTransaction":return await this.handleSignTransaction(e);default:return await this.handleIFrameRpc(e)}}get _publicKey(){return this._account.address}async connectAndRecover(e){if(this._account.recovery_method!=="privy-v2")try{await this._proxy.connect({entropyId:this._entropyId,entropyIdVerifier:this._entropyIdVerifier,accessToken:e})}catch(n){let r=tO(n);if(r&&this._account.recovery_method==="privy")await this._proxy.recover({entropyId:this._entropyId,entropyIdVerifier:this._entropyIdVerifier,accessToken:e});else if(r&&this._onNeedsRecovery){let i;await new Promise(async(s,a)=>{var o;i=setTimeout(()=>a(new yt({code:"embedded_wallet_recovery_error",error:"User-owned recovery timed out"})),12e4),await((o=this._onNeedsRecovery)==null?void 0:o.call(this,{recoveryMethod:this._account.recovery_method,onRecovered:()=>s(!0)}))}).finally(()=>clearTimeout(i))}else throw n}}async signMessageRpc(e,n){let r=this._account;if(Kl(r)){let{data:i}=await Dne({context:{app:this._app,fetchPrivyRoute:(...s)=>this._privyInternal.fetch(...s),getCompiledPath:(...s)=>this._privyInternal.getPath(...s),signRequest:({message:s})=>this._proxy.signWithUserSigner({accessToken:n,message:s})},account:r,rpcRequest:{chainType:"solana",request:e}});return{signature:i}}else return(await this._proxy.rpcWallet({accessToken:n,request:e,chainType:"solana",hdWalletIndex:this._account.wallet_index,entropyId:this._entropyId,entropyIdVerifier:this._entropyIdVerifier})).response.data}async handleIFrameRpc(e){try{let n=await this._privyInternal.getAccessTokenInternal();if(!n)throw Error("Missing privy token. User must be logged in");return this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_rpc_started",{method:e.method,address:this._account.address}),await this.connectAndRecover(n),await this.signMessageRpc(e,n)}catch(n){console.error(n);let r=n instanceof Error?n.message:"Unable to make wallet request";throw this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_rpc_failed",{method:e.method,address:this._account.address,error:r}),new yt({code:"embedded_wallet_request_error",error:r})}}async handleSignAndSendTransaction(e){try{let n=await this._privyInternal.getAccessTokenInternal();if(!n)throw Error("Missing privy token. User must be logged in");this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_rpc_started",{method:e.method,address:this._account.address}),await this.connectAndRecover(n);let{transaction:r,connection:i,options:s}=e.params,a=sV(r,this._account.address),o=VT(r)?Buffer.from(r.message.serialize()):r.serializeMessage(),{signature:l}=await this.signMessageRpc({method:"signMessage",params:{message:o.toString("base64")}},n);return r.addSignature(a,Buffer.from(l,"base64")),{signature:await i.sendRawTransaction(r.serialize(),s)}}catch(n){console.error(n);let r=n instanceof Error?n.message:"Unable to make wallet request";throw this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_rpc_failed",{method:e.method,address:this._account.address,error:r}),new yt({code:"embedded_wallet_request_error",error:r})}}async handleSignTransaction(e){try{let n=await this._privyInternal.getAccessTokenInternal();if(!n)throw Error("Missing privy token. User must be logged in");this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_rpc_started",{method:e.method,address:this._account.address}),await this.connectAndRecover(n);let{transaction:r}=e.params,i=sV(r,this._account.address),s=VT(r)?Buffer.from(r.message.serialize()):r.serializeMessage(),{signature:a}=await this.signMessageRpc({method:"signMessage",params:{message:s.toString("base64")}},n);return r.addSignature(i,Buffer.from(a,"base64")),{signedTransaction:r}}catch(n){console.error(n);let r=n instanceof Error?n.message:"Unable to make wallet request";throw this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_rpc_failed",{method:e.method,address:this._account.wallet_index,error:r}),new yt({code:"embedded_wallet_request_error",error:r})}}
505toJSON(){return`PrivyEmbeddedSolanaProvider { address: '${this._account.address}', request: [Function] }`}},p$e=class{constructor({proxy:e,privyInternal:n,account:r,entropyId:i,entropyIdVerifier:s}){fe(this,"_proxy");fe(this,"_privyInternal");fe(this,"_account");fe(this,"_entropyId");fe(this,"_entropyIdVerifier");this._proxy=e,this._privyInternal=n,this._account=r,this._entropyId=i,this._entropyIdVerifier=s}async sign({message:e}){return await this.request({method:"sign",params:{message:new TextDecoder("utf8").decode(e)}})}async signTransaction({psbt:e}){return await this.request({method:"signTransaction",params:{psbt:e}})}async request(e){if(Kl(this._account))throw new yt({code:"unsupported_wallet_type",error:"Bitcoin wallet providers are only supported for on-device execution and this app uses TEE execution. Use the useSignRawHash hook from @privy-io/expo/extended-chains to sign over a hash with this wallet. Learn more at https://docs.privy.io/recipes/tee-wallet-migration-guide"});if(!await this._privyInternal.getAccessTokenInternal())throw new yt({error:"Missing access token",code:"attempted_rpc_call_before_logged_in"});return this.handleIFrameRpc(e)}async handleIFrameRpc(e){try{let n=await this._privyInternal.getAccessTokenInternal();if(!n)throw Error("Missing access token. User must be authenticated.");return this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_rpc_started",{method:e.method,address:this._account.address}),(await this._proxy.rpcWallet({accessToken:n,request:e,entropyId:this._entropyId,entropyIdVerifier:this._entropyIdVerifier,hdWalletIndex:this._account.wallet_index,chainType:this._account.chain_type})).response.data}catch(n){console.error(n);let r=n instanceof Error?n.message:"Unable to make wallet request";throw this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_rpc_failed",{method:e.method,address:this._account.address,error:r}),new yt({code:"embedded_wallet_request_error",error:r})}}toJSON(){return`PrivyEmbeddedBitcoinProvider { address: '${this._account.address}', request: [Function] }`}},m$e=class{constructor(){fe(this,"callbacks",{})}enqueue(e,n){this.callbacks[e]=n}flush(e){let n=Object.values(this.callbacks);this.callbacks={};for(let{reject:r}of n)r(e)}dequeue(e,n){let r=this.callbacks[n];if(!r)return console.warn(`[Privy] No callback found for "${e}" (id: ${n})`),null;switch(delete this.callbacks[n],e){case"privy:iframe:ready":return r;case"privy:wallets:create":return r;case"privy:user-signer:sign":return r;case"privy:wallets:add":return r;case"privy:wallets:set-recovery":return r;case"privy:wallets:connect":return r;case"privy:wallets:recover":return r;case"privy:wallets:rpc":return r;case"privy:wallets:import":return r;case"privy:wallet:create":return r;case"privy:wallet:connect":return r;case"privy:wallet:recover":return r;case"privy:wallet:rpc":return r;case"privy:solana-wallet:create":return r;case"privy:solana-wallet:create-additional":return r;case"privy:solana-wallet:connect":return r;case"privy:solana-wallet:recover":return r;case"privy:solana-wallet:rpc":return r;case"privy:delegated-actions:consent":return r;case"privy:mfa:verify":return r;case"privy:mfa:init-enrollment":return r;case"privy:mfa:submit-enrollment":return r;case"privy:mfa:unenroll":return r;case"privy:mfa:clear":return r;case"privy:auth:unlink-passkey":return r;default:throw Error(`invalid wallet event type ${e}`)}}};async function y$e(t,e,n,r,i=!1,s,a){var f,p,y;let o=i,l=async g=>{var b;return o?(g===+!i?r():(b=n.current)==null||b.reject(new Iw("missing_or_invalid_mfa","MFA verification failed, retry.")),await t(await new Promise((v,_)=>{e.current={resolve:v,reject:_},setTimeout(()=>{var S;let C=new Iw("mfa_timeout","Timed out waiting for MFA code");(S=n.current)==null||S.reject(C),_(C)},a)}))):await t()},u=null;for(let g=0;g<s;g++)try{u=await l(g),(f=n.current)==null||f.resolve(void 0);break}catch(b){if(b.type==="missing_or_invalid_mfa")o=!0;else throw(p=n.current)==null||p.resolve(void 0),b}if(u===null){let g=new Iw("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw(y=n.current)==null||y.reject(g),g}return u}function g$e(t){return t.error!==void 0}const b$e=(function(t){return()=>`id-${t++}`})(0),w$e=(t,e)=>typeof e=="bigint"?e.toString():e,v$e=(t,e)=>`${t}${JSON.stringify(e,w$e)}`,Hc=async(t,{ms:e,msg:n})=>{let r,i=new Promise((s,a)=>{r=setTimeout(()=>{a(Error(n))},e??15e3)});try{return await Promise.race([t,i])}finally{r!==void 0&&clearTimeout(r)}},yE=new m$e;var aV=class{constructor(e,n){fe(this,"ready");fe(this,"_waitForReadyPromise",null);
505fe(this,"cache");fe(this,"_embeddedWalletMessagePoster");fe(this,"mfa");this.ready=!1,this.cache=new Map,this._embeddedWalletMessagePoster=e,this.mfa=n}invokeWithMfa(e,n){return Hc(y$e(r=>Hc(this.waitForReady().then(()=>e(r)),{msg:n.timeoutMsg,ms:n.timeoutMs}),this.mfa.rootPromise,this.mfa.submitPromise,()=>this.mfa.emit("mfaRequired"),n.mfaAlwaysRequired??!1,4,3e5),{msg:"Operation reached timeout: MFA verification",ms:126e4})}reload(){return this.ready=!1,this._waitForReadyPromise=null,yE.flush(Error("Embedded wallet WebView was reloaded")),this.cache.clear(),this._embeddedWalletMessagePoster.reload()}onBackground(){this.ready=!1}ping(e=15e3){return Hc(this.invoke("privy:iframe:ready",{}),{msg:"Ping reached timeout",ms:e})}create(e){return Hc(this.waitForReady().then(()=>this.invoke("privy:wallet:create",e)),{msg:"Operation reached timeout: create"})}rpc(e){return this.invokeWithMfa(n=>this.invoke("privy:wallet:rpc",{...n,...e}),{timeoutMsg:"Operation reached timeout: rpc"})}createSolana(e){return this.invokeWithMfa(n=>this.invoke("privy:solana-wallet:create",{...n,...e}),{timeoutMsg:"Operation reached timeout: create",timeoutMs:6e4})}createAdditionalSolana(e){return Hc(this.waitForReady().then(()=>this.invoke("privy:solana-wallet:create-additional",e)),{msg:"Operation reached timeout: create"})}solanaRpc(e){return this.invokeWithMfa(n=>this.invoke("privy:solana-wallet:rpc",{...n,...e}),{timeoutMsg:"Operation reached timeout: solana-rpc"})}delegateWallets(e){return this.invokeWithMfa(n=>this.invoke("privy:delegated-actions:consent",{...n,...e}),{timeoutMsg:"Operation reached timeout: delegated-actions:consent"})}verifyMfa(e){return this.invokeWithMfa(n=>this.invoke("privy:mfa:verify",{...n,...e}),{timeoutMsg:"Operation reached timeout: mfa:verify",mfaAlwaysRequired:!0})}initEnrollMfa(e){return this.invokeWithMfa(n=>this.invoke("privy:mfa:init-enrollment",{...n,...e}),{timeoutMsg:"Operation reached timeout: mfa:init-enrollment"})}submitEnrollMfa(e){return e.method==="passkey"?this.invokeWithMfa(n=>this.invoke("privy:mfa:submit-enrollment",{...n,...e}),{timeoutMsg:"Operation reached timeout: mfa:submit-enrollment"}):Hc(this.waitForReady().then(()=>this.invoke("privy:mfa:submit-enrollment",e)),{msg:"Operation reached timeout: mfa:submit-enrollment"})}unenrollMfa(e){return this.invokeWithMfa(n=>this.invoke("privy:mfa:unenroll",{...n,...e}),{timeoutMsg:"Operation reached timeout: mfa:unenroll",mfaAlwaysRequired:!0})}unlinkPasskey(e){return this.invokeWithMfa(n=>this.invoke("privy:auth:unlink-passkey",{...n,...e}),{timeoutMsg:"Operation reached timeout: auth:unlink-passkey",mfaAlwaysRequired:!0})}clearMfa(e){return Hc(this.waitForReady().then(()=>this.invoke("privy:mfa:clear",e)),{msg:"Operation reached timeout: mfa:clear"})}createWallet(e){return this.invokeWithMfa(n=>this.invoke("privy:wallets:create",{...n,...e}),{timeoutMsg:"Operation reached timeout: create",timeoutMs:6e4})}signWithUserSigner(e){return this.invokeWithMfa(n=>this.invoke("privy:user-signer:sign",{...n,...e}),{timeoutMsg:"Operation reached timeout: user-signer:sign"})}addWallet(e){return Hc(this.waitForReady().then(()=>this.invoke("privy:wallets:add",e)),{msg:"Operation reached timeout: wallets:add"})}importWallet(e){return this.invokeWithMfa(n=>this.invoke("privy:wallets:import",{...n,...e}),{timeoutMsg:"Operation reached timeout: wallets:import",timeoutMs:6e4})}setRecovery(e){return this.invokeWithMfa(n=>this.invoke("privy:wallets:set-recovery",{...n,...e}),{timeoutMsg:"Operation reached timeout: wallets:set-recovery",timeoutMs:6e4})}connect(e){return Hc(this.waitForReady().then(()=>this.invoke("privy:wallets:connect",e)),{msg:"Operation reached timeout: wallets:connect"})}recover(e){return this.invokeWithMfa(n=>this.invoke("privy:wallets:recover",{...n,...e}),{timeoutMsg:"Operation reached timeout: wallets:recover",timeoutMs:6e4})}rpcWallet(e){return this.invokeWithMfa(n=>this.invoke("privy:wallets:rpc",{...n,...e}),{timeoutMsg:"Operation reached timeout: wallets:rpc"})}handleEmbeddedWalletMessages(e){if(!e.event.startsWith("privy:")){console.warn(`Unsupported event type: ${e.event}`);return}let n=yE.dequeue(e.event,e.id);if(n)return g$e(e)?n.reject(new Iw(e.error.type,e.error.message)):n.resolve(e.data)}waitForReady(){return this.ready?Promise.resolve():(this._waitForReadyPromise||(this._waitForReadyPromise=new Promise((e,n
505)=>{(async()=>{for(let r=0;r<100&&!this.ready;r++)this.invoke("privy:iframe:ready",{}).then(()=>{this.ready=!0,this._waitForReadyPromise=null,e()}).catch(()=>{}),await new Promise(i=>setTimeout(i,150));this.ready||(this._waitForReadyPromise=null,n(Error("Embedded wallet WebView failed to become ready")))})()})),this._waitForReadyPromise)}invoke(e,n){let r=v$e(e,n);if(e==="privy:wallet:create"||e==="privy:solana-wallet:create"){let s=this.cache.get(r);if(s)return s}let i=new Promise((s,a)=>{let o=b$e();yE.enqueue(o,{resolve:s,reject:a}),this._embeddedWalletMessagePoster.postMessage(JSON.stringify({id:o,event:e,data:n}),"*")}).finally(()=>{this.cache.delete(r)});return this.cache.set(r,i),i}};async function HT(t,{request:e,headers:n}){return await t.fetchPrivyRoute(xX,{body:e,headers:n})}async function gE({context:t,chainType:e,idempotencyKey:n}){return{wallet:await HT(t,{request:{chain_type:e,owner_id:void 0},headers:n?{"privy-idempotency-key":n}:void 0})}}var _$e=class{constructor(e,n,r,i,s,a,o){fe(this,"_privyInternal");fe(this,"_proxy");fe(this,"_chains",Array.from(M6));fe(this,"_mfa");fe(this,"_mfaPromises");fe(this,"_appApi");fe(this,"_dataSuffixPlugin");if(this._privyInternal=e,n&&(this._proxy=new aV(n,s),i.setProxy(this._proxy)),r){let l=SX(r);this._chains=l}
505this._mfa=i,this._mfaPromises=s,this._appApi=a,this._dataSuffixPlugin=o}setMessagePoster(e){this._proxy=new aV(e,this._mfaPromises),this._mfa.setProxy(this._proxy)}async signWithUserSigner(e){if(!this._proxy)throw Error("Embedded wallet proxy not initialized");let n=await this._privyInternal.getAccessTokenInternal();if(!n)throw new yt({error:"User must be logged in to sign a message with the user signer",code:"user_signer_sign_error"});let{signature:r}=await this._proxy.signWithUserSigner({accessToken:n,message:e.message});return{signature:r}}async add(e){var r;if(!this._proxy)throw Error("Embedded wallet proxy not initialized");if(((r=this._privyInternal.config)==null?void 0:r.embedded_wallet_config.mode)==="user-controlled-server-wallets-only")await gE({context:{app:this._appApi,fetchPrivyRoute:(...i)=>this._privyInternal.fetch(...i),getCompiledPath:(...i)=>this._privyInternal.getPath(...i)},chainType:e.chainType});else{let i=await this._privyInternal.getAccessTokenInternal();if(!i)throw new yt({error:"User must be logged in to create an embedded wallet",code:"embedded_wallet_creation_error"});await this._proxy.addWallet({accessToken:i,...e})}let{user:n}=await this._privyInternal.refreshSession();return{user:n}}async getBitcoinProvider({wallet:e,entropyId:n,entropyIdVerifier:r,recoveryPassword:i,recoveryAccessToken:s,recoverySecretOverride:a}){if(!this._proxy)throw Error("Embedded wallet proxy not initialized");if(!await this._privyInternal.getAccessTokenInternal())throw Error("User must be logged in to create an embedded wallet");return Kl(e)||await this._load({entropyId:n,entropyIdVerifier:r,wallet:e,recoveryPassword:i,recoveryAccessToken:s,recoverySecretOverride:a}),new p$e({account:e,privyInternal:this._privyInternal,proxy:this._proxy,entropyId:n,entropyIdVerifier:r})}async create({password:e,recoveryMethod:n,recoveryToken:r,recoveryKey:i,recoverySecretOverride:s,iCloudRecordNameOverride:a,solanaAccount:o,skipCallbacks:l,idempotencyKey:u}){var f,p;if(!this._proxy)throw Error("Embedded wallet proxy not initialized");if(((f=this._privyInternal.config)==null?void 0:f.embedded_wallet_config.mode)==="user-controlled-server-wallets-only"){if(n&&!n.startsWith("privy"))throw new yt({error:"User-controlled server wallets do not support custom recovery methods",code:"embedded_wallet_creation_error"});await gE({context:{app:this._appApi,fetchPrivyRoute:(...y)=>this._privyInternal.fetch(...y),getCompiledPath:(...y)=>this._privyInternal.getPath(...y)},chainType:"ethereum",idempotencyKey:u})}else{let y;if(y=n||(e?"user-passcode":"privy"),e&&typeof e!="string")throw Error("Invalid recovery password, must be a string");if(y==="privy"&&((p=this._privyInternal.config)!=null&&p.embedded_wallet_config.require_user_password_on_create))throw Error("Password not provided yet is required by App configuration");let g=await this._privyInternal.getAccessTokenInternal();if(!g)throw Error("User must be logged in to create an embedded wallet");let{address:b}=await this._proxy.create({accessToken:g,recoveryMethod:y,recoveryKey:i,recoveryPassword:e,recoveryAccessToken:r,recoverySecretOverride:s,iCloudRecordNameOverride:a,solanaAddress:o==null?void 0:o.address});if(!b)throw Error("Failed to create wallet")}return await this._privyInternal.refreshSession(l)}async importWallet({privateKey:e,chainType:n,additionalSigners:r}){var u;if(!this._proxy)throw Error("Embedded wallet proxy not initialized");let i=((u=this._privyInternal.config)==null?void 0:u.embedded_wallet_config.mode)==="user-controlled-server-wallets-only"?"tee":"on-device";if(r&&i==="on-device")throw new yt({error:"Specifying additionalSigners is only supported for TEE execution and this app uses on-device execution. Learn more https://docs.privy.io/recipes/tee-wallet-migration-guide",code:"invalid_input"});let s=await this._privyInternal.getAccessTokenInternal();if(!s)throw new yt({error:"User must be logged in to import an embedded wallet",code:"embedded_wallet_before_logged_in"});let{address:a}=await this._proxy.importWallet({accessToken:s,privateKey:e,chainType:n,mode:i,additionalSigners:r});if(!a)throw new yt({error:"Failed to import wallet",code:"embedded_wallet_creation_error"});let{session_update_action:o,...l}=await this._privyInternal.refreshSession();return{address:a,user:l}}async createSolana(e){var n,r;if(!this._proxy)throw new yt({error:"Embedded wallet proxy not initialized",code:"embedded_wallet_creation_error"});if(((n=this._privyInternal.config)==null?void 0:n.embedded_wallet_config.mode)==="user-controlled-server-wallets-only")await gE({context:{app:this._appApi,fetchPrivyRoute:(...i)=>this._privyInternal.fetch(...i),getCompiledPath:(...i)=>this._privyInternal.getPath(...i)},chainType:"solana",idempotencyKey:e==null?void 0:e.idempotencyKey});else{let i=await this._privyInternal.getAccessTokenInternal();if(!i)throw new yt({error:"User must be logged in to create an embedded wallet",code:"embedded_wallet_creation_error"});e!=null&&e.ethereumAccount&&await this.getProvider(e.ethereumAccount);let{publicKey:s}=await this._proxy.createSolana({accessToken:i,ethereumAddress:(r=e==null?void 0:e.ethereumAccount)==null?void 0:r.address});if(!s)throw new yt({error:"Failed to create wallet",code:"embedded_wallet_creation_error"})}return await this._privyInternal.refreshSession()}async delegateWallets({delegatedWallets:e,rootWallet:n}){if(!this._proxy)throw new yt({error:"Embedded wallet proxy not initialized",code:"embedded_wallet_creation_error"});let r=await this._privyInternal.getAccessTokenInternal();if(!r)throw new yt({error:"User must be logged in to create an embedded wallet",code:"embedded_wallet_creation_error"});await this._proxy.delegateWallets({accessToken:r,delegatedWallets:e,rootWallet:n})}async getProvider(e,n,r,i,s){if(!this._proxy)throw Error("Embedded wallet proxy not initialized");
505return Kl(e)||await this._load({wallet:e,entropyId:e.address,entropyIdVerifier:"ethereum-address-verifier",recoveryPassword:n,recoveryKey:s,recoveryAccessToken:r,recoverySecretOverride:i}),new mE({account:e,entropyId:e.address,entropyIdVerifier:"ethereum-address-verifier",privyInternal:this._privyInternal,chains:this._chains,walletProxy:this._proxy,appApi:this._appApi,dataSuffixPlugin:this._dataSuffixPlugin})}async getEthereumProvider({wallet:e,entropyId:n,entropyIdVerifier:r,recoveryPassword:i,recoveryAccessToken:s,recoverySecretOverride:a,recoveryKey:o,onNeedsRecovery:l}){if(!this._proxy)throw Error("Embedded wallet proxy not initialized");if(!await this._privyInternal.getAccessTokenInternal())throw Error("User must be logged in to create an embedded wallet");return Kl(e)||(!l||i||s||a||o)&&await this._load({entropyId:n,entropyIdVerifier:r,wallet:e,recoveryPassword:i,recoveryAccessToken:s,recoverySecretOverride:a,recoveryKey:o}),new mE({account:e,entropyId:n,entropyIdVerifier:"ethereum-address-verifier",privyInternal:this._privyInternal,chains:this._chains,walletProxy:this._proxy,onNeedsRecovery:l,appApi:this._appApi,dataSuffixPlugin:this._dataSuffixPlugin})}async getSolanaProvider(e,n,r,i,s,a,o){if(!this._proxy)throw new yt({error:"Embedded wallet proxy not initialized",code:"embedded_wallet_webview_not_loaded"});return Kl(e)||(!o||i||s||a)&&await this._load({wallet:e,entropyId:n,entropyIdVerifier:r,recoveryPassword:i,recoveryAccessToken:s,recoverySecretOverride:a}),new f$e({account:e,privyInternal:this._privyInternal,proxy:this._proxy,entropyId:n,entropyIdVerifier:r,onNeedsRecovery:o,app:this._appApi})}async setRecovery(e){let{wallet:n,...r}=e;if(!this._proxy)throw Error("Embedded wallet proxy not initialized");if(Kl(n))throw new yt({error:"This wallet does not support setting recovery methods",code:"unsupported_recovery_method"});d$e({currentRecoveryMethod:n.recovery_method,upgradeToRecoveryMethod:r.recoveryMethod==="icloud-native"?"icloud":r.recoveryMethod}),await this._load(n.chain_type==="solana"?{wallet:n,entropyId:n.address,entropyIdVerifier:"solana-address-ver
505ifier"}:{wallet:n,entropyId:n.address,entropyIdVerifier:"ethereum-address-verifier"});let i=await this._privyInternal.getAccessTokenInternal();if(!i)throw Error("User must be logged in to interact with embedded wallets");let s=n.recovery_method;this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_set_recovery_started",{address:n.address,target_recovery_method:r.recoveryMethod,existing_recovery_method:s});try{let a;if(r.recoveryMethod==="user-passcode")a={recoveryMethod:"user-passcode",recoveryPassword:r.password};else if(r.recoveryMethod==="google-drive")a={recoveryMethod:"google-drive",recoveryAccessToken:r.recoveryAccessToken};else if(r.recoveryMethod==="icloud")a={recoveryMethod:"icloud",recoveryAccessToken:r.recoveryAccessToken};else if(r.recoveryMethod==="icloud-native")a={recoveryMethod:"icloud-native",iCloudRecordNameOverride:r.iCloudRecordNameOverride,recoverySecretOverride:r.recoverySecretOverride};else if(r.recoveryMethod==="recovery-encryption-key")a={recoveryMethod:"recovery-encryption-key",recoveryKey:r.recoveryKey};else if(r.recoveryMethod==="privy")a={recoveryMethod:"privy"};else throw Error(`Unknown recovery method: ${r.recoveryMethod}`);await this._proxy.setRecovery({accessToken:i,entropyId:n.address,entropyIdVerifier:n.chain_type==="solana"?"solana-address-ver
505ifier":"ethereum-address-verifier",...a}),this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_set_recovery_completed",{address:n.address,target_recovery_method:r.recoveryMethod,existing_recovery_method:s});let{user:o}=await this._privyInternal.refreshSession();return{user:o,provider:n.chain_type==="ethereum"?new mE({account:n,entropyId:n.address,entropyIdVerifier:"ethereum-address-verifier",privyInternal:this._privyInternal,chains:this._chains,walletProxy:this._proxy,appApi:this._appApi,dataSuffixPlugin:this._dataSuffixPlugin}):null}}catch(a){throw this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_set_recovery_failed",{address:n.address,recovery_method:n.recovery_method,error:a instanceof Error?a.message:"Unable to recover wallet"}),a}}getURL(){let e=new URL(`${this._privyInternal.baseUrl}/apps/${this._privyInternal.appId}/embedded-wallets`);return this._privyInternal.caid&&e.searchParams.append("caid",this._privyInternal.caid),this._privyInternal.appClientId&&e.searchParams.append("client_id",this._privyInternal.appClientId),e.href}get chains(){return this._chains}onMessage(e){if(!this._proxy)throw Error("Embedded wallet proxy not initialized");return this._proxy.handleEmbeddedWalletMessages(e)}reload(){if(!this._proxy){this._privyInternal.logger.warn("Attempted to reload proxy before initialized");return}this._proxy.reload()}onBackground(){var e;(e=this._proxy)==null||e.onBackground()}async ping(e){try{if(!this._proxy)throw Error("Embedded wallet proxy not initialized");return await this._proxy.ping(e),!0}catch(n){return this._privyInternal.logger.debug(n),!1}}async _load({entropyId:e,entropyIdVerifier:n,wallet:r,recoveryPassword:i,recoveryKey:s,recoveryAccessToken:a,recoverySecretOverride:o}){if(!this._proxy)throw Error("Embedded wallet proxy not initialized");let l=await this._privyInternal.getAccessTokenInternal();if(!l)throw Error("User must be logged in to interact with embedded wallets");try{return await this._proxy.connect({accessToken:l,entropyId:e,entropyIdVerifier:n}),e}catch(u){if(tO(u)){try{if(r.recovery_method==="privy"){this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_started",{address:r.address,recovery_method:r.recovery_method});let f=await this._proxy.recover({accessToken:l,entropyId:e,entropyIdVerifier:n});return this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_completed",{address:r.address,recovery_method:r.recovery_method}),f.entropyId}if(r.recovery_method==="user-passcode"&&i){this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_started",{address:r.address,recovery_method:r.recovery_method});let f=await this._proxy.recover({accessToken:l,recoveryPassword:i,entropyId:e,entropyIdVerifier:n});return this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_completed",{address:r.address,recovery_method:r.recovery_method}),f.entropyId}if(["google-drive","icloud"].includes(r.recovery_method)&&a){this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_started",{address:r.address,recovery_method:r.recovery_method});let f=await this._proxy.recover({accessToken:l,recoveryAccessToken:a,entropyId:e,entropyIdVerifier:n});return this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_completed",{address:r.address,recovery_method:r.recovery_method}),f.entropyId}if(r.recovery_method==="icloud"&&o){this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_started",{address:r.address,recovery_method:"icloud-native"});let f=await this._proxy.recover({accessToken:l,recoverySecretOverride:o,entropyId:e,entropyIdVerifier:n});return this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_completed",{address:r.address,recovery_method:"icloud-native"}),f.entropyId}if(r.recovery_method==="recovery-encryption-key"&&s){this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_started",{address:r.address,recovery_method:r.recovery_method});let f=await this._proxy.recover({accessToken:l,recoveryKey:s,entropyId:e,entropyIdVerifier:n});return this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_completed",{address:r.address,recovery_method:r.re
505covery_method}),f.entropyId}}catch(f){throw this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_failed",{address:r.address,recovery_method:r.recovery_method,error:f instanceof Error?f.message:`Unable to recover wallet: ${e}`}),f}throw u}else throw u}}},x$e=class extends qf{constructor(){super();fe(this,"rootPromise");fe(this,"submitPromise");this.rootPromise={current:null},this.submitPromise={current:null}}};const C$e=["chrome-extension:","moz-extension:","safari-web-extension:"];let k4=!1;const Une=()=>{var t,e,n,r,i;if(k4)return!0;try{let s=globalThis,a=((e=(t=s.chrome)==null?void 0:t.runtime)==null?void 0:e.id)??((r=(n=s.browser)==null?void 0:n.runtime)==null?void 0:r.id),o=(i=s.location)==null?void 0:i.protocol;k4=typeof a=="string"&&a.length>0||typeof o=="string"&&C$e.includes(o)}catch{k4=!0}return k4},Qr={get(t){return cE.get(t)},set(t,e,n){Une()||cE.set(t,e,n)},remove(t){cE.remove(t)}},Bne=({useServerCookies:t,cookieWriteBehavior:e})=>t||e==="never"?!1:!Une(),T4="privy:active-user",bE="privy:saved-users",Ay=t=>t?`privy:${t}:token`:"privy:token",ky=t=>t?`privy:${t}:pat`:"privy:pat",Ty=t=>t?`privy:${t}:refresh_token`:"privy:refresh_token",Ly=t=>t?`privy:${t}:id-token`:"privy:id-token",wE=t=>t?`privy-${t}-token`:"privy-token",vE=t=>t?`privy-${t}-refresh-token`:"privy-refresh-token",_E=t=>t?`privy-${t}-id-token`:"privy-id-token",$y=t=>t?`privy-${t}-session`:"privy-session",Iy=Promise.allSettled.bind(Promise)??(t=>Promise.all(t.map(e=>e.then(n=>({status:"fulfilled",value:n})).catch(n=>({status:"rejected",reason:n}))))),E$e=["storage_cleared","token_cleared","refresh_token_cleared","identity_token_cleared","token_stored","refresh_token_stored","identity_token_stored","oauth_tokens_granted","error_storing_tokens"];var MA,S$e=(MA=class extends qf{constructor(n){super();fe(this,"_storage");fe(this,"_isUsingServerCookies",!1);fe(this,"_cookieWriteBehavior");fe(this,"GUEST_CREDENTIAL_STORAGE_KEY");
505fe(this,"_setStoredUsers");fe(this,"_hasEmittedStoredUsers",!1);this._storage=n.storage,this._isUsingServerCookies=n.isUsingServerCookies,this._cookieWriteBehavior=n.cookieWriteBehavior,this.GUEST_CREDENTIAL_STORAGE_KEY=`privy:guest:${n.appId}`,this._setStoredUsers=n.setStoredUsers}set isUsingServerCookies(n){this._isUsingServerCookies=n}shouldWriteCookies(){return Bne({useServerCookies:this._isUsingServerCookies,cookieWriteBehavior:this._cookieWriteBehavior})}writeCookie(n,r,i){this.shouldWriteCookies()&&Qr.set(n,r,i)}setStoredUsersCallback(n){this._setStoredUsers=n,this.getSavedUserIds().then(r=>{var i;this._hasEmittedStoredUsers||((i=this._setStoredUsers)==null||i.call(this,{users:r.map(s=>({id:s}))}))})}async getCustomerAccessToken(){let n=await this.getActiveUserId(),r=await this._storage.get(Ay(n));try{return typeof r=="string"?new Th(r).value:null}catch(i){return console.error(i),await this.destroyLocalState({reason:"getToken_error"}),null}}async getPrivyAccessToken(){let n=await this.getActiveUserId(),r=await this._storage.get(ky(n));try{return typeof r=="string"?new Th(r).value:null}catch(i){return console.error(i),await this.destroyLocalState({reason:"getToken_error"}),null}}async getRefreshToken(){let n=await this.getActiveUserId(),r=await this._storage.get(Ty(n));return typeof r=="string"?r:null}async getIdentityToken(){let n=await this.getActiveUserId(),r=await this._storage.get(Ly(n));return typeof r=="string"?r:null}async mightHaveServerCookies(){try{let n=await this.getActiveUserId(),r=Qr.get($y(n));if(r!==void 0&&r.length>0)return!0;let i=Qr.get($y(null));return i!==void 0&&i.length>0}catch(n){console.error(n)}return!1}async hasRefreshCredentials(n,r){return await this.mightHaveServerCookies()||typeof n=="string"&&typeof r=="string"}tokenIsActive(n){if(!n)return!1;let r=Th.parse(n);return r!==null&&!r.isExpired(30)}async destroyLocalState(n){let r=await this.getActiveUserId(),i=[this._storage.del(Ay(null)),this._storage.del(ky(null)),this._storage.del(Ty(null)),this._storage.del(Ly(null)),this._storage.del(this.GUEST_CREDENTIAL_STORAGE_KEY),this._storage.del(T4)];r&&i.push(this._storage.del(Ay(r)),this._storage.del(ky(r)),this._storage.del(Ty(r)),this._storage.del(Ly(r)),this.removeSavedUserId(r)),await Iy(i),Qr.remove(wE(null)),Qr.remove(vE(null)),Qr.remove(_E(null)),Qr.remove($y(null)),r&&(Qr.remove(wE(r)),Qr.remove(vE(r)),Qr.remove(_E(r)),Qr.remove($y(r))),n!=null&&n.reason&&this.emit("storage_cleared",{reason:n.reason})}async storeCustomerAccessToken(n){let r=await this.getActiveUserId();await this.storeCustomerAccessTokenForUser(r,n)}async storeCustomerAccessTokenForUser(n,r){var a;let i=Ay(n),s=wE(n);if(typeof r=="string"){let o=await this._storage.get(i);await this._storage.put(i,r);let l=(a=Th.parse(r))==null?void 0:a.expiration;this.writeCookie(s,r,{sameSite:"Strict",secure:!0,expires:l?new Date(l*1e3):void 0}),o!==r&&this.emit("token_stored",{cookiesEnabled:this._isUsingServerCookies})}else{let o=await this._storage.get(i);await this._storage.del(i),Qr.remove(s),o!==null&&this.emit("token_cleared",{reason:"set_with_non_string_value"})}}async storePrivyAccessToken(n){let r=await this.getActiveUserId();await this.storePrivyAccessTokenForUser(r,n)}async storePrivyAccessTokenForUser(n,r){let i=ky(n);typeof r=="string"?await this._storage.put(i,r):await this._storage.del(i)}async storeRefreshTokenForUser(n,r){let i=Ty(n),s=vE(n),a=$y(n);typeof r=="string"?(await this._storage.put(i,r),this.writeCookie(a,"t",{sameSite:"Strict",secure:!0,expires:30}),this.writeCookie(s,r,{sameSite:"Strict",secure:!0,expires:30}),this.emit("refresh_token_stored",{cookiesEnabled:this._isUsingServerCookies})):(await this._storage.del(i),Qr.remove(s),Qr.remove(a),this.emit("refresh_token_cleared",{reason:"set_with_non_string_value"}))}async updateWithTokensResponse(n){let r=n.user.id,i=(await Iy([this.storeCustomerAccessTokenForUser(r,n.token),this.storePrivyAccessTokenForUser(r,n.privy_access_token),this.storeRefreshTokenForUser(r,n.refresh_token),this.storeIdentityTokenForUser(r,n.identity_token)])).filter(o=>o.status==="rejected");if(i.length>
5050){this.emit("error_storing_tokens",i.map(o=>String(o.reason)).join(", "));return}let s=(await Iy([this.storeCustomerAccessTokenForUser(null,n.token),this.storePrivyAccessTokenForUser(null,n.privy_access_token),this.storeRefreshTokenForUser(null,n.refresh_token),this.storeIdentityTokenForUser(null,n.identity_token)])).filter(o=>o.status==="rejected");if(s.length>0){this.emit("error_storing_tokens",s.map(o=>String(o.reason)).join(", "));return}await this.storeActiveUserId(r);let a=(await Iy([this.processOAuthTokens(n.oauth_tokens)])).filter(o=>o.status==="rejected");a.length>0&&this.emit("error_storing_tokens",a.map(o=>String(o.reason)).join(", "))}async backfillLegacySession(){var u;if(await this.getActiveUserId())return;let[n,r,i,s]=await Promise.all([this._storage.get(Ay(null)),this._storage.get(ky(null)),this._storage.get(Ty(null)),this._storage.get(Ly(null))]);if(typeof n!="string"||typeof i!="string")return;let a=(u=Th.parse(n))==null?void 0:u.subject;if(typeof a!="string"||a.length===0)return;let o=[this.storeCustomerAccessTokenForUser(a,n),this.storeRefreshTokenForUser(a,i)];typeof r=="string"&&o.push(this.storePrivyAccessTokenForUser(a,r)),typeof s=="string"&&o.push(this.storeIdentityTokenForUser(a,s));let l=(await Iy(o)).filter(f=>f.status==="rejected");if(l.length>0){this.emit("error_storing_tokens",l.map(f=>String(f.reason)).join(", "));return}await this.storeActiveUserId(a)}async processOAuthTokens(n){n&&this.emit("oauth_tokens_granted",n)}async storeIdentityToken(n){let r=await this.getActiveUserId();await this.storeIdentityTokenForUser(r,n)}async storeIdentityTokenForUser(n,r){var a;let i=Ly(n),s=_E(n);if(typeof r=="string"){let o=await this._storage.get(i);await this._storage.put(i,r);let l=(a=Th.parse(r))==null?void 0:a.expiration;this.writeCookie(s,r,{sameSite:"Strict",secure:!0,expires:l?new Date(l*1e3):void 0}),o!==r&&this.emit("identity_token_stored",{cookiesEnabled:this._isUsingServerCookies})}else{let o=await this._storage.get(i);await this._storage.del(i),Qr.remove(s),o!==null&&this.emit("identity_token_cleared",{reason:"set_with_non_string_value"})}}async getOrCreateGuestCredential(){let n=await this._storage.get(this.GUEST_CREDENTIAL_STORAGE_KEY);if(n&&typeof n=="string")return n;let r=vI(crypto.getRandomValues(new Uint8Array(32)));return await this._storage.put(this.GUEST_CREDENTIAL_STORAGE_KEY,r),r}async getActiveUserId(){let n=await this._storage.get(T4);return typeof n=="string"?n:null}
505async storeActiveUserId(n){let r=await this.getSavedUserIds();await this.storeSavedUserIds([...r,n]),await this._storage.put(T4,n)}async getSavedUserIds(){let n=await this._storage.get(bE);if(typeof n!="string")return[];try{let r=JSON.parse(n),i=Array.isArray(r)?r.filter(s=>typeof s=="string"):[];return[...new Set(i)]}catch{return[]}}async storeSavedUserIds(n){let r=[...new Set(n)];r.length>0?await this._storage.put(bE,JSON.stringify(r)):await this._storage.del(bE),this._setStoredUsers&&(this._hasEmittedStoredUsers=!0,this._setStoredUsers({users:r.map(i=>({id:i}))}))}async removeSavedUserId(n){let r=await this.getSavedUserIds();await this.storeSavedUserIds(r.filter(i=>i!==n))}async switchActiveUserId(n){if(!(await this.getSavedUserIds()).includes(n))throw new yt({code:"invalid_input",error:"Cannot switch active user because the user ID is not saved on this device"});await this._storage.put(T4,n)}},fe(MA,"events",E$e),MA);const oV=t=>{let e=new AbortController;return setTimeout(()=>e.abort(),t),e.signal};function A$e(t){let e=new URLSearchParams;for(let n in t)t[n]!=null&&e.append(n,String(t[n]));return Array.from(e).length?"?"+e.toString():""}const L4=()=>{},Ad={NONE:-1/0,ERROR:1,WARN:2,INFO:3,DEBUG:1/0},k$e=({level:t,logger:e})=>({get level(){return t},error:Ad[t]>=Ad.ERROR?e.error:L4,warn:Ad[t]>=Ad.WARN?e.warn:L4,info:Ad[t]>=Ad.INFO?e.info:L4,debug:Ad[t]>=Ad.DEBUG?e.debug:L4});function Nw(t){return new Promise(e=>{setTimeout(()=>{e()},t)})}const T$e=t=>3**t*500,L$e=[408,409,425,500,502,503,504];function $$e(t){return async(e,n)=>{let r=e instanceof Request?e:new Request(e,n),i,s=!1,a;for(let o=0;o<=3;o++){let l=new Headers((n==null?void 0:n.headers)??r.headers);l.set("privy-retry-attempt",String(o));try{let u=await t(r.clone(),{...n,headers:l});if(!L$e.includes(u.status))return u;a=u,s=!1}catch(u){i===void 0&&(i=u),s=!0}o<3&&await Nw(T$e(o))}if(s)throw i;return a}}const xE="privy:caid";var I$e=class{constructor(e){fe(this,"baseUrl");fe(this,"callbacks");fe(this,"appId");fe(this,"appClientId");fe(this,"logger");fe(this,"session");fe(this,"_config");fe(this,"_analyticsId");fe(this,"_storage");fe(this,"_sdkVersion","js-sdk-core:0.75.0");fe(this,"_fetch");fe(this,"nativeAppIdentifier");fe(this,"_crypto");fe(this,"isMultiUserModeEnabled");fe(this,"_cache",new Map);var n,r;this.logger=k$e({level:((n=e.logger)==null?void 0:n.level)??e.logLevel??"ERROR",logger:e.logger??console}),this._storage=e.storage,this._crypto=e.crypto,this._analyticsId=null,this._getOrGenerateClientAnalyticsId(),this.baseUrl=e.baseUrl??"https://auth.privy.io",this.appId=e.appId,this.appClientId=e.appClientId,this._sdkVersion=e.sdkVersion??this._sdkVersion,this.callbacks=e.callbacks,this.nativeAppIdentifier=e.nativeAppIdentifier,this.isMultiUserModeEnabled=e.isMultiUserModeEnabled,this.session=new S$e({storage:this._storage,isUsingServerCookies:!1,cookieWriteBehavior:e.cookieWriteBehavior,appId:e.appId,setStoredUsers:(r=e.callbacks)==null?void 0:r.setStoredUsers}),this._fetch=$$e(globalThis.fetch),this.session.on("error_storing_tokens",i=>{this.createAnalyticsEvent("error_updating_tokens_in_storage",{reason:i})})}setCallbacks(e){var n;this.callbacks={...this.callbacks,...e},this.session.setStoredUsersCallback((n=this.callbacks)==null?void 0:n.setStoredUsers)}get isReady(){return!!this._config}get config(){return this._config}get caid(){return this._analyticsId}async _initialize(){var e,n,r,i,s;if(this.isReady){(n=(e=this.callbacks)==null?void 0:e.setIsReady)==null||n.call(e,!0);return}if(!await this.isStorageAccessible())throw new yt({code:"storage_error",error:"Unable to access storage"});this._config=await this.getAppConfig(),(r=this._config)!=null&&r.custom_api_url&&(this.baseUrl=this._config.custom_api_url,this.session.isUsingServerCookies=!0),this.isMultiUserModeEnabled&&await this.session.backfillLegacySession(),(s=(i=this.callbacks)==null?void 0:i.setIsReady)==null||s.call(i,!0),this._sdkVersion.startsWith("js-sdk-core:")&&this.createAnalyticsEvent("sdk_initialize",{})}getPath(e,{params:n,query:r}){return`${this.baseUrl}${L5e(e.path,n)}${A$e(r)}`}async fetchWithoutAuthentication(e,n){if(!this.isMultiUserModeEnabled)throw new yt({code:"invalid_input",error:'Unauthenticated requests require sessions.mode to be set to "multi-user"'});return this.fetch(e,{...n,onRequest:this._beforeRequestWithoutAuth.bind(this)})}async fetchForLogin(e,n){return this.isMultiUserModeEnabled?this.fetchWithoutAuthentication(e,n):this.fetch(e,n
505)}async fetch(e,{body:n,params:r,query:i,headers:s,onRequest:a=this._beforeRequest.bind(this)}){let o=new Request(this.getPath(e,{params:r,query:i}),{method:e.method,body:JSON.stringify(n),headers:s}),l=await a(o),u=await this._fetch(o,l),f=await u.json();if(u.status>299)throw new A4({...f,status:u.status});return f}async fetchRaw(e,{body:n,params:r,query:i,headers:s,onRequest:a=this._beforeRequest.bind(this)}){let o=new Request(this.getPath(e,{params:r,query:i}),{method:e.method,body:JSON.stringify(n),headers:s}),l=await a(o),u=await this._fetch(o,l);if(u.status>299)throw new A4({...await u.json().catch(()=>({})),status:u.status});return u}async _beforeRequestWithoutInitialize(e){let n=await this.session.getPrivyAccessToken()??await this.session.getCustomerAccessToken(),r=new Headers(e.headers);r.set("privy-app-id",this.appId),this.appClientId&&r.set("privy-client-id",this.appClientId),r.set("privy-client",this._sdkVersion),n&&r.set("Authorization",`Bearer ${n}`),r.set("Content-Type","application/json"),r.set("Accept","application/json");let i=await this._getOrGenerateClientAnalyticsId();return i&&r.set("privy-ca-id",i),this.nativeAppIdentifier&&r.set("x-native-app-identifier",this.nativeAppIdentifier),{signal:oV(2e4),headers:r,credentials:"include"}}async beforeRequestWithoutRefresh(e){return await this._initialize(),this._beforeRequestWithoutInitialize(e)}async _beforeRequestWithoutAuth(e){await this._initialize();let n=new Headers(e.headers);n.set("privy-app-id",this.appId),this.appClientId&&n.set("privy-client-id",this.appClientId),n.set("privy-client",this._sdkVersion),n.set("Content-Type","application/json"),n.set("Accept","application/json");let r=await this._getOrGenerateClientAnalyticsId();return r&&n.set("privy-ca-id",r),this.nativeAppIdentifier&&n.set("x-native-app-identifier",this.nativeAppIdentifier),{signal:oV(2e4),headers:n}}async _beforeRequest(e){return await this._initialize(),await this.getAccessTokenInternal(),this.beforeRequestWithoutRefresh(e)}async getAppConfig(){return await this.fetch(U6e,{params:{app_id:this.appId},onRequest:this._beforeRequestWithoutInitialize.bind(this)})}async _getOrGenerateClientAnalyticsId(){if(this._analyticsId)return this._analyticsId;try{let e=await this._storage.get(xE);if(typeof e=="string"&&e.length>0)return this._analyticsId=e,e}catch(e){this.logger.error("Unable to load clientId",e)}try{this._analyticsId=this._crypto.randomUUID()}catch(e){this.logger.error("Unable to generate uuidv4",e)}if(this._analyticsId){try{await this._storage.put(xE,this._analyticsId)}catch(e){this.logger.error(`Unable to store clientId: ${this._analyticsId}`,e)}return this._analyticsId}}async destroyClientAnalyticsId(){try{return await this._storage.del(xE)}catch(e){this.logger.error("Unable to delete clientId",e)}}async createAnalyticsEvent(e,n){try{await this.fetch(D6e,{body:{event_name:e,client_id:await this._getOrGenerateClientAnalyticsId(),payload:n},onRequest:this.beforeRequestWithoutRefresh.bind(this)})}catch{}}async refreshSession(e=!1){if(!await this.isStorageAccessible())throw new yt({code:"storage_error",error:"Unable to access storage"});let n=await this.session.getRefreshToken()??void 0,r=n??"key",i=this._cache.get(r);if(i)return this.logger.debug("[privy:refresh] found in-flight session refresh request, deduping"),await i;let s=this._refreshSession(n,e);this._cache.set(r,s);try{return await s}finally{this._cache.delete(r)}}async _refreshSession(e,n){var i,s,a,o,l,u;let r=await this.session.getCustomerAccessToken();if(!await this.session.hasRefreshCredentials(r,e??null))throw this.logger.debug("[privy:refresh] missing tokens, skipping request"),await this._initialize(),new A4({code:IT.MISSING_OR_INVALID_TOKEN,error:"No tokens found in storage",status:401});try{this.logger.debug(`[privy:refresh] fetching: ${MB.path}`);let f=await this.fetch(MB,{body:{refresh_token:e},onRequest:this.beforeRequestWithoutRefresh.bind(this)}),p=f.session_update_action;return this.logger.debug(`[privy:refresh] response: ${p}`),p==="set"&&(await this.session.updateWithTokensResponse(f),this.logger.debug("[privy:refresh] tokens stored")),p==="clear"&&(await this.session.destroyLocalState(),this.logger.debug("[privy:refresh] tokens cleared"),!n&&((s=(i=this.callbacks)==null?void 0:i.setUser)==null||s.call(i,null))),p==="ignore"&&(f.token&&(await this.session.storeCustomerAccessToken(f.token),this.logger.debug("[privy:refresh] token stored (CAT)")),f.privy_access_token&&(await this.session.storePrivyAccessToken(f.privy_access_token),this.logger.debug("[privy:refresh] token stored (PAT)")),f.identity_token&&(this.logger.debug("[privy:refresh] token stored (IDT)"),await this.session.storeIdentityToken(f.identity_token))),this.logger.debug("[privy:refresh] returning response"),
505!n&&((o=(a=this.callbacks)==null?void 0:a.setUser)==null||o.call(a,f.user)),f}catch(f){throw this.logger.debug(`[privy:refresh] error: ${f.message??"unknown error"}`),f instanceof A4&&f.code===IT.MISSING_OR_INVALID_TOKEN&&(await this.session.destroyLocalState(),!n&&((u=(l=this.callbacks)==null?void 0:l.setUser)==null||u.call(l,null))),f}}async getAccessToken(){var r,i;let[e,n]=await Promise.all([this.session.getCustomerAccessToken(),this.session.getRefreshToken()]);if(e&&!this.session.tokenIsActive(e)&&await this.session.hasRefreshCredentials(e,n)){let s=await this.refreshSession(),a=await this.session.getCustomerAccessToken();return s.token||this.logger.debug("[privy:getAccessToken] expected token received null"),s.token===e&&this.logger.debug("[privy:getAccessToken] expected new token in response received existing"),a===e&&this.logger.debug("[privy:getAccessToken] expected new token in storage received existing"),s.token??a}return e&&!this.session.tokenIsActive(e)?(this.logger.debug("[privy:getAccessToken] unable to refresh inactive token"),(i=(r=this.callbacks)==null?void 0:r.setUser)==null||i.call(r,null),await this.session.destroyLocalState(),null):e}async getAccessTokenInternal(){let e=await this.getAccessToken();return await this.session.getPrivyAccessToken()??e}async getIdentityToken(){return await this.session.getIdentityToken()}async isStorageAccessible(){try{let e=`privy:__storage__test-${this._crypto.randomUUID()}`,n="blobby";await this._storage.put(e,n);let r=await this._storage.get(e);return await this._storage.del(e),r===n}catch(e){return this.logger.error(e),!1}}},N$e=class{constructor(e,n,r){fe(this,"_privyInternal");fe(this,"_embedded");fe(this,"_isMultiUserModeEnabled");this._privyInternal=e,this._embedded=n,this._isMultiUserModeEnabled=r}async get(){let{user:e}=await this._privyInternal.refreshSession();return{user:e}}async acceptTerms(){return{user:await this._privyInternal.fetch(B5e,{})}}async refreshUser(){var r,i;let{user:e,identity_token:n}=await this._privyInternal.fetch(K5e,{});return await this._privyInternal.session.storeIdentityToken(n),(i=(r=this._privyInternal.callbacks)==null?void 0:r.setUser)==null||i.call(r,e),{user:e}}async switchActiveUser(e){var n,r,i,s;if(!this._isMultiUserModeEnabled)throw new yt({code:"invalid_input",error:'User switching requires sessions.mode to be set to "multi-user"'});await this._privyInternal.session.switchActiveUserId(e.userId);try{this._embedded.reload();let{user:a}=await this._privyInternal.refreshSession(!0);if(a.id!==e.userId)throw new yt({code:"invalid_input",error:"Cannot switch active user because the refreshed user did not match the requested user ID"});return(r=(n=this._privyInternal.callbacks)==null?void 0:n.setUser)==null||r.call(n,a),{user:a}}catch(a){throw await this._privyInternal.session.destroyLocalState(),(s=(i=this._privyInternal.callbacks)==null?void 0:i.setUser)==null||s.call(i,null),a}}};const Fne=t=>t.type==="wallet"&&t.wallet_client_type==="privy"&&t.connector_type==="embedded",nO=t=>t?t.linked_accounts.filter(Fne).filter(e=>e.chain_type==="ethereum").sort((e,n)=>e.wallet_index-n.wallet_index):[],WT=t=>nO(t).find(e=>e.wallet_index===0)??null,rO=t=>t?t.linked_accounts.filter(Fne).filter(e=>e.chain_type==="solana").sort((e,n)=>e.wallet_index-n.wallet_index):[],zne=t=>rO(t).find(e=>e.wallet_index===0)??null,O$e=(t,e)=>e==="off"||nO(t).length>0?!1:t.linked_accounts.filter(n=>n.type==="wallet"&&n.chain_type==="ethereum").length>0?e==="all-users":!0,P$e=(t,e)=>e==="off"||rO(t).length>0?!1:t.linked_accounts.filter(n=>n.type==="wallet"&&n.chain_type==="solana").length>0?e==="all-users":!0,CE=(t,e)=>({...t,is_new_user:e.is_new_user,oauth_tokens:e.oauth_tokens}),No=async(t,e,n)=>{var s,a;let r=O$e(e.user,((s=n==null?void 0:n.ethereum)==null?void 0:s.createOnLogin)??"off"),i=P$e(e.user,((a=n==null?void 0:n.solana)==null?void 0:a.createOnLogin)??"off");if(r&&i){let o=await t.create({recoveryMethod:"privy",skipCallbacks:!0}),l=await t.createSolana({ethereumAccount:WT(o.user)??void 0});return CE(l,e)}if(r){let o=await t.create({recoveryMethod:"privy",solanaAccount:zne(e.user)??void 0});return CE(o,e)}if(i){let o=await t.createSolana({ethereumAccount:WT(e.user)??void 0});return CE(o,e)}return e};var R$e=class{constructor(e,n){fe(this,"_privyInternal");fe(this,"_embedded");this._privyInternal=e,this._embedded=n}async syncWithToken(e,n,r){var a,o;let i=await this._privyInternal.fetchForLogin(V6e,{body:{token:e,mode:r}});await this._privyInternal.session.updateWithTokensResponse(i);let s=await No(this._embedded,i,n==null?void 0:n.embedded);return(o=(a=this._privyInternal.callbacks)==null?void 0:a.setUser)==null||o.call(a,s.user),s}async linkWithToken(e){await this._privyInternal.fetch(H6e,{body:{token:e}});let n=await this._privyInternal.refreshSession();return{user:n.user,identity_token:n.identity_token}}},j$e=class{constructor(e,n){fe(this,"_privyInternal");fe(this,"_embedded");this._privyInternal=e,this._embedded=n}async sendCode(e,n){return this._privyInternal.fetch(h5e,{body:{email:e,token:n}})}async loginWithCode(e,n,r,i){var o,l;let s=await this._privyInternal.fetchForLogin(d5e,{body:{email:e,code:n,mode:r}});await this._privyInternal.session.updateWithTokensResponse(s);let a=await No(this._embedded,s,i==null?void 0:i.embedded);return(l=(o=this._privyInternal.callbacks)==null?void 0:o.setUser)==null||l.call(o,a.user),a}async linkWithCode(e,n){await this._privyInternal.fetch(f5e,{body:{email:e,code:n}});let r=await this._privyInternal.refreshSession();return{user:r.user,identity_token:r.identity_token}}async updateEmail({oldEmailAddress:e,newEmailAddress:n,code:r}){await this._privyInternal.fetch(m5e,{body:{oldAddress:e,newAddress:n,code:r}});let i=await this._privyInternal.refreshSession();return{user:i.user,identity_token:i.identity_token}}async unlink(e){await this._privyInternal.fetch(p5e,{body:{address:e}});let n=await this._privyInternal.refreshSession();return{user:n.user,identity_token:n.identity_token}}},M$e=class{constructor(e,n){fe(this,"_privyInternal");fe(this,"_embedded");this._privyInternal=e,this._embedded=n}async initializeAuth({relyingParty:e,redirectUrl:n,token:r}){return await this._privyInternal.fetch(W6e,{body:{relying_party:e,redirect_url:n,token:r}})}async getFarcasterStatus({channel_token:e}){return await this._privyInternal.fetch(G6e,{headers:{"farcaster-channel-token":e}})}async authenticate({channel_token:e,message:n,signature:r,fid:i,mode:s},a){var u,f;let o=await this._privyInternal.fetchForLogin(q6e,{body:{channel_token:e,message:n,signature:r,fid:i,mode:s}});await this._privyInternal.session.updateWithTokensResponse(o);let l=await No(this._embedded,o,a==null?void 0:a.embedded);return(f=(u=this._privyInternal.callbacks)==null?void 0:u.setUser)==null||f.call(u,l.user),l}async link({channel_token:e,message:n,signature:r,fid:i}
505){await this._privyInternal.fetch(Z6e,{body:{channel_token:e,message:n,signature:r,fid:i}});let s=await this._privyInternal.refreshSession();return{user:s.user,identity_token:s.identity_token}}async unlink({fid:e}){await this._privyInternal.fetch(K6e,{body:{fid:e}});let n=await this._privyInternal.refreshSession();return{user:n.user,identity_token:n.identity_token}}},D$e=class{constructor(e,n){fe(this,"_privyInternal");fe(this,"_embedded");this._privyInternal=e,this._embedded=n}async initializeAuth(){return await this._privyInternal.fetch(Y6e,{body:{}})}async authenticate({message:e,signature:n,fid:r},i){var o,l;let s=await this._privyInternal.fetchForLogin(J6e,{body:{message:e,signature:n,fid:r}});await this._privyInternal.session.updateWithTokensResponse(s);let a=await No(this._embedded,s,i==null?void 0:i.embedded);return(l=(o=this._privyInternal.callbacks)==null?void 0:o.setUser)==null||l.call(o,a.user),a}},U$e=class{constructor(e,n){fe(this,"_privyInternal");fe(this,"_embedded");this._privyInternal=e,this._embedded=n}async create(e){var s,a;let n=await this._privyInternal.session.getOrCreateGuestCredential(),r=await this._privyInternal.fetch(X6e,{body:{guest_credential:n}});await this._privyInternal.session.updateWithTokensResponse(r);let i=await No(this._embedded,r,e==null?void 0:e.embedded);return(a=(s=this._privyInternal.callbacks)==null?void 0:s.setUser)==null||a.call(s,i.user),i}};const e2="privy:state_code",t2="privy:code_verifier";async function B$e(t,e){let n=await e("SHA-256",new TextEncoder().encode(t));return new Uint8Array(n)}function F$e(t){return crypto.getRandomValues(new Uint8Array(t))}function iO(){return vI(F$e(36))}function Vne(){return iO()}async function Hne({codeVerifier:t,method:e="S256",digest:n}){if(e=="S256"){let r=await B$e(t,n);return vI(r)}else return t}var z$e=class{constructor(e,n,r,i){fe(this,"_privyInternal");fe(this,"_storage");fe(this,"_crypto");fe(this,"_embedded");this._privyInternal=e,this._embedded=n,this._storage=r,this._crypto=i}async generateURL(e,n){let r=iO(),i=Vne(),s=await Hne({codeVerifier:r,digest:this._crypto.digest});return await Promise.all([this._storage.put(t2,r),this._storage.put(e2,i)]),this._privyInternal.fetchForLogin(n5e,{body:{redirect_to:n,provider:e,code_challenge:s,state_code:i}})}async loginWithCode(e,n,r,i,s,a){var p,y;let[o,l]=await Promise.all([this._storage.get(t2),this._storage.get(e2)]);if(l!==n)throw this._privyInternal.createAnalyticsEvent("possible_phishing_attempt",{flow:"oauth",provider:r,storedStateCode:l??"",returnedStateCode:n??""}),new yt({code:"pkce_state_code_mismatch",error:"Unexpected auth flow. This may be a phishing attempt."});let u=await this._privyInternal.fetchForLogin(t5e,{body:{authorization_code:e,code_type:i,state_code:l,code_verifier:o,mode:s}});await this._privyInternal.session.updateWithTokensResponse(u);let f=await No(this._embedded,u,a==null?void 0:a.embedded);return await Promise.all([this._storage.del(t2),this._storage.del(e2)]),(y=(p=this._privyInternal.callbacks)==null?void 0:p.setUser)==null||y.call(p,f.user),f}async linkWithCode(e,n,r,i){let[s,a]=await Promise.all([this._storage.get(t2),this._storage.get(e2)]);if(a!==n)throw this._privyInternal.createAnalyticsEvent("possible_phishing_attempt",{flow:"oauth",provider:r,storedStateCode:a??"",returnedStateCode:n??""}),new yt({code:"pkce_state_code_mismatch",error:"Unexpected auth flow. This may be a phishing attempt."});let o=await this._privyInternal.fetch(r5e,{body:{authorization_code:e,code_type:i,state_code:a,code_verifier:s}});await this._privyInternal.session.processOAuthTokens(o.oauth_tokens);let l=await this._privyInternal.refreshSession();return await Promise.all([this._storage.del(t2),this._storage.del(e2)]),{user:l.user,identity_token:l.identity_token}}async unlink(e,n){await this._privyInternal.fetch(i5e,{body:{provider:e,subject:n}});let r=await this._privyInternal.refreshSession();return{user:r.user,identity_token:r.identity_token}}},V$e=class{constructor(e,n){fe(this,"_privyInternal");fe(this,"_embedded");this._privyInternal=e,this._embedded=n}async generateRegistrationOptions(e){return await this._privyInternal.fetch(u5e,{body:{relying_party:e}})}async generateAuthenticationOptions(e){return await this._privyInternal.fetch(l5e,{body:{relying_party:e}})}async generateSignupOptions(e){return await this._privyInternal.fetch(c5e,{body:{relying_party:e}})}async loginWithPasskey(e,n,r,i){var o,l;let s=await this._privyInternal.fetchForLogin(a5e,{body:{relying_party:r,challenge:n,authenticator_response:this._transformAuthenticationResponseToSnakeCase(e)}});await this._privyInternal.session.updateWithTokensResponse(s);let a=await No(this._embedded,s,i==null?void 0:i.embedded);return(l=(o=this._privyInternal.callbacks)==null?void 0:o.setUser)==null||l.call(o,a.user),a}async signupWithPasskey(e,n,r){var a,o;let i=await this._privyInternal.fetchForLogin(o5e,{body:{relying_party:n,authenticator_response:this._transformRegistrationResponseToSnakeCase(e)}});await this._privyInternal.session.updateWithTokensResponse(i);let s=await No(this._embedded,i,r==null?void 0:r.embedded);return(o=(a=this._privyInternal.callbacks)==null?void 0:a.setUser)==null||o.call(a,s.user),s}async linkWithPasskey(e,n){await this._privyInternal.fetch(s5e,{body:{relying_party:n,authenticator_response:this._transformRegistrationResponseToSnakeCase(e)}});let r=await this._privyInternal.refreshSession();return{user:r.user,identity_token:r.identity_token}}_transformRegistrationResponseToSnakeCase(e){return{type:e.type,id:e.id,raw_i
505d:e.rawId,response:{client_data_json:e.response.clientDataJSON,attestation_object:e.response.attestationObject,authenticator_data:e.response.authenticatorData||void 0,transports:e.response.transports||void 0,public_key:e.response.publicKey||void 0,public_key_algorithm:e.response.publicKeyAlgorithm||void 0},authenticator_attachment:e.authenticatorAttachment||void 0,client_extension_results:{app_id:e.clientExtensionResults.appid||void 0,cred_props:e.clientExtensionResults.credProps||void 0,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret||void 0}}}_transformAuthenticationResponseToSnakeCase(e){return{type:e.type,id:e.id,raw_id:e.rawId,response:{signature:e.response.signature,client_data_json:e.response.clientDataJSON,authenticator_data:e.response.authenticatorData,user_handle:e.response.userHandle||void 0},authenticator_attachment:e.authenticatorAttachment||void 0,client_extension_results:{app_id:e.clientExtensionResults.appid||void 0,cred_props:e.clientExtensionResults.credProps||void 0,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret||void 0}}}},H$e=class{constructor(e,n){fe(this,"_privyInternal");fe(this,"_embedded");this._privyInternal=e,this._embedded=n}async sendCode(e,n){return this._privyInternal.fetch(g5e,{body:{phoneNumber:e,token:n}})}async loginWithCode(e,n,r,i){var o,l;let s=await this._privyInternal.fetchForLogin(y5e,{body:{phoneNumber:e,code:n,mode:r}});await this._privyInternal.session.updateWithTokensResponse(s);let a=await No(this._embedded,s,i==null?void 0:i.embedded);return(l=(o=this._privyInternal.callbacks)==null?void 0:o.setUser)==null||l.call(o,a.user),a}async linkWithCode(e,n){await this._privyInternal.fetch(b5e,{body:{phoneNumber:e,code:n}});let r=await this._privyInternal.refreshSession();return{user:r.user,identity_token:r.identity_token}}async updatePhone({oldPhoneNumber:e,newPhoneNumber:n,code:r}){await this._privyInternal.fetch(v5e,{body:{old_phone_number:e,new_phone_number:n,code:r}});let i=await this._privyInternal.refreshSession();return{user:i.user,identity_token:i.identity_token}}async unlink(e){await this._privyInternal.fetch(w5e,{body:{phoneNumber:e}});let n=await this._privyInternal.refreshSession();return{user:n.user,identity_token:n.identity_token}}},W$e=class{constructor(e,n){fe(this,"_privyInternal");fe(this,"_embedded");fe(this,"_wallet");fe(this,"_preparedMessage");this._privyInternal=e,this._embedded=n}async unlinkWallet(e){await this._privyInternal.fetch(R5e,{body:{address:e}});let n=await this._privyInternal.refreshSession();return{user:n.user,identity_token:n.identity_token}}async linkWithSiwe(e,n,r){let i=n||this._wallet,s=r||this._preparedMessage;if(!i)throw Error("A wallet must be provided in the init step or as an argument to linkWithSiwe");if(!s)throw Error("A message must be generated and signed before being used to link a wallet to privy");await this._privyInternal.fetch(O5e,{body:{message:s,signature:e,chainId:i.chainId,walletClientType:i.walletClientType??null,connectorType:i.connectorType??null}});let a=await this._privyInternal.refreshSession();return{user:a.user,identity_token:a.identity_token}}async loginWithSiwe(e,n,r,i,s){var f,p;let a=n||this._wallet,o=r||this._preparedMessage;if(!a)throw Error("A wallet must be provided in the init step or as an argument to loginWithSiwe");if(!o)throw Error("A message must be generated and signed before being used to login to privy with a wallet");let l=await this._privyInternal.fetchForLogin(N5e,{body:{signature:e,message:o,chainId:a.chainId,walletClientType:a.walletClientType??null,connectorType:a.connectorType??null,mode:i}});await this._privyInternal.session.updateWithTokensResponse(l);let u=await No(this._embedded,l,s==null?void 0:s.embedded);return(p=(f=this._privyInternal.callbacks)==null?void 0:f.setUser)==null||p.call(f,u.user),u}async init(e,n,r){this._wallet=e;let{nonce:i}=await this._privyInternal.fetch(_X,{body:{address:e.address}}),s=q$e({chainId:e.chainId.toString().replace("eip155:",""),address:e.address,issuedAt:new Date().toISOString(),statement:"By signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees.",domain:n,nonce:i,uri:r});return this._preparedMessage=s,{nonce:i,message:s}}};function q$e(t){return`${t.domain} wants you to sign in with your Ethereum account: 506${t.address} 507 508${t.statement} 509 510URI: ${t.uri} 511Version: 1 512Chain ID: ${t.chainId} 513Nonce: ${t.nonce} 514Issued At: ${t.issuedAt} 515Resources: 516- https://privy.io`}var Z$e=class{constructor(e,n){fe(this,"_privyInternal");fe(this,"_embedded");this._privyInternal=e,this._embedded=n}async unlink({address:e}){await this._privyInternal.fetch(U5e,{body:{address:e}});let n=await this._privyInternal.refreshSession();return{user:n.user,identity_token:n.identity_token}}async link({message:e,signature:n,walletClientType:r,connectorType:i}){await this._privyInternal.fetch(D5e,{body:{message:e,signature:n,walletClientType:r??null,connectorType:i??null}});let s=await this._privyInternal.refreshSession();return{user:s.user,identity_token:s.identity_token}}async login({mode:e,message:n,signature:r,walletClientType:i,connectorType:s,opts:a}){var u,f;let o=await this._privyInternal.fetchForLogin(M5e,{body:{signature:r,message:n,walletClientType:i??null,connectorType:s??null,mode:e}});await this._privyInternal.session.updateWithTokensResponse(o);let l=await No(this._embedded,o,a==null?void 0:a.embedded);return(f=(u=this._privyInternal.callbacks)==null?void 0:u.setUser)==null||f.call(u,l.user),l}async fetchNonce({address:e}){let{nonce:n}=await this._privyInternal.fetch(j5e,{body:{address:e}});return{nonce:n}}},K$e=class{constructor(e){fe(this,"_privyInternal");this._privyInternal=e}async link(e,n,r,i){await this._privyInternal.fetch(P5e,{body:{message:e,signature:n,smart_wallet_type:r,smart_wallet_version:i}});let s=await this._privyInternal.refreshSession();return{user:s.user,identity_token:s.identity_token}}async init(e){let{nonce:n}=await this._privyInternal.fetch(_X,{body:{address:e.address}});return{nonce:n,message:G$e({chainId:e.chainId.toString().replace("eip155:",""),address:e.address,issuedAt:new Date().toISOString(),statement:"By signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees.",domain:"privy.io",uri:"https://auth.privy.io",nonce:n})}}};function G$e(t){return`${t.domain} wants you to sign in with your Ethereum account: 517${t.address} 518 519${t.statement} 520 521URI: ${t.uri} 522Version: 1 523Chain ID: ${t.chainId} 524Nonce: ${t.nonce} 525Issued At: ${t.issuedAt} 526Resources: 527- https://privy.io`}var Y$e=class{constructor(e,n){fe(this,"_privyInternal");fe(this,"_embedded");this._privyInternal=e,this._embedded=n}async authenticate({telegramWebAppData:e,telegramAuthResult:n,captchaToken:r,mode:i="login-or-sign-up"},s){var l,u;let a=await this._privyInternal.fetchForLogin(F5e,{body:{telegram_web_app_data:e,telegram_auth_result:n,captcha_token:r,mode:i}});
527await this._privyInternal.session.updateWithTokensResponse(a);let o=await No(this._embedded,a,s==null?void 0:s.embedded);return(u=(l=this._privyInternal.callbacks)==null?void 0:l.setUser)==null||u.call(l,o.user),o}async link({telegramWebAppData:e,telegramAuthResult:n,captchaToken:r}){await this._privyInternal.fetch(z5e,{body:{telegram_web_app_data:e,telegram_auth_result:n,captcha_token:r}});let i=await this._privyInternal.refreshSession();return{user:i.user,identity_token:i.identity_token}}async unlink({telegramUserId:e}){await this._privyInternal.fetch(V5e,{body:{telegram_user_id:e}});let n=await this._privyInternal.refreshSession();return{user:n.user,identity_token:n.identity_token}}},J$e=class{constructor(e,n,r,i,s){fe(this,"_privyInternal");fe(this,"_mfa");fe(this,"customProvider");fe(this,"phone");fe(this,"email");fe(this,"oauth");fe(this,"siwe");fe(this,"siws");fe(this,"smartWallet");fe(this,"passkey");fe(this,"farcaster");fe(this,"farcasterV2");fe(this,"guest");fe(this,"telegram");this._privyInternal=e,this._mfa=s,this.customProvider=new R$e(this._privyInternal,n),this.phone=new H$e(this._privyInternal,n),this.email=new j$e(this._privyInternal,n),this.oauth=new z$e(this._privyInternal,n,r,i),this.guest=new U$e(this._privyInternal,n),this.siwe=new W$e(this._privyInternal,n),this.siws=new Z$e(this._privyInternal,n),this.smartWallet=new K$e(this._privyInternal),this.passkey=new V$e(this._privyInternal,n),this.farcaster=new M$e(this._privyInternal,n),this.farcasterV2=new D$e(this._privyInternal,n),this.telegram=new Y$e(this._privyInternal,n)}async logout(e){var r,i;let n=await this._prepareSessionRevocation();await Promise.all([this._privyInternal.session.destroyLocalState({reason:"logout"}),this._privyInternal.destroyClientAnalyticsId(),(e==null?void 0:e.userId)&&this._mfa.clearMfa({userId:e.userId})]),(i=(r=this._privyInternal.callbacks)==null?void 0:r.setUser)==null||i.call(r,null),n&&this._privyInternal.fetch($5e,{body:{refresh_token:n.refresh_token},onRequest:()=>n.init}).catch(()=>{console.warn("Error destroying session")})}async _prepareSessionRevocation(){try{let e=await this._privyInternal.beforeRequestWithoutRefresh(new Request(this._privyInternal.baseUrl));return{refresh_token:await this._privyInternal.session.getRefreshToken()??void 0,init:e}}catch{console.warn("Error preparing session revocation");return}}},X$e=class{constructor(e){fe(this,"_privyInternal");this._privyInternal=e}async initOnRampSession(e){return await this._privyInternal.fetch(B6e,{body:e})}async getStatus(e){return await this._privyInternal.fetch(F6e,{query:{partnerUserId:e}})}};const Q$e={prod:{url:"https://api.moonpay.com/v1",key:"pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL"},sandbox:{url:"https://api.moonpay.com/v1",key:"pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI"}},eIe=new Set([pc.id,zu.id,Hu.id,mc.id,Vu.id,EI.id,Z1.id]),tIe=new Set([pc.id,zu.id,Wf.id,Hu.id,mc.id,Vu.id]);function H3t(t,e){switch(e){case"native-currency":return eIe.has(t);case"USDC":return tIe.has(t);default:return console.warn("Unknown asset passed to MoonPay Onramp"),!1}}function W3t(t,e){switch(t){case zu.id:return e==="native-currency"?"ETH_ARBITRUM":"USDC_ARBITRUM";case Vu.id:return e==="native-currency"?"AVAX_CCHAIN":"USDC_CCHAIN";case Hu.id:return e==="native-currency"?"ETH_BASE":"USDC_BASE";case EI.id:return"CELO_CELO";case mc.id:return e==="native-currency"?"MATIC_POLYGON":"USDC_POLYGON";case Z1.id:return"MON_MON";case pc.id:return e==="native-currency"?"ETH_ETHEREUM":"USDC_ETHEREUM";default:return console.warn(`Chain ${t} not supported by Moonpay, defaulting to Ethereum mainnet`),"ETH_ETHEREUM"}}var nIe=class{constructor(e){fe(this,"_privyInternal");this._privyInternal=e}async sign(e){return await this._privyInternal.fetch(H5e,{body:e})}async getTransactionStatus({transactionId:e,useSandbox:n}){let{url:r,key:i}=Q$e[n?"sandbox":"prod"],s=await uAe(fetch,{retries:3,retryDelay:500})(`${r}/transactions/ext/${e}?apiKey=${i}`);if(!s.ok)throw new KLe({error:`Failed to fetch transaction status for Transaction ${e}`,code:"failed_to_fetch_moonpay_transaction_status",response:s});let a=await s.json();return Array.isArray(a)?a.at(0):void 0}},rIe=class{constructor(e){fe(this,"moonpay");fe(this,"coinbase");this.moonpay=new nIe(e),this.coinbase=new X$e(e)}},iIe=class{constructor(e){fe(this,"_privyInternal");this._privyInternal=e}async generateAuthenticationOptions(e){return await this._privyInternal.fetch(Q6e,{body:e})}},sIe=class{constructor(e){fe(this,"_privyInternal");this._privyInternal=e}async sendCode(e){return await this._privyInternal.fetch(e5e,{body:e})}},aIe=class{constructor(e,n){fe(this,"privyInternal");fe(this,"proxy");fe(this,"sms");fe(this,"passkey");this.proxy=n,this.privyInternal=e,this.sms=new sIe(e),this.passkey=new iIe(e)}setProxy(e){this.proxy=e}async getAccessTokenInternal(){let e=await this.privyInternal.getAccessTokenInternal();if(!e)throw new yt({error:"Missing access token",code:"attempted_rpc_call_before_logged_in"});return e}async verifyMfa(){if(!this.proxy)throw new yt({error:"Embedded wallet proxy not initialized",code:"embedded_wallet_webview_not_loaded"});return await this.proxy.verifyMfa({accessToken:await this.getAccessTokenInternal()})}async initEnrollMfa(e){if(!this.proxy)throw new yt({error:"Embedded wallet proxy not initialized",code:"embedded_wallet_webview_not_loaded"});return await this.proxy.initEnrollMfa({...e,accessToken:await this.getAccessTokenInternal()})}async submitEnrollMfa(e){if(!this.proxy)throw new yt({error:"Embedded wallet proxy not initialized",code:"embedded_wallet_webview_not_loaded"});let n=await this.proxy.submitEnrollMfa({...e,accessToken:await this.getAccessTokenInternal()}),r=await this.privyInternal.refreshSession();if(r.user.mfa_methods.length===0)try{await this.proxy.clearMfa({userId:r.user.id})}catch{}return n}async unenrollMfa(e){if(!this.proxy)throw new yt({error:"Embedded wallet proxy not initialized",code:"embedded_wallet_webview_not_loaded"});let n=await this.proxy.unenrollMfa({method:e,accessToken:await this.getAccessTokenInternal()}),r=await this.privyInternal.refreshSession();if(r.user.mfa_methods.length===0)try{await this.proxy.clearMfa({userId:r.user.id})}catch{}return n}async unlinkPasskey({credentialId:e,removeAsMfa:n}){if(!this.proxy)throw new yt({error:"Embedded wallet proxy not initialized",code:"embedded_wallet_webview_not_loaded"});await this.proxy.unlinkPasskey({credentialId:e,removeAsMfa:n,accessToken:await this.getAccessTokenInternal()});let r=await this.privyInternal.refreshSession();if(r.user.mfa_methods.length===0)try{await this.proxy.clearMfa({userId:r.user.id})}catch{}}async clearMfa(e){if(!this.proxy)throw new yt({error:"Embedded wallet proxy not initialized",code:"embedded_wallet_webview_not_loaded"});return await this.proxy.clearMfa(e)}},oIe=class{constructor(e){fe(this,"_privyInternal");this._privyInternal=e}async init(e){return this._privyInternal.fetch(E5e,{body:{client_type:e}})}async getICloudConfiguration(e){return this._privyInternal.fetch(S5e,{body:{client_type:e}})}},lIe=class{constructor(e,n,r){fe(this,"_privyInternal");fe(this,"_storage");fe(this,"_crypto");this._privyInternal=e,this._storage=n,this._crypto=r}async generateURL(e){let n=iO(),r=Vne(),i=await Hne({codeVerifier:n,digest:this._crypto.digest});return await Promise.all([this._storage.put(t2,n),this._storage.put(e2,r)]),this._privyInternal.fetch(x5e,{body:{redirect_to:e,code_challenge:i,state_code:r}})}async authorize(e,n){let[r,i]=await Promise.all([this._storage.get(t2),this._storage.get(e2)]);if(i!==n)throw this._privyInternal.createAnalyticsEvent("possible_phishing_attempt",{flow:"recovery_oauth",storedStateCode:i??"",returnedStateCode:n??""}),new yt({code:"pkce_state_code_mismatch",error:"Unexpected auth flow. This may be a phishing attempt."});let s=await this._privyInternal.fetch(C5e,{body:{authorization_code:e,state_code:i,code_verifier:r}});return await Promise.all([this._storage.del(t2),this._storage.del(e2)]),s}},cIe=class{constructor(e,n,r){fe(this,"_privyInternal");fe(this,"auth");fe(this,"icloudAuth");this._privyInternal=e,this.auth=new lIe(this._privyInternal,n,r),this.icloudAuth=new oIe(this._privyInternal)}async getRecoveryKeyMaterial(e,n){return this._privyInternal.fetch(_5e,{body:{chain_type:n},params:{address:e}})}},uIe=class{constructor({clientId:e,sessions:n,plugins:r=[],...i}){fe(this,"plugins");fe(this,"auth");fe(this,"user");
527fe(this,"embeddedWallet");fe(this,"recovery");fe(this,"mfa");fe(this,"app");fe(this,"mfaPromises");fe(this,"funding");fe(this,"delegated");fe(this,"crossApp");fe(this,"isMultiUserModeEnabled");fe(this,"_privyInternal");let s=VLe(i.crypto);this.isMultiUserModeEnabled=(n==null?void 0:n.mode)==="multi-user",this.plugins=[...r],this._privyInternal=new I$e({...i,appClientId:e,crypto:s,isMultiUserModeEnabled:this.isMultiUserModeEnabled,cookieWriteBehavior:n==null?void 0:n.cookieWriteBehavior}),this.mfa=new aIe(this._privyInternal),this.mfaPromises=new x$e,this.app=new WLe(this._privyInternal),this.embeddedWallet=new _$e(this._privyInternal,i.embeddedWalletMessagePoster,i.supportedChains,this.mfa,this.mfaPromises,this.app,HLe(this.plugins)),this.user=new N$e(this._privyInternal,this.embeddedWallet,(n==null?void 0:n.mode)==="multi-user"),this.auth=new J$e(this._privyInternal,this.embeddedWallet,i.storage,s,this.mfa),this.recovery=new cIe(this._privyInternal,i.storage,s),this.funding=new rIe(this._privyInternal),this.delegated=new ZLe(this._privyInternal),this.crossApp=new qLe(this._privyInternal,i.storage)}async initialize(){await this._privyInternal._initialize()}setMessagePoster(e){this.embeddedWallet.setMessagePoster(e)}addOAuthTokensListener(e){return this._privyInternal.session.on("oauth_tokens_granted",e),{unsubscribe:()=>{this._privyInternal.session.removeListener("oauth_tokens_granted",e)}}}setCallbacks(e){this._privyInternal.setCallbacks(e)}getAccessToken(){return this._privyInternal.getAccessToken()}getIdentityToken(){return this._privyInternal.getIdentityToken()}track({name:e,properties:n}){this._privyInternal.createAnalyticsEvent(e,n)}getCompiledPath(e,n){return this._privyInternal.getPath(e,n)}async fetchPrivyRoute(e,n){return this._privyInternal.fetch(e,n)}async fetchPrivyRouteRaw(e,n){return this._privyInternal.fetchRaw(e,n)}get logger(){return this._privyInternal.logger}};const t6t=(t,e)=>BLe(String(t),e),dIe=t=>{var e;return((e=ULe(t,"US"))==null?void 0:e.format("E.164"))??t.replace(/[\s()-]/g,"")},n6t=(t,e)=>`+${Ine(e)} ${t}`,r6t=t=>`*${t.replaceAll("-","").slice(-4)}`,i6t=t=>new o6(t),s6t=FLe().map(t=>({code:t,callCode:Ine(t)})),a6t=t=>{var n;let e=(n=zLe(t,dAe))==null?void 0:n.formatInternational();return e==null?void 0:e.substring(e.indexOf(" ")+1)},o6t=t=>{let e=new o6;e.input(t);let n=e.getCountry()||"US",r=e.getCallingCode()||"1";return{countryCode:n,phone:t.replace("+"+r,"")}},l6t=(t,e=!0)=>t.reduce((n,r)=>({...n,[r]:e}),{}),c6t={[pc.id]:"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",[kI.id]:"0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",[Wf.id]:"0x0b2c639c533813f4aa9d7837caf62653d097ff85",[SI.id]:"0x5fd84259d66Cd46123540766Be93DFE6D43130D7",[mc.id]:"0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",[AI.id]:"0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582",[Hu.id]:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",[CI.id]:"0x036CbD53842c5426634e7929541eC2318f3dCF7e",[Vu.id]:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",[xI.id]:"0x5425890298aed601595a70ab815c96711a31bc65",[zu.id]:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",[_I.id]:"0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"};async function u6t(t,e){let n=`${t}-auto-${e==="ethereum"?"eth":"sol"}`,r=new TextEncoder().encode(n),i=await crypto.subtle.digest("SHA-256",r);return Array.from(new Uint8Array(i)).map(s=>s.toString(16).padStart(2,"0")).join("")}const hIe=new Set([pc.id,Hu.id,Wf.id,mc.id,zu.id,Vu.id,Z1.id]),fIe=new Set([pc.id,Hu.id,mc.id,Wf.id,zu.id,Vu.id,Z1.id]),pIe={buy:"CARD",send:"CRYPTO_ACCOUNT"},mIe={USDC:"2b92315d-eab7-5bef-84fa-089a131333f5",ETH:"d85dce9b-5b73-5c3c-8978-522ce1d1c1b4",BTC:"5b71fc48-3dd3-540c-809b-f8c94d0e68b5",SOL:"4f039497-3af8-5bb3-951c-6df9afa9be1c",POL:"026bcc1e-9163-591c-a709-34dd18b2e7a1",MON:"92aa538f-b005-45cc-a237-71d6466f54d9"};pc.id+"",Hu.id+"",Wf.id+"",mc.id+"",zu.id+"",Vu.id+"";function yIe(t){return t.startsWith(".")?`0${t}`:t}function d6t({appId:t,input:e,amount:n,blockchain:r,asset:i,experience:s}){let a=new URL("https://pay.coinbase.com/buy/select-asset");return a.searchParams.set("appId",e.app_id),a.searchParams.set("sessionToken",e.session_token),a.searchParams.set("endPartnerName",`privy:${t}`),a.searchParams.set("defaultExperience",s),a.searchParams.set("presetCryptoAmount",yIe(n)),a.searchParams.set("defaultNetwork",r),a.searchParams.set("defaultPaymentMethod",pIe[s]),a.searchParams.set("defaultAsset",mIe[i]),a.searchParams.set("partnerUserId",e.partner_user_id
527),{url:a}}const h6t=(t,e)=>{switch(e){case"native-currency":return hIe.has(t);case"USDC":return fIe.has(t);default:return console.warn("Unknown asset passed to Coinbase Onramp"),!1}};function f6t(t,e){return t===mc.id?"POL":t===Z1.id?"MON":"ETH"}const gIe="solana offchain",lV=1232;function bIe(t){let e=W0.utf8.toBytes(t),n=new Uint8Array(32);return n.set(e.slice(0,32)),n}function wIe({message:t,signerPublicKey:e,domain:n}){let r=W0.utf8.toBytes(t);if(e.length!==32)throw Error("Signer public key must be 32 bytes");let i=85+r.length;if(i>lV)throw Error(`Combined message length (${i}) exceeds maximum (${lV})`);let s=bIe(n),a=new Uint8Array(i),o=0;a[o]=255,o+=1;let l=W0.utf8.toBytes(gIe);return a.set(l,o),o+=l.length,a[o]=0,o+=1,a.set(s,o),o+=32,a[o]=1,o+=1,a[o]=1,o+=1,a.set(e,o),o+=32,a[o]=r.length&255,a[o+1]=r.length>>8&255,o+=2,a.set(r,o),a}const vIe=["privy"],_Ie=["metamask","phantom","brave_wallet","rainbow"],xIe=["coinbase_wallet"],CIe="metamask.trust.safe.rainbow.uniswap.zerion.argent.spot.omni.cryptocom.blockchain.safepal.bitget_wallet.zengo.1inch.binance.exodus.mew_wallet.alphawallet.keyring_pro.mathwallet.unstoppable.obvious.ambire.internet_money_wallet.coin98.abc_wallet.arculus_wallet.haha.cling_wallet.broearn.copiosa.burrito_wallet.enjin_wallet.plasma_wallet.avacus.bee.pitaka.pltwallet.minerva.kryptogo.prema.slingshot.kriptonio.timeless.secux.bitizen.blocto.safemoon".split("."),EIe=["unknown"];[..._Ie,...xIe,...CIe,...vIe,...EIe];function p6t(t){return t?`${t.slice(0,5)}â¦${t.slice(-4)}`:""}function m6t({wei:t,precision:e=3}){return parseFloat(g7(t)).toFixed(e).replace(/0+$/,"").replace(/\.$/,"")}function y6t({amount:t,decimals:e}){return M7(BigInt(t),e)}const Wne=t=>[...nO(t),...rO(t)],SIe=(t,e)=>t.imported?t:WT(e)??zne(e),AIe=t=>async({address:e,chainType:n})=>{let{user:r}=await t.user.get();if(!r)throw new yt({code:"delegated_actions_before_logged_in",error:"Must be logged in to delegate wallets"});if(n!=="solana"&&n!=="ethereum")throw new yt({code:"unsupported_chain_type",error:"Only Solana and Ethereum embedded wallets are supported for delegation and revocation."});let i=Wne(r).find(o=>o.chain_type===n&&o.address===e);if(!i)throw new yt({code:"delegated_actions_wallet_not_found",error:"Address to delegate is not associated with current user."});if(Kl(i))throw new yt({code:"unsupported_wallet_type",error:"useDelegatedActions is only supported for on-device execution and this app uses TEE execution. Use the useSessionSigners hook to provision server side access on behalf of your users. Learn more https://docs.privy.io/recipes/tee-wallet-migration-guide"});if(i.delegated)return{user:r};let s=SIe(i,r);if(!s)throw new yt({code:"delegated_actions_wallet_not_found",error:"Address to delegate is not associated with current user."});await t.embeddedWallet.delegateWallets({rootWallet:{address:s.address,chainType:s.chain_type,imported:s.imported},delegatedWallets:[{address:i.address,chainType:i.chain_type,walletIndex:i.wallet_index}]});let{user:a}=await t.user.get();return{user:a}},kIe=t=>async()=>{let{user:e}=await t.user.get();if(!e)throw new yt({code:"delegated_actions_before_logged_in",error:"Must be logged in to revoke delegated wallets"});let n=Wne(e);if(n.some(Kl))throw new yt({code:"unsupported_wallet_type",error:"revokeWallets is only supported for on-device execution and this app uses TEE execution. Use the useSessionSigners hook to manage server side access on behalf of your users. Learn more https://docs.privy.io/recipes/tee-wallet-migration-guide"});if(n.every(i=>!i.delegated))throw new yt({code:"delegated_actions_no_wallet_to_revoke",error:"User has no delegated
527wallets to revoke."});await t.delegated.revoke();let{user:r}=await t.user.get();return{user:r}};u5({delegateWallet:()=>AIe,revokeWallets:()=>kIe});const TIe=({client:t,openAuthSession:e})=>async({providerAppId:n,redirectUrl:r})=>{let i=`privy:${n}`,{url:s}=await t.auth.oauth.generateURL(i,r),a=await e(s,r),o=a.privy_oauth_state,l=a.privy_oauth_code;if(!o||!l)throw new yt({code:"login_with_oauth_returned_with_invalid_credentials",error:"Auth session oauth returned invalid credentials"});let u=await t.auth.oauth.loginWithCode(l,o,i),f=u.oauth_tokens;return f&&await t.crossApp.updateOnCrossAppAuthentication(n,f),u},qne=({client:t,openAuthSession:e})=>async({providerAppId:n,redirectUrl:r})=>{let i=`privy:${n}`,{url:s}=await t.auth.oauth.generateURL(i,r),a=await e(s,r),o=a.privy_oauth_state,l=a.privy_oauth_code;if(!o||!l)throw new yt({code:"login_with_oauth_returned_with_invalid_credentials",error:"Auth session oauth returned invalid credentials"});let u=t.addOAuthTokensListener(p=>{t.crossApp.updateOnCrossAppAuthentication(n,p)}),{user:f}=await t.auth.oauth.linkWithCode(l,o,i);return u.unsubscribe(),f};function sO(t,e){return t.linked_accounts.filter(n=>n.type==="cross_app").flatMap(n=>n.smart_wallets).some(n=>n.address===e)}const LIe=(t,e)=>t.linked_accounts.filter(n=>n.type==="cross_app").find(({embedded_wallets:n,smart_wallets:r})=>[...n,...r].some(i=>i.address===e)),$Ie=({client:t,openAuthSession:e})=>{let n=qne({client:t,openAuthSession:e});return async({providerAppId:r,redirectUrl:i})=>await t.crossApp.getProviderAccessToken(r)||(await n({providerAppId:r,redirectUrl:i}),await t.crossApp.getProviderAccessToken(r))},aO=({client:t,openAuthSession:e})=>{let n=$Ie({client:t,openAuthSession:e});return async({user:r,request:i,redirectUrl:s,address:a})=>{let o=LIe(r,a);if(!o)throw new yt({code:"cross_app_invalid_wallet",error:"Cannot operate with this wallet address"});let l=o.provider_app_id,{connections:u}=await t.crossApp.getCrossAppConnections(),f=u.find(_=>_.provider_app_id===l);if(!f)throw new yt({code:"cross_app_invalid_app",error:"Invalid connected app"});if(f.read_only)throw new yt({code:"cross_app_read_only",error:"Cannot transact against a read-only provider app"});let p=await n({providerAppId:l,redirectUrl:s});if(!p)throw new yt({code:"cross_app_request_error",error:"Wallet operations require a valid token"});let y={content:{request:{request:i}},timestamp:Date.now(),callbackUrl:s},g=new URL(`${f.provider_app_custom_api_url}/oauth/transact`);g.searchParams.set("communicationMode","redirect"),g.searchParams.set("token",p),g.searchParams.set("request",JSON.stringify(y));let{privy_cross_app_type:b,privy_cross_app_payload:v}=await e(g.href,s);if(!b||!v)throw new yt({code:"cross_app_request_error",error:"Cross app request returned an invalid result"});if(b==="PRIVY_CROSS_APP_ACTION_ERROR")throw new yt({code:"cross_app_request_error",error:v});if(b!=="PRIVY_CROSS_APP_ACTION_RESPONSE")throw new yt({code:"cross_app_request_error",error:"Cross app request returned an invalid result"});return{result:v}}};function oO(t){if(!t)throw new yt({code:"attempted_cross_app_request_before_logged_in",error:"Must be logged in to sign messages with a cross-app wallet"})}const IIe=({client:t,openAuthSession:e})=>{let n=aO({client:t,openAuthSession:e});return async({user:r,address:i,message:s,redirectUrl:a})=>{oO(r);let o={method:sO(r,i)?"privy_signSmartWalletMessage":"personal_sign",params:[s,i]},{result:l}=await n({user:r,request:o,address:i,redirectUrl:a});return{signature:l}}};function NIe(t){let e={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},n=t.types.EIP712Domain??Object.entries(t.domain??{}).map(([i,s])=>{if(s!=null&&typeof i=="string"&&i in e)return{name:i,type:e[i]}}).filter(i=>!!i),r={...t.types};return r.EIP712Domain=n,{...t,types:r}}const OIe=({client:t,openAuthSession:e})=>{let n=aO({client:t,openAuthSession:e});return async({user:r,typedData:i,address:s,redirectUrl:a})=>{oO(r);let o={method:sO(r,s)?"privy_signSmartWalletTypedData":"eth_signTypedData_v4",params:[s,NIe(i)]},{result:l}=await n({user:r,request:o,address:s,redirectUrl:a});return{signature:l}}}
527,PIe=({client:t,openAuthSession:e})=>{let n=aO({client:t,openAuthSession:e});return async({user:r,transaction:i,address:s,redirectUrl:a})=>{oO(r);let o={method:sO(r,s)?"privy_sendSmartWalletTx":"eth_sendTransaction",params:[i]},{result:l}=await n({user:r,request:o,address:s,redirectUrl:a});return{transactionHash:l}}};var RIe=u5({sendTransaction:()=>PIe,signMessage:()=>IIe,signTypedData:()=>OIe});u5({linkWithCrossAppAuth:()=>qne,loginWithCrossAppAuth:()=>TIe,wallet:()=>RIe});function Zne(t){if(t.startsWith("eip155:"))return"ethereum";if(t.startsWith("solana:"))return"solana";if(t.startsWith("bip122:"))return"bitcoin-segwit";if(t.startsWith("tron:"))return"tron"}function jIe(t,e){let n=Zne(t);if(!n)return;let r=e.linked_accounts.find(i=>i.type==="wallet"&&i.chain_type===n&&"address"in i&&i.address);return r&&"address"in r?r.address:void 0}async function Kne(t){var i;let{user:e}=await t.privy.user.get();if(!e)return{ok:!1,error:"NOT_AUTHENTICATED"};let n=jIe(t.caip2,e);if(n)return{ok:!0,address:n};let r=Zne(t.caip2);if(!r)return{ok:!1,error:"UNSUPPORTED_CHAIN"};try{let s=await t.privy.fetchPrivyRoute(xX,{body:{chain_type:r}});return await((i=t.onWalletCreated)==null?void 0:i.call(t)),{ok:!0,address:s.address}}catch{return{ok:!1,error:"REFUND_WALLET_CREATION_FAILED"}}}async function MIe(t){let{user:e}=await t.privy.user.get();if(!e)throw Error("NOT_AUTHENTICATED");let n=t.refundAddress;if(!n){let i=await Kne({privy:t.privy,caip2:t.sourceChain,onWalletCreated:t.onWalletCreated});if(!i.ok)throw Error(i.error);n=i.address}let r=await t.privy.fetchPrivyRoute(A5e,{body:{source_chain:t.sourceChain,source_currency:t.sourceCurrency,destination_chain:t.destinationChain,destination_currency:t.destinationCurrency,destination_address:t.destinationAddress,refund_address:n,...t.slippageBps==null?{}:{slippage_bps:t.slippageBps}}});return t.privy.track({name:"sdk_deposit_address_headless_quote",properties:{sourceChain:t.sourceChain,sourceCurrency:t.sourceCurrency,destinationChain:t.destinationChain,destinationCurrency:t.destinationCurrency,depositAddressId:r.id}}),r}const Gne=async({operation:t,until:e,delay:n,interval:r,attempts:i,signal:s})=>{n&&await Nw(n);let a=0,o,l;for(;a<i;){if(s!=null&&s.aborted)return{status:"aborted",result:o,attempts:a,error:l};a++;try{if(l=void 0,o=await t(),e(o))return{status:"success",result:o,attempts:a};a<i&&await Nw(r)}catch(u){u instanceof Error&&(l=u),a<i&&await Nw(r)}}return{status:"max_attempts",result:o,attempts:a,error:l}},Yne=2e3,Jne=1800*1e3;function Xne(t,e){return Math.ceil(e/t)}function Qne(t){return t.status==="success"?t.result?{status:"success",order:t.result}:{status:"timeout"}:t.status==="aborted"?{status:"aborted",error:t.error}:{status:"timeout",error:t.error}}async function DIe(t){return await t.privy.fetchPrivyRoute(wI,{params:{order_id:t.orderId}})}async function UIe(t){let e=t.pollIntervalMs??Yne,n=t.timeoutMs??Jne,r=t.signal??new AbortController().signal;return Qne(await Gne({operation:async()=>{let i=await t.privy.fetchPrivyRoute(k5e,{params:{deposit_address_id:t.depositAddressId},query:{after:t.quoteCreatedAt}});if(i.order)return await t.privy.fetchPrivyRoute(wI,{params:{order_id:i.order.id}})},until:i=>i!==void 0,delay:e,interval:e,attempts:Xne(e,n),signal:r}))}async function BIe(t){let e=t.pollIntervalMs??Yne,n=t.timeoutMs??Jne,r=t.signal??new AbortController().signal;return Qne(await Gne({operation:()=>t.privy.fetchPrivyRoute(wI,{params:{order_id:t.orderId}}),until:i=>i.status!=="executing",delay:e,interval:e,attempts:Xne(e,n),signal:r}))}var g6t=u5({generateDepositAddress:()=>MIe,getConfig:()=>FIe,getDeposit:()=>DIe,resolveRefundAddress:()=>Kne,waitForCompletion:()=>BIe,waitForDeposit:()=>UIe});async function FIe(t){let e=await t.fetchPrivyRoute(vX,{});return{currencies:e.currencies,chains:e.chains}}function zIe(t){return t.type==="deposit_config"?{type:"deposit_config",deposit_config_id:t.depositConfigId}:{type:"inline_route",source:t.source,destination:t.destination}}async function VIe(t,e,n){let{walletId:r}=n,i=zIe(n),s=t.getCompiledPath(IC,{params:{wallet_id:r}}),a=String(Date.now()+Rne),{signature:o}=await Pne(e,{version:1,url:s,method:IC.method,headers:{"privy-app-id":t.app.appId,[Z8]:a},body:i});if(Date.now()>Number(a))throw new yt({error:"Wallet request expired before it could be sent. Please try again.",code:"embedded_wallet_request_expired"});
527let l=await t.fetchPrivyRoute(IC,{body:i,params:{wallet_id:r},headers:{"privy-authorization-signature":o,[Z8]:a}});return t.track({name:"sdk_deposit_address_headless_create",properties:{version:"v3",action:"create",walletId:r,type:n.type,...n.type==="inline_route"?{destinationChain:n.destination.chain,destinationCurrency:n.destination.asset}:{depositConfigId:n.depositConfigId}}}),l}async function HIe(t,e){let n=await t.fetchPrivyRoute(T5e,{body:{source:e.source,destination:e.destination,...e.inputAmount==null?{}:{input_amount:e.inputAmount},...e.slippageBps==null?{}:{slippage_bps:e.slippageBps}}});return t.track({name:"sdk_deposit_address_headless_quote",properties:{version:"v3",action:"quote",sourceChain:e.source.chain,sourceCurrency:e.source.asset,destinationChain:e.destination.chain,destinationCurrency:e.destination.asset}}),n}function WIe(t){let e=Number(t.input_amount),n=Number(t.estimated_output_amount);if(!(!Number.isFinite(e)||!Number.isFinite(n)||e===0))return String(n/e)}u5({createCryptoDepositAccount:()=>VIe,getCryptoDepositAccountQuote:()=>HIe,indicativeRateFromQuote:()=>WIe});var Is,hu,EY,qIe=(EY=class{constructor({wallet:e,account:n}){Zx(this,Is);Zx(this,hu);Kx(this,Is,e),Kx(this,hu,n)}get standardWallet(){return es(this,Is)}get address(){return es(this,hu).address}async disconnect(){var e;if(!((e=es(this,Is).features["standard:disconnect"])!=null&&e.disconnect))throw Error("Wallet does not support disconnect");await es(this,Is).features["standard:disconnect"].disconnect()}async signMessage(...e){var r;if(!((r=es(this,Is).features["solana:signMessage"])!=null&&r.signMessage))throw Error("Wallet does not support signMessage");let n=await es(this,Is).features["solana:signMessage"].signMessage(...e.map(i=>({...i,account:es(this,hu)})));return e.length===1?n[0]:[...n]}async signTransaction(...e){var r;if(!((r=es(this,Is).features["solana:signTransaction"])!=null&&r.signTransaction))throw Error("Wallet does not support signTransaction");let n=await es(this,Is).features["solana:signTransaction"].signTransaction(...e.map(i=>({...i,account:es(this,hu)})));return e.length===1?n[0]:[...n]}async signAndSendTransaction(...e){var r;if(!((r=es(this,Is).features["solana:signAndSendTransaction"])!=null&&r.signAndSendTransaction))throw Error("Wallet does not support signAndSendTransaction");let n=await es(this,Is).features["solana:signAndSendTransaction"].signAndSendTransaction(...e.map(i=>({...i,account:es(this,hu)})));return e.length===1?n[0]:[...n]}async signAndSendAllTransactions(e){var n;if(!((n=es(this,Is).features["solana:signAndSendTransaction"])!=null&&n.signAndSendTransaction))throw Error("Wallet does not support signAndSendTransaction");return[...await es(this,Is).features["solana:signAndSendTransaction"].signAndSendTransaction(...e.map(r=>({...r,account:es(this,hu)})))]}},Is=new WeakMap,hu=new WeakMap,EY),ZIe=uIe;const KIe=new TextEncoder,ere=new TextDecoder,GIe=t=>{let e=t;typeof e=="string"&&(e=KIe.encode(e));const n=32768,r=[];for(let i=0;i<e.length;i+=n)r.push(String.fromCharCode.apply(null,e.subarray(i,i+n)));return btoa(r.join(""))},YIe=t=>GIe(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),JIe=t=>{const e=atob(t),n=new Uint8Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r);return n},XIe=t=>{let e=t;e instanceof Uint8Array&&(e=ere.decode(e)),e=e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return JIe(e)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}};class QIe extends Error{static get code(){return"ERR_JOSE_GENERIC"}constructor(e){var n;super(e),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,(n=Error.captureStackTrace)===null||n===void 0||n.call(Error,this,this.constructor)}}class gh extends QIe{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}static get code(){return"ERR_JWT_INVALID"}}function eNe(t){return typeof t=="object"&&t!==null}function tNe(t){if(!eNe(t)||Object.prototype.toString.call(t)!=="[object Object]")return!1;if(Object.getPrototypeOf(t)===null)return!0;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}const K8=YIe,nNe=XIe;function cV(t){if(typeof t!="string")throw new gh("JWTs must use Compact JWS serialization, JWT must be a string");const{1:e,length:n}=t.split(".");if(n===5)throw new gh("Only JWTs using Compact JWS serialization can be decoded");
527if(n!==3)throw new gh("Invalid JWT");if(!e)throw new gh("JWTs must contain a payload");let r;try{r=nNe(e)}catch{throw new gh("Failed to base64url decode the payload")}let i;try{i=JSON.parse(ere.decode(r))}catch{throw new gh("Failed to parse the decoded payload as JSON")}if(!tNe(i))throw new gh("Invalid JWT Claims Set");return i}const tre=(t,e)=>t===e?!0:t.startsWith("0x")&&e.startsWith("0x")&&t.length===42&&e.length===42?Vi(t)===Vi(e):!1,Ae=()=>{throw Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")},w6t=t=>()=>{throw Error(t.trim())},nre=()=>{},rre=N.createContext({setAuthenticated:Ae,setUser:Ae,setIsNewUser:Ae,isNewUserThisSession:!1,walletConnectionStatus:null,setWalletConnectionStatus:Ae,connectors:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,client:null,privy:null,appId:"notAdded",hideWalletUIs:{current:!1},nativeTokenSymbolForChainId:Ae,initializeWalletProxy:Ae,getAuthMeta:Ae,getAuthFlow:Ae,closePrivyModal:Ae,openPrivyModal:Ae,connectWallet:Ae,initLoginWithWallet:Ae,loginWithWallet:Ae,initLoginWithFarcaster:Ae,loginWithFarcaster:Ae,loginWithCode:Ae,initLoginWithEmail:Ae,initLoginWithSms:Ae,initUpdateEmail:Ae,initUpdatePhone:Ae,resendEmailCode:Ae,resendSmsCode:Ae,initLoginWithHeadlessOAuth:Ae,loginWithHeadlessOAuth:Ae,crossAppAuthFlow:Ae,initLoginWithOAuth:Ae,loginWithOAuth:Ae,passkeyAuthState:{status:"initial"},setPasskeyAuthState:Ae,initSignupWithPasskey:Ae,signupWithPasskey:Ae,initLoginWithPasskey:Ae,loginWithPasskey:Ae,initLinkWithPasskey:Ae,linkWithPasskey:Ae,refreshSessionAndUser:Ae,walletProxy:null,createAnalyticsEvent:Ae,acceptTerms:Ae,getUsdTokenPrice:Ae,getUsdPriceForSol:Ae,getSplTokenMetadata:Ae,recoverEmbeddedWallet:Ae,updateWallets:Ae,fundWallet:Ae,openModal:Ae,setReadyToTrue:Ae,requestFarcasterSignerStatus:Ae,initLoginWithTelegram:Ae,loginWithTelegram:Ae,generateSiweMessage:Ae,generateSiweMessageForSmartWallet:Ae,loginWithSiwe:Ae,linkWithSiwe:Ae,linkSmartWallet:Ae,delegateWallet:Ae,revokeDelegatedWallets:Ae,connectCoinbaseSmartWallet:Ae,connectBaseAccount:Ae,initiateAccountTransfer:Ae,emailOtpState:{status:"initial"},setEmailOtpState:Ae,smsOtpState:{status:"initial"},setSmsOtpState:Ae,siweState:{status:"initial"},setSiweState:Ae,oAuthState:{status:"initial"},setOAuthState:Ae,telegramAuthState:{status:"initial"},setTelegramAuthState:Ae,isHeadlessOAuthLoading:!1,isHeadlessSigning:Ae,inProgressAuthFlowRef:{current:null},inProgressLoginOrLinkMethodRef:{current:null},baseAccountSdk:void 0,setBaseAccountSdk:Ae}),Br=()=>N.useContext(rre);function lO(t){return typeof t=="string"&&/^custom:[a-zA-Z0-9_-]+$/i.test(t)}const Da=t=>!!t.id&&t.recoveryMethod==="privy-v2";function Ft(t){return t?new Date(1e3*t):null}function ns(t,e){return t.slice().sort(((n,r)=>{var i,s;return(((i=n.firstVerifiedAt)==null?void 0:i.getTime())??0)-(((s=r.firstVerifiedAt)==null?void 0:s.getTime())??0)})).find((n=>n.type===e))}const v2=t=>t?rNe(t).find((e=>e.walletIndex===0))??null:null,rNe=t=>t?ire(t,"ethereum"):[],ire=(t,e)=>t.linkedAccounts.filter((n=>n.type==="wallet"&&n.walletClientType==="privy"&&!n.imported&&n.chainType===e)),iNe=t=>t?ire(t,"solana"):[],G8=t=>t?iNe(t).find((e=>e.walletIndex===0))??null:null,cO=t=>((t==null?void 0:t.linkedAccounts)??[]).filter((e=>e.type==="wallet"&&e.walletClientType==="privy"&&e.imported&&e.chainType==="ethereum")),sre=t=>((t==null?void 0:t.linkedAccounts)??[]).filter((e=>e.type==="wallet"&&e.imported&&e.walletClientType==="privy"&&e.chainType==="solana")),x0=(t,e)=>(t==null?void 0:t.linkedAccounts.find((n=>n.type==="wallet"&&n.walletClientType==="privy"&&tre(n.address,e))))||null,$4=(t,e)=>t.find((n=>tre(n.address,e)))||null,l6=t=>{let e=v2(t),n=G8(t);return e&&n&&!Da(n)&&Da(e)?n:v2(t)??G8(t)};function os(t){if(!t)return null;let e=(function(A){let I=[];for(let $ of A){let O=$.type;switch($.type){case"wallet":let P={id:$.id,address:$.address,type:$.type,imported:$.imported,delegated:$.delegated,firstVerifiedAt:Ft($.first_verified_at),latestVerifiedAt:Ft($.latest_verified_at),chainType:$.chain_type,walletClientType:$.wallet_client_type,connectorType:$.connector_type,recoveryMethod:$.recovery_method,walletIndex:$.wallet_index,publicKey:$.public_key};I.push(P);break;case"smart_wallet":let j={address:$.address,type:$.type,firstVerifiedAt:Ft
527($.first_verified_at),latestVerifiedAt:Ft($.latest_verified_at),smartWalletType:$.smart_wallet_type,smartWalletVersion:$.smart_wallet_version};I.push(j);break;case"cross_app":let U={type:$.type,subject:$.subject,embeddedWallets:$.embedded_wallets,smartWallets:$.smart_wallets,providerApp:{id:$.provider_app_id},firstVerifiedAt:Ft($.first_verified_at),latestVerifiedAt:Ft($.latest_verified_at)};I.push(U);break;case"email":let z={address:$.address,type:$.type,firstVerifiedAt:Ft($.first_verified_at),latestVerifiedAt:Ft($.latest_verified_at)};I.push(z);break;case"phone":let D={number:$.phoneNumber,type:$.type,firstVerifiedAt:Ft($.first_verified_at),latestVerifiedAt:Ft($.latest_verified_at)};I.push(D);break;case"google_oauth":let R={subject:$.subject,email:$.email,name:$.name,type:$.type,firstVerifiedAt:Ft($.first_verified_at),latestVerifiedAt:Ft($.latest_verified_at)};I.push(R);break;case"spotify_oauth":let W={subject:$.subject,email:$.email,name:$.name,type:$.type,firstVerifiedAt:Ft($.first_verified_at),latestVerifiedAt:Ft($.latest_verified_at)};I.push(W);break;case"instagram_oauth":let T={subject:$.subject,username:$.username,type:$.type,firstVerifiedAt:Ft($.first_verified_at),latestVerifiedAt:Ft($.latest_verified_at)};I.push(T);break;case"twitter_oauth":let L={subject:$.subject,username:$.username,name:$.name,type:$.type,profilePictureUrl:$.profile_picture_url,firstVerifiedAt:Ft($.first_verified_at),latestVerifiedAt:Ft($.latest_verified_at)};I.push(L);break;case"discord_oauth":let M={subject:$.subject,username:$.username,email:$.email,type:$.type,firstVerifiedAt:Ft($.first_verified_at),latestVerifiedAt:Ft($.latest_verified_at)};I.push(M);break;case"github_oauth":let Z={subject:$.subject,username:$.username,name:$.name,email:$.email,type:$.type,firstVerifiedAt:Ft($.first_verified_at),latestVerifiedAt:Ft($.latest_verified_at)};I.push(Z);break;case"tiktok_oauth":let H={subject:$.subject,username:$.username,name:$.name,type:$.type,firstVerifiedAt:Ft($.first_verified_at),latestVerifiedAt:Ft($.latest_verified_at)};I.push(H);break;case"line_oauth":let V={subject:$.subject,name:$.name,email:$.email,profilePictureUrl:$.profile_picture_url,type:$.type,firstVerifiedAt:Ft($.first_verified_at),latestVerifiedAt:Ft($.latest_verified_at)};I.push(V);break;case"twitch_oauth":let F={subject:$.subject,username:$.username,type:$.type,firstVerifiedAt:Ft($.first_verified_at),latestVerifiedAt:Ft($.latest_verified_at)};I.push(F);break;case"linkedin_oauth":let q={subject:$.subject,name:$.name,email:$.email,vanityName:$.vanity_name,type:$.type,firstVerifiedAt:Ft($.first_verified_at),latestVerifiedAt:Ft($.latest_verified_at)};I.push(q);break;case"apple_oauth":let G={subject:$.subject,email:$.email,type:$.type,firstVerifiedAt:Ft($.first_verified_at),latestVerifiedAt:Ft($.latest_verified_at)};I.push(G);break;case"custom_auth":I.push({type:$.type,customUserId:$.custom_user_id,firstVerifiedAt:Ft($.first_verified_at),latestVerifiedAt:Ft($.latest_verified_at)});break;case"farcaster":let Y={type:$.type,fid:$.fid,ownerAddress:$.owner_address,displayName:$.display_name,username:$.username,bio:$.bio,pfp:$.profile_picture_url,url:$.homepage_url,firstVerifiedAt:Ft($.first_verified_at),latestVerifiedAt:Ft($.latest_verified_at),signerPublicKey:$.signer_public_key};I.push(Y);break;case"passkey":let X={type:$.type,enrolledInMfa:$.enrolled_in_mfa,credentialId:$.credential_id,publicKey:$.public_key,authenticatorName:$.authenticator_name,createdWithDevice:$.created_with_device,createdWithOs:$.created_with_os,createdWithBrowser:$.created_with_browser,firstVerifiedAt:Ft($.first_verified_at),latestVerifiedAt:Ft($.latest_verified_at)};I.push(X);break;case"telegram":let te={type:$.type,telegramUserId:$.telegram_user_id,firstName:$.first_name,lastName:$.last_name,username:$.username,photoUrl:$.photo_url,firstVerifiedAt:Ft($.first_verified_at),latestVerifiedAt:Ft($.latest_verified_at)};I.push(te);break;default:if(lO($.type)){let ie={type:$.type,subject:$.subject,name:$.name,username:$.username,email:$.email,profilePictureUrl:$.profile_picture_url,firstVerifiedAt:Ft($.first_verified_at),latestVerifiedAt:Ft
527($.latest_verified_at)};I.push(ie);break}console.warn(`Unrecognized account type: ${O}. Please consider upgrading the Privy SDK.`)}}return I})(t.linked_accounts),n=ns(e,"wallet"),r=ns(e,"smart_wallet"),i=ns(e,"email"),s=ns(e,"phone"),a=ns(e,"google_oauth"),o=ns(e,"twitter_oauth"),l=ns(e,"discord_oauth"),u=ns(e,"github_oauth"),f=ns(e,"spotify_oauth"),p=ns(e,"instagram_oauth"),y=ns(e,"tiktok_oauth"),g=ns(e,"line_oauth"),b=ns(e,"twitch_oauth"),v=ns(e,"linkedin_oauth"),_=ns(e,"apple_oauth"),C=ns(e,"farcaster"),S=ns(e,"telegram"),x=t.mfa_methods.map((({type:A,verified_at:I})=>({type:A,verifiedAt:Ft(I)})));return{id:t.id,createdAt:Ft(t.created_at),linkedAccounts:e,email:i&&{address:i==null?void 0:i.address},phone:s&&{number:s==null?void 0:s.number},wallet:n&&{id:n.id,address:n.address,chainType:n.chainType,walletClientType:n.walletClientType,connectorType:n.connectorType,recoveryMethod:n.recoveryMethod,imported:n.imported,delegated:n.delegated,walletIndex:n.walletIndex,publicKey:n.publicKey},smartWallet:r&&{address:r.address,smartWalletType:r.smartWalletType,smartWalletVersion:r.smartWalletVersion},google:a&&{subject:a.subject,email:a.email,name:a.name},twitter:o&&{subject:o.subject,username:o.username,name:o.name,profilePictureUrl:o.profilePictureUrl},discord:l&&{subject:l.subject,username:l.username,email:l.email},github:u&&{subject:u.subject,username:u.username,name:u.name,email:u.email},spotify:f&&{subject:f.subject,email:f.email,name:f.name},instagram:p&&{subject:p.subject,username:p.username},tiktok:y&&{subject:y.subject,username:y.username,name:y.name},line:g&&{subject:g.subject,name:g.name,email:g.email,profilePictureUrl:g.profilePictureUrl},twitch:b&&{subject:b.subject,username:b.username},linkedin:v&&{subject:v.subject,name:v.name,email:v.email,vanityName:v.vanityName},apple:_&&{subject:_.subject,email:_.email},farcaster:C&&{fid:C.fid,ownerAddress:C.ownerAddress,displayName:C.displayName,username:C.username,bio:C.bio,pfp:C.pfp,url:C.url,signerPublicKey:C.signerPublicKey},telegram:S&&{telegramUserId:S.telegramUserId,firstName:S.firstName,lastName:S.lastName,username:S.username,photoUrl:S.photoUrl},delegatedWallets:[],mfaMethods:x.map((A=>A.type)),hasAcceptedTerms:t.has_accepted_terms??!1,isGuest:t.is_guest,customMetadata:t.custom_metadata}}const Ku=N.createContext({ready:!1,authenticated:!1,user:null,error:null,walletConnectors:null,connectWallet:Ae,login:Ae,connectOrCreateWallet:Ae,linkEmail:Ae,linkPhone:Ae,linkFarcaster:Ae,linkWallet:Ae,linkGoogle:Ae,linkTwitter:Ae,linkTwitch:Ae,linkDiscord:Ae,linkGithub:Ae,linkSpotify:Ae,linkInstagram:Ae,linkTelegram:Ae,linkTiktok:Ae,linkLine:Ae,linkLinkedIn:Ae,linkApple:Ae,linkPasskey:Ae,linkOAuth:Ae,logout:Ae,getAccessToken:Ae,signMessage:Ae,signTypedData:Ae,enrollInMfa:Ae,initEnrollmentWithSms:Ae,initEnrollmentWithTotp:Ae,initEnrollmentWithPasskey:Ae,promptMfa:Ae,init:Ae,submitEnrollmentWithSms:Ae,submitEnrollmentWithTotp:Ae,submitEnrollmentWithPasskey:Ae,unenroll:Ae,clear:Ae,submit:Ae,cancel:Ae,sendTransaction:Ae,signTransaction:Ae,setWalletPassword:Ae,setWalletRecovery:Ae,isModalOpen:!1,mfaMethods:[]}),Uo=()=>N.useContext(Ku),uV=t=>{let e;const n=new Set,r=(u,f)=>{const p=typeof u=="function"?u(e):u;if(!Object.is(p,e)){const y=e;e=f??(typeof p!="object"||p===null)?p:Object.assign({},e,p),n.forEach(g=>g(e,y))}},i=()=>e,o={setState:r,getState:i,getInitialState:()=>l,subscribe:u=>(n.add(u),()=>n.delete(u))},l=e=t(r,i,o);return o},sNe=(t=>t?uV(t):uV),aNe=t=>t;function oNe(t,e=aNe){const n=Qe.useSyncExternalStore(t.subscribe,Qe.useCallback(()=>e(t.getState()),[t,e]),Qe.useCallback(()=>e(t.getInitialState()),[t,e]));return Qe.useDebugValue(n),n}const dV=t=>{const e=sNe(t),n=r=>oNe(e,r);return Object.assign(n,e),n},Bo=(t=>t?dV(t):dV);function Y8(t){"@babel/helpers - typeof";return Y8=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Y8(t)}var lNe=/^\s+/,cNe=/\s+$/;function nt(t,e){if(t=t||"",e=e||{},t instanceof nt)return t;if(!(this instanceof nt))return new nt(t,e);var n=uNe(t);this._originalInput=t,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||n.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}nt.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},getLuminance:function(){var e=this.toRgb(),n,r,i,s,a,o;return n=e.r/255,r=e.g/255,i=e.b/255,n<=.03928?s=n/12.92:s=Math.pow((n+.055)/1.055,2.4),r<=.03928?a=r/12.92:a=Math.pow((r+.055)/1.055,2.4),i<=.03928?o=i/12.92:o=Math.pow((i+.055)/1.055,2.4),.2126*s+.7152*a+.0722*o},setAlpha:function(e){return this._a=are(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=fV(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=fV(this._r,this._g,this._b),n=Math.round(e.h*360),r=Math.round(e.s*100),i=Math.round(e.v*100);return this._a==1?"hsv("+n+", "+r+"%, "+i+"%)":"hsva("+n+", "+r+"%, "+i+"%, "+this._roundA+")"},toHsl:function(){var e=hV(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=hV(this._r,this._g,this._b),n=Math.round(e.h*360),r=Math.round(e.s*100),i=Math.round(e.l*100);return this._a==1?"hsl("+n+", "+r+"%, "+i+"%)":"hsla("+n+", "+r+"%, "+i+"%, "+this._roundA+")"},toHex:function(e){return pV(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return pNe(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(Or(this._r,255)*100)+"%",g:Math.round(Or(this._g,255)*100)+"%",b:Math.round(Or(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(Or(this._r,255)*100)+"%, "+Math.round(Or(this._g,255)*100)+"%, "+Math.round(Or(this._b,255)*100)+"%)":"rgba("+Math.round(Or(this._r,255)*100)+"%, "+Math.round(Or(this._g,255)*100)+"%, "+Math.round(Or(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:ANe[pV(this._r,this._g,this._b,!0)]||!1},toFilter:function(e){var n="#"+mV(this._r,this._g,this._b,this._a),r=n,i=this._gradientType?"GradientType = 1, ":"";if(e){var s=nt(e);r="#"+mV(s._r,s._g,s._b,s._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+n+",endColorstr="+r+")"},toString:function(e){var n=!!e;e=e||this._format;var r=!1,i=this._a<1&&this._a>=0,s=!n&&i&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return s?e==="name"&&this._a===0?this.toName():this.toRgbString():(e==="rgb"&&(r=this.toRgbString()),e==="prgb"&&(r=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(r=this.toHexString()),e==="hex3"&&(r=this.toHexString(!0)),e==="hex4"&&(r=this.toHex8String(!0)),e==="hex8"&&(r=this.toHex8String()),e==="name"&&(r=this.toName()),e==="hsl"&&(r=this.toHslString()),e==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return nt(this.toString())},_applyModification:function(e,n){var r=e.apply(null,[this].concat([].slice.call(n)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(bNe,arguments)},brighten:function(){return this._applyModification(wNe,arguments)},darken:function(){return this._applyModification(vNe,arguments)},desaturate:function(){return this._applyModification(mNe,arguments)},saturate:function(){return this._applyModification(yNe,arguments)},greyscale:function(){return this._applyModification(gNe,arguments)},spin:function(){return this._applyModification(_Ne,arguments)},_applyCombination:function(e,n){return e.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(ENe,arguments)},complement:function(){return this._applyCombination(xNe,arguments)},monochromatic:function(){return this._applyCombination(SNe,arguments)},splitcomplement:function(){return this._applyCombination(CNe,arguments)},triad:function(){return this._applyCombination(yV,[3])},tetrad:function(){return this._applyCombination(yV,[4])}};nt.fromRatio=function(t,e){if(Y8(t)=="object"){var n={};for(var r in t)t.hasOwnProperty(r)&&(r==="a"?n[r]=t[r]:n[r]=cg(t[r]));t=n}return nt(t,e)};function uNe(t){var e={r:0,g:0,b:0}
vendor: 4,629 bytes, line 527
527,n=1,r=null,i=null,s=null,a=!1,o=!1;return typeof t=="string"&&(t=$Ne(t)),Y8(t)=="object"&&(Wc(t.r)&&Wc(t.g)&&Wc(t.b)?(e=dNe(t.r,t.g,t.b),a=!0,o=String(t.r).substr(-1)==="%"?"prgb":"rgb"):Wc(t.h)&&Wc(t.s)&&Wc(t.v)?(r=cg(t.s),i=cg(t.v),e=fNe(t.h,r,i),a=!0,o="hsv"):Wc(t.h)&&Wc(t.s)&&Wc(t.l)&&(r=cg(t.s),s=cg(t.l),e=hNe(t.h,r,s),a=!0,o="hsl"),t.hasOwnProperty("a")&&(n=t.a)),n=are(n),{ok:a,format:t.format||o,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:n}}function dNe(t,e,n){return{r:Or(t,255)*255,g:Or(e,255)*255,b:Or(n,255)*255}}function hV(t,e,n){t=Or(t,255),e=Or(e,255),n=Or(n,255);var r=Math.max(t,e,n),i=Math.min(t,e,n),s,a,o=(r+i)/2;if(r==i)s=a=0;else{var l=r-i;switch(a=o>.5?l/(2-r-i):l/(r+i),r){case t:s=(e-n)/l+(e<n?6:0);break;case e:s=(n-t)/l+2;break;case n:s=(t-e)/l+4;break}s/=6}return{h:s,s:a,l:o}}function hNe(t,e,n){var r,i,s;t=Or(t,360),e=Or(e,100),n=Or(n,100);function a(u,f,p){return p<0&&(p+=1),p>1&&(p-=1),p<1/6?u+(f-u)*6*p:p<1/2?f:p<2/3?u+(f-u)*(2/3-p)*6:u}if(e===0)r=i=s=n;else{var o=n<.5?n*(1+e):n+e-n*e,l=2*n-o;r=a(l,o,t+1/3),i=a(l,o,t),s=a(l,o,t-1/3)}return{r:r*255,g:i*255,b:s*255}}function fV(t,e,n){t=Or(t,255),e=Or(e,255),n=Or(n,255);var r=Math.max(t,e,n),i=Math.min(t,e,n),s,a,o=r,l=r-i;if(a=r===0?0:l/r,r==i)s=0;else{switch(r){case t:s=(e-n)/l+(e<n?6:0);break;case e:s=(n-t)/l+2;break;case n:s=(t-e)/l+4;break}s/=6}return{h:s,s:a,v:o}}function fNe(t,e,n){t=Or(t,360)*6,e=Or(e,100),n=Or(n,100);var r=Math.floor(t),i=t-r,s=n*(1-e),a=n*(1-i*e),o=n*(1-(1-i)*e),l=r%6,u=[n,a,s,s,o,n][l],f=[o,n,n,a,s,s][l],p=[s,s,o,n,n,a][l];return{r:u*255,g:f*255,b:p*255}}function pV(t,e,n,r){var i=[hl(Math.round(t).toString(16)),hl(Math.round(e).toString(16)),hl(Math.round(n).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function pNe(t,e,n,r,i){var s=[hl(Math.round(t).toString(16)),hl(Math.round(e).toString(16)),hl(Math.round(n).toString(16)),hl(ore(r))];return i&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)&&s[3].charAt(0)==s[3].charAt(1)?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}function mV(t,e,n,r){var i=[hl(ore(r)),hl(Math.round(t).toString(16)),hl(Math.round(e).toString(16)),hl(Math.round(n).toString(16))];return i.join("")}nt.equals=function(t,e){return!t||!e?!1:nt(t).toRgbString()==nt(e).toRgbString()};nt.random=function(){return nt.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function mNe(t,e){e=e===0?0:e||10;var n=nt(t).toHsl();return n.s-=e/100,n.s=K7(n.s),nt(n)}function yNe(t,e){e=e===0?0:e||10;var n=nt(t).toHsl();return n.s+=e/100,n.s=K7(n.s),nt(n)}function gNe(t){return nt(t).desaturate(100)}function bNe(t,e){e=e===0?0:e||10;var n=nt(t).toHsl();return n.l+=e/100,n.l=K7(n.l),nt(n)}function wNe(t,e){e=e===0?0:e||10;var n=nt(t).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(e/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(e/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(e/100)))),nt(n)}function vNe(t,e){e=e===0?0:e||10;var n=nt(t).toHsl();return n.l-=e/100,n.l=K7(n.l),nt(n)}function _Ne(t,e){var n=nt(t).toHsl(),r=(n.h+e)%360;return n.h=r<0?360+r:r,nt(n)}function xNe(t){var e=nt(t).toHsl();return e.h=(e.h+180)%360,nt(e)}function yV(t,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var n=nt(t).toHsl(),r=[nt(t)],i=360/e,s=1;s<e;s++)r.push(nt({h:(n.h+s*i)%360,s:n.s,l:n.l}));return r}function CNe(t){var e=nt(t).toHsl(),n=e.h;return[nt(t),nt({h:(n+72)%360,s:e.s,l:e.l}),nt({h:(n+216)%360,s:e.s,l:e.l})]}function ENe(t,e,n){e=e||6,n=n||30;var r=nt(t).toHsl(),i=360/n,s=[nt(t)];for(r.h=(r.h-(i*e>>1)+720)%360;--e;)r.h=(r.h+i)%360,s.push(nt(r));return s}function SNe(t,e){e=e||6;for(var n=nt(t).toHsv(),r=n.h,i=n.s,s=n.v,a=[],o=1/e;e--;)a.push(nt({h:r,s:i,v:s})),s=(s+o)%1;return a}nt.mix=function(t,e,n){n=n===0?0:n||50;var r=nt(t).toRgb(),i=nt(e).toRgb(),s=n/100,a={r:(i.r-r.r)*s+r.r,g:(i.g-r.g)*s+r.g,b:(i.b-r.b)*s+r.b,a:(i.a-r.a)*s+r.a};return nt(a)};nt.readability=function(t,e){var n=nt(t),r=nt(e);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)};nt.isReadable=function(t,e,n){var r=nt.readability(t,e),i,s;switch(s=!1,i=INe(n),i.level+i.size){case"AAsmall":case"AAAlarge":s=r>=4.5;break;case"AAlarge":s=r>=3;break;case"AAAsmall":s=r>=7;break}return s};nt.mostReadable=function(t,e,n){var r=null,i=0,s,a,o,l;n=n||{},a=n.includeFallbackColors,o=n.level,l=n.size;
527for(var u=0;u<e.length;u++)s=nt.readability(t,e[u]),s>i&&(i=s,r=nt(e[u]));return nt.isReadable(t,r,{level:o,size:l})||!a?r:(n.includeFallbackColors=!1,nt.mostReadable(t,["#fff","#000"],n))};var qT=nt.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee9
5270",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},ANe=nt.hexNames=kNe(qT);function kNe(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}function are(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function Or(t,e){TNe(t)&&(t="100%");var n=LNe(t);return t=Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function K7(t){return Math.min(1,Math.max(0,t))}function Na(t){return parseInt(t,16)}function TNe(t){return typeof t=="string"&&t.indexOf(".")!=-1&&parseFloat(t)===1}function LNe(t){return typeof t=="string"&&t.indexOf("%")!=-1}function hl(t){return t.length==1?"0"+t:""+t}function cg(t){return t<=1&&(t=t*100+"%"),t}function ore(t){return Math.round(parseFloat(t)*255).toString(16)}function gV(t){return Na(t)/255}var nl=(function(){var t="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",n="(?:"+e+")|(?:"+t+")",r="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",i="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{CSS_UNIT:new RegExp(n),rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+r),hsva:new RegExp("hsva"
527+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}})();function Wc(t){return!!nl.CSS_UNIT.exec(t)}function $Ne(t){t=t.replace(lNe,"").replace(cNe,"").toLowerCase();var e=!1;if(qT[t])t=qT[t],e=!0;else if(t=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=nl.rgb.exec(t))?{r:n[1],g:n[2],b:n[3]}:(n=nl.rgba.exec(t))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=nl.hsl.exec(t))?{h:n[1],s:n[2],l:n[3]}:(n=nl.hsla.exec(t))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=nl.hsv.exec(t))?{h:n[1],s:n[2],v:n[3]}:(n=nl.hsva.exec(t))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=nl.hex8.exec(t))?{r:Na(n[1]),g:Na(n[2]),b:Na(n[3]),a:gV(n[4]),format:e?"name":"hex8"}:(n=nl.hex6.exec(t))?{r:Na(n[1]),g:Na(n[2]),b:Na(n[3]),format:e?"name":"hex"}:(n=nl.hex4.exec(t))?{r:Na(n[1]+""+n[1]),g:Na(n[2]+""+n[2]),b:Na(n[3]+""+n[3]),a:gV(n[4]+""+n[4]),format:e?"name":"hex8"}:(n=nl.hex3.exec(t))?{r:Na(n[1]+""+n[1]),g:Na(n[2]+""+n[2]),b:Na(n[3]+""+n[3]),format:e?"name":"hex"}:!1}function INe(t){var e,n;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),n=(t.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),n!=="small"&&n!=="large"&&(n="small"),{level:e,size:n}}const ZT="https://auth.privy.io",NNe=2e4,v6t=1400,_6t=2500,x6t=4e3,ONe="3.42.0",ug="privy:token",bV="privy-token",EE="privy:refresh_token",PNe="privy-refresh-token",Ow="privy:pat",wV="privy:id_token",vV="privy-id-token",SE="privy-session",KT="privy:caid",lre=t=>`privy:guest:${t}`,I4=t=>`privy:cross-app:${t}`,J8="privy:state_code",dg="privy:code_verifier",X8="privy:headless_oauth",Og="privy:oauth_disable_signup",AE=t=>`privy:wallet:${t}`,cre="privy:connections",G7=12e4,C6t=1,_V="0x1",RNe=3e4,E6t="https://api.moonpay.com/v1",S6t="https://api.moonpay.com/v1",A6t="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",k6t="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",jNe="deprecated",Vd={appearance:{landingHeader:"Log in or sign up",theme:"light",walletList:["detected_ethereum_wallets","detected_solana_wallets","metamask","coinbase_wallet","rainbow","robinhood_wallet","base_account","wallet_connect","phantom"]},walletConnectCloudProjectId:"34357d3c125c2bcf2ce2bc3309d98715",_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};let MNe=new Set(["coinbase_wallet","base_account","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","universal_profile","bybit_wallet","ronin_wallet","haha_wallet","wallet_connect","wallet_connect_qr","wallet_connect_qr_solana","detected_solana_wallets","detected_ethereum_wallets","rabby_wallet","safe","solflare","backpack","jupiter","binance","binanceus","bitget_wallet","kraken_wallet","robinhood_wallet"]),xV=t=>MNe.has(t),CV=(t,e,n)=>n.indexOf(t)===e;const DNe=({input:t,overrides:e})=>e?e.primary.concat(e.overflow??[]).filter(xV).filter(CV):t?t.filter(xV).filter(CV):Vd.appearance.walletList;let UNe=/paymaster\.biconomy\.io\/api/i,BNe={mode:"SPONSORED",calculateGasLimits:!0,expiryDuration:300,sponsorshipInfo:{webhookData:{},smartAccountInfo:{name:"BICONOMY",version:"2.0.0"}}};const FNe=(t,e)=>t&&UNe.test(t)?BNe:e&&e.policy_id?{policyId:e.policy_id}:void 0;function N4(t,e){let n=Math.max(0,Math.min(1,t.toHsl().l+e));return nt({...t.toHsl(),l:n})}function kE(t,e){let n=t.getLuminance(),r=e.getLuminance();return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function zNe(t,e){if(!t){let r=e?hg:Pw;return{accent:nt(r.background.interactive),accentLight:nt(r.background.interactive),accentHover:nt(r.background["interactive-hover"]),accentDark:nt(r.background["interactive-clicked"]),accentDarkest:nt(r.background["interactive-disabled"])}}let n=nt(t);return{accent:n,accentLight:N4(n,.15),accentHover:N4(n,.3),accentDark:N4(n,-.06),accentDarkest:N4(n,-.6)}}function VNe({backgroundTheme:t,accentHex:e}){let n,r;t==="light"?n=!1:t==="dark"?n=!0:(n=.5>=nt(t).getLuminance(),r=nt(t).toHslString());let i=n?"dark":"light",s=n?hg:Pw,{accent:a,accentLight:o,accentHover:l,accentDark:u,accentDarkest:f}=zNe(e,n),p=(function(b){let v=nt(Pw.text.default),_=nt(hg.text.default),C=kE(b,v),S=kE(b,_),x=b.toHsl();return x.h>=220&&x.h<=300&&S>=3?hg.text.default:C>S?Pw.text.default:hg.text.default})(a),y=nt(p),g=kE(a,nt(s.background.default))>=3;return{colorScheme:i,background:r||s.background.default,background2:s.background.elevated,background3:s.background.interactive,foreground:s.text.default,foreground2:s.text.muted,foreground3:s.text.placeholder,foreground4:s.border.default,accent:a.toHslString(),accentLight:o.toHslString(),accentHover:l.toHslString(),accentDark:u.toHslString(),accentDarkest:f.toHslString(),foregroundAccent:y.toHslString(),success:s.background.success,successDark:s.text.success,successLight:s.background.success,error:s.text.error,errorLight:s.background.error,warn:s.background.warning,warnLight:s.background.warning,warningDark:s.text.warning,errorDark:s.text.error,successBg:s.background.success,errorBg:s.background.error,errorBgHover:s.background["error-hover"],warnBg:s.background.warning,infoBg:s.background.info,infoBgHover:s.background["info-hover"],borderDefault:s.border.default,borderHover:s.border["default-hover"],borderFocus:s.border.focused,borderError:s.border.error,borderSuccess:s.border.success,borderWarning:s.border.warning,borderInfo:s.border.info,borderInteractive:s.border.interactive,borderInteractiveHover:s.border["interactive-hover"],backgroundHover:s.background["default-hover"],backgroundClicked:s.background["default-clicked"],backgroundDisabled:s.background["default-disabled"],backgroundInteractive:s.background.interactive,backgroundInteractiveHover:s.background["interactive-hover"],backgroundInteractiveClicked:s.background["interactive-clicked"],backgroundInteractiveDisabled:s.background["interactive-disabled"],foregroundHover:s.text.default,foregroundClicked:s.text.default,foregroundDisabled:s.text["default-disabled"],foregroundInteractive:s.text.interactive,foregroundInteractiveHover:s.text["interactive-hover"],accentHasGoodContrast:g?"1":"0",linkNavigationColor:g?a.toHslString():s.text.default,linkNavigationDecoration:g?"none":"underline",iconDefault:s.icon.default,iconMuted:s.icon.muted,iconSubtle:s.icon.subtle,iconInverse:s.icon.inverse,iconSuccess:s.icon.success,iconWarning:s.icon.warning,iconError:s.icon.error,iconInteractive:s.icon.interactive,iconDefaultHover:s.icon["default-hover"],iconMutedHover:s.icon["muted-hover"],iconSubtleHover:s.icon["subtle-hover"],iconDefaultClicked:s.icon["default-clicked"],iconMutedClicked:s.icon["muted-clicked"],iconSubtleClicked:s.icon["subtle-clicked"],iconDefaultDisabled:s.icon["default-disabled"],iconMutedDisabled:s.icon["muted-disabled"],iconSubtleDisabled:s.icon["subtle-disabled"],iconErrorHover:s.icon["error-hover"],iconInteractiveHover:s.icon["interactive-hover"],iconErrorClicked:s.icon["error-clicked"],iconInteractiveClicked:s.icon["interactive-clicked"],iconMutedDisabledAlt:s.icon["muted-disabled"],iconSubtleDisabledAlt:s.icon["subtle-disabled"]}}const hg={background:{default:"#020713",elevated:"#1A2230","default-hover":"#101724","default-clicked":"#1A2230","default-disabled":"#020713",success:"#0E3E2D",warning:"#373827",error:"#2E0C18",interactive:"#8B86FF","error-hover":"#441821","interactive-hover":"#7B73E5","interactive-clicked":"#6560CC","interactive-disabled":"#141824",info:"#1F2937","info-hover":"#141824"},icon:{default:"#F8F8F8",muted:"#9BA2AE",subtle:"#7B8491",inverse:"#020713",success:"#88E3B5",warning:"#FDF27B",error:"#EF4444",interactive:"#88B6FF","default-hover":"#F8F8F8","muted-hover":"#AEB3BD","subtle-hover":"#8B939E","default-clicked":"#F8F8F8","muted-clicked":"#9097A5","subtle-clicked":"#78818E","default-disabled":"#404452","muted-disabled":"#404452","subtle-disabled":"#404452","error-hover":"#F05555","interactive-hover":"#7B73E5","error-clicked":"#
527EF4444","interactive-clicked":"#6560CC"},text:{default:"#F8F8F8",muted:"#9BA2AE",placeholder:"#7B8491",success:"#ACEECB",warning:"#FEF9A0",error:"#FCA5A5",interactive:"#A29EFF","default-disabled":"#404452","interactive-hover":"#8C88E5"},border:{default:"#1F2937",interactive:"#88B0FF",focused:"#F8F8FC",info:"#5B83D3",success:"#317056",warning:"#FBBF24",error:"#F87171","default-hover":"#34304A","interactive-hover":"#88B0FF"}},Pw={background:{default:"#FFFFFF",elevated:"#F1F2F9","default-hover":"#F8F9FC","default-clicked":"#F1F2F9","default-disabled":"#FFFFFF",success:"#DCFCE7",warning:"#FEF3C7",error:"#FEE2E2",interactive:"#5B4FFF","error-hover":"#FECACA","interactive-hover":"#4F46E5","interactive-clicked":"#4338CA","interactive-disabled":"#F1F2F9",info:"#E0E7FF","info-hover":"#EEF2FF"},icon:{default:"#110F2A",muted:"#64668B",subtle:"#9498B8",inverse:"#FFFFFF",success:"#33B287",warning:"#F59E0B",error:"#EF4444",interactive:"#564FFF","default-hover":"#1D1B35","muted-hover":"#64668B","subtle-hover":"#888AAE","default-clicked":"#060C23","muted-clicked":"#64668B","subtle-clicked":"#788804","default-disabled":"#CBCDE1","muted-disabled":"#CBCDE1","subtle-disabled":"#CBCDE1","error-hover":"#F06060","interactive-hover":"#4F46E5","error-clicked":"#DC3838","interactive-clicked":"#2BA482"},text:{default:"#040217",muted:"#64668B",placeholder:"#9498B8",success:"#135638",warning:"#906218",error:"#991B1B",interactive:"#5B4FFF","default-disabled":"#CBCDE1","interactive-hover":"#5B4FFF"},border:{default:"#E2E3F0",interactive:"#5B4FFF",focused:"#949DF9",info:"#F1F2F9",success:"#87D7B7",warning:"#FACD63",error:"#F69393","default-hover":"#E2E3F0","interactive-hover":"#5B4FFF"}},HNe=["sms","totp","passkey"],WNe=["metamask","phantom","brave_wallet","rainbow","uniswap_wallet_extension","uniswap_extension","rabby_wallet","bybit_wallet","ronin_wallet","haha_wallet","crypto.com_wallet_extension","crypto.com_onchain","binance","bitget_wallet","coinbase_wallet","coinbase_smart_wallet","base_account","metamask","trust","safe","rainbow","uniswap","zerion","argent","spot","omni","cryptocom","blockchain","safepal","bitget_wallet","zengo","1inch","binance","exodus","mew_wallet","alphawallet","keyring_pro","mathwallet","unstoppable","obvious","ambire","internet_money_wallet","coin98","abc_wallet","arculus_wallet","haha","cling_wallet","broearn","copiosa","burrito_wallet","enjin_wallet","plasma_wallet","avacus","bee","pitaka","pltwallet","minerva","kryptogo","prema","slingshot","kriptonio","timeless","secux","bitizen","blocto","okx_wallet","safemoon","rabby_wallet","bybit_wallet","ronin_wallet","haha_wallet","privy","unknown","phantom","solflare","glow","backpack","jupiter","mobile_wallet_adapter"];function ure(t,e,n,r,i){var Ce,xe,Te,Et,Ke,Ge,nn,yr,gr,ve,et,rn,br,$n,$t,jr,ar,Mr,In,Tr,ln,Rt,Ht,wt,Ze,or,bn,Gt,_t,Zr,K,Q,le,ae,ce,ye,Pe,Re,it,bt,Ut,St,jt,Hn,ot,Nn,Jn,Fr,lr,en,Dn,cr,zr,ga,Vo,Ho,Wt,Un,Ct,wn,Wn,Dr,_n,xc;let s,a,o,l,u,f,p,y,g,b,v,_,C,S,x,A,I,$,O=n?console.warn:()=>{},P=[];if(e!=null&&e.loginMethods)for(let pn of(s=e.loginMethods.includes("email"),a=e.loginMethods.includes("sms"),l=e.loginMethods.includes("wallet"),u=e.loginMethods.includes("google"),f=e.loginMethods.includes("twitter"),p=e.loginMethods.includes("discord"),v=e.loginMethods.includes("spotify"),_=e.loginMethods.includes("instagram"),y=e.loginMethods.includes("tiktok"),g=e.loginMethods.includes("line"),b=e.loginMethods.includes("twitch"),S=e.loginMethods.includes("github"),C=e.loginMethods.includes("linkedin"),x=e.loginMethods.includes("apple"),A=e.loginMethods.includes("farcaster"),I=e.loginMethods.includes("telegram"),o=e.loginMethods.includes("passkey"),e.loginMethods))typeof pn=="string"&&pn.startsWith("privy:")&&P.push(pn);else s=t.email_auth,a=t.sms_auth,l=t.wallet_auth||t.solana_wallet_auth,u=t.google_oauth,f=t.twitter_oauth,p=t.discord_oauth,S=t.github_oauth,v=t.spotify_oauth,_=t.instagram_oauth,y=t.tiktok_oauth,g=t.line_oauth,b=t.twitch_oauth,C=t.linkedin_oauth,x=t.apple_oauth,A=t.farcaster_auth,I=t.telegram_auth||t.telegram_oauth,o=t.passkey_auth,$=t.custom_jwt_auth;t.passkey_auth&&(o=!0),typeof window<"u"&&typeof window.PublicKeyCredential!="function"&&(o=!1);
527let j=[s,a].filter(Boolean),U=[u,f,p,S,v,_,y,g,b,C,x,A,I].filter(Boolean),z=[l].filter(Boolean),D=((Ce=e==null?void 0:e.loginMethods)==null?void 0:Ce.includes("passkey"))??!1,R=t.passkeys_for_signup_enabled??!1,W=[o&&(R||D)].filter(Boolean),T=[$].filter(Boolean);if(j.length+U.length+z.length+W.length+T.length+P.length===0)throw Error("You must enable at least one login method");let L=((xe=e==null?void 0:e.appearance)==null?void 0:xe.showWalletLoginFirst)!==void 0?(Te=e==null?void 0:e.appearance)==null?void 0:Te.showWalletLoginFirst:t.show_wallet_login_first;L&&z.length===0?(O("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),L=!1):L||U.length+j.length!==0||(O("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),L=!0);let M=((Ke=(Et=e==null?void 0:e.externalWallets)==null?void 0:Et.walletConnect)==null?void 0:Ke.enabled)??!0;e!=null&&e.loginMethods&&e.loginMethodsAndOrder&&O("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let Z=DNe({input:(Ge=e==null?void 0:e.appearance)==null?void 0:Ge.walletList,overrides:e==null?void 0:e.loginMethodsAndOrder});if((Z.includes("wallet_connect_qr")||Z.includes("wallet_connect"))&&Z.includes("wallet_connect_qr_solana"))throw Error("wallet_connect_qr and wallet_connect_qr_solana cannot both be present in walletList due to WalletConnect session conflicts.");let H=(({input:pn})=>{if(!pn||!pn.primary[0])return;let si=[pn.primary[0]],Pi=[];for(let Bs of(pn.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`"),pn.primary.slice(1)))si.includes(Bs)?console.warn(`Duplicated login method: ${Bs}`):si.push(Bs);for(let Bs of pn.overflow??[])si.includes(Bs)||Pi.includes(Bs)?console.warn(`Duplicated login method: ${Bs}`):Pi.push(Bs);return{primary:si,overflow:Pi}})({input:e==null?void 0:e.loginMethodsAndOrder}),V=((nn=e==null?void 0:e.intl)==null?void 0:nn.defaultCountry)??"US",{chains:F,defaultChain:q}=(function({supportedChains:pn,defaultChainFromConfig:si}){let Pi;if(pn){if(pn.length===0)throw Error("`supportedChains` must contain at least one chain");Pi=SX(pn)}else Pi=[...M6];let Bs=pn?Pi[0]:pc,G2=si??Bs;if(!Pi.find((ip=>ip.id===G2.id)))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:Pi,defaultChain:G2}})({supportedChains:e==null?void 0:e.supportedChains,defaultChainFromConfig:e==null?void 0:e.defaultChain}),G=!!(e!=null&&e.defaultChain),Y=((yr=e==null?void 0:e.customAuth)==null?void 0:yr.getCustomAccessToken)&&((gr=e==null?void 0:e.customAuth)==null?void 0:gr.enabled)!==!1,X=Y?"all-users":t.embedded_wallet_config.ethereum.create_on_login,te=t.embedded_wallet_config.solana.create_on_login;t.solana_wallet_auth&&!((et=(ve=e==null?void 0:e.externalWallets)==null?void 0:ve.solana)!=null&&et.connectors)&&console.warn("App configuration has Solana wallet login enabled, but no Solana wallet connectors have been passed to Privy. Make sure to pass Solana connectors to the `config.externalWallets.solana.connectors` field of the `PrivyProvider`");let ie=t.telegram_auth_config?{botId:t.telegram_auth_config.bot_id,botName:t.telegram_auth_config.bot_name,linkEnabled:t.telegram_auth_config.link_enabled,seamlessAuthEnabled:t.telegram_auth_config.seamless_auth_enabled}:void 0,se=t.funding_config?{methods:t.funding_config.methods,options:t.funding_config.options,defaultRecommendedAmount:t.funding_config.default_recommended_amount,defaultRecommendedCurrency:t.funding_config.default_recommended_currency,promptFundingOnWalletCreation:t.funding_config.prompt_funding_on_wallet_creation,crossChainBridgingEnabled:t.funding_config.cross_chain_bridging_enabled}:void 0,pe=t.smart_wallet_config;return{id:t.id,appClientId:i,name:t.name,legalName:t.legal_name??null,scriptNonce:e==null?void 0:e.scriptNonce,allowlistConfig:{errorTitle:t.allowlist_config.error_title,errorDetail:t.allowlist_config.error_detail,errorCtaText:t.allowlist_config.cta_text,errorCtaLink:t.allowlist_config.cta_link},legacyWalletUiConfig:t.legacy_wallet_ui_config,appearance:{logo:((rn=e==null?void 0:e.appearance)==null?void 0:rn.logo)??t.logo_url??void 0,emailDomain:(br=e==null?void 0:e.appearance)==null?void 0:br.emailDomain,landingHeader:(($n=e==null?void 0:e.appearance)==null?void 0:$n.landingHeader)??Vd.appearance.landingHeader,loginMessage:typeof(($t=e==null?void 0:e.appearance)==null?void 0:$t.loginMessage)=="str
527ing"?(jr=e==null?void 0:e.appearance)==null?void 0:jr.loginMessage.slice(0,100):(ar=e==null?void 0:e.appearance)==null?void 0:ar.loginMessage,footerLogo:(Mr=e==null?void 0:e.appearance)==null?void 0:Mr.footerLogo,palette:VNe({backgroundTheme:((In=e==null?void 0:e.appearance)==null?void 0:In.theme)??Vd.appearance.theme,accentHex:((Tr=e==null?void 0:e.appearance)==null?void 0:Tr.accentColor)??t.accent_color}),loginGroupPriority:L?"web3-first":"web2-first",hideDirectWeb2Inputs:!!((ln=e==null?void 0:e.appearance)!=null&&ln.hideDirectWeb2Inputs),walletList:Z,walletChainType:((Rt=e==null?void 0:e.appearance)==null?void 0:Rt.walletChainType)??(({evmWalletAuth:pn,solanaWalletAuth:si})=>pn&&si?"ethereum-and-solana":pn?"ethereum-only":si?"solana-only":"ethereum-only")({evmWalletAuth:t.wallet_auth??!1,solanaWalletAuth:t.solana_wallet_auth??!1})},loginMethods:{wallet:l,email:s,sms:a,passkey:o,google:u,twitter:f,discord:p,github:S,spotify:v,instagram:_,tiktok:y,line:g,twitch:b,linkedin:C,apple:x,farcaster:A,telegram:I},globalDisablePasskeys:(e==null?void 0:e.globalDisablePasskeys)??!1,customOAuthProviders:(t.custom_oauth_providers??[]).filter((pn=>pn.enabled!==!1)),crossAppProviders:P,disablePlusEmails:t.disable_plus_emails,loginMethodsAndOrder:H,legal:{termsAndConditionsUrl:((Ht=e==null?void 0:e.legal)==null?void 0:Ht.termsAndConditionsUrl)??t.terms_and_conditions_url,privacyPolicyUrl:((wt=e==null?void 0:e.legal)==null?void 0:wt.privacyPolicyUrl)??t.privacy_policy_url,requireUsersAcceptTerms:t.require_users_accept_terms??!1},walletConnectCloudProjectId:(e==null?void 0:e.walletConnectCloudProjectId)??t.wallet_connect_cloud_project_id??Vd.walletConnectCloudProjectId,rpcConfig:{rpcUrls:{},rpcTimeouts:((Ze=e==null?void 0:e.externalWallets)==null?void 0:Ze.signatureRequestTimeouts)??{}},chains:F,defaultChain:q,intl:{defaultCountry:V,textLocalization:(or=e==null?void 0:e.intl)==null?void 0:or.textLocalization},shouldEnforceDefaultChainOnConnect:G,captcha:{enabledProvider:t.enabled_captcha_provider??null,siteKey:t.captcha_site_key},externalWallets:{coinbaseWallet:{config:{appName:t.name,appLogoUrl:t.logo_url,preference:{options:"all",...(_t=(Gt=(bn=e==null?void 0:e.externalWallets)==null?void 0:bn.coinbaseWallet)==null?void 0:Gt.config)==null?void 0:_t.preference},...(K=(Zr=e==null?void 0:e.externalWallets)==null?void 0:Zr.coinbaseWallet)==null?void 0:K.config}},baseAccount:{config:{appName:t.name,appLogoUrl:t.logo_url,...(le=(Q=e==null?void 0:e.externalWallets)==null?void 0:Q.baseAccount)==null?void 0:le.config,preference:{...(ye=(ce=(ae=e==null?void 0:e.externalWallets)==null?void 0:ae.baseAccount)==null?void 0:ce.config)==null?void 0:ye.preference,telemetry:!1}}},walletConnect:{enabled:M},solana:{connectors:(Re=(Pe=e==null?void 0:e.externalWallets)==null?void 0:Pe.solana)==null?void 0:Re.connectors},disableAllExternalWallets:((it=e==null?void 0:e.externalWallets)==null?void 0:it.disableAllExternalWallets)??!1},embeddedWallets:{requireUserOwnedRecoveryOnCreate:!Y&&(t.embedded_wallet_config.require_user_owned_recovery_on_create??!1),userOwnedRecoveryOptions:Y?["user-passcode"]:t.embedded_wallet_config.user_owned_recovery_options,priceDisplay:((bt=e==null?void 0:e.embeddedWallets)==null?void 0:bt.priceDisplay)??{primary:"fiat-currency",secondary:"native-token"},ethereum:{createOnLogin:((St=(Ut=e==null?void 0:e.embeddedWallets)==null?void 0:Ut.ethereum)==null?void 0:St.createOnLogin)??X},solana:{createOnLogin:((Hn=(jt=e==null?void 0:e.embeddedWallets)==null?void 0:jt.solana)==null?void 0:Hn.createOnLogin)??te},disableAutomaticMigration:((ot=e==null?void 0:e.embeddedWallets)==null?void 0:ot.disableAutomaticMigration)??!1,mode:t.embedded_wallet_config.mode,showWalletUIs:((Nn=e==null?void 0:e.embeddedWallets)==null?void 0:Nn.showWalletUIs)??t.enforce_wallet_uis??!0,extendedCalldataDecoding:((Jn=e==null?void 0:e.embeddedWallets)==null?void 0:Jn.extendedCalldataDecoding)??!1,transactionScanning:{enabled:((lr=(Fr=e==null?void 0:e.embeddedWallets)==null?void 0:Fr.transactionScanning)==null?void 0:lr.enabled)??!1,domain:((Dn=(en=e==null?void 0:e.embeddedWallets)==null?void 0:en.transactionScanning)==null?void 0:Dn.domain)??r??"https://auth.privy.io"}},mfa:{methods:(t.mfa_methods??[]).filter((pn=>HNe.includes(pn))),noPromptOnMfaRequired:((cr=e==null?void 0:e.mfa)==null?void 0:cr.noPromptOnMfaRequired)??!1},passkeys:{shouldUnlinkOnUnenrollMfa:(zr=e==null?void 0:e.passkeys)==null?void 0:zr.shouldUnlinkOnUnenrollMfa,shouldUnenrollMfaOnUnlink:(ga=e==null?void 0:e.passkeys)==null?void 0:ga.shouldUnenrollMfaOnUnlink,registration:(Vo=e==null?void 0:e.passkeys)==null?void 0:Vo.registration},customAuth:Y?{enabled:!0,...e.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:ie,telegramHasHmacCredentials:!!t.telegram_auth,telegramSeamlessAuthEnabled:!!t.telegram_seamless_auth_enabled,passkeysForSignupEnabled:t.passkeys_for_signup_enabled},headless:!!(e!=null&&e.headless),render:{standalone:((Ho=e==null?void 0:e._render)==null?void 0:Ho.standalone)??Vd._render.standalone},fundingConfig:se,fundingMethodConfig:{...(e==null?void 0:e.fundingMethodConfig)??Vd.fundingMethodConfig,moonpay:{...((Wt=e==null?void 0:e.fundingMethodConfig)==null?void 0:Wt.moonpay)??Vd.fundingMethodConfig.moonpay,useSandbox:((Un=e
527==null?void 0:e.fundingMethodConfig)==null?void 0:Un.moonpay.useSandbox)??Vd.fundingMethodConfig.moonpay.useSandbox}},whatsAppEnabled:!!t.whatsapp_enabled,customOAuthRedirectUrl:e==null?void 0:e.customOAuthRedirectUrl,allowOAuthInEmbeddedBrowsers:(e==null?void 0:e.allowOAuthInEmbeddedBrowsers)??!1,solanaRpcs:{"solana:mainnet":((wn=(Ct=e==null?void 0:e.solana)==null?void 0:Ct.rpcs)==null?void 0:wn["solana:mainnet"])??null,"solana:devnet":((Dr=(Wn=e==null?void 0:e.solana)==null?void 0:Wn.rpcs)==null?void 0:Dr["solana:devnet"])??null,"solana:testnet":((xc=(_n=e==null?void 0:e.solana)==null?void 0:_n.rpcs)==null?void 0:xc["solana:testnet"])??null},smartWallets:pe!=null&&pe.enabled?{enabled:pe.enabled,smartWalletVersion:pe.smart_wallet_version,smartWalletType:pe.smart_wallet_type,configuredNetworks:pe.configured_networks.map((pn=>({chainId:pn.chain_id,bundlerUrl:pn.bundler_url,paymasterUrl:pn.paymaster_url,paymasterContext:FNe(pn.paymaster_url,pn.paymaster_context)})))}:{enabled:(pe==null?void 0:pe.enabled)??!1},connectorsDebugLogs:(e==null?void 0:e.connectorsDebugLogs)??!1}}const dre={show_wallet_login_first:!0,allowlist_config:{error_title:null,error_detail:null,cta_text:null,cta_link:null},wallet_auth:!0,email_auth:!0,sms_auth:!1,google_oauth:!1,twitter_oauth:!1,discord_oauth:!1,github_oauth:!1,linkedin_oauth:!1,apple_oauth:!1,disable_plus_emails:!1,terms_and_conditions_url:null,privacy_policy_url:null,embedded_wallet_config:{create_on_login:"off",ethereum:{create_on_login:"off"},solana:{create_on_login:"off"},require_user_owned_recovery_on_create:!1,user_owned_recovery_options:["user-passcode"],mode:"user-controlled-server-wallets-only"},captcha_site_key:"",enforce_wallet_uis:!1,legacy_wallet_ui_config:!1,id:"",name:"",passkeys_for_signup_enabled:!1,whatsapp_enabled:!1};let Y7=N.createContext({appConfig:ure(dre,void 0,!1),isServerConfigLoaded:!1,initializationError:null,setInitializationError:()=>{}});const qNe=({children:t,client:e,legacyClient:n,clientConfig:r,appClientId:i})=>{let[s,a]=N.useState(null),[o,l]=N.useState(null),u=N.useMemo((()=>ure(s??dre,r,!!s,typeof window<"u"?window.location.origin:void 0,i)),[s,r,i]);return N.useEffect((()=>{if(!s)return;let f=(function(g){var A,I;if(!g)return{};let{appearance:b,scriptNonce:v,supportedChains:_,defaultChain:C,externalWallets:S,...x}=g;return{...x,..._?{supportedChains:_.map(($=>$.id))}:void 0,...C?{defaultChain:C.id}:void 0,...S?{walletConnect:S.walletConnect?{enabled:S.walletConnect.enabled}
527:void 0,coinbaseWallet:S.coinbaseWallet,solana:{connectors:(I=(A=S.solana)==null?void 0:A.connectors)==null?void 0:I.get().map(($=>$.walletClientType))}}:void 0}})(r),p=(function(g,b=0){let v=3735928559^b,_=1103547991^b;for(let C,S=0;S<g.length;S++)v=Math.imul(v^(C=g.charCodeAt(S)),2654435761),_=Math.imul(_^C,1597334677);return v=Math.imul(v^v>>>16,2246822507)^Math.imul(_^_>>>13,3266489909),4294967296*(2097151&(_=Math.imul(_^_>>>16,2246822507)^Math.imul(v^v>>>13,3266489909)))+(v>>>0)})(JSON.stringify(f)).toString(),y=`privy:sent:${s.id}:${p}`;localStorage.getItem(y)||(n.createAnalyticsEvent({eventName:"sdk_initialize",payload:f}),localStorage.setItem(y,"t"))}),[r,s]),N.useEffect((()=>{s||(async()=>{try{await e.initialize();let f=e.app.getConfig();f.custom_api_url&&n.updateApiUrl(f.custom_api_url),a(f)}catch(f){let p=f instanceof Error?f:Error(String(f));l(p),console.warn("Error generating app config: ",p)}})()}),[]),h.jsx(Y7.Provider,{value:{appConfig:u,isServerConfigLoaded:!!s,initializationError:o,setInitializationError:l},children:t})},Ts=()=>{let{appConfig:t}=N.useContext(Y7);return t},hre=()=>{let{isServerConfigLoaded:t}=N.useContext(Y7);return t},ZNe=()=>{let{initializationError:t,setInitializationError:e}=N.useContext(Y7);return{initializationError:t,setInitializationError:e}},KNe=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,GNe=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,YNe=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function JNe(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){XNe(t);return}return e}function XNe(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function fg(t,e={}){if(typeof t!="string")return t;if(t[0]==='"'&&t[t.length-1]==='"'&&t.indexOf("\\")===-1)return t.slice(1,-1);const n=t.trim();if(n.length<=9)switch(n.toLowerCase()){case"true":return!0;case"false":return!1;case"undefined":return;case"null":return null;case"nan":return Number.NaN;case"infinity":return Number.POSITIVE_INFINITY;case"-infinity":return Number.NEGATIVE_INFINITY}if(!YNe.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(KNe.test(t)||GNe.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,JNe)}return JSON.parse(t)}catch(r){if(e.strict)throw r;return t}}const QNe=/#/g,eOe=/&/g,tOe=/\//g,nOe=/=/g,uO=/\+/g,rOe=/%5e/gi,iOe=/%60/gi,sOe=/%7c/gi,aOe=/%20/gi;function oOe(t){return encodeURI(""+t).replace(sOe,"|")}function GT(t){return oOe(typeof t=="string"?t:JSON.stringify(t)).replace(uO,"%2B").replace(aOe,"+").replace(QNe,"%23").replace(eOe,"%26").replace(iOe,"`").replace(rOe,"^").replace(tOe,"%2F")}function TE(t){return GT(t).replace(nOe,"%3D")}function fre(t=""){try{return decodeURIComponent(""+t)}catch{return""+t}}function lOe(t){return fre(t.replace(uO," "))}function cOe(t){return fre(t.replace(uO," "))}function uOe(t=""){const e=Object.create(null);t[0]==="?"&&(t=t.slice(1));for(const n of t.split("&")){const r=n.match(/([^=]+)=?(.*)/)||[];if(r.length<2)continue;const i=lOe(r[1]);if(i==="__proto__"||i==="constructor")continue;const s=cOe(r[2]||"");e[i]===void 0?e[i]=s:Array.isArray(e[i])?e[i].push(s):e[i]=[e[i],s]}return e}function dOe(t,e){return(typeof e=="number"||typeof e=="boolean")&&(e=String(e)),e?Array.isArray(e)?e.map(n=>`${TE(t)}=${GT(n)}`).join("&"):`${TE(t)}=${GT(e)}`:TE(t)}function hOe(t){return Object.keys(t).filter(e=>t[e]!==void 0).map(e=>dOe(e,t[e])).filter(Boolean).join("&")}const fOe=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,pOe=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,mOe=/^([/\\]\s*){2,}[^/\\]/,yOe=/^\.?\//;function pre(t,e={}){return typeof e=="boolean"&&(e={acceptRelative:e}),e.strict?fOe.test(t):pOe.test(t)||(e.acceptRelative?mOe.test(t):!1)}function gOe(t="",e){return t.endsWith("/")}function bOe(t="",e){return(gOe(t)?t.slice(0,-1):t)||"/"}function wOe(t="",e){return t.endsWith("/")?t:t+"/"}function vOe(t,e){if(xOe(e)||pre(t))return t;const n=bOe(e);
527if(t.startsWith(n)){const r=t[n.length];if(!r||r==="/"||r==="?")return t}return EOe(n,t)}function _Oe(t,e){const n=SOe(t),r={...uOe(n.search),...e};return n.search=hOe(r),AOe(n)}function xOe(t){return!t||t==="/"}function COe(t){return t&&t!=="/"}function EOe(t,...e){let n=t||"";for(const r of e.filter(i=>COe(i)))if(n){const i=r.replace(yOe,"");n=wOe(n)+i}else n=r;return n}const mre=Symbol.for("ufo:protocolRelative");function SOe(t="",e){const n=t.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(n){const[,p,y=""]=n;return{protocol:p.toLowerCase(),pathname:y,href:p+y,auth:"",host:"",search:"",hash:""}}if(!pre(t,{acceptRelative:!0}))return EV(t);const[,r="",i,s=""]=t.replace(/\\/g,"/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[];let[,a="",o=""]=s.match(/([^#/?]*)(.*)?/)||[];r==="file:"&&(o=o.replace(/\/(?=[A-Za-z]:)/,""));const{pathname:l,search:u,hash:f}=EV(o);return{protocol:r.toLowerCase(),auth:i?i.slice(0,Math.max(0,i.length-1)):"",host:a,pathname:l,search:u,hash:f,[mre]:!r}}function EV(t=""){const[e="",n="",r=""]=(t.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:e,search:n,hash:r}}function AOe(t){const e=t.pathname||"",n=t.search?(t.search.startsWith("?")?"":"?")+t.search:"",r=t.hash||"",i=t.auth?t.auth+"@":"",s=t.host||"";return(t.protocol||t[mre]?(t.protocol||"")+"//":"")+i+s+e+n+r}class yre extends Error{constructor(e,n){super(e,n),this.name="FetchError",n!=null&&n.cause&&!this.cause&&(this.cause=n.cause)}}function kOe(t){var l,u,f,p,y;const e=((l=t.error)==null?void 0:l.message)||((u=t.error)==null?void 0:u.toString())||"",n=((f=t.request)==null?void 0:f.method)||((p=t.options)==null?void 0:p.method)||"GET",r=((y=t.request)==null?void 0:y.url)||String(t.request)||"/",i=`[${n}] ${JSON.stringify(r)}`,s=t.response?`${t.response.status} ${t.response.statusText}`:"<no response>",a=`${i}: ${s}${e?` ${e}`:""}`,o=new yre(a,t.error?{cause:t.error}:void 0);for(const g of["request","options","response"])Object.defineProperty(o,g,{get(){return t[g]}});for(const[g,b]of[["data","_data"],["status","status"],["statusCode","status"],["statusText","statusText"],["statusMessage","statusText"]])Object.defineProperty(o,g,{get(){return t.response&&t.response[b]}});return o}const TOe=new Set(Object.freeze(["PATCH","POST","PUT","DELETE"]));function SV(t="GET"){return TOe.has(t.toUpperCase())}function LOe(t){if(t===void 0)return!1;const e=typeof t;return e==="string"||e==="number"||e==="boolean"||e===null?!0:e!=="object"?!1:Array.isArray(t)?!0:t.buffer||t instanceof FormData||t instanceof URLSearchParams?!1:t.constructor&&t.constructor.name==="Object"||typeof t.toJSON=="function"}const $Oe=new Set(["image/svg","application/xml","application/xhtml","application/html"]),IOe=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function NOe(t=""){if(!t)return"json";const e=t.split(";").shift()||"";return IOe.test(e)?"json":e==="text/event-stream"?"stream":$Oe.has(e)||e.startsWith("text/")?"text":"blob"}function OOe(t,e,n,r){const i=POe((e==null?void 0:e.headers)??(t==null?void 0:t.headers),n==null?void 0:n.headers,r);let s;return(n!=null&&n.query||n!=null&&n.params||e!=null&&e.params||e!=null&&e.query)&&(s={...n==null?void 0:n.params,...n==null?void 0:n.query,...e==null?void 0:e.params,...e==null?void 0:e.query}),{...n,...e,query:s,params:s,headers:i}}function POe(t,e,n){if(!e)return new n(t);const r=new n(e);if(t)for(const[i,s]of Symbol.iterator in t||Array.isArray(t)?t:new n(t))r.set(i,s);return r}async function O4(t,e){if(e)if(Array.isArray(e))for(const n of e)await n(t);else await e(t)}const ROe=new Set([408,409,425,429,500,502,503,504]),jOe=new Set([101,204,205,304]);function gre(t={}){const{fetch:e=globalThis.fetch,Headers:n=globalThis.Headers,AbortController:r=globalThis.AbortController}=t;async function i(o){const l=o.error&&o.error.name==="AbortError"&&!o.options.timeout||!1;if(o.options.retry!==!1&&!l){let f;typeof o.options.retry=="number"?f=o.options.retry:f=SV(o.options.method)?0:1;const p=o.response&&o.response.status||500;if(f>0&&(Array.isArray(o.options.retryStatusCodes)?o.options.retryStatusCodes.includes(p):ROe.has(p))){const y=typeof o.options.retryDelay=="function"?o.options.retryDelay(o):o.options.retryDelay||0;return y>0&&await new Promise(g=>setTimeout(g,y)),s(o.request,{...o.options,retry:f-1})}}const u=kOe(o);throw Error.captureStackTrace&&Error.captureStackTrace(u,s),u}const s=async function(l,u={}){const f={request:l,options:OOe(l,u,t.defaults,n),response:void 0,error:void 0};if(f.options.method&&(f.options.method=f.options.method.toUpperCase()),f.options.onRequest&&(await O4(f,f.options.onRequest),f.options.headers instanceof n||(f.options.headers=new n(f.o
527ptions.headers||{}))),typeof f.request=="string"&&(f.options.baseURL&&(f.request=vOe(f.request,f.options.baseURL)),f.options.query&&(f.request=_Oe(f.request,f.options.query),delete f.options.query),"query"in f.options&&delete f.options.query,"params"in f.options&&delete f.options.params),f.options.body&&SV(f.options.method))if(LOe(f.options.body)){const g=f.options.headers.get("content-type");typeof f.options.body!="string"&&(f.options.body=g==="application/x-www-form-urlencoded"?new URLSearchParams(f.options.body).toString():JSON.stringify(f.options.body)),g||f.options.headers.set("content-type","application/json"),f.options.headers.has("accept")||f.options.headers.set("accept","application/json")}else("pipeTo"in f.options.body&&typeof f.options.body.pipeTo=="function"||typeof f.options.body.pipe=="function")&&("duplex"in f.options||(f.options.duplex="half"));let p;if(!f.options.signal&&f.options.timeout){const g=new r;p=setTimeout(()=>{const b=new Error("[TimeoutError]: The operation was aborted due to timeout");b.name="TimeoutError",b.code=23,g.abort(b)},f.options.timeout),f.options.signal=g.signal}try{f.response=await e(f.request,f.options)}catch(g){return f.error=g,f.options.onRequestError&&await O4(f,f.options.onRequestError),await i(f)}finally{p&&clearTimeout(p)}if((f.response.body||f.response._bodyInit)&&!jOe.has(f.response.status)&&f.options.method!=="HEAD"){const g=(f.options.parseResponse?"json":f.options.responseType)||NOe(f.response.headers.get("content-type")||"");switch(g){case"json":{const b=await f.response.text(),v=f.options.parseResponse||fg;f.response._data=v(b);break}case"stream":{f.response._data=f.response.body||f.response._bodyInit;break}default:f.response._data=await f.response[g]()}}return f.options.onResponse&&await O4(f,f.options.onResponse),!f.options.ignoreResponseError&&f.response.status>=400&&f.response.status<600?(f.options.onResponseError&&await O4(f,f.options.onResponseError),await i(f)):f.response},a=async function(l,u){return(await s(l,u))._data};return a.raw=s,a.native=(...o)=>e(...o),a.create=(o={},l={})=>gre({...t,...l,defaults:{...t.defaults,...l.defaults,...o}}),a}const Q8=(function(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")})(),MOe=Q8.fetch?(...t)=>Q8.fetch(...t):()=>Promise.reject(new Error("[ofetch] global.fetch is not supported!")),DOe=Q8.Headers,UOe=Q8.AbortController,BOe=gre({fetch:MOe,Headers:DOe,AbortController:UOe});var ft;let V2=class extends Error{toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}constructor(e,n,r){super(e),n instanceof Error&&(this.cause=n),this.privyErrorCode=r}},ev=class extends V2{constructor(e,n,r,i,s,a){super(r,i,s),this.type=e,this.status=n,this.data=a}},ue=class extends V2{constructor(e,n,r){super(e,n,r),this.type="client_error"}},FOe=class extends ue{constructor(){super("Request timed out",void 0,"client_request_timeout")}},Sr=class extends V2{constructor(e,n,r){super(e,n,r),this.type="connector_error"}};const vn=t=>{if(t instanceof V2)return t;if(!(t instanceof yre))return Nr(t);if(!t.response)return new ev("api_error",null,t.message,t);let{type:e,message:n,error:r,code:i}=t.data;return new ev(e||"ApiError",t.response.status,n||r,t,i,t.data)},Nr=t=>t instanceof V2?t:t instanceof Error?new ue(t.message,t):new ue(`Internal error: ${t}`);var Oe=((ft={}).OAUTH_ACCOUNT_SUSPENDED="oauth_account_suspended",ft.MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",ft.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",ft.MISSING_OR_INVALID_TOKEN="missing_or_invalid_token",ft.INVALID_DATA="invalid_data",ft.INVALID_CAPTCHA="invalid_captcha",ft.LINKED_TO_ANOTHER_USER="linked_to_another_user",ft.CANNOT_LINK_MORE_OF_TYPE="cannot_link_more_of_type",ft.FAILED_TO_LINK_ACCOUNT="failed_to_link_account",ft.FAILED_TO_UPDATE_ACCOUNT="failed_to_update_account",ft.USER_EXITED_UPDATE_FLOW="exited_update_flow",ft.ALLOWLIST_REJECTED="allowlist_rejected",ft.OAUTH_USER_DENIED="oauth_user_denied",ft.OAUTH_UNEXPECTED="oauth_unexpected",ft.UNKNOWN_AUTH_ERROR="unknown_auth_error",ft.USER_EXITED_AUTH_FLOW="exited_auth_flow",ft.USER_EXITED_LINK_FLOW="exited_link_flow",ft.USER_EXITED_SET_PASSWORD_FLOW="user_exited_set_password_flow",ft.MUST_BE_AUTHENTICATED="must_be_authenticated",ft.UNKNOWN_CONNECT_WALLET_ERROR="unknown_connect_wallet_error",ft.GENERIC_CONNECT_WALLET_ERROR="generic_connect_wallet_error",ft.CLIENT_REQUEST_TIMEOUT="client_request_timeout",ft.INVALID_CREDENTIALS="invalid_credentials",ft.MISSING_MFA_CREDENTIALS="missing_or_invalid_mfa",ft.UNKNOWN_MFA_ERROR="unknown_mfa_error",ft.EMBEDDED_WALLET_ALREADY_EXISTS="embedded_wallet_already_exists",ft.EMBEDDED_WALLET_NOT_FOUND="embedded_wallet_not_found",ft.EMBEDDED_WALLET_CREATE_ERROR="embedded_wallet_create_error",ft.UNKNOWN_EMBEDDED_WALLET_ERROR="unknown_embedded_wallet_error",ft.EMBEDDED_WALLET_PASSWORD_UNCONFIRMED="embedded_wallet_password_unconfirmed",ft.EMBEDDED_WALLET_PASSWORD_ALREADY_EXISTS="embedded_wallet_password_already_exists",ft.EMBEDDED_WALLET_RECOVERY_ALREADY_EXISTS="embedded_wallet_recovery_already_exists",ft.TRANSACTION_FAILURE="transaction_failure",ft.UNSUPPORTED_CHAIN_ID="unsupported_chain_id",ft.NOT_SUPPORTED="not_supported",ft.CAPTCHA_TIMEOUT="captcha_timeout",ft.INVALID_MESSAGE="invalid_message",ft.UNABLE_TO_SIGN="unable_to_sign",ft.CAPTCHA_FAILURE="captcha_failure",ft.CAPTCHA_DISABLED="captcha_disabled",ft.SESSION_STORAGE_UNAVAILABLE="session_storage_unavailable",ft.TOO_MANY_REQUESTS="too_many_requests",ft.USER_LIMIT_REACHED="max_accounts_reached",ft.DISALLOWED_LOGIN_METHOD="disallowed_login_method",ft.DISALLOWED_PLUS_EMAIL="disallowed_plus_email",ft.PASSKEY_NOT_ALLOWED="passkey_not_allowed",ft.USER_DOES_NOT_EXIST="user_does_not_exist",ft.INSUFFICIENT_BALANCE="insufficient_balance",ft.ONRAMP_MINIMUM_IDENTITY_VERIFICATION_REQUIRED="onramp_minimum_identity_verification_required",ft.ONRAMP_IDENTITY_VERIFICATION_REQUIRED="onramp_identity_verification_required",ft.ONRAMP_DOCUMENT_VERIFICATION_REQUIRED="onramp_document_verification_required",ft.ONRAMP_UNSUPPORTED_INFORMATION="onramp_unsupported_information",ft.ONRAMP_TRANSACTION_LIMIT_REACHED="transaction_limit_reached",ft.ONRAMP_QUOTE_EXPIRED="onramp_quote_expired",ft.ACCOUNT_TRANSFER_REQUIRED="account_transfer_required",ft.BUFFER_NOT_DEFINED="buffer_not_defined",ft.UNSUPPORTED_WALLET_TYPE="unsupported_wallet_type",ft.NO_SOLANA_ACCOUNTS="no_solana_accounts",ft.UNKNOWN_FUNDING_ERROR="unknown_funding_error",ft);let bh=class extends ue{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},P6t=class extends ue{constructor(e="Embedded wallet error",n){super(e,n,"unknown_embedded_wallet_error")}},j6t=class extends ue{constructor(e="User must be authenticated"){super(e,void 0,"must_be_authenticated")}},D6t=class extends ue{constructor(e){super("This application is in development mode and must be upgraded to production to log in new users.",e,"max_accounts_reached")}},AV=class extends Sr{constructor(){super("No Solana accounts found in wallet",void 0,"no_solana_accounts")}};const tv=(t,e,n,r)=>{let i=Number(t),s=e.find((o=>o.id===i));if(!s)throw new Sr(`Unsupported chainId ${t}`,4901);let a=bre(s,n,r.appId);if(i===uf.id||i===q3.id){let o=i===uf.id?uf:q3;return B3({transport:y1(a),chain:o})}return B3({transport:y1(a),chain:s})},bre=(t,e,n)=>{var a,o,l;let r,i=t.id,s=Number(t.id);if(t.rpcUrls.privyWalletOverride&&t.rpcUrls.privyWalletOverride.http[0])r=t.rpcUrls.privyWalletOverride.http[0];else if(e.rpcUrls&&e.rpcUrls[s])r=e.rpcUrls[s];else if((a=t.rpcUrls.privy)!=null&&a.http[0]){let u=new URL(t.rpcUrls.privy.http[0]);u.searchParams.append("privyAppId",n),r=u.toString()}else r=(o=t.rpcUrls.public)!=null&&o.http[0]?t.rpcUrls.public.http[0]:(l=t.rpcUrls.default)==null?void 0:l.http[0];if(!r)throw new Sr(`No RPC url found for ${i}`);return r},wre=t=>t.isApexWallet?"Apex Wallet":t.isAvalanche?"Core Wallet":t.isBackpack?"Backpack":t.isBifrost?"Bifrost Wallet":t.isBitKeep?"BitKeep":t.isBitski?"Bitski":t.isBlockWallet?"BlockWallet":t.isBraveWallet?"Brave Wallet":t.isClover?"Clover":t.isCoin98?"Coin98 Wallet":t.isCoinbaseWallet?"Coinbase Wallet":t.isDawn?"Dawn Wallet":t.isDefiant?"Defiant":t.isDesig?"Desig Wallet":t.isEnkrypt?"Enkrypt":t.isExodus?"Exodus":t.isFordefi?"Fordefi":t.isFrame?"Frame":t.isFrontier?"Frontier Wallet":t.isGamestop?"GameStop Wallet":t.isHaqqWallet?"HAQQ Wallet":t.isHyperPay?"HyperPay Wallet":t.isImToken?"ImToken":t.isHaloWallet?"Halo Wallet":t.isKuCoinWallet?"KuCoin Wallet":t.isMathWallet?"MathWallet":t.isNovaWallet?"Nova Wallet":t.isOkxWallet||t.isOKExWallet?"OKX Wallet":t.isOneInchIOSWallet||t.isOneInchAndroidWallet?"1inch Wallet":t.isOneKey?"OneKey Wallet":t.isOpera?"Opera":t.isPhantom||"isPhantom"in t?"Phantom":t.isPortal?"Ripio Portal":t.isRabby?"Rabby Wallet":t.isRainbow?"Rainbow":t.isSafePal?"SafePal Wallet":t.isStatus?"Status":t.isSubWallet?"SubWallet":t.isTalisman?"Talisman":t.isTally||t.isTaho?"Taho":t.isTokenPocket?"TokenPocket":t.isTokenary?"Tokenary":t.isTrust||t.isTrustWallet?"Trust Wallet":t.isTTWallet?"TTWallet":t.isXDEFI?"XDEFI Wallet":t.isZeal?"Zeal":t.isZerion?"Zerion":t.isMetaMask?"MetaMask":void 0,vre=(t,e)=>{if(!t.isMetaMask)return!1;if(t.isMetaMask&&!e)return!0;
527if(t.isBraveWallet&&!t._events&&!t._state||wre(t)!=="MetaMask")return!1;if(t.providers){for(let n of t.providers)if(!vre(n))return!1}return!0},F6t=()=>{let t=window;if(!t.ethereum)return!1;if(t.ethereum.isCoinbaseWallet)return!0;if(t.ethereum.providers){for(let e of t.ethereum.providers)if(e&&e.isCoinbaseWallet)return!0}return!1},z6t=(t,e)=>{let n=[],r=[];for(let[i,s]of t.entries())i<e?n.push(s):r.push(s);return[n,r]},V6t=t=>!!String(t).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),H6t=(t,e)=>{let n=t.slice(0),r=[];for(;n.length;)r.push(n.splice(0,e));return r},zOe=(t,e=3,n=4,r="ethereum")=>{if(!t)return"";let i=r==="ethereum"?2:0;return e+n+i+3>=t.length?t:`${t.slice(0,i+e)}...${t.slice(t.length-n,t.length)}`},W6t=(t,e=3,n=4)=>zOe(t,e,n,"solana"),nv=t=>new Promise((e=>setTimeout(e,t)));function kV(t,{interval:e=100,timeout:n=5e3}={}){return new Promise(((r,i)=>{let s,a=0,o=()=>{a>=n?i("Max attempts reached without result"):(s=t(),a+=e,s==null?setTimeout(o,e):r(s))};o()}))}const YT=(t,e={})=>{let n=e.delayMs||150,r=e.maxAttempts||270;return new Promise((async(i,s)=>{var l;let a=!1,o=0;for(;!a&&o<r;){if((l=e.abortSignal)!=null&&l.aborted)return;t().then((u=>{a=!0,i(u)}),((...u)=>{a=!0,s(...u)})),o+=1,await nv(n)}a||s(Error("Exceeded max attempts before resolving function"))}))},VOe=t=>t.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),P4=t=>typeof t=="string"?t:"0x"+t.toString(16);async function HOe({store:t,walletList:e,externalWalletConfig:n,walletChainType:r,timeout:i=3e3}){let s=!1,a=window;return new Promise((o=>{function l(){if(s)return;s=!0,window.removeEventListener("ethereum#initialized",l);let u=t.getProviders();console.debug("Detected injected providers:",u.map((p=>p.info)));let f=[];for(let p of u)e.includes("coinbase_wallet")&&p.info.rdns==="com.coinbase.wallet"||r==="solana-only"&&p.info.rdns==="app.phantom"||f.push({type:p.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:p});if(r!=="solana-only")for(let p of(function(){var v;let y=window,g=y.ethereum;if(!g)return[];let b=[];if((v=g.providers)!=null&&v.length)for(let _ of g.providers)_&&b.push(_);return b.push(y.ethereum),b})()){let y=wre(p);if(!u.some((g=>g.info.name===y))){if(vre(p,!0)&&!f.find((g=>g.type==="metamask"))){f.push({type:"metamask",legacyInjectedProvider:p});continue}if(y==="Phantom"&&!f.find((g=>g.type==="phantom"))){f.push({type:"phantom",legacyInjectedProvider:p});continue}if(y==="Coinbase Wallet"&&!f.find((g=>{var b,v,_;return g.type==="coinbase_wallet"&&((_=(v=(b=n.coinbaseWallet)==null?void 0:b.config)==null?void 0:v.preference)==null?void 0:_.options)!=="smartWalletOnly"}))){f.push({type:"coinbase_wallet",legacyInjectedProvider:p});continue}f.find((g=>g.type==="unknown_browser_extension"))||f.push({type:"unknown_browser_extension",legacyInjectedProvider:p})}}o(f)}a.ethereum?l():(window.addEventListener("ethereum#initialized",l,{once:!0}),setTimeout((()=>{l()}),i))}))}function Pg(t){return`eip155:${String(Number(t))}`}const WOe=(t,e,n,r)=>{let i=Number(t),s=e.find((a=>a.id===i));if(!s)throw new Sr(`Unsupported chainId ${t}`,4901);return bre(s,n,r)},q6t=(t,e)=>{var i;let n=Number(t),r=e.find((s=>s.id===n));if(!r)throw new Sr(`Unsupported chainId ${t}`,4901);return(i=r.blockExplorers)==null?void 0:i.default.url},rv=t=>{let e={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},n=t.types.EIP712Domain??Object.entries(t.domain).map((([r,i])=>{if(i!=null&&typeof r=="string"&&r in e)return{name:r,type:e[r]}})).filter((r=>r!==void 0));return{...t,types:{...t.types,EIP712Domain:n}}};function Z6t(t,{min:e,max:n}){return Math.min(Math.max(t,e),n)}const TV=t=>t==null?void 0:t.map((e=>({signer_id:e.signerId,override_policy_ids:e.policyIds})));let _re=class{get(e){let n=localStorage.getItem(e);return n===null?void 0:JSON.parse(n)}put(e,n){n!==void 0?localStorage.setItem(e,JSON.stringify(n)):this.del(e)}del(e){localStorage.removeItem(e)}getKeys(){return Object.entries(localStorage).map((([e])=>e))}};function JT(){try{let t="privy:__session_storage__test",e=new _re;return e.put(t,"blobby"),e.del(t),!0}catch{return!1}}var vt=typeof window<"u"&&window.localStorage?new _re:new class{get(t){return this._cache[t]}put(t,e){e!==void 0?this._cache[t]=e:this.del(t)}del(t){delete this._cache[t]}getKeys(){return Object.keys(this._cache)}constructor(){this._cache={}}};let R4="[Privy:Connectors]";function j4(t){if(!t||Object.keys(t).length===0)return"";let e=Object.entries(t).filter((([,n])=>n!=null)).map((([n,r])=>`${n}=${String(r)}`));return e.length>0?` (${e.join(", ")})`:""}const Ue=new class{setEnabled(t){this._enabled=t,t&&this.info("Debug logging enabled")}get enabled(){return this._enabled}debug(t,e){this._enabled&&console.debug(`${R4} ${t}${j4(e)}`)}info(t,e){this._enabled&&console.info(`${R4} ${t}${j4(e)}`)}warn(t,e){this._enabled&&console.warn(`${R4} ${t}${j4(e)}`)}error(t,e,n){if(!this._enabled)return;
527let r=e instanceof Error?e.message:e?String(e):void 0,i=r?{...n,error:r}:n;console.error(`${R4} ${t}${j4(i)}`)}connectionStart(t,e,n){this.info("Connection attempt started",{wallet:t,method:e,...n})}connectionSuccess(t,e){this.info("Connection successful",{wallet:t,...e})}connectionFailed(t,e,n){this.error("Connection failed",e,{wallet:t,...n})}connectorInit(t,e,n){this.debug("Connector initialized",{connector:t,wallet:e,...n})}connectorCreated(t,e,n){this.debug("Connector created",{connector:t,wallet:e,...n})}providerEvent(t,e,n){this.debug(`Provider event: ${t}`,{wallet:e,...n})}rpcRequest(t,e,n){this.debug(`RPC request: ${t}`,{wallet:e,...n})}rpcResponse(t,e,n){this.debug(`RPC response: ${t}`,{wallet:e,...n})}constructor(){this._enabled=!1}};let qOe=class extends Sr{constructor(){super("Wallet timeout"),this.type="wallet_error",Ue.warn("Wallet request timed out")}};const H2=t=>{if(t instanceof Sr)return Ue.debug("Connector error (already formatted)",{error:t.message}),t;if(typeof(t==null?void 0:t.code)=="number"){let n=new Fl(t);return Ue.debug("Provider RPC error",{code:n.code,error:n.message}),n}let e=t instanceof Error?t.message:String(t);return Ue.debug("Unknown connector error",{error:e}),new Sr(e||"Unknown connector error",t)};let ZOe=class extends V2{constructor(e,n,r){super(e),this.type="provider_error",this.code=n,this.data=r}},Fl=class extends ZOe{constructor(e){var r,i,s;super(e.message,e.code,e.data);let n=Object.values(_0).find((a=>a.eipCode===e.code));this.details=n||_0.UNKNOWN_ERROR,e.code===-32002&&((r=e.message)!=null&&r.includes("already pending for origin")?(i=e.message)!=null&&i.includes("wallet_requestPermissions")?this.details=_0.E32002_CONNECTION_ALREADY_PENDING:this.details=_0.E32002_REQUEST_ALREADY_PENDING:(s=e.message)!=null&&s.includes("Already processing")&&e.message.includes("eth_requestAccounts")&&(this.details=_0.E32002_WALLET_LOCKED))}};const X6t={ERROR_USER_EXISTS:{message:"User already exists for this address",detail:"Try another address!",retryable:!1},ERROR_TIMED_OUT:{message:"Wallet request timed out",detail:"Please try connecting again.",retryable:!0},ERROR_WALLET_CONNECTION:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0},ERROR_USER_LIMIT_REACHED:{message:"Unable to link",detail:"You've reached the maximum number of linked wallets.",retryable:!1},..._0};let xre=class extends qf{constructor(e){super(),this.walletClientType=e,this.connected=!1,this.initialized=!1}};const dO=()=>{let t=vt.get(cre);return t&&Array.isArray(t)&&t.map((e=>(n=>n&&typeof n.address=="string"&&typeof n.connectorType=="string"&&typeof n.walletClientType=="string"&&typeof n.connectedAt=="number")(e))).every(Boolean)?t:[]};let KOe=["phantom","glow","solflare","backpack","okx_wallet","walletconnect","mobile_wallet_adapter","jupiter","tokenpocket"];function GOe(t){return t.toLowerCase().split(" ").join("_")}let YOe=class extends xre{get isInstalled(){return!0}get wallet(){return this._wallet}buildConnectedWallet(){return this._wallet.accounts.map((e=>({type:"solana",provider:new qIe({wallet:this._wallet,account:e}),address:e.address,connectedAt:Date.now(),walletClientType:this._wallet.name,connectorType:this.connectorType,imported:!1,meta:{name:this._wallet.name,id:this._wallet.name,icon:this._wallet.icon},isConnected:async()=>this._wallet.accounts.length>0,disconnect:async()=>{await this.disconnect()}})))}async syncAccounts(){this.wallets=this.buildConnectedWallet(),this.emit("walletsUpdated")}get walletBranding(){return{id:LV(this.wallet)?"walletconnect_solana":this.wallet.name,name:this.wallet.name,icon:this.wallet.icon}}async initialize(){var e;Ue.debug("Initializing Solana connector",{wallet:this.walletClientType}),this.subscribeListeners(),await this.syncAccounts(),this.shouldAttemptAutoConnect()&&(Ue.debug("Attempting Solana auto-connect",{wallet:this.walletClientType}),await((e=this.wallet.features["standard:connect"])==null?void 0:e.connect({silent:!0}).catch((()=>{}))),await this.isConnected()&&(Ue.debug("Solana auto-connect successful",{wallet:this.walletClientType}
527),await this.syncAccounts())),this.initialized=!0,this.emit("initialized")}async connect(e){if(Ue.connectionStart(this.walletClientType,"solana_adapter",{showPrompt:e.showPrompt}),e.showPrompt)try{await this.promptConnection()}catch(r){throw this._wallet.accounts.length===0?(Ue.warn("Solana wallet connected but has no accounts",{wallet:this.walletClientType}),new AV):(Ue.connectionFailed(this.walletClientType,r,{method:"solana_adapter"}),r)}if(!await this.isConnected())throw Ue.warn("Solana wallet not connected after prompt",{wallet:this.walletClientType}),new AV;await this.syncAccounts();let n=await this.getConnectedWallet();return n&&Ue.connectionSuccess(this.walletClientType),n}async getConnectedWallet(){return this.wallets.sort(((e,n)=>n.connectedAt-e.connectedAt))[0]||null}async isConnected(){return this._wallet.accounts.length>0}subscribeListeners(){var e;this._unsubscribeListeners=(e=this.wallet.features["standard:events"])==null?void 0:e.on("change",this.onChange)}unsubscribeListeners(){var e;(e=this._unsubscribeListeners)==null||e.call(this)}shouldAttemptAutoConnect(){return!(!this.autoConnectEnabled||!KOe.includes(this.walletClientType))&&(this.walletClientType!=="phantom"||dO().some((({walletClientType:e})=>e==="phantom")))}constructor(e,n){super(GOe(LV(e)?"walletconnect_solana":e.name)),this.chainType="solana",this.connectorType="solana_adapter",this.disconnect=async()=>{var r;Ue.debug("Disconnecting Solana wallet",{wallet:this.walletClientType}),await((r=this.wallet.features["standard:disconnect"])==null?void 0:r.disconnect().catch((i=>{Ue.error("Error disconnecting Solana wallet",i,{wallet:this.walletClientType})}))),await this.syncAccounts()},this.promptConnection=async()=>{var r;Ue.debug("Prompting Solana connection",{wallet:this.walletClientType});try{await((r=this.wallet.features["standard:connect"])==null?void 0:r.connect())}catch(i){throw Ue.connectionFailed(this.walletClientType,i,{method:"solana_adapter"}),H2(i)}},this.onChange=()=>{this.syncAccounts()},this._wallet=e,this.autoConnectEnabled=n,this.wallets=[]}};function LV(t){return"isWalletConnectSolana"in t&&t.isWalletConnectSolana}const t5t=({style:t,...e})=>{let n=Ts();return h.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...t},...e,children:[h.jsx("rect",{width:"28",height:"28",rx:"3",fill:(n==null?void 0:n.appearance.palette.colorScheme)==="dark"?"#3396ff":"#141414"}),h.jsx("g",{clipPath:"url(#clip0_1765_9946)",children:h.jsx("path",{d:"M8.09448 10.3941C11.3558 7.20196 16.6442 7.20196 19.9055 10.3941L20.2982 10.7782C20.3369 10.8157 20.3677 10.8606 20.3887 10.9102C20.4097 10.9599 20.4206 11.0132 20.4206 11.0671C20.4206 11.121 20.4097 11.1744 20.3887 11.224C20.3677 11.2737 20.3369 11.3186 20.2982 11.3561L18.9554 12.6702C18.9158 12.7086 18.8628 12.7301 18.8077 12.7301C18.7526 12.7301 18.6996 12.7086 18.66 12.6702L18.1198 12.1415C15.8448 9.91503 12.1557 9.91503 9.88015 12.1415L9.30167 12.7075C9.26207 12.7459 9.20909 12.7673 9.15395 12.7673C9.0988 12.7673 9.04582 12.7459 9.00622 12.7075L7.66346 11.3934C7.62475 11.3559 7.59397 11.3109 7.57295 11.2613C7.55193 11.2117 7.5411 11.1583 7.5411 11.1044C7.5411 11.0505 7.55193 10.9971 7.57295 10.9475C7.59397 10.8979 7.62475 10.8529 7.66346 10.8154L8.09448 10.3941ZM22.6829 13.1115L23.8776 14.2814C23.9163 14.319 23.9471 14.3639 23.9681 14.4135C23.9892 14.4632 24 14.5165 24 14.5704C24 14.6243 23.9892 14.6777 23.9681 14.7273C23.9471 14.777 23.9163 14.8219 23.8776 14.8594L18.4893 20.1332C18.4102 20.2101 18.3042 20.2531 18.1938 20.2531C18.0835 20.2531 17.9775 20.2101 17.8984 20.1332L14.0743 16.3901C14.0545 16.3708 14.0279 16.36 14.0003 16.36C13.9726 16.36 13.9461 16.3708 13.9263 16.3901L10.1021 20.1332C10.023 20.2101 9.91703 20.2531 9.8067 20.2531C9.69636 20.2531 9.59038 20.2101 9.51124 20.1332L4.12236 14.8594C4.08365 14.8219 4.05287 14.777 4.03185 14.7273C4.01083 14.6777 4 14.6243 4 14.5704C4 14.5165 4.01083 14.4632 4.03185 14.4135C4.05287 14.3639 4.08365 14.319 4.12236 14.2814L5.31767 13.1115C5.39678 13.0348 5.50265 12.9919 5.61285 12.9919C5.72305 12.9919 5.82892 13.0348 5.90803 13.1115L9.73216 16.8546C9.75194 16.874 9.7785 16.8848 9.80616 16.8848C9.83381 16.8848 9.86037 16.874 9.88015 16.8546L13.7043 13.1115C13.7834 13.0346 13.8894 12.9916 13.9997 12.9916C14.1101 12.9916 14.216 13.0346 14.2952 13.1115L18.1198 16.8546C18.1396 16.874 18.1662 16.8848 18.1938 16.8848C18.2215 16.8848 18.2481 16.874 18.2678
52716.8546L22.092 13.1115C22.1711 13.0346 22.2771 12.9916 22.3874 12.9916C22.4977 12.9916 22.6037 13.0346 22.6829 13.1115Z",fill:"white"})}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_1765_9946",children:h.jsx("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})},JOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAHdElNRQfoDAIVODUC+w+GAAAGsUlEQVRYw6WXbYwWVxXHf+fOLAtCXYS2QJdIaClipGCTknXXNqBQMVHbfmhItH4Aral+IAEaG03UxJgYKQJGTUxtDWjaxDSNtcZqIGDwpRuW1oYiVqpdpZSlpC3qysu+PHPP3w/3mXnmeXZbPzjJZO7cefn/z/mfe865xlscq3dGDIguGiHLaMQVLja4s87FShcLo5jtApdddnHexUmHIy475JmdUkPRAQMu7gzT4ljnxJpdk0QPmMFkyAKN2OfOFpc2uuh1J3MZDrjAvXmVEQUuoosRxw642FcEG7IoDxiFxNiu8NYE+vcUYIFYRKKs113bXWx2Z34CoQZsVHOiCZ7mopdzdsFhv8NexEgRDHMxUSNREbh1bwNZwBsFblmfu/a4a6AEENYO5i3AOoEWeEUCF4MOOxBDMQAOk99OJALA2u80sBCwWGBZWG/yRwMaCAbBIAsQTJT3gea1OWfNeaPzvjoHEI85rA8ObtB1v7cIdJkIHgkh9AXpocy0LJjIKvB2wPpZB0v3wkrw5jdNEjeYeMhFX3BAyfn2ke9NUrgB9LrrcZcGJFCld4fWNddXbvbWfWzGR6xJFZsBGh0cBh3bBIxIEGTQ3W0h4NuDaSAzyAxCmGq11Vzf5uaa1aG8p+WFtrEYQGwvjICJkAEqvC+YNmcmMlMNvEaCdrcbyUvQAWDTjVuESHObM6cPGWHmzDwLaEtmzG9Z3qF1zUpXmuuZBb1z4bqeNC6f0WE1NtUTwHzEloiy3BvFisy0sYoLlQtT6XW15md2Qf9SY+2Ngfdca/TMSm/9ewz+/Boc/It45h/i4kSTsKw90SQJsPTvjSZbkWemDW7qTRZ0JEYJWSKxZJ7xmf6M224MzMzbX1s8F1YugjtvMg6eErt/4/z1jUrz1rXUKxnZC2zIg2mdBTK1mFUOKC1fOt/48kdzVixIz86Nij+eEacvpJWyZJ5xy7th8VzjjpuMJfMCW58QL73ekXPVlhsyE+vyzFiplJyauEIyrGIquruMq7qTxk+dcB495rzyTzFepCUWLIFv/kBg081Gd55WUk1IDGFTS89K++TDYxddzKnWcbluHd450xgdh7EGrOo1rr868PMTzqWJRGZ2d8oB/xpL33Xnxl2rjeNn4blXRXduzJ4B5y+28kWscAwXl+yeR654FFZPHoUb710YuPeDOUdPO48di1xptKpeEeHqOcYXNwQKGd88EDk3mqxtxPSfGRlsXRtYt8z4ytPOH/7eqpg1Aso7fYKgK4NPrMpYvsC4/poMA34yVJIQC3sCD9yecdsNyaV5yPj6ryJnR1PAvSNP4J+/1cgDfLbfePaMGGtM7Qdyl12WmKOmXgKKAp54vmBRTxfLrjE+tSYjBPjRM5FrrzIeuD2jf2lLzw8vN4JlfPVp581LsO1DgXv7jSzAiXPw/d+JiYLpjsu26Yfjf5O0rF5WoxsNT9G/bX0XKxakmPjlSee6HlizJJXSX7/oRDc+vjKR+f2wODcKd78/gR8/C9uedF44myJxmhh4OY/ipMQyqaWxmjn95TfEroMFOzbkvG+RceeqViPx1Aln1yEnOow1AnffHCpJAJ5/Vex4UvzptZRdY/O/1dJIS/NkcNmR6MTYah6qzseA4TfFtw4UvHBW1bc/O+7sPhwZHYf/jMODh5yfPudVbXj2TAJ/8XxrOZagNamj4Ei2/GNfuyRxh8t6BG2l15up+MIVODEiFr8rcPS0+O6RBF6mrrEGHHtFzOo2Lo7Dl37hvPQ6mNV6R9JYKgnYWcE37K5HlE2OT/5A0udaPUBHH+BQOMzuNsYLuDyZflTW+fTcmJFDHhJhaZqewMuewXDxcDR9IYyPN6Jj+6K4MF2vV8qBtZJScqVRNi6lpGONVJis5mpKi1WbgwsY+zIsBpcR8mzIZfuTRVZrtdu9odrptR/Xx5XONXJqBmCN0P6YMUQq9WJiwt0Je102WHdbpxSqydMObBWYdwDWLVcqcIMYe3NPjg0Ht84od0Ajju1w2XCr9e6QoqM9V23ZtnmI6cfAMMb9AY0YEHdb6oobEh4y3H3Ize6LsmGvN5IdUnhttdQ9UVrfLk/ljWEZ9wXsqAdQk1EA+O22GcgdZTke/bAs3OPY4HSdcB20HhvVtTMu0jmI8ekAhz2IICj2hKpNqI60NcuIRUHEej1quzubXa2tmZhenrfZmv3YYQ9ipDAIgvHptmblccuDjdRcmjFpWbDi/9ycZjZkRbk5jYztai/AUwiUx+qdEQB/m+25i9lxyvbcjrg45Lmd0uT/3p7/Fw6ODf+WO019AAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDI0LTEyLTAyVDIxOjU2OjQ4KzAwOjAwMVpslgAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyNC0xMi0wMlQyMTo1Njo0OCswMDowMEAH1CoAAAAodEVYdGRhdGU6dGltZXN0YW1wADIwMjQtMTItMDJUMjE6NTY6NTMrMDA6MDDZv6GRAAAAAElFTkSuQmCC";var rt={},pg={exports:{}},XOe=pg.exports,$V;function QOe(){return $V||($V=1,(function(t,e){(function(n,r){var i="1.0.41",s="",a="?",o="function",l="undefined",u="object",f="string",p="major",y="model",g="name",b="type",v="vendor",_="version",C="architecture",S="console",x="mobile",A="tablet",I="smarttv",$="wearable",O="embedded",P=500,j="Amazon",U="Apple",z="ASUS",D="BlackBerry",R="Browser",W="Chrome",T="Edge",L="Firefox",M="Google",Z="Honor",H="Huawei",V="Lenovo",F="LG",q="Microsoft",G="Motorola",Y="Nvidia",X="OnePlus",te="Opera",ie="OPPO",se="Samsung",pe="Sharp",Ce="Sony",xe="Xiaomi",Te="Zebra",Et="Facebook",Ke="Chromium OS",Ge="Mac OS",nn=" Browser",yr=function(Rt,Ht){var wt={};for(var Ze in Rt)Ht[Ze]&&Ht[Ze].length%2===0?wt[Ze]=Ht[Ze].concat(Rt[Ze]):wt[Ze]=Rt[Ze];return wt},gr=function(Rt){for(var Ht={},wt=0;wt<Rt.length;wt++)Ht[Rt[wt].toUpperCase()]=Rt[wt];return Ht},ve=function(Rt,Ht){return typeof Rt===f?et(Ht).indexOf(et(Rt))!==-1:!1},et=function(Rt){return Rt.toLowerCase()},rn=function(Rt){return typeof Rt===f?Rt.replace(/[^\d\.]/g,s).split(".")[0]:r},br=function(Rt,Ht){if(typeof Rt===f)return Rt=Rt.replace(/^\s\s*/,s),typeof Ht===l?Rt:Rt.substring(0,P)},$n=function(Rt,Ht){for(var wt=0,Ze,or,bn,Gt,_t,Zr;wt<Ht.length&&!_t;){var K=Ht[wt],Q=Ht[wt+1];for(Ze=or=0;Ze<K.length&&!_t&&K[Ze];)if(_t=K[Ze++].exec(Rt),_t)for(bn=0;bn<Q.length;bn++)Zr=_t[++or],Gt=Q[bn],typeof Gt===u&&Gt.length>0?Gt.length===2?typeof Gt[1]==o?this[Gt[0]]=Gt[1].call(this,Zr):this[Gt[0]]=Gt[1]:Gt.length===3?typeof Gt[1]===o&&!(Gt[1].exec&&Gt[1].test)?this[Gt[0]]=Zr?Gt[1].call(this,Zr,Gt[2]):r:this[Gt[0]]=Zr?Zr.replace(Gt[1],Gt[2]):r:Gt.length===4&&(this[Gt[0]]=Zr?Gt[3].call(this,Zr.replace(Gt[1],Gt[2])):r):this[Gt]=Zr||r;wt+=2}},$t=function(Rt,Ht){for(var wt in Ht)if(typeof Ht[wt]===u&&Ht[wt].length>0){for(var Ze=0;Ze<Ht[wt].length;Ze++)if(ve(Ht[wt][Ze],Rt))return wt===a?r:wt}else if(ve(Ht[wt],Rt))return wt===a?r:wt;return Ht.hasOwnProperty("*")?Ht["*"]:Rt},jr={"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},ar={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"},Mr={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[_,[g,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[_,[g,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[g,_],[/opios[\/ ]+([\w\.]+)/i],[_,[g,te+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[_,[g,te+" GX"]],[/\bopr\/([\w\.]+)/i],[_,[g,te]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[_,[g,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[_,[g,"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],[g,_],[/quark(?:pc)?\/([-\w\.]+)/i],[_,[g,"Quark"]],[/\bddg\/([\w\.]+)/i],[_,[g,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[_,[g,"UC"+R]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[_,[g,"WeChat"]],[/konqueror\/([\w\.]+)/i],[_,[g,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[_,[g,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[_,[g,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[_,[g,"Smart Lenovo "+R]],[/(avast|avg)\/([\w\.]+)/i],[[g,/(.+)/,"$1 Secure "+R],_],[/\bfocus\/([\w\.]+)/i],[_,[g,L+" Focus"]],[/\bopt\/([\w\.]+)/i],[_,[g,te+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[_,[g,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[_,[g,"Dolphin"]],[/coast\/([\w\.]+)/i],[_,[g,te+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[_,[g,"MIUI"+nn]],[/fxios\/([\w\.-]+)/i],[_,[g,L]],[/\bqihoobrowser\/?([\w\.]*)/i],[_,[g,"360"]],[/\b(qq)\/([\w\.]+)/i],[[g,/(.+)/,"$1Browser"],_],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[g,/(.+)/,"$1"+nn],_],[/samsungbrowser\/([\w\.]+)/i],[_,[g,se+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[_,[g,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[g,"Sogou Mobile"],_],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[g,_],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[g],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[_,g],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[g,Et],_],[/(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],[g,_],[/\bgsa\/([\w\.]+) .*safari\//i],[_,[g,"GSA"]],[/musical_ly(?:.
vendor: 9,091 bytes, line 527
527+app_?version\/|_)([\w\.]+)/i],[_,[g,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[_,[g,W+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[g,W+" WebView"],_],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[_,[g,"Android "+R]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[g,_],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[_,[g,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[_,g],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[g,[_,$t,jr]],[/(webkit|khtml)\/([\w\.]+)/i],[g,_],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[g,"Netscape"],_],[/(wolvic|librewolf)\/([\w\.]+)/i],[g,_],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[_,[g,L+" 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],[g,[_,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[g,[_,/master.|lts./,""]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[C,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[C,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[C,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[C,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[C,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[C,/ower/,s,et]],[/ sun4\w[;\)]/i],[[C,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[C,et]]],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],[y,[v,se],[b,A]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[y,[v,se],[b,x]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[y,[v,U],[b,x]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[y,[v,U],[b,A]],[/(macintosh);/i],[y,[v,U]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[y,[v,pe],[b,x]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[y,[v,Z],[b,A]],[/honor([-\w ]+)[;\)]/i],[y,[v,Z],[b,x]],[/\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],[y,[v,H],[b,A]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[y,[v,H],[b,x]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[y,/_/g," "],[v,xe],[b,A]],[/\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],[[y,/_/g," "],[v,xe],[b,x]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[y,[v,ie],[b,x]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[y,[v,$t,{OnePlus:["304","403","203"],"*":ie}],[b,A]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[y,[v,"Vivo"],[b,x]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[y,[v,"Realme"],[b,x]],[/\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],[y,[v,G],[b,x]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[y,[v,G],[b,A]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[y,[v,F],[b,A]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv|watch)\w+)/i,/\blg-?([\d\w]+) bui/i],[y,[v,F],[b,x]],[/(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],[y,[v,V],[b,A]],[/(nokia) (t[12][01])/i],[v,y,[b,A]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[y,/_/g," "],[b,x],[v,"Nokia"]],[/(pixel (c|tablet))\b/i],[y,[v,M],[b,A]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[y,[v,M],[b,x]],[/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],[y,[v,Ce],[b,x]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[y,"Xperia Tablet"],[v,Ce],[b,A]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[y,[v,X],[b,x]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[y,[v,j],[b,A]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[y,/(.+)/g,"Fire Phone $1"],[v,j],[b,x]],[/(playbook);[-\w\),; ]+(rim)/i],[y,v,[b,A]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[y,[v,D],[b,x]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[y,[v,z],[b,A]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[y,[v,z],[b,x]],[/(nexus 9)/i],[y,[v,"HTC"],[b,A]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[v,[y,/_/g," "],[b,x]],[/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],[y,[v,"TCL"],[b,A]],[/(itel) ((\w+))/i],[[v,et],y,[b,$t,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[y,[v,"Acer"],[b,A]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[y,[v,"Meizu"],[b,x]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[y,[v,"Ulefone"],[b,x]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[y,[v,"Energizer"],[b,x]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[y,[v,"Cat"],[b,x]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[y,[v,"Smartfren"],[b,x]],[/droid.+; (a(?:015|06[35]|142p?))/i],[y,[v,"Nothing"],[b,x]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[y,[v,"Archos"],[b,A]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[y,[v,"Archos"],[b,x]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[v,y,[b,A]],[/(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],[v,y,[b,x]],[/(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],[v,y,[b,A]],[/(surface duo)/i],[y,[v,q],[b,A]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[y,[v,"Fairphone"],[b,x]],[/(u304aa)/i],[y,[v,"AT&T"],[b,x]],[/\bsie-(\w*)/i],[y,[v,"Siemens"],[b,x]],[/\b(rct\w+) b/i],[y,[v,"RCA"],[b,A]],[/\b(venue[\d ]{2,7}) b/i],[y,[v,"Dell"],[b,A]],[/\b(q(?:mv|ta)\w+) b/i],[y,[v,"Verizon"],[b,A]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[y,[v,"Barnes & Noble"],[b,A]],[/\b(tm\d{3}\w+) b/i],[y,[v,"NuVision"],[b,A]],[/\b(k88) b/i],[y,[v,"ZTE"],[b,A]],[/\b(nx\d{3}j) b/i],[y,[v,"ZTE"],[b,x]],[/\b(gen\d{3}) b.+49h/i],[y,[v,"Swiss"],[b,x]],[/\b(zur\d{3}) b/i],[y,[v,"Swiss"],[b,A]],[/\b((zeki)?tb.*\b) b/i],[y,[v,"Zeki"],[b,A]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[v,"Dragon Touch"],y,[b,A]],[/\b(ns-?\w{0,9}) b/i],[y,[v,"Insignia"],[b,A]],[/\b((nxa|next)-?\w{0,9}) b/i],[y,[v,"NextBook"],[b,A]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[v,"Voice"],y,[b,x]],[/\b(lvtel\-)?(v1[12]) b/i],[[v,"LvTel"],y,[b,x]],[/\b(ph-1) /i],[y,[v,"Essential"],[b,x]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[y,[v,"Envizen"],[b,A]],[/\b(trio[-\w\. ]+) b/i],[y,[v,"MachSpeed"],[b,A]],[/\btu_(1491) b/i],[y,[v,"Rotor"],[b,A]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[y,[v,Y],[b,A]],[/(sprint) (\w+)/i],[v,y,[b,x]],[/(kin\.[onetw]{3})/i],[[y,/\./g," "],[v,q],[b,x]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[y,[v,Te],[b,A]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[y,[v,Te],[b,x]],[/smart-tv.+(samsung)/i],[v,[b,I]],[/hbbtv.+maple;(\d+)/i],[[y,/^/,"SmartTV"],[v,se],[b,I]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[v,F],[b,I]],[/(apple) ?tv/i],[v,[y,U+" TV"],[b,I]],[/crkey/i],[[y,W+"cast"],[v,M],[b,I]],[/droid.+aft(\w+)( bui|\))/i],[y,[v,j],[b,I]],[/(shield \w+ tv)/i],[y,[v,Y],[b,I]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[y,[v,pe],[b,I]],[/(bravia[\w ]+)( bui|\))/i],[y,[v,Ce],[b,I]],[/(mi(tv|box)-?\w+) bui/i],[y,[v,xe],[b,I]],[/
vendor: 3,166 bytes, line 527
527Hbbtv.*(technisat) (.*);/i],[v,y,[b,I]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[v,br],[y,br],[b,I]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[y,[b,I]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[b,I]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[v,y,[b,S]],[/droid.+; (shield)( bui|\))/i],[y,[v,Y],[b,S]],[/(playstation \w+)/i],[y,[v,Ce],[b,S]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[y,[v,q],[b,S]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[y,[v,se],[b,$]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[v,y,[b,$]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[y,[v,ie],[b,$]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[y,[v,U],[b,$]],[/(opwwe\d{3})/i],[y,[v,X],[b,$]],[/(moto 360)/i],[y,[v,G],[b,$]],[/(smartwatch 3)/i],[y,[v,Ce],[b,$]],[/(g watch r)/i],[y,[v,F],[b,$]],[/droid.+; (wt63?0{2,3})\)/i],[y,[v,Te],[b,$]],[/droid.+; (glass) \d/i],[y,[v,M],[b,$]],[/(pico) (4|neo3(?: link|pro)?)/i],[v,y,[b,$]],[/; (quest( \d| pro)?)/i],[y,[v,Et],[b,$]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[v,[b,O]],[/(aeobc)\b/i],[y,[v,j],[b,O]],[/(homepod).+mac os/i],[y,[v,U],[b,O]],[/windows iot/i],[[b,O]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[y,[b,x]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[y,[b,A]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[b,A]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[b,x]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[y,[v,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[_,[g,T+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[g,_],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[_,[g,"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],[g,_],[/ladybird\//i],[[g,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[_,g]],os:[[/microsoft (windows) (vista|xp)/i],[g,_],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[g,[_,$t,ar]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[_,$t,ar],[g,"Windows"]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[_,/_/g,"."],[g,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[g,Ge],[_,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[_,g],[/(ubuntu) ([\w\.]+) like android/i],[[g,/(.+)/,"$1 Touch"],_],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; ]?([\d\.]*)/i],[g,_],[/\(bb(10);/i],[_,[g,D]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[_,[g,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[_,[g,L+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[_,[g,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[_,[g,"watchOS"]],[/crkey\/([\d\.]+)/i],[_,[g,W+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[g,
527Ke],_],[/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],[g,_],[/(sunos) ?([\w\.\d]*)/i],[[g,"Solaris"],_],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[g,_]]},In=function(Rt,Ht){if(typeof Rt===u&&(Ht=Rt,Rt=r),!(this instanceof In))return new In(Rt,Ht).getResult();var wt=typeof n!==l&&n.navigator?n.navigator:r,Ze=Rt||(wt&&wt.userAgent?wt.userAgent:s),or=wt&&wt.userAgentData?wt.userAgentData:r,bn=Ht?yr(Mr,Ht):Mr,Gt=wt&&wt.userAgent==Ze;return this.getBrowser=function(){var _t={};return _t[g]=r,_t[_]=r,$n.call(_t,Ze,bn.browser),_t[p]=rn(_t[_]),Gt&&wt&&wt.brave&&typeof wt.brave.isBrave==o&&(_t[g]="Brave"),_t},this.getCPU=function(){var _t={};return _t[C]=r,$n.call(_t,Ze,bn.cpu),_t},this.getDevice=function(){var _t={};return _t[v]=r,_t[y]=r,_t[b]=r,$n.call(_t,Ze,bn.device),Gt&&!_t[b]&&or&&or.mobile&&(_t[b]=x),Gt&&_t[y]=="Macintosh"&&wt&&typeof wt.standalone!==l&&wt.maxTouchPoints&&wt.maxTouchPoints>2&&(_t[y]="iPad",_t[b]=A),_t},this.getEngine=function(){var _t={};return _t[g]=r,_t[_]=r,$n.call(_t,Ze,bn.engine),_t},this.getOS=function(){var _t={};return _t[g]=r,_t[_]=r,$n.call(_t,Ze,bn.os),Gt&&!_t[g]&&or&&or.platform&&or.platform!="Unknown"&&(_t[g]=or.platform.replace(/chrome os/i,Ke).replace(/macos/i,Ge)),_t},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 Ze},this.setUA=function(_t){return Ze=typeof _t===f&&_t.length>P?br(_t,P):_t,this},this.setUA(Ze),this};In.VERSION=i,In.BROWSER=gr([g,_,p]),In.CPU=gr([C]),In.DEVICE=gr([y,v,b,S,x,I,A,$,O]),In.ENGINE=In.OS=gr([g,_]),t.exports&&(e=t.exports=In),e.UAParser=In;var Tr=typeof n!==l&&(n.jQuery||n.Zepto);if(Tr&&!Tr.ua){var ln=new In;Tr.ua=ln.getResult(),Tr.ua.get=function(){return ln.getUA()},Tr.ua.set=function(Rt){ln.setUA(Rt);var Ht=ln.getResult();for(var wt in Ht)Tr.ua[wt]=Ht[wt]}}})(typeof window=="object"?window:XOe)})(pg,pg.exports)),pg.exports}var IV;function ePe(){if(IV)return rt;IV=1,Object.defineProperty(rt,"__esModule",{value:!0});function t(he){return he&&typeof he=="object"&&"default"in he?he.default:he}var e=B1(),n=t(e),r=QOe(),i=new r,s=i.getBrowser(),a=i.getCPU(),o=i.getDevice(),l=i.getEngine(),u=i.getOS(),f=i.getUA(),p=function(ee){return i.setUA(ee)},y=function(ee){if(!ee){console.error("No userAgent string was provided");return}var re=new r(ee);return{UA:re,browser:re.getBrowser(),cpu:re.getCPU(),device:re.getDevice(),engine:re.getEngine(),os:re.getOS(),ua:re.getUA(),setUserAgent:function(De){return re.setUA(De)}}},g=Object.freeze({ClientUAInstance:i,browser:s,cpu:a,device:o,engine:l,os:u,ua:f,setUa:p,parseUserAgent:y});function b(he,ee){var re=Object.keys(he);if(Object.getOwnPropertySymbols){var Ee=Object.getOwnPropertySymbols(he);ee&&(Ee=Ee.filter(function(De){return Object.getOwnPropertyDescriptor(he,De).enumerable})),re.push.apply(re,Ee)}return re}function v(he){for(var ee=1;ee<arguments.length;ee++){var re=arguments[ee]!=null?arguments[ee]:{};ee%2?b(Object(re),!0).forEach(function(Ee){A(he,Ee,re[Ee])}):Object.getOwnPropertyDescriptors?Object.defineProperties(he,Object.getOwnPropertyDescriptors(re)):b(Object(re)).forEach(function(Ee){Object.defineProperty(he,Ee,Object.getOwnPropertyDescriptor(re,Ee))})}return he}function _(he){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_=function(ee){return typeof ee}:_=function(ee){return ee&&typeof Symbol=="function"&&ee.constructor===Symbol&&ee!==Symbol.prototype?"symbol":typeof ee},_(he)}function C(he,ee){if(!(he instanceof ee))throw new TypeError("Cannot call a class as a function")}function S(he,ee){for(var re=0;re<ee.length;re++){var Ee=ee[re];Ee.enumerable=Ee.enumerable||!1,Ee.configurable=!0,"value"in Ee&&(Ee.writable=!0),Object.defineProperty(he,Ee.key,Ee)}}function x(he,ee,re){return ee&&S(he.prototype,ee),he}function A(he,ee,re){return ee in he?Object.defineProperty(he,ee,{value:re,enumerable:!0,configurable:!0,writable:!0}):he[ee]=re,he}function I(){return I=Object.assign||function(he){for(var ee=1;ee<arguments.length;ee++){var re=arguments[ee];for(var Ee in re)Object.prototype.hasOwnProperty.call(re,Ee)&&(he[Ee]=re[Ee])}return he},I.apply(this,arguments)}function $(he,ee){if(typeof ee!="function"&&ee!==null)throw new TypeError("Super expression must either be null or a function");he.prototype=Object.create(ee&&ee.prototype,{constructor:{value:he,writable:!0,configurable:!0}}),ee&&P(he,ee)}function O(he){return O=Object.setPrototypeOf?Object.getPrototypeOf:function(re){return re.__proto__||Object.getPrototypeOf(re)},O(he)}function P(he,ee){return P=Object.setPrototypeOf||function(Ee,De){return Ee.__proto__=De,Ee},P(he,ee)}function j(he,ee){if(he==null)return{};var re={},Ee=Object.keys(he),De,Zt;for(Zt=0;Zt<Ee.length;Zt++)De=Ee[Zt],!(ee.indexOf(De)>=0)&&(re[De]=he[De]);return re}function U(he,ee){if(he==null)return{};var re=j(he,ee),Ee,De;if(Object.getOwnPropertySymbols){var Zt=Object.getOwnPropertySymbols(he);for(De=0;De<Zt.length;De++)Ee=Zt[De],!(ee.indexOf(Ee)>=0)&&Object.prototype.propertyIsEnumerable.call(he,Ee)&&(re[Ee]=he[Ee])}return re}function z(he){if(he===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return he}function D(he,ee){if(ee&&(typeof ee=="object"||typeof ee=="function"))return ee;if(ee!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return z(he)}function R(he,ee){return W(he)||T(he,ee)||L(he,ee)||Z()}function W(he){if(Array.isArray(he))return he}function T(he,ee){var re=he==null?null:typeof Symbol<"u"&&he[Symbol.iterator]||he["@@iterator"];if(re!=null){var Ee=[],De=!0,Zt=!1,wr,Gi;try{for(re=re.call(he);!(De=(wr=re.next()).done)&&(Ee.push(wr.value),!(ee&&Ee.length===ee));De=!0);}catch(Ci){Zt=!0,Gi=Ci}finally{try{!De&&re.return!=null&&re.return()}finally{if(Zt)throw Gi}}return Ee}}
527function L(he,ee){if(he){if(typeof he=="string")return M(he,ee);var re=Object.prototype.toString.call(he).slice(8,-1);if(re==="Object"&&he.constructor&&(re=he.constructor.name),re==="Map"||re==="Set")return Array.from(he);if(re==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(re))return M(he,ee)}}function M(he,ee){(ee==null||ee>he.length)&&(ee=he.length);for(var re=0,Ee=new Array(ee);re<ee;re++)Ee[re]=he[re];return Ee}function Z(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 528In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var H={Mobile:"mobile",Tablet:"tablet",SmartTv:"smarttv",Console:"console",Wearable:"wearable",Embedded:"embedded",Browser:void 0},V={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"},F={IOS:"iOS",Android:"Android",WindowsPhone:"Windows Phone",Windows:"Windows",MAC_OS:"Mac OS"},q={isMobile:!1,isTablet:!1,isBrowser:!1,isSmartTV:!1,isConsole:!1,isWearable:!1},G=function(ee){switch(ee){case H.Mobile:return{isMobile:!0};case H.Tablet:return{isTablet:!0};case H.SmartTv:return{isSmartTV:!0};case H.Console:return{isConsole:!0};case H.Wearable:return{isWearable:!0};case H.Browser:return{isBrowser:!0};case H.Embedded:return{isEmbedded:!0};default:return q}},Y=function(ee){return p(ee)},X=function(ee){var re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"none";return ee||re},te=function(){return typeof window<"u"&&(window.navigator||navigator)?window.navigator||navigator:!1},ie=function(ee){var re=te();return re&&re.platform&&(re.platform.indexOf(ee)!==-1||re.platform==="MacIntel"&&re.maxTouchPoints>1&&!window.MSStream)},se=function(ee,re,Ee,De,Zt){return{isBrowser:ee,browserMajorVersion:X(re.major),browserFullVersion:X(re.version),browserName:X(re.name),engineName:X(Ee.name),engineVersion:X(Ee.version),osName:X(De.name),osVersion:X(De.version),userAgent:X(Zt)}},pe=function(ee,re,Ee,De){return v({},ee,{vendor:X(re.vendor),model:X(re.model),os:X(Ee.name),osVersion:X(Ee.version),ua:X(De)})},Ce=function(ee,re,Ee,De){return{isSmartTV:ee,engineName:X(re.name),engineVersion:X(re.version),osName:X(Ee.name),osVersion:X(Ee.version),userAgent:X(De)}},xe=function(ee,re,Ee,De){return{isConsole:ee,engineName:X(re.name),engineVersion:X(re.version),osName:X(Ee.name),osVersion:X(Ee.version),userAgent:X(De)}},Te=function(ee,re,Ee,De){return{isWearable:ee,engineName:X(re.name),engineVersion:X(re.version),osName:X(Ee.name),osVersion:X(Ee.version),userAgent:X(De)}},Et=function(ee,re,Ee,De,Zt){return{isEmbedded:ee,vendor:X(re.vendor),model:X(re.model),engineName:X(Ee.name),engineVersion:X(Ee.version),osName:X(De.name),osVersion:X(De.version),userAgent:X(Zt)}};function Ke(he){var ee=he?y(he):g,re=ee.device,Ee=ee.browser,De=ee.engine,Zt=ee.os,wr=ee.ua,Gi=G(re.type),Ci=Gi.isBrowser,Cc=Gi.isMobile,cp=Gi.isTablet,Qu=Gi.isSmartTV,q5=Gi.isConsole,up=Gi.isWearable,dp=Gi.isEmbedded;if(Ci)return se(Ci,Ee,De,Zt,wr);if(Qu)return Ce(Qu,De,Zt,wr);if(q5)return xe(q5,De,Zt,wr);if(Cc||cp)return pe(Gi,re,Zt,wr);if(up)return Te(up,De,Zt,wr);if(dp)return Et(dp,re,De,Zt,wr)}var Ge=function(ee){var re=ee.type;return re===H.Mobile},nn=function(ee){var re=ee.type;return re===H.Tablet},yr=function(ee){var re=ee.type;return re===H.Mobile||re===H.Tablet},gr=function(ee){var re=ee.type;return re===H.SmartTv},ve=function(ee){var re=ee.type;return re===H.Browser},et=function(ee){var re=ee.type;return re===H.Wearable},rn=function(ee){var re=ee.type;return re===H.Console},br=function(ee){var re=ee.type;return re===H.Embedded},$n=function(ee){var re=ee.vendor;return X(re)},$t=function(ee){var re=ee.model;return X(re)},jr=function(ee){var re=ee.type;return X(re,"browser")},ar=function(ee){var re=ee.name;return re===F.Android},Mr=function(ee){var re=ee.name;return re===F.Windows},In=function(ee){var re=ee.name;return re===F.MAC_OS},Tr=function(ee){var re=ee.name;return re===F.WindowsPhone},ln=function(ee){var re=ee.name;return re===F.IOS},Rt=function(ee){var re=ee.version;return X(re)},Ht=function(ee){var re=ee.name;return X(re)},wt=function(ee){var re=ee.name;return re===V.Chrome},Ze=function(ee){var re=ee.name;return re===V.Firefox},or=function(ee){var re=ee.name;return re===V.Chromium},bn=function(ee){var re=ee.name;return re===V.Edge},Gt=function(ee){var re=ee.name;return re===V.Yandex},_t=function(ee){var re=ee.name;return re===V.Safari||re===V.MobileSafari},Zr=function(ee){var re=ee.name;return re===V.MobileSafari},K=function(ee){var re=ee.name;return re===V.Opera},Q=function(ee){var re=ee.name;return re===V.InternetExplorer||re===V.Ie},le=function(ee){var re=ee.name;return re===V.MIUI},ae=function(ee){var re=ee.name;return re===V.SamsungBrowser},ce=function(ee){var re=ee.version;return X(re)},ye=function(ee){var re=ee.major;return X(re)},Pe=function(ee){var re=ee.name;return X(re)},Re=function(ee){var re=ee.name;return X(re)},it=function(ee){var re=ee.version;return X(re)},bt=function(){var ee=te(),re=ee&&ee.userAgent&&ee.userAgent.toLowerCase();return typeof re=="string"?/electron/.test(re):!1},Ut=function(ee){return typeof ee=="string"&&ee.indexOf("Edg/")!==-1},St=function(){var ee=te();return ee&&(/iPad|iPhone|iPod/.test(ee.platform)||ee.platform==="MacIntel"&&ee.maxTouchPoints>1)&&!window.MSStream},jt=function(){return ie("iPad")},Hn=function(){return ie("iPhone")},ot=function(){return ie("iPod")},Nn=function(ee){return X(ee)};function Jn(he){var ee=he||g,re=ee.device,Ee=ee.browser,De=ee.os,Zt=ee.engine,wr=ee.ua;return{isSmartTV:gr(re),isConsole:rn(re),isWearable:et(re),isEmbedded:br(re),isMobileSafari:Zr(Ee)||jt(),isChromium:or(Ee),isMobile:yr(re)||jt(),isMobileOnly:Ge(re),isTablet:nn(re)||jt(),isBrowser:ve(re),isDesktop:ve(re),isAndroid:ar(De),isWinPhone:Tr(De),isIOS:ln(De)||jt(),isChrome:wt(Ee),isFirefox:Ze(Ee),isSafari:_t(Ee),isOpera:K(Ee),isIE:Q(Ee),osVersion:Rt(De),osName:Ht(De),fullBrowserVersion:ce(Ee),browserVersion:ye(Ee),browserName:Pe(Ee),mobileVendor:$n(re),mobileModel:$t(re),engineName:Re(Zt),engineVersion:it(Zt),getUA:Nn(wr),isEdge:bn(Ee)||Ut(wr),isYandex:Gt(Ee),deviceType:jr(re),isIOS13:St(),isIPad13:jt(),isIPhone13:Hn(),isIPod13:ot(),isElectron:bt(),isEdgeChromium:Ut(wr),isLegacyEdge:bn(Ee)&&!Ut(wr),isWindows:Mr(De),isMacOs:In(De),isMIUI:le(Ee),isSamsungBrowser:ae(Ee)}}var Fr=gr(o),lr=rn(o),en=et(o),Dn=br(o),cr=Zr(s)||jt(),zr=or(s),ga=yr(o)||jt(),Vo=Ge(o),Ho=nn(o)||jt(),Wt=ve(o),Un=ve(o),Ct=ar(u),wn=Tr(u),Wn=ln(u)||jt(),Dr=wt(s),_n=Ze(s),xc=_t(s),pn=K(s),si=Q(s),Pi=Rt(u),Bs=Ht(u),G2=ce(s),ip=ye(s),W9=Pe(s),sp=$n(o),ap=$t(o),Wo=Re(l),Fs=it(l),M5=Nn(f),q9=bn(s)||Ut(f),xm=Gt(s),D5=jr(o),op=St(),Z9=jt(),zs=Hn(),Cm=ot(),U5=bt(),Em=Ut(f),Gu=bn(s)&&!Ut(f),B5=Mr(u),F5=In(u),Yu=le(s),K9=ae(s),z5=function(ee){if(!ee||typeof ee!="string"){console.error("No valid user agent string was provided");return}var re=y(ee),Ee=re.device,De=re.browser,Zt=re.os,wr=re.engine,Gi=re.ua;return Jn({device:Ee,browser:De,os:Zt,engine:wr,ua:Gi})},V5=function(ee){var re=ee.renderWithFragment,Ee=ee.children,De=U(ee,["renderWithFragment","children"]);return Ct?re?n.createElement(e.Fragment,null,Ee):n.createElement("div",De,Ee):null},Sm=function(ee){var re=ee.renderWithFragment,Ee=ee.children,De=U(ee,["renderWithFragment","children"]);return Wt?re?n.createElement(e.Fragment,null,Ee):n.createElement("div",De,Ee):null},G9=function(ee){var re=ee.renderWithFragment,Ee=ee.children,De=U(ee,["renderWithFragment","children"]);return si?re?n.createElement(e.Fragment,null,Ee):n.createElement("div",De,Ee):null},Y9=function(ee){var re=ee.renderWithFragment,Ee=ee.children,De=U(ee,["renderWithFragment","children"]);return Wn?re?n.createElement(e.Fragment,null,Ee):n.createElement("div",De,Ee):null},lp=function(ee){var re=ee.renderWithFragment,Ee=ee.children,De=U(ee,["renderWithFragment","children"]);return ga?re?n.createElement(e.Fragment,null,Ee):n.createElement("div",De,Ee):null},qo=function(ee){var re=ee.renderWithFragment,Ee=ee.children,De=U(ee,["renderWithFragment","children"]);return Ho?re?n.createElement(e.Fragment,null,Ee):n.createElement("div",De,Ee):null},Am=function(ee){var re=ee.renderWithFragment,Ee=ee.children,De=U(ee,["renderWithFragment","children"]);return wn?re?n.createElement(e.Fragment,null,Ee):n.createElement("div",De,Ee):null},km=function(ee){var re=ee.renderWithFragment,Ee=ee.children;ee.viewClassName,ee.style;var De=U(ee,["renderWithFragment","children","viewClassName","style"]);return Vo?re?n.createElement(e.Fragment,null,Ee):n.createElement("div",De,Ee):null},Ju=function(ee){var re=ee.renderWithFragment,Ee=ee.children,De=U(ee,["renderWithFragment","children"]);return Fr?re?n.createElement(e.Fragment,null,Ee):n.createElement("div",De,Ee):null},Xu=function(ee){var re=ee.renderWithFragment,Ee=ee.children,De=U(ee,["renderWithFragment","children"]);return lr?re?n.createElement(e.Fragment,null,Ee):n.createElement("div",De,Ee):null},H5=function(ee){var re=ee.renderWithFragment,Ee=ee.children,De=U(ee,["renderWithFragment","children"]);return en?re?n.createElement(e.Fragment,null,Ee):n.createElement("div",De,Ee):null},Tm=function(ee){var re=ee.renderWithFragment,Ee=ee.children;ee.viewClassName,ee.style;var De=ee.condition,Zt=U(ee,["renderWithFragment","children","viewClassName","style","condition"]);return De?re?n.createElement(e.Fragment,null,Ee):n.createElement("div",Zt,Ee):null};function W5(he){return(function(ee){$(re,ee);function re(Ee){var De;return C(this,re),De=D(this,O(re).call(this,Ee)),De.isEventListenerAdded=!1,De.handleOrientationChange=De.handleOrientationChange.bind(z(De)),De.onOrientationChange=De.onOrientationChange.bind(z(De)),De.onPageLoad=De.onPageLoad.bind(z(De)),De.state={isLandscape:!1,isPortrait:!1},De}return x(re,[{key:"handleOrientationChange",value:function(){this.isEventListenerAdded||(this.isEventListenerAdded=!0);var De=window.innerWidth>window.innerHeight?90:0;this.setState({isPortrait:De===0,isLandscape:De===90})}},{key:"onOrientationChange",value:function(){this.handleOrientationChange()}},{key:"onPageLoad",value:function(){this.handleOrientationChange()}},{key:"componentDidMount",value:function(){(typeof window>"u"?"undefined":_(window))!==void 0&&ga&&(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(he,I({},this.props,{isLandscape:this.state.isLandscape,isPortrait:this.state.isPortrait}))}}]),re})(n.Component)}function Y2(){var he=e.useState(function(){var Zt=window.innerWidth>window.innerHeight?90:0;return{isPortrait:Zt===0,isLandscape:Zt===90,orientation:Zt===0?"portrait":"landscape"}}),ee=R(he,2),re=ee[0],Ee=ee[1],De=e.useCallback(function(){var Zt=window.innerWidth>window.innerHeight?90:0,wr={isPortrait:Zt===0,isLandscape:Zt===90,orientation:Zt===0?"portrait":"landscape"};re.orientation!==wr.orientation&&Ee(wr)},[re.orientation]);return e.useEffect(function(){return(typeof window>"u"?"undefined":_(window))!==void 0&&ga&&(De(),window.addEventListener("load",De,!1),window.addEventListener("resize",De,!1)),function(){window.removeEventListener("resize",De,!1),window.removeEventListener("load",De,!1)}},[De]),re}function Ga(he){var ee=he||window.navigator.userAgent;return y(ee)}function Lm(he){var ee=he||window.navigator.userAgent,re=Ga(ee),Ee=Jn(re);return[Ee,re]}return rt.AndroidView=V5,rt.BrowserTypes=V,rt.BrowserView=Sm,rt.ConsoleView=Xu,rt.CustomView=Tm,rt.IEView=G9,rt.IOSView=Y9,rt.MobileOnlyView=km,rt.MobileView=lp,rt.OsTypes=F,rt.SmartTVView=Ju,rt.TabletView=qo,rt.WearableView=H5,rt.WinPhoneView=Am,rt.browserName=W9,rt.browserVersion=ip,rt.deviceDetect=Ke,rt.deviceType=D5,rt.engineName=Wo,rt.engineVersion=Fs,rt.fullBrowserVersion=G2,rt.getSelectorsByUserAgent=z5,rt.getUA=M5,rt.isAndroid=Ct,rt.isBrowser=Wt,rt.isChrome=Dr,rt.isChromium=zr,rt.isConsole=lr,rt.isDesktop=Un,rt.isEdge=q9,rt.isEdgeChromium=Em,rt.isElectron=U5,rt.isEmbedded=Dn,rt.isFirefox=_n,rt.isIE=si,rt.isIOS=Wn,rt.isIOS13=op,rt.isIPad13=Z9,rt.isIPhone13=zs,rt.isIPod13=Cm,rt.isLegacyEdge=Gu,rt.isMIUI=Yu,rt.isMacOs=F5,rt.isMobile=ga,rt.isMobileOnly=Vo,rt.isMobileSafari=cr,rt.isOpera=pn,rt.isSafari=xc,rt.isSamsungBrowser=K9,rt.isSmartTV=Fr,rt.isTablet=Ho,rt.isWearable=en,rt.isWinPhone=wn,rt.isWindows=B5,rt.isYandex=xm,rt.mobileModel=ap,rt.mobileVendor=sp,rt.osName=Bs,rt.osVersion=Pi,rt.parseUserAgent=y,rt.setUserAgent=Y,rt.useDeviceData=Ga,rt.useDeviceSelectors=Lm,rt.useMobileOrientation=Y2,rt.withOr
528ientationChange=W5,rt}var El=ePe();const c6=Bo((()=>({listings:[],loading:!1}))),LE=c6.setState,tPe=t=>c6.getState().listings.find((({slug:e})=>iv(e)===iv(t))),$E=t=>{let e;try{e=new URL(t).hostname}catch{return}return c6.getState().listings.find((({homepage:n})=>{let r;try{r=new URL(n).hostname}catch{return!1}return e.includes(r)}))},Cre=(t=!0)=>{let e=Ts(),n=c6((s=>s.listings)),r=c6((s=>s.loading)),i=!!n.length;return N.useEffect((()=>{t&&!i&&(LE({listings:[],loading:!0}),(async s=>{let a=new URL("v3/wallets","https://explorer-api.walletconnect.com");a.searchParams.append("projectId",s);let o=await fetch(a);return o.ok?Object.values((await o.json()).listings).sort((({slug:l},{slug:u})=>l==="rainbow"&&u==="metamask"?1:l==="metamask"||l==="rainbow"?-1:1)):(console.debug(`Failed to fetch WalletConnect listings: ${await o.text().catch((()=>"No response."))}`),[])})(e.walletConnectCloudProjectId).then((s=>LE({listings:s,loading:!1}))).catch((s=>{console.error(s),LE({listings:[],loading:!1})})))}),[t,i,e.walletConnectCloudProjectId]),{listings:n,loading:r}},n5t=t=>{let{listings:e}=Cre();return e.find((({slug:n})=>iv(n)===iv(t)))};function iv(t){return t==="cryptocom"?"cryptocom-defi":t==="binance"?"binance-defi":t.replace(/[-_]wallet$/,"")}function XT(t){return["wallet_connect","backpack","binance","binanceus","bitget_wallet","bybit_wallet","cryptocom","haha_wallet","jupiter","metamask","okx_wallet","phantom","rabby_wallet","rainbow","ronin_wallet","safe","solflare","uniswap","zerion","kraken_wallet","robinhood_wallet"].some((e=>t==null?void 0:t.includes(e)))}function Zd(t){return t.type==="ethereum"}function Ere(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++){let r=t[n],i=e[n];if((r==null?void 0:r.address)!==(i==null?void 0:i.address)||r&&i&&Zd(r)&&Zd(i)&&(r==null?void 0:r.chainId)!==(i==null?void 0:i.chainId)||(r==null?void 0:r.connectorType)!==(i==null?void 0:i.connectorType)||(r==null?void 0:r.connectedAt)!==(i==null?void 0:i.connectedAt)||(r==null?void 0:r.walletClientType)!==(i==null?void 0:i.walletClientType)||(r==null?void 0:r.isConnected)!==(i==null?void 0:i.isConnected)||(r==null?void 0:r.linked)!==(i==null?void 0:i.linked))return!1}return!0}const hO=(t,e)=>t.rpcTimeouts&&t.rpcTimeouts[e]||G7;function IE(t){return t.chainType==="ethereum"}let fm=class extends xre{buildConnectedWallet(e,n,r,i){let s=async()=>!!this.wallets.find((a=>Vi(a.address)===Vi(e)));return{type:"ethereum",address:Vi(e),chainId:n,meta:r,imported:i,switchChain:async a=>{var y,g,b,v;let o,l;if(!s)throw new Sr("Wallet is not currently connected.");let u=(y=this.wallets.find((_=>Vi(_.address)===Vi(e))))==null?void 0:y.chainId;if(!u)throw new Sr("Unable to determine current chainId.");if(typeof a=="number"?(o=`0x${a.toString(16)}`,l=a):(o=a,l=Number(a)),u===Pg(o))return;let f=this.chains.find((_=>_.id===l));if(!f)throw new Sr(`Unsupported chainId: ${a}`);let p=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:o}]})};try{return await p()}catch(_){if(((C,S)=>{var x;switch(S){case"coinbase_wallet":case"base_account":return C.message.includes("addEthereumChain");case"rabby_wallet":return C.message.includes("Unrecognized chain ID");default:return C.code===4902||((x=C.message)==null?void 0:x.includes("4902"))}})(_,this.walletClientType))return this.walletClientType==="rabby_wallet"&&await nv(300),await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:o,chainName:f.name,nativeCurrency:f.nativeCurrency,rpcUrls:[((g=f.rpcUrls.default)==null?void 0:g.http[0])??""],blockExplorerUrls:[((b=f.blockExplorers)==null?void 0:b.default.url)??""]}]}),p();throw this.walletClientType==="rainbow"&&((v=_.message)!=null&&v.includes("wallet_switchEthereumChain"))?new Sr(`Rainbow does not support the chainId ${n}`):_}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:s,getEthereumProvider:async()=>{if(!await s())throw new Sr("Wallet is not currently connected.");return this.proxyProvider},sign:async a=>{if(!await s())throw new Sr("Wallet is not currently connected.");return await this.sign(a)},disconnect:()=>{this.disconnect()}}}async syncAccounts(e){let n;Ue.debug("Syncing accounts",{wallet:this.walletClientType});let r=e;try{if(r===void 0){Ue.rpcRequest("eth_accounts",this.walletClientType);let l=await YT((()=>this.proxyProvider.request({method:"eth_accounts"})),{maxAttempts:10,delayMs:500});Ue.rpcResponse("eth_accounts",this.walletClientType),Array.isArray(l)&&(r=l)}}catch{Ue.warn("Wallet did not respond to eth_accounts, using prefetched accounts",{wallet:this.walletClientType})}if(!r||!Array.isArray(r)||r.length<=0||!r[0])return void Ue.debug("No accounts found",{wallet:this.walletClientType});let i=r[0];if(!Yn(i))return;let s=Vi(i),a=[];if(this.walletClientType==="privy"){let l=vt.get(AE(s));this.chains.find((u=>u.id===Number(l)))||(vt.del(AE(s)),l=null),n=l||`0x${this.defaultChain.id.toString(16)}`;try{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:n}]})}catch{Ue.warn("Unable to switch embedded wallet chain on initialization",{wallet:this.walletClientType,chainId:n})}}else try{Ue.rpcRequest("eth_chainId",this.walletClientType);let l=await YT((()=>this.proxyProvider.request({method:"eth_chainId"})),{maxAttempts:10,delayMs:500});if(Ue.rpcResponse("eth_chainId",this.walletClientType),typeof l=="string")n=l;else{if(typeof l!="number")throw Error("Invalid chainId returned from provider");n=`0x${l.toString(16)}`}}catch{Ue.warn("Failed to get chainId from provider, using default",{wallet:this.walletClientType,defaultChainId:_V}),n=_V}let o=Pg(n);if(!a.find((l=>Vi(l.address)===s))){let l={name:this.walletBranding.name,icon:this.walletBranding.icon,id:this.walletBranding.id};a.push(this.buildConnectedWallet(Vi(i),o,l,this.connectorType==="embedded_imported"))}
528Ere(a,this.wallets)||(Ue.debug("Wallets updated",{wallet:this.walletClientType,address:s,chainId:o}),this.wallets=a,this.emit("walletsUpdated"))}async getConnectedWallet(){let e=await this.proxyProvider.request({method:"eth_accounts"});return this.wallets.sort(((n,r)=>r.connectedAt-n.connectedAt)).find((n=>e.find((r=>Vi(r)===Vi(n.address)))))||null}async isConnected(){let e=await this.proxyProvider.request({method:"eth_accounts"});return Array.isArray(e)&&e.length>0}async sign(e){var n;return await this.connect({showPrompt:!1}),this.proxyProvider.request({method:"personal_sign",params:[Dt(e),(n=this.wallets[0])==null?void 0:n.address]})}subscribeListeners(){this.proxyProvider.on("accountsChanged",this.onAccountsChanged),this.proxyProvider.on("chainChanged",this.onChainChanged),this.proxyProvider.on("disconnect",this.onDisconnect),this.proxyProvider.on("connect",this.onConnect)}unsubscribeListeners(){this.proxyProvider.removeListener("accountsChanged",this.onAccountsChanged),this.proxyProvider.removeListener("chainChanged",this.onChainChanged),this.proxyProvider.removeListener("disconnect",this.onDisconnect),this.proxyProvider.removeListener("connect",this.onConnect)}constructor(e,n,r,i){super(e),this.chainType="ethereum",this.onAccountsChanged=s=>{Ue.providerEvent("accountsChanged",this.walletClientType,{accountsCount:s.length}),s.length===0?this.onDisconnect():this.syncAccounts(s)},this.onChainChanged=s=>{Ue.providerEvent("chainChanged",this.walletClientType,{chainId:s}),this.wallets.forEach((a=>{a.chainId=Pg(s),this.walletClientType==="privy"&&vt.put(AE(a.address),s)})),this.emit("walletsUpdated")},this.onDisconnect=()=>{Ue.providerEvent("disconnect",this.walletClientType),this.connected=!1,this.wallets=[],this.emit("walletsUpdated")},this.onConnect=async()=>{Ue.providerEvent("connect",this.walletClientType),this.connectorType==="base_account"&&this.connected||(this.connected=!0,this.connectorType==="coinbase_wallet"&&await nv(500),this.syncAccounts())},this.wallets=[],this.walletClientType=e,this.chains=n,this.defaultChain=r,this.rpcConfig=i,this.rpcTimeoutDuration=hO(i,e),this.connected=!1,this.initialized=!1}},Gf=class{on(e,n){if(this.walletProvider)return this.addWalletProviderListener(e,n);this._subscriptions.push({eventName:e,listener:n})}addWalletProviderListener(e,n){var r;if(typeof((r=this.walletProvider)==null?void 0:r.on)=="function")try{return this.walletProvider.on(e,n)}catch{console.warn("Unable to subscribe to wallet provider event")}else console.warn("Wallet provider does not support event subscriptions")}async request(e){if(!this.walletProvider)throw new Sr(`A wallet request of type ${e.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(e),this.walletTimeout()]).catch((n=>{throw H2(n)}))}constructor(e,n){this.removeListener=(r,i)=>{if(this.walletProvider)try{return this.walletProvider.removeListener(r,i)}catch{console.warn("Unable to remove wallet provider listener")}},this.walletTimeout=(r=new qOe,i=this.rpcTimeoutDuration)=>new Promise(((s,a)=>setTimeout((()=>{a(r)}),i))),this.setWalletProvider=r=>{this.walletProvider&&this._subscriptions.forEach((i=>{this.removeListener(i.eventName,i.listener)})),this.walletProvider=r,this._subscriptions.forEach((i=>{this.addWalletProviderListener(i.eventName,i.listener)}))},this.walletProvider=e,this.rpcTimeoutDuration=n||G7,this._subscriptions=[]}},nPe=class extends fm{get walletBranding(){return{id:this.id,name:this.name,icon:this.icon}}async initialize(){this.initialized=!0,this.emit("initialized")}async connect(){throw Error("connect called for an uninstalled wallet via the EthereumNullConnector")}disconnect(){throw Error("disconnect called for an uninstalled wallet via the EthereumNullConnector")}promptConnection(e){throw Error(`promptConnection called for an uninstalled wallet via the EthereumNullConnector for ${e}`)}constructor({id:e,name:n,icon:r,walletClientType:i,defaultChain:s}){super(i,[],s,{}),this.connectorType="null",this.proxyProvider=new Gf(void 0,G7),this.id=e,this.name=n,this.icon=r}};const rPe=({...t}={})=>h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",...t,children:[h.jsx("rect",{width:"32",height:"32",rx:"6",fill:"#121314"}),h.jsx("g",{transform:"translate(4, 4)",children:h.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 318.6 318.6",children:[h.jsx("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),h.jsx("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),h.jsx("path",{d:"m44.4 35.5 98.7 74.6-17.5-44.3zm193.9 171.3-26.5 40.6 56.7 15.6 16.3-55.3zm-204.4.9L50.1 263l56.7-15.6-26.5-40.6z",className:"s1 s2"}),h.jsx("path",{d:"m103.6 138.2-15.8 23.9 56.3 2.5-2-60.5zm111.3 0-39-34.8-1.3 61.2 56.2-2.5zM106.8 247.4l33.8-16.5-29.2-22.8zm71.1-16.5 33.9 16.5-4.7-39.3z",className:"s1 s2"}),h.jsx("path",{fill:"#d7c1b3",stroke:"#d7c1b3",className:"s1",d:"m211.8 247.4-33.9-16.5 2.7 22.1-.3 9.3zm-105 0 31.5 14.9-.2-9.3 2.5-22.1z"}),h.jsx("path",{fill:"#233447",stroke:"#233447",className:"s1",d:"m138.8 193.5-28.2-8.3 19.9-9.1zm40.9 0 8.3-17.4 20 9.1z"}),h.jsx("path",{fill:"#cd6116",stroke:"#cd6116",className:"s1",d:"m106.8 247.4 4.8-40.6-31.3.9zM207 206.8l4.8 40.6 26.5-39.7zm23.8-44.7-56.2 2.5 5.2 28.9 8.3-17.4 20 9.1zm-120.2 23.1 20-9.1 8.2 17.4 5.3-28.9-56.3-2.5z"}),h.jsx("path",{fill:"#e4751f",stroke:"#e4751f",className:"s1",d:"m87.8 162.1 23.6 46-.8-22.9zm120.3 23.1-1 22.9 23.7-46zm-64-20.6-5.3 28.9 6.6 34.1 1.5-44.9zm30.5 0-2.7 18 1.2 45 6.7-34.1z"}),h.jsx("path",{d:"m179.8 193.5-6.7 34.1 4.8 3.3 29.2-22.8 1-22.9zm-69.2-8.3.8 22.9 29.2 22.8 4.8-3.3-6.6-34.1z",className:"s3"}),h.jsx("path",{fill:"#c0ad9e",stroke:"#c0ad9e",className:"s1",d:"m180.3 262.3.3-9.3-2.5-2.2h-37.7l-2.3 2.2.2 9.3-31.5-14.9 11 9 22.3 15.5h38.3l22.4-15.5 11-9z"}),h.jsx("path",{fill:"#161616",stroke:"#161616",className:"s1",d:"m177.9 230.9-4.8-3.3h-27.7l-4.8 3.3-2.5 22.1 2.3-2.2h37.7l2.5 2.2z"}),h.jsx("path",{fill:"#763d16",stroke:"#763d16",className:"s1",d:"m278.3 114.2 8.5-40.8-12.7-37.9-96.2 71.4 37 31.3 52.3 15.3 11.6-13.5-5-3.6 8-7.3-6.2-4.8 8-6.1zM31.8 73.4l8.5 40.8-5.4 4 8 6.1-6.1 4.8 8 7.3-5 3.6 11.5 13.5 52.3-15.3 37-31.3-96.2-71.4z"}),h.jsx("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h4
5286.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]})})]}),Sre=Object.freeze({phantom:{client:"phantom",name:"Phantom",installLink:El.isFirefox?"https://addons.mozilla.org/en-US/firefox/addon/phantom-app/":"https://chrome.google.com/webstore/detail/phantom/bfnaelmomeimhlpmgjnjophhpkkoljpa?hl=en",chainTypes:["ethereum","solana"],get isInstalled(){var t,e,n,r,i,s;if("phantom"in window){let a=window;if((e=(t=a==null?void 0:a.phantom)==null?void 0:t.ethereum)!=null&&e.isPhantom&&((r=(n=a==null?void 0:a.phantom)==null?void 0:n.ethereum)!=null&&r.chainId)||(s=(i=a==null?void 0:a.phantom)==null?void 0:i.solana)!=null&&s.isPhantom)return!0}return!1},getMobileRedirect({useUniversalLink:t,isSolana:e,connectOnly:n}){let r=Ny({client:this.client,isSolana:e,connectOnly:n});return`${t?"phantom://":"https://phantom.app/ul/"}browse/${r}?ref=${r}`}},solflare:{client:"solflare",name:"Solflare",installLink:El.isFirefox?"https://addons.mozilla.org/es/firefox/addon/solflare-wallet/":"https://chromewebstore.google.com/detail/solflare-wallet/bhhhlbepdkbapadjdnnojkbgioiodbic",chainTypes:["solana"],get isInstalled(){var t;return"solflare"in window&&!!((t=window==null?void 0:window.solflare)!=null&&t.isSolflare)},getMobileRedirect({useUniversalLink:t,isSolana:e,connectOnly:n}){let r=Ny({client:this.client,isSolana:e,connectOnly:n});return`${t?"solflare://ul/v1/":"https://solflare.com/ul/v1/"}browse/${r}?ref=${r}`}},jupiter:{client:"jupiter",name:"Jupiter Wallet",installLink:"https://chromewebstore.google.com/detail/jupiter-wallet/iledlaeogohbilgbfhmbgkgmpplbfboh",chainTypes:["solana"],get isInstalled(){var t;return"jupiter"in window&&!!((t=window==null?void 0:window.jupiter)!=null&&t.isJupiter)},getMobileRedirect({isSolana:t,connectOnly:e}){let n=Ny({client:this.client,isSolana:t,connectOnly:e});return`jupjupjup://jup.ag/browse/${n}?ref=${n}`}},backpack:{client:"backpack",name:"Backpack",installLink:"https://chromewebstore.google.com/detail/backpack/aflkmfhebedbjioipglgcbcmnbpgliof",chainTypes:["ethereum","solana"],get isInstalled(){var t,e,n,r;return!(!("backpack"in window)||!((e=(t=window==null?void 0:window.backpack)==null?void 0:t.ethereum)!=null&&e.isBackpack)&&!((r=(n=window==null?void 0:window.backpack)==null?void 0:n.solana)!=null&&r.isBackpack))},getMobileRedirect({useUniversalLink:t,isSolana:e,connectOnly:n}){let r=Ny({client:this.client,isSolana:e,connectOnly:n});return`${t?"backpack://ul/v1/":"https://backpack.app/ul/v1/"}browse/${r}?ref=${r}`}},okx_wallet:{client:"okx_wallet",name:"OKX Wallet",installLink:"https://chromewebstore.google.com/detail/okx-wallet/mcohilncbfahbmgdjkbpemcciiolgcge",chainTypes:["ethereum","solana"],get isInstalled(){var t;return"okxwallet"in window&&!!((t=window==null?void 0:window.okxwallet)!=null&&t.isOkxWallet)},getMobileRedirect({isSolana:t,connectOnly:e}){return`okx://wallet/dapp/url?dappUrl=${Ny({client:this.client,isSolana:t,connectOnly:e})}`}}});function iPe({connectorType:t,walletClientType:e}){for(let n of WNe)if(t===n||e===n)return Sre[n]}function a5t({isMobile:t,walletConfig:e}){return!t&&(e==null?void 0:e.client)==="phantom"}function Ny({client:t,isSolana:e,connectOnly:n}){let r=new URL(window.location.href);return r.searchParams.set("privy_connector",e?"solana_adapter":"injected"),r.searchParams.set("privy_wallet_client",t),r.searchParams.set("privy_connect_only",String(n)),encodeURIComponent(r.href.replace(/\/$/g,""))}let sPe=class extends YOe{get walletBranding(){return{id:this.id,name:this.name,icon:this.icon}}async initialize(){this.initialized=!0,this.emit("initialized")}async connect(){throw Error("connect called for an uninstalled wallet via the SolanaNullConnector")}constructor({id:e,name:n,icon:r}){super({name:n},!1),this.connectorType="null",this.proxyProvider=new Gf(void 0,G7),this.disconnect=async()=>{throw Error("disconnect called for an uninstalled wallet via the SolanaNullConnector")},this.promptConnection=async()=>{throw Error("promptConnection called for an uninstalled wallet via the SolanaNullConnector")},this.id=e,this.name=n,this.icon=r}};function aPe(t){return t.chainType==="solana"}function oPe(t){return t.type==="solana"}class cc{constructor(e,n){this.scope=e,this.module=n}storeObject(e,n){this.setItem(e,JSON.stringify(n))}loadObject(e){const n=this.getItem(e);return n?JSON.parse(n):void 0}setItem(e,n){localStorage.setItem(this.scopedKey(e),n)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),n=[];for(let r=0;r<localStorage.length;r++){const i=localStorage.key(r);typeof i=="string"&&i.startsWith(e)&&n.push(i)}n.forEach(r=>localStorage.removeItem(r))}scopedKey(e){return`-${this.scope}${this.module?`:${this.module}`:""}:${e}`}static clearAll(){new cc("CBWSDK").clear(),new cc("walletlink").clear()}}const Jr={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}},QT={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}},Are="Unspecified error message.",lPe="Unspecified server error.";function fO(t,e=Are){if(t&&Number.isInteger(t)){const n=t.toString();if(eL(QT,n))return QT[n].message;if(kre(t))return lPe}return e}function cPe(t){if(!Number.isInteger(t))return!1;const e=t.toString();return!!(QT[e]||kre(t))}function uPe(t,{shouldIncludeStack:e=!1}={}){const n={};if(t&&typeof t=="object"&&!Array.isArray(t)&&eL(t,"code")&&cPe(t.code)){const r=t;n.code=r.code,r.message&&typeof r.message=="string"?(n.message=r.message,eL(r,"data")&&(n.data=r.data)):(n.message=fO(n.code),n.data={originalError:NV(t)})}else n.code=Jr.rpc.internal,n.message=OV(t,"message")?t.message:Are,n.data={originalError:NV(t)};return e&&(n.stack=OV(t,"stack")?t.stack:void 0),n}function kre(t){return t>=-32099&&t<=-32e3}function NV(t){return t&&typeof t=="object"&&!Array.isArray(t)?Object.assign({},t):t}function eL(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function OV(t,e){return typeof t=="object"&&t!==null&&e in t&&typeof t[e]=="string"}const xn={rpc:{parse:t=>ao(Jr.rpc.parse,t),invalidRequest:t=>ao(Jr.rpc.invalidRequest,t),invalidParams:t=>ao(Jr.rpc.invalidParams,t),methodNotFound:t=>ao(Jr.rpc.methodNotFound,t),internal:t=>ao(Jr.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code
528<= -32005');return ao(e,t)},invalidInput:t=>ao(Jr.rpc.invalidInput,t),resourceNotFound:t=>ao(Jr.rpc.resourceNotFound,t),resourceUnavailable:t=>ao(Jr.rpc.resourceUnavailable,t),transactionRejected:t=>ao(Jr.rpc.transactionRejected,t),methodNotSupported:t=>ao(Jr.rpc.methodNotSupported,t),limitExceeded:t=>ao(Jr.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>t0(Jr.provider.userRejectedRequest,t),unauthorized:t=>t0(Jr.provider.unauthorized,t),unsupportedMethod:t=>t0(Jr.provider.unsupportedMethod,t),disconnected:t=>t0(Jr.provider.disconnected,t),chainDisconnected:t=>t0(Jr.provider.chainDisconnected,t),unsupportedChain:t=>t0(Jr.provider.unsupportedChain,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:n,data:r}=t;if(!n||typeof n!="string")throw new Error('"message" must be a nonempty string');return new $re(e,n,r)}}};function ao(t,e){const[n,r]=Tre(e);return new Lre(t,n||fO(t),r)}function t0(t,e){const[n,r]=Tre(e);return new $re(t,n||fO(t),r)}function Tre(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){const{message:e,data:n}=t;
528if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,n]}}return[]}class Lre extends Error{constructor(e,n,r){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!n||typeof n!="string")throw new Error('"message" must be a nonempty string.');super(n),this.code=e,r!==void 0&&(this.data=r)}}class $re extends Lre{constructor(e,n,r){if(!dPe(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,n,r)}}function dPe(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}function pO(){return t=>t}const u6=pO(),hPe=pO(),fPe=pO();function lu(t){return Math.floor(t)}const Ire=/^[0-9]*$/,Nre=/^[a-f0-9]*$/;function jh(t){return mO(crypto.getRandomValues(new Uint8Array(t)))}function mO(t){return[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}function Rw(t){return new Uint8Array(t.match(/.{1,2}/g).map(e=>Number.parseInt(e,16)))}function Rg(t,e=!1){const n=t.toString("hex");return u6(e?`0x${n}`:n)}function NE(t){return Rg(tL(t),!0)}function Nl(t){return fPe(t.toString(10))}function d2(t){return u6(`0x${BigInt(t).toString(16)}`)}function Ore(t){return t.startsWith("0x")||t.startsWith("0X")}function yO(t){return Ore(t)?t.slice(2):t}function Pre(t){return Ore(t)?`0x${t.slice(2)}`:`0x${t}`}function J7(t){if(typeof t!="string")return!1;const e=yO(t).toLowerCase();return Nre.test(e)}function pPe(t,e=!1){if(typeof t=="string"){const n=yO(t).toLowerCase();if(Nre.test(n))return u6(e?`0x${n}`:n)}throw xn.rpc.invalidParams(`"${String(t)}" is not a hexadecimal string`)}function gO(t,e=!1){let n=pPe(t,!1);return n.length%2===1&&(n=u6(`0${n}`)),e?u6(`0x${n}`):n}function kd(t){if(typeof t=="string"){const e=yO(t).toLowerCase();if(J7(e)&&e.length===40)return hPe(Pre(e))}throw xn.rpc.invalidParams(`Invalid Ethereum address: ${String(t)}`)}function tL(t){if(Buffer.isBuffer(t))return t;if(typeof t=="string"){if(J7(t)){const e=gO(t,!1);return Buffer.from(e,"hex")}return Buffer.from(t,"utf8")}throw xn.rpc.invalidParams(`Not binary data: ${String(t)}`)}function jg(t){if(typeof t=="number"&&Number.isInteger(t))return lu(t);if(typeof t=="string"){if(Ire.test(t))return lu(Number(t));if(J7(t))return lu(Number(BigInt(gO(t,!0))))}throw xn.rpc.invalidParams(`Not an integer: ${String(t)}`)}function Oy(t){if(t!==null&&(typeof t=="bigint"||yPe(t)))return BigInt(t.toString(10));if(typeof t=="number")return BigInt(jg(t));if(typeof t=="string"){if(Ire.test(t))return BigInt(t);if(J7(t))return BigInt(gO(t,!0))}throw xn.rpc.invalidParams(`Not an integer: ${String(t)}`)}function mPe(t){if(typeof t=="string")return JSON.parse(t);if(typeof t=="object")return t;throw xn.rpc.invalidParams(`Not a JSON string or an object: ${String(t)}`)}function yPe(t){if(t==null||typeof t.constructor!="function")return!1;const{constructor:e}=t;return typeof e.config=="function"&&typeof e.EUCLID=="number"}async function gPe(){return crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!0,["deriveKey"])}async function bPe(t,e){return crypto.subtle.deriveKey({name:"ECDH",public:e},t,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}async function wPe(t,e){const n=crypto.getRandomValues(new Uint8Array(12)),r=await crypto.subtle.encrypt({name:"AES-GCM",iv:n},t,new TextEncoder().encode(e));return{iv:n,cipherText:r}}async function vPe(t,{iv:e,cipherText:n}){const r=await crypto.subtle.decrypt({name:"AES-GCM",iv:e},t,n);return new TextDecoder().decode(r)}function Rre(t){switch(t){case"public":return"spki";case"private":return"pkcs8"}}async function jre(t,e){const n=Rre(t),r=await crypto.subtle.exportKey(n,e);return mO(new Uint8Array(r))}async function Mre(t,e){const n=Rre(t),r=Rw(e).buffer;return await crypto.subtle.importKey(n,new Uint8Array(r),{name:"ECDH",namedCurve:"P-256"},!0,t==="private"?["deriveKey"]:[])}async function _Pe(t,e){const n=JSON.stringify(t,(r,i)=>{if(!(i instanceof Error))return i;const s=i;return Object.assign(Object.assign({},s.code?{code:s.code}:{}),{message:s.message})});return wPe(e,n)}async function xPe(t,e){return JSON.parse(await vPe(e,t))}const OE={storageKey:"ownPrivateKey",keyType:"private"},PE={storageKey:"ownPublicKey",keyType:"public"},RE={storageKey:"peerPublicKey",keyType:"public"};
528class CPe{constructor(){this.storage=new cc("CBWSDK","SCWKeyManager"),this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null}async getOwnPublicKey(){return await this.loadKeysIfNeeded(),this.ownPublicKey}async getSharedSecret(){return await this.loadKeysIfNeeded(),this.sharedSecret}async setPeerPublicKey(e){this.sharedSecret=null,this.peerPublicKey=e,await this.storeKey(RE,e),await this.loadKeysIfNeeded()}async clear(){this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null,this.storage.removeItem(PE.storageKey),this.storage.removeItem(OE.storageKey),this.storage.removeItem(RE.storageKey)}async generateKeyPair(){const e=await gPe();this.ownPrivateKey=e.privateKey,this.ownPublicKey=e.publicKey,await this.storeKey(OE,e.privateKey),await this.storeKey(PE,e.publicKey)}async loadKeysIfNeeded(){if(this.ownPrivateKey===null&&(this.ownPrivateKey=await this.loadKey(OE)),this.ownPublicKey===null&&(this.ownPublicKey=await this.loadKey(PE)),(this.ownPrivateKey===null||this.ownPublicKey===null)&&await this.generateKeyPair(),this.peerPublicKey===null&&(this.peerPublicKey=await this.loadKey(RE)),this.sharedSecret===null){if(this.ownPrivateKey===null||this.peerPublicKey===null)return;this.sharedSecret=await bPe(this.ownPrivateKey,this.peerPublicKey)}}async loadKey(e){const n=this.storage.getItem(e.storageKey);return n?Mre(e.keyType,n):null}async storeKey(e,n){const r=await jre(e.keyType,n);this.storage.setItem(e.storageKey,r)}}const d5="4.3.2",Dre="@coinbase/wallet-sdk";async function bO(t,e){const n=Object.assign(Object.assign({},t),{jsonrpc:"2.0",id:crypto.randomUUID()}
528),r=await window.fetch(e,{method:"POST",body:JSON.stringify(n),mode:"cors",headers:{"Content-Type":"application/json","X-Cbw-Sdk-Version":d5,"X-Cbw-Sdk-Platform":Dre}}),{result:i,error:s}=await r.json();if(s)throw s;return i}function EPe(){return globalThis.coinbaseWalletExtension}function SPe(){var t,e;try{const n=globalThis;return(t=n.ethereum)!==null&&t!==void 0?t:(e=n.top)===null||e===void 0?void 0:e.ethereum}catch{return}}function APe({metadata:t,preference:e}){var n,r;const{appName:i,appLogoUrl:s,appChainIds:a}=t;if(e.options!=="smartWalletOnly"){const l=EPe();if(l)return(n=l.setAppInfo)===null||n===void 0||n.call(l,i,s,a,e),l}const o=SPe();if(o!=null&&o.isCoinbaseBrowser)return(r=o.setAppInfo)===null||r===void 0||r.call(o,i,s,a,e),o}function kPe(t){if(!t||typeof t!="object"||Array.isArray(t))throw xn.rpc.invalidParams({message:"Expected a single, non-array, object argument.",data:t});const{method:e,params:n}=t;if(typeof e!="string"||e.length===0)throw xn.rpc.invalidParams({message:"'args.method' must be a non-empty string.",data:t});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw xn.rpc.invalidParams({message:"'args.params' must be an object or array if provided.",data:t});switch(e){case"eth_sign":case"eth_signTypedData_v2":case"eth_subscribe":case"eth_unsubscribe":throw xn.provider.unsupportedMethod()}}const PV="accounts",RV="activeChain",jV="availableChains",MV="walletCapabilities";class TPe{constructor(e){var n,r,i;this.metadata=e.metadata,this.communicator=e.communicator,this.callback=e.callback,this.keyManager=new CPe,this.storage=new cc("CBWSDK","SCWStateManager"),this.accounts=(n=this.storage.loadObject(PV))!==null&&n!==void 0?n:[],this.chain=this.storage.loadObject(RV)||{id:(i=(r=e.metadata.appChainIds)===null||r===void 0?void 0:r[0])!==null&&i!==void 0?i:1},this.handshake=this.handshake.bind(this),this.request=this.request.bind(this),this.createRequestMessage=this.createRequestMessage.bind(this),this.decryptResponseMessage=this.decryptResponseMessage.bind(this)}async handshake(e){var n,r,i,s;await((r=(n=this.communicator).waitForPopupLoaded)===null||r===void 0?void 0:r.call(n));const a=await this.createRequestMessage({handshake:{method:e.method,params:Object.assign({},this.metadata,(i=e.params)!==null&&i!==void 0?i:{})}}),o=await this.communicator.postRequestAndWaitForResponse(a);if("failure"in o.content)throw o.content.failure;const l=await Mre("public",o.sender);await this.keyManager.setPeerPublicKey(l);const f=(await this.decryptResponseMessage(o)).result;if("error"in f)throw f.error;switch(e.method){case"eth_requestAccounts":{const p=f.value;this.accounts=p,this.storage.storeObject(PV,p),(s=this.callback)===null||s===void 0||s.call(this,"accountsChanged",p);break}}}async request(e){var n;if(this.accounts.length===0)switch(e.method){case"wallet_sendCalls":return this.sendRequestToPopup(e);default:throw xn.provider.unauthorized()}switch(e.method){case"eth_requestAccounts":return(n=this.callback)===null||n===void 0||n.call(this,"connect",{chainId:d2(this.chain.id)}),this.accounts;case"eth_accounts":return this.accounts;case"eth_coinbase":return this.accounts[0];case"net_version":return this.chain.id;case"eth_chainId":return d2(this.chain.id);case"wallet_getCapabilities":return this.storage.loadObject(MV);case"wallet_switchEthereumChain":return this.handleSwitchChainRequest(e);case"eth_ecRecover":case"personal_sign":case"wallet_sign":case"personal_ecRecover":case"eth_signTransaction":case"eth_sendTransaction":case"eth_signTypedData_v1":case"eth_signTypedData_v3":case"eth_signTypedData_v4":case"eth_signTypedData":case"wallet_addEthereumChain":case"wallet_watchAsset":case"wallet_sendCalls":case"wallet_showCallsStatus":case"wallet_grantPermissions":return this.sendRequestToPopup(e);default:if(!this.chain.rpcUrl)throw xn.rpc.internal("No RPC URL set for chain");return bO(e,this.chain.rpcUrl)}}async sendRequestToPopup(e){var n,r;await((r=(n=this.communicator).waitForPopupLoaded)===null||r===void 0?void 0:r.call(n));const i=await this.sendEncryptedRequest(e),a=(await this.decryptResponseMessage(i)).result;if("error"in a)throw a.error;return a.value}async cleanup(){var e,n;this.storage.clear(),await this.keyManager.clear(),this.accounts=[],this.chain={id:(n=(e=this.metadata.appChainIds)===null||e===void 0?void 0:e[0])!==null&&n!==void 0?n:1}}async handleSwitchChainRequest(e){var n;const r=e.params;if(!r||!(!((n=r[0])===null||n===void 0)&&n.chainId))throw xn.rpc.invalidParams();const i=jg(r[0].chainId);if(this.updateChain(i))return null;const a=await this.sendRequestToPopup(e);return a===null&&this.updateChain(i),a}async sendEncryptedRequest(e){const n=await this.keyManager.getSharedSecret();if(!n)throw xn.provider.unauthorized("No valid session found, try requestAccounts before other methods");const r=await _Pe({action:e,chainId:this.chain.id},n),i=await this.createRequestMessage({encrypted:r});return this.communicator.postRequestAndWaitForResponse(i)}async createRequestMessage(e){const n=await jre("public",await this.keyManager.getOwnPublicKey());return{id:crypto.randomUUID(),sender:n,content:e,timestamp:new Date}}async decryptResponseMessage(e){var n,r;const i=e.content;if("failure"in i)throw i.failure;
528const s=await this.keyManager.getSharedSecret();if(!s)throw xn.provider.unauthorized("Invalid session");const a=await xPe(i.encrypted,s),o=(n=a.data)===null||n===void 0?void 0:n.chains;if(o){const u=Object.entries(o).map(([f,p])=>({id:Number(f),rpcUrl:p}));this.storage.storeObject(jV,u),this.updateChain(this.chain.id,u)}const l=(r=a.data)===null||r===void 0?void 0:r.capabilities;return l&&this.storage.storeObject(MV,l),a}updateChain(e,n){var r;const i=n??this.storage.loadObject(jV),s=i==null?void 0:i.find(a=>a.id===e);return s?(s!==this.chain&&(this.chain=s,this.storage.storeObject(RV,s),(r=this.callback)===null||r===void 0||r.call(this,"chainChanged",d2(s.id))),!0):!1}}var Qn={},ji={},DV;function Ure(){if(DV)return ji;DV=1,Object.defineProperty(ji,"__esModule",{value:!0}),ji.output=ji.exists=ji.hash=ji.bytes=ji.bool=ji.number=ji.isBytes=void 0;function t(l){if(!Number.isSafeInteger(l)||l<0)throw new Error(`positive integer expected, not ${l}`)}ji.number=t;function e(l){if(typeof l!="boolean")throw new Error(`boolean expected, not ${l}`)}ji.bool=e;function n(l){return l instanceof Uint8Array||l!=null&&typeof l=="object"&&l.constructor.name==="Uint8Array"}ji.isBytes=n;function r(l,...u){if(!n(l))throw new Error("Uint8Array expected");if(u.length>0&&!u.includes(l.length))throw new Error(`Uint8Array expected of length ${u}, not of length=${l.length}`)}ji.bytes=r;function i(l){if(typeof l!="function"||typeof l.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");t(l.outputLen),t(l.blockLen)}ji.hash=i;function s(l,u=!0){if(l.destroyed)throw new Error("Hash instance has been destroyed");if(u&&l.finished)throw new Error("Hash#digest() has already been called")}ji.exists=s;function a(l,u){r(l);const f=u.outputLen;if(l.length<f)throw new Error(`digestInto() expects output buffer of length at least ${f}`)}ji.output=a;const o={number:t,bool:e,bytes:r,hash:i,exists:s,output:a};return ji.default=o,ji}var Nt={},UV;function LPe(){if(UV)return Nt;UV=1,Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.add5L=Nt.add5H=Nt.add4H=Nt.add4L=Nt.add3H=Nt.add3L=Nt.add=Nt.rotlBL=Nt.rotlBH=Nt.rotlSL=Nt.rotlSH=Nt.rotr32L=Nt.rotr32H=Nt.rotrBL=Nt.rotrBH=Nt.rotrSL=Nt.rotrSH=Nt.shrSL=Nt.shrSH=Nt.toBig=Nt.split=Nt.fromBig=void 0;const t=BigInt(2**32-1),e=BigInt(32);function n(j,U=!1){return U?{h:Number(j&t),l:Number(j>>e&t)}:{h:Number(j>>e&t)|0,l:Number(j&t)|0}}Nt.fromBig=n;function r(j,U=!1){let z=new Uint32Array(j.length),D=new Uint32Array(j.length);for(let R=0;R<j.length;R++){const{h:W,l:T}=n(j[R],U);[z[R],D[R]]=[W,T]}return[z,D]}Nt.split=r;const i=(j,U)=>BigInt(j>>>0)<<e|BigInt(U>>>0);Nt.toBig=i;const s=(j,U,z)=>j>>>z;Nt.shrSH=s;const a=(j,U,z)=>j<<32-z|U>>>z;Nt.shrSL=a;const o=(j,U,z)=>j>>>z|U<<32-z;Nt.rotrSH=o;const l=(j,U,z)=>j<<32-z|U>>>z;Nt.rotrSL=l;const u=(j,U,z)=>j<<64-z|U>>>z-32;Nt.rotrBH=u;const f=(j,U,z)=>j>>>z-32|U<<64-z;Nt.rotrBL=f;const p=(j,U)=>U;Nt.rotr32H=p;const y=(j,U)=>j;Nt.rotr32L=y;const g=(j,U,z)=>j<<z|U>>>32-z;Nt.rotlSH=g;const b=(j,U,z)=>U<<z|j>>>32-z;Nt.rotlSL=b;const v=(j,U,z)=>U<<z-32|j>>>64-z;Nt.rotlBH=v;const _=(j,U,z)=>j<<z-32|U>>>64-z;Nt.rotlBL=_;function C(j,U,z,D){const R=(U>>>0)+(D>>>0);return{h:j+z+(R/2**32|0)|0,l:R|0}}Nt.add=C;const S=(j,U,z)=>(j>>>0)+(U>>>0)+(z>>>0);Nt.add3L=S;const x=(j,U,z,D)=>U+z+D+(j/2**32|0)|0;Nt.add3H=x;const A=(j,U,z,D)=>(j>>>0)+(U>>>0)+(z>>>0)+(D>>>0);Nt.add4L=A;const I=(j,U,z,D,R)=>U+z+D+R+(j/2**32|0)|0;Nt.add4H=I;const $=(j,U,z,D,R)=>(j>>>0)+(U>>>0)+(z>>>0)+(D>>>0)+(R>>>0);Nt.add5L=$;const O=(j,U,z,D,R,W)=>U+z+D+R+W+(j/2**32|0)|0;Nt.add5H=O;const P={fromBig:n,split:r,toBig:i,shrSH:s,shrSL:a,rotrSH:o,rotrSL:l,rotrBH:u,rotrBL:f,rotr32H:p,rotr32L:y,rotlSH:g,rotlSL:b,rotlBH:v,rotlBL:_,add:C,add3L:S,add3H:x,add4L:A,add4H:I,add5H:O,add5L:$};return Nt.default=P,Nt}var jE={},Py={},BV;function $Pe(){return BV||(BV=1,Object.defineProperty(Py,"__esModule",{value:!0}),Py.crypto=void 0,Py.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0),Py}var FV;function IPe(){return FV||(FV=1,(function(t){/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(t,"__esMo
528dule",{value:!0}),t.randomBytes=t.wrapXOFConstructorWithOpts=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.byteSwap32=t.byteSwapIfBE=t.byteSwap=t.isLE=t.rotl=t.rotr=t.createView=t.u32=t.u8=t.isBytes=void 0;const e=$Pe(),n=Ure();function r(D){return D instanceof Uint8Array||D!=null&&typeof D=="object"&&D.constructor.name==="Uint8Array"}t.isBytes=r;const i=D=>new Uint8Array(D.buffer,D.byteOffset,D.byteLength);t.u8=i;const s=D=>new Uint32Array(D.buffer,D.byteOffset,Math.floor(D.byteLength/4));t.u32=s;const a=D=>new DataView(D.buffer,D.byteOffset,D.byteLength);t.createView=a;const o=(D,R)=>D<<32-R|D>>>R;t.rotr=o;const l=(D,R)=>D<<R|D>>>32-R>>>0;t.rotl=l,t.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;const u=D=>D<<24&4278190080|D<<8&16711680|D>>>8&65280|D>>>24&255;t.byteSwap=u,t.byteSwapIfBE=t.isLE?D=>D:D=>(0,t.byteSwap)(D);function f(D){for(let R=0;R<D.length;R++)D[R]=(0,t.byteSwap)(D[R])}t.byteSwap32=f;const p=Array.from({length:256},(D,R)=>R.toString(16).padStart(2,"0"));function y(D){(0,n.bytes)(D);let R="";for(let W=0;W<D.length;W++)R+=p[D[W]];return R}t.bytesToHex=y;const g={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function b(D){if(D>=g._0&&D<=g._9)return D-g._0;if(D>=g._A&&D<=g._F)return D-(g._A-10);if(D>=g._a&&D<=g._f)return D-(g._a-10)}function v(D){if(typeof D!="string")throw new Error("hex string expected, got "+typeof D);const R=D.length,W=R/2;if(R%2)throw new Error("padded hex string expected, got unpadded hex of length "+R);const T=new Uint8Array(W);for(let L=0,M=0;L<W;L++,M+=2){const Z=b(D.charCodeAt(M)),H=b(D.charCodeAt(M+1));if(Z===void 0||H===void 0){const V=D[M]+D[M+1];throw new Error('hex string expected, got non-hex character "'+V+'" at index '+M)}T[L]=Z*16+H}return T}t.hexToBytes=v;const _=async()=>{};t.nextTick=_;async function C(D,R,W){let T=Date.now();for(let L=0;L<D;L++){W(L);const M=Date.now()-T;M>=0&&M<R||(await(0,t.nextTick)(),T+=M)}}t.asyncLoop=C;function S(D){if(typeof D!="string")throw new Error(`utf8ToBytes expected string, got ${typeof D}`);return new Uint8Array(new TextEncoder().encode(D))}t.utf8ToBytes=S;
528function x(D){return typeof D=="string"&&(D=S(D)),(0,n.bytes)(D),D}t.toBytes=x;function A(...D){let R=0;for(let T=0;T<D.length;T++){const L=D[T];(0,n.bytes)(L),R+=L.length}const W=new Uint8Array(R);for(let T=0,L=0;T<D.length;T++){const M=D[T];W.set(M,L),L+=M.length}return W}t.concatBytes=A;class I{clone(){return this._cloneInto()}}t.Hash=I;const $={}.toString;function O(D,R){if(R!==void 0&&$.call(R)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(D,R)}t.checkOpts=O;function P(D){const R=T=>D().update(x(T)).digest(),W=D();return R.outputLen=W.outputLen,R.blockLen=W.blockLen,R.create=()=>D(),R}t.wrapConstructor=P;function j(D){const R=(T,L)=>D(L).update(x(T)).digest(),W=D({});return R.outputLen=W.outputLen,R.blockLen=W.blockLen,R.create=T=>D(T),R}t.wrapConstructorWithOpts=j;function U(D){const R=(T,L)=>D(L).update(x(T)).digest(),W=D({});return R.outputLen=W.outputLen,R.blockLen=W.blockLen,R.create=T=>D(T),R}t.wrapXOFConstructorWithOpts=U;function z(D=32){if(e.crypto&&typeof e.crypto.getRandomValues=="function")return e.crypto.getRandomValues(new Uint8Array(D));throw new Error("crypto.getRandomValues must be defined")}t.randomBytes=z})(jE)),jE}var zV;function NPe(){if(zV)return Qn;zV=1,Object.defineProperty(Qn,"__esModule",{value:!0}),Qn.shake256=Qn.shake128=Qn.keccak_512=Qn.keccak_384=Qn.keccak_256=Qn.keccak_224=Qn.sha3_512=Qn.sha3_384=Qn.sha3_256=Qn.sha3_224=Qn.Keccak=Qn.keccakP=void 0;const t=Ure(),e=LPe(),n=IPe(),r=[],i=[],s=[],a=BigInt(0),o=BigInt(1),l=BigInt(2),u=BigInt(7),f=BigInt(256),p=BigInt(113);for(let A=0,I=o,$=1,O=0;A<24;A++){[$,O]=[O,(2*$+3*O)%5],r.push(2*(5*O+$)),i.push((A+1)*(A+2)/2%64);let P=a;for(let j=0;j<7;j++)I=(I<<o^(I>>u)*p)%f,I&l&&(P^=o<<(o<<BigInt(j))-o);s.push(P)}const[y,g]=(0,e.split)(s,!0),b=(A,I,$)=>$>32?(0,e.rotlBH)(A,I,$):(0,e.rotlSH)(A,I,$),v=(A,I,$)=>$>32?(0,e.rotlBL)(A,I,$):(0,e.rotlSL)(A,I,$);function _(A,I=24){const $=new Uint32Array(10);for(let O=24-I;O<24;O++){for(let U=0;U<10;U++)$[U]=A[U]^A[U+10]^A[U+20]^A[U+30]^A[U+40];for(let U=0;U<10;U+=2){const z=(U+8)%10,D=(U+2)%10,R=$[D],W=$[D+1],T=b(R,W,1)^$[z],L=v(R,W,1)^$[z+1];for(let M=0;M<50;M+=10)A[U+M]^=T,A[U+M+1]^=L}let P=A[2],j=A[3];for(let U=0;U<24;U++){const z=i[U],D=b(P,j,z),R=v(P,j,z),W=r[U];P=A[W],j=A[W+1],A[W]=D,A[W+1]=R}for(let U=0;U<50;U+=10){for(let z=0;z<10;z++)$[z]=A[U+z];for(let z=0;z<10;z++)A[U+z]^=~$[(z+2)%10]&$[(z+4)%10]}A[0]^=y[O],A[1]^=g[O]}$.fill(0)}Qn.keccakP=_;class C extends n.Hash{constructor(I,$,O,P=!1,j=24){if(super(),this.blockLen=I,this.suffix=$,this.outputLen=O,this.enableXOF=P,this.rounds=j,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,t.number)(O),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,n.u32)(this.state)}keccak(){n.isLE||(0,n.byteSwap32)(this.state32),_(this.state32,this.rounds),n.isLE||(0,n.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(I){(0,t.exists)(this);const{blockLen:$,state:O}=this;I=(0,n.toBytes)(I);const P=I.length;for(let j=0;j<P;){const U=Math.min($-this.pos,P-j);for(let z=0;z<U;z++)O[this.pos++]^=I[j++];this.pos===$&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:I,suffix:$,pos:O,blockLen:P}=this;I[O]^=$,($&128)!==0&&O===P-1&&this.keccak(),I[P-1]^=128,this.keccak()}writeInto(I){(0,t.exists)(this,!1),(0,t.bytes)(I),this.finish();const $=this.state,{blockLen:O}=this;for(let P=0,j=I.length;P<j;){this.posOut>=O&&this.keccak();const U=Math.min(O-this.posOut,j-P);I.set($.subarray(this.posOut,this.posOut+U),P),this.posOut+=U,P+=U}return I}xofInto(I){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(I)}xof(I){return(0,t.number)(I),this.xofInto(new Uint8Array(I))}digestInto(I){if((0,t.output)(I,this),this.finished)throw new Error("digest() was already called");return this.writeInto(I),this.destroy(),I}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(I){const{blockLen:$,suffix:O,outputLen:P,rounds:j,enableXOF:U}=this;return I||(I=new C($,O,P,U,j)),I.state32.set(this.state32),I.pos=this.pos,I.posOut=this.posOut,I.finished=this.finished,I.rounds=j,I.suffix=O,I.outputLen=P,I.enableXOF=U,I.destroyed=this.destroyed,I}}Qn.Keccak=C;const S=(A,I,$)=>(0,n.wrapConstructor)(()=>new C(I,A,$));Qn.sha3_224=S(6,144,224/8),Qn.sha3_256=S(6,136,256/8),Qn.sha3_384=S(6,104,384/8),Qn.sha3_512=S(6,72,512/8),Qn.keccak_224=S(1,144,224/8),Qn.keccak_256=S(1,136,256/8),Qn.keccak_384=S(1,104,384/8),Qn.keccak_512=S(1,72,512/8);const x=(A,I,$)=>(0,n.wrapXOFConstructorWithOpts)((O={})=>new C(I,A,O.dkLen===void 0?$:O.dkLen,!0));return Qn.shake128=x(31,168,128/8),Qn.shake256=x(31,136,256/8),Qn}var ME,VV;function Bre(){if(VV)return ME;VV=1;const{keccak_256:t}=NPe();function e(g){return Buffer.allocUnsafe(g).fill(0)}function n(g){return g.toString(2).length}function r(g,b){let v=g.toString(16);v.length%2!==0&&(v="0"+v);const _=v.match(/.{1,2}/g).map(C=>parseInt(C,16));for(;_.length<b;)_.unshift(0);return Buffer.from(_)}function i(g,b){const v=g<0n;let _;if(v){const C=(1n<<BigInt(b))-1n;_=(~g&C)+1n}else _=g;return _&=(1n<<BigInt(b))-1n,_}function s(g,b,v){const _=e(b);return g=o(g),v?g.length<b?(g.copy(_),_):g.slice(0,b):g.length<b?(g.copy(_,b-g.length),_):g.slice(-b)}function a(g,b){return s(g,b,!0)}function o(g){if(!Buffer.isBuffer(g))if(Array.isArray(g))g=Buffer.from(g);else if(typeof g=="string")p(g)?g=Buffer.from(f(y(g)),"hex"):g=Buffer.from(g);else if(typeof g=="number")g=intToBuffer(g);
528else if(g==null)g=Buffer.allocUnsafe(0);else if(typeof g=="bigint")g=r(g);else if(g.toArray)g=Buffer.from(g.toArray());else throw new Error("invalid type");return g}function l(g){return g=o(g),"0x"+g.toString("hex")}function u(g,b){if(g=o(g),b||(b=256),b!==256)throw new Error("unsupported");return Buffer.from(t(new Uint8Array(g)))}function f(g){return g.length%2?"0"+g:g}function p(g){return typeof g=="string"&&g.match(/^0x[0-9A-Fa-f]*$/)}function y(g){return typeof g=="string"&&g.startsWith("0x")?g.slice(2):g}return ME={zeros:e,setLength:s,setLengthRight:a,isHexString:p,stripHexPrefix:y,toBuffer:o,bufferToHex:l,keccak:u,bitLengthFromBigInt:n,bufferBEFromBigInt:r,twosFromBigInt:i},ME}var DE,HV;function OPe(){if(HV)return DE;HV=1;const t=Bre();function e(y){return y.startsWith("int[")?"int256"+y.slice(3):y==="int"?"int256":y.startsWith("uint[")?"uint256"+y.slice(4):y==="uint"?"uint256":y.startsWith("fixed[")?"fixed128x128"+y.slice(5):y==="fixed"?"fixed128x128":y.startsWith("ufixed[")?"ufixed128x128"+y.slice(6):y==="ufixed"?"ufixed128x128":y}function n(y){return Number.parseInt(/^\D+(\d+)$/.exec(y)[1],10)}function r(y){var g=/^\D+(\d+)x(\d+)$/.exec(y);return[Number.parseInt(g[1],10),Number.parseInt(g[2],10)]}function i(y){var g=y.match(/(.*)\[(.*?)\]$/);return g?g[2]===""?"dynamic":Number.parseInt(g[2],10):null}function s(y){var g=typeof y;if(g==="string"||g==="number")return BigInt(y);if(g==="bigint")return y;throw new Error("Argument is not a number")}function a(y,g){var b,v,_,C;if(y==="address")return a("uint160",s(g));if(y==="bool")return a("uint8",g?1:0);if(y==="string")return a("bytes",new Buffer(g,"utf8"));if(l(y)){if(typeof g.length>"u")throw new Error("Not an array?");if(b=i(y),b!=="dynamic"&&b!==0&&g.length>b)throw new Error("Elements exceed array size: "+b);_=[],y=y.slice(0,y.lastIndexOf("[")),typeof g=="string"&&(g=JSON.parse(g));for(C in g)_.push(a(y,g[C]));if(b==="dynamic"){var S=a("uint256",g.length);_.unshift(S)}return Buffer.concat(_)}else{if(y==="bytes")return g=new Buffer(g),_=Buffer.concat([a("uint256",g.length),g]),g.length%32!==0&&(_=Buffer.concat([_,t.zeros(32-g.length%32)])),_;if(y.startsWith("bytes")){if(b=n(y),b<1||b>32)throw new Error("Invalid bytes<N> width: "+b);return t.setLengthRight(g,32)}else if(y.startsWith("uint")){if(b=n(y),b%8||b<8||b>256)throw new Error("Invalid uint<N> width: "+b);v=s(g);const x=t.bitLengthFromBigInt(v);if(x>b)throw new Error("Supplied uint exceeds width: "+b+" vs "+x);if(v<0)throw new Error("Supplied uint is negative");return t.bufferBEFromBigInt(v,32)}else if(y.startsWith("int")){if(b=n(y),b%8||b<8||b>256)throw new Error("Invalid int<N> width: "+b);v=s(g);const x=t.bitLengthFromBigInt(v);if(x>b)throw new Error("Supplied int exceeds width: "+b+" vs "+x);const A=t.twosFromBigInt(v,256);return t.bufferBEFromBigInt(A,32)}else if(y.startsWith("ufixed")){if(b=r(y),v=s(g),v<0)throw new Error("Supplied ufixed is negative");return a("uint256",v*BigInt(2)**BigInt(b[1]))}else if(y.startsWith("fixed"))return b=r(y),a("int256",s(g)*BigInt(2)**BigInt(b[1]))}throw new Error("Unsupported or invalid type: "+y)}function o(y){return y==="string"||y==="bytes"||i(y)==="dynamic"}function l(y){return y.lastIndexOf("]")===y.length-1}function u(y,g){var b=[],v=[],_=32*y.length;for(var C in y){var S=e(y[C]),x=g[C],A=a(S,x);o(S)?(b.push(a("uint256",_)),v.push(A),_+=A.length):b.push(A)}return Buffer.concat(b.concat(v))}function f(y,g){if(y.length!==g.length)throw new Error("Number of types are not matching the values");for(var b,v,_=[],C=0;C<y.length;C++){var S=e(y[C]),x=g[C];if(S==="bytes")_.push(x);else if(S==="string")_.push(new Buffer(x,"utf8"));else if(S==="bool")_.push(new Buffer(x?"01":"00","hex"));else if(S==="address")_.push(t.setLength(x,20));else if(S.startsWith("bytes")){if(b=n(S),b<1||b>32)throw new Error("Invalid bytes<N> width: "+b);_.push(t.setLengthRight(x,b))}else if(S.startsWith("uint")){if(b=n(S),b%8||b<8||b>256)throw new Error("Invalid uint<N> width: "+b);v=s(x);const A=t.bitLengthFromBigInt(v);if(A>b)throw new Error("Supplied uint exceeds width: "+b+" vs "+A);_.push(t.bufferBEFromBigInt(v,b/8))}else if(S.startsWith("int")){if(b=n(S),b%8||b<8||b>256)throw new Error("Invalid int<N> width: "+b);v=s(x);const A=t.bitLengthFromBigInt(v);if(A>b)throw new Error("Supplied int exceeds width: "+b+" vs "+A);const I=t.twosFromBigInt(v,b);_.push(t.bufferBEFromBigInt(I,b/8))}else throw new Error("Unsupported or invalid type: "+S)}return Buffer.concat(_)}function p(y,g){return t.keccak(f(y,g))}return DE={rawEncode:u,solidityPack:f,soliditySHA3:p},DE}var UE,WV;function PPe(){if(WV)return UE;WV=1;const t=Bre(),e=OPe(),n={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},r={encodeData(s,a,o,l=!0){const u=["bytes32"],f=[this.hashType(s,o)];if(l){const p=(y,g,b)=>{if(o[g]!==void 0)return["bytes32",b==null?"0x0000000000000000000000000000000000000000000000000000000000000000":t.keccak(this.encodeData(g,b,o,l))];if(b===void 0)throw new Error(`missing value for field ${y} of type ${g}`);if(g==="bytes")return["bytes32",t.keccak(b)];if(g==="string")return typeof b=="string"&&(b=Buffer.from(b,"utf8")),["bytes32",t.keccak(b)];if(g.lastIndexOf("]")===g.length-1){const v=g.slice(0,g.lastIndexOf("[")),_=b.map(C=>p(y,v,C));return["bytes32",t.keccak(e.rawEncode(_.map(([C])=>C),_.map(([,C])=>C)))]}return[g,b]};for(const y of o[s]){const[g,b]=p(y.name,y.type,a[y.name]);u.push(g),f.push(b)}}else for(const p of o[s]){let y=a[p.name];if(y!==void 0)if(p.type==="bytes")u.push("bytes32"),y=t.keccak(y),f.push(y);else if(p.type==="string")u.push("bytes32"),typeof y=="string"&&(y=Buffer.from(y,"utf8")),y=t.keccak(y),f.push(y);else if(o[p.type]!==void 0)u.push("bytes32"),y=t.keccak(this.encodeData(p.type,y,o,l)),f.push(y);else{if(p.type.lastIndexOf("]")===p.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");u.push(p.type),f.push(y)}}return e.rawEncode(u,f)},encodeType(s,a){let o="",l=this.findTypeDependencies(s,a).filter(u=>u!==s);l=[s].concat(l.sort());for(const u of l){if(!a[u])throw new Error("No type definition specified: "+u);o+=u+"("+a[u].map(({name:p,type:y})=>y+" "+p).join(",")+")"}return o},findTypeDependencies(s,a,o=[]){if(s=s.match(/^\w*/)[0],o.includes(s)||a[s]===void 0)return o;o.push(s);for(const l of a[s])for(const u of this.findTypeDependencies(l.type,a,o))!o.includes(u)&&o.push(u);return o},hashStruct(s,a,o,l=!0){return t.keccak(this.encodeData(s,a,o,l))},hashType(s,a){return t.keccak(this.encodeType(s,a))},sanitizeData(s){const a={};for(const o in n.properties)s[o]&&(a[o]=s[o]);return a.types&&(a.types=Object.assign({EIP712Domain:[]},a.types)),a},hash(s,a=!0){const o=this.sanitizeData(s),l=[Buffer.from("1901","hex")];return l.push(this.hashStruct("EIP712Domain",o.domain,o.types,a)),o.primaryType!=="EIP712Domain"&&l.push(this.hashStruct(o.primaryType,o.message,o.types,a)),t.keccak(Buffer.concat(l))}};UE={TYPED_MESSAGE_SCHEMA:n,TypedDataUtils:r,hashForSignTypedDataLegacy:function(s){return i(s.data)},hashForSignTypedData_v3:function(s){return r.hash(s.data,!1)},hashForSignTypedData_v4:function(s){return r.hash(s.data)}};function i(s){const a=new Error("Expect argument to be non-empty array");if(typeof s!="object"||!s.length)throw a;const o=s.map(function(f){return f.type==="bytes"?t.toBuffer(f.value):f.value}),l=s.map(function(f){return f.type}),u=s.map(function(f){if(!f.name)throw a;return f.type+" "+f.name});return e.soliditySHA3(["bytes32","bytes32"],[e.soliditySHA3(new Array(s.length).fill("string"),u),e.soliditySHA3(l,o)])}return UE}var RPe=PPe();
528const M4=Wa(RPe),jPe="walletUsername",nL="Addresses",MPe="AppVersion";function ls(t){return t.errorMessage!==void 0}class DPe{constructor(e){this.secret=e}async encrypt(e){const n=this.secret;if(n.length!==64)throw Error("secret must be 256 bits");const r=crypto.getRandomValues(new Uint8Array(12)),i=await crypto.subtle.importKey("raw",Rw(n),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=new TextEncoder,a=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:r},i,s.encode(e)),o=16,l=a.slice(a.byteLength-o),u=a.slice(0,a.byteLength-o),f=new Uint8Array(l),p=new Uint8Array(u),y=new Uint8Array([...r,...f,...p]);return mO(y)}async decrypt(e){const n=this.secret;if(n.length!==64)throw Error("secret must be 256 bits");return new Promise((r,i)=>{(async function(){const s=await crypto.subtle.importKey("raw",Rw(n),{name:"aes-gcm"},!1,["encrypt","decrypt"]),a=Rw(e),o=a.slice(0,12),l=a.slice(12,28),u=a.slice(28),f=new Uint8Array([...u,...l]),p={name:"AES-GCM",iv:new Uint8Array(o)};try{const y=await window.crypto.subtle.decrypt(p,s,f),g=new TextDecoder;r(g.decode(y))}catch(y){i(y)}})()})}}class UPe{constructor(e,n,r){this.linkAPIUrl=e,this.sessionId=n;const i=`${n}:${r}`;this.auth=`Basic ${btoa(i)}`}async markUnseenEventsAsSeen(e){return Promise.all(e.map(n=>fetch(`${this.linkAPIUrl}/events/${n.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(n=>console.error("Unabled to mark event as failed:",n))}async fetchUnseenEvents(){var e;const n=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(n.ok){const{events:r,error:i}=await n.json();if(i)throw new Error(`Check unseen events failed: ${i}`);const s=(e=r==null?void 0:r.filter(a=>a.event==="Web3Response").map(a=>({type:"Event",sessionId:this.sessionId,eventId:a.id,event:a.event,data:a.data})))!==null&&e!==void 0?e:[];return this.markUnseenEventsAsSeen(s),s}throw new Error(`Check unseen events failed: ${n.status}`)}}var wu;(function(t){t[t.DISCONNECTED=0]="DISCONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED"})(wu||(wu={}));class BPe{setConnectionStateListener(e){this.connectionStateListener=e}setIncomingDataListener(e){this.incomingDataListener=e}constructor(e,n=WebSocket){this.WebSocketClass=n,this.webSocket=null,this.pendingData=[],this.url=e.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((e,n)=>{var r;let i;try{this.webSocket=i=new this.WebSocketClass(this.url)}catch(s){n(s);return}(r=this.connectionStateListener)===null||r===void 0||r.call(this,wu.CONNECTING),i.onclose=s=>{var a;this.clearWebSocket(),n(new Error(`websocket error ${s.code}: ${s.reason}`)),(a=this.connectionStateListener)===null||a===void 0||a.call(this,wu.DISCONNECTED)},i.onopen=s=>{var a;e(),(a=this.connectionStateListener)===null||a===void 0||a.call(this,wu.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(l=>this.sendData(l)),this.pendingData=[])},i.onmessage=s=>{var a,o;if(s.data==="h")(a=this.incomingDataListener)===null||a===void 0||a.call(this,{type:"Heartbeat"});else try{const l=JSON.parse(s.data);(o=this.incomingDataListener)===null||o===void 0||o.call(this,l)}catch{}}})}disconnect(){var e;const{webSocket:n}=this;if(n){this.clearWebSocket(),(e=this.connectionStateListener)===null||e===void 0||e.call(this,wu.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{n.close()}catch{}}}sendData(e){const{webSocket:n}=this;if(!n){this.pendingData.push(e),this.connect();return}n.send(e)}clearWebSocket(){const{webSocket:e}=this;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}}const qV=1e4,FPe=6e4;class zPe{constructor({session:e,linkAPIUrl:n,listener:r}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=lu(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=s=>{if(!s)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",o=>
528s.JsonRpcUrl&&this.handleChainUpdated(o,s.JsonRpcUrl)]]).forEach((o,l)=>{const u=s[l];u!==void 0&&o(u)})},this.handleDestroyed=s=>{var a;s==="1"&&((a=this.listener)===null||a===void 0||a.resetAndReload())},this.handleAccountUpdated=async s=>{var a;const o=await this.cipher.decrypt(s);(a=this.listener)===null||a===void 0||a.accountUpdated(o)},this.handleMetadataUpdated=async(s,a)=>{var o;const l=await this.cipher.decrypt(a);(o=this.listener)===null||o===void 0||o.metadataUpdated(s,l)},this.handleWalletUsernameUpdated=async s=>{this.handleMetadataUpdated(jPe,s)},this.handleAppVersionUpdated=async s=>{this.handleMetadataUpdated(MPe,s)},this.handleChainUpdated=async(s,a)=>{var o;const l=await this.cipher.decrypt(s),u=await this.cipher.decrypt(a);(o=this.listener)===null||o===void 0||o.chainUpdated(l,u)},this.session=e,this.cipher=new DPe(e.secret),this.listener=r;const i=new BPe(`${n}/rpc`,WebSocket);i.setConnectionStateListener(async s=>{let a=!1;switch(s){case wu.DISCONNECTED:if(!this.destroyed){const o=async()=>{await new Promise(l=>setTimeout(l,5e3)),this.destroyed||i.connect().catch(()=>{o()})};o()}break;case wu.CONNECTED:a=await this.handleConnected(),this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},qV),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case wu.CONNECTING:break}this.connected!==a&&(this.connected=a)}),i.setIncomingDataListener(s=>{var a;switch(s.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const o=s.type==="IsLinkedOK"?s.linked:void 0;this.linked=o||s.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{this.handleSessionMetadataUpdated(s.metadata);break}case"Event":{this.handleIncomingEvent(s);break}}s.id!==void 0&&((a=this.requestResolutions.get(s.id))===null||a===void 0||a(s))}),this.ws=i,this.http=new UPe(n,e.id,e.key)}connect(){if(this.destroyed)throw new Error("instance is destroyed");this.ws.connect()}async destroy(){this.destroyed||(await this.makeRequest({type:"SetSessionConfig",id:lu(this.nextReqId++),sessionId:this.session.id,metadata:{__destroyed:"1"}},{timeout:1e3}),this.destroyed=!0,this.ws.disconnect(),this.listener=void 0)}get connected(){return this._connected}set connected(e){this._connected=e}get linked(){return this._linked}set linked(e){var n,r;this._linked=e,e&&((n=this.onceLinked)===null||n===void 0||n.call(this)),(r=this.listener)===null||r===void 0||r.linkedUpdated(e)}setOnceLinked(e){return new Promise(n=>{this.linked?e().then(n):this.onceLinked=()=>{e().then(n),this.onceLinked=void 0}})}async handleIncomingEvent(e){var n;if(e.type!=="Event"||e.event!=="Web3Response")return;const r=await this.cipher.decrypt(e.data),i=JSON.parse(r);if(i.type!=="WEB3_RESPONSE")return;const{id:s,response:a}=i;(n=this.listener)===null||n===void 0||n.handleWeb3ResponseMessage(s,a)}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(e=>setTimeout(e,250));try{await this.fetchUnseenEventsAPI()}catch(e){console.error("Unable to check for unseen events",e)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(n=>this.handleIncomingEvent(n))}async publishEvent(e,n,r=!1){const i=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},n),{origin:location.origin,location:location.href,relaySource:"coinbaseWalletExtension"in window&&window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),s={type:"PublishEvent",id:lu(this.nextReqId++),sessionId:this.session.id,event:e,data:i,callWebhook:r};return this.setOnceLinked(async()=>{const a=await this.makeRequest(s);if(a.type==="Fail")throw new Error(a.error||"failed to publish event");return a.eventId})}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>qV*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(e,n={timeout:FPe}){const r=e.id;this.sendData(e);let i;return Promise.race([new Promise((s,a)=>{i=window.setTimeout(()=>{a(new Error(`request ${r} timed out`))},n.timeout)}),new Promise(s=>{this.requestResolutions.set(r,a=>{clearTimeout(i),s(a),this.requestResolutions.delete(r)})})])}
528async handleConnected(){return(await this.makeRequest({type:"HostSession",id:lu(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key})).type==="Fail"?!1:(this.sendData({type:"IsLinked",id:lu(this.nextReqId++),sessionId:this.session.id}),this.sendData({type:"GetSessionConfig",id:lu(this.nextReqId++),sessionId:this.session.id}),!0)}}class VPe{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,n=Pre(e.toString(16));return this.callbacks.get(n)&&this.callbacks.delete(n),e}}function HPe(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}function wO(t,...e){if(!HPe(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error(`Uint8Array expected of length ${e}, not of length=${t.length}`)}function ZV(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function WPe(t,e){wO(t);const n=e.outputLen;if(t.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const BE=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Ol=(t,e)=>t<<32-e|t>>>e;new Uint8Array(new Uint32Array([287454020]).buffer)[0];const qPe=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function ZPe(t){wO(t);let e="";for(let n=0;n<t.length;n++)e+=qPe[t[n]];return e}function KPe(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Fre(t){return typeof t=="string"&&(t=KPe(t)),wO(t),t}let GPe=class{clone(){return this._cloneInto()}};function YPe(t){const e=r=>t().update(Fre(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function JPe(t,e,n,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,r);const i=BigInt(32),s=BigInt(4294967295),a=Number(n>>i&s),o=Number(n&s),l=r?4:0,u=r?0:4;t.setUint32(e+l,a,r),t.setUint32(e+u,o,r)}const XPe=(t,e,n)=>t&e^~t&n,QPe=(t,e,n)=>t&e^t&n^e&n;let eRe=class extends GPe{constructor(e,n,r,i){super(),this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=BE(this.buffer)}update(e){ZV(this);const{view:n,buffer:r,blockLen:i}=this;e=Fre(e);const s=e.length;for(let a=0;a<s;){const o=Math.min(i-this.pos,s-a);if(o===i){const l=BE(e);for(;i<=s-a;a+=i)this.process(l,a);continue}r.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===i&&(this.process(n,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){ZV(this),WPe(e,this),this.finished=!0;const{buffer:n,view:r,blockLen:i,isLE:s}=this;let{pos:a}=this;n[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>i-a&&(this.process(r,0),a=0);for(let p=a;p<i;p++)n[p]=0;JPe(r,i-8,BigInt(this.length*8),s),this.process(r,0);const o=BE(e),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=l/4,f=this.get();if(u>f.length)throw new Error("_sha2: outputLen bigger than state");for(let p=0;p<u;p++)o.setUint32(4*p,f[p],s)}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const r=e.slice(0,n);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:n,buffer:r,length:i,finished:s,destroyed:a,pos:o}=this;return e.length=i,e.pos=o,e.finished=s,e.destroyed=a,i%n&&e.buffer.set(r),e}};const tRe=new Uint32Array([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,2756
528734187,3204031479,3329325298]),Td=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ld=new Uint32Array(64);let nRe=class extends eRe{constructor(){super(64,32,8,!1),this.A=Td[0]|0,this.B=Td[1]|0,this.C=Td[2]|0,this.D=Td[3]|0,this.E=Td[4]|0,this.F=Td[5]|0,this.G=Td[6]|0,this.H=Td[7]|0}get(){const{A:e,B:n,C:r,D:i,E:s,F:a,G:o,H:l}=this;return[e,n,r,i,s,a,o,l]}set(e,n,r,i,s,a,o,l){this.A=e|0,this.B=n|0,this.C=r|0,this.D=i|0,this.E=s|0,this.F=a|0,this.G=o|0,this.H=l|0}process(e,n){for(let p=0;p<16;p++,n+=4)Ld[p]=e.getUint32(n,!1);for(let p=16;p<64;p++){const y=Ld[p-15],g=Ld[p-2],b=Ol(y,7)^Ol(y,18)^y>>>3,v=Ol(g,17)^Ol(g,19)^g>>>10;Ld[p]=v+Ld[p-7]+b+Ld[p-16]|0}let{A:r,B:i,C:s,D:a,E:o,F:l,G:u,H:f}=this;for(let p=0;p<64;p++){const y=Ol(o,6)^Ol(o,11)^Ol(o,25),g=f+y+XPe(o,l,u)+tRe[p]+Ld[p]|0,v=(Ol(r,2)^Ol(r,13)^Ol(r,22))+QPe(r,i,s)|0;f=u,u=l,l=o,o=a+g|0,a=s,s=i,i=r,r=g+v|0}r=r+this.A|0,i=i+this.B|0,s=s+this.C|0,a=a+this.D|0,o=o+this.E|0,l=l+this.F|0,u=u+this.G|0,f=f+this.H|0,this.set(r,i,s,a,o,l,u,f)}roundClean(){Ld.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};const rRe=YPe(()=>new nRe),KV="session:id",GV="session:secret",YV="session:linked";class q0{constructor(e,n,r,i=!1){this.storage=e,this.id=n,this.secret=r,this.key=ZPe(rRe(`${n}, ${r} WalletLink`)),this._linked=!!i}static create(e){const n=jh(16),r=jh(32);return new q0(e,n,r).save()}static load(e){const n=e.getItem(KV),r=e.getItem(YV),i=e.getItem(GV);return n&&i?new q0(e,n,i,r==="1"):null}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this.storage.setItem(KV,this.id),this.storage.setItem(GV,this.secret),this.persistLinked(),this}persistLinked(){this.storage.setItem(YV,this._linked?"1":"0")}}function iRe(){try{return window.frameElement!==null}catch{return!1}}function sRe(){try{return iRe()&&window.top?window.top.location:window.location}catch{return window.location}}function aRe(){var t;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((t=window==null?void 0:window.navigator)===null||t===void 0?void 0:t.userAgent)}function zre(){var t,e;return(e=(t=window==null?void 0:window.matchMedia)===null||t===void 0?void 0:t.call(window,"(prefers-color-scheme: dark)").matches)!==null&&e!==void 0?e:!1}const oRe='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';function Vre(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(oRe)),document.documentElement.appendChild(t)}function Hre(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=Hre(t[e]))&&(r&&(r+=" "),r+=n);else for(e in t)t[e]&&(r&&(r+=" "),r+=e);return r}function Mg(){for(var t,e,n=0,r="";n<arguments.length;)(t=arguments[n++])&&(e=Hre(t))&&(r&&(r+=" "),r+=e);return r}var X7,kr,Wre,Mh,JV,qre,rL,vO,iL,sL,d6={},Zre=[],lRe=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,_O=Array.isArray;function h2(t,e){for(var n in e)t[n]=e[n];return t}function Kre(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Gn(t,e,n){var r,i,s,a={};for(s in e)s=="key"?r=e[s]:s=="ref"?i=e[s]:a[s]=e[s];if(arguments.length>2&&(a.children=arguments.length>3?X7.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)a[s]===void 0&&(a[s]=t.defaultProps[s]);return jw(t,a,r,i,null)}function jw(t,e,n,r,i){var s={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++Wre,__i:-1,__u:0};return i==null&&kr.vnode!=null&&kr.vnode(s),s}function Q7(t){return t.children}function Mw(t,e){this.props=t,this.context=e}function S1(t,e){if(e==null)return t.__?S1(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?S1(t):null}function Gre(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return Gre(t)}}function XV(t){(!t.__d&&(t.__d=!0)&&Mh.push(t)&&!sv.__r++||JV!==kr.debounceRendering)&&((JV=kr.debounceRendering)||qre)(sv)}function sv(){var t,e,n,r,i,s,a,o;for(Mh.sort(rL);t=Mh.shift();)t.__d&&(e=Mh.length,r=void 0,s=(i=(n=t).__v).__e,a=[],o=[],n.__P&&((r=h2({},i)).__v=i.__v+1,kr.vnode&&kr.vnode(r),xO(n.__P,r,i,n.__n,n.__P.namespaceURI,32&i.__u?[s]:null,a,s??S1(i),!!(32&i.__u),o),r.__v=i.__v,r.__.__k[r.__i]=r,Xre(a,r,o),r.__e!=s&&Gre(r)),Mh.length>e&&Mh.sort(rL));sv.__r=0}function Yre(t,e,n,r,i,s,a,o,l,u,f){var p,y,g,b,v,_=r&&r.__k||Zre,C=e.length;for(n.__d=l,cRe(n,e,_),l=n.__d,p=0;p<C;p++)(g=n.__k[p])!=null&&(y=g.__i===-1?d6:_[g.__i]||d6,g.__i=p,xO(t,g,y,i,s,a,o,l,u,f),b=g.__e,g.ref&&y.ref!=g.ref&&(y.ref&&CO(y.ref,null,g),f.push(g.ref,g.__c||b,g)),v==null&&b!=null&&(v=b),65536&g.__u||y.__k===g.__k?l=Jre(g,l,t):typeof g.type=="function"&&g.__d!==void 0?l=g.__d:b&&(l=b.nextSibling),g.__d=void 0,g.__u&=-196609);n.__d=l,n.__e=v}function cRe(t,e,n){var r,i,s,a,o,l=e.length,u=n.length,f=u,p=0;for(t.__k=[],r=0;r<l;r++)(i=e[r])!=null&&typeof i!="boolean"&&typeof i!="function"?(a=r+p,(i=t.__k[r]=typeof i=="string"||typeof i=="number"||typeof i=="bigint"||i.constructor==String?jw(null,i,null,null,null):_O(i)?jw(Q7,{children:i},null,null,null):i.constructor===void 0&&i.__b>0?jw(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i).__=t,i.__b=t.__b+1,s=null,(o=i.__i=uRe(i,n,a,f))!==-1&&(f--,(s=n[o])&&(s.__u|=131072)),s==null||s.__v===null?(o==-1&&p--,typeof i.type!="function"&&(i.__u|=65536)):o!==a&&(o==a-1?p--:o==a+1?p++:(o>a?p--:p++,i.__u|=65536))):i=t.__k[r]=null;if(f)for(r=0;r<u;r++)(s=n[r])!=null&&(131072&s.__u)==0&&(s.__e==t.__d&&(t.__d=S1(s)),Qre(s,s))}function Jre(t,e,n){var r,i;if(typeof t.type=="function"){for(r=t.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=t,e=Jre(r[i],e,n));return e}t.__e!=e&&(e&&t.type&&!n.contains(e)&&(e=S1(t)),n.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType===8);return e}function uRe(t,e,n,r){var i=t.key,s=t.type,a=n-1,o=n+1,l=e[n];if(l===null||l&&i==l.key&&s===l.type&&(131072&l.__u)==0)return n;if(r>(l!=null&&(131072&l.__u)==0?1:0))for(;a>=0||o<e.length;){if(a>=0){if((l=e[a])&&(131072&l.__u)==0&&i==l.key&&s===l.type)return a;a--}if(o<e.length){if((l=e[o])&&(131072&l.__u)==0&&i==l.key&&s===l.type)return o;o++}}return-1}function QV(t,e,n){e[0]==="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||lRe.test(e)?n:n+"px"}function D4(t,e,n,r,i){var s;e:if(e==="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||QV(t.style,e,"");if(n)for(e in n)r&&n[e]===r[e]||QV(t.style,e,n[e])}else if(e[0]==="o"&&e[1]==="n")s=e!==(e=e.replace(/(PointerCapture)$|Capture$/i,"$1")),e=e.toLowerCase()in t||e==="onFocusOut"||e==="onFocusIn"?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=n,n?r?n.u=r.u:(n.u=vO,t.addEventListener(e,s?sL:iL,s)):t.removeEventListener(e,s?sL:iL,s);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!=="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function eH(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=vO++;else if(e.t<n.u)return;return n(kr.event?kr.event(e):e)}}}function xO(t,e,n,r,i,s,a,o,l,u){var f,p,y,g,b,v,_,C,S,x,A,I,$,O,P,j,U=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),s=[o=e.__e=n.__e]),(f=kr.__b)&&f(e);e:if(typeof U=="function")try{if(C=e.props,S="prototype"in U&&U.prototype.render,x=(f=U.contextType)&&r[f.__c],A=f?x?x.props.value:f.__:r,n.__c?_=(p=e.__c=n.__c).__=p.__E:(S?e.__c=p=new U(C,A):(e.__c=p=new Mw(C,A),p.constructor=U,p.render=hRe),x&&x.sub(p),p.props=C,p.state||(p.state={}),p.context=A,p.__n=r,y=p.__d=!0,p.__h=[],p._sb=[]),S&&p.__s==null&&(p.__s=p.state),S&&U.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=h2({}
vendor: 4,834 bytes, line 528
528,p.__s)),h2(p.__s,U.getDerivedStateFromProps(C,p.__s))),g=p.props,b=p.state,p.__v=e,y)S&&U.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),S&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(S&&U.getDerivedStateFromProps==null&&C!==g&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(C,A),!p.__e&&(p.shouldComponentUpdate!=null&&p.shouldComponentUpdate(C,p.__s,A)===!1||e.__v===n.__v)){for(e.__v!==n.__v&&(p.props=C,p.state=p.__s,p.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(z){z&&(z.__=e)}),I=0;I<p._sb.length;I++)p.__h.push(p._sb[I]);p._sb=[],p.__h.length&&a.push(p);break e}p.componentWillUpdate!=null&&p.componentWillUpdate(C,p.__s,A),S&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(g,b,v)})}if(p.context=A,p.props=C,p.__P=t,p.__e=!1,$=kr.__r,O=0,S){for(p.state=p.__s,p.__d=!1,$&&$(e),f=p.render(p.props,p.state,p.context),P=0;P<p._sb.length;P++)p.__h.push(p._sb[P]);p._sb=[]}else do p.__d=!1,$&&$(e),f=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++O<25);p.state=p.__s,p.getChildContext!=null&&(r=h2(h2({},r),p.getChildContext())),S&&!y&&p.getSnapshotBeforeUpdate!=null&&(v=p.getSnapshotBeforeUpdate(g,b)),Yre(t,_O(j=f!=null&&f.type===Q7&&f.key==null?f.props.children:f)?j:[j],e,n,r,i,s,a,o,l,u),p.base=e.__e,e.__u&=-161,p.__h.length&&a.push(p),_&&(p.__E=p.__=null)}catch(z){if(e.__v=null,l||s!=null){for(e.__u|=l?160:32;o&&o.nodeType===8&&o.nextSibling;)o=o.nextSibling;s[s.indexOf(o)]=null,e.__e=o}else e.__e=n.__e,e.__k=n.__k;kr.__e(z,e,n)}else s==null&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=dRe(n.__e,e,n,r,i,s,a,l,u);(f=kr.diffed)&&f(e)}function Xre(t,e,n){e.__d=void 0;for(var r=0;r<n.length;r++)CO(n[r],n[++r],n[++r]);kr.__c&&kr.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(s){s.call(i)})}catch(s){kr.__e(s,i.__v)}})}function dRe(t,e,n,r,i,s,a,o,l){var u,f,p,y,g,b,v,_=n.props,C=e.props,S=e.type;if(S==="svg"?i="http://www.w3.org/2000/svg":S==="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),s!=null){for(u=0;u<s.length;u++)if((g=s[u])&&"setAttribute"in g==!!S&&(S?g.localName===S:g.nodeType===3)){t=g,s[u]=null;break}}if(t==null){if(S===null)return document.createTextNode(C);t=document.createElementNS(i,S,C.is&&C),o&&(kr.__m&&kr.__m(e,s),o=!1),s=null}if(S===null)_===C||o&&t.data===C||(t.data=C);else{if(s=s&&X7.call(t.childNodes),_=n.props||d6,!o&&s!=null)for(_={},u=0;u<t.attributes.length;u++)_[(g=t.attributes[u]).name]=g.value;for(u in _)if(g=_[u],u!="children"){if(u=="dangerouslySetInnerHTML")p=g;else if(!(u in C)){if(u=="value"&&"defaultValue"in C||u=="checked"&&"defaultChecked"in C)continue;D4(t,u,null,g,i)}}for(u in C)g=C[u],u=="children"?y=g:u=="dangerouslySetInnerHTML"?f=g:u=="value"?b=g:u=="checked"?v=g:o&&typeof g!="function"||_[u]===g||D4(t,u,g,_[u],i);if(f)o||p&&(f.__html===p.__html||f.__html===t.innerHTML)||(t.innerHTML=f.__html),e.__k=[];else if(p&&(t.innerHTML=""),Yre(t,_O(y)?y:[y],e,n,r,S==="foreignObject"?"http://www.w3.org/1999/xhtml":i,s,a,s?s[0]:n.__k&&S1(n,0),o,l),s!=null)for(u=s.length;u--;)Kre(s[u]);o||(u="value",S==="progress"&&b==null?t.removeAttribute("value"):b!==void 0&&(b!==t[u]||S==="progress"&&!b||S==="option"&&b!==_[u])&&D4(t,u,b,_[u],i),u="checked",v!==void 0&&v!==t[u]&&D4(t,u,v,_[u],i))}return t}function CO(t,e,n){try{if(typeof t=="function"){var r=typeof t.__u=="function";r&&t.__u(),r&&e==null||(t.__u=t(e))}else t.current=e}catch(i){kr.__e(i,n)}}function Qre(t,e,n){var r,i;if(kr.unmount&&kr.unmount(t),(r=t.ref)&&(r.current&&r.current!==t.__e||CO(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(s){kr.__e(s,e)}r.base=r.__P=null}if(r=t.__k)for(i=0;i<r.length;i++)r[i]&&Qre(r[i],e,n||typeof t.type!="function");n||Kre(t.__e),t.__c=t.__=t.__e=t.__d=void 0}function hRe(t,e,n){return this.constructor(t,n)}function aL(t,e,n){var r,i,s,a;kr.__&&kr.__(t,e),i=(r=!1)?null:e.__k,s=[],a=[],xO(e,t=e.__k=Gn(Q7,null,[t]),i||d6,d6,e.namespaceURI,i?null:e.firstChild?X7.call(e.childNodes):null,s,i?i.__e:e.firstChild,r,a),Xre(s,t,a)}X7=Zre.slice,kr={__e:function(t,e,n,r){for(var i,s,a;e=e.__;)if((i=e.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(t)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,r||{}),a=i.__d),a)return i.__E=i}catch(o){t=o}throw t}},Wre=0,Mw.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=h2({},this.state),typeof t=="function"&&(t=t(h2({},n),this.props)),t&&h2(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),XV(this))},Mw.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),XV(this))},Mw.prototype.render=Q7,Mh=[],qre=typeof Promise=="function"?Promise.prototype.then.bind(Prom
vendor: 4,446 bytes, line 528
528ise.resolve()):setTimeout,rL=function(t,e){return t.__v.__b-e.__v.__b},sv.__r=0,vO=0,iL=eH(!1),sL=eH(!0);var h6,ti,FE,tH,oL=0,eie=[],mi=kr,nH=mi.__b,rH=mi.__r,iH=mi.diffed,sH=mi.__c,aH=mi.unmount,oH=mi.__;function EO(t,e){mi.__h&&mi.__h(ti,t,oL||e),oL=0;var n=ti.__H||(ti.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function lH(t){return oL=1,fRe(nie,t)}function fRe(t,e,n){var r=EO(h6++,2);if(r.t=t,!r.__c&&(r.__=[nie(void 0,e),function(o){var l=r.__N?r.__N[0]:r.__[0],u=r.t(l,o);l!==u&&(r.__N=[u,r.__[1]],r.__c.setState({}))}],r.__c=ti,!ti.u)){var i=function(o,l,u){if(!r.__c.__H)return!0;var f=r.__c.__H.__.filter(function(y){return!!y.__c});if(f.every(function(y){return!y.__N}))return!s||s.call(this,o,l,u);var p=!1;return f.forEach(function(y){if(y.__N){var g=y.__[0];y.__=y.__N,y.__N=void 0,g!==y.__[0]&&(p=!0)}}),!(!p&&r.__c.props===o)&&(!s||s.call(this,o,l,u))};ti.u=!0;var s=ti.shouldComponentUpdate,a=ti.componentWillUpdate;ti.componentWillUpdate=function(o,l,u){if(this.__e){var f=s;s=void 0,i(o,l,u),s=f}a&&a.call(this,o,l,u)},ti.shouldComponentUpdate=i}return r.__N||r.__}function pRe(t,e){var n=EO(h6++,3);!mi.__s&&tie(n.__H,e)&&(n.__=t,n.i=e,ti.__H.__h.push(n))}function d5t(t,e){var n=EO(h6++,7);return tie(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function mRe(){for(var t;t=eie.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Dw),t.__H.__h.forEach(lL),t.__H.__h=[]}catch(e){t.__H.__h=[],mi.__e(e,t.__v)}}mi.__b=function(t){ti=null,nH&&nH(t)},mi.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),oH&&oH(t,e)},mi.__r=function(t){rH&&rH(t),h6=0;var e=(ti=t.__c).__H;e&&(FE===ti?(e.__h=[],ti.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(e.__h.forEach(Dw),e.__h.forEach(lL),e.__h=[],h6=0)),FE=ti},mi.diffed=function(t){iH&&iH(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(eie.push(e)!==1&&tH===mi.requestAnimationFrame||((tH=mi.requestAnimationFrame)||yRe)(mRe)),e.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),FE=ti=null},mi.__c=function(t,e){e.some(function(n){try{n.__h.forEach(Dw),n.__h=n.__h.filter(function(r){return!r.__||lL(r)})}catch(r){e.some(function(i){i.__h&&(i.__h=[])}),e=[],mi.__e(r,n.__v)}}),sH&&sH(t,e)},mi.unmount=function(t){aH&&aH(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{Dw(r)}catch(i){e=i}}),n.__H=void 0,e&&mi.__e(e,n.__v))};var cH=typeof requestAnimationFrame=="function";function yRe(t){var e,n=function(){clearTimeout(r),cH&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,100);cH&&(e=requestAnimationFrame(n))}function Dw(t){var e=ti,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),ti=e}function lL(t){var e=ti;t.__c=t.__(),ti=e}function tie(t,e){return!t||t.length!==e.length||e.some(function(n,r){return n!==t[r]})}function nie(t,e){return typeof e=="function"?e(t):e}const gRe=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}
528.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}",bRe="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",wRe="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";
528class rie{constructor(){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=zre()}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",e.appendChild(this.root),this.render()}presentItem(e){const n=this.nextItemKey++;return this.items.set(n,e),this.render(),()=>{this.items.delete(n),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&aL(Gn("div",null,Gn(iie,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([e,n])=>Gn(vRe,Object.assign({},n,{key:e}))))),this.root)}}const iie=t=>Gn("div",{class:Mg("-cbwsdk-snackbar-container")},Gn("style",null,gRe),Gn("div",{class:"-cbwsdk-snackbar"},t.children)),vRe=({autoExpand:t,message:e,menuItems:n})=>{const[r,i]=lH(!0),[s,a]=lH(t??!1);pRe(()=>{const l=[window.setTimeout(()=>{i(!1)},1),window.setTimeout(()=>{a(!0)},1e4)];return()=>{l.forEach(window.clearTimeout)}});const o=()=>{a(!s)};return Gn("div",{class:Mg("-cbwsdk-snackbar-instance",r&&"-cbwsdk-snackbar-instance-hidden",s&&"-cbwsdk-snackbar-instance-expanded")},Gn("div",{class:"-cbwsdk-snackbar-instance-header",onClick:o},Gn("img",{src:bRe,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",Gn("div",{class:"-cbwsdk-snackbar-instance-header-message"},e),Gn("div",{class:"-gear-container"},!s&&Gn("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Gn("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),Gn("img",{src:wRe,class:"-gear-icon",title:"Expand"}))),n&&n.length>0&&Gn("div",{class:"-cbwsdk-snackbar-instance-menu"},n.map((l,u)=>Gn("div",{class:Mg("-cbwsdk-snackbar-instance-menu-item",l.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:l.onClick,key:u},Gn("svg",{width:l.svgWidth,height:l.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Gn("path",{"fill-rule":l.defaultFillRule,"clip-rule":l.defaultClipRule,d:l.path,fill:"#AAAAAA"})),Gn("span",{class:Mg("-cbwsdk-snackbar-instance-menu-item-info",l.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},l.info)))))},sie="M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z";class _Re{constructor(){this.attached=!1,this.snackbar=new rie}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const e=document.documentElement,n=document.createElement("div");n.className="-cbwsdk-css-reset",e.appendChild(n),this.snackbar.attach(n),this.attached=!0,Vre()}showConnecting(e){let n;return e.isUnlinkedErrorState?n={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]}:n={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:e.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:sie,defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(n)}}const xRe=".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}
528.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}";class CRe{constructor(){this.root=null,this.darkMode=zre()}attach(){const e=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",e.appendChild(this.root),Vre()}present(e){this.render(e)}clear(){this.render(null)}render(e){this.root&&(aL(null,this.root),e&&aL(Gn(ERe,Object.assign({},e,{onDismiss:()=>{this.clear()},darkMode:this.darkMode})),this.root))}}const ERe=({title:t,buttonText:e,darkMode:n,onButtonClick:r,onDismiss:i})=>{const s=n?"dark":"light";return Gn(iie,{darkMode:n},Gn("div",{class:"-cbwsdk-redirect-dialog"},Gn("style",null,xRe),Gn("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:i}),Gn("div",{class:Mg("-cbwsdk-redirect-dialog-box",s)},Gn("p",null,t),Gn("button",{onClick:r},e))))},SRe="https://keys.coinbase.com/connect",ARe="https://rpc.wallet.coinbase.com",uH="https://www.walletlink.org",kRe="https://go.cb-w.com/walletlink";class dH{constructor(){this.attached=!1,this.redirectDialog=new CRe}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}redirectToCoinbaseWallet(e){const n=new URL(kRe);n.searchParams.append("redirect_url",sRe().href),e&&n.searchParams.append("wl_url",e);const r=document.createElement("a");r.target="cbw-opener",r.href=n.href,r.rel="noreferrer noopener",r.click()}openCoinbaseWalletDeeplink(e){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",onButtonClick:()=>{this.redirectToCoinbaseWallet(e)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(e)},99)}showConnecting(e){return()=>{this.redirectDialog.clear()}}}class cu{constructor(e){this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.isMobileWeb=aRe(),this.linkedUpdated=s=>{this.isLinked=s;const a=this.storage.getItem(nL);if(s&&(this._session.linked=s),this.isUnlinkedErrorState=!1,a){const o=a.split(" "),l=this.storage.getItem("IsStandaloneSigning")==="true";o[0]!==""&&!s&&this._session.linked&&!l&&(this.isUnlinkedErrorState=!0)}},this.metadataUpdated=(s,a)=>{this.storage.setItem(s,a)},this.chainUpdated=(s,a)=>{this.chainCallbackParams.chainId===s&&this.chainCallbackParams.jsonRpcUrl===a||(this.chainCallbackParams={chainId:s,jsonRpcUrl:a},this.chainCallback&&this.chainCallback(a,Number.parseInt(s,10)))},this.accountUpdated=s=>{this.accountsCallback&&this.accountsCallback([s]),cu.accountRequestCallbackIds.size>0&&(Array.from(cu.accountRequestCallbackIds.values()).forEach(a=>{this.invokeCallback(a,{method:"requestEthereumAccounts",result:[s]})}),cu.accountRequestCallbackIds.clear())},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage,this.metadata=e.metadata,this.accountsCallback=e.accountsCallback,this.chainCallback=e.chainCallback;const{session:n,ui:r,connection:i}=this.subscribe();this._session=n,this.connection=i,this.relayEventManager=new VPe,this.ui=r,this.ui.attach()}subscribe(){const e=q0.load(this.storage)||q0.create(this.storage),{linkAPIUrl:n}=this,r=new zPe({session:e,linkAPIUrl:n,listener:this}),i=this.isMobileWeb?new dH:new _Re;return r.connect(),{session:e,ui:i,connection:r}}resetAndReload(){this.connection.destroy().then(()=>{const e=q0.load(this.storage);(e==null?void 0:e.id)===this._session.id&&cc.clearAll(),document.location.reload()}).catch(e=>{})}signEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:Nl(e.weiValue),data:Rg(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?Nl(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?Nl(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?Nl(e.gasPriceInWei):null,gasLimit:e.gasLim
528it?Nl(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:Nl(e.weiValue),data:Rg(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?Nl(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?Nl(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?Nl(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?Nl(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,n){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:Rg(e,!0),chainId:n}})}getWalletLinkSession(){return this._session}sendRequest(e){let n=null;const r=jh(8),i=s=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,e.method,s),n==null||n()};return new Promise((s,a)=>{n=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload}),this.relayEventManager.callbacks.set(r,o=>{if(n==null||n(),ls(o))return a(new Error(o.errorMessage));s(o)}),this.publishWeb3RequestEvent(r,e)})}publishWeb3RequestEvent(e,n){const r={type:"WEB3_REQUEST",id:e,request:n};this.publishEvent("Web3Request",r,!0).then(i=>{}).catch(i=>{this.handleWeb3ResponseMessage(r.id,{method:n.method,errorMessage:i.message})}),this.isMobileWeb&&this.openCoinbaseWalletDeeplink(n.method)}openCoinbaseWalletDeeplink(e){if(this.ui instanceof dH)switch(e){case"requestEthereumAccounts":case"switchEthereumChain":return;default:window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0}),this.ui.openCoinbaseWalletDeeplink();break}}publishWeb3RequestCanceledEvent(e){const n={type:"WEB3_REQUEST_CANCELED",id:e};this.publishEvent("Web3RequestCanceled",n,!1).then()}publishEvent(e,n,r){return this.connection.publishEvent(e,n,r)}handleWeb3ResponseMessage(e,n){if(n.method==="requestEthereumAccounts"){cu.accountRequestCallbackIds.forEach(r=>this.invokeCallback(r,n)),cu.accountRequestCallbackIds.clear();return}this.invokeCallback(e,n)}handleErrorResponse(e,n,r){var i;const s=(i=r==null?void 0:r.message)!==null&&i!==void 0?i:"Unspecified error message.";this.handleWeb3ResponseMessage(e,{method:n,errorMessage:s})}invokeCallback(e,n){const r=this.relayEventManager.callbacks.get(e);r&&(r(n),this.relayEventManager.callbacks.delete(e))}requestEthereumAccounts(){const{appName:e,appLogoUrl:n}=this.metadata,r={method:"requestEthereumAccounts",params:{appName:e,appLogoUrl:n}},i=jh(8);return new Promise((s,a)=>{this.relayEventManager.callbacks.set(i,o=>{if(ls(o))return a(new Error(o.errorMessage));s(o)}),cu.accountRequestCallbackIds.add(i),this.publishWeb3RequestEvent(i,r)})}watchAsset(e,n,r,i,s,a){const o={method:"watchAsset",params:{type:e,options:{address:n,symbol:r,decimals:i,image:s},chainId:a}};let l=null;const u=jh(8),f=p=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,o.method,p),l==null||l()};return l=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:f,onResetConnection:this.resetAndReload}),new Promise((p,y)=>{this.relayEventManager.callbacks.set(u,g=>{if(l==null||l(),ls(g))return y(new Error(g.errorMessage));p(g)}),this.publishWeb3RequestEvent(u,o)})}addEthereumChain(e,n,r,i,s,a){const o={method:"addEthereumChain",params:{chainId:e,rpcUrls:n,blockExplorerUrls:i,chainName:s,iconUrls:r,nativeCurrency:a}};let l=null;const u=jh(8),f=p=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,o.method,p),l==null||l()};return l=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:f,onResetConnection:this.resetAndReload}),new Promise((p,y)=>{this.relayEventManager.callbacks.set(u,g=>{if(l==null||l(),ls(g))return y(new Error(g.errorMessage));p(g)}),this.publishWeb3RequestEvent(u,o)})}switchEthereumChain(e,n){const r={method:"switchEthereumChain",params:Object.assign({chainId:e},{address:n})};let i=null;const s=jh(8),a=o=>{this.publishWeb3RequestCanceledEvent(s),this.handleErrorResponse(s,r.method,o),i==null||i()};return i=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:a,onResetConnection:this.resetAndReload}),new Promise((o,l)=>{this.relayEventManager.callbacks.set(s,u=>{if(i==null||i(),ls(u)&&u.errorCode)return l(xn.provider.custom({code:u.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if(ls(u))return l(new Error(u.errorMessage));o(u)}),this.publishWeb3RequestEvent(s,r)})}}cu.accountRequestCallbackIds=new Set;const hH="DefaultChainId",fH="DefaultJsonRpcUrl";class aie{constructor(e){this._relay=null,this._addresses=[],this.metadata=e.metadata,this._storage=new cc("walletlink",uH),this.callback=e.callback||null;const n=this._storage.getItem(nL);if(n){const r=n.split(" ");r[0]!==""&&(this._addresses=r.map(i=>kd(i)))}this.initializeRelay()}getSession(){const e=this.initializeRelay(),{id:n,secret:r}=e.getWalletLinkSession();return{id:n,secret:r}}async handshake(){await this._eth_requestAccounts()}get selectedAddress(){return this._addresses[0]||void 0}get jsonRpcUrl(){var e;return(e=this._storage.getItem(fH))!==null&&e!==void 0?e:void 0}set jsonRpcUrl(e){this._storage.setItem(fH,e)}updateProviderInfo(e,n){var r;this.jsonRpcUrl=e;const i=this.getChainId();this._storage.setItem(hH,n.toString(10)),jg(n)!==i&&((r=this.callback)===null||r===void 0||r.call(this,"chainChanged",d2(n)))}async watchAsset(e){const n=Array.isArray(e)?e[0]:e;if(!n.type)throw xn.rpc.invalidParams("Type is required");if((n==null?void 0:n.type)!=="ERC20")throw xn.rpc.invalidParams(`Asset of type '${n.type}' is not supported`);if(!(n!=null&&n.options))throw xn.rpc.invalidParams("Options are required");if(!(n!=null&&n.options.address))throw xn.rpc.invalidParams("Address is required");const r=this.getChainId(),{address:i,symbol:s,image:a,decimals:o}=n.options,u=await this.initializeRelay().watchAsset(n.type,i,s,o,a,r==null?void 0:r.toString());return ls(u)?!1:!!u.result}async addEthereumChain(e){var n,r;const i=e[0];if(((n=i.rpcUrls)===null||n===void 0?void 0:n.length)===0)throw xn.rpc.invalidParams("please pass in at least 1 rpcUrl");if(!i.chainName||i.chainName.trim()==="")throw xn.rpc.invalidParams("chainName is a required field");if(!i.nativeCurrency)throw xn.rpc.invalidParams("nativeCurrency is a required field");const s=Number.parseInt(i.chainId,16);if(s===this.getChainId())return!1;const a=this.initializeRelay(),{rpcUrls:o=[],blockExplorerUrls:l=[],chainName:u,iconUrls:f=[],nativeCurrency:p}=i,y=await a.addEthereumChain(s.toString(),o,f,l,u,p);if(ls(y))return!1;if(((r=y.result)===null||r===void 0?void 0:r.isApproved)===!0)return this.updateProviderInfo(o[0],s),null;throw xn.rpc.internal("unable to add ethereum chain")}async switchEthereumChain(e){const n=e[0],r=Number.parseInt(n.chainId,16),s=await this.initializeRelay().switchEthereumChain(r.toString(10),this.selectedAddress||void 0);if(ls(s))throw s;const a=s.result;return a.isApproved&&a.rpcUrl.length>0&&this.updateProviderInfo(a.rpcUrl,r),null}async cleanup(){this.callback=null,this._relay&&this._relay.resetAndReload(),this._storage.clear()}_setAddresses(e,n){var r;if(!Array.isArray(e))throw new Error("addresses is not an array");const i=e.map(s=>kd(s));JSON.stringify(i)!==JSON.stringify(this._addresses)&&(this._addresses=i,(r=this.callback)===null||r===void 0||r.call(this,"accountsChanged",i),this._storage.setItem(nL,i.join(" ")))}async request(e){const n=e.params||[];switch(e.method){case"eth_accounts":return[...this._addresses];case"eth_coinbase":return this.selectedAddress||null;case"net_version":return this.getChainId().toString(10);case"eth_chainId":return d2(this.getChainId());case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_ecRecover":case"personal_ecRecover":return this.ecRecover(e);case"personal_sign":return this.personalSign(e);case"eth_signTransaction":return this._eth_signTransaction(n);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(n);case"eth_sendTransaction":return this._eth_sendTransaction(n);case"eth_signTypedData_v1":case"eth_signTypedData_v3":case"eth_signTypedData_v4":case"eth_signTypedData":return this.signTypedData(e);case"wallet_addEthereumChain":return this.addEthereumChain(n);case"wallet_switchEthereumChain":return this.switchEthereumChain(n);case"wallet_watchAsset":return this.watchAsset(n);default:if(!this.jsonRpcUrl)throw xn.rpc.internal("No RPC URL set for chain");return bO(e,this.jsonRpcUrl)}}_ensureKnownAddress(e){const n=kd(e);if(!this._addresses.map(i=>kd(i)).includes(n))throw new Error("Unknown Ethereum address")}_prepareTransactionParams(e){const n=e.from?kd(e.from):this.selectedAddress;if(!n)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(n);const r=e.to?kd(e.to):null,i=e.value!=null?Oy(e.value):BigInt(0),s=e.data?tL(e.data):Buffer.alloc(0),a=e.nonce!=null?jg(e.nonce):null,o=e.gasPrice!=null?Oy(e.gasPrice):null,l=e.maxFeePerGas!=null?Oy(e.maxFeePerGas):null,u=e.maxPriorityFeePerGas!=null?Oy(e.maxPriorityFeePerGas):null,f=e.gas!=null?Oy(e.gas):null,p=e.chainId?jg(e.chainId):this.getChainId();return{fromAddress:n,toAddress:r,weiValue:i,data:s,nonce:a,gasPriceInWei:o,maxFeePerGas:l,maxPriorityFeePerGas:u,gasLim
528it:f,chainId:p}}async ecRecover(e){const{method:n,params:r}=e;if(!Array.isArray(r))throw xn.rpc.invalidParams();const s=await this.initializeRelay().sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:NE(r[0]),signature:NE(r[1]),addPrefix:n==="personal_ecRecover"}});if(ls(s))throw s;return s.result}getChainId(){var e;return Number.parseInt((e=this._storage.getItem(hH))!==null&&e!==void 0?e:"1",10)}async _eth_requestAccounts(){var e,n;if(this._addresses.length>0)return(e=this.callback)===null||e===void 0||e.call(this,"connect",{chainId:d2(this.getChainId())}),this._addresses;const i=await this.initializeRelay().requestEthereumAccounts();if(ls(i))throw i;if(!i.result)throw new Error("accounts received is empty");return this._setAddresses(i.result),(n=this.callback)===null||n===void 0||n.call(this,"connect",{chainId:d2(this.getChainId())}),this._addresses}async personalSign({params:e}){if(!Array.isArray(e))throw xn.rpc.invalidParams();const n=e[1],r=e[0];this._ensureKnownAddress(n);const s=await this.initializeRelay().sendRequest({method:"signEthereumMessage",params:{address:kd(n),message:NE(r),addPrefix:!0,typedDataJson:null}});if(ls(s))throw s;return s.result}async _eth_signTransaction(e){const n=this._prepareTransactionParams(e[0]||{}),i=await this.initializeRelay().signEthereumTransaction(n);if(ls(i))throw i;return i.result}async _eth_sendRawTransaction(e){const n=tL(e[0]),i=await this.initializeRelay().submitEthereumTransaction(n,this.getChainId());if(ls(i))throw i;return i.result}async _eth_sendTransaction(e){const n=this._prepareTransactionParams(e[0]||{}),i=await this.initializeRelay().signAndSubmitEthereumTransaction(n);if(ls(i))throw i;return i.result}async signTypedData(e){const{method:n,params:r}=e;if(!Array.isArray(r))throw xn.rpc.invalidParams();const i=u=>{const f={eth_signTypedData_v1:M4.hashForSignTypedDataLegacy,eth_signTypedData_v3:
528M4.hashForSignTypedData_v3,eth_signTypedData_v4:M4.hashForSignTypedData_v4,eth_signTypedData:M4.hashForSignTypedData_v4};return Rg(f[n]({data:mPe(u)}),!0)},s=r[n==="eth_signTypedData_v1"?1:0],a=r[n==="eth_signTypedData_v1"?0:1];this._ensureKnownAddress(s);const l=await this.initializeRelay().sendRequest({method:"signEthereumMessage",params:{address:kd(s),message:i(a),typedDataJson:JSON.stringify(a,null,2),addPrefix:!1}});if(ls(l))throw l;return l.result}initializeRelay(){return this._relay||(this._relay=new cu({linkAPIUrl:uH,storage:this._storage,metadata:this.metadata,accountsCallback:this._setAddresses.bind(this),chainCallback:this.updateProviderInfo.bind(this)})),this._relay}}const oie="SignerType",lie=new cc("CBWSDK","SignerConfigurator");function TRe(){return lie.getItem(oie)}function LRe(t){lie.setItem(oie,t)}async function $Re(t){const{communicator:e,metadata:n,handshakeRequest:r,callback:i}=t;NRe(e,n,i).catch(()=>{});const s={id:crypto.randomUUID(),event:"selectSignerType",data:Object.assign(Object.assign({},t.preference),{handshakeRequest:r})},{data:a}=await e.postRequestAndWaitForResponse(s);return a}function IRe(t){const{signerType:e,metadata:n,communicator:r,callback:i}=t;switch(e){case"scw":return new TPe({metadata:n,callback:i,communicator:r});case"walletlink":return new aie({metadata:n,callback:i})}}async function NRe(t,e,n){await t.onMessage(({event:i})=>i==="WalletLinkSessionRequest");const r=new aie({metadata:e,callback:n});t.postMessage({event:"WalletLinkUpdate",data:{session:r.getSession()}}),await r.handshake(),t.postMessage({event:"WalletLinkUpdate",data:{connected:!0}})}const ORe=`Coinbase Wallet SDK requires the Cross-Origin-Opener-Policy header to not be set to 'same-origin'. This is to ensure that the SDK can communicate with the Coinbase Smart Wallet app. 529 530Please see https://www.smartwallet.dev/guides/tips/popup-tips#cross-origin-opener-policy for more information.`,PRe=()=>{let t;return{getCrossOriginOpenerPolicy:()=>t===void 0?"undefined":t,checkCrossOriginOpenerPolicy:async()=>{if(typeof window>"u"){t="non-browser-env";return}try{const e=`${window.location.origin}${window.location.pathname}`,n=await fetch(e,{method:"HEAD"});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);const r=n.headers.get("Cross-Origin-Opener-Policy");t=r??"null",t==="same-origin"&&console.error(ORe)}catch(e){console.error("Error checking Cross-Origin-Opener-Policy:",e.message),t="error"}}}},{checkCrossOriginOpenerPolicy:RRe,getCrossOriginOpenerPolicy:jRe}=PRe(),pH=420,mH=540,MRe={isRed:!1,info:"Retry",svgWidth:"10",svgHeight:"11",path:sie,defaultFillRule:"evenodd",defaultClipRule:"evenodd"},DRe="Popup was blocked. Try again.";let U4=null;function URe(t){const e=(window.innerWidth-pH)/2+window.screenX,n=(window.innerHeight-mH)/2+window.screenY;FRe(t);function r(){const s=`wallet_${crypto.randomUUID()}`,a=window.open(t,s,`width=${pH}, height=${mH}, left=${e}, top=${n}`);return a==null||a.focus(),a||null}let i=r();if(!i){const s=zRe();return new Promise((a,o)=>{s.presentItem({autoExpand:!0,message:DRe,menuItems:[Object.assign(Object.assign({},MRe),{onClick:()=>{i=r(),i?a(i):o(xn.rpc.internal("Popup window was blocked")),s.clear()}})]})})}return Promise.resolve(i)}function BRe(t){t&&!t.closed&&t.close()}
530function FRe(t){const e={sdkName:Dre,sdkVersion:d5,origin:window.location.origin,coop:jRe()};for(const[n,r]of Object.entries(e))t.searchParams.append(n,r.toString())}function zRe(){if(!U4){const t=document.createElement("div");t.className="-cbwsdk-css-reset",document.body.appendChild(t),U4=new rie,U4.attach(t)}return U4}class VRe{constructor({url:e=SRe,metadata:n,preference:r}){this.popup=null,this.listeners=new Map,this.postMessage=async i=>{(await this.waitForPopupLoaded()).postMessage(i,this.url.origin)},this.postRequestAndWaitForResponse=async i=>{const s=this.onMessage(({requestId:a})=>a===i.id);return this.postMessage(i),await s},this.onMessage=async i=>new Promise((s,a)=>{const o=l=>{if(l.origin!==this.url.origin)return;const u=l.data;i(u)&&(s(u),window.removeEventListener("message",o),this.listeners.delete(o))};window.addEventListener("message",o),this.listeners.set(o,{reject:a})}),this.disconnect=()=>{BRe(this.popup),this.popup=null,this.listeners.forEach(({reject:i},s)=>{i(xn.provider.userRejectedRequest("Request rejected")),window.removeEventListener("message",s)}),this.listeners.clear()},this.waitForPopupLoaded=async()=>this.popup&&!this.popup.closed?(this.popup.focus(),this.popup):(this.popup=await URe(this.url),this.onMessage(({event:i})=>i==="PopupUnload").then(this.disconnect).catch(()=>{}),this.onMessage(({event:i})=>i==="PopupLoaded").then(i=>{this.postMessage({requestId:i.id,data:{version:d5,metadata:this.metadata,preference:this.preference,location:window.location.toString()}})}).then(()=>{if(!this.popup)throw xn.rpc.internal();return this.popup})),this.url=new URL(e),this.metadata=n,this.preference=r}}function HRe(t){const e=uPe(WRe(t),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");return n.searchParams.set("version",d5),n.searchParams.set("code",e.code.toString()),n.searchParams.set("message",e.message),Object.assign(Object.assign({},e),{docUrl:n.href})}function WRe(t){var e;if(typeof t=="string")return{message:t,code:Jr.rpc.internal};if(ls(t)){const n=t.errorMessage,r=(e=t.errorCode)!==null&&e!==void 0?e:n.match(/(denied|rejected)/i)?Jr.provider.userRejectedRequest:void 0;return Object.assign(Object.assign({},t),{message:n,code:r,data:{method:t.method}})}return t}class qRe extends qf{}var ZRe=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};class KRe extends qRe{constructor(e){var{metadata:n}=e,r=e.preference,{keysUrl:i}=r,s=ZRe(r,["keysUrl"]);super(),this.signer=null,this.isCoinbaseWallet=!0,this.metadata=n,this.preference=s,this.communicator=new VRe({url:i,metadata:n,preference:s});const a=TRe();a&&(this.signer=this.initSigner(a))}async request(e){try{if(kPe(e),!this.signer)switch(e.method){case"eth_requestAccounts":{const n=await this.requestSignerSelection(e),r=this.initSigner(n);await r.handshake(e),this.signer=r,LRe(n);break}case"wallet_sendCalls":{const n=this.initSigner("scw");await n.handshake({method:"handshake"});const r=await n.request(e);return await n.cleanup(),r}case"wallet_getCallsStatus":return bO(e,ARe);case"net_version":return 1;case"eth_chainId":return d2(1);default:throw xn.provider.unauthorized("Must call 'eth_requestAccounts' before other methods")}return await this.signer.request(e)}catch(n){const{code:r}=n;return r===Jr.provider.unauthorized&&this.disconnect(),Promise.reject(HRe(n))}}async enable(){return console.warn('.enable() has been deprecated. Please use .request({ method: "eth_requestAccounts" }) instead.'),await this.request({method:"eth_requestAccounts"})}async disconnect(){var e;await((e=this.signer)===null||e===void 0?void 0:e.cleanup()),this.signer=null,cc.clearAll(),this.emit("disconnect",xn.provider.disconnected("User initiated disconnection"))}requestSignerSelection(e){return $Re({communicator:this.communicator,preference:this.preference,metadata:this.metadata,handshakeRequest:e,callback:this.emit.bind(this)})}initSigner(e){return IRe({signerType:e,metadata:this.metadata,communicator:this.communicator,callback:this.emit.bind(this)})}}function GRe(t){if(t){if(!["all","smartWalletOnly","eoaOnly"].includes(t.options))throw new Error(`Invalid options: ${t.options}`);
530if(t.attribution&&t.attribution.auto!==void 0&&t.attribution.dataSuffix!==void 0)throw new Error("Attribution cannot contain both auto and dataSuffix properties")}}function YRe(t){var e;const n={metadata:t.metadata,preference:t.preference};return(e=APe(n))!==null&&e!==void 0?e:new KRe(n)}const JRe={options:"all"};function yH(t){var e;new cc("CBWSDK").setItem("VERSION",d5),RRe();const r={metadata:{appName:t.appName||"Dapp",appLogoUrl:t.appLogoUrl||"",appChainIds:t.appChainIds||[]},preference:Object.assign(JRe,(e=t.preference)!==null&&e!==void 0?e:{})};GRe(r.preference);let i=null;return{getProvider:()=>(i||(i=YRe(r)),i)}}var B4={exports:{}},gH;function XRe(){if(gH)return B4.exports;gH=1;var t=typeof Reflect=="object"?Reflect:null,e=t&&typeof t.apply=="function"?t.apply:function(I,$,O){return Function.prototype.apply.call(I,$,O)},n;t&&typeof t.ownKeys=="function"?n=t.ownKeys:Object.getOwnPropertySymbols?n=function(I){return Object.getOwnPropertyNames(I).concat(Object.getOwnPropertySymbols(I))}:n=function(I){return Object.getOwnPropertyNames(I)};function r(A){console&&console.warn&&console.warn(A)}var i=Number.isNaN||function(I){return I!==I};function s(){s.init.call(this)}B4.exports=s,B4.exports.once=C,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function o(A){if(typeof A!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof A)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a}
vendor: 21,918 bytes, lines 530-543
530,set:function(A){if(typeof A!="number"||A<0||i(A))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+A+".");a=A}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(I){if(typeof I!="number"||I<0||i(I))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+I+".");return this._maxListeners=I,this};function l(A){return A._maxListeners===void 0?s.defaultMaxListeners:A._maxListeners}s.prototype.getMaxListeners=function(){return l(this)},s.prototype.emit=function(I){for(var $=[],O=1;O<arguments.length;O++)$.push(arguments[O]);var P=I==="error",j=this._events;if(j!==void 0)P=P&&j.error===void 0;else if(!P)return!1;if(P){var U;if($.length>0&&(U=$[0]),U instanceof Error)throw U;var z=new Error("Unhandled error."+(U?" ("+U.message+")":""));throw z.context=U,z}var D=j[I];if(D===void 0)return!1;if(typeof D=="function")e(D,this,$);else for(var R=D.length,W=b(D,R),O=0;O<R;++O)e(W[O],this,$);return!0};function u(A,I,$,O){var P,j,U;if(o($),j=A._events,j===void 0?(j=A._events=Object.create(null),A._eventsCount=0):(j.newListener!==void 0&&(A.emit("newListener",I,$.listener?$.listener:$),j=A._events),U=j[I]),U===void 0)U=j[I]=$,++A._eventsCount;else if(typeof U=="function"?U=j[I]=O?[$,U]:[U,$]:O?U.unshift($):U.push($),P=l(A),P>0&&U.length>P&&!U.warned){U.warned=!0;var z=new Error("Possible EventEmitter memory leak detected. "+U.length+" "+String(I)+" listeners added. Use emitter.setMaxListeners() to increase limit");z.name="MaxListenersExceededWarning",z.emitter=A,z.type=I,z.count=U.length,r(z)}return A}s.prototype.addListener=function(I,$){return u(this,I,$,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(I,$){return u(this,I,$,!0)};function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(A,I,$){var O={fired:!1,wrapFn:void 0,target:A,type:I,listener:$},P=f.bind(O);return P.listener=$,O.wrapFn=P,P}s.prototype.once=function(I,$){return o($),this.on(I,p(this,I,$)),this},s.prototype.prependOnceListener=function(I,$){return o($),this.prependListener(I,p(this,I,$)),this},s.prototype.removeListener=function(I,$){var O,P,j,U,z;if(o($),P=this._events,P===void 0)return this;if(O=P[I],O===void 0)return this;if(O===$||O.listener===$)--this._eventsCount===0?this._events=Object.create(null):(delete P[I],P.removeListener&&this.emit("removeListener",I,O.listener||$));else if(typeof O!="function"){for(j=-1,U=O.length-1;U>=0;U--)if(O[U]===$||O[U].listener===$){z=O[U].listener,j=U;break}if(j<0)return this;j===0?O.shift():v(O,j),O.length===1&&(P[I]=O[0]),P.removeListener!==void 0&&this.emit("removeListener",I,z||$)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(I){var $,O,P;if(O=this._events,O===void 0)return this;if(O.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):O[I]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete O[I]),this;if(arguments.length===0){var j=Object.keys(O),U;for(P=0;P<j.length;++P)U=j[P],U!=="removeListener"&&this.removeAllListeners(U);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if($=O[I],typeof $=="function")this.removeListener(I,$);else if($!==void 0)for(P=$.length-1;P>=0;P--)this.removeListener(I,$[P]);return this};function y(A,I,$){var O=A._events;if(O===void 0)return[];var P=O[I];return P===void 0?[]:typeof P=="function"?$?[P.listener||P]:[P]:$?_(P):b(P,P.length)}s.prototype.listeners=function(I){return y(this,I,!0)},s.prototype.rawListeners=function(I){return y(this,I,!1)},s.listenerCount=function(A,I){return typeof A.listenerCount=="function"?A.listenerCount(I):g.call(A,I)},s.prototype.listenerCount=g;function g(A){var I=this._events;if(I!==void 0){var $=I[A];if(typeof $=="function")return 1;if($!==void 0)return $.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function b(A,I){for(var $=new Array(I),O=0;O<I;++O)$[O]=A[O];return $}function v(A,I){for(;I+1<A.length;I++)A[I]=A[I+1];A.pop()}function _(A){for(var I=new Array(A.length),$=0;$<I.length;++$)I[$]=A[$].listener||A[$];return I}function C(A,I){return new Promise(function($,O){function P(U){A.removeListener(I,j),O(U)}function j(){typeof A.removeListener=="function"&&A.removeListener("error",P),$([].slice.call(arguments))}x(A,I,j,{once:!0}),I!=="error"&&S(A,P,{once:!0})})}function S(A,I,$){typeof A.on=="function"&&x(A,"error",I,$)}function x(A,I,$,O){if(typeof A.on=="function")O.once?A.once(I,$):A.on(I,$);else if(typeof A.addEventListener=="function")A.addEventListener(I,function P(j){O.once&&A.removeEventListener(I,P),$(j)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof A)}return B4.exports}var Za=XRe();const SO=Wa(Za);var bH=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))},QRe=(function(){function t(e,n,r){this.name=e,this.version=n,this.os=r,this.type="browser"}return t})(),eje=(function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return t})(),tje=(function(){function t(e,n,r,i){this.name=e,this.version=n,this.os=r,this.bot=i,this.type="bot-device"}return t})(),nje=(function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t})(),rje=(function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t})(),ije=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,sje=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,wH=3,aje=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",ije]],vH=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function oje(t){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new rje:typeof navigator<"u"?cje(navigator.userAgent):dje()}function lje(t){return t!==""&&aje.reduce(function(e,n){var r=n[0],i=n[1];if(e)return e;var s=i.exec(t);return!!s&&[r,s]},!1)}function cje(t){var e=lje(t);if(!e)return null;var n=e[0],r=e[1];if(n==="searchbot")return new nje;var i=r[1]&&r[1].split(".").join("_").split("_").slice(0,3);i?i.length<wH&&(i=bH(bH([],i,!0),hje(wH-i.length),!0)):i=[];var s=i.join("."),a=uje(t),o=sje.exec(t);return o&&o[1]?new tje(n,s,a,o[1]):new QRe(n,s,a)}function uje(t){for(var e=0,n=vH.length;e<n;e++){var r=vH[e],i=r[0],s=r[1],a=s.exec(t);if(a)return i}return null}function dje(){var t=typeof process<"u"&&process.version;return t?new eje(process.version.slice(1)):null}function hje(t){for(var e=[],n=0;n<t;n++)e.push("0");return e}var zE={};/*! ***************************************************************************** 531Copyright (c) Microsoft Corporation. 532 533Permission to use, copy, modify, and/or distribute this software for any 534purpose with or without fee is hereby granted. 535 536THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 537REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 538AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 539INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 540LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 541OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 542PERFORMANCE OF THIS SOFTWARE. 543***************************************************************************** */var cL=function(t,e){return cL=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)r.hasOwnProperty(i)&&(n[i]=r[i])},cL(t,e)};function fje(t,e){cL(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var uL=function(){return uL=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},uL.apply(this,arguments)};function pje(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function mje(t,e,n,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,n,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(s=(i<3?a(s):i>3?a(e,n,s):a(e,n))||s);return i>3&&s&&Object.defineProperty(e,n,s),s}function yje(t,e){return function(n,r){e(n,r,t)}}function gje(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function bje(t,e,n,r){function i(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function o(f){try{u(r.next(f))}catch(p){a(p)}}function l(f){try{u(r.throw(f))}catch(p){a(p)}}function u(f){f.done?s(f.value):i(f.value).then(o,l)}u((r=r.apply(t,e||[])).next())})}function wje(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(u){return function(f){return l([u,f])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(t,n)}catch(f){u=[6,f],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function vje(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}function _je(t,e){for(var n in t)n!=="default"&&!e.hasOwnProperty(n)&&(e[n]=t[n])}function dL(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function cie(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(o){a={error:o}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return s}function xje(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(cie(arguments[e]));return t}function Cje(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;for(var r=Array(t),i=0,e=0;e<n;e++)for(var s=arguments[e],a=0,o=s.length;a<o;a++,i++)r[i]=s[a];return r}function f6(t){return this instanceof f6?(this.v=t,this):new f6(t)}function Eje(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,s=[];return i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i;function a(y){r[y]&&(i[y]=function(g){return new Promise(function(b,v){s.push([y,g,b,v])>1||o(y,g)})})}function o(y,g){try{l(r[y](g))}catch(b){p(s[0][3],b)}}function l(y){y.value instanceof f6?Promise.resolve(y.value.v).then(u,f):p(s[0][2],y)}function u(y){o("next",y)}function f(y){o("throw",y)}function p(y,g){y(g),s.shift(),s.length&&o(s[0][0],s[0][1])}}function Sje(t){var e,n;return e={},r("next"),r("throw",function(i){throw i}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(i,s){e[i]=t[i]?function(a){return(n=!n)?{value:f6(t[i](a)),done:i==="return"}:s?s(a):a}:s}}function Aje(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof dL=="function"?dL(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(s){n[s]=t[s]&&function(a){return new Promise(function(o,l){a=t[s](a),i(o,l,a.done,a.value)})}}function i(s,a,o,l){Promise.resolve(l).then(function(u){s({value:u,done:o})},a)}}function kje(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function Tje(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function Lje(t){return t&&t.__esModule?t:{default:t}}function $je(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function Ije(t,e,n){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,n),n}const Nje=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return uL},__asyncDelegator:Sje,__asyncGenerator:Eje,__asyncValues:Aje,__await:f6,__awaiter:bje,__classPrivateFieldGet:$je,__classPrivateFieldSet:Ije,__createBinding:vje,__decorate:mje,__exportStar:_je,__extends:fje,__generator:wje,__importDefault:Lje,__importStar:Tje,__makeTemplateObject:kje,__metadata:gje,__param:yje,__read:cie,__rest:pje,__spread:xje,__spreadArrays:Cje,__values:dL},Symbol.toStringTag,{value:"Module"})),e9=AY(Nje);var VE={},Ry={},_H;function Oje(){if(_H)return Ry;_H=1,Object.defineProperty(Ry,"__esModule",{value:!0}),Ry.delay=void 0;function t(e){return new Promise(n=>{setTimeout(()=>{n(!0)},e)})}return Ry.delay=t,Ry}var wh={},HE={},vh={},xH;function Pje(){return xH||(xH=1,Object.defineProperty(vh,"__esModule",{value:!0}),vh.ONE_THOUSAND=vh.ONE_HUNDRED=void 0,vh.ONE_HUNDRED=100,vh.ONE_THOUSAND=1e3),vh}var WE={},CH;function Rje(){return CH||(CH=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=t.ONE_MINUTE*5,t.TEN_MINUTES=t.ONE_MINUTE*10,t.THIRTY_MINUTES=t.ONE_MINUTE*30,t.SIXTY_MINUTES=t.ONE_MINUTE*60,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=t.ONE_HOUR*3,t.SIX_HOURS=t.ONE_HOUR*6,t.TWELVE_HOURS=t.ONE_HOUR*12,t.TWENTY_FOUR_HOURS=t.ONE_HOUR*24,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=t.ONE_DAY*3,t.FIVE_DAYS=t.ONE_DAY*5,t.SEVEN_DAYS=t.ONE_DAY*7,t.THIRTY_DAYS=t.ONE_DAY*30,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=t.ONE_WEEK*2,t.THREE_WEEKS=t.ONE_WEEK*3,t.FOUR_WEEKS=t.ONE_WEEK*4,t.ONE_YEAR=t.ONE_DAY*365})(WE)),WE}var EH;function uie(){return EH||(EH=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=e9;e.__exportStar(Pje(),t),e.__exportStar(Rje(),t)})(HE)),HE}var SH;function jje(){if(SH)return wh;SH=1,Object.defineProperty(wh,"__esModule",{value:!0}),wh.fromMiliseconds=wh.toMiliseconds=void 0;const t=uie();function e(r){return r*t.ONE_THOUSAND}wh.toMiliseconds=e;function n(r){return Math.floor(r/t.ONE_THOUSAND)}return wh.fromMiliseconds=n,wh}var AH;function Mje(){return AH||(AH=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=e9;e.__exportStar(Oje(),t),e.__exportStar(jje(),t)})(VE)),VE}var n0={},kH;function Dje(){if(kH)return n0;kH=1,Object.defineProperty(n0,"__esModule",{value:!0}),n0.Watch=void 0;class t{constructor(){this.timestamps=new Map}start(n){if(this.timestamps.has(n))throw new Error(`Watch already started for label: ${n}`);this.timestamps.set(n,{started:Date.now()})}stop(n){const r=this.get(n);if(typeof r.elapsed<"u")throw new Error(`Watch already stopped for label: ${n}`);const i=Date.now()-r.started;this.timestamps.set(n,{started:r.started,elapsed:i})}get(n){const r=this.timestamps.get(n);if(typeof r>"u")throw new Error(`No timestamp found for label: ${n}`);return r}elapsed(n){const r=this.get(n);return r.elapsed||Date.now()-r.started}}return n0.Watch=t,n0.default=t,n0}var qE={},jy={},TH;function Uje(){if(TH)return jy;TH=1,Object.defineProperty(jy,"__esModule",{value:!0}),jy.IWatch=void 0;class t{}return jy.IWatch=t,jy}var LH;function Bje(){return LH||(LH=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),e9.__exportStar(Uje(),t)})(qE)),qE}var $H;function Fje(){return $H||($H=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=e9;e.__exportStar(Mje(),t),e.__exportStar(Dje(),t),e.__exportStar(Bje(),t),e.__exportStar(uie(),t)})(zE)),zE}var qe=Fje(),er={},IH;function die(){if(IH)return er;IH=1,Object.defineProperty(er,"__esModule",{value:!0}),er.getLocalStorage=er.getLocalStorageOrThrow=er.getCrypto=er.getCryptoOrThrow=er.getLocation=er.getLocationOrThrow=er.getNavigator=er.getNavigatorOrThrow=er.getDocument=er.getDocumentOrThrow=er.getFromWindowOrThrow=er.getFromWindow=void 0;function t(y){let g;return typeof window<"u"&&typeof window[y]<"u"&&(g=window[y]),g}er.getFromWindow=t;function e(y){const g=t(y);if(!g)throw new Error(`${y} is not defined in Window`);return g}er.getFromWindowOrThrow=e;function n(){return e("document")}er.getDocumentOrThrow=n;function r(){return t("document")}er.getDocument=r;function i(){return e("navigator")}er.getNavigatorOrThrow=i;function s(){return t("navigator")}er.getNavigator=s;function a(){return e("location")}er.getLocationOrThrow=a;function o(){return t("location")}er.getLocation=o;function l(){return e("crypto")}er.getCryptoOrThrow=l;function u(){return t("crypto")}er.getCrypto=u;function f(){return e("localStorage")}er.getLocalStorageOrThrow=f;function p(){return t("localStorage")}return er.getLocalStorage=p,er}var Ru=die(),My={},NH;function zje(){if(NH)return My;NH=1,Object.defineProperty(My,"__esModule",{value:!0}),My.getWindowMetadata=void 0;const t=die();function e(){let n,r;try{n=t.getDocumentOrThrow(),r=t.getLocationOrThrow()}catch{return null}function i(){const g=n.getElementsByTagName("link"),b=[];for(let v=0;v<g.length;v++){const _=g[v],C=_.getAttribute("rel");if(C&&C.toLowerCase().indexOf("icon")>-1){const S=_.getAttribute("href");if(S)if(S.toLowerCase().indexOf("https:")===-1&&S.toLowerCase().indexOf("http:")===-1&&S.indexOf("//")!==0){let x=r.protocol+"//"+r.host;if(S.indexOf("/")===0)x+=S;else{const A=r.pathname.split("/");A.pop();const I=A.join("/");x+=I+"/"+S}b.push(x)}else if(S.indexOf("//")===0){const x=r.protocol+S;b.push(x)}else b.push(S)}}return b}function s(...g){const b=n.getElementsByTagName("meta");for(let v=0;v<b.length;v++){const _=b[v],C=["itemprop","property","name"].map(S=>_.getAttribute(S)).filter(S=>S?g.includes(S):!1);if(C.length&&C){const S=_.getAttribute("content");
vendor: 6,743 bytes, lines 543-544
543if(S)return S}}return""}function a(){let g=s("name","og:site_name","og:title","twitter:title");return g||(g=n.title),g}function o(){return s("description","og:description","twitter:description","keywords")}const l=a(),u=o(),f=r.origin,p=i();return{description:u,url:f,icons:p,name:l}}return My.getWindowMetadata=e,My}var Vje=zje();const Hje="0.1.1";function Wje(){return Hje}class Rr extends Error{constructor(e,n={}){const r=(()=>{var l;if(n.cause instanceof Rr){if(n.cause.details)return n.cause.details;if(n.cause.shortMessage)return n.cause.shortMessage}return n.cause&&"details"in n.cause&&typeof n.cause.details=="string"?n.cause.details:(l=n.cause)!=null&&l.message?n.cause.message:n.details})(),i=n.cause instanceof Rr&&n.cause.docsPath||n.docsPath,a=`https://oxlib.sh${i??""}`,o=[e||"An error occurred.",...n.metaMessages?["",...n.metaMessages]:[],...r||i?["",r?`Details: ${r}`:void 0,i?`See: ${a}`:void 0]:[]].filter(l=>typeof l=="string").join(` 544`);super(o,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{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,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:`ox@${Wje()}`}),this.cause=n.cause,this.details=r,this.docs=a,this.docsPath=i,this.shortMessage=e}walk(e){return hie(this,e)}}function hie(t,e){return e!=null&&e(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause?hie(t.cause,e):e?null:t}const r0=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function qje(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function p6(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function Tf(t,...e){if(!qje(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function Zje(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");p6(t.outputLen),p6(t.blockLen)}function A1(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function fie(t,e){Tf(t);const n=e.outputLen;if(t.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function Kje(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function k1(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function ZE(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function Pl(t,e){return t<<32-e|t>>>e}const Gje=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Yje(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function Jje(t){for(let e=0;e<t.length;e++)t[e]=Yje(t[e]);return t}const OH=Gje?t=>t:Jje;function Xje(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function t9(t){return typeof t=="string"&&(t=Xje(t)),Tf(t),t}function Qje(...t){let e=0;for(let r=0;r<t.length;r++){const i=t[r];Tf(i),e+=i.length}const n=new Uint8Array(e);for(let r=0,i=0;r<t.length;r++){const s=t[r];n.set(s,i),i+=s.length}return n}class AO{}function pie(t){const e=r=>t().update(t9(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function eMe(t=32){if(r0&&typeof r0.getRandomValues=="function")return r0.getRandomValues(new Uint8Array(t));if(r0&&typeof r0.randomBytes=="function")return Uint8Array.from(r0.randomBytes(t));throw new Error("crypto.getRandomValues must be defined")}function tMe(t,e,n,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,r);const i=BigInt(32),s=BigInt(4294967295),a=Number(n>>i&s),o=Number(n&s),l=r?4:0,u=r?0:4;t.setUint32(e+l,a,r),t.setUint32(e+u,o,r)}function nMe(t,e,n){return t&e^~t&n}function rMe(t,e,n){return t&e^t&n^e&n}class iMe extends AO{constructor(e,n,r,i){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=i,this.buffer=new Uint8Array(e),this.view=ZE(this.buffer)}update(e){A1(this),e=t9(e),Tf(e);const{view:n,buffer:r,blockLen:i}=this,s=e.length;for(let a=0;a<s;){const o=Math.min(i-this.pos,s-a);if(o===i){const l=ZE(e);for(;i<=s-a;a+=i)this.process(l,a);continue}r.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===i&&(this.process(n,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){A1(this),fie(e,this),this.finished=!0;const{buffer:n,view:r,blockLen:i,isLE:s}=this;let{pos:a}=this;n[a++]=128,k1(this.buffer.subarray(a)),this.padOffset>i-a&&(this.process(r,0),a=0);for(let p=a;p<i;p++)n[p]=0;tMe(r,i-8,BigInt(this.length*8),s),this.process(r,0);const o=ZE(e),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=l/4,f=this.get();if(u>f.length)throw new Error("_sha2: outputLen bigger than state");for(let p=0;p<u;p++)o.setUint32(4*p,f[p],s)}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const r=e.slice(0,n);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:n,buffer:r,length:i,finished:s,destroyed:a,pos:o}=this;return e.destroyed=a,e.finished=s,e.length=i,e.pos=o,i%n&&e.buffer.set(r),e}clone(){return this._cloneInto()}}const $d=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),F4=BigInt(2**32-1),PH=BigInt(32);function sMe(t,e=!1){return e?{h:Number(t&F4),l:Number(t>>PH&F4)}:{h:Number(t>>PH&F4)|0,l:Number(t&F4)|0}}function aMe(t,e=!1){const n=t.length;let r=new Uint32Array(n),i=new Uint32Array(n);for(let s=0;s<n;s++){const{h:a,l:o}=sMe(t[s],e);[r[s],i[s]]=[a,o]}return[r,i]}const oMe=(t,e,n)=>t<<n|e>>>32-n,lMe=(t,e,n)=>e<<n|t>>>32-n,cMe=(t,e,n)=>e<<n-32|t>>>64-n,uMe=(t,e,n)=>t<<n-32|e>>>64-n,dMe=BigInt(0),Dy=BigInt(1),hMe=BigInt(2),fMe=BigInt(7),pMe=BigInt(256),mMe=BigInt(113),mie=[],yie=[],gie=[];for(let t=0,e=Dy,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],mie.push(2*(5*r+n)),yie.push((t+1)*(t+2)/2%64);let i=dMe;for(let s=0;s<7;s++)e=(e<<Dy^(e>>fMe)*mMe)%pMe,e&hMe&&(i^=Dy<<(Dy<<BigInt(s))-Dy);gie.push(i)}
vendor: 16,449 bytes, line 544
544const bie=aMe(gie,!0),yMe=bie[0],gMe=bie[1],RH=(t,e,n)=>n>32?cMe(t,e,n):oMe(t,e,n),jH=(t,e,n)=>n>32?uMe(t,e,n):lMe(t,e,n);function bMe(t,e=24){const n=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let a=0;a<10;a++)n[a]=t[a]^t[a+10]^t[a+20]^t[a+30]^t[a+40];for(let a=0;a<10;a+=2){const o=(a+8)%10,l=(a+2)%10,u=n[l],f=n[l+1],p=RH(u,f,1)^n[o],y=jH(u,f,1)^n[o+1];for(let g=0;g<50;g+=10)t[a+g]^=p,t[a+g+1]^=y}let i=t[2],s=t[3];for(let a=0;a<24;a++){const o=yie[a],l=RH(i,s,o),u=jH(i,s,o),f=mie[a];i=t[f],s=t[f+1],t[f]=l,t[f+1]=u}for(let a=0;a<50;a+=10){for(let o=0;o<10;o++)n[o]=t[a+o];for(let o=0;o<10;o++)t[a+o]^=~n[(o+2)%10]&n[(o+4)%10]}t[0]^=yMe[r],t[1]^=gMe[r]}k1(n)}class kO extends AO{constructor(e,n,r,i=!1,s=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=n,this.outputLen=r,this.enableXOF=i,this.rounds=s,p6(r),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=Kje(this.state)}clone(){return this._cloneInto()}keccak(){OH(this.state32),bMe(this.state32,this.rounds),OH(this.state32),this.posOut=0,this.pos=0}update(e){A1(this),e=t9(e),Tf(e);const{blockLen:n,state:r}=this,i=e.length;for(let s=0;s<i;){const a=Math.min(n-this.pos,i-s);for(let o=0;o<a;o++)r[this.pos++]^=e[s++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:n,pos:r,blockLen:i}=this;e[r]^=n,(n&128)!==0&&r===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){A1(this,!1),Tf(e),this.finish();const n=this.state,{blockLen:r}=this;for(let i=0,s=e.length;i<s;){this.posOut>=r&&this.keccak();const a=Math.min(r-this.posOut,s-i);e.set(n.subarray(this.posOut,this.posOut+a),i),this.posOut+=a,i+=a}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return p6(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(fie(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,k1(this.state)}_cloneInto(e){const{blockLen:n,suffix:r,outputLen:i,rounds:s,enableXOF:a}=this;return e||(e=new kO(n,r,i,a,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=r,e.outputLen=i,e.enableXOF=a,e.destroyed=this.destroyed,e}}const wMe=(t,e,n)=>pie(()=>new kO(e,t,n)),vMe=wMe(1,136,256/8),_Me=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]),Id=new Uint32Array(64);class xMe extends iMe{constructor(e=32){super(64,e,8,!1),this.A=$d[0]|0,this.B=$d[1]|0,this.C=$d[2]|0,this.D=$d[3]|0,this.E=$d[4]|0,this.F=$d[5]|0,this.G=$d[6]|0,this.H=$d[7]|0}get(){const{A:e,B:n,C:r,D:i,E:s,F:a,G:o,H:l}=this;return[e,n,r,i,s,a,o,l]}set(e,n,r,i,s,a,o,l){this.A=e|0,this.B=n|0,this.C=r|0,this.D=i|0,this.E=s|0,this.F=a|0,this.G=o|0,this.H=l|0}process(e,n){for(let p=0;p<16;p++,n+=4)Id[p]=e.getUint32(n,!1);for(let p=16;p<64;p++){const y=Id[p-15],g=Id[p-2],b=Pl(y,7)^Pl(y,18)^y>>>3,v=Pl(g,17)^Pl(g,19)^g>>>10;Id[p]=v+Id[p-7]+b+Id[p-16]|0}let{A:r,B:i,C:s,D:a,E:o,F:l,G:u,H:f}=this;for(let p=0;p<64;p++){const y=Pl(o,6)^Pl(o,11)^Pl(o,25),g=f+y+nMe(o,l,u)+_Me[p]+Id[p]|0,v=(Pl(r,2)^Pl(r,13)^Pl(r,22))+rMe(r,i,s)|0;f=u,u=l,l=o,o=a+g|0,a=s,s=i,i=r,r=g+v|0}r=r+this.A|0,i=i+this.B|0,s=s+this.C|0,a=a+this.D|0,o=o+this.E|0,l=l+this.F|0,u=u+this.G|0,f=f+this.H|0,this.set(r,i,s,a,o,l,u,f)}roundClean(){k1(Id)}destroy(){this.set(0,0,0,0,0,0,0,0),k1(this.buffer)}}const CMe=pie(()=>new xMe);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const TO=BigInt(0),hL=BigInt(1);function h5(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function LO(t){if(!h5(t))throw new Error("Uint8Array expected")}function m6(t,e){if(typeof e!="boolean")throw new Error(t+" boolean expected, got "+e)}function z4(t){const e=t.toString(16);return e.length&1?"0"+e:e}function wie(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?TO:BigInt("0x"+t)}const vie=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",EMe=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function y6(t){if(LO(t),vie)return t.toHex();let e="";for(let n=0;n<t.length;n++)e+=EMe[t[n]];return e}const qc={_0:48,_9:57,A:65,F:70,a:97,f:102};function MH(t){if(t>=qc._0&&t<=qc._9)return t-qc._0;if(t>=qc.A&&t<=qc.F)return t-(qc.A-10);if(t>=qc.a&&t<=qc.f)return t-(qc.a-10)}function av(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);if(vie)return Uint8Array.fromHex(t);const e=t.length,n=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(n);for(let i=0,s=0;i<n;i++,s+=2){const a=MH(t.charCodeAt(s)),o=MH(t.charCodeAt(s+1));if(a===void 0||o===void 0){const l=t[s]+t[s+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+s)}r[i]=a*16+o}return r}function hf(t){return wie(y6(t))}function _ie(t){return LO(t),wie(y6(Uint8Array.from(t).reverse()))}function f5(t,e){return av(t.toString(16).padStart(e*2,"0"))}function xie(t,e){return f5(t,e).reverse()}function go(t,e,n){let r;if(typeof e=="string")try{r=av(e)}catch(s){throw new Error(t+" must be hex string or Uint8Array, cause: "+s)}else if(h5(e))r=Uint8Array.from(e);else throw new Error(t+" must be hex string or Uint8Array");const i=r.length;if(typeof n=="number"&&i!==n)throw new Error(t+" of length "+n+" expected, got "+i);return r}function ov(...t){let e=0;for(let r=0;r<t.length;r++){const i=t[r];LO(i),e+=i.length}const n=new Uint8Array(e);for(let r=0,i=0;r<t.length;r++){const s=t[r];n.set(s,i),i+=s.length}return n}const KE=t=>typeof t=="bigint"&&TO<=t;function $O(t,e,n){return KE(t)&&KE(e)&&KE(n)&&e<=t&&t<n}function Z0(t,e,n,r){if(!$O(e,n,r))throw new Error("expected valid "+t+": "+n+" <= n < "+r+", got "+e)}function SMe(t){let e;for(e=0;t>TO;t>>=hL,e+=1);return e}const n9=t=>(hL<<BigInt(t))-hL,GE=t=>new Uint8Array(t),DH=t=>Uint8Array.from(t);function AMe(t,e,n){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=GE(t),i=GE(t),s=0;const a=()=>{r.fill(1),i.fill(0),s=0},o=(...p)=>n(i,r,...p),l=(p=GE(0))=>{i=o(DH([0]),p),r=o(),p.length!==0&&(i=o(DH([1]),p),r=o())},u=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let p=0;const y=[];for(;p<e;){r=o();const g=r.slice();y.push(g),p+=r.length}return ov(...y)};return(p,y)=>{a(),l(p);let g;for(;!(g=y(u()));)l();return a(),g}}const kMe={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||h5(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function r9(t,e,n={}){const r=(i,s,a)=>{const o=kMe[s];if(typeof o!="function")throw new Error("invalid validator function");const l=t[i];if(!(a&&l===void 0)&&!o(l,t))throw new Error("param "+String(i)+" is invalid. Expected "+s+", got "+l)};for(const[i,s]of Object.entries(e))r(i,s,!1);for(const[i,s]of Object.entries(n))r(i,s,!0);return t}function UH(t){const e=new WeakMap;return(n,...r)=>{const i=e.get(n);if(i!==void 0)return i;const s=t(n,...r);return e.set(n,s),s}}function TMe(t,e){if(VH(t)>e)throw new GMe({givenSize:VH(t),maxSize:e})}const Zc={zero:48,nine:57,A:65,F:70,a:97,f:102};function BH(t){if(t>=Zc.zero&&t<=Zc.nine)return t-Zc.zero;if(t>=Zc.A&&t<=Zc.F)return t-(Zc.A-10);if(t>=Zc.a&&t<=Zc.f)return t-(Zc.a-10)}function LMe(t,e={}){const{dir:n,size:r=32}=e;if(r===0)return t;if(t.length>r)throw new YMe({size:t.length,targetSize:r,type:"Bytes"});const i=new Uint8Array(r);for(let s=0;s<r;s++){const a=n==="right";i[a?s:r-s-1]=t[a?s:t.length-s-1]}return i}function Cie(t,e){if(O2(t)>e)throw new UMe({givenSize:O2(t),maxSize:e})}function $Me(t,e){if(typeof e=="number"&&e>0&&e>O2(t)-1)throw new Aie({offset:e,position:"start",size:O2(t)})}function IMe(t,e,n){if(typeof e=="number"&&typeof n=="number"&&O2(t)!==n-e)throw new Aie({offset:n,position:"end",size:O2(t)})}function Eie(t,e={}){const{dir:n,size:r=32}=e;if(r===0)return t;const i=t.replace("0x","");if(i.length>r*2)throw new BMe({size:Math.ceil(i.length/2),targetSize:r,type:"Hex"});return`0x${i[n==="right"?"padEnd":"padStart"](r*2,"0")}`}const NMe="#__bigint";function IO(t,e,n){return JSON.stringify(t,(r,i)=>typeof i=="bigint"?i.toString()+NMe:i,n)}const OMe=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function PMe(t,e={}){const{strict:n=!1}=e;if(!t)throw new FH(t);if(typeof t!="string")throw new FH(t);if(n&&!/^0x[0-9a-fA-F]*$/.test(t))throw new zH(t);if(!t.startsWith("0x"))throw new zH(t)}function RMe(...t){return`0x${t.reduce((e,n)=>e+n.replace("0x",""),"")}`}function NO(t){return t instanceof Uint8Array?lv(t):Array.isArray(t)?lv(new Uint8Array(t)):t}function lv(t,e={}){let n="";for(let i=0;i<t.length;i++)n+=OMe[t[i]];const r=`0x${n}`;return typeof e.size=="number"?(Cie(r,e.size),Sie(r,e.size)):r}function YE(t,e={}){const{signed:n,size:r}=e,i=BigInt(t);let s;r?n?s=(1n<<BigInt(r)*8n-1n)-1n:s=2n**(BigInt(r)*8n)-1n:typeof t=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));const a=typeof s=="bigint"&&n?-s-1n:0;if(s&&i>s||i<a){const u=typeof t=="bigint"?"n":"";throw new DMe({max:s?`${s}${u}`:void 0,min:`${a}${u}`,signed:n,size:r,value:`${t}${u}`})}const l=`0x${(n&&i<0?(1n<<BigInt(r*8))+BigInt(i):i).toString(16)}`;return r?jMe(l,r):l}function jMe(t,e){return Eie(t,{dir:"left",size:e})}function Sie(t,e){return Eie(t,{dir:"right",size:e})}function iu(t,e,n,r={}){const{strict:i}=r;$Me(t,e);const s=`0x${t.replace("0x","").slice((e??0)*2,(n??t.length)*2)}`;return i&&IMe(s,e,n),s}function O2(t){return Math.ceil((t.length-2)/2)}function MMe(t,e={}){const{strict:n=!1}=e;try{return PMe(t,{strict:n}),!0}catch{return!1}}class DMe extends Rr{constructor({max:e,min:n,signed:r,size:i,value:s}){super(`Number \`${s}\` is not in safe${i?` ${i*8}-bit`:""}${r?" signed":" unsigned"} integer range ${e?`(\`${n}\` to \`${e}\`)`:`(above \`${n}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}class FH extends Rr{constructor(e){super(`Value \`${typeof e=="object"?IO(e):e}\` of type \`${typeof e}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}}class zH extends Rr{constructor(e){super(`Value \`${e}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}}let UMe=class extends Rr{constructor({givenSize:e,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}};class Aie extends Rr{constructor({offset:e,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset \`${e}\` is out-of-bounds (size: \`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}}let BMe=class extends Rr{constructor({size:e,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}};const FMe=new TextEncoder;function zMe(t){if(!(t instanceof Uint8Array)){if(!t)throw new V4(t);if(typeof t!="object")throw new V4(t);if(!("BYTES_PER_ELEMENT"in t))throw new V4(t);if(t.BYTES_PER_ELEMENT!==1||t.constructor.name!=="Uint8Array")throw new V4(t)}}function VMe(t){return t instanceof Uint8Array?t:typeof t=="string"?WMe(t):HMe(t)}function HMe(t){return t instanceof Uint8Array?t:new Uint8Array(t)}function WMe(t,e={}){const{size:n}=e;let r=t;n&&(Cie(t,n),r=Sie(t,n));let i=r.slice(2);i.length%2&&(i=`0${i}`);const s=i.length/2,a=new Uint8Array(s);for(let o=0,l=0;o<s;o++){const u=BH(i.charCodeAt(l++)),f=BH(i.charCodeAt(l++));if(u===void 0||f===void 0)throw new Rr(`Invalid byte sequence ("${i[l-2]}${i[l-1]}" in "${i}").`);a[o]=u*16+f}return a}function qMe(t,e={}){const{size:n}=e,r=FMe.encode(t);return typeof n=="number"?(TMe(r,n),ZMe(r,n)):r}function ZMe(t,e){return LMe(t,{dir:"right",size:e})}function VH(t){return t.length}function KMe(t){try{return zMe(t),!0}catch{return!1}}class V4 extends Rr{constructor(e){super(`Value \`${typeof e=="object"?IO(e):e}\` of type \`${typeof e}\` is an invalid Bytes value.`,{metaMessages:["Bytes values must be of type `Bytes`."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesTypeError"})}}class GMe extends Rr{constructor({givenSize:e,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}}class YMe extends Rr{constructor({size:e,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}}function kie(t,e={}){const{as:n=typeof t=="string"?"Hex":"Bytes"}=e,r=vMe(VMe(t));return n==="Bytes"?r:lv(r)}class JMe extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const n=super.get(e);return super.has(e)&&n!==void 0&&(this.delete(e),super.set(e,n)),n}set(e,n){if(super.set(e,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}}const XMe={checksum:new JMe(8192)},JE=XMe.checksum;function Tie(t,e={}){const{compressed:n}=e,{prefix:r,x:i,y:s}=t;if(n===!1||typeof i=="bigint"&&typeof s=="bigint"){if(r!==4)throw new HH({prefix:r,cause:new iDe});return}if(n===!0||typeof i=="bigint"&&typeof s>"u"){if(r!==3&&r!==2)throw new HH({prefix:r,cause:new rDe});return}throw new nDe({publicKey:t})}function QMe(t){const e=(()=>{if(MMe(t))return Lie(t);if(KMe(t))return eDe(t);const{prefix:n,x:r,y:i}=t;return typeof r=="bigint"&&typeof i=="bigint"?{prefix:n??4,x:r,y:i}:{prefix:n,x:r}})();return Tie(e),e}function eDe(t){return Lie(lv(t))}function Lie(t){if(t.length!==132&&t.length!==130&&t.length!==68)throw new sDe({publicKey:t});if(t.length===130){const r=BigInt(iu(t,0,32)),i=BigInt(iu(t,32,64));return{prefix:4,x:r,y:i}}if(t.length===132){const r=Number(iu(t,0,1)),i=BigInt(iu(t,1,33)),s=BigInt(iu(t,33,65));return{prefix:r,x:i,y:s}}const e=Number(iu(t,0,1)),n=BigInt(iu(t,1,33));return{prefix:e,x:n}}function tDe(t,e={}){Tie(t);const{prefix:n,x:r,y:i}=t,{includePrefix:s=!0}=e;return RMe(s?YE(n,{size:1}):"0x",YE(r,{size:32}),typeof i=="bigint"?YE(i,{size:32}):"0x")}class nDe extends Rr{constructor({publicKey:e}){super(`Value \`${IO(e)}\` is not a valid public key.`,{metaMessages:["Public key must contain:","- an `x` and `prefix` value (compressed)","- an `x`, `y`, and `prefix` value (uncompressed)"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidError"})}}class HH extends Rr{constructor({prefix:e,cause:n}){super(`Prefix "${e}
544" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidPrefixError"})}}class rDe extends Rr{constructor(){super("Prefix must be 2 or 3 for compressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidCompressedPrefixError"})}}class iDe extends Rr{constructor(){super("Prefix must be 4 for uncompressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidUncompressedPrefixError"})}}let sDe=class extends Rr{constructor({publicKey:e}){super(`Value \`${e}\` is an invalid public key size.`,{metaMessages:["Expected: 33 bytes (compressed + prefix), 64 bytes (uncompressed) or 65 bytes (uncompressed + prefix).",`Received ${O2(NO(e))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidSerializedSizeError"})}};const aDe=/^0x[a-fA-F0-9]{40}$/;function $ie(t,e={}){const{strict:n=!0}=e;if(!aDe.test(t))throw new WH({address:t,cause:new cDe});if(n){if(t.toLowerCase()===t)return;if(Iie(t)!==t)throw new WH({address:t,cause:new uDe})}}function Iie(t){if(JE.has(t))return JE.get(t);$ie(t,{strict:!1});const e=t.substring(2).toLowerCase(),n=kie(qMe(e),{as:"Bytes"}),r=e.split("");for(let s=0;s<40;s+=2)n[s>>1]>>4>=8&&r[s]&&(r[s]=r[s].toUpperCase()),(n[s>>1]&15)>=8&&r[s+1]&&(r[s+1]=r[s+1].toUpperCase());const i=`0x${r.join("")}`;return JE.set(t,i),i}function oDe(t,e={}){const{checksum:n=!1}=e;return $ie(t),n?Iie(t):t}function lDe(t,e={}){const n=kie(`0x${tDe(t).slice(4)}`).substring(26);return oDe(`0x${n}`,e)}class WH extends Rr{constructor({address:e,cause:n}){super(`Address "${e}" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class cDe extends Rr{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class uDe extends Rr{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}class Nie extends AO{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,Zje(e);const r=t9(n);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,s=new Uint8Array(i);s.set(r.length>i?e.create().update(r).digest():r);for(let a=0;a<s.length;a++)s[a]^=54;this.iHash.update(s),this.oHash=e.create();for(let a=0;a<s.length;a++)s[a]^=106;this.oHash.update(s),k1(s)}update(e){return A1(this),this.iHash.update(e),this}digestInto(e){A1(this),Tf(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:i,destroyed:s,blockLen:a,outputLen:o}=this;return e=e,e.finished=i,e.destroyed=s,e.blockLen=a,e.outputLen=o,e.oHash=n._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Oie=(t,e,n)=>new Nie(t,e).update(n).digest();Oie.create=(t,e)=>new Nie(t,e);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const sa=BigInt(0),Rs=BigInt(1),Yh=BigInt(2),dDe=BigInt(3),Pie=BigInt(4),Rie=BigInt(5),jie=BigInt(8);function Qs(t,e){const n=t%e;return n>=sa?n:e+n}function oo(t,e,n){let r=t;for(;e-- >sa;)r*=r,r%=n;return r}function fL(t,e){if(t===sa)throw new Error("invert: expected non-zero number");if(e<=sa)throw new Error("invert: expected positive modulus, got "+e);let n=Qs(t,e),r=e,i=sa,s=Rs;for(;n!==sa;){const o=r/n,l=r%n,u=i-s*o;r=n,n=l,i=s,s=u}if(r!==Rs)throw new Error("invert: does not exist");return Qs(i,e)}function Mie(t,e){const n=(t.ORDER+Rs)/Pie,r=t.pow(e,n);if(!t.eql(t.sqr(r),e))throw new Error("Cannot find square root");return r}function hDe(t,e){const n=(t.ORDER-Rie)/jie,r=t.mul(e,Yh),i=t.pow(r,n),s=t.mul(e,i),a=t.mul(t.mul(s,Yh),i),o=t.mul(s,t.sub(a,t.ONE));if(!t.eql(t.sqr(o),e))throw new Error("Cannot find square root");return o}function fDe(t){if(t<BigInt(3))throw new Error("sqrt is not defined for small field");let e=t-Rs,n=0;for(;e%Yh===sa;)e/=Yh,n++;let r=Yh;const i=OO(t);for(;qH(i,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(n===1)return Mie;let s=i.pow(r,e);const a=(e+Rs)/Yh;return function(l,u){if(l.is0(u))return u;if(qH(l,u)!==1)throw new Error("Cannot find square root");let f=n,p=l.mul(l.ONE,s),y=l.pow(u,e),g=l.pow(u,a);for(;!l.eql(y,l.ONE);){if(l.is0(y))return l.ZERO;let b=1,v=l.sqr(y);for(;!l.eql(v,l.ONE);)if(b++,v=l.sqr(v),b===f)throw new Error("Cannot find square root");const _=Rs<<BigInt(f-b-1),C=l.pow(p,_);f=b,p=l.sqr(C),y=l.mul(y,p),g=l.mul(g,C)}return g}}function pDe(t){return t%Pie===dDe?Mie:t%jie===Rie?hDe:fDe(t)}const mDe=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function yDe(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=mDe.reduce((r,i)=>(r[i]="function",r),e);return r9(t,n)}function gDe(t,e,n){if(n<sa)throw new Error("invalid exponent, negatives unsupported");if(n===sa)return t.ONE;if(n===Rs)return e;let r=t.ONE,i=e;for(;n>sa;)n&Rs&&(r=t.mul(r,i)),i=t.sqr(i),n>>=Rs;return r}function Die(t,e,n=!1){const r=new Array(e.length).fill(n?t.ZERO:void 0),i=e.reduce((a,o,l)=>t.is0(o)?a:(r[l]=a,t.mul(a,o)),t.ONE),s=t.inv(i);return e.reduceRight((a,o,l)=>t.is0(o)?a:(r[l]=t.mul(a,r[l]),t.mul(a,o)),s),r}function qH(t,e){const n=(t.ORDER-Rs)/Yh,r=t.pow(e,n),i=t.eql(r,t.ONE),s=t.eql(r,t.ZERO),a=t.eql(r,t.neg(t.ONE));if(!i&&!s&&!a)throw new Error("invalid Legendre symbol result");return i?1:s?0:-1}function Uie(t,e){e!==void 0&&p6(e);const n=e!==void 0?e:t.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function OO(t,e,n=!1,r={}){if(t<=sa)throw new Error("invalid field: expected ORDER > 0, got "+t);const{nBitLength:i,nByteLength:s}=Uie(t,e);if(s>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let a;const o=Object.freeze({ORDER:t,isLE:n,BITS:i,BYTES:s,MASK:n9(i),ZERO:sa,ONE:Rs,create:l=>Qs(l,t),isValid:l=>{if(typeof l!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof l);return sa<=l&&l<t},is0:l=>l===sa,isOdd:l=>(l&Rs)===Rs,neg:l=>Qs(-l,t),eql:(l,u)=>l===u,sqr:l=>Qs(l*l,t),add:(l,u)=>Qs(l+u,t),sub:(l,u)=>Qs(l-u,t),mul:(l,u)=>Qs(l*u,t),pow:(l,u)=>gDe(o,l,u),div:(l,u)=>Qs(l*fL(u,t),t),sqrN:l=>l*l,addN:(l,u)=>l+u,subN:(l,u)=>l-u,mulN:(l,u)=>l*u,inv:l=>fL(l,t),sqrt:r.sqrt||(l=>(a||(a=pDe(t)),a(o,l))),toBytes:l=>n?xie(l,s):f5(l,s),fromBytes:l=>{if(l.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+l.length);return n?_ie(l):hf(l)},invertBatch:l=>Die(o,l),cmov:(l,u,f)=>f?u:l});return Object.freeze(o)}function Bie(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function Fie(t){const e=Bie(t);return e+Math.ceil(e/2)}function bDe(t,e,n=!1){const r=t.length,i=Bie(e),s=Fie(e);if(r<16||r<s||r>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+r);const a=n?_ie(t):hf(t),o=Qs(a,e-Rs)+Rs;return n?xie(o,i):f5(o,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ZH=BigInt(0),pL=BigInt(1);function XE(t,e){const n=e.negate();return t?n:e}function zie(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function QE(t,e){zie(t,e);const n=Math.ceil(e/t)+1,r=2**(t-1),i=2**t,s=n9(t),a=BigInt(t);return{windows:n,windowSize:r,mask:s,maxNumber:i,shiftBy:a}}function KH(t,e,n){const{windowSize:r,mask:i,maxNumber:s,shiftBy:a}=n;let o=Number(t&i),l=t>>a;o>r&&(o-=s,l+=pL);const u=e*r,f=u+Math.abs(o)-1,p=o===0,y=o<0,g=e%2!==0;return{nextN:l,offset:f,isZero:p,isNeg:y,isNegF:g,offsetF:u}}function wDe(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach((n,r)=>{if(!(n instanceof e))throw new Error("invalid point at index "+r)})}function vDe(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((n,r)=>{if(!e.isValid(n))throw new Error("invalid scalar at index "+r)})}const eS=new WeakMap,Vie=new WeakMap;function tS(t){return Vie.get(t)||1}function _De(t,e){return{constTimeNegate:XE,hasPrecomputes(n){return tS(n)!==1},unsafeLadder(n,r,i=t.ZERO){let s=n;for(;r>ZH;)r&pL&&(i=i.add(s)),s=s.double(),r>>=pL;return i},precomputeWindow(n,r){const{windows:i,windowSize:s}=QE(r,e),a=[];let o=n,l=o;for(let u=0;u<i;u++){l=o,a.push(l);for(let f=1;f<s;f++)l=l.add(o),a.push(l);o=l.double()}return a},wNAF(n,r,i){let s=t.ZERO,a=t.BASE;const o=QE(n,e);for(let l=0;l<o.windows;l++){const{nextN:u,offset:f,isZero:p,isNeg:y,isNegF:g,offsetF:b}=KH(i,l,o);i=u,p?a=a.add(XE(g,r[b])):s=s.add(XE(y,r[f]))}return{p:s,f:a}},wNAFUnsafe(n,r,i,s=t.ZERO){const a=QE(n,e);for(let o=0;o<a.windows&&i!==ZH;o++){const{nextN:l,offset:u,isZero:f,isNeg:p}=KH(i,o,a);if(i=l,!f){const y=r[u];s=s.add(p?y.negate():y)}}return s},getPrecomputes(n,r,i){let s=eS.get(r);
vendor: 47,591 bytes, line 544
544return s||(s=this.precomputeWindow(r,n),n!==1&&eS.set(r,i(s))),s},wNAFCached(n,r,i){const s=tS(n);return this.wNAF(s,this.getPrecomputes(s,n,i),r)},wNAFCachedUnsafe(n,r,i,s){const a=tS(n);return a===1?this.unsafeLadder(n,r,s):this.wNAFUnsafe(a,this.getPrecomputes(a,n,i),r,s)},setWindowSize(n,r){zie(r,e),Vie.set(n,r),eS.delete(n)}}}function xDe(t,e,n,r){wDe(n,t),vDe(r,e);const i=n.length,s=r.length;if(i!==s)throw new Error("arrays of points and scalars must have equal length");const a=t.ZERO,o=SMe(BigInt(i));let l=1;o>12?l=o-3:o>4?l=o-2:o>0&&(l=2);const u=n9(l),f=new Array(Number(u)+1).fill(a),p=Math.floor((e.BITS-1)/l)*l;let y=a;for(let g=p;g>=0;g-=l){f.fill(a);for(let v=0;v<s;v++){const _=r[v],C=Number(_>>BigInt(g)&u);f[C]=f[C].add(n[v])}let b=a;for(let v=f.length-1,_=a;v>0;v--)_=_.add(f[v]),b=b.add(_);if(y=y.add(b),g!==0)for(let v=0;v<l;v++)y=y.double()}return y}function Hie(t){return yDe(t.Fp),r9(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Uie(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function GH(t){t.lowS!==void 0&&m6("lowS",t.lowS),t.prehash!==void 0&&m6("prehash",t.prehash)}function CDe(t){const e=Hie(t);r9(e,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});const{endo:n,Fp:r,a:i}=e;if(n){if(!r.eql(i,r.ZERO))throw new Error("invalid endo: CURVE.a must be 0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...e})}class EDe extends Error{constructor(e=""){super(e)}}const uu={Err:EDe,_tlv:{encode:(t,e)=>{const{Err:n}=uu;if(t<0||t>256)throw new n("tlv.encode: wrong tag");if(e.length&1)throw new n("tlv.encode: unpadded data");const r=e.length/2,i=z4(r);if(i.length/2&128)throw new n("tlv.encode: long form length too big");const s=r>127?z4(i.length/2|128):"";return z4(t)+s+i+e},decode(t,e){const{Err:n}=uu;let r=0;if(t<0||t>256)throw new n("tlv.encode: wrong tag");if(e.length<2||e[r++]!==t)throw new n("tlv.decode: wrong tlv");const i=e[r++],s=!!(i&128);let a=0;if(!s)a=i;else{const l=i&127;if(!l)throw new n("tlv.decode(long): indefinite length not supported");if(l>4)throw new n("tlv.decode(long): byte length is too big");const u=e.subarray(r,r+l);if(u.length!==l)throw new n("tlv.decode: length bytes not complete");if(u[0]===0)throw new n("tlv.decode(long): zero leftmost byte");for(const f of u)a=a<<8|f;if(r+=l,a<128)throw new n("tlv.decode(long): not minimal encoding")}const o=e.subarray(r,r+a);if(o.length!==a)throw new n("tlv.decode: wrong value length");return{v:o,l:e.subarray(r+a)}}},_int:{encode(t){const{Err:e}=uu;if(t<pu)throw new e("integer: negative integers are not allowed");let n=z4(t);if(Number.parseInt(n[0],16)&8&&(n="00"+n),n.length&1)throw new e("unexpected DER parsing assertion: unpadded hex");return n},decode(t){const{Err:e}=uu;if(t[0]&128)throw new e("invalid signature integer: negative");if(t[0]===0&&!(t[1]&128))throw new e("invalid signature integer: unnecessary leading zero");return hf(t)}},toSig(t){const{Err:e,_int:n,_tlv:r}=uu,i=go("signature",t),{v:s,l:a}=r.decode(48,i);if(a.length)throw new e("invalid signature: left bytes after parsing");const{v:o,l}=r.decode(2,s),{v:u,l:f}=r.decode(2,l);if(f.length)throw new e("invalid signature: left bytes after parsing");return{r:n.decode(o),s:n.decode(u)}},hexFromSig(t){const{_tlv:e,_int:n}=uu,r=e.encode(2,n.encode(t.r)),i=e.encode(2,n.encode(t.s)),s=r+i;return e.encode(48,s)}};function nS(t,e){return y6(f5(t,e))}const pu=BigInt(0),zi=BigInt(1);BigInt(2);const rS=BigInt(3),SDe=BigInt(4);function ADe(t){const e=CDe(t),{Fp:n}=e,r=OO(e.n,e.nBitLength),i=e.toBytes||((x,A,I)=>{const $=A.toAffine();return ov(Uint8Array.from([4]),n.toBytes($.x),n.toBytes($.y))}),s=e.fromBytes||(x=>{const A=x.subarray(1),I=n.fromBytes(A.subarray(0,n.BYTES)),$=n.fromBytes(A.subarray(n.BYTES,2*n.BYTES));return{x:I,y:$}});function a(x){const{a:A,b:I}=e,$=n.sqr(x),O=n.mul($,x);return n.add(n.add(O,n.mul(x,A)),I)}function o(x,A){const I=n.sqr(A),$=a(x);return n.eql(I,$)}if(!o(e.Gx,e.Gy))throw new Error("bad curve params: generator point");const l=n.mul(n.pow(e.a,rS),SDe),u=n.mul(n.sqr(e.b),BigInt(27));if(n.is0(n.add(l,u)))throw new Error("bad curve params: a or b");function f(x){return $O(x,zi,e.n)}function p(x){const{allowedPrivateKeyLengths:A,nByteLength:I,wrapPrivateKey:$,n:O}=e;if(A&&typeof x!="bigint"){if(h5(x)&&(x=y6(x)),typeof x!="string"||!A.includes(x.length))throw new Error("invalid private key");x=x.padStart(I*2,"0")}let P;try{P=typeof x=="bigint"?x:hf(go("private key",x,I))}catch{throw new Error("invalid private key, expected hex or "+I+" bytes, got "+typeof x)}return $&&(P=Qs(P,O)),Z0("private key",P,zi,O),P}function y(x){if(!(x instanceof v))throw new Error("ProjectivePoint expected")}const g=UH((x,A)=>{const{px:I,py:$,pz:O}=x;if(n.eql(O,n.ONE))return{x:I,y:$};const P=x.is0();A==null&&(A=P?n.ONE:n.inv(O));const j=n.mul(I,A),U=n.mul($,A),z=n.mul(O,A);if(P)return{x:n.ZERO,y:n.ZERO};if(!n.eql(z,n.ONE))throw new Error("invZ was invalid");return{x:j,y:U}}),b=UH(x=>{if(x.is0()){if(e.allowInfinityPoint&&!n.is0(x.py))return;throw new Error("bad point: ZERO")}const{x:A,y:I}=x.toAffine();if(!n.isValid(A)||!n.isValid(I))throw new Error("bad point: x or y not FE");if(!o(A,I))throw new Error("bad point: equation left != right");if(!x.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class v{constructor(A,I,$){if(A==null||!n.isValid(A))throw new Error("x required");if(I==null||!n.isValid(I)||n.is0(I))throw new Error("y required");if($==null||!n.isValid($))throw new Error("z required");this.px=A,this.py=I,this.pz=$,Object.freeze(this)}static fromAffine(A){const{x:I,y:$}=A||{};if(!A||!n.isValid(I)||!n.isValid($))throw new Error("invalid affine point");if(A instanceof v)throw new Error("projective point not allowed");const O=P=>n.eql(P,n.ZERO);return O(I)&&O($)?v.ZERO:new v(I,$,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(A){const I=Die(n,A.map($=>$.pz));return A.map(($,O)=>$.toAffine(I[O])).map(v.fromAffine)}static fromHex(A){const I=v.fromAffine(s(go("pointHex",A)));return I.assertValidity(),I}static fromPrivateKey(A){return v.BASE.multiply(p(A))}static msm(A,I){return xDe(v,r,A,I)}_setWindowSize(A){S.setWindowSize(this,A)}assertValidity(){b(this)}hasEvenY(){const{y:A}=this.toAffine();if(n.isOdd)return!n.isOdd(A);throw new Error("Field doesn't support isOdd")}equals(A){y(A);const{px:I,py:$,pz:O}=this,{px:P,py:j,pz:U}=A,z=n.eql(n.mul(I,U),n.mul(P,O)),D=n.eql(n.mul($,U),n.mul(j,O));return z&&D}negate(){return new v(this.px,n.neg(this.py),this.pz)}double(){const{a:A,b:I}=e,$=n.mul(I,rS),{px:O,py:P,pz:j}=this;let U=n.ZERO,z=n.ZERO,D=n.ZERO,R=n.mul(O,O),W=n.mul(P,P),T=n.mul(j,j),L=n.mul(O,P);return L=n.add(L,L),D=n.mul(O,j),D=n.add(D,D),U=n.mul(A,D),z=n.mul($,T),z=n.add(U,z),U=n.sub(W,z),z=n.add(W,z),z=n.mul(U,z),U=n.mul(L,U),D=n.mul($,D),T=n.mul(A,T),L=n.sub(R,T),L=n.mul(A,L),L=n.add(L,D),D=n.add(R,R),R=n.add(D,R),R=n.add(R,T),R=n.mul(R,L),z=n.add(z,R),T=n.mul(P,j),T=n.add(T,T),R=n.mul(T,L),U=n.sub(U,R),D=n.mul(T,W),D=n.add(D,D),D=n.add(D,D),new v(U,z,D)}add(A){y(A);const{px:I,py:$,pz:O}=this,{px:P,py:j,pz:U}=A;let z=n.ZERO,D=n.ZERO,R=n.ZERO;const W=e.a,T=n.mul(e.b,rS);let L=n.mul(I,P),M=n.mul($,j),Z=n.mul(O,U),H=n.add(I,$),V=n.add(P,j);H=n.mul(H,V),V=n.add(L,M),H=n.sub(H,V),V=n.add(I,O);let F=n.add(P,U);return V=n.mul(V,F),F=n.add(L,Z),V=n.sub(V,F),F=n.add($,O),z=n.add(j,U),F=n.mul(F,z),z=n.add(M,Z),F=n.sub(F,z),R=n.mul(W,V),z=n.mul(T,Z),R=n.add(z,R),z=n.sub(M,R),R=n.add(M,R),D=n.mul(z,R),M=n.add(L,L),M=n.add(M,L),Z=n.mul(W,Z),V=n.mul(T,V),M=n.add(M,Z),Z=n.sub(L,Z),Z=n.mul(W,Z),V=n.add(V,Z),L=n.mul(M,V),D=n.add(D,L),L=n.mul(F,V),z=n.mul(H,z),z=n.sub(z,L),L=n.mul(H,M),R=n.mul(F,R),R=n.add(R,L),new v(z,D,R)}subtract(A){return this.add(A.negate())}is0(){return this.equals(v.ZERO)}wNAF(A){return S.wNAFCached(this,A,v.normalizeZ)}multiplyUnsafe(A){const{endo:I,n:$}=e;Z0("scalar",A,pu,$);const O=v.ZERO;if(A===pu)return O;if(this.is0()||A===zi)return this;if(!I||S.hasPrecomputes(this))return S.wNAFCachedUnsafe(this,A,v.normalizeZ);let{k1neg:P,k1:j,k2neg:U,k2:z}=I.splitScalar(A),D=O,R=O,W=this;for(;j>pu||z>pu;)j&zi&&(D=D.add(W)),z&zi&&(R=R.add(W)),W=W.double(),j>>=zi,z>>=zi;return P&&(D=D.negate()),U&&(R=R.negate()),R=new v(n.mul(R.px,I.beta),R.py,R.pz),D.add(R)}multiply(A){const{endo:I,n:$}=e;Z0("scalar",A,zi,$);let O,P;if(I){const{k1neg:j,k1:U,k2neg:z,k2:D}=I.splitScalar(A);let{p:R,f:W}=this.wNAF(U),{p:T,f:L}=this.wNAF(D);R=S.constTimeNegate(j,R),T=S.constTimeNegate(z,T),T=new v(n.mul(T.px,I.beta),T.py,T.pz),O=R.add(T),P=W.add(L)}else{const{p:j,f:U}=this.wNAF(A);O=j,P=U}return v.normalizeZ([O,P])[0]}multiplyAndAddUnsafe(A,I,$){const O=v.BASE,P=(U,z)=>z===pu||z===zi||!U.equals(O)?U.multiplyUnsafe(z):U.multiply(z),j=P(this,I).add(P(A,$));return j.is0()?void 0:j}toAffine(A){return g(this,A)}isTorsionFree(){const{h:A,isTorsionFree:I}=e;if(A===zi)return!0;if(I)return I(v,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:A,clearCofactor:I}=e;return A===zi?this:I?I(v,this):this.multiplyUnsafe(e.h)}toRawBytes(A=!0){return m6("isCompressed",A),this.assertValidity(),i(v,this,A)}toHex(A=!0){return m6("isCompressed",A),y6(this.toRawBytes(A))}}v.BASE=new v(e.Gx,e.Gy,n.ONE),v.ZERO=new v(n.ZERO,n.ONE,n.ZERO);const{endo:_,nBitLength:C}=e,S=_De(v,_?Math.ceil(C/2):C);return{CURVE:e,ProjectivePoint:v,normPrivateKeyToScalar:p,weierstrassEquation:a,isWithinCurveOrder:f}}function kDe(t){const e=Hie(t);return r9(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function TDe(t){const e=kDe(t),{Fp:n,n:r,nByteLength:i,nBitLength:s}=e,a=n.BYTES+1,o=2*n.BYTES+1;function l(T){return Qs(T,r)}function u(T){return fL(T,r)}const{ProjectivePoint:f,normPrivateKeyToScalar:p,weierstrassEquation:y,isWithinCurveOrder:g}=ADe({...e,toBytes(T,L,M){const Z=L.toAffine(),H=n.toBytes(Z.x),V=ov;return m6("isCompressed",M),M?V(Uint8Array.from([L.hasEvenY()?2:3]),H):V(Uint8Array.from([4]),H,n.toBytes(Z.y))},fromBytes(T){const L=T.length,M=T[0],Z=T.subarray(1);if(L===a&&(M===2||M===3)){const H=hf(Z);if(!$O(H,zi,n.ORDER))throw new Error("Point is not on curve");const V=y(H);let F;try{F=n.sqrt(V)}catch(Y){const X=Y instanceof Error?": "+Y.message:"";throw new Error("Point is not on curve"+X)}const q=(F&zi)===zi;return(M&1)===1!==q&&(F=n.neg(F)),{x:H,y:F}}else if(L===o&&M===4){const H=n.fromBytes(Z.subarray(0,n.BYTES)),V=n.fromBytes(Z.subarray(n.BYTES,2*n.BYTES));return{x:H,y:V}}else{const H=a,V=o;throw new Error("invalid Point, expected length of "+H+", or uncompressed "+V+", got "+L)}}});function b(T){const L=r>>zi;return T>L}function v(T){return b(T)?l(-T):T}const _=(T,L,M)=>hf(T.slice(L,M));class C{constructor(L,M,Z){Z0("r",L,zi,r),Z0("s",M,zi,r),this.r=L,this.s=M,Z!=null&&(this.recovery=Z),Object.freeze(this)}static fromCompact(L){const M=i;return L=go("compactSignature",L,M*2),new C(_(L,0,M),_(L,M,2*M))}static fromDER(L){const{r:M,s:Z}=uu.toSig(go("DER",L));return new C(M,Z)}assertValidity(){}addRecoveryBit(L){return new C(this.r,this.s,L)}recoverPublicKey(L){const{r:M,s:Z,recovery:H}=this,V=O(go("msgHash",L));if(H==null||![0,1,2,3].includes(H))throw new Error("recovery id invalid");const F=H===2||H===3?M+e.n:M;if(F>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const q=(H&1)===0?"02":"03",G=f.fromHex(q+nS(F,n.BYTES)),Y=u(F),X=l(-V*Y),te=l(Z*Y),ie=f.BASE.multiplyAndAddUnsafe(G,X,te);if(!ie)throw new Error("point at infinify");return ie.assertValidity(),ie}hasHighS(){return b(this.s)}normalizeS(){return this.hasHighS()?new C(this.r,l(-this.s),this.recovery):this}toDERRawBytes(){return av(this.toDERHex())}toDERHex(){return uu.hexFromSig(this)}toCompactRawBytes(){return av(this.toCompactHex())}toCompactHex(){const L=i;return nS(this.r,L)+nS(this.s,L)}}const S={isValidPrivateKey(T){try{return p(T),!0}catch{return!1}},normPrivateKeyToScalar:p,randomPrivateKey:()=>{const T=Fie(e.n);return bDe(e.randomBytes(T),e.n)},precompute(T=8,L=f.BASE){return L._setWindowSize(T),L.multiply(BigInt(3)),L}};function x(T,L=!0){return f.fromPrivateKey(T).toRawBytes(L)}function A(T){if(typeof T=="bigint")return!1;if(T instanceof f)return!0;const M=go("key",T).length,Z=n.BYTES,H=Z+1,V=2*Z+1;if(!(e.allowedPrivateKeyLengths||i===H))return M===H||M===V}function I(T,L,M=!0){if(A(T)===!0)throw new Error("first arg must be private key");if(A(L)===!1)throw new Error("second arg must be public key");return f.fromHex(L).multiply(p(T)).toRawBytes(M)}const $=e.bits2int||function(T){if(T.length>8192)throw new Error("input is too large");const L=hf(T),M=T.length*8-s;return M>0?L>>BigInt(M):L},O=e.bits2int_modN||function(T){return l($(T))},P=n9(s);function j(T){return Z0("num < 2^"+s,T,pu,P),f5(T,i)}function U(T,L,M=z){if(["recovered","canonical"].some(pe=>pe in M))throw new Error("sign() legacy options not supported");const{hash:Z,randomBytes:H}=e;let{lowS:V,prehash:F,extraEntropy:q}=M;V==null&&(V=!0),T=go("msgHash",T),GH(M),F&&(T=go("prehashed msgHash",Z(T)));const G=O(T),Y=p(L),X=[j(Y),j(G)];if(q!=null&&q!==!1){const pe=q===!0?H(n.BYTES):q;X.push(go("extraEntropy",pe))}const te=ov(...X),ie=G;function se(pe){const Ce=$(pe);if(!g(Ce))return;const xe=u(Ce),Te=f.BASE.multiply(Ce).toAffine(),Et=l(Te.x);if(Et===pu)return;const Ke=l(xe*l(ie+Et*Y));if(Ke===pu)return;let Ge=(Te.x===Et?0:2)|Number(Te.y&zi),nn=Ke;return V&&b(Ke)&&(nn=v(Ke),Ge^=1),new C(Et,nn,Ge)}return{seed:te,k2sig:se}}const z={lowS:e.lowS,prehash:!1},D={lowS:e.lowS,prehash:!1};function R(T,L,M=z){const{seed:Z,k2sig:H}=U(T,L,M),V=e;return AMe(V.hash.outputLen,V.nByteLength,V.hmac)(Z,H)}f.BASE._setWindowSize(8);function W(T,L,M,Z=D){var Ge;const H=T;L=go("msgHash",L),M=go("publicKey",M);const{lowS:V,prehash:F,format:q}=Z;if(GH(Z),"strict"in Z)throw new Error("options.strict was renamed to lowS");if(q!==void 0&&q!=="compact"&&q!=="der")throw new Error("format must be compact or der");const G=typeof H=="string"||h5(H),Y=!G&&!q&&typeof H=="object"&&H!==null&&typeof H.r=="bigint"&&typeof H.s=="bigint";if(!G&&!Y)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let X,te;try{if(Y&&(X=new C(H.r,H.s)),G){try{q!=="compact"&&(X=C.fromDER(H))}catch(nn){if(!(nn instanceof uu.Err))throw nn}!X&&q!=="der"&&(X=C.fromCompact(H))}te=f.fromHex(M)}catch{return!1}if(!X||V&&X.hasHighS())return!1;F&&(L=e.hash(L));const{r:ie,s:se}=X,pe=O(L),Ce=u(se),xe=l(pe*Ce),Te=l(ie*Ce),Et=(Ge=f.BASE.multiplyAndAddUnsafe(te,xe,Te))==null?void 0:Ge.toAffine();return Et?l(Et.x)===ie:!1}return{CURVE:e,getPublicKey:x,getSharedSecret:I,sign:R,verify:W,ProjectivePoint:f,Signature:C,utils:S}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function LDe(t){return{hash:t,hmac:(e,...n)=>Oie(t,e,Qje(...n)),randomBytes:eMe}}function $De(t,e){const n=r=>TDe({...t,...LDe(r)});return{...n(e),create:n}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Wie=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),YH=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),IDe=BigInt(0),NDe=BigInt(1),mL=BigInt(2),JH=(t,e)=>(t+e/mL)/e;function ODe(t){const e=Wie,n=BigInt(3),r=BigInt(6),i=BigInt(11),s=BigInt(22),a=BigInt(23),o=BigInt(44),l=BigInt(88),u=t*t*t%e,f=u*u*t%e,p=oo(f,n,e)*f%e,y=oo(p,n,e)*f%e,g=oo(y,mL,e)*u%e,b=oo(g,i,e)*g%e,v=oo(b,s,e)*b%e,_=oo(v,o,e)*v%e,C=oo(_,l,e)*_%e,S=oo(C,o,e)*v%e,x=oo(S,n,e)*f%e,A=oo(x,a,e)*b%e,I=oo(A,r,e)*u%e,$=oo(I,mL,e);if(!yL.eql(yL.sqr($),t))throw new Error("Cannot find square root");return $}const yL=OO(Wie,void 0,void 0,{sqrt:ODe}),PDe=$De({a:IDe,b:BigInt(7),Fp:yL,n:YH,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=YH,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-NDe*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=n,a=BigInt("0x100000000000000000000000000000000"),o=JH(s*t,e),l=JH(-r*t,e);let u=Qs(t-o*n-l*i,e),f=Qs(-o*r-l*s,e);const p=u>a,y=f>a;if(p&&(u=e-u),y&&(f=e-f),u>a||f>a)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:p,k1:u,k2neg:y,k2:f}}}},CMe);function RDe(t){if(t.length!==130&&t.length!==132)throw new MDe({signature:t});const e=BigInt(iu(t,0,32)),n=BigInt(iu(t,32,64)),r=(()=>{const i=+`0x${t.slice(130)}`;if(!Number.isNaN(i))try{return jDe(i)}catch{throw new DDe({value:i})}})();return typeof r>"u"?{r:e,s:n}:{r:e,s:n,yParity:r}}function jDe(t){if(t===0||t===27)return 0;if(t===1||t===28)return 1;if(t>=35)return t%2===0?1:0;throw new UDe({value:t})}class MDe extends Rr{constructor({signature:e}){super(`Value \`${e}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${O2(NO(e))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class DDe extends Rr{constructor({value:e}){super(`Value \`${e}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class UDe extends Rr{constructor({value:e}){super(`Value \`${e}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}function BDe(t){return lDe(FDe(t))}function FDe(t){const{payload:e,signature:n}=t,{r,s:i,yParity:s}=n,o=new PDe.Signature(BigInt(r),BigInt(i)).addRecoveryBit(s).recoverPublicKey(NO(e).substring(2));return QMe(o)}function zDe(t){if(t.length>=255)throw new TypeError("Alphabet too long");const e=new Uint8Array(256);for(let u=0;u<e.length;u++)e[u]=255;for(let u=0;u<t.length;u++){const f=t.charAt(u),p=f.charCodeAt(0);if(e[p]!==255)throw new TypeError(f+" is ambiguous");e[p]=u}const n=t.length,r=t.charAt(0),i=Math.log(n)/Math.log(256),s=Math.log(256)/Math.log(n);function a(u){if(u instanceof Uint8Array||(ArrayBuffer.isView(u)?u=new Uint8Array(u.buffer,u.byteOffset,u.byteLength):Array.isArray(u)&&(u=Uint8Array.from(u))),!(u instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(u.length===0)return"";let f=0,p=0,y=0;const g=u.length;for(;y!==g&&u[y]===0;)y++,f++;const b=(g-y)*s+1>>>0,v=new Uint8Array(b);for(;y!==g;){let S=u[y],x=0;for(let A=b-1;(S!==0||x<p)&&A!==-1;A--,x++)S+=256*v[A]>>>0,v[A]=S%n>>>0,S=S/n>>>0;if(S!==0)throw new Error("Non-zero carry");p=x,y++}let _=b-p;for(;_!==b&&v[_]===0;)_++;let C=r.repeat(f);for(;_<b;++_)C+=t.charAt(v[_]);return C}function o(u){if(typeof u!="string")throw new TypeError("Expected String");if(u.length===0)return new Uint8Array;let f=0,p=0,y=0;for(;u[f]===r;)p++,f++;const g=(u.length-f)*i+1>>>0,b=new Uint8Array(g);for(;f<u.length;){const S=u.charCodeAt(f);if(S>255)return;let x=e[S];if(x===255)return;let A=0;for(let I=g-1;(x!==0||A<y)&&I!==-1;I--,A++)x+=n*b[I]>>>0,b[I]=x%256>>>0,x=x/256>>>0;if(x!==0)throw new Error("Non-zero carry");y=A,f++}let v=g-y;for(;v!==g&&b[v]===0;)v++;const _=new Uint8Array(p+(g-v));let C=p;for(;v!==g;)_[C++]=b[v++];return _}function l(u){const f=o(u);if(f)return f;throw new Error("Non-base"+n+" character")}return{encode:a,decodeUnsafe:o,decode:l}}var VDe="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";const p5=zDe(VDe);function HDe(t){const e=t.length;let n=0,r=0;for(;r<e;){let i=t.charCodeAt(r++);if((i&4294967168)===0){n++;continue}else if((i&4294965248)===0)n+=2;else{if(i>=55296&&i<=56319&&r<e){const s=t.charCodeAt(r);(s&64512)===56320&&(++r,i=((i&1023)<<10)+(s&1023)+65536)}(i&4294901760)===0?n+=3:n+=4}}return n}function WDe(t,e,n){const r=t.length;let i=n,s=0;for(;s<r;){let a=t.charCodeAt(s++);if((a&4294967168)===0){e[i++]=a;continue}else if((a&4294965248)===0)e[i++]=a>>6&31|192;else{if(a>=55296&&a<=56319&&s<r){const o=t.charCodeAt(s);(o&64512)===56320&&(++s,a=((a&1023)<<10)+(o&1023)+65536)}(a&4294901760)===0?(e[i++]=a>>12&15|224,e[i++]=a>>6&63|128):(e[i++]=a>>18&7|240,e[i++]=a>>12&63|128,e[i++]=a>>6&63|128)}e[i++]=a&63|128}}const qDe=new TextEncoder,ZDe=50;function KDe(t,e,n){qDe.encodeInto(t,e.subarray(n))}function GDe(t,e,n){t.length>ZDe?KDe(t,e,n):WDe(t,e,n)}const YDe=4096;function qie(t,e,n){let r=e;const i=r+n,s=[];let a="";for(;r<i;){const o=t[r++];if((o&128)===0)s.push(o);else if((o&224)===192){const l=t[r++]&63;s.push((o&31)<<6|l)}else if((o&240)===224){const l=t[r++]&63,u=t[r++]&63;s.push((o&31)<<12|l<<6|u)}else if((o&248)===240){const l=t[r++]&63,u=t[r++]&63,f=t[r++]&63;let p=(o&7)<<18|l<<12|u<<6|f;p>65535&&(p-=65536,s.push(p>>>10&1023|55296),p=56320|p&1023),s.push(p)}else s.push(o);s.length>=YDe&&(a+=String.fromCharCode(...s),s.length=0)}return s.length>0&&(a+=String.fromCharCode(...s)),a}const JDe=new TextDecoder,XDe=200;function QDe(t,e,n){const r=t.subarray(e,e+n);return JDe.decode(r)}function eUe(t,e,n){return n>XDe?QDe(t,e,n):qie(t,e,n)}class H4{constructor(e,n){this.type=e,this.data=n}}class ja extends Error{constructor(e){super(e);const n=Object.create(ja.prototype);Object.setPrototypeOf(this,n),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:ja.name})}}const Uy=4294967295;function tUe(t,e,n){const r=n/4294967296,i=n;t.setUint32(e,r),t.setUint32(e+4,i)}function Zie(t,e,n){const r=Math.floor(n/4294967296),i=n;t.setUint32(e,r),t.setUint32(e+4,i)}function Kie(t,e){const n=t.getInt32(e),r=t.getUint32(e+4);return n*4294967296+r}function nUe(t,e){const n=t.getUint32(e),r=t.getUint32(e+4);return n*4294967296+r}const rUe=-1,iUe=4294967296-1,sUe=17179869184-1;function aUe({sec:t,nsec:e}){if(t>=0&&e>=0&&t<=sUe)if(e===0&&t<=iUe){const n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,t),n}else{const n=t/4294967296,r=t&4294967295,i=new Uint8Array(8),s=new DataView(i.buffer);return s.setUint32(0,e<<2|n&3),s.setUint32(4,r),i}else{const n=new Uint8Array(12),r=new DataView(n.buffer);return r.setUint32(0,e),Zie(r,4,t),n}}function oUe(t){const e=t.getTime(),n=Math.floor(e/1e3),r=(e-n*1e3)*1e6,i=Math.floor(r/1e9);return{sec:n+i,nsec:r-i*1e9}}function lUe(t){if(t instanceof Date){const e=oUe(t);return aUe(e)}else return null}function cUe(t){const e=new DataView(t.buffer,t.byteOffset,t.byteLength);switch(t.byteLength){case 4:return{sec:e.getUint32(0),nsec:0};case 8:{const n=e.getUint32(0),r=e.getUint32(4),i=(n&3)*4294967296+r,s=n>>>2;return{sec:i,nsec:s}}case 12:{const n=Kie(e,4),r=e.getUint32(0);return{sec:n,nsec:r}}default:throw new ja(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${t.length}`)}}function uUe(t){const e=cUe(t);return new Date(e.sec*1e3+e.nsec/1e6)}const dUe={type:rUe,encode:lUe,decode:uUe};class cv{constructor(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(dUe)}register({type:e,encode:n,decode:r}){if(e>=0)this.encoders[e]=n,this.decoders[e]=r;else{const i=-1-e;this.builtInEncoders[i]=n,this.builtInDecoders[i]=r}}tryToEncode(e,n){for(let r=0;r<this.builtInEncoders.length;r++){const i=this.builtInEncoders[r];if(i!=null){const s=i(e,n);if(s!=null){const a=-1-r;return new H4(a,s)}}}for(let r=0;r<this.encoders.length;r++){const i=this.encoders[r];if(i!=null){const s=i(e,n);if(s!=null){const a=r;return new H4(a,s)}}}return e instanceof H4?e:null}decode(e,n,r){const i=n<0?this.builtInDecoders[-1-n]:this.decoders[n];return i?i(e,n,r):new H4(n,e)}}cv.defaultCodec=new cv;function hUe(t){return t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer}function gL(t){return t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):hUe(t)?new Uint8Array(t):Uint8Array.from(t)}const fUe=100,pUe=2048;let mUe=class Gie{constructor(e){this.entered=!1,this.extensionCodec=(e==null?void 0:e.extensionCodec)??cv.defaultCodec,this.context=e==null?void 0:e.context,this.useBigInt64=(e==null?void 0:e.useBigInt64)??!1,this.maxDepth=(e==null?void 0:e.maxDepth)??fUe,this.initialBufferSize=(e==null?void 0:e.initialBufferSize)??pUe,this.sortKeys=(e==null?void 0:e.sortKeys)??!1,this.forceFloat32=(e==null?void 0:e.forceFloat32)??!1,this.ignoreUndefined=(e==null?void 0:e.ignoreUndefined)??!1,this.forceIntegerToFloat=(e==null?void 0:e.forceIntegerToFloat)??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new Gie({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(e){if(this.entered)return this.clone().encodeSharedRef(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(e){if(this.entered)return this.clone().encode(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(e,n){if(n>this.maxDepth)throw new Error(`Too deep objects in depth ${n}`);e==null?this.encodeNil():typeof e=="boolean"?this.encodeBoolean(e):typeof e=="number"?this.forceIntegerToFloat?this.encodeNumberAsFloat(e):this.encodeNumber(e):typeof e=="string"?this.encodeString(e):this.useBigInt64&&typeof e=="bigint"?this.encodeBigInt64(e):this.encodeObject(e,n)}ensureBufferSizeToWrite(e){const n=this.pos+e;this.view.byteLength<n&&this.resizeBuffer(n*2)}resizeBuffer(e){const n=new ArrayBuffer(e),r=new Uint8Array(n),i=new DataView(n);r.set(this.bytes),this.view=i,this.bytes=r}encodeNil(){this.writeU8(192)}encodeBoolean(e){e===!1?this.writeU8(194):this.writeU8(195)}encodeNumber(e){!this.forceIntegerToFloat&&Number.isSafeInteger(e)?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(211),this.writeI64(e)):this.encodeNumberAsFloat(e)}encodeNumberAsFloat(e){this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))}encodeBigInt64(e){e>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(e)):(this.writeU8(211),this.writeBigInt64(e))}writeStringHeader(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else if(e<4294967296)this.writeU8(219),this.writeU32(e);else throw new Error(`Too long string: ${e} bytes in UTF-8`)}encodeString(e){const r=HDe(e);this.ensureBufferSizeToWrite(5+r),this.writeStringHeader(r),GDe(e,this.bytes,this.pos),this.pos+=r}encodeObject(e,n){const r=this.extensionCodec.tryToEncode(e,this.context);if(r!=null)this.encodeExtension(r);else if(Array.isArray(e))this.encodeArray(e,n);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else if(typeof e=="object")this.encodeMap(e,n);else throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(e)}`)}encodeBinary(e){const n=e.byteLength;if(n<256)this.writeU8(196),this.writeU8(n);else if(n<65536)this.writeU8(197),this.writeU16(n);else if(n<4294967296)this.writeU8(198),this.writeU32(n);else throw new Error(`Too large binary: ${n}`);const r=gL(e);this.writeU8a(r)}encodeArray(e,n){const r=e.length;if(r<16)this.writeU8(144+r);else if(r<65536)this.writeU8(220),this.writeU16(r);else if(r<4294967296)this.writeU8(221),this.writeU32(r);else throw new Error(`Too large array: ${r}`);for(const i of e)this.doEncode(i,n+1)}countWithoutUndefined(e,n){let r=0;for(const i of n)e[i]!==void 0&&r++;return r}encodeMap(e,n){const r=Object.keys(e);this.sortKeys&&r.sort();const i=this.ignoreUndefined?this.countWithoutUndefined(e,r):r.length;if(i<16)this.writeU8(128+i);else if(i<65536)this.writeU8(222),this.writeU16(i);else if(i<4294967296)this.writeU8(223),this.writeU32(i);else throw new Error(`Too large map object: ${i}`);for(const s of r){const a=e[s];this.ignoreUndefined&&a===void 0||(this.encodeString(s),this.doEncode(a,n+1))}}encodeExtension(e){if(typeof e.data=="function"){const r=e.data(this.pos+6),i=r.length;if(i>=4294967296)throw new Error(`Too large extension object: ${i}`);this.writeU8(201),this.writeU32(i),this.writeI8(e.type),this.writeU8a(r);return}const n=e.data.length;if(n===1)this.writeU8(212);else if(n===2)this.writeU8(213);else if(n===4)this.writeU8(214);else if(n===8)this.writeU8(215);else if(n===16)this.writeU8(216);else if(n<256)this.writeU8(199),this.writeU8(n);else if(n<65536)this.writeU8(200),this.writeU16(n);else if(n<4294967296)this.writeU8(201),this.writeU32(n);else throw new Error(`Too large extension object: ${n}`);this.writeI8(e.type),this.writeU8a(e.data)}writeU8(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++}writeU8a(e){const n=e.length;this.ensureBufferSizeToWrite(n),this.bytes.set(e,this.pos),this.pos+=n}writeI8(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++}writeU16(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2}writeI16(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2}writeU32(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4}writeI32(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4}writeF32(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4}writeF64(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8}writeU64(e){this.ensureBufferSizeToWrite(8),tUe(this.view,this.pos,e),this.pos+=8}writeI64(e){this.ensureBufferSizeToWrite(8),Zie(this.view,this.pos,e),this.pos+=8}writeBigUint64(e){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,e),this.pos+=8}writeBigInt64(e){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,e),this.pos+=8}};function yUe(t,e){return new mUe(e).encodeSharedRef(t)}function iS(t){return`${t<0?"-":""}0x${Math.abs(t).toString(16).padStart(2,"0")}`}const gUe=16,bUe=16;class wUe{constructor(e=gUe,n=bUe){this.hit=0,this.miss=0,this.maxKeyLength=e,this.maxLengthPerKey=n,this.caches=[];for(let r=0;r<this.maxKeyLength;r++)this.caches.push([])}canBeCached(e){return e>0&&e<=this.maxKeyLength}find(e,n,r){const i=this.caches[r-1];e:for(const s of i){const a=s.bytes;for(let o=0;o<r;o++)if(a[o]!==e[n+o])continue e;return s.str}return null}store(e,n){const r=this.caches[e.length-1],i={bytes:e,str:n};r.length>=this.maxLengthPerKey?r[Math.random()*r.length|0]=i:r.push(i)}decode(e,n,r){const i=this.find(e,n,r);if(i!=null)return this.hit++,i;this.miss++;const s=qie(e,n,r),a=Uint8Array.prototype.slice.call(e,n,n+r);return this.store(a,s),s}}const bL="array",Dg="map_key",Yie="map_value",vUe=t=>{if(typeof t=="string"||typeof t=="number")return t;throw new ja("The type of key must be string or number but "+typeof t)};class _Ue{constructor(){this.stack=[],this.stackHeadPosition=-1}get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(e){const n=this.getUninitializedStateFromPool();n.type=bL,n.position=0,n.size=e,n.array=new Array(e)}pushMapState(e){const n=this.getUninitializedStateFromPool();n.type=Dg,n.readCount=0,n.size=e,n.map={}}getUninitializedStateFromPool(){if(this.stackHeadPosition++,this.stackHeadPosition===this.stack.length){const e={type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null};this.stack.push(e)}return this.stack[this.stackHeadPosition]}release(e){if(this.stack[this.stackHeadPosition]!==e)throw new Error("Invalid stack state. Released state is not on top of the stack.");if(e.type===bL){const r=e;r.size=0,r.array=void 0,r.position=0,r.type=void 0}if(e.type===Dg||e.type===Yie){const r=e;r.size=0,r.map=void 0,r.readCount=0,r.type=void 0}this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}}const By=-1,PO=new DataView(new ArrayBuffer(0)),xUe=new Uint8Array(PO.buffer);try{PO.getInt8(0)}catch(t){if(!(t instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}const XH=new RangeError("Insufficient data"),CUe=new wUe;let EUe=class Jie{constructor(e){this.totalPos=0,this.pos=0,this.view=PO,this.bytes=xUe,this.headByte=By,this.stack=new _Ue,this.entered=!1,this.extensionCodec=(e==null?void 0:e.extensionCodec)??cv.defaultCodec,this.context=e==null?void 0:e.context,this.useBigInt64=(e==null?void 0:e.useBigInt64)??!1,this.rawStrings=(e==null?void 0:e.rawStrings)??!1,this.maxStrLength=(e==null?void 0:e.maxStrLength)??Uy,this.maxBinLength=(e==null?void 0:e.maxBinLength)??Uy,this.maxArrayLength=(e==null?void 0:e.maxArrayLength)??Uy,this.maxMapLength=(e==null?void 0:e.maxMapLength)??Uy,this.maxExtLength=(e==null?void 0:e.maxExtLength)??Uy,this.keyDecoder=(e==null?void 0:e.keyDecoder)!==void 0?e.keyDecoder:CUe,this.mapKeyConverter=(e==null?void 0:e.mapKeyConverter)??vUe}clone(){return new Jie({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=By,this.stack.reset()}setBuffer(e){const n=gL(e);this.bytes=n,this.view=new DataView(n.buffer,n.byteOffset,n.byteLength),this.pos=0}appendBuffer(e){if(this.headByte===By&&!this.hasRemaining(1))this.setBuffer(e);else{const n=this.bytes.subarray(this.pos),r=gL(e),i=new Uint8Array(n.length+r.length);i.set(n),i.set(r,n.length),this.setBuffer(i)}}hasRemaining(e){return this.view.byteLength-this.pos>=e}createExtraByteError(e){const{view:n,pos:r}=this;return new RangeError(`Extra ${n.byteLength-r} of ${n.byteLength} byte(s) found at buffer[${e}]`)}decode(e){if(this.entered)return this.clone().decode(e);try{this.entered=!0,this.reinitializeState(),this.setBuffer(e);const n=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return n}finally{this.entered=!1}}*decodeMulti(e){if(this.entered){yield*this.clone().decodeMulti(e);return}try{for(this.entered=!0,this.reinitializeState(),this.setBuffer(e);this.hasRemaining(1);)yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(e){if(this.entered)return this.clone().decodeAsync(e);try{this.entered=!0;let n=!1,r;for await(const o of e){if(n)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(o);try{r=this.doDecodeSync(),n=!0}catch(l){if(!(l instanceof RangeError))throw l}this.totalPos+=this.pos}if(n){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return r}const{headByte:i,pos:s,totalPos:a}=this;throw new RangeError(`Insufficient data in parsing ${iS(i)} at ${a} (${s} in the current buffer)`)}finally{this.entered=!1}}decodeArrayStream(e){return this.decodeMultiAsync(e,!0)}decodeStream(e){return this.decodeMultiAsync(e,!1)}async*decodeMultiAsync(e,n){if(this.entered){yield*this.clone().decodeMultiAsync(e,n);return}try{this.entered=!0;let r=n,i=-1;for await(const s of e){if(n&&i===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(s),r&&(i=this.readArraySize(),r=!1,this.complete());try{for(;yield this.doDecodeSync(),--i!==0;);}catch(a){if(!(a instanceof RangeError))throw a}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){e:for(;;){const e=this.readHeadByte();let n;if(e>=224)n=e-256;else if(e<192)if(e<128)n=e;else if(e<144){const i=e-128;if(i!==0){this.pushMapState(i),this.complete();continue e}else n={}}else if(e<160){const i=e-144;if(i!==0){this.pushArrayState(i),this.complete();continue e}else n=[]}else{const i=e-160;n=this.decodeString(i,0)}else if(e===192)n=null;else if(e===194)n=!1;else if(e===195)n=!0;else if(e===202)n=this.readF32();else if(e===203)n=this.readF64();else if(e===204)n=this.readU8();else if(e===205)n=this.readU16();else if(e===206)n=this.readU32();else if(e===207)this.useBigInt64?n=this.readU64AsBigInt():n=this.readU64();else if(e===208)n=this.readI8();else if(e===209)n=this.readI16();else if(e===210)n=this.readI32();else if(e===211)this.useBigInt64?n=this.readI64AsBigInt():n=this.readI64();else if(e===217){const i=this.lookU8();n=this.decodeString(i,1)}else if(e===218){const i=this.lookU16();n=this.decodeString(i,2)}else if(e===219){const i=this.lookU32();n=this.decodeString(i,4)}else if(e===220){const i=this.readU16();if(i!==0){this.pushArrayState(i),this.complete();continue e}else n=[]}else if(e===221){const i=this.readU32();if(i!==0){this.pushArrayState(i),this.complete();continue e}else n=[]}else if(e===222){const i=this.readU16();if(i!==0){this.pushMapState(i),this.complete();continue e}else n={}}else if(e===223){const i=this.readU32();if(i!==0){this.pushMapState(i),this.complete();continue e}else n={}}else if(e===196){const i=this.lookU8();n=this.decodeBinary(i,1)}else if(e===197){const i=this.lookU16();n=this.decodeBinary(i,2)}else if(e===198){const i=this.lookU32();n=this.decodeBinary(i,4)}else if(e===212)n=this.decodeExtension(1,0);else if(e===213)n=this.decodeExtension(2,0);else if(e===214)n=this.decodeExtension(4,0);else if(e===215)n=this.decodeExtension(8,0);else if(e===216)n=this.decodeExtension(16,0);else if(e===199){const i=this.lookU8();n=this.decodeExtension(i,1)}else if(e===200){const i=this.lookU16();n=this.decodeExtension(i,2)}else if(e===201){const i=this.lookU32();n=this.decodeExtension(i,4)}else throw new ja(`Unrecognized type byte: ${iS(e)}`);this.complete();const r=this.stack;for(;r.length>0;){const i=r.top();if(i.type===bL)if(i.array[i.position]=n,i.position++,i.position===i.size)n=i.array,r.release(i);else continue e;else if(i.type===Dg){if(n==="__proto__")throw new ja("The key __proto__ is not allowed");i.key=this.mapKeyConverter(n),i.type=Yie;continue e}else if(i.map[i.key]=n,i.readCount++,i.readCount===i.size)n=i.map,r.release(i);else{i.key=null,i.type=Dg;continue e}}return n}}readHeadByte(){return this.headByte===By&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=By}readArraySize(){const e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:{if(e<160)return e-144;throw new ja(`Unrecognized array type byte: ${iS(e)}`)}}}pushMapState(e){if(e>this.maxMapLength)throw new ja(`Max length exceeded: map length (${e}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(e)}pushArrayState(e){if(e>this.maxArrayLength)throw new ja(`Max length exceeded: array length (${e}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(e)}decodeString(e,n){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(e,n):this.decodeBinary(e,n)}decodeUtf8String(e,n){var s;if(e>this.maxStrLength)throw new ja(`Max length exceeded: UTF-8 byte length (${e}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+n+e)throw XH;const r=this.pos+n;let i;return this.stateIsMapKey()&&((s=this.keyDecoder)!=null&&s.canBeCached(e))?i=this.keyDecoder.decode(this.bytes,r,e):i=eUe(this.bytes,r,e),this.pos+=n+e,i}stateIsMapKey(){return this.stack.length>0?this.stack.top().type===Dg:!1}decodeBinary(e,n){if(e>this.maxBinLength)throw new ja(`Max length exceeded: bin length (${e}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(e+n))throw XH;const r=this.pos+n,i=this.bytes.subarray(r,r+e);return this.pos+=n+e,i}decodeExtension(e,n){if(e>this.maxExtLength)throw new ja(`Max length exceeded: ext length (${e}) > maxExtLength (${this.maxExtLength})`);const r=this.view.getInt8(this.pos+n),i=this.decodeBinary(e,n+1);return this.extensionCodec.decode(i,r,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){const e=this.view.getUint8(this.pos);return this.pos++,e}readI8(){const e=this.view.getInt8(this.pos);return this.pos++,e}readU16(){const e=this.view.getUint16(this.pos);return this.pos+=2,e}readI16(){const e=this.view.getInt16(this.pos);return this.pos+=2,e}readU32(){const e=this.view.getUint32(this.pos);return this.pos+=4,e}readI32(){const e=this.view.getInt32(this.pos);return this.pos+=4,e}readU64(){const e=nUe(this.view,this.pos);return this.pos+=8,e}readI64(){const e=Kie(this.view,this.pos);return this.pos+=8,e}readU64AsBigInt(){const e=this.view.getBigUint64(this.pos);return this.pos+=8,e}readI64AsBigInt(){const e=this.view.getBigInt64(this.pos);return this.pos+=8,e}readF32(){const e=this.view.getFloat32(this.pos);return this.pos+=4,e}readF64(){const e=this.view.getFloat64(this.pos);return this.pos+=8,e}};function SUe(t,e){return new EUe(e).decode(t)}const AUe=t=>JSON.stringify(t,(e,n)=>typeof n=="bigint"?n.toString()+"n":n),kUe=t=>{const e=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,n=t.replace(e,'$1"$2n"$3');return JSON.parse(n,(r,i)=>typeof i=="string"&&i.match(/^\d+n$/)?BigInt(i.substring(0,i.length-1)):i)};function Lf(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return kUe(t)}catch{return t}}function ju(t){return typeof t=="string"?t:AUe(t)||""}function TUe(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function Xie(t,...e){if(!TUe(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function QH(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function LUe(t,e){Xie(t);const n=e.outputLen;if(t.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}const i0=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const sS=t=>new DataView(t.buffer,t.byteOffset,t.byteLength);function $Ue(t){if(typeof t!="string")throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array(new TextEncoder().encode(t))}function Qie(t){return typeof t=="string"&&(t=$Ue(t)),Xie(t),t}let IUe=class{clone(){return this._cloneInto()}};function NUe(t){const e=r=>t().update(Qie(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function ese(t=32){if(i0&&typeof i0.getRandomValues=="function")return i0.getRandomValues(new Uint8Array(t));if(i0&&typeof i0.randomBytes=="function")return i0.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}function OUe(t,e,n,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,r);const i=BigInt(32),s=BigInt(4294967295),a=Number(n>>i&s),o=Number(n&s),l=r?4:0,u=r?0:4;t.setUint32(e+l,a,r),t.setUint32(e+u,o,r)}let PUe=class extends IUe{constructor(e,n,r,i){super(),this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=sS(this.buffer)}update(e){QH(this);const{view:n,buffer:r,blockLen:i}=this;e=Qie(e);const s=e.length;for(let a=0;a<s;){const o=Math.min(i-this.pos,s-a);if(o===i){const l=sS(e);for(;i<=s-a;a+=i)this.process(l,a);continue}r.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===i&&(this.process(n,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){QH(this),LUe(e,this),this.finished=!0;const{buffer:n,view:r,blockLen:i,isLE:s}=this;let{pos:a}=this;n[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>i-a&&(this.process(r,0),a=0);for(let p=a;p<i;p++)n[p]=0;OUe(r,i-8,BigInt(this.length*8),s),this.process(r,0);const o=sS(e),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=l/4,f=this.get();if(u>f.length)throw new Error("_sha2: outputLen bigger than state");for(let p=0;p<u;p++)o.setUint32(4*p,f[p],s)}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const r=e.slice(0,n);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:n,buffer:r,length:i,finished:s,destroyed:a,pos:o}=this;return e.length=i,e.pos=o,e.finished=s,e.destroyed=a,i%n&&e.buffer.set(r),e}};const W4=BigInt(2**32-1),wL=BigInt(32);function tse(t,e=!1){return e?{h:Number(t&W4),l:Number(t>>wL&W4)}:{h:Number(t>>wL&W4)|0,l:Number(t&W4)|0}}function RUe(t,e=!1){let n=new Uint32Array(t.length),r=new Uint32Array(t.length);for(let i=0;i<t.length;i++){const{h:s,l:a}=tse(t[i],e);[n[i],r[i]]=[s,a]}return[n,r]}const jUe=(t,e)=>BigInt(t>>>0)<<wL|BigInt(e>>>0),MUe=(t,e,n)=>t>>>n,DUe=(t,e,n)=>t<<32-n|e>>>n,UUe=(t,e,n)=>t>>>n|e<<32-n,BUe=(t,e,n)=>t<<32-n|e>>>n,FUe=(t,e,n)=>t<<64-n|e>>>n-32,zUe=(t,e,n)=>t>>>n-32|e<<64-n,VUe=(t,e)=>e,HUe=(t,e)=>t,WUe=(t,e,n)=>t<<n|e>>>32-n,qUe=(t,e,n)=>e<<n|t>>>32-n,ZUe=(t,e,n)=>e<<n-32|t>>>64-n,KUe=(t,e,n)=>t<<n-32|e>>>64-n;function GUe(t,e,n,r){const i=(e>>>0)+(r>>>0);return{h:t+n+(i/2**32|0)|0,l:i|0}}const YUe=(t,e,n)=>(t>>>0)+(e>>>0)+(n>>>0),JUe=(t,e,n,r)=>e+n+r+(t/2**32|0)|0,XUe=(t,e,n,r)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0),QUe=(t,e,n,r,i)=>e+n+r+i+(t/2**32|0)|0,eBe=(t,e,n,r,i)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0)+(i>>>0),tBe=(t,e,n,r,i,s)=>e+n+r+i+s+(t/2**32|0)|0,Xt={fromBig:tse,split:RUe,toBig:jUe,shrSH:MUe,shrSL:DUe,rotrSH:UUe,rotrSL:BUe,rotrBH:FUe,rotrBL:zUe,rotr32H:VUe,rotr32L:HUe,rotlSH:WUe,rotlSL:qUe,rotlBH:ZUe,rotlBL:KUe,add:GUe,add3L:YUe,add3H:JUe,add4L:XUe,add4H:QUe,add5H:tBe,add5L:eBe},[nBe,rBe]=Xt.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e3585
5445771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),Nd=new Uint32Array(80),Od=new Uint32Array(80);let iBe=class extends PUe{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}
vendor: 4,843 bytes, line 544
544get(){const{Ah:e,Al:n,Bh:r,Bl:i,Ch:s,Cl:a,Dh:o,Dl:l,Eh:u,El:f,Fh:p,Fl:y,Gh:g,Gl:b,Hh:v,Hl:_}=this;return[e,n,r,i,s,a,o,l,u,f,p,y,g,b,v,_]}set(e,n,r,i,s,a,o,l,u,f,p,y,g,b,v,_){this.Ah=e|0,this.Al=n|0,this.Bh=r|0,this.Bl=i|0,this.Ch=s|0,this.Cl=a|0,this.Dh=o|0,this.Dl=l|0,this.Eh=u|0,this.El=f|0,this.Fh=p|0,this.Fl=y|0,this.Gh=g|0,this.Gl=b|0,this.Hh=v|0,this.Hl=_|0}process(e,n){for(let x=0;x<16;x++,n+=4)Nd[x]=e.getUint32(n),Od[x]=e.getUint32(n+=4);for(let x=16;x<80;x++){const A=Nd[x-15]|0,I=Od[x-15]|0,$=Xt.rotrSH(A,I,1)^Xt.rotrSH(A,I,8)^Xt.shrSH(A,I,7),O=Xt.rotrSL(A,I,1)^Xt.rotrSL(A,I,8)^Xt.shrSL(A,I,7),P=Nd[x-2]|0,j=Od[x-2]|0,U=Xt.rotrSH(P,j,19)^Xt.rotrBH(P,j,61)^Xt.shrSH(P,j,6),z=Xt.rotrSL(P,j,19)^Xt.rotrBL(P,j,61)^Xt.shrSL(P,j,6),D=Xt.add4L(O,z,Od[x-7],Od[x-16]),R=Xt.add4H(D,$,U,Nd[x-7],Nd[x-16]);Nd[x]=R|0,Od[x]=D|0}let{Ah:r,Al:i,Bh:s,Bl:a,Ch:o,Cl:l,Dh:u,Dl:f,Eh:p,El:y,Fh:g,Fl:b,Gh:v,Gl:_,Hh:C,Hl:S}=this;for(let x=0;x<80;x++){const A=Xt.rotrSH(p,y,14)^Xt.rotrSH(p,y,18)^Xt.rotrBH(p,y,41),I=Xt.rotrSL(p,y,14)^Xt.rotrSL(p,y,18)^Xt.rotrBL(p,y,41),$=p&g^~p&v,O=y&b^~y&_,P=Xt.add5L(S,I,O,rBe[x],Od[x]),j=Xt.add5H(P,C,A,$,nBe[x],Nd[x]),U=P|0,z=Xt.rotrSH(r,i,28)^Xt.rotrBH(r,i,34)^Xt.rotrBH(r,i,39),D=Xt.rotrSL(r,i,28)^Xt.rotrBL(r,i,34)^Xt.rotrBL(r,i,39),R=r&s^r&o^s&o,W=i&a^i&l^a&l;C=v|0,S=_|0,v=g|0,_=b|0,g=p|0,b=y|0,{h:p,l:y}=Xt.add(u|0,f|0,j|0,U|0),u=o|0,f=l|0,o=s|0,l=a|0,s=r|0,a=i|0;const T=Xt.add3L(U,D,W);r=Xt.add3H(T,j,z,R),i=T|0}({h:r,l:i}=Xt.add(this.Ah|0,this.Al|0,r|0,i|0)),{h:s,l:a}=Xt.add(this.Bh|0,this.Bl|0,s|0,a|0),{h:o,l}=Xt.add(this.Ch|0,this.Cl|0,o|0,l|0),{h:u,l:f}=Xt.add(this.Dh|0,this.Dl|0,u|0,f|0),{h:p,l:y}=Xt.add(this.Eh|0,this.El|0,p|0,y|0),{h:g,l:b}=Xt.add(this.Fh|0,this.Fl|0,g|0,b|0),{h:v,l:_}=Xt.add(this.Gh|0,this.Gl|0,v|0,_|0),{h:C,l:S}=Xt.add(this.Hh|0,this.Hl|0,C|0,S|0),this.set(r,i,s,a,o,l,u,f,p,y,g,b,v,_,C,S)}roundClean(){Nd.fill(0),Od.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};const sBe=NUe(()=>new iBe);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const RO=BigInt(0),nse=BigInt(1),aBe=BigInt(2);function jO(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function MO(t){if(!jO(t))throw new Error("Uint8Array expected")}function aS(t,e){if(typeof e!="boolean")throw new Error(t+" boolean expected, got "+e)}const oBe=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function DO(t){MO(t);let e="";for(let n=0;n<t.length;n++)e+=oBe[t[n]];return e}function rse(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?RO:BigInt("0x"+t)}const Kc={_0:48,_9:57,A:65,F:70,a:97,f:102};function eW(t){if(t>=Kc._0&&t<=Kc._9)return t-Kc._0;if(t>=Kc.A&&t<=Kc.F)return t-(Kc.A-10);if(t>=Kc.a&&t<=Kc.f)return t-(Kc.a-10)}function ise(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const e=t.length,n=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(n);for(let i=0,s=0;i<n;i++,s+=2){const a=eW(t.charCodeAt(s)),o=eW(t.charCodeAt(s+1));if(a===void 0||o===void 0){const l=t[s]+t[s+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+s)}r[i]=a*16+o}return r}function lBe(t){return rse(DO(t))}function Uw(t){return MO(t),rse(DO(Uint8Array.from(t).reverse()))}function sse(t,e){return ise(t.toString(16).padStart(e*2,"0"))}function vL(t,e){return sse(t,e).reverse()}function Gc(t,e,n){let r;if(typeof e=="string")try{r=ise(e)}catch(s){throw new Error(t+" must be hex string or Uint8Array, cause: "+s)}else if(jO(e))r=Uint8Array.from(e);else throw new Error(t+" must be hex string or Uint8Array");const i=r.length;if(typeof n=="number"&&i!==n)throw new Error(t+" of length "+n+" expected, got "+i);return r}function tW(...t){let e=0;for(let r=0;r<t.length;r++){const i=t[r];MO(i),e+=i.length}const n=new Uint8Array(e);for(let r=0,i=0;r<t.length;r++){const s=t[r];n.set(s,i),i+=s.length}return n}const oS=t=>typeof t=="bigint"&&RO<=t;function cBe(t,e,n){return oS(t)&&oS(e)&&oS(n)&&e<=t&&t<n}function Fy(t,e,n,r){if(!cBe(e,n,r))throw new Error("expected valid "+t+": "+n+" <= n < "+r+", got "+e)}function uBe(t){let e;for(e=0;t>RO;t>>=nse,e+=1);return e}const dBe=t=>(aBe<<BigInt(t-1))-nse,hBe={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||jO(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function UO(t,e,n={}){const r=(i,s,a)=>{const o=hBe[s];if(typeof o!="function")throw new Error("invalid validator function");const l=t[i];if(!(a&&l===void 0)&&!o(l,t))throw new Error("param "+String(i)+" is invali
544d. Expected "+s+", got "+l)};for(const[i,s]of Object.entries(e))r(i,s,!1);for(const[i,s]of Object.entries(n))r(i,s,!0);return t}function nW(t){const e=new WeakMap;return(n,...r)=>{const i=e.get(n);if(i!==void 0)return i;const s=t(n,...r);return e.set(n,s),s}}const Hi=BigInt(0),ni=BigInt(1),Dh=BigInt(2),fBe=BigInt(3),_L=BigInt(4),rW=BigInt(5),iW=BigInt(8);function Li(t,e){const n=t%e;return n>=Hi?n:e+n}function pBe(t,e,n){if(e<Hi)throw new Error("invalid exponent, negatives unsupported");if(n<=Hi)throw new Error("invalid modulus");if(n===ni)return Hi;let r=ni;for(;e>Hi;)e&ni&&(r=r*t%n),t=t*t%n,e>>=ni;return r}function Rl(t,e,n){let r=t;for(;e-- >Hi;)r*=r,r%=n;return r}function sW(t,e){if(t===Hi)throw new Error("invert: expected non-zero number");if(e<=Hi)throw new Error("invert: expected positive modulus, got "+e);let n=Li(t,e),r=e,i=Hi,s=ni;for(;n!==Hi;){const a=r/n,o=r%n,l=i-s*a;r=n,n=o,i=s,s=l}if(r!==ni)throw new Error("invert: does not exist");return Li(i,e)}function mBe(t){const e=(t-ni)/Dh;let n,r,i;for(n=t-ni,r=0;n%Dh===Hi;n/=Dh,r++);for(i=Dh;i<t&&pBe(i,e,t)!==t-ni;i++)if(i>1e3)throw new Error("Cannot find square root: likely non-prime P");if(r===1){const a=(t+ni)/_L;return function(o,l){const u=o.pow(l,a);if(!o.eql(o.sqr(u),l))throw new Error("Cannot find square root");return u}}const s=(n+ni)/Dh;return function(a,o){if(a.pow(o,e)===a.neg(a.ONE))throw new Error("Cannot find square root");let l=r,u=a.pow(a.mul(a.ONE,i),n),f=a.pow(o,s),p=a.pow(o,n);for(;!a.eql(p,a.ONE);){if(a.eql(p,a.ZERO))return a.ZERO;let y=1;for(let b=a.sqr(p);y<l&&!a.eql(b,a.ONE);y++)b=a.sqr(b);const g=a.pow(u,ni<<BigInt(l-y-1));u=a.sqr(g),f=a.mul(f,g),p=a.mul(p,u),l=y}return f}}function yBe(t){if(t%_L===fBe){const e=(t+ni)/_L;return function(n,r){const i=n.pow(r,e);if(!n.eql(n.sqr(i),r))throw new Error("Cannot find square root");return i}}if(t%iW===rW){const e=(t-rW)/iW;return function(n,r){const i=n.mul(r,Dh),s=n.pow(i,e),a=n.mul(r,s),o=n.mul(n.mul(a,Dh),s),l=n.mul(a,n.sub(o,n.ONE));if(!n.eql(n.sqr(l),r))throw new Error("Cannot find square root");return l}}return mBe(t)}const gBe=(t,e)=>(Li(t,e)&ni)===ni,bBe=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function wBe(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=bBe.reduce((r,i)=>(r[i]="function",r),e);return UO(t,n)}function vBe(t,e,n){if(n<Hi)throw new Error("invalid exponent, negatives unsupported");if(n===Hi)return t.ONE;if(n===ni)return e;let r=t.ONE,i=e;for(;n>Hi;)n&ni&&(r=t.mul(r,i)),i=t.sqr(i),n>>=ni;return r}function _Be(t,e){const n=new Array(e.length),r=e.reduce((s,a,o)=>t.is0(a)?s:(n[o]=s,t.mul(s,a)),t.ONE),i=t.inv(r);return e.reduceRight((s,a,o)=>t.is0(a)?s:(n[o]=t.mul(s,n[o]),t.mul(s,a)),i),n}function ase(t,e){const n=e!==void 0?e:t.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function ose(t,e,n=!1,r={}){if(t<=Hi)throw new Error("invalid field: expected ORDER > 0, got "+t);const{nBitLength:i,nByteLength:s}=ase(t,e);if(s>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let a;const o=Object.freeze({ORDER:t,isLE:n,BITS:i,BYTES:s,MASK:dBe(i),ZERO:Hi,ONE:ni,create:l=>Li(l,t),isValid:l=>{if(typeof l!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof l);return Hi<=l&&l<t},is0:l=>l===Hi,isOdd:l=>(l&ni)===ni,neg:l=>Li(-l,t),eql:(l,u)=>l===u,sqr:l=>Li(l*l,t),add:(l,u)=>Li(l+u,t),sub:(l,u)=>Li(l-u,t),mul:(l,u)=>Li(l*u,t),pow:(l,u)=>vBe(o,l,u),div:(l,u)=>Li(l*sW(u,t),t),sqrN:l=>l*l,addN:(l,u)=>l+u,subN:(l,u)=>l-u,mulN:(l,u)=>l*u,inv:l=>sW(l,t),sqrt:r.sqrt||(l=>(a||(a=yBe(t)),a(o,l))),invertBatch:l=>_Be(o,l),cmov:(l,u,f)=>f?u:l,toBytes:l=>n?vL(l,s):sse(l,s),fromBytes:l=>{if(l.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+l.length);return n?Uw(l):lBe(l)}});return Object.freeze(o)}const aW=BigInt(0),q4=BigInt(1);function lS(t,e){const n=e.negate();return t?n:e}function lse(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function cS(t,e){lse(t,e);const n=Math.ceil(e/t)+1,r=2**(t-1);return{windows:n,windowSize:r}}function xBe(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach((n,r)=>{if(!(n instanceof e))throw new Error("invalid point at index "+r)})}function CBe(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((n,r)=>{if(!e.isValid(n))throw new Error("invalid scalar at index "+r)})}const uS=new WeakMap,cse=new WeakMap;function dS(t){return cse.get(t)||1}function EBe(t,e){return{constTimeNegate:lS,hasPrecomputes(n){return dS(n)!==1},unsafeLadder(n,r,i=t.ZERO){let s=n;for(;r>aW;)r&q4&&(i=i.add(s)),s=s.double(),r>>=q4;return i},precomputeWindow(n,r){const{windows:i,windowSize:s}=cS(r,e),a=[];let o=n,l=o;for(let u=0;u<i;u++){l=o,a.push(l);for(let f=1;f<s;f++)l=l.add(o),a.push(l);o=l.double()}return a},wNAF(n,r,i){const{windows:s,windowSize:a}=cS(n,e);let o=t.ZERO,l=t.BASE;const u=BigInt(2**n-1),f=2**n,p=BigInt(n);for(let y=0;y<s;y++){const g=y*a;let b=Number(i&u);i>>=p,b>a&&(b-=f,i+=q4);const v=g,_=g+Math.abs(b)-1,C=y%2!==0,S=b<0;b===0?l=l.add(lS(C,r[v])):o=o.add(lS(S,r[_]))}return{p:o,f:l}},wNAFUnsafe(n,r,i,s=t.ZERO){const{windows:a,windowSize:o}=cS(n,e),l=BigInt(2**n-1),u=2**n,f=BigInt(n);for(let p=0;p<a;p++){const y=p*o;if(i===aW)break;let g=Number(i&l);if(i>>=f,g>o&&(g-=u,i+=q4),g===0)continue;let b=r[y+Math.abs(g)-1];g<0&&(b=b.negate()),s=s.add(b)}return s},getPrecomputes(n,r,i){let s=uS.get(r);
vendor: 23,702 bytes, line 544
544return s||(s=this.precomputeWindow(r,n),n!==1&&uS.set(r,i(s))),s},wNAFCached(n,r,i){const s=dS(n);return this.wNAF(s,this.getPrecomputes(s,n,i),r)},wNAFCachedUnsafe(n,r,i,s){const a=dS(n);return a===1?this.unsafeLadder(n,r,s):this.wNAFUnsafe(a,this.getPrecomputes(a,n,i),r,s)},setWindowSize(n,r){lse(r,e),cse.set(n,r),uS.delete(n)}}}function SBe(t,e,n,r){if(xBe(n,t),CBe(r,e),n.length!==r.length)throw new Error("arrays of points and scalars must have equal length");const i=t.ZERO,s=uBe(BigInt(n.length)),a=s>12?s-3:s>4?s-2:s?2:1,o=(1<<a)-1,l=new Array(o+1).fill(i),u=Math.floor((e.BITS-1)/a)*a;let f=i;for(let p=u;p>=0;p-=a){l.fill(i);for(let g=0;g<r.length;g++){const b=r[g],v=Number(b>>BigInt(p)&BigInt(o));l[v]=l[v].add(n[g])}let y=i;for(let g=l.length-1,b=i;g>0;g--)b=b.add(l[g]),y=y.add(b);if(f=f.add(y),p!==0)for(let g=0;g<a;g++)f=f.double()}return f}function ABe(t){return wBe(t.Fp),UO(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...ase(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}const Jo=BigInt(0),Ks=BigInt(1),Z4=BigInt(2),kBe=BigInt(8),TBe={zip215:!0};function LBe(t){const e=ABe(t);return UO(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function $Be(t){const e=LBe(t),{Fp:n,n:r,prehash:i,hash:s,randomBytes:a,nByteLength:o,h:l}=e,u=Z4<<BigInt(o*8)-Ks,f=n.create,p=ose(e.n,e.nBitLength),y=e.uvRatio||((T,L)=>{try{return{isValid:!0,value:n.sqrt(T*n.inv(L))}}catch{return{isValid:!1,value:Jo}}}),g=e.adjustScalarBytes||(T=>T),b=e.domain||((T,L,M)=>{if(aS("phflag",M),L.length||M)throw new Error("Contexts/pre-hash are not supported");return T});function v(T,L){Fy("coordinate "+T,L,Jo,u)}function _(T){if(!(T instanceof x))throw new Error("ExtendedPoint expected")}const C=nW((T,L)=>{const{ex:M,ey:Z,ez:H}=T,V=T.is0();L==null&&(L=V?kBe:n.inv(H));const F=f(M*L),q=f(Z*L),G=f(H*L);if(V)return{x:Jo,y:Ks};if(G!==Ks)throw new Error("invZ was invalid");return{x:F,y:q}}),S=nW(T=>{const{a:L,d:M}=e;if(T.is0())throw new Error("bad point: ZERO");const{ex:Z,ey:H,ez:V,et:F}=T,q=f(Z*Z),G=f(H*H),Y=f(V*V),X=f(Y*Y),te=f(q*L),ie=f(Y*f(te+G)),se=f(X+f(M*f(q*G)));if(ie!==se)throw new Error("bad point: equation left != right (1)");const pe=f(Z*H),Ce=f(V*F);if(pe!==Ce)throw new Error("bad point: equation left != right (2)");return!0});class x{constructor(L,M,Z,H){this.ex=L,this.ey=M,this.ez=Z,this.et=H,v("x",L),v("y",M),v("z",Z),v("t",H),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(L){if(L instanceof x)throw new Error("extended point not allowed");const{x:M,y:Z}=L||{};return v("x",M),v("y",Z),new x(M,Z,Ks,f(M*Z))}static normalizeZ(L){const M=n.invertBatch(L.map(Z=>Z.ez));return L.map((Z,H)=>Z.toAffine(M[H])).map(x.fromAffine)}static msm(L,M){return SBe(x,p,L,M)}_setWindowSize(L){$.setWindowSize(this,L)}assertValidity(){S(this)}equals(L){_(L);const{ex:M,ey:Z,ez:H}=this,{ex:V,ey:F,ez:q}=L,G=f(M*q),Y=f(V*H),X=f(Z*q),te=f(F*H);return G===Y&&X===te}is0(){return this.equals(x.ZERO)}negate(){return new x(f(-this.ex),this.ey,this.ez,f(-this.et))}double(){const{a:L}=e,{ex:M,ey:Z,ez:H}=this,V=f(M*M),F=f(Z*Z),q=f(Z4*f(H*H)),G=f(L*V),Y=M+Z,X=f(f(Y*Y)-V-F),te=G+F,ie=te-q,se=G-F,pe=f(X*ie),Ce=f(te*se),xe=f(X*se),Te=f(ie*te);return new x(pe,Ce,Te,xe)}add(L){_(L);const{a:M,d:Z}=e,{ex:H,ey:V,ez:F,et:q}=this,{ex:G,ey:Y,ez:X,et:te}=L;if(M===BigInt(-1)){const ve=f((V-H)*(Y+G)),et=f((V+H)*(Y-G)),rn=f(et-ve);if(rn===Jo)return this.double();const br=f(F*Z4*te),$n=f(q*Z4*X),$t=$n+br,jr=et+ve,ar=$n-br,Mr=f($t*rn),In=f(jr*ar),Tr=f($t*ar),ln=f(rn*jr);return new x(Mr,In,ln,Tr)}const ie=f(H*G),se=f(V*Y),pe=f(q*Z*te),Ce=f(F*X),xe=f((H+V)*(G+Y)-ie-se),Te=Ce-pe,Et=Ce+pe,Ke=f(se-M*ie),Ge=f(xe*Te),nn=f(Et*Ke),yr=f(xe*Ke),gr=f(Te*Et);return new x(Ge,nn,gr,yr)}subtract(L){return this.add(L.negate())}wNAF(L){return $.wNAFCached(this,L,x.normalizeZ)}multiply(L){const M=L;Fy("scalar",M,Ks,r);const{p:Z,f:H}=this.wNAF(M);return x.normalizeZ([Z,H])[0]}multiplyUnsafe(L,M=x.ZERO){const Z=L;return Fy("scalar",Z,Jo,r),Z===Jo?I:this.is0()||Z===Ks?this:$.wNAFCachedUnsafe(this,Z,x.normalizeZ,M)}isSmallOrder(){return this.multiplyUnsafe(l).is0()}isTorsionFree(){return $.unsafeLadder(this,r).is0()}toAffine(L){return C(this,L)}clearCofactor(){const{h:L}=e;return L===Ks?this:this.multiplyUnsafe(L)}static fromHex(L,M=!1){const{d:Z,a:H}=e,V=n.BYTES;L=Gc("pointHex",L,V),aS("zip215",M);const F=L.slice(),q=L[V-1];F[V-1]=q&-129;const G=Uw(F),Y=M?u:n.ORDER;Fy("pointHex.y",G,Jo,Y);const X=f(G*G),te=f(X-Ks),ie=f(Z*X-H);let{isValid:se,value:pe}=y(te,ie);if(!se)throw new Error("Point.fromHex: invalid y coordinate");const Ce=(pe&Ks)===Ks,xe=(q&128)!==0;if(!M&&pe===Jo&&xe)throw new Error("Point.fromHex: x=0 and x_0=1");return xe!==Ce&&(pe=f(-pe)),x.fromAffine({x:pe,y:G})}static fromPrivateKey(L){return j(L).point}toRawBytes(){const{x:L,y:M}=this.toAffine(),Z=vL(M,n.BYTES);return Z[Z.length-1]|=L&Ks?128:0,Z}toHex(){return DO(this.toRawBytes())}}x.BASE=new x(e.Gx,e.Gy,Ks,f(e.Gx*e.Gy)),x.ZERO=new x(Jo,Ks,Ks,Jo);const{BASE:A,ZERO:I}=x,$=EBe(x,o*8);function O(T){return Li(T,r)}function P(T){return O(Uw(T))}function j(T){const L=n.BYTES;T=Gc("private key",T,L);const M=Gc("hashed private key",s(T),2*L),Z=g(M.slice(0,L)),H=M.slice(L,2*L),V=P(Z),F=A.multiply(V),q=F.toRawBytes();return{head:Z,prefix:H,scalar:V,point:F,pointBytes:q}}function U(T){return j(T).pointBytes}function z(T=new Uint8Array,...L){const M=tW(...L);return P(s(b(M,Gc("context",T),!!i)))}function D(T,L,M={}){T=Gc("message",T),i&&(T=i(T));const{prefix:Z,scalar:H,pointBytes:V}=j(L),F=z(M.context,Z,T),q=A.multiply(F).toRawBytes(),G=z(M.context,q,V,T),Y=O(F+G*H);Fy("signature.s",Y,Jo,r);const X=tW(q,vL(Y,n.BYTES));return Gc("result",X,n.BYTES*2)}const R=TBe;function W(T,L,M,Z=R){const{context:H,zip215:V}=Z,F=n.BYTES;T=Gc("signature",T,2*F),L=Gc("message",L),M=Gc("publicKey",M,F),V!==void 0&&aS("zip215",V),i&&(L=i(L));const q=Uw(T.slice(F,2*F));let G,Y,X;try{G=x.fromHex(M,V),Y=x.fromHex(T.slice(0,F),V),X=A.multiplyUnsafe(q)}catch{return!1}if(!V&&G.isSmallOrder())return!1;const te=z(H,Y.toRawBytes(),G.toRawBytes(),L);return Y.add(G.multiplyUnsafe(te)).subtract(X).clearCofactor().equals(x.ZERO)}return A._setWindowSize(8),{CURVE:e,getPublicKey:U,sign:D,verify:W,ExtendedPoint:x,utils:{getExtendedPublicKey:j,randomPrivateKey:()=>a(n.BYTES),precompute(T=8,L=x.BASE){return L._setWindowSize(T),L.multiply(BigInt(3)),L}}}}BigInt(0),BigInt(1);const BO=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),oW=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);const IBe=BigInt(1),lW=BigInt(2);BigInt(3);const NBe=BigInt(5),OBe=BigInt(8);function PBe(t){const e=BigInt(10),n=BigInt(20),r=BigInt(40),i=BigInt(80),s=BO,a=t*t%s*t%s,o=Rl(a,lW,s)*a%s,l=Rl(o,IBe,s)*t%s,u=Rl(l,NBe,s)*l%s,f=Rl(u,e,s)*u%s,p=Rl(f,n,s)*f%s,y=Rl(p,r,s)*p%s,g=Rl(y,i,s)*y%s,b=Rl(g,i,s)*y%s,v=Rl(b,e,s)*u%s;return{pow_p_5_8:Rl(v,lW,s)*t%s,b2:a}}function RBe(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function jBe(t,e){const n=BO,r=Li(e*e*e,n),i=Li(r*r*e,n),s=PBe(t*i).pow_p_5_8;let a=Li(t*r*s,n);const o=Li(e*a*a,n),l=a,u=Li(a*oW,n),f=o===t,p=o===Li(-t,n),y=o===Li(-t*oW,n);return f&&(a=l),(p||y)&&(a=u),gBe(a,n)&&(a=Li(-a,n)),{isValid:f||p,value:a}}const MBe=ose(BO,void 0,!0),DBe={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:MBe,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:OBe,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:sBe,randomBytes:ese,adjustScalarBytes:RBe,uvRatio:jBe},use=$Be(DBe),UBe="EdDSA",BBe="JWT",uv=".",i9="base64url",dse="utf8",hse="utf8",FBe=":",zBe="did",VBe="key",cW="base58btc",HBe="z",WBe="K36",qBe=32;function FO(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function fse(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?FO(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function pse(t,e){e||(e=t.reduce((i,s)=>i+s.length,0));const n=fse(e);let r=0;for(const i of t)n.set(i,r),r+=i.length;return FO(n)}function ZBe(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),r=0;r<n.length;r++)n[r]=255;for(var i=0;i<t.length;i++){var s=t.charAt(i),a=s.charCodeAt(0);if(n[a]!==255)throw new TypeError(s+" is ambiguous");n[a]=i}var o=t.length,l=t.charAt(0),u=Math.log(o)/Math.log(256),f=Math.log(256)/Math.log(o);function p(b){if(b instanceof Uint8Array||(ArrayBuffer.isView(b)?b=new Uint8Array(b.buffer,b.byteOffset,b.byteLength):Array.isArray(b)&&(b=Uint8Array.from(b))),!(b instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(b.length===0)return"";for(var v=0,_=0,C=0,S=b.length;C!==S&&b[C]===0;)C++,v++;for(var x=(S-C)*f+1>>>0,A=new Uint8Array(x);C!==S;){for(var I=b[C],$=0,O=x-1;(I!==0||$<_)&&O!==-1;O--,$++)I+=256*A[O]>>>0,A[O]=I%o>>>0,I=I/o>>>0;if(I!==0)throw new Error("Non-zero carry");_=$,C++}for(var P=x-_;P!==x&&A[P]===0;)P++;for(var j=l.repeat(v);P<x;++P)j+=t.charAt(A[P]);return j}function y(b){if(typeof b!="string")throw new TypeError("Expected String");if(b.length===0)return new Uint8Array;var v=0;if(b[v]!==" "){for(var _=0,C=0;b[v]===l;)_++,v++;for(var S=(b.length-v)*u+1>>>0,x=new Uint8Array(S);b[v];){var A=n[b.charCodeAt(v)];if(A===255)return;for(var I=0,$=S-1;(A!==0||I<C)&&$!==-1;$--,I++)A+=o*x[$]>>>0,x[$]=A%256>>>0,A=A/256>>>0;if(A!==0)throw new Error("Non-zero carry");C=I,v++}if(b[v]!==" "){for(var O=S-C;O!==S&&x[O]===0;)O++;for(var P=new Uint8Array(_+(S-O)),j=_;O!==S;)P[j++]=x[O++];return P}}}function g(b){var v=y(b);if(v)return v;throw new Error(`Non-${e} character`)}return{encode:p,decodeUnsafe:y,decode:g}}var KBe=ZBe,GBe=KBe;const mse=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},YBe=t=>new TextEncoder().encode(t),JBe=t=>new TextDecoder().decode(t);let XBe=class{constructor(e,n,r){this.name=e,this.prefix=n,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},QBe=class{constructor(e,n,r){if(this.name=e,this.prefix=n,n.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=n.codePointAt(0),this.baseDecode=r}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return yse(this,e)}},eFe=class{constructor(e){this.decoders=e}or(e){return yse(this,e)}decode(e){const n=e[0],r=this.decoders[n];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};const yse=(t,e)=>new eFe({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});let tFe=class{constructor(e,n,r,i){this.name=e,this.prefix=n,this.baseEncode=r,this.baseDecode=i,this.encoder=new XBe(e,n,r),this.decoder=new QBe(e,n,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};const s9=({name:t,prefix:e,encode:n,decode:r})=>new tFe(t,e,n,r),m5=({prefix:t,name:e,alphabet:n})=>{const{encode:r,decode:i}=GBe(n,e);return s9({prefix:t,name:e,encode:r,decode:s=>mse(i(s))})},nFe=(t,e,n,r)=>{const i={};for(let f=0;f<e.length;++f)i[e[f]]=f;let s=t.length;for(;t[s-1]==="=";)--s;const a=new Uint8Array(s*n/8|0);let o=0,l=0,u=0;for(let f=0;f<s;++f){const p=i[t[f]];if(p===void 0)throw new SyntaxError(`Non-${r} character`);l=l<<n|p,o+=n,o>=8&&(o-=8,a[u++]=255&l>>o)}if(o>=n||255&l<<8-o)throw new SyntaxError("Unexpected end of data");return a},rFe=(t,e,n)=>{const r=e[e.length-1]==="=",i=(1<<n)-1;let s="",a=0,o=0;for(let l=0;l<t.length;++l)for(o=o<<8|t[l],a+=8;a>n;)a-=n,s+=e[i&o>>a];if(a&&(s+=e[i&o<<n-a]),r)for(;s.length*n&7;)s+="=";return s},ds=({name:t,prefix:e,bitsPerChar:n,alphabet:r})=>s9({prefix:e,name:t,encode(i){return rFe(i,r,n)},decode(i){return nFe(i,r,n,t)}}),iFe=s9({prefix:"\0",name:"identity",encode:t=>JBe(t),decode:t=>YBe(t)});var sFe=Object.freeze({__proto__:null,identity:iFe});const aFe=ds({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var oFe=Object.freeze({__proto__:null,base2:aFe});const lFe=ds({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var cFe=Object.freeze({__proto__:null,base8:lFe});const uFe=m5({prefix:"9",name:"base10",alphabet:"0123456789"});var dFe=Object.freeze({__proto__:null,base10:uFe});const hFe=ds({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),fFe=ds({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var pFe=Object.freeze({__proto__:null,base16:hFe,base16upper:fFe});const mFe=ds({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),yFe=ds({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),gFe=ds({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),bFe=ds({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),wFe=ds({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),vFe=ds({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),_Fe=ds({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),xFe=ds({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),CFe=ds({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var EFe=Object.freeze({__proto__:null,base32:mFe,base32upper:yFe,base32pad:gFe,base32padupper:bFe,base32hex:wFe,base32hexupper:vFe,base32hexpad:_Fe,base32hexpadupper:xFe,base32z:CFe});const SFe=m5({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),AFe=m5({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var kFe=Object.freeze({__proto__:null,base36:SFe,base36upper:AFe});const TFe=m5({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),LFe=m5({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var $Fe=Object.freeze({__proto__:null,base58btc:TFe,base58flickr:LFe});const IFe=ds({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),NFe=ds({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),OFe=ds({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),PFe=ds({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var RFe=Object.freeze({__proto__:null,base64:IFe,base64pad:NFe,base64url:OFe,base64urlpad:PFe});const gse=Array.from("ððªâð°ðððððððððððððâð»ð¥ð¾ð¿ðâ¤ðð¤£ððððððð
ððð¥ð¥°ðððð¢ð¤ðððªðâºðð¤ððððð¹ð¤¦ððââ¨ð¤·ð±ðð¸ððððððððð¤©ððð¤ðð¯ððð¶ðð¤â£ððððªðð¥ððð©ð¡ð¤ªðð¥³ð¥ð¤¤ððð³âððð´ðð¬ððð·ð»ðââ
ð¥ºððð¤ð¦âð£ððâ¹ððð âððºðð»ððððð¹ð£ð«ðððµð¤ðð´ð¤ð¼ð«â½ð¤âðð¤«ðð®ðð»ðð¶ðð²ð¿ð§¡ðâ¡ððââðð°ð¤¨ð¶ð¤ð¶ð°ðð¢ð¤ðð¨ð¨ð¤¬âððºð¤ððð±ðð¶ð¥´â¶â¡âðð¸â¬ð¨ðð¦ð·ðºâ ð
ððµðð¤²ð¤ ð¤§ððµð
ð§ð¾ððð¤ðð¤¯ð·âð§ð¯ððð¤ððâð´ð£ð¸ððð¥ð¤¢ð
ð¡ð©ðð¸ð»ð¤ð¤®ð¼ð¥µð©ððð¼ðð£ð¥"),jFe=gse.reduce((t,e,n)=>(t[n]=e,t),[]),MFe=gse.reduce((t,e,n)=>(t[e.codePointAt(0)]=n,t),[]);function DFe(t){return t.reduce((e,n)=>(e+=jFe[n],e),"")}function UFe(t){const e=[];for(const n of t){const r=MFe[n.codePointAt(0)];if(r===void 0)throw new Error(`Non-base256emoji character: ${n}`);e.push(r)}return new Uint8Array(e)}const BFe=s9({prefix:"ð",name:"base256emoji",encode:DFe,decode:UFe});var FFe=Object.freeze({__proto__:null,base256emoji:BFe}),zFe=bse,uW=128,VFe=-128,HFe=Math.pow(2,31);function bse(t,e,n){e=e||[],n=n||0;for(var r=n;t>=HFe;)e[n++]=t&255|uW,t/=128;for(;t&VFe;)e[n++]=t&255|uW,t>>>=7;return e[n]=t|0,bse.bytes=n-r+1,e}var WFe=xL,qFe=128,dW=127;function xL(t,r){var n=0,r=r||0,i=0,s=r,a,o=t.length;do{if(s>=o)throw xL.bytes=0,new RangeError("Could not decode varint");a=t[s++],n+=i<28?(a&dW)<<i:(a&dW)*Math.pow(2,i),i+=7}while(a>=qFe);return xL.bytes=s-r,n}var ZFe=Math.pow(2,7),KFe=Math.pow(2,14),GFe=Math.pow(2,21),YFe=Math.pow(2,28),JFe=Math.pow(2,35),XFe=Math.pow(2,42),QFe=Math.pow(2,49),eze=Math.pow(2,56),tze=Math.pow(2,63),nze=function(t){return t<ZFe?1:t<KFe?2:t<GFe?3:t<YFe?4:t<JFe?5:t<XFe?6:t<QFe?7:t<eze?8:t<tze?9:10},rze={encode:zFe,decode:WFe,encodingLength:nze},wse=rze;const hW=(t,e,n=0)=>(wse.encode(t,e,n),e),fW=t=>wse.encodingLength(t),CL=(t,e)=>{const n=e.byteLength,r=fW(t),i=r+fW(n),s=new Uint8Array(i+n);return hW(t,s,0),hW(n,s,r),s.set(e,i),new ize(t,n,e,s)};let ize=class{constructor(e,n,r,i){this.code=e,this.size=n,this.digest=r,this.bytes=i}};const vse=({name:t,code:e,encode:n})=>new sze(t,e,n);let sze=class{constructor(e,n,r){this.name=e,this.code=n,this.encode=r}digest(e){if(e instanceof Uint8Array){const n=this.encode(e);return n instanceof Uint8Array?CL(this.code,n):n.then(r=>CL(this.code,r))}else throw Error("Unknown type, must be binary type")}};const _se=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),aze=vse({name:"sha2-256",code:18,encode:_se("SHA-256")}),oze=vse({name:"sha2-512",code:19,encode:_se("SHA-512")});var lze=Object.freeze({__proto__:null,sha256:aze,sha512:oze});const xse=0,cze="identity",Cse=mse,uze=t=>CL(xse,Cse(t)),dze={code:xse,name:cze,encode:Cse,digest:uze};var hze=Object.freeze({__proto__:null,identity:dze});new TextEncoder,new TextDecoder;const pW={...sFe,...oFe,...cFe,...dFe,...pFe,...EFe,...kFe,...$Fe,...RFe,...FFe};({...lze,...hze});function Ese(t,e,n,r){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:n},decoder:{decode:r}}}const mW=Ese("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),hS=Ese("ascii","a",t=>{let e="a";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return e},t=>{t=t.substring(1);const e=fse(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}),Sse={utf8:mW,"utf-8":mW,hex:pW.base16,latin1:hS,ascii:hS,binary:hS,...pW};function a9(t,e="utf8"){const n=Sse[e];if(!n)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):n.encoder.encode(t).substring(1)}function pm(t,e="utf8"){const n=Sse[e];if(!n)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?FO(globalThis.Buffer.from(t,"utf-8")):n.decoder.decode(`${n.prefix}${t}`)}function yW(t){return Lf(a9(pm(t,i9),dse))}function dv(t){return a9(pm(ju(t),dse),i9)}function Ase(t){const e=pm(WBe,cW),n=HBe+a9(pse([e,t]),cW);return[zBe,VBe,n].join(FBe)}function fze(t){return a9(t,i9)}function pze(t){return pm(t,i9)}function mze(t){return pm([dv(t.header),dv(t.payload)].join(uv),hse)}function yze(t){return[dv(t.header),dv(t.payload),fze(t.signature)].join(uv)}function EL(t){const e=t.split(uv),n=yW(e[0]),r=yW(e[1]),i=pze(e[2]),s=pm(e.slice(0,2).join(uv),hse);return{header:n,payload:r,signature:i,data:s}}function gW(t=ese(qBe)){const e=use.getPublicKey(t);return{secretKey:pse([t,e]),publicKey:e}}async function gze(t,e,n,r,i=qe.fromMiliseconds(Date.now())){const s={alg:UBe,typ:BBe},a=Ase(r.publicKey),o=i+n,l={iss:a,sub:t,aud:e,iat:i,exp:o},u=mze({header:s,payload:l}),f=use.sign(u,r.secretKey.slice(0,32));return yze({header:s,payload:l,signature:f})}function zO(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function kse(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?zO(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function Ug(t,e){e||(e=t.reduce((i,s)=>i+s.length,0));const n=kse(e);let r=0;for(const i of t)n.set(i,r),r+=i.length;return zO(n)}function bze(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),r=0;r<n.length;r++)n[r]=255;for(var i=0;i<t.length;i++){var s=t.charAt(i),a=s.charCodeAt(0);if(n[a]!==255)throw new TypeError(s+" is ambiguous");n[a]=i}var o=t.length,l=t.charAt(0),u=Math.log(o)/Math.log(256),f=Math.log(256)/Math.log(o);function p(b){if(b instanceof Uint8Array||(ArrayBuffer.isView(b)?b=new Uint8Array(b.buffer,b.byteOffset,b.byteLength):Array.isArray(b)&&(b=Uint8Array.from(b))),!(b instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(b.length===0)return"";for(var v=0,_=0,C=0,S=b.length;C!==S&&b[C]===0;)C++,v++;for(var x=(S-C)*f+1>>>0,A=new Uint8Array(x);C!==S;){for(var I=b[C],$=0,O=x-1;(I!==0||$<_)&&O!==-1;O--,$++)I+=256*A[O]>>>0,A[O]=I%o>>>0,I=I/o>>>0;if(I!==0)throw new Error("Non-zero carry");_=$,C++}for(var P=x-_;P!==x&&A[P]===0;)P++;for(var j=l.repeat(v);P<x;++P)j+=t.charAt(A[P]);return j}function y(b){if(typeof b!="string")throw new TypeError("Expected String");if(b.length===0)return new Uint8Array;var v=0;if(b[v]!==" "){for(var _=0,C=0;b[v]===l;)_++,v++;for(var S=(b.length-v)*u+1>>>0,x=new Uint8Array(S);b[v];){var A=n[b.charCodeAt(v)];if(A===255)return;for(var I=0,$=S-1;(A!==0||I<C)&&$!==-1;$--,I++)A+=o*x[$]>>>0,x[$]=A%256>>>0,A=A/256>>>0;if(A!==0)throw new Error("Non-zero carry");C=I,v++}if(b[v]!==" "){for(var O=S-C;O!==S&&x[O]===0;)O++;for(var P=new Uint8Array(_+(S-O)),j=_;O!==S;)P[j++]=x[O++];return P}}}function g(b){var v=y(b);if(v)return v;throw new Error(`Non-${e} character`)}return{encode:p,decodeUnsafe:y,decode:g}}var wze=bze,vze=wze;const _ze=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},xze=t=>new TextEncoder().encode(t),Cze=t=>new TextDecoder().decode(t);class Eze{constructor(e,n,r){this.name=e,this.prefix=n,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class Sze{constructor(e,n,r){if(this.name=e,this.prefix=n,n.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=n.codePointAt(0),this.baseDecode=r}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name}
544 decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Tse(this,e)}}class Aze{constructor(e){this.decoders=e}or(e){return Tse(this,e)}decode(e){const n=e[0],r=this.decoders[n];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Tse=(t,e)=>new Aze({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class kze{constructor(e,n,r,i){this.name=e,this.prefix=n,this.baseEncode=r,this.baseDecode=i,this.encoder=new Eze(e,n,r),this.decoder=new Sze(e,n,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const o9=({name:t,prefix:e,encode:n,decode:r})=>new kze(t,e,n,r),y5=({prefix:t,name:e,alphabet:n})=>{const{encode:r,decode:i}=vze(n,e);return o9({prefix:t,name:e,encode:r,decode:s=>_ze(i(s))})},Tze=(t,e,n,r)=>{const i={};for(let f=0;f<e.length;++f)i[e[f]]=f;let s=t.length;for(;t[s-1]==="=";)--s;const a=new Uint8Array(s*n/8|0);let o=0,l=0,u=0;for(let f=0;f<s;++f){const p=i[t[f]];if(p===void 0)throw new SyntaxError(`Non-${r} character`);l=l<<n|p,o+=n,o>=8&&(o-=8,a[u++]=255&l>>o)}if(o>=n||255&l<<8-o)throw new SyntaxError("Unexpected end of data");return a},Lze=(t,e,n)=>{const r=e[e.length-1]==="=",i=(1<<n)-1;let s="",a=0,o=0;for(let l=0;l<t.length;++l)for(o=o<<8|t[l],a+=8;a>n;)a-=n,s+=e[i&o>>a];if(a&&(s+=e[i&o<<n-a]),r)for(;s.length*n&7;)s+="=";return s},hs=({name:t,prefix:e,bitsPerChar:n,alphabet:r})=>o9({prefix:e,name:t,encode(i){return Lze(i,r,n)},decode(i){return Tze(i,r,n,t)}}),$ze=o9({prefix:"\0",name:"identity",encode:t=>Cze(t),decode:t=>xze(t)}),Ize=Object.freeze(Object.defineProperty({__proto__:null,identity:$ze},Symbol.toStringTag,{value:"Module"})),Nze=hs({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),Oze=Object.freeze(Object.defineProperty({__proto__:null,base2:Nze},Symbol.toStringTag,{value:"Module"})),Pze=hs({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),Rze=Object.freeze(Object.defineProperty({__proto__:null,base8:Pze},Symbol.toStringTag,{value:"Module"})),jze=y5({prefix:"9",name:"base10",alphabet:"0123456789"}),Mze=Object.freeze(Object.defineProperty({__proto__:null,base10:jze},Symbol.toStringTag,{value:"Module"})),Dze=hs({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Uze=hs({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),Bze=Object.freeze(Object.defineProperty({__proto__:null,base16:Dze,base16upper:Uze},Symbol.toStringTag,{value:"Module"})),Fze=hs({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),zze=hs({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Vze=hs({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Hze=hs({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Wze=hs({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),qze=hs({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Zze=hs({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Kze=hs({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Gze=hs({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),Yze=Object.freeze(Object.defineProperty({__proto__:null,base32:Fze,base32hex:Wze,base32hexpad:Zze,base32hexpadupper:Kze,base32hexupper:qze,base32pad:Vze,base32padupper:Hze,base32upper:zze,base32z:Gze},Symbol.toStringTag,{value:"Module"})),Jze=y5({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Xze=y5({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),Qze=Object.freeze(Object.defineProperty({__proto__:null,base36:Jze,base36upper:Xze},Symbol.toStringTag,{value:"Module"})),eVe=y5({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),tVe=y5({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),nVe=Object.freeze(Object.defineProperty({__proto__:null,base58btc:eVe,base58flickr:tVe},Symbol.toStringTag,{value:"Module"})),rVe=hs({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
544+/",bitsPerChar:6}),iVe=hs({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),sVe=hs({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),aVe=hs({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),oVe=Object.freeze(Object.defineProperty({__proto__:null,base64:rVe,base64pad:iVe,base64url:sVe,base64urlpad:aVe},Symbol.toStringTag,{value:"Module"})),Lse=Array.from("ððªâð°ðððððððððððððâð»ð¥ð¾ð¿ðâ¤ðð¤£ððððððð
ððð¥ð¥°ðððð¢ð¤ðððªðâºðð¤ððððð¹ð¤¦ððââ¨ð¤·ð±ðð¸ððððððððð¤©ððð¤ðð¯ððð¶ðð¤â£ððððªðð¥ððð©ð¡ð¤ªðð¥³ð¥ð¤¤ððð³âððð´ðð¬ððð·ð»ðââ
ð¥ºððð¤ð¦âð£ððâ¹ððð âððºðð»ððððð¹ð£ð«ðððµð¤ðð´ð¤ð¼ð«â½ð¤âðð¤«ðð®ðð»ðð¶ðð²ð¿ð§¡ðâ¡ððââðð°ð¤¨ð¶ð¤ð¶ð°ðð¢ð¤ðð¨ð¨ð¤¬âððºð¤ððð±ðð¶ð¥´â¶â¡âðð¸â¬ð¨ðð¦ð·ðºâ ð
ððµðð¤²ð¤ ð¤§ððµð
ð§ð¾ððð¤ðð¤¯ð·âð§ð¯ððð¤ððâð´ð£ð¸ððð¥ð¤¢ð
ð¡ð©ðð¸ð»ð¤ð¤®ð¼ð¥µð©ððð¼ðð£ð¥"),lVe=Lse.reduce((t,e,n)=>(t[n]=e,t),[]),cVe=Lse.reduce((t,e,n)=>(t[e.codePointAt(0)]=n,t),[]);function uVe(t){return t.reduce((e,n)=>(e+=lVe[n],e),"")}function dVe(t){const e=[];for(const n of t){const r=cVe[n.codePointAt(0)];if(r===void 0)throw new Error(`Non-base256emoji character: ${n}`);e.push(r)}return new Uint8Array(e)}const hVe=o9({prefix:"ð",name:"base256emoji",encode:uVe,decode:dVe}),fVe=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:hVe},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const bW={...Ize,...Oze,...Rze,...Mze,...Bze,...Yze,...Qze,...nVe,...oVe,...fVe};function $se(t,e,n,r){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:n},decoder:{decode:r}}}const wW=$se("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),fS=$se("ascii","a",t=>{let e="a";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return e},t=>{t=t.substring(1);const e=kse(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}),Ise={utf8:wW,"utf-8":wW,hex:bW.base16,latin1:fS,ascii:fS,binary:fS,...bW};function Eo(t,e="utf8"){const n=Ise[e];if(!n)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?zO(globalThis.Buffer.from(t,"utf-8")):n.decoder.decode(`${n.prefix}${t}`)}function ca(t,e="utf8"){const n=Ise[e];if(!n)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):n.encoder.encode(t).substring(1)}const pVe={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}};var pS,vW;function Nse(){if(vW)return pS;vW=1;const t="Input must be an string, Buffer or Uint8Array";function e(a){let o;if(a instanceof Uint8Array)o=a;
vendor: 39,255 bytes, lines 544-546
544else if(typeof a=="string")o=new TextEncoder().encode(a);else throw new Error(t);return o}function n(a){return Array.prototype.map.call(a,function(o){return(o<16?"0":"")+o.toString(16)}).join("")}function r(a){return(4294967296+a).toString(16).substring(1)}function i(a,o,l){let u=` 545`+a+" = ";for(let f=0;f<o.length;f+=2){if(l===32)u+=r(o[f]).toUpperCase(),u+=" ",u+=r(o[f+1]).toUpperCase();else if(l===64)u+=r(o[f+1]).toUpperCase(),u+=r(o[f]).toUpperCase();else throw new Error("Invalid size "+l);f%6===4?u+=` 546`+new Array(a.length+4).join(" "):f<o.length-2&&(u+=" ")}console.log(u)}function s(a,o,l){let u=new Date().getTime();const f=new Uint8Array(o);for(let y=0;y<o;y++)f[y]=y%256;const p=new Date().getTime();console.log("Generated random input in "+(p-u)+"ms"),u=p;for(let y=0;y<l;y++){const g=a(f),b=new Date().getTime(),v=b-u;u=b,console.log("Hashed in "+v+"ms: "+g.substring(0,20)+"..."),console.log(Math.round(o/(1<<20)/(v/1e3)*100)/100+" MB PER SECOND")}}return pS={normalizeInput:e,toHex:n,debugPrint:i,testSpeed:s},pS}var mS,_W;function mVe(){if(_W)return mS;_W=1;const t=Nse();function e(C,S,x){const A=C[S]+C[x];let I=C[S+1]+C[x+1];A>=4294967296&&I++,C[S]=A,C[S+1]=I}function n(C,S,x,A){let I=C[S]+x;x<0&&(I+=4294967296);let $=C[S+1]+A;I>=4294967296&&$++,C[S]=I,C[S+1]=$}function r(C,S){return C[S]^C[S+1]<<8^C[S+2]<<16^C[S+3]<<24}function i(C,S,x,A,I,$){const O=u[I],P=u[I+1],j=u[$],U=u[$+1];e(l,C,S),n(l,C,O,P);let z=l[A]^l[C],D=l[A+1]^l[C+1];l[A]=D,l[A+1]=z,e(l,x,A),z=l[S]^l[x],D=l[S+1]^l[x+1],l[S]=z>>>24^D<<8,l[S+1]=D>>>24^z<<8,e(l,C,S),n(l,C,j,U),z=l[A]^l[C],D=l[A+1]^l[C+1],l[A]=z>>>16^D<<16,l[A+1]=D>>>16^z<<16,e(l,x,A),z=l[S]^l[x],D=l[S+1]^l[x+1],l[S]=D>>>31^z<<1,l[S+1]=z>>>31^D<<1}const s=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),a=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],o=new Uint8Array(a.map(function(C){return C*2})),l=new Uint32Array(32),u=new Uint32Array(32);function f(C,S){let x=0;for(x=0;x<16;x++)l[x]=C.h[x],l[x+16]=s[x];for(l[24]=l[24]^C.t,l[25]=l[25]^C.t/4294967296,S&&(l[28]=~l[28],l[29]=~l[29]),x=0;x<32;x++)u[x]=r(C.b,4*x);for(x=0;x<12;x++)i(0,8,16,24,o[x*16+0],o[x*16+1]),i(2,10,18,26,o[x*16+2],o[x*16+3]),i(4,12,20,28,o[x*16+4],o[x*16+5]),i(6,14,22,30,o[x*16+6],o[x*16+7]),i(0,10,20,30,o[x*16+8],o[x*16+9]),i(2,12,22,24,o[x*16+10],o[x*16+11]),i(4,14,16,26,o[x*16+12],o[x*16+13]),i(6,8,18,28,o[x*16+14],o[x*16+15]);for(x=0;x<16;x++)C.h[x]=C.h[x]^l[x]^l[x+16]}const p=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function y(C,S,x,A){if(C===0||C>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(S&&S.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(x&&x.length!==16)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(A&&A.length!==16)throw new Error("Illegal personal, expected Uint8Array with length is 16");const I={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:C};p.fill(0),p[0]=C,S&&(p[1]=S.length),p[2]=1,p[3]=1,x&&p.set(x,32),A&&p.set(A,48);for(let $=0;$<16;$++)I.h[$]=s[$]^r(p,$*4);return S&&(g(I,S),I.c=128),I}function g(C,S){for(let x=0;x<S.length;x++)C.c===128&&(C.t+=C.c,f(C,!1),C.c=0),C.b[C.c++]=S[x]}function b(C){for(C.t+=C.c;C.c<128;)C.b[C.c++]=0;f(C,!0);const S=new Uint8Array(C.outlen);for(let x=0;x<C.outlen;x++)S[x]=C.h[x>>2]>>8*(x&3);return S}function v(C,S,x,A,I){x=x||64,C=t.normalizeInput(C),A&&(A=t.normalizeInput(A)),I&&(I=t.normalizeInput(I));const $=y(x,S,A,I);return g($,C),b($)}function _(C,S,x,A,I){const $=v(C,S,x,A,I);return t.toHex($)}return mS={blake2b:v,blake2bHex:_,blake2bInit:y,blake2bUpdate:g,blake2bFinal:b},mS}var yS,xW;function yVe(){if(xW)return yS;xW=1;const t=Nse();function e(b,v){return b[v]^b[v+1]<<8^b[v+2]<<16^b[v+3]<<24}function n(b,v,_,C,S,x){a[b]=a[b]+a[v]+S,a[C]=r(a[C]^a[b],16),a[_]=a[_]+a[C],a[v]=r(a[v]^a[_],12),a[b]=a[b]+a[v]+x,a[C]=r(a[C]^a[b],8),a[_]=a[_]+a[C],a[v]=r(a[v]^a[_],7)}function r(b,v){return b>>>v^b<<32-v}const i=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),s=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),a=new Uint32Array(16),o=new Uint32Array(16);function l(b,v){let _=0;for(_=0;_<8;_++)a[_]=b.h[_],a[_+8]=i[_];for(a[12]^=b.t,a[13]^=b.t/4294967296,v&&(a[14]=~a[14]),_=0;_<16;_++)o[_]=e(b.b,4*_);for(_=0;_<10;_++)n(0,4,8,12,o[s[_*16+0]],o[s[_*16+1]]),n(1,5,9,13,o[s[_*16+2]],o[s[_*16+3]]),n(2,6,10,14,o[s[_*16+4]],o[s[_*16+5]]),n(3,7,11,15,o[s[_*16+6]],o[s[_*16+7]]),n(0,5,10,15,o[s[_*16+8]],o[s[_*16+9]]),n(1,6,11,12,o[s[_*16+10]],o[s[_*16+11]]),n(2,7,8,13,o[s[_*16+12]],o[s[_*16+13]]),n(3,4,9,14,o[s[_*16+14]],o[s[_*16+15]]);for(_=0;_<8;_++)b.h[_]^=a[_]^a[_+8]}function u(b,v){if(!(b>0&&b<=32))throw new Error("Incorrect output length, should be in [1, 32]");const _=v?v.length:0;if(v&&!(_>0&&_<=32))throw new Error("Incorrect key length, should be in [1, 32]");const C={h:new Uint32Array(i),b:new Uint8Array(64),c:0,t:0,outlen:b};return C.h[0]^=16842752^_<<8^b,_>0&&(f(C,v),C.c=64),C}function f(b,v){for(let _=0;_<v.length;_++)b.c===64&&(b.t+=b.c,l(b,!1),b.c=0),b.b[b.c++]=v[_]}function p(b){for(b.t+=b.c;b.c<64;)b.b[b.c++]=0;l(b,!0);const v=new Uint8Array(b.outlen);for(let _=0;_<b.outlen;_++)v[_]=b.h[_>>2]>>8*(_&3)&255;return v}function y(b,v,_){_=_||32,b=t.normalizeInput(b);const C=u(_,v);return f(C,b),p(C)}function g(b,v,_){const C=y(b,v,_);return t.toHex(C)}return yS={blake2s:y,blake2sHex:g,blake2sInit:u,blake2sUpdate:f,blake2sFinal:p},yS}var gS,CW;function gVe(){if(CW)return gS;CW=1;const t=mVe(),e=yVe();return gS={blake2b:t.blake2b,blake2bHex:t.blake2bHex,blake2bInit:t.blake2bInit,blake2bUpdate:t.blake2bUpdate,blake2bFinal:t.blake2bFinal,blake2s:e.blake2s,blake2sHex:e.blake2sHex,blake2sInit:e.blake2sInit,blake2sUpdate:e.blake2sUpdate,blake2sFinal:e.blake2sFinal},gS}var bVe=gVe(),zy={exports:{}},bS,EW;function wVe(){if(EW)return bS;EW=1;function t(n){try{return JSON.stringify(n)}catch{return'"[Circular]"'}}bS=e;function e(n,r,i){var s=i&&i.stringify||t,a=1;if(typeof n=="object"&&n!==null){var o=r.length+a;if(o===1)return n;var l=new Array(o);l[0]=s(n);for(var u=1;u<o;u++)l[u]=s(r[u]);return l.join(" ")}if(typeof n!="string")return n;var f=r.length;if(f===0)return n;for(var p="",y=1-a,g=-1,b=n&&n.length||0,v=0;v<b;){if(n.charCodeAt(v)===37&&v+1<b){switch(g=g>-1?g:0,n.charCodeAt(v+1)){case 100:case 102:if(y>=f||r[y]==null)break;g<v&&(p+=n.slice(g,v)),p+=Number(r[y]),g=v+2,v++;break;case 105:if(y>=f||r[y]==null)break;g<v&&(p+=n.slice(g,v)),p+=Math.floor(Number(r[y])),g=v+2,v++;break;case 79:case 111:case 106:if(y>=f||r[y]===void 0)break;g<v&&(p+=n.slice(g,v));var _=typeof r[y];if(_==="string"){p+="'"+r[y]+"'",g=v+2,v++;break}if(_==="function"){p+=r[y].name||"<anonymous>",g=v+2,v++;break}p+=s(r[y]),g=v+2,v++;break;case 115:if(y>=f)break;g<v&&(p+=n.slice(g,v)),p+=String(r[y]),g=v+2,v++;break;case 37:g<v&&(p+=n.slice(g,v)),p+="%",g=v+2,v++,y--;break}++y}++v}return g===-1?n:(g<b&&(p+=n.slice(g)),p)}return bS}var SW;function vVe(){if(SW)return zy.exports;SW=1;const t=wVe();zy.exports=f;const e=W().console||{},n={mapHttpRequest:O,mapHttpResponse:O,wrapRequestSerializer:P,wrapResponseSerializer:P,wrapErrorSerializer:P,req:O,res:O,err:I,errWithCause:I};function r(T,L){return T==="silent"?1/0:L.levels.values[T]}const i=Symbol("pino.logFuncs"),s=Symbol("pino.hierarchy"),a={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function o(T,L){const M={logger:L,parent:T[s]};L[s]=M}function l(T,L,M){const Z={};L.forEach(H=>{Z[H]=M[H]?M[H]:e[H]||e[a[H]||"log"]||j}),T[i]=Z}function u(T,L){return Array.isArray(T)?T.filter(function(Z){return Z!=="!stdSerializers.err"}):T===!0?Object.keys(L):!1}function f(T){T=T||{},T.browser=T.browser||{};const L=T.browser.transmit;if(L&&typeof L.send!="function")throw Error("pino: transmit option must have a send function");const M=T.browser.write||e;T.browser.write&&(T.browser.asObject=!0);const Z=T.serializers||{},H=u(T.browser.serialize,Z);let V=T.browser.serialize;Array.isArray(T.browser.serialize)&&T.browser.serialize.indexOf("!stdSerializers.err")>-1&&(V=!1);const F=Object.keys(T.customLevels||{}),q=["error","fatal","warn","info","debug","trace"].concat(F);typeof M=="function"&&q.forEach(function(Ce){M[Ce]=M}),(T.enabled===!1||T.browser.disabled)&&(T.level="silent");const G=T.level||"info",Y=Object.create(M);Y.log||(Y.log=j),l(Y,q,M),o({},Y),Object.defineProperty(Y,"levelVal",{get:te}),Object.defineProperty(Y,"level",{get:ie,set:se});const X={transmit:L,serialize:H,asObject:T.browser.asObject,asObjectBindingsOnly:T.browser.asObjectBindingsOnly,formatters:T.browser.formatters,levels:q,timestamp:$(T),messageKey:T.messageKey||"msg",onChild:T.onChild||j};Y.levels=p(T),Y.level=G,Y.isLevelEnabled=function(Ce){return this.levels.values[Ce]?this.levels.values[Ce]>=this.levels.values[this.level]:!1},Y.setMaxListeners=Y.getMaxListeners=Y.emit=Y.addListener=Y.on=Y.prependListener=Y.once=Y.prependOnceListener=Y.removeListener=Y.removeAllListeners=Y.listeners=Y.listenerCount=Y.eventNames=Y.write=Y.flush=j,Y.serializers=Z,Y._serialize=H,Y._stdErrSerialize=V,Y.child=function(...Ce){return pe.call(this,X,...Ce)},L&&(Y._logEvent=A());function te(){return r(this.level,this)}function ie(){return this._level}function se(Ce){if(Ce!=="silent"&&!this.levels.values[Ce])throw Error("unknown level "+Ce);this._level=Ce,b(this,X,Y,"error"),b(this,X,Y,"fatal"),b(this,X,Y,"warn"),b(this,X,Y,"info"),b(this,X,Y,"debug"),b(this,X,Y,"trace"),F.forEach(xe=>{b(this,X,Y,xe)})}function pe(Ce,xe,Te){if(!xe)throw new Error("missing bindings for child Pino");Te=Te||{},H&&xe.serializers&&(Te.serializers=xe.serializers);const Et=Te.serializers;if(H&&Et){var Ke=Object.assign({},Z,Et),Ge=T.browser.serialize===!0?Object.keys(Ke):H;delete xe.serializers,S([xe],Ge,Ke,this._stdErrSerialize)}function nn(gr){this._childLevel=(gr._childLevel|0)+1,this.bindings=xe,Ke&&(this.serializers=Ke,this._serialize=Ge),L&&(this._logEvent=A([].concat(gr._logEvent.bindings,xe)))}nn.prototype=this;const yr=new nn(this);return o(this,yr),yr.child=function(...gr){return pe.call(this,Ce,...gr)},yr.level=Te.level||this.level,Ce.onChild(yr),yr}return Y}function p(T){const L=T.customLevels||{},M=Object.assign({},f.levels.values,L),Z=Object.assign({},f.levels.labels,y(L));return{values:M,labels:Z}}function y(T){const L={};return Object.keys(T).forEach(function(M){L[T[M]]=M}),L}f.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},f.stdSerializers=n,f.stdTimeFunctions=Object.assign({},{nullTime:U,epochTime:z,unixTime:D,isoTime:R});function g(T){const L=[];T.bindings&&L.push(T.bindings);let M=T[s];for(;M.parent;)M=M.parent,M.logger.bindings&&L.push(M.logger.bindings);return L.reverse()}function b(T,L,M,Z){if(Object.defineProperty(T,Z,{value:r(T.level,M)>r(Z,M)?j:M[i][Z],writable:!0,enumerable:!0,configurable:!0}),T[Z]===j){if(!L.transmit)return;const V=L.transmit.level||T.level,F=r(V,M);if(r(Z,M)<F)return}T[Z]=_(T,L,M,Z);const H=g(T);H.length!==0&&(T[Z]=v(H,T[Z]))}function v(T,L){return function(){return L.apply(this,[...T,...arguments])}}function _(T,L,M,Z){return(function(H){return function(){const F=L.timestamp(),q=new Array(arguments.length),G=Object.getPrototypeOf&&Object.getPrototypeOf(this)===e?e:this;for(var Y=0;Y<q.length;Y++)q[Y]=arguments[Y];var X=!1;if(L.serialize&&(S(q,this._serialize,this.serializers,this._stdErrSerialize),X=!0),L.asObject||L.formatters?H.call(G,...C(this,Z,q,F,L)):H.apply(G,q),L.transmit){const te=L.transmit.level||T._level,ie=r(te,M),se=r(Z,M);if(se<ie)return;x(this,{ts:F,methodLevel:Z,methodValue:se,transmitValue:M.levels.values[L.transmit.level||T._level],send:L.transmit.send,val:r(T._level,M)},q,X)}}})(T[i][Z])}function C(T,L,M,Z,H){const{level:V,log:F=te=>te}=H.formatters||{},q=M.slice();let G=q[0];const Y={};let X=(T._childLevel|0)+1;if(X<1&&(X=1),Z&&(Y.time=Z),V){const te=V(L,T.levels.values[L]);Object.assign(Y,te)}else Y.level=T.levels.values[L];if(H.asObjectBindingsOnly){if(G!==null&&typeof G=="object")for(;X--&&typeof q[0]=="object";)Object.assign(Y,q.shift());return[F(Y),...q]}else{if(G!==null&&typeof G=="object"){for(;X--&&typeof q[0]=="object";)Object.assign(Y,q.shift());G=q.length?t(q.shift(),q):void 0}else typeof G=="string"&&(G=t(q.shift(),q));return G!==void 0&&(Y[H.messageKey]=G),[F(Y)]}}function S(T,L,M,Z){for(const H in T)if(Z&&T[H]instanceof Error)T[H]=f.stdSerializers.err(T[H]);else if(typeof T[H]=="object"&&!Array.isArray(T[H])&&L)for(const V in T[H])L.indexOf(V)>-1&&V in M&&(T[H][V]=M[V](T[H][V]))}function x(T,L,M,Z=!1){const H=L.send,V=L.ts,F=L.methodLevel,q=L.methodValue,G=L.val,Y=T._logEvent.bindings;Z||S(M,T._serialize||Object.keys(T.serializers),T.serializers,T._stdErrSerialize===void 0?!0:T._stdErrSerialize),T._logEvent.ts=V,T._logEvent.messages=M.filter(function(X){return Y.indexOf(X)===-1}),T._logEvent.level.label=F,T._logEvent.level.value=q,H(F,T._logEvent,G),T._logEvent=A(Y)}function A(T){return{ts:0,messages:[],bindings:T||[],level:{label:"",value:0}}}function I(T){const L={type:T.constructor.name,msg:T.message,stack:T.stack};for(const M in T)L[M]===void 0&&(L[M]=T[M]);return L}function $(T){return typeof T.timestamp=="function"?T.timestamp:T.timestamp===!1?U:z}function O(){return{}}function P(T){return T}function j(){}function U(){return!1}function z(){return Date.now()}function D(){return Math.round(Date.now()/1e3)}function R(){return new Date(Date.now()).toISOString()}function W(){function T(L){return typeof L<"u"&&L}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return T(self)||T(window)||T(this)||{}}}return zy.exports.default=f,zy.exports.pino=f,zy.exports}var C0=vVe();const Ose=Wa(C0),_Ve={level:"info"},l9="custom_context",VO=1e3*1024;var xVe=Object.defineProperty,CVe=(t,e,n)=>e in t?xVe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,n2=(t,e,n)=>CVe(t,typeof e!="symbol"?e+"":e,n);let EVe=class{constructor(e){n2(this,"nodeValue"),n2(this,"sizeInBytes"),n2(this,"next"),this.nodeValue=e,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}},AW=class{constructor(e){n2(this,"lengthInNodes"),n2(this,"sizeInBytes"),n2(this,"head"),n2(this,"tail"),n2(this,"maxSizeInBytes"),this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=e,this.sizeInBytes=0}append(e){const n=new EVe(e);if(n.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${e} with size ${n.size}`);for(;this.size+n.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=n),this.tail=n):(this.head=n,this.tail=n),this.lengthInNodes++,this.sizeInBytes+=n.size}shift(){if(!this.head)return;const e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){const e=[];let n=this.head;for(;n!==null;)e.push(n.value),n=n.next;return e}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let e=this.head;return{next:()=>{if(!e)return{done:!0,value:null};const n=e.value;return e=e.next,{done:!1,value:n}}}}};var SVe=Object.defineProperty,AVe=(t,e,n)=>e in t?SVe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,K4=(t,e,n)=>AVe(t,typeof e!="symbol"?e+"":e,n);let Pse=class{constructor(e,n=VO){K4(this,"logs"),K4(this,"level"),K4(this,"levelValue"),K4(this,"MAX_LOG_SIZE_IN_BYTES"),this.level=e??"error",this.levelValue=C0.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=n,this.logs=new AW(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,n){n===C0.levels.values.error?console.error(e):n===C0.levels.values.warn?console.warn(e):n===C0.levels.values.debug?console.debug(e):n===C0.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(ju({timestamp:new Date().toISOString(),log:e}));const n=typeof e=="string"?JSON.parse(e).level:e.level;n>=this.levelValue&&this.forwardToConsole(e,n)}getLogs(){return this.logs}clearLogs(){this.logs=new AW(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){const n=this.getLogArray();return n.push(ju({extraMetadata:e})),new Blob(n,{type:"application/json"})}};var kVe=Object.defineProperty,TVe=(t,e,n)=>e in t?kVe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,LVe=(t,e,n)=>TVe(t,e+"",n);let $Ve=class{constructor(e,n=VO){LVe(this,"baseChunkLogger"),this.baseChunkLogger=new Pse(e,n)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}downloadLogsBlobInBrowser(e){const n=URL.createObjectURL(this.logsToBlob(e)),r=document.createElement("a");r.href=n,r.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n)}};var IVe=Object.defineProperty,NVe=(t,e,n)=>e in t?IVe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,OVe=(t,e,n)=>NVe(t,e+"",n);let PVe=class{constructor(e,n=VO){OVe(this,"baseChunkLogger"),this.baseChunkLogger=new Pse(e,n)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}};var RVe=Object.defineProperty,jVe=Object.defineProperties,MVe=Object.getOwnPropertyDescriptors,kW=Object.getOwnPropertySymbols,DVe=Object.prototype.hasOwnProperty,UVe=Object.prototype.propertyIsEnumerable,TW=(t,e,n)=>e in t?RVe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,hv=(t,e)=>{for(var n in e||(e={}))DVe.call(e,n)&&TW(t,n,e[n]);if(kW)for(var n of kW(e))UVe.call(e,n)&&TW(t,n,e[n]);return t},fv=(t,e)=>jVe(t,MVe(e));function BVe(t){return fv(hv({},t),{level:(t==null?void 0:t.level)||_Ve.level})}function FVe(t,e,n=l9){return t[n]=e,t}function ma(t,e=l9){return t[e]||""}function zVe(t,e,n=l9){const r=ma(t,n);return r.trim()?`${r}/${e}`:e}function Ka(t,e,n=l9){const r=zVe(t,e,n),i=t.child({context:r});return FVe(i,r,n)}function VVe(t){var e,n;const r=new $Ve((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:Ose(fv(hv({},t.opts),{level:"trace",browser:fv(hv({},(n=t.opts)==null?void 0:n.browser),{write:i=>r.write(i)})})),chunkLoggerController:r}}function HVe(t){var e;const n=new PVe((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:Ose(fv(hv({},t.opts),{level:"trace"}),n),chunkLoggerController:n}}function Rse(t){return typeof t.loggerOverride<"u"&&typeof t.loggerOverride!="string"?{logger:t.loggerOverride,chunkLoggerController:null}:typeof window<"u"?VVe(t):HVe(t)}var WVe={};const qVe=":";function Su(t){const[e,n]=t.split(qVe);return{namespace:e,reference:n}}function LW(t,e=[]){const n=[];return Object.keys(t).forEach(r=>{if(e.length&&!e.includes(r))return;const i=t[r];n.push(...i.accounts)}),n}function jse(t,e){return t.includes(":")?[t]:e.chains||[]}var ZVe=Object.defineProperty,KVe=Object.defineProperties,GVe=Object.getOwnPropertyDescriptors,$W=Object.getOwnPropertySymbols,YVe=Object.prototype.hasOwnProperty,JVe=Object.prototype.propertyIsEnumerable,SL=(t,e,n)=>e in t?ZVe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,IW=(t,e)=>{for(var n in e||(e={}))YVe.call(e,n)&&SL(t,n,e[n]);if($W)for(var n of $W(e))JVe.call(e,n)&&SL(t,n,e[n]);return t},XVe=(t,e)=>KVe(t,GVe(e)),NW=(t,e,n)=>SL(t,typeof e!="symbol"?e+"":e,n);const QVe="ReactNative",Fa={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},eHe="js";function pv(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function W2(){return!Ru.getDocument()&&!!Ru.getNavigator()&&navigator.product===QVe}function tHe(){return W2()&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"&&(global==null?void 0:global.Platform.OS)==="android"}function nHe(){return W2()&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"&&(global==null?void 0:global.Platform.OS)==="ios"}function mm(){return!pv()&&!!Ru.getNavigator()&&!!Ru.getDocument()}function g5(){return W2()?Fa.reactNative:pv()?Fa.node:mm()?Fa.browser:Fa.unknown}function OW(){var t;try{return W2()&&typeof global<"u"&&typeof(global==null?void 0:global.Application)<"u"?(t=global.Application)==null?void 0:t.applicationId:void 0}catch{return}}function rHe(t,e){const n=new URLSearchParams(t);return Object.entries(e).sort(([r],[i])=>r.localeCompare(i)).forEach(([r,i])=>{i!=null&&n.set(r,String(i))}),n.toString()}function iHe(t){var e,n;const r=Mse();try{return t!=null&&t.url&&r.url&&new URL(t.url).host!==new URL(r.url).host&&(console.warn(`The configured WalletConnect 'metadata.url':${t.url} differs from the actual page url:${r.url}. This is probably unintended and can lead to issues.`),t.url=r.url),(e=t==null?void 0:t.icons)!=null&&e.length&&t.icons.length>0&&(t.icons=t.icons.filter(i=>i!=="")),XVe(IW(IW({},r),t),{url:(t==null?void 0:t.url)||r.url,name:(t==null?void 0:t.name)||r.name,description:(t==null?void 0:t.description)||r.description,icons:(n=t==null?void 0:t.icons)!=null&&n.length&&t.icons.length>0?t.icons:r.icons})}catch(i){return console.warn("Error populating app metadata",i),t||r}}function Mse(){return Vje.getWindowMetadata()||{name:"",description:"",url:"",icons:[""]}}function sHe(){if(g5()===Fa.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:n,Version:r}=global.Platform;return[n,r].join("-")}const t=oje();if(t===null)return"unknown";const e=t.os?t.os.replace(" ","").toLowerCase():"unknown";return t.type==="browser"?[e,t.name,t.version].join("-"):[e,t.version].join("-")}function aHe(){var t;const e=g5();return e===Fa.browser?[e,((t=Ru.getLocation())==null?void 0:t.host)||"unknown"].join(":"):e}function Dse(t,e,n){const r=sHe(),i=aHe();return[[t,e].join("-"),[eHe,n].join("-"),r,i].join("/")}function oHe({protocol:t,version:e,relayUrl:n,sdkVersion:r,auth:i,projectId:s,useOnCloseEvent:a,bundleId:o,packageName:l}){const u=n.split("?"),f=Dse(t,e,r),p={auth:i,ua:f,projectId:s,useOnCloseEvent:a,packageName:l||void 0,bundleId:o||void 0},y=rHe(u[1]||"",p);return u[0]+"?"+y}function Jh(t,e){return t.filter(n=>e.includes(n)).length===t.length}function AL(t){return Object.fromEntries(t.entries())}function kL(t){return new Map(Object.entries(t))}function Lh(t=qe.FIVE_MINUTES,e){const n=qe.toMiliseconds(t||qe.FIVE_MINUTES);let r,i,s,a;return{resolve:o=>{s&&r&&(clearTimeout(s),r(o),a=Promise.resolve(o))},reject:o=>{s&&i&&(clearTimeout(s),i(o))},done:()=>new Promise((o,l)=>{if(a)return o(a);s=setTimeout(()=>{const u=new Error(e);a=Promise.reject(u),l(u)},n),r=o,i=l})}}function Jl(t,e,n){return new Promise(async(r,i)=>{const s=setTimeout(()=>i(new Error(n)),e);try{const a=await t;r(a)}catch(a){i(a)}clearTimeout(s)})}function Use(t,e){if(typeof e=="string"&&e.startsWith(`${t}:`))return e;if(t.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(t.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${t}`)}function lHe(t){return Use("topic",t)}function cHe(t){return Use("id",t)}function Bse(t){const[e,n]=t.split(":"),r={id:void 0,topic:void 0};if(e==="topic"&&typeof n=="string")r.topic=n;else if(e==="id"&&Number.isInteger(Number(n)))r.id=Number(n);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${n}`);return r}function hi(t,e){return qe.fromMiliseconds(Date.now()+qe.toMiliseconds(t))}function Zl(t){return Date.now()>=qe.toMiliseconds(t)}function jn(t,e){return`${t}${e?`:${e}`:""}`}function tc(t=[],e=[]){return[...new Set([...t,...e])]}async function uHe({id:t,topic:e,wcDeepLink:n}){var r;try{if(!n)return;const i=typeof n=="string"?JSON.parse(n):n,s=i==null?void 0:i.href;if(typeof s!="string")return;const a=dHe(s,t,e),o=g5();if(o===Fa.browser){if(!((r=Ru.getDocument())!=null&&r.hasFocus())){console.warn("Document does not have focus, skipping deeplink.");return}hHe(a)}else o===Fa.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(a)}catch(i){console.error(i)}}function dHe(t,e,n){const r=`requestId=${e}&sessionTopic=${n}`;t.endsWith("/")&&(t=t.slice(0,-1));let i=`${t}`;if(t.startsWith("https://t.me")){const s=t.includes("?")?"&startapp=":"?startapp=";i=`${i}${s}${yHe(r,!0)}`}else i=`${i}/wc?${r}`;return i}function hHe(t){let e="_self";mHe()?e="_top":(pHe()||t.startsWith("https://")||t.startsWith("http://"))&&(e="_blank"),window.open(t,e,"noreferrer noopener")}async function fHe(t,e){let n="";try{if(mm()&&(n=localStorage.getItem(e),n))return n;n=await t.getItem(e)}catch(r){console.error(r)}return n}function PW(t,e){if(!t.includes(e))return null;const n=t.split(/([&,?,=])/),r=n.indexOf(e);return n[r+2]}function RW(){return typeof crypto<"u"&&crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function HO(){return typeof process<"u"&&WVe.IS_VITEST==="true"}function pHe(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)}function mHe(){try{return window.self!==window.top}catch{return!1}}function yHe(t,e=!1){const n=Buffer.from(t).toString("base64");return e?n.replace(/[=]/g,""):n}function Fse(t){return Buffer.from(t,"base64").toString("utf-8")}function gHe(t){return new Promise(e=>setTimeout(e,t))}let bHe=class{constructor({limit:e}){NW(this,"limit"),NW(this,"set"),this.limit=e,this.set=new Set}add(e){if(!this.set.has(e)){if(this.set.size>=this.limit){const n=this.set.values().next().value;n&&this.set.delete(n)}this.set.add(e)}}has(e){return this.set.has(e)}};const G4=BigInt(2**32-1),jW=BigInt(32);function zse(t,e=!1){return e?{h:Number(t&G4),l:Number(t>>jW&G4)}:{h:Number(t>>jW&G4)|0,l:Number(t&G4)|0}}function Vse(t,e=!1){const n=t.length;let r=new Uint32Array(n),i=new Uint32Array(n);for(let s=0;s<n;s++){const{h:a,l:o}=zse(t[s],e);[r[s],i[s]]=[a,o]}return[r,i]}const MW=(t,e,n)=>t>>>n,DW=(t,e,n)=>t<<32-n|e>>>n,Kd=(t,e,n)=>t>>>n|e<<32-n,Gd=(t,e,n)=>t<<32-n|e>>>n,mg=(t,e,n)=>t<<64-n|e>>>n-32,yg=(t,e,n)=>t>>>n-32|e<<64-n,wHe=(t,e)=>e,vHe=(t,e)=>t,_He=(t,e,n)=>t<<n|e>>>32-n,xHe=(t,e,n)=>e<<n|t>>>32-n,CHe=(t,e,n)=>e<<n-32|t>>>64-n,EHe=(t,e,n)=>t<<n-32|e>>>64-n;function sl(t,e,n,r){const i=(e>>>0)+(r>>>0);return{h:t+n+(i/2**32|0)|0,l:i|0}}const WO=(t,e,n)=>(t>>>0)+(e>>>0)+(n>>>0),qO=(t,e,n,r)=>e+n+r+(t/2**32|0)|0,SHe=(t,e,n,r)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0),AHe=(t,e,n,r,i)=>e+n+r+i+(t/2**32|0)|0,kHe=(t,e,n,r,i)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0)+(i>>>0),THe=(t,e,n,r,i,s)=>e+n+r+i+s+(t/2**32|0)|0,s0=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;function c9(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function Mu(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function Sl(t,...e){if(!c9(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function u9(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");Mu(t.outputLen),Mu(t.blockLen)}function P2(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function ZO(t,e){Sl(t);const n=e.outputLen;if(t.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function g6(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function Oo(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function wS(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function jl(t,e){return t<<32-e|t>>>e}const Hse=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Wse(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}const eu=Hse?t=>t:t=>Wse(t);function LHe(t){for(let e=0;e<t.length;e++)t[e]=Wse(t[e]);return t}const Yd=Hse?t=>t:LHe,qse=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",$He=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function K0(t){if(Sl(t),qse)return t.toHex();let e="";for(let n=0;n<t.length;n++)e+=$He[t[n]];return e}const Yc={_0:48,_9:57,A:65,F:70,a:97,f:102};function UW(t){if(t>=Yc._0&&t<=Yc._9)return t-Yc._0;if(t>=Yc.A&&t<=Yc.F)return t-(Yc.A-10);if(t>=Yc.a&&t<=Yc.f)return t-(Yc.a-10)}function mv(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);if(qse)return Uint8Array.fromHex(t);const e=t.length,n=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(n);for(let i=0,s=0;i<n;i++,s+=2){const a=UW(t.charCodeAt(s)),o=UW(t.charCodeAt(s+1));if(a===void 0||o===void 0){const l=t[s]+t[s+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+s)}r[i]=a*16+o}return r}function Zse(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function gl(t){return typeof t=="string"&&(t=Zse(t)),Sl(t),t}function r2(...t){let e=0;for(let r=0;r<t.length;r++){const i=t[r];Sl(i),e+=i.length}const n=new Uint8Array(e);for(let r=0,i=0;r<t.length;r++){const s=t[r];n.set(s,i),i+=s.length}return n}let d9=class{};function b5(t){const e=r=>t().update(gl(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function IHe(t){const e=(r,i)=>t(i).update(gl(r)).digest(),n=t({});return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=r=>t(r),e}function Yf(t=32){if(s0&&typeof s0.getRandomValues=="function")return s0.getRandomValues(new Uint8Array(t));if(s0&&typeof s0.randomBytes=="function")return Uint8Array.from(s0.randomBytes(t));throw new Error("crypto.getRandomValues must be defined")}const NHe=BigInt(0),Vy=BigInt(1),OHe=BigInt(2),PHe=BigInt(7),RHe=BigInt(256),jHe=BigInt(113),Kse=[],Gse=[],Yse=[];for(let t=0,e=Vy,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],Kse.push(2*(5*r+n)),Gse.push((t+1)*(t+2)/2%64);let i=NHe;for(let s=0;s<7;s++)e=(e<<Vy^(e>>PHe)*jHe)%RHe,e&OHe&&(i^=Vy<<(Vy<<BigInt(s))-Vy);Yse.push(i)}const Jse=Vse(Yse,!0),MHe=Jse[0],DHe=Jse[1],BW=(t,e,n)=>n>32?CHe(t,e,n):_He(t,e,n),FW=(t,e,n)=>n>32?EHe(t,e,n):xHe(t,e,n);function UHe(t,e=24){const n=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let a=0;a<10;a++)n[a]=t[a]^t[a+10]^t[a+20]^t[a+30]^t[a+40];for(let a=0;a<10;a+=2){const o=(a+8)%10,l=(a+2)%10,u=n[l],f=n[l+1],p=BW(u,f,1)^n[o],y=FW(u,f,1)^n[o+1];for(let g=0;g<50;g+=10)t[a+g]^=p,t[a+g+1]^=y}let i=t[2],s=t[3];for(let a=0;a<24;a++){const o=Gse[a],l=BW(i,s,o),u=FW(i,s,o),f=Kse[a];i=t[f],s=t[f+1],t[f]=l,t[f+1]=u}for(let a=0;a<50;a+=10){for(let o=0;o<10;o++)n[o]=t[a+o];for(let o=0;o<10;o++)t[a+o]^=~n[(o+2)%10]&n[(o+4)%10]}t[0]^=MHe[r],t[1]^=DHe[r]}Oo(n)}let BHe=class Xse extends d9{constructor(e,n,r,i=!1,s=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=n,this.outputLen=r,this.enableXOF=i,this.rounds=s,Mu(r),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=g6(this.state)}clone(){return this._cloneInto()}keccak(){Yd(this.state32),UHe(this.state32,this.rounds),Yd(this.state32),this.posOut=0,this.pos=0}update(e){P2(this),e=gl(e),Sl(e);const{blockLen:n,state:r}=this,i=e.length;for(let s=0;s<i;){const a=Math.min(n-this.pos,i-s);for(let o=0;o<a;o++)r[this.pos++]^=e[s++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:n,pos:r,blockLen:i}=this;e[r]^=n,(n&128)!==0&&r===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){P2(this,!1),Sl(e),this.finish();const n=this.state,{blockLen:r}=this;for(let i=0,s=e.length;i<s;){this.posOut>=r&&this.keccak();const a=Math.min(r-this.posOut,s-i);e.set(n.subarray(this.posOut,this.posOut+a),i),this.posOut+=a,i+=a}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Mu(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(ZO(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,Oo(this.state)}_cloneInto(e){const{blockLen:n,suffix:r,outputLen:i,rounds:s,enableXOF:a}=this;return e||(e=new Xse(n,r,i,a,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=r,e.outputLen=i,e.enableXOF=a,e.destroyed=this.destroyed,e}};const FHe=(t,e,n)=>b5(()=>new BHe(e,t,n)),zHe=FHe(1,136,256/8);function VHe(t,e,n,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,r);const i=BigInt(32),s=BigInt(4294967295),a=Number(n>>i&s),o=Number(n&s),l=r?4:0,u=r?0:4;t.setUint32(e+l,a,r),t.setUint32(e+u,o,r)}function HHe(t,e,n){return t&e^~t&n}function WHe(t,e,n){return t&e^t&n^e&n}let Qse=class extends d9{constructor(e,n,r,i){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=i,this.buffer=new Uint8Array(e),this.view=wS(this.buffer)}update(e){P2(this),e=gl(e),Sl(e);const{view:n,buffer:r,blockLen:i}=this,s=e.length;for(let a=0;a<s;){const o=Math.min(i-this.pos,s-a);if(o===i){const l=wS(e);for(;i<=s-a;a+=i)this.process(l,a);continue}r.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===i&&(this.process(n,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){P2(this),ZO(e,this),this.finished=!0;const{buffer:n,view:r,blockLen:i,isLE:s}=this;let{pos:a}=this;n[a++]=128,Oo(this.buffer.subarray(a)),this.padOffset>i-a&&(this.process(r,0),a=0);for(let p=a;p<i;p++)n[p]=0;VHe(r,i-8,BigInt(this.length*8),s),this.process(r,0);const o=wS(e),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=l/4,f=this.get();if(u>f.length)throw new Error("_sha2: outputLen bigger than state");for(let p=0;p<u;p++)o.setUint32(4*p,f[p],s)}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const r=e.slice(0,n);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:n,buffer:r,length:i,finished:s,destroyed:a,pos:o}=this;return e.destroyed=a,e.finished=s,e.length=i,e.pos=o,i%n&&e.buffer.set(r),e}clone(){return this._cloneInto()}};const Pd=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),gs=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),bs=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),qHe=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]),Rd=new Uint32Array(64);class ZHe extends Qse{constructor(e=32){super(64,e,8,!1),this.A=Pd[0]|0,this.B=Pd[1]|0,this.C=Pd[2]|0,this.D=Pd[3]|0,this.E=Pd[4]|0,this.F=Pd[5]|0,this.G=Pd[6]|0,this.H=Pd[7]|0}get(){const{A:e,B:n,C:r,D:i,E:s,F:a,G:o,H:l}=this;return[e,n,r,i,s,a,o,l]}set(e,n,r,i,s,a,o,l){this.A=e|0,this.B=n|0,this.C=r|0,this.D=i|0,this.E=s|0,this.F=a|0,this.G=o|0,this.H=l|0}process(e,n){for(let p=0;p<16;p++,n+=4)Rd[p]=e.getUint32(n,!1);for(let p=16;p<64;p++){const y=Rd[p-15],g=Rd[p-2],b=jl(y,7)^jl(y,18)^y>>>3,v=jl(g,17)^jl(g,19)^g>>>10;Rd[p]=v+Rd[p-7]+b+Rd[p-16]|0}let{A:r,B:i,C:s,D:a,E:o,F:l,G:u,H:f}=this;for(let p=0;p<64;p++){const y=jl(o,6)^jl(o,11)^jl(o,25),g=f+y+HHe(o,l,u)+qHe[p]+Rd[p]|0,b=(jl(r,2)^jl(r,13)^jl(r,22))+WHe(r,i,s)|0;f=u,u=l,l=o,o=a+g|0,a=s,s=i,i=r,r=g+b|0}r=r+this.A|0,i=i+this.B|0,s=s+this.C|0,a=a+this.D|0,o=o+this.E|0,l=l+this.F|0,u=u+this.G|0,f=f+this.H|0,this.set(r,i,s,a,o,l,u,f)}roundClean(){Oo(Rd)}destroy(){this.set(0,0,0,0,0,0,0,0),Oo(this.buffer)}}const eae=Vse(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e3585
5465771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),KHe=eae[0],GHe=eae[1],jd=new Uint32Array(80),Md=new Uint32Array(80);let KO=class extends Qse{constructor(e=64){super(128,e,16,!1),this.Ah=bs[0]|0,this.Al=bs[1]|0,this.Bh=bs[2]|0,this.Bl=bs[3]|0,this.Ch=bs[4]|0,this.Cl=bs[5]|0,this.Dh=bs[6]|0,this.Dl=bs[7]|0,this.Eh=bs[8]|0,this.El=bs[9]|0,this.Fh=bs[10]|0,this.Fl=bs[11]|0,this.Gh=bs[12]|0,this.Gl=bs[13]|0,this.Hh=bs[14]|0,this.Hl=bs[15]|0}
vendor: 4,158 bytes, line 546
546get(){const{Ah:e,Al:n,Bh:r,Bl:i,Ch:s,Cl:a,Dh:o,Dl:l,Eh:u,El:f,Fh:p,Fl:y,Gh:g,Gl:b,Hh:v,Hl:_}=this;return[e,n,r,i,s,a,o,l,u,f,p,y,g,b,v,_]}set(e,n,r,i,s,a,o,l,u,f,p,y,g,b,v,_){this.Ah=e|0,this.Al=n|0,this.Bh=r|0,this.Bl=i|0,this.Ch=s|0,this.Cl=a|0,this.Dh=o|0,this.Dl=l|0,this.Eh=u|0,this.El=f|0,this.Fh=p|0,this.Fl=y|0,this.Gh=g|0,this.Gl=b|0,this.Hh=v|0,this.Hl=_|0}process(e,n){for(let x=0;x<16;x++,n+=4)jd[x]=e.getUint32(n),Md[x]=e.getUint32(n+=4);for(let x=16;x<80;x++){const A=jd[x-15]|0,I=Md[x-15]|0,$=Kd(A,I,1)^Kd(A,I,8)^MW(A,I,7),O=Gd(A,I,1)^Gd(A,I,8)^DW(A,I,7),P=jd[x-2]|0,j=Md[x-2]|0,U=Kd(P,j,19)^mg(P,j,61)^MW(P,j,6),z=Gd(P,j,19)^yg(P,j,61)^DW(P,j,6),D=SHe(O,z,Md[x-7],Md[x-16]),R=AHe(D,$,U,jd[x-7],jd[x-16]);jd[x]=R|0,Md[x]=D|0}let{Ah:r,Al:i,Bh:s,Bl:a,Ch:o,Cl:l,Dh:u,Dl:f,Eh:p,El:y,Fh:g,Fl:b,Gh:v,Gl:_,Hh:C,Hl:S}=this;for(let x=0;x<80;x++){const A=Kd(p,y,14)^Kd(p,y,18)^mg(p,y,41),I=Gd(p,y,14)^Gd(p,y,18)^yg(p,y,41),$=p&g^~p&v,O=y&b^~y&_,P=kHe(S,I,O,GHe[x],Md[x]),j=THe(P,C,A,$,KHe[x],jd[x]),U=P|0,z=Kd(r,i,28)^mg(r,i,34)^mg(r,i,39),D=Gd(r,i,28)^yg(r,i,34)^yg(r,i,39),R=r&s^r&o^s&o,W=i&a^i&l^a&l;C=v|0,S=_|0,v=g|0,_=b|0,g=p|0,b=y|0,{h:p,l:y}=sl(u|0,f|0,j|0,U|0),u=o|0,f=l|0,o=s|0,l=a|0,s=r|0,a=i|0;const T=WO(U,D,W);r=qO(T,j,z,R),i=T|0}({h:r,l:i}=sl(this.Ah|0,this.Al|0,r|0,i|0)),{h:s,l:a}=sl(this.Bh|0,this.Bl|0,s|0,a|0),{h:o,l}=sl(this.Ch|0,this.Cl|0,o|0,l|0),{h:u,l:f}=sl(this.Dh|0,this.Dl|0,u|0,f|0),{h:p,l:y}=sl(this.Eh|0,this.El|0,p|0,y|0),{h:g,l:b}=sl(this.Fh|0,this.Fl|0,g|0,b|0),{h:v,l:_}=sl(this.Gh|0,this.Gl|0,v|0,_|0),{h:C,l:S}=sl(this.Hh|0,this.Hl|0,C|0,S|0),this.set(r,i,s,a,o,l,u,f,p,y,g,b,v,_,C,S)}roundClean(){Oo(jd,Md)}destroy(){Oo(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};class YHe extends KO{constructor(){super(48),this.Ah=gs[0]|0,this.Al=gs[1]|0,this.Bh=gs[2]|0,this.Bl=gs[3]|0,this.Ch=gs[4]|0,this.Cl=gs[5]|0,this.Dh=gs[6]|0,this.Dl=gs[7]|0,this.Eh=gs[8]|0,this.El=gs[9]|0,this.Fh=gs[10]|0,this.Fl=gs[11]|0,this.Gh=gs[12]|0,this.Gl=gs[13]|0,this.Hh=gs[14]|0,this.Hl=gs[15]|0}}const ws=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);class JHe extends KO{constructor(){super(32),this.Ah=ws[0]|0,this.Al=ws[1]|0,this.Bh=ws[2]|0,this.Bl=ws[3]|0,this.Ch=ws[4]|0,this.Cl=ws[5]|0,this.Dh=ws[6]|0,this.Dl=ws[7]|0,this.Eh=ws[8]|0,this.El=ws[9]|0,this.Fh=ws[10]|0,this.Fl=ws[11]|0,this.Gh=ws[12]|0,this.Gl=ws[13]|0,this.Hh=ws[14]|0,this.Hl=ws[15]|0}}const h9=b5(()=>new ZHe),XHe=b5(()=>new KO),QHe=b5(()=>new YHe),eWe=b5(()=>new JHe),tWe=Uint8Array.from([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9]),Si=Uint32Array.from([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),Je=new Uint32Array(32);function Dd(t,e,n,r,i,s){const a=i[s],o=i[s+1];let l=Je[2*t],u=Je[2*t+1],f=Je[2*e],p=Je[2*e+1],y=Je[2*n],g=Je[2*n+1],b=Je[2*r],v=Je[2*r+1],_=WO(l,f,a);u=qO(_,u,p,o),l=_|0,{Dh:v,Dl:b}={Dh:v^u,Dl:b^l},{Dh:v,Dl:b}={Dh:wHe(v,b),Dl:vHe(v)},{h:g,l:y}=sl(g,y,v,b),{Bh:p,Bl:f}={Bh:p^g,Bl:f^y},{Bh:p,Bl:f}={Bh:Kd(p,f,24),Bl:Gd(p,f,24)},Je[2*t]=l,Je[2*t+1]=u,Je[2*e]=f,Je[2*e+1]=p,Je[2*n]=y,Je[2*n+1]=g,Je[2*r]=b,Je[2*r+1]=v}function Ud(t,e,n,r,i,s){const a=i[s],o=i[s+1];let l=Je[2*t],u=Je[2*t+1],f=Je[2*e],p=Je[2*e+1],y=Je[2*n],g=Je[2*n+1],b=Je[2*r],v=Je[2*r+1],_=WO(l,f,a);u=qO(_,u,p,o),l=_|0,{Dh:v,Dl:b}={Dh:v^u,Dl:b^l},{Dh:v,Dl:b}={Dh:Kd(v,b,16),Dl:Gd(v,b,16)},{h:g,l:y}=sl(g,y,v,b),{Bh:p,Bl:f}
vendor: 43,514 bytes, lines 546-549
546={Bh:p^g,Bl:f^y},{Bh:p,Bl:f}={Bh:mg(p,f,63),Bl:yg(p,f,63)},Je[2*t]=l,Je[2*t+1]=u,Je[2*e]=f,Je[2*e+1]=p,Je[2*n]=y,Je[2*n+1]=g,Je[2*r]=b,Je[2*r+1]=v}function nWe(t,e={},n,r,i){if(Mu(n),t<0||t>n)throw new Error("outputLen bigger than keyLen");const{key:s,salt:a,personalization:o}=e;if(s!==void 0&&(s.length<1||s.length>n))throw new Error("key length must be undefined or 1.."+n);if(a!==void 0&&a.length!==r)throw new Error("salt must be undefined or "+r);if(o!==void 0&&o.length!==i)throw new Error("personalization must be undefined or "+i)}class rWe extends d9{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,this.length=0,this.pos=0,Mu(e),Mu(n),this.blockLen=e,this.outputLen=n,this.buffer=new Uint8Array(e),this.buffer32=g6(this.buffer)}update(e){P2(this),e=gl(e),Sl(e);const{blockLen:n,buffer:r,buffer32:i}=this,s=e.length,a=e.byteOffset,o=e.buffer;for(let l=0;l<s;){this.pos===n&&(Yd(i),this.compress(i,0,!1),Yd(i),this.pos=0);const u=Math.min(n-this.pos,s-l),f=a+l;if(u===n&&!(f%4)&&l+u<s){const p=new Uint32Array(o,f,Math.floor((s-l)/4));Yd(p);for(let y=0;l+n<s;y+=i.length,l+=n)this.length+=n,this.compress(p,y,!1);Yd(p);continue}r.set(e.subarray(l,l+u),this.pos),this.pos+=u,this.length+=u,l+=u}return this}digestInto(e){P2(this),ZO(e,this);const{pos:n,buffer32:r}=this;this.finished=!0,Oo(this.buffer.subarray(n)),Yd(r),this.compress(r,0,!0),Yd(r);const i=g6(e);this.get().forEach((s,a)=>i[a]=eu(s))}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const r=e.slice(0,n);return this.destroy(),r}_cloneInto(e){const{buffer:n,length:r,finished:i,destroyed:s,outputLen:a,pos:o}=this;return e||(e=new this.constructor({dkLen:a})),e.set(...this.get()),e.buffer.set(n),e.destroyed=s,e.finished=i,e.length=r,e.pos=o,e.outputLen=a,e}clone(){return this._cloneInto()}}class iWe extends rWe{constructor(e={}){const n=e.dkLen===void 0?64:e.dkLen;super(128,n),this.v0l=Si[0]|0,this.v0h=Si[1]|0,this.v1l=Si[2]|0,this.v1h=Si[3]|0,this.v2l=Si[4]|0,this.v2h=Si[5]|0,this.v3l=Si[6]|0,this.v3h=Si[7]|0,this.v4l=Si[8]|0,this.v4h=Si[9]|0,this.v5l=Si[10]|0,this.v5h=Si[11]|0,this.v6l=Si[12]|0,this.v6h=Si[13]|0,this.v7l=Si[14]|0,this.v7h=Si[15]|0,nWe(n,e,64,16,16);let{key:r,personalization:i,salt:s}=e,a=0;if(r!==void 0&&(r=gl(r),a=r.length),this.v0l^=this.outputLen|a<<8|65536|1<<24,s!==void 0){s=gl(s);const o=g6(s);this.v4l^=eu(o[0]),this.v4h^=eu(o[1]),this.v5l^=eu(o[2]),this.v5h^=eu(o[3])}if(i!==void 0){i=gl(i);const o=g6(i);this.v6l^=eu(o[0]),this.v6h^=eu(o[1]),this.v7l^=eu(o[2]),this.v7h^=eu(o[3])}if(r!==void 0){const o=new Uint8Array(this.blockLen);o.set(r),this.update(o)}}get(){let{v0l:e,v0h:n,v1l:r,v1h:i,v2l:s,v2h:a,v3l:o,v3h:l,v4l:u,v4h:f,v5l:p,v5h:y,v6l:g,v6h:b,v7l:v,v7h:_}=this;return[e,n,r,i,s,a,o,l,u,f,p,y,g,b,v,_]}set(e,n,r,i,s,a,o,l,u,f,p,y,g,b,v,_){this.v0l=e|0,this.v0h=n|0,this.v1l=r|0,this.v1h=i|0,this.v2l=s|0,this.v2h=a|0,this.v3l=o|0,this.v3h=l|0,this.v4l=u|0,this.v4h=f|0,this.v5l=p|0,this.v5h=y|0,this.v6l=g|0,this.v6h=b|0,this.v7l=v|0,this.v7h=_|0}compress(e,n,r){this.get().forEach((l,u)=>Je[u]=l),Je.set(Si,16);let{h:i,l:s}=zse(BigInt(this.length));Je[24]=Si[8]^s,Je[25]=Si[9]^i,r&&(Je[28]=~Je[28],Je[29]=~Je[29]);let a=0;const o=tWe;for(let l=0;l<12;l++)Dd(0,4,8,12,e,n+2*o[a++]),Ud(0,4,8,12,e,n+2*o[a++]),Dd(1,5,9,13,e,n+2*o[a++]),Ud(1,5,9,13,e,n+2*o[a++]),Dd(2,6,10,14,e,n+2*o[a++]),Ud(2,6,10,14,e,n+2*o[a++]),Dd(3,7,11,15,e,n+2*o[a++]),Ud(3,7,11,15,e,n+2*o[a++]),Dd(0,5,10,15,e,n+2*o[a++]),Ud(0,5,10,15,e,n+2*o[a++]),Dd(1,6,11,12,e,n+2*o[a++]),Ud(1,6,11,12,e,n+2*o[a++]),Dd(2,7,8,13,e,n+2*o[a++]),Ud(2,7,8,13,e,n+2*o[a++]),Dd(3,4,9,14,e,n+2*o[a++]),Ud(3,4,9,14,e,n+2*o[a++]);this.v0l^=Je[0]^Je[16],this.v0h^=Je[1]^Je[17],this.v1l^=Je[2]^Je[18],this.v1h^=Je[3]^Je[19],this.v2l^=Je[4]^Je[20],this.v2h^=Je[5]^Je[21],this.v3l^=Je[6]^Je[22],this.v3h^=Je[7]^Je[23],this.v4l^=Je[8]^Je[24],this.v4h^=Je[9]^Je[25],this.v5l^=Je[10]^Je[26],this.v5h^=Je[11]^Je[27],this.v6l^=Je[12]^Je[28],this.v6h^=Je[13]^Je[29],this.v7l^=Je[14]^Je[30],this.v7h^=Je[15]^Je[31],Oo(Je)}destroy(){this.destroyed=!0,Oo(this.buffer32),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const sWe=IHe(t=>new iWe(t)),aWe="https://rpc.walletconnect.org/v1";function tae(t){const e=`�Ethereum Signed Message: 547${t.length}`,n=new TextEncoder().encode(e+t);return"0x"+Buffer.from(zHe(n)).toString("hex")}async function oWe(t,e,n,r,i,s){switch(n.t){case"eip191":return await lWe(t,e,n.s);case"eip1271":return await cWe(t,e,n.s,r,i,s);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${n.t}`)}}function lWe(t,e,n){const r=RDe(n);return BDe({payload:tae(e),signature:r}).toLowerCase()===t.toLowerCase()}async function cWe(t,e,n,r,i,s){const a=Su(r);if(!a.namespace||!a.reference)throw new Error(`isValidEip1271Signature failed: chainId must be in CAIP-2 format, received: ${r}`);try{const o="0x1626ba7e",l="0000000000000000000000000000000000000000000000000000000000000040",u=n.substring(2),f=(u.length/2).toString(16).padStart(64,"0"),p=(e.startsWith("0x")?e:tae(e)).substring(2),y=o+p+l+f+u,g=await fetch(`${s||aWe}/?chainId=${r}&projectId=${i}`,{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify({id:uWe(),jsonrpc:"2.0",method:"eth_call",params:[{to:t,data:y},"latest"]})}),{result:b}=await g.json();return b?b.slice(0,o.length).toLowerCase()===o.toLowerCase():!1}catch(o){return console.error("isValidEip1271Signature: ",o),!1}}function uWe(){return Date.now()+Math.floor(Math.random()*1e3)}function dWe(t){const e=atob(t),n=new Uint8Array(e.length);for(let a=0;a<e.length;a++)n[a]=e.charCodeAt(a);const r=n[0];if(r===0)throw new Error("No signatures found");const i=1+r*64;if(n.length<i)throw new Error("Transaction data too short for claimed signature count");if(n.length<100)throw new Error("Transaction too short");const s=Buffer.from(t,"base64").slice(1,65);return p5.encode(s)}function hWe(t){const e=new Uint8Array(Buffer.from(t,"base64")),n=Array.from("TransactionData::").map(s=>s.charCodeAt(0)),r=new Uint8Array(n.length+e.length);r.set(n),r.set(e,n.length);const i=sWe(r,{dkLen:32});return p5.encode(i)}function zW(t){const e=new Uint8Array(h9(fWe(t)));return p5.encode(e)}function fWe(t){if(t instanceof Uint8Array)return t;if(Array.isArray(t))return new Uint8Array(t);if(typeof t=="object"&&t!=null&&t.data)return new Uint8Array(Object.values(t.data));if(typeof t=="object"&&t)return new Uint8Array(Object.values(t));throw new Error("getNearUint8ArrayFromBytes: Unexpected result type from bytes array")}function VW(t){const e=Buffer.from(t,"base64"),n=SUe(e).txn;if(!n)throw new Error("Invalid signed transaction: missing 'txn' field");const r=yUe(n),i=Buffer.from("TX"),s=Buffer.concat([i,Buffer.from(r)]),a=eWe(s);return aCe.encode(a).replace(/=+$/,"")}function vS(t){const e=[];let n=BigInt(t);for(;n>=BigInt(128);)e.push(Number(n&BigInt(127)|BigInt(128))),n>>=BigInt(7);return e.push(Number(n)),Buffer.from(e)}function pWe(t){const e=Buffer.from(t.signed.bodyBytes,"base64"),n=Buffer.from(t.signed.authInfoBytes,"base64"),r=Buffer.from(t.signature.signature,"base64"),i=[];i.push(Buffer.from([10])),i.push(vS(e.length)),i.push(e),i.push(Buffer.from([18])),i.push(vS(n.length)),i.push(n),i.push(Buffer.from([26])),i.push(vS(r.length)),i.push(r);const s=Buffer.concat(i),a=h9(s);return Buffer.from(a).toString("hex").toUpperCase()}function mWe(t){var e,n;const r=[];try{if(typeof t=="string")return r.push(t),r;if(typeof t!="object")return r;t!=null&&t.id&&r.push(t.id);const i=(n=(e=t==null?void 0:t.capabilities)==null?void 0:e.caip345)==null?void 0:n.transactionHashes;i&&r.push(...i)}catch(i){console.warn("getWalletSendCallsHashes failed: ",i)}return r}var yWe=Object.defineProperty,gWe=Object.defineProperties,bWe=Object.getOwnPropertyDescriptors,HW=Object.getOwnPropertySymbols,wWe=Object.prototype.hasOwnProperty,vWe=Object.prototype.propertyIsEnumerable,WW=(t,e,n)=>e in t?yWe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,_We=(t,e)=>{for(var n in e||(e={}))wWe.call(e,n)&&WW(t,n,e[n]);if(HW)for(var n of HW(e))vWe.call(e,n)&&WW(t,n,e[n]);return t},xWe=(t,e)=>gWe(t,bWe(e));const CWe="did:pkh:",GO=t=>t==null?void 0:t.split(":"),EWe=t=>{const e=t&&GO(t);if(e)return t.includes(CWe)?e[3]:e[1]},TL=t=>{const e=t&&GO(t);if(e)return e[2]+":"+e[3]},yv=t=>{const e=t&&GO(t);if(e)return e.pop()};async function qW(t){const{cacao:e,projectId:n}=t,{s:r,p:i}=e,s=nae(i,i.iss),a=yv(i.iss);return await oWe(a,s,r,TL(i.iss),n)}const nae=(t,e)=>{const n=`${t.domain} wants you to sign in with your Ethereum account:`,r=yv(e);if(!t.aud&&!t.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let i=t.statement||void 0;const s=`URI: ${t.aud||t.uri}`,a=`Version: ${t.version}`,o=`Chain ID: ${EWe(e)}`,l=`Nonce: ${t.nonce}`,u=`Issued At: ${t.iat}`,f=t.exp?`Expiration Time: ${t.exp}`:void 0,p=t.nbf?`Not Before: ${t.nbf}`:void 0,y=t.requestId?`Request ID: ${t.requestId}`:void 0,g=t.resources?`Resources:${t.resources.map(v=>` 548- ${v}`).join("")}`:void 0,b=Bw(t.resources);if(b){const v=b6(b);i=OWe(i,v)}return[n,r,"",i,"",s,a,o,l,u,f,p,y,g].filter(v=>v!=null).join(` 549`)};function SWe(t){return Buffer.from(JSON.stringify(t)).toString("base64")}function AWe(t){return JSON.parse(Buffer.from(t,"base64").toString("utf-8"))}function $f(t){if(!t)throw new Error("No recap provided, value is undefined");if(!t.att)throw new Error("No `att` property found");const e=Object.keys(t.att);if(!(e!=null&&e.length))throw new Error("No resources found in `att` property");e.forEach(n=>{const r=t.att[n];if(Array.isArray(r))throw new Error(`Resource must be an object: ${n}`);if(typeof r!="object")throw new Error(`Resource must be an object: ${n}`);if(!Object.keys(r).length)throw new Error(`Resource object is empty: ${n}`);Object.keys(r).forEach(i=>{const s=r[i];if(!Array.isArray(s))throw new Error(`Ability limits ${i} must be an array of objects, found: ${s}`);if(!s.length)throw new Error(`Value of ${i} is empty array, must be an array with objects`);s.forEach(a=>{if(typeof a!="object")throw new Error(`Ability limits (${i}) must be an array of objects, found: ${a}`)})})})}function kWe(t,e,n,r={}){return n==null||n.sort((i,s)=>i.localeCompare(s)),{att:{[t]:TWe(e,n,r)}}}function TWe(t,e,n={}){e=e==null?void 0:e.sort((i,s)=>i.localeCompare(s));const r=e.map(i=>({[`${t}/${i}`]:[n]}));return Object.assign({},...r)}function rae(t){return $f(t),`urn:recap:${SWe(t).replace(/=/g,"")}`}function b6(t){const e=AWe(t.replace("urn:recap:",""));return $f(e),e}function LWe(t,e,n){const r=kWe(t,e,n);return rae(r)}function $We(t){return t&&t.includes("urn:recap:")}function IWe(t,e){const n=b6(t),r=b6(e),i=NWe(n,r);return rae(i)}function NWe(t,e){$f(t),$f(e);const n=Object.keys(t.att).concat(Object.keys(e.att)).sort((i,s)=>i.localeCompare(s)),r={att:{}};return n.forEach(i=>{var s,a;Object.keys(((s=t.att)==null?void 0:s[i])||{}).concat(Object.keys(((a=e.att)==null?void 0:a[i])||{})).sort((o,l)=>o.localeCompare(l)).forEach(o=>{var l,u;r.att[i]=xWe(_We({},r.att[i]),{[o]:((l=t.att[i])==null?void 0:l[o])||((u=e.att[i])==null?void 0:u[o])})})}),r}function OWe(t="",e){$f(e);const n="I further authorize the stated URI to perform the following actions on my behalf: ";if(t.includes(n))return t;const r=[];let i=0;Object.keys(e.att).forEach(o=>{const l=Object.keys(e.att[o]).map(p=>({ability:p.split("/")[0],action:p.split("/")[1]}));l.sort((p,y)=>p.action.localeCompare(y.action));const u={};l.forEach(p=>{u[p.ability]||(u[p.ability]=[]),u[p.ability].push(p.action)});const f=Object.keys(u).map(p=>(i++,`(${i}) '${p}': '${u[p].join("', '")}' for '${o}'.`));r.push(f.join(", ").replace(".,","."))});const s=r.join(" "),a=`${n}${s}`;return`${t?t+" ":""}${a}`}function ZW(t){var e;const n=b6(t);$f(n);const r=(e=n.att)==null?void 0:e.eip155;return r?Object.keys(r).map(i=>i.split("/")[1]):[]}function KW(t){const e=b6(t);$f(e);const n=[];return Object.values(e.att).forEach(r=>{Object.values(r).forEach(i=>{var s;(s=i==null?void 0:i[0])!=null&&s.chains&&n.push(i[0].chains)})}),[...new Set(n.flat())]}function Bw(t){if(!t)return;const e=t==null?void 0:t[t.length-1];return $We(e)?e:void 0}/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */function iae(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function LL(t){if(typeof t!="boolean")throw new Error(`boolean expected, not ${t}`)}function _S(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function ea(t,...e){if(!iae(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function GW(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function PWe(t,e){ea(t);const n=e.outputLen;if(t.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function _2(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function T1(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function RWe(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}const jWe=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function MWe(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function $L(t){if(typeof t=="string")t=MWe(t);else if(iae(t))t=IL(t);else throw new Error("Uint8Array expected, got "+typeof t);return t}function DWe(t,e){if(e==null||typeof e!="object")throw new Error("options must be defined");return Object.assign(t,e)}function UWe(t,e){if(t.length!==e.length)return!1;let n=0;for(let r=0;r<t.length;r++)n|=t[r]^e[r];return n===0}const BWe=(t,e)=>{function n(r,...i){if(ea(r),!jWe)throw new Error("Non little-endian hardware is not yet supported");if(t.nonceLength!==void 0){const u=i[0];if(!u)throw new Error("nonce / iv required");t.varSizeNonce?ea(u):ea(u,t.nonceLength)}const s=t.tagLength;s&&i[1]!==void 0&&ea(i[1]);const a=e(r,...i),o=(u,f)=>{if(f!==void 0){if(u!==2)throw new Error("cipher output not supported");ea(f)}};let l=!1;return{encrypt(u,f){if(l)throw new Error("cannot encrypt() twice with same key + nonce");return l=!0,ea(u),o(a.encrypt.length,f),a.encrypt(u,f)},decrypt(u,f){if(ea(u),s&&u.length<s)throw new Error("invalid ciphertext length: smaller than tagLength="+s);return o(a.decrypt.length,f),a.decrypt(u,f)}}}return Object.assign(n,t),n};function YW(t,e,n=!0){if(e===void 0)return new Uint8Array(t);if(e.length!==t)throw new Error("invalid output length, expected "+t+", got: "+e.length);if(n&&!zWe(e))throw new Error("invalid output, must be aligned");return e}function JW(t,e,n,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,r);const i=BigInt(32),s=BigInt(4294967295),a=Number(n>>i&s),o=Number(n&s);t.setUint32(e+4,a,r),t.setUint32(e+0,o,r)}function FWe(t,e,n){LL(n);const r=new Uint8Array(16),i=RWe(r);return JW(i,0,BigInt(e),n),JW(i,8,BigInt(t),n),r}function zWe(t){return t.byteOffset%4===0}function IL(t){return Uint8Array.from(t)}const sae=t=>Uint8Array.from(t.split("").map(e=>e.charCodeAt(0))),VWe=sae("expand 16-byte k"),HWe=sae("expand 32-byte k"),WWe=_2(VWe),qWe=_2(HWe);function kn(t,e){return t<<e|t>>>32-e}function NL(t){return t.byteOffset%4===0}const Y4=64,ZWe=16,aae=2**32-1,XW=new Uint32Array;function KWe(t,e,n,r,i,s,a,o){const l=i.length,u=new Uint8Array(Y4),f=_2(u),p=NL(i)&&NL(s),y=p?_2(i):XW,g=p?_2(s):XW;for(let b=0;b<l;a++){if(t(e,n,r,f,a,o),a>=aae)throw new Error("arx: counter overflow");const v=Math.min(Y4,l-b);if(p&&v===Y4){const _=b/4;if(b%4!==0)throw new Error("arx: invalid block position");for(let C=0,S;C<ZWe;C++)S=_+C,g[S]=y[S]^f[C];b+=Y4;continue}for(let _=0,C;_<v;_++)C=b+_,s[C]=i[C]^u[_];b+=v}}function GWe(t,e){const{allowShortKeys:n,extendNonceFn:r,counterLength:i,counterRight:s,rounds:a}=DWe({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},e);if(typeof t!="function")throw new Error("core must be a function");return _S(i),_S(a),LL(s),LL(n),(o,l,u,f,p=0)=>{ea(o),ea(l),ea(u);const y=u.length;if(f===void 0&&(f=new Uint8Array(y)),ea(f),_S(p),p<0||p>=aae)throw new Error("arx: counter overflow");if(f.length<y)throw new Error(`arx: output (${f.length}) is shorter than data (${y})`);const g=[];let b=o.length,v,_;if(b===32)g.push(v=IL(o)),_=qWe;else if(b===16&&n)v=new Uint8Array(32),v.set(o),v.set(o,16),_=WWe,g.push(v);else throw new Error(`arx: invalid 32-byte key, got length=${b}`);NL(l)||g.push(l=IL(l));const C=_2(v);if(r){if(l.length!==24)throw new Error("arx: extended nonce must be 24 bytes");r(_,C,_2(l.subarray(0,16)),C),l=l.subarray(16)}const S=16-i;if(S!==l.length)throw new Error(`arx: nonce must be ${S} or 16 bytes`);if(S!==12){const A=new Uint8Array(12);A.set(l,s?0:12-l.length),l=A,g.push(l)}const x=_2(l);return KWe(t,_,C,x,u,f,p,a),T1(...g),f}}const rs=(t,e)=>t[e++]&255|(t[e++]&255)<<8;class YWe{constructor(e){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,e=$L(e),ea(e,32);const n=rs(e,0),r=rs(e,2),i=rs(e,4),s=rs(e,6),a=rs(e,8),o=rs(e,10),l=rs(e,12),u=rs(e,14);this.r[0]=n&8191,this.r[1]=(n>>>13|r<<3)&8191,this.r[2]=(r>>>10|i<<6)&7939,this.r[3]=(i>>>7|s<<9)&8191,this.r[4]=(s>>>4|a<<12)&255,this.r[5]=a>>>1&8190,this.r[6]=(a>>>14|o<<2)&8191,this.r[7]=(o>>>11|l<<5)&8065,this.r[8]=(l>>>8|u<<8)&8191,this.r[9]=u>>>5&127;for(let f=0;f<8;f++)this.pad[f]=rs(e,16+2*f)}process(e,n,r=!1){const i=r?0:2048,{h:s,r:a}=this,o=a[0],l=a[1],u=a[2],f=a[3],p=a[4],y=a[5],g=a[6],b=a[7],v=a[8],_=a[9],C=rs(e,n+0),S=rs(e,n+2),x=rs(e,n+4),A=rs(e,n+6),I=rs(e,n+8),$=rs(e,n+10),O=rs(e,n+12),P=rs(e,n+14);let j=s[0]+(C&8191),U=s[1]+((C>>>13|S<<3)&8191),z=s[2]+((S>>>10|x<<6)&8191),D=s[3]+((x>>>7|A<<9)&8191),R=s[4]+((A>>>4|I<<12)&8191),W=s[5]+(I>>>1&8191),T=s[6]+((I>>>14|$<<2)&8191),L=s[7]+(($>>>11|O<<5)&8191),M=s[8]+((O>>>8|P<<8)&8191),Z=s[9]+(P>>>5|i),H=0,V=H+j*o+U*(5*_)+z*(5*v)+D*(5*b)+R*(5*g);H=V>>>13,V&=8191,V+=W*(5*y)+T*(5*p)+L*(5*f)+M*(5*u)+Z*(5*l),H+=V>>>13,V&=8191;let F=H+j*l+U*o+z*(5*_)+D*(5*v)+R*(5*b);H=F>>>13,F&=8191,F+=W*(5*g)+T*(5*y)+L*(5*p)+M*(5*f)+Z*(5*u),H+=F>>>13,F&=8191;let q=H+j*u+U*l+z*o+D*(5*_)+R*(5*v);H=q>>>13,q&=8191,q+=W*(5*b)+T*(5*g)+L*(5*y)+M*(5*p)+Z*(5*f),H+=q>>>13,q&=8191;let G=H+j*f+U*u+z*l+D*o+R*(5*_);H=G>>>13,G&=8191,G+=W*(5*v)+T*(5*b)+L*(5*g)+M*(5*y)+Z*(5*p),H+=G>>>13,G&=8191;let Y=H+j*p+U*f+z*u+D*l+R*o;H=Y>>>13,Y&=8191,Y+=W*(5*_)+T*(5*v)+L*(5*b)+M*(5*g)+Z*(5*y),H+=Y>>>13,Y&=8191;let X=H+j*y+U*p+z*f+D*u+R*l;H=X>>>13,X&=8191,X+=W*o+T*(5*_)+L*(5*v)+M*(5*b)+Z*(5*g),H+=X>>>13,X&=8191;let te=H+j*g+U*y+z*p+D*f+R*u;H=te>>>13,te&=8191,te+=W*l+T*o+L*(5*_)+M*(5*v)+Z*(5*b),H+=te>>>13,te&=8191;let ie=H+j*b+U*g+z*y+D*p+R*f;H=ie>>>13,ie&=8191,ie+=W*u+T*l+L*o+M*(5*_)+Z*(5*v),H+=ie>>>13,ie&=8191;let se=H+j*v+U*b+z*g+D*y+R*p;H=se>>>13,se&=8191,se+=W*f+T*u+L*l+M*o+Z*(5*_),H+=se>>>13,se&=8191;let pe=H+j*_+U*v+z*b+D*g+R*y;H=pe>>>13,pe&=8191,pe+=W*p+T*f+L*u+M*l+Z*o,H+=pe>>>13,pe&=8191,H=(H<<2)+H|0,H=H+V|0,V=H&8191,H=H>>>13,F+=H,s[0]=V,s[1]=F,s[2]=q,s[3]=G,s[4]=Y,s[5]=X,s[6]=te,s[7]=ie,s[8]=se,s[9]=pe}finalize(){const{h:e,pad:n}=this,r=new Uint16Array(10);let i=e[1]>>>13;e[1]&=8191;for(let o=2;o<10;o++)e[o]+=i,i=e[o]>>>13,e[o]&=8191;e[0]+=i*5,i=e[0]>>>13,e[0]&=8191,e[1]+=i,i=e[1]>>>13,e[1]&=8191,e[2]+=i,r[0]=e[0]+5,i=r[0]>>>13,r[0]&=8191;for(let o=1;o<10;o++)r[o]=e[o]+i,i=r[o]>>>13,r[o]&=8191;r[9]-=8192;let s=(i^1)-1;for(let o=0;o<10;o++)r[o]&=s;s=~s;for(let o=0;o<10;o++)e[o]=e[o]&s|r[o];e[0]=(e[0]|e[1]<<13)&65535,e[1]=(e[1]>>>3|e[2]<<10)&65535,e[2]=(e[2]>>>6|e[3]<<7)&65535,e[3]=(e[3]>>>9|e[4]<<4)&65535,e[4]=(e[4]>>>12|e[5]<<1|e[6]<<14)&65535,e[5]=(e[6]>>>2|e[7]<<11)&65535,e[6]=(e[7]>>>5|e[8]<<8)&65535,e[7]=(e[8]>>>8|e[9]<<5)&65535;let a=e[0]+n[0];e[0]=a&65535;for(let o=1;o<8;o++)a=(e[o]+n[o]|0)+(a>>>16)|0,e[o]=a&65535;T1(r)}update(e){GW(this),e=$L(e),ea(e);const{buffer:n,blockLen:r}=this,i=e.length;for(let s=0;s<i;){const a=Math.min(r-this.pos,i-s);if(a===r){for(;r<=i-s;s+=r)this.process(e,s);continue}n.set(e.subarray(s,s+a),this.pos),this.pos+=a,s+=a,this.pos===r&&(this.process(n,0,!1),this.pos=0)}return this}destroy(){T1(this.h,this.r,this.buffer,this.pad)}digestInto(e){GW(this),PWe(e,this),this.finished=!0;const{buffer:n,h:r}=this;let{pos:i}=this;if(i){for(n[i++]=1;i<16;i++)n[i]=0;this.process(n,0,!0)}this.finalize();let s=0;for(let a=0;a<8;a++)e[s++]=r[a]>>>0,e[s++]=r[a]>>>8;return e}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const r=e.slice(0,n);return this.destroy(),r}}function JWe(t){const e=(r,i)=>t(i).update($L(r)).digest(),n=t(new Uint8Array(32));return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=r=>t(r),e}const XWe=JWe(t=>new YWe(t));function QWe(t,e,n,r,i,s=20){let a=t[0],o=t[1],l=t[2],u=t[3],f=e[0],p=e[1],y=e[2],g=e[3],b=e[4],v=e[5],_=e[6],C=e[7],S=i,x=n[0],A=n[1],I=n[2],$=a,O=o,P=l,j=u,U=f,z=p,D=y,R=g,W=b,T=v,L=_,M=C,Z=S,H=x,V=A,F=I;for(let G=0;G<s;G+=2)$=$+U|0,Z=kn(Z^$,16),W=W+Z|0,U=kn(U^W,12),$=$+U|0,Z=kn(Z^$,8),W=W+Z|0,U=kn(U^W,7),O=O+z|0,H=kn(H^O,16),T=T+H|0,z=kn(z^T,12),O=O+z|0,H=kn(H^O,8),T=T+H|0,z=kn(z^T,7),P=P+D|0,V=kn(V^P,16),L=L+V|0,D=kn(D^L,12),P=P+D|0,V=kn(V^P,8),L=L+V|0,D=kn(D^L,7),j=j+R|0,F=kn(F^j,16),M=M+F|0,R=kn(R^M,12),j=j+R|0,F=kn(F^j,8),M=M+F|0,R=kn(R^M,7),$=$+z|0,F=kn(F^$,16),L=L+F|0,z=kn(z^L,12),$=$+z|0,F=kn(F^$,8),L=L+F|0,z=kn(z^L,7),O=O+D|0,Z=kn(Z^O,16),M=M+Z|0,D=kn(D^M,12),O=O+D|0,Z=kn(Z^O,8),M=M+Z|0,D=kn(D^M,7),P=P+R|0,H=kn(H^P,16),W=W+H|0,R=kn(R^W,12),P=P+R|0,H=kn(H^P,8),W=W+H|0,R=kn(R^W,7),j=j+U|0,V=kn(V^j,16),T=T+V|0,U=kn(U^T,12),j=j+U|0,V=kn(V^j,8),T=T+V|0,U=kn(U^T,7);let q=0;r[q++]=a+$|0,r[q++]=o+O|0,r[q++]=l+P|0,r[q++]=u+j|0,r[q++]=f+U|0,r[q++]=p+z|0,r[q++]=y+D|0,r[q++]=g+R|0,r[q++]=b+W|0,r[q++]=v+T|0,r[q++]=_+L|0,r[q++]=C+M|0,r[q++]=S+Z|0,r[q++]=x+H|0,r[q++]=A+V|0,r[q++]=I+F|0}const eqe=GWe(QWe,{counterRight:!1,counterLength:4,allowShortKeys:!1}),tqe=new Uint8Array(16),QW=(t,e)=>{t.update(e);const n=e.length%16;n&&t.update(tqe.subarray(n))},nqe=new Uint8Array(32);function eq(t,e,n,r,i){const s=t(e,n,nqe),a=XWe.create(s);i&&QW(a,i),QW(a,r);const o=FWe(r.length,i?i.length:0,!0);a.update(o);const l=a.digest();return T1(s,o),l}const rqe=t=>(e,n,r)=>({encrypt(i,s){const a=i.length;s=YW(a+16,s,!1),s.set(i);const o=s.subarray(0,-16);t(e,n,o,o,1);const l=eq(t,e,n,o,r);return s.set(l,a),T1(l),s},decrypt(i,s){s=YW(i.length-16,s,!1);const a=i.subarray(0,-16),o=i.subarray(-16),l=eq(t,e,n,a,r);if(!UWe(o,l))throw new Error("invalid tag");return s.set(i.subarray(0,-16)),t(e,n,s,s,1),T1(l),s}}),oae=BWe({blockSize:64,nonceLength:12,tagLength:16},rqe(eqe));let lae=class extends d9{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,u9(e);const r=gl(n);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,s=new Uint8Array(i);s.set(r.length>i?e.create().update(r).digest():r);for(let a=0;a<s.length;a++)s[a]^=54;this.iHash.update(s),this.oHash=e.create();for(let a=0;a<s.length;a++)s[a]^=106;this.oHash.update(s),Oo(s)}update(e){return P2(this),this.iHash.update(e),this}digestInto(e){P2(this),Sl(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:i,destroyed:s,blockLen:a,outputLen:o}=this;return e=e,e.finished=i,e.destroyed=s,e.blockLen=a,e.outputLen=o,e.oHash=n._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};const f9=(t,e,n)=>new lae(t,e).update(n).digest();f9.create=(t,e)=>new lae(t,e);function iqe(t,e,n){return u9(t),n===void 0&&(n=new Uint8Array(t.outputLen)),f9(t,gl(n),gl(e))}const xS=Uint8Array.from([0]),tq=Uint8Array.of();function sqe(t,e,n,r=32){u9(t),Mu(r);const i=t.outputLen;if(r>255*i)throw new Error("Length should be <= 255*HashLen");const s=Math.ceil(r/i);n===void 0&&(n=tq);const a=new Uint8Array(s*i),o=f9.create(t,e),l=o._cloneInto(),u=new Uint8Array(o.outputLen);for(let f=0;f<s;f++)xS[0]=f+1,l.update(f===0?tq:u).update(n).update(xS).digestInto(u),a.set(u,i*f),o._cloneInto(l);return o.destroy(),l.destroy(),Oo(u,xS),a.slice(0,r)}const aqe=(t,e,n,r,i)=>sqe(t,iqe(t,e,n),r,i),p9=h9,YO=BigInt(0),OL=BigInt(1);function gv(t,e=""){if(typeof t!="boolean"){const n=e&&`"${e}"`;throw new Error(n+"expected boolean, got type="+typeof t)}return t}function Xh(t,e,n=""){const r=c9(t),i=t==null?void 0:t.length,s=e!==void 0;if(!r||s&&i!==e){const a=n&&`"${n}" `,o=s?` of length ${e}`:"",l=r?`length=${i}`:`type=${typeof t}`;throw new Error(a+"expected Uint8Array"+o+", got "+l)}return t}function J4(t){const e=t.toString(16);return e.length&1?"0"+e:e}function cae(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?YO:BigInt("0x"+t)}function m9(t){return cae(K0(t))}function bv(t){return Sl(t),cae(K0(Uint8Array.from(t).reverse()))}function JO(t,e){return mv(t.toString(16).padStart(e*2,"0"))}function XO(t,e){return JO(t,e).reverse()}function Cs(t,e,n){let r;if(typeof e=="string")try{r=mv(e)}catch(s){throw new Error(t+" must be hex string or Uint8Array, cause: "+s)}else if(c9(e))r=Uint8Array.from(e);else throw new Error(t+" must be hex string or Uint8Array");const i=r.length;if(typeof n=="number"&&i!==n)throw new Error(t+" of length "+n+" expected, got "+i);return r}const CS=t=>typeof t=="bigint"&&YO<=t;function oqe(t,e,n){return CS(t)&&CS(e)&&CS(n)&&e<=t&&t<n}function PL(t,e,n,r){if(!oqe(e,n,r))throw new Error("expected valid "+t+": "+n+" <= n < "+r+", got "+e)}function uae(t){let e;for(e=0;t>YO;t>>=OL,e+=1);return e}const w5=t=>(OL<<BigInt(t))-OL;function lqe(t,e,n){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");const r=y=>new Uint8Array(y),i=y=>Uint8Array.of(y);let s=r(t),a=r(t),o=0;const l=()=>{s.fill(1),a.fill(0),o=0},u=(...y)=>n(a,s,...y),f=(y=r(0))=>{a=u(i(0),y),s=u(),y.length!==0&&(a=u(i(1),y),s=u())},p=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let y=0;const g=[];for(;y<e;){s=u();const b=s.slice();g.push(b),y+=s.length}return r2(...g)};return(y,g)=>{l(),f(y);let b;for(;!(b=g(p()));)f();return l(),b}}function y9(t,e,n={}){if(!t||typeof t!="object")throw new Error("expected valid options object");function r(i,s,a){const o=t[i];if(a&&o===void 0)return;const l=typeof o;if(l!==s||o===null)throw new Error(`param "${i}" is invalid: expected ${s}, got ${l}`)}Object.entries(e).forEach(([i,s])=>r(i,s,!1)),Object.entries(n).forEach(([i,s])=>r(i,s,!0))}function nq(t){const e=new WeakMap;return(n,...r)=>{const i=e.get(n);if(i!==void 0)return i;const s=t(n,...r);return e.set(n,s),s}}const aa=BigInt(0),js=BigInt(1),Qh=BigInt(2),dae=BigInt(3),hae=BigInt(4),fae=BigInt(5),cqe=BigInt(7),pae=BigInt(8),uqe=BigInt(9),mae=BigInt(16);function Ma(t,e){const n=t%e;return n>=aa?n:e+n}function rl(t,e,n){let r=t;for(;e-- >aa;)r*=r,r%=n;return r}function rq(t,e){if(t===aa)throw new Error("invert: expected non-zero number");if(e<=aa)throw new Error("invert: expected positive modulus, got "+e);let n=Ma(t,e),r=e,i=aa,s=js;for(;n!==aa;){const a=r/n,o=r%n,l=i-s*a;r=n,n=o,i=s,s=l}if(r!==js)throw new Error("invert: does not exist");return Ma(i,e)}function QO(t,e,n){if(!t.eql(t.sqr(e),n))throw new Error("Cannot find square root")}function yae(t,e){const n=(t.ORDER+js)/hae,r=t.pow(e,n);return QO(t,r,e),r}function dqe(t,e){const n=(t.ORDER-fae)/pae,r=t.mul(e,Qh),i=t.pow(r,n),s=t.mul(e,i),a=t.mul(t.mul(s,Qh),i),o=t.mul(s,t.sub(a,t.ONE));return QO(t,o,e),o}function hqe(t){const e=q2(t),n=gae(t),r=n(e,e.neg(e.ONE)),i=n(e,r),s=n(e,e.neg(r)),a=(t+cqe)/mae;return(o,l)=>{let u=o.pow(l,a),f=o.mul(u,r);const p=o.mul(u,i),y=o.mul(u,s),g=o.eql(o.sqr(f),l),b=o.eql(o.sqr(p),l);u=o.cmov(u,f,g),f=o.cmov(y,p,b);const v=o.eql(o.sqr(f),l),_=o.cmov(u,f,v);return QO(o,_,l),_}}function gae(t){if(t<dae)throw new Error("sqrt is not defined for small field");let e=t-js,n=0;for(;e%Qh===aa;)e/=Qh,n++;let r=Qh;const i=q2(t);for(;iq(i,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(n===1)return yae;let s=i.pow(r,e);const a=(e+js)/Qh;return function(o,l){if(o.is0(l))return l;if(iq(o,l)!==1)throw new Error("Cannot find square root");let u=n,f=o.mul(o.ONE,s),p=o.pow(l,e),y=o.pow(l,a);for(;!o.eql(p,o.ONE);){if(o.is0(p))return o.ZERO;let g=1,b=o.sqr(p);for(;!o.eql(b,o.ONE);)if(g++,b=o.sqr(b),g===u)throw new Error("Cannot find square root");const v=js<<BigInt(u-g-1),_=o.pow(f,v);u=g,f=o.sqr(_),p=o.mul(p,f),y=o.mul(y,_)}return y}}function fqe(t){return t%hae===dae?yae:t%pae===fae?dqe:t%mae===uqe?hqe(t):gae(t)}const pqe=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function mqe(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"},n=pqe.reduce((r,i)=>(r[i]="function",r),e);return y9(t,n),t}function yqe(t,e,n){if(n<aa)throw new Error("invalid exponent, negatives unsupported");if(n===aa)return t.ONE;if(n===js)return e;let r=t.ONE,i=e;for(;n>aa;)n&js&&(r=t.mul(r,i)),i=t.sqr(i),n>>=js;return r}function bae(t,e,n=!1){const r=new Array(e.length).fill(n?t.ZERO:void 0),i=e.reduce((a,o,l)=>t.is0(o)?a:(r[l]=a,t.mul(a,o)),t.ONE),s=t.inv(i);return e.reduceRight((a,o,l)=>t.is0(o)?a:(r[l]=t.mul(a,r[l]),t.mul(a,o)),s),r}function iq(t,e){const n=(t.ORDER-js)/Qh,r=t.pow(e,n),i=t.eql(r,t.ONE),s=t.eql(r,t.ZERO),a=t.eql(r,t.neg(t.ONE));if(!i&&!s&&!a)throw new Error("invalid Legendre symbol result");return i?1:s?0:-1}function wae(t,e){e!==void 0&&Mu(e);const n=e!==void 0?e:t.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function q2(t,e,n=!1,r={}){if(t<=aa)throw new Error("invalid field: expected ORDER > 0, got "+t);let i,s,a=!1,o;if(typeof e=="object"&&e!=null){if(r.sqrt||n)throw new Error("cannot specify opts in two arguments");const y=e;y.BITS&&(i=y.BITS),y.sqrt&&(s=y.sqrt),typeof y.isLE=="boolean"&&(n=y.isLE),typeof y.modFromBytes=="boolean"&&(a=y.modFromBytes),o=y.allowedLengths}else typeof e=="number"&&(i=e),r.sqrt&&(s=r.sqrt);const{nBitLength:l,nByteLength:u}=wae(t,i);if(u>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let f;const p=Object.freeze({ORDER:t,isLE:n,BITS:l,BYTES:u,MASK:w5(l),ZERO:aa,ONE:js,allowedLengths:o,create:y=>Ma(y,t),isValid:y=>{if(typeof y!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof y);return aa<=y&&y<t},is0:y=>y===aa,isValidNot0:y=>!p.is0(y)&&p.isValid(y),isOdd:y=>(y&js)===js,neg:y=>Ma(-y,t),eql:(y,g)=>y===g,sqr:y=>Ma(y*y,t),add:(y,g)=>Ma(y+g,t),sub:(y,g)=>Ma(y-g,t),mul:(y,g)=>Ma(y*g,t),pow:(y,g)=>yqe(p,y,g),div:(y,g)=>Ma(y*rq(g,t),t),sqrN:y=>y*y,addN:(y,g)=>y+g,subN:(y,g)=>y-g,mulN:(y,g)=>y*g,inv:y=>rq(y,t),sqrt:s||(y=>(f||(f=fqe(t)),f(p,y))),toBytes:y=>n?XO(y,u):JO(y,u),fromBytes:(y,g=!0)=>{if(o){if(!o.includes(y.length)||y.length>u)throw new Error("Field.fromBytes: expected "+o+" bytes, got "+y.length);const v=new Uint8Array(u);v.set(y,n?0:v.length-y.length),y=v}if(y.length!==u)throw new Error("Field.fromBytes: expected "+u+" bytes, got "+y.length);let b=n?bv(y):m9(y);if(a&&(b=Ma(b,t)),!g&&!p.isValid(b))throw new Error("invalid field element: outside of range 0..ORDER");return b},invertBatch:y=>bae(p,y),cmov:(y,g,b)=>b?g:y});return Object.freeze(p)}function vae(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function _ae(t){const e=vae(t);return e+Math.ceil(e/2)}function gqe(t,e,n=!1){const r=t.length,i=vae(e),s=_ae(e);if(r<16||r<s||r>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+r);const a=n?bv(t):m9(t),o=Ma(a,e-js)+js;return n?XO(o,i):JO(o,i)}const L1=BigInt(0),ef=BigInt(1);function wv(t,e){const n=e.negate();return t?n:e}function ES(t,e){const n=bae(t.Fp,e.map(r=>r.Z));return e.map((r,i)=>t.fromAffine(r.toAffine(n[i])))}function xae(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function SS(t,e){xae(t,e);const n=Math.ceil(e/t)+1,r=2**(t-1),i=2**t,s=w5(t),a=BigInt(t);return{windows:n,windowSize:r,mask:s,maxNumber:i,shiftBy:a}}function sq(t,e,n){const{windowSize:r,mask:i,maxNumber:s,shiftBy:a}=n;let o=Number(t&i),l=t>>a;o>r&&(o-=s,l+=ef);const u=e*r,f=u+Math.abs(o)-1,p=o===0,y=o<0,g=e%2!==0;return{nextN:l,offset:f,isZero:p,isNeg:y,isNegF:g,offsetF:u}}function bqe(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach((n,r)=>{if(!(n instanceof e))throw new Error("invalid point at index "+r)})}function wqe(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((n,r)=>{if(!e.isValid(n))throw new Error("invalid scalar at index "+r)})}const AS=new WeakMap,Cae=new WeakMap;function kS(t){return Cae.get(t)||1}function aq(t){if(t!==L1)throw new Error("invalid wNAF")}class vqe{constructor(e,n){this.BASE=e.BASE,this.ZERO=e.ZERO,this.Fn=e.Fn,this.bits=n}_unsafeLadder(e,n,r=this.ZERO){let i=e;for(;n>L1;)n&ef&&(r=r.add(i)),i=i.double(),n>>=ef;return r}precomputeWindow(e,n){const{windows:r,windowSize:i}=SS(n,this.bits),s=[];let a=e,o=a;for(let l=0;l<r;l++){o=a,s.push(o);for(let u=1;u<i;u++)o=o.add(a),s.push(o);a=o.double()}return s}wNAF(e,n,r){if(!this.Fn.isValid(r))throw new Error("invalid scalar");let i=this.ZERO,s=this.BASE;const a=SS(e,this.bits);for(let o=0;o<a.windows;o++){const{nextN:l,offset:u,isZero:f,isNeg:p,isNegF:y,offsetF:g}=sq(r,o,a);r=l,f?s=s.add(wv(y,n[g])):i=i.add(wv(p,n[u]))}return aq(r),{p:i,f:s}}wNAFUnsafe(e,n,r,i=this.ZERO){const s=SS(e,this.bits);for(let a=0;a<s.windows&&r!==L1;a++){const{nextN:o,offset:l,isZero:u,isNeg:f}=sq(r,a,s);if(r=o,!u){const p=n[l];i=i.add(f?p.negate():p)}}return aq(r),i}getPrecomputes(e,n,r){let i=AS.get(n);return i||(i=this.precomputeWindow(n,e),e!==1&&(typeof r=="function"&&(i=r(i)),AS.set(n,i))),i}cached(e,n,r){const i=kS(e);return this.wNAF(i,this.getPrecomputes(i,e,r),n)}unsafe(e,n,r,i){const s=kS(e);return s===1?this._unsafeLadder(e,n,i):this.wNAFUnsafe(s,this.getPrecomputes(s,e,r),n,i)}createCache(e,n){xae(n,this.bits),Cae.set(e,n),AS.delete(e)}hasCache(e){return kS(e)!==1}}function _qe(t,e,n,r){let i=e,s=t.ZERO,a=t.ZERO;for(;n>L1||r>L1;)n&ef&&(s=s.add(i)),r&ef&&(a=a.add(i)),i=i.double(),n>>=ef,r>>=ef;return{p1:s,p2:a}}function xqe(t,e,n,r){bqe(n,t),wqe(r,e);const i=n.length,s=r.length;if(i!==s)throw new Error("arrays of points and scalars must have equal length");const a=t.ZERO,o=uae(BigInt(i));let l=1;o>12?l=o-3:o>4?l=o-2:o>0&&(l=2);const u=w5(l),f=new Array(Number(u)+1).fill(a),p=Math.floor((e.BITS-1)/l)*l;let y=a;for(let g=p;g>=0;g-=l){f.fill(a);for(let v=0;v<s;v++){const _=r[v],C=Number(_>>BigInt(g)&u);f[C]=f[C].add(n[v])}let b=a;for(let v=f.length-1,_=a;v>0;v--)_=_.add(f[v]),b=b.add(_);if(y=y.add(b),g!==0)for(let v=0;v<l;v++)y=y.double()}return y}function oq(t,e,n){if(e){if(e.ORDER!==t)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return mqe(e),e}else return q2(t,{isLE:n})}function Cqe(t,e,n={},r){if(r===void 0&&(r=t==="edwards"),!e||typeof e!="object")throw new Error(`expected valid ${t} CURVE object`);for(const o of["p","n","h"]){const l=e[o];if(!(typeof l=="bigint"&&l>L1))throw new Error(`CURVE.${o} must be positive bigint`)}const i=oq(e.p,n.Fp,r),s=oq(e.n,n.Fn,r),a=["Gx","Gy","a","b"];for(const o of a)if(!i.isValid(e[o]))throw new Error(`CURVE.${o} must be valid field element of CURVE.Fp`);return e=Object.freeze(Object.assign({},e)),{CURVE:e,Fp:i,Fn:s}}BigInt(0),BigInt(1),BigInt(2),BigInt(8),Zse("HashToScalar-");const Hy=BigInt(0),a0=BigInt(1),X4=BigInt(2);function Eqe(t){return y9(t,{adjustScalarBytes:"function",powPminus2:"function"}),Object.freeze({...t})}function Sqe(t){const e=Eqe(t),{P:n,type:r,adjustScalarBytes:i,powPminus2:s,randomBytes:a}=e,o=r==="x25519";if(!o&&r!=="x448")throw new Error("invalid type");const l=a||Yf,u=o?255:448,f=o?32:56,p=BigInt(o?9:5),y=BigInt(o?121665:39081),g=o?X4**BigInt(254):X4**BigInt(447),b=o?BigInt(8)*X4**BigInt(251)-a0:BigInt(4)*X4**BigInt(445)-a0,v=g+b+a0,_=D=>Ma(D,n),C=S(p);function S(D){return XO(_(D),f)}function x(D){const R=Cs("u coordinate",D,f);return o&&(R[31]&=127),_(bv(R))}function A(D){return bv(i(Cs("scalar",D,f)))}function I(D,R){const W=P(x(R),A(D));if(W===Hy)throw new Error("invalid private or public key received");return S(W)}function $(D){return I(D,C)}function O(D,R,W){const T=_(D*(R-W));return R=_(R-T),W=_(W+T),{x_2:R,x_3:W}}function P(D,R){PL("u",D,Hy,n),PL("scalar",R,g,v);const W=R,T=D;let L=a0,M=Hy,Z=D,H=a0,V=Hy;for(let q=BigInt(u-1);q>=Hy;q--){const G=W>>q&a0;V^=G,{x_2:L,x_3:Z}=O(V,L,Z),{x_2:M,x_3:H}=O(V,M,H),V=G;const Y=L+M,X=_(Y*Y),te=L-M,ie=_(te*te),se=X-ie,pe=Z+H,Ce=Z-H,xe=_(Ce*Y),Te=_(pe*te),Et=xe+Te,Ke=xe-Te;Z=_(Et*Et),H=_(T*_(Ke*Ke)),L=_(X*ie),M=_(se*(X+_(y*se)))}({x_2:L,x_3:Z}=O(V,L,Z)),{x_2:M,x_3:H}=O(V,M,H);const F=s(M);return _(L*F)}const j={secretKey:f,publicKey:f,seed:f},U=(D=l(f))=>(Sl(D,j.seed),D);function z(D){const R=U(D);return{secretKey:R,publicKey:$(R)}}return{keygen:z,getSharedSecret:(D,R)=>I(D,R),getPublicKey:D=>$(D),scalarMult:I,scalarMultBase:$,utils:{randomSecretKey:U,randomPrivateKey:U},GuBytes:C.slice(),lengths:j}}const Aqe=BigInt(1),lq=BigInt(2),kqe=BigInt(3),Tqe=BigInt(5);BigInt(8);const Eae=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),Lqe={p:Eae,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function $qe(t){const e=BigInt(10),n=BigInt(20),r=BigInt(40),i=BigInt(80),s=Eae,a=t*t%s*t%s,o=rl(a,lq,s)*a%s,l=rl(o,Aqe,s)*t%s,u=rl(l,Tqe,s)*l%s,f=rl(u,e,s)*u%s,p=rl(f,n,s)*f%s,y=rl(p,r,s)*p%s,g=rl(y,i,s)*y%s,b=rl(g,i,s)*y%s,v=rl(b,e,s)*u%s;return{pow_p_5_8:rl(v,lq,s)*t%s,b2:a}}function Iqe(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}const Nqe=q2(Lqe.p,{isLE:!0}),RL=(()=>{const t=Nqe.ORDER;return Sqe({P:t,type:"x25519",powPminus2:e=>{const{pow_p_5_8:n,b2:r}=$qe(e);return Ma(rl(n,kqe,t)*r,t)},adjustScalarBytes:Iqe})})(),cq=(t,e)=>(t+(t>=0?e:-e)/Sae)/e;function Oqe(t,e,n){const[[r,i],[s,a]]=e,o=cq(a*t,n),l=cq(-i*t,n);let u=t-o*r-l*s,f=-o*i-l*a;const p=u<vu,y=f<vu;p&&(u=-u),y&&(f=-f);const g=w5(Math.ceil(uae(n)/2))+G0;if(u<vu||u>=g||f<vu||f>=g)throw new Error("splitScalar (endomorphism): failed, k="+t);return{k1neg:p,k1:u,k2neg:y,k2:f}}function jL(t){if(!["compact","recovered","der"].includes(t))throw new Error('Signature format must be "compact", "recovered", or "der"');return t}function TS(t,e){const n={};for(let r of Object.keys(e))n[r]=t[r]===void 0?e[r]:t[r];return gv(n.lowS,"lowS"),gv(n.prehash,"prehash"),n.format!==void 0&&jL(n.format),n}class Pqe extends Error{constructor(e=""){super(e)}}const du={Err:Pqe,_tlv:{encode:(t,e)=>{const{Err:n}=du;if(t<0||t>256)throw new n("tlv.encode: wrong tag");if(e.length&1)throw new n("tlv.encode: unpadded data");const r=e.length/2,i=J4(r);if(i.length/2&128)throw new n("tlv.encode: long form length too big");const s=r>127?J4(i.length/2|128):"";return J4(t)+s+i+e},decode(t,e){const{Err:n}=du;let r=0;if(t<0||t>256)throw new n("tlv.encode: wrong tag");if(e.length<2||e[r++]!==t)throw new n("tlv.decode: wrong tlv");const i=e[r++],s=!!(i&128);let a=0;if(!s)a=i;else{const l=i&127;if(!l)throw new n("tlv.decode(long): indefinite length not supported");if(l>4)throw new n("tlv.decode(long): byte length is too big");const u=e.subarray(r,r+l);if(u.length!==l)throw new n("tlv.decode: length bytes not complete");if(u[0]===0)throw new n("tlv.decode(long): zero leftmost byte");for(const f of u)a=a<<8|f;if(r+=l,a<128)throw new n("tlv.decode(long): not minimal encoding")}const o=e.subarray(r,r+a);if(o.length!==a)throw new n("tlv.decode: wrong value length");return{v:o,l:e.subarray(r+a)}}},_int:{encode(t){const{Err:e}=du;if(t<vu)throw new e("integer: negative integers are not allowed");let n=J4(t);if(Number.parseInt(n[0],16)&8&&(n="00"+n),n.length&1)throw new e("unexpected DER parsing assertion: unpadded hex");return n},decode(t){const{Err:e}=du;if(t[0]&128)throw new e("invalid signature integer: negative");if(t[0]===0&&!(t[1]&128))throw new e("invalid signature integer: unnecessary leading zero");return m9(t)}},toSig(t){const{Err:e,_int:n,_tlv:r}=du,i=Cs("signature",t),{v:s,l:a}=r.decode(48,i);if(a.length)throw new e("invalid signature: left bytes after parsing");const{v:o,l}=r.decode(2,s),{v:u,l:f}=r.decode(2,l);if(f.length)throw new e("invalid signature: left bytes after parsing");return{r:n.decode(o),s:n.decode(u)}},hexFromSig(t){const{_tlv:e,_int:n}=du,r=e.encode(2,n.encode(t.r)),i=e.encode(2,n.encode(t.s)),s=r+i;return e.encode(48,s)}},vu=BigInt(0),G0=BigInt(1),Sae=BigInt(2),Q4=BigInt(3),Rqe=BigInt(4);function I0(t,e){const{BYTES:n}=t;let r;if(typeof e=="bigint")r=e;else{let i=Cs("private key",e);try{r=t.fromBytes(i)}catch{throw new Error(`invalid private key: expected ui8a of size ${n}, got ${typeof e}`)}}if(!t.isValidNot0(r))throw new Error("invalid private key: out of range [1..N-1]");return r}function jqe(t,e={}){const n=Cqe("weierstrass",t,e),{Fp:r,Fn:i}=n;let s=n.CURVE;const{h:a,n:o}=s;y9(e,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});const{endo:l}=e;if(l&&(!r.is0(s.a)||typeof l.beta!="bigint"||!Array.isArray(l.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');const u=kae(r,i);function f(){if(!r.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}function p(D,R,W){const{x:T,y:L}=R.toAffine(),M=r.toBytes(T);if(gv(W,"isCompressed"),W){f();const Z=!r.isOdd(L);return r2(Aae(Z),M)}else return r2(Uint8Array.of(4),M,r.toBytes(L))}function y(D){Xh(D,void 0,"Point");const{publicKey:R,publicKeyUncompressed:W}=u,T=D.length,L=D[0],M=D.subarray(1);if(T===R&&(L===2||L===3)){const Z=r.fromBytes(M);if(!r.isValid(Z))throw new Error("bad point: is not on curve, wrong x");const H=v(Z);let V;try{V=r.sqrt(H)}catch(q){const G=q instanceof Error?": "+q.message:"";throw new Error("bad point: is not on curve, sqrt error"+G)}f();const F=r.isOdd(V);return(L&1)===1!==F&&(V=r.neg(V)),{x:Z,y:V}}else if(T===W&&L===4){const Z=r.BYTES,H=r.fromBytes(M.subarray(0,Z)),V=r.fromBytes(M.subarray(Z,Z*2));if(!_(H,V))throw new Error("bad point: is not on curve");return{x:H,y:V}}else throw new Error(`bad point: got length ${T}, expected compressed=${R} or uncompressed=${W}`)}const g=e.toBytes||p,b=e.fromBytes||y;function v(D){const R=r.sqr(D),W=r.mul(R,D);return r.add(r.add(W,r.mul(D,s.a)),s.b)}function _(D,R){const W=r.sqr(R),T=v(D);return r.eql(W,T)}if(!_(s.Gx,s.Gy))throw new Error("bad curve params: generator point");const C=r.mul(r.pow(s.a,Q4),Rqe),S=r.mul(r.sqr(s.b),BigInt(27));if(r.is0(r.add(C,S)))throw new Error("bad curve params: a or b");function x(D,R,W=!1){if(!r.isValid(R)||W&&r.is0(R))throw new Error(`bad point coordinate ${D}
549`);return R}function A(D){if(!(D instanceof j))throw new Error("ProjectivePoint expected")}function I(D){if(!l||!l.basises)throw new Error("no endo");return Oqe(D,l.basises,i.ORDER)}const $=nq((D,R)=>{const{X:W,Y:T,Z:L}=D;if(r.eql(L,r.ONE))return{x:W,y:T};const M=D.is0();R==null&&(R=M?r.ONE:r.inv(L));const Z=r.mul(W,R),H=r.mul(T,R),V=r.mul(L,R);if(M)return{x:r.ZERO,y:r.ZERO};if(!r.eql(V,r.ONE))throw new Error("invZ was invalid");return{x:Z,y:H}}),O=nq(D=>{if(D.is0()){if(e.allowInfinityPoint&&!r.is0(D.Y))return;throw new Error("bad point: ZERO")}const{x:R,y:W}=D.toAffine();if(!r.isValid(R)||!r.isValid(W))throw new Error("bad point: x or y not field elements");if(!_(R,W))throw new Error("bad point: equation left != right");if(!D.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function P(D,R,W,T,L){return W=new j(r.mul(W.X,D),W.Y,W.Z),R=wv(T,R),W=wv(L,W),R.add(W)}class j{constructor(R,W,T){this.X=x("x",R),this.Y=x("y",W,!0),this.Z=x("z",T),Object.freeze(this)}static CURVE(){return s}static fromAffine(R){const{x:W,y:T}=R||{};if(!R||!r.isValid(W)||!r.isValid(T))throw new Error("invalid affine point");if(R instanceof j)throw new Error("projective point not allowed");return r.is0(W)&&r.is0(T)?j.ZERO:new j(W,T,r.ONE)}static fromBytes(R){const W=j.fromAffine(b(Xh(R,void 0,"point")));return W.assertValidity(),W}static fromHex(R){return j.fromBytes(Cs("pointHex",R))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(R=8,W=!0){return z.createCache(this,R),W||this.multiply(Q4),this}assertValidity(){O(this)}hasEvenY(){const{y:R}=this.toAffine();if(!r.isOdd)throw new Error("Field doesn't support isOdd");return!r.isOdd(R)}equals(R){A(R);const{X:W,Y:T,Z:L}=this,{X:M,Y:Z,Z:H}=R,V=r.eql(r.mul(W,H),r.mul(M,L)),F=r.eql(r.mul(T,H),r.mul(Z,L));return V&&F}negate(){return new j(this.X,r.neg(this.Y),this.Z)}double(){const{a:R,b:W}=s,T=r.mul(W,Q4),{X:L,Y:M,Z}=this;let H=r.ZERO,V=r.ZERO,F=r.ZERO,q=r.mul(L,L),G=r.mul(M,M),Y=r.mul(Z,Z),X=r.mul(L,M);return X=r.add(X,X),F=r.mul(L,Z),F=r.add(F,F),H=r.mul(R,F),V=r.mul(T,Y),V=r.add(H,V),H=r.sub(G,V),V=r.add(G,V),V=r.mul(H,V),H=r.mul(X,H),F=r.mul(T,F),Y=r.mul(R,Y),X=r.sub(q,Y),X=r.mul(R,X),X=r.add(X,F),F=r.add(q,q),q=r.add(F,q),q=r.add(q,Y),q=r.mul(q,X),V=r.add(V,q),Y=r.mul(M,Z),Y=r.add(Y,Y),q=r.mul(Y,X),H=r.sub(H,q),F=r.mul(Y,G),F=r.add(F,F),F=r.add(F,F),new j(H,V,F)}add(R){A(R);const{X:W,Y:T,Z:L}=this,{X:M,Y:Z,Z:H}=R;let V=r.ZERO,F=r.ZERO,q=r.ZERO;const G=s.a,Y=r.mul(s.b,Q4);let X=r.mul(W,M),te=r.mul(T,Z),ie=r.mul(L,H),se=r.add(W,T),pe=r.add(M,Z);se=r.mul(se,pe),pe=r.add(X,te),se=r.sub(se,pe),pe=r.add(W,L);let Ce=r.add(M,H);return pe=r.mul(pe,Ce),Ce=r.add(X,ie),pe=r.sub(pe,Ce),Ce=r.add(T,L),V=r.add(Z,H),Ce=r.mul(Ce,V),V=r.add(te,ie),Ce=r.sub(Ce,V),q=r.mul(G,pe),V=r.mul(Y,ie),q=r.add(V,q),V=r.sub(te,q),q=r.add(te,q),F=r.mul(V,q),te=r.add(X,X),te=r.add(te,X),ie=r.mul(G,ie),pe=r.mul(Y,pe),te=r.add(te,ie),ie=r.sub(X,ie),ie=r.mul(G,ie),pe=r.add(pe,ie),X=r.mul(te,pe),F=r.add(F,X),X=r.mul(Ce,pe),V=r.mul(se,V),V=r.sub(V,X),X=r.mul(se,te),q=r.mul(Ce,q),q=r.add(q,X),new j(V,F,q)}subtract(R){return this.add(R.negate())}is0(){return this.equals(j.ZERO)}multiply(R){const{endo:W}=e;if(!i.isValidNot0(R))throw new Error("invalid scalar: out of range");let T,L;const M=Z=>z.cached(this,Z,H=>ES(j,H));if(W){const{k1neg:Z,k1:H,k2neg:V,k2:F}=I(R),{p:q,f:G}=M(H),{p:Y,f:X}=M(F);L=G.add(X),T=P(W.beta,q,Y,Z,V)}else{const{p:Z,f:H}=M(R);T=Z,L=H}return ES(j,[T,L])[0]}multiplyUnsafe(R){const{endo:W}=e,T=this;if(!i.isValid(R))throw new Error("invalid scalar: out of range");if(R===vu||T.is0())return j.ZERO;if(R===G0)return T;if(z.hasCache(this))return this.multiply(R);if(W){const{k1neg:L,k1:M,k2neg:Z,k2:H}=I(R),{p1:V,p2:F}=_qe(j,T,M,H);return P(W.beta,V,F,L,Z)}else return z.unsafe(T,R)}multiplyAndAddUnsafe(R,W,T){const L=this.multiplyUnsafe(W).add(R.multiplyUnsafe(T));return L.is0()?void 0:L}toAffine(R){return $(this,R)}isTorsionFree(){const{isTorsionFree:R}=e;return a===G0?!0:R?R(j,this):z.unsafe(this,o).is0()}clearCofactor(){const{clearCofactor:R}=e;return a===G0?this:R?R(j,this):this.multiplyUnsafe(a)}isSmallOrder(){return this.multiplyUnsafe(a).is0()}toBytes(R=!0){return gv(R,"isCompressed"),this.assertValidity(),g(j,this,R)}toHex(R=!0){return K0(this.toBytes(R))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(R=!0){return this.toBytes(R)}
vendor: 10,723 bytes, line 549
549_setWindowSize(R){this.precompute(R)}static normalizeZ(R){return ES(j,R)}static msm(R,W){return xqe(j,i,R,W)}static fromPrivateKey(R){return j.BASE.multiply(I0(i,R))}}j.BASE=new j(s.Gx,s.Gy,r.ONE),j.ZERO=new j(r.ZERO,r.ONE,r.ZERO),j.Fp=r,j.Fn=i;const U=i.BITS,z=new vqe(j,e.endo?Math.ceil(U/2):U);return j.BASE.precompute(8),j}function Aae(t){return Uint8Array.of(t?2:3)}function kae(t,e){return{secretKey:e.BYTES,publicKey:1+t.BYTES,publicKeyUncompressed:1+2*t.BYTES,publicKeyHasPrefix:!0,signature:2*e.BYTES}}function Mqe(t,e={}){const{Fn:n}=t,r=e.randomBytes||Yf,i=Object.assign(kae(t.Fp,n),{seed:_ae(n.ORDER)});function s(y){try{return!!I0(n,y)}catch{return!1}}function a(y,g){const{publicKey:b,publicKeyUncompressed:v}=i;try{const _=y.length;return g===!0&&_!==b||g===!1&&_!==v?!1:!!t.fromBytes(y)}catch{return!1}}function o(y=r(i.seed)){return gqe(Xh(y,i.seed,"seed"),n.ORDER)}function l(y,g=!0){return t.BASE.multiply(I0(n,y)).toBytes(g)}function u(y){const g=o(y);return{secretKey:g,publicKey:l(g)}}function f(y){if(typeof y=="bigint")return!1;if(y instanceof t)return!0;const{secretKey:g,publicKey:b,publicKeyUncompressed:v}=i;if(n.allowedLengths||g===b)return;const _=Cs("key",y).length;return _===b||_===v}function p(y,g,b=!0){if(f(y)===!0)throw new Error("first arg must be private key");if(f(g)===!1)throw new Error("second arg must be public key");const v=I0(n,y);return t.fromHex(g).multiply(v).toBytes(b)}return Object.freeze({getPublicKey:l,getSharedSecret:p,keygen:u,Point:t,utils:{isValidSecretKey:s,isValidPublicKey:a,randomSecretKey:o,isValidPrivateKey:s,randomPrivateKey:o,normPrivateKeyToScalar:y=>I0(n,y),precompute(y=8,g=t.BASE){return g.precompute(y,!1)}},lengths:i})}function Dqe(t,e,n={}){u9(e),y9(n,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const r=n.randomBytes||Yf,i=n.hmac||((W,...T)=>f9(e,W,r2(...T))),{Fp:s,Fn:a}=t,{ORDER:o,BITS:l}=a,{keygen:u,getPublicKey:f,getSharedSecret:p,utils:y,lengths:g}=Mqe(t,n),b={prehash:!1,lowS:typeof n.lowS=="boolean"?n.lowS:!1,format:void 0,extraEntropy:!1},v="compact";function _(W){const T=o>>G0;return W>T}function C(W,T){if(!a.isValidNot0(T))throw new Error(`invalid signature ${W}: out of range 1..Point.Fn.ORDER`);return T}function S(W,T){jL(T);const L=g.signature,M=T==="compact"?L:T==="recovered"?L+1:void 0;return Xh(W,M,`${T} signature`)}class x{constructor(T,L,M){this.r=C("r",T),this.s=C("s",L),M!=null&&(this.recovery=M),Object.freeze(this)}static fromBytes(T,L=v){S(T,L);let M;if(L==="der"){const{r:F,s:q}=du.toSig(Xh(T));return new x(F,q)}L==="recovered"&&(M=T[0],L="compact",T=T.subarray(1));const Z=a.BYTES,H=T.subarray(0,Z),V=T.subarray(Z,Z*2);return new x(a.fromBytes(H),a.fromBytes(V),M)}static fromHex(T,L){return this.fromBytes(mv(T),L)}addRecoveryBit(T){return new x(this.r,this.s,T)}recoverPublicKey(T){const L=s.ORDER,{r:M,s:Z,recovery:H}=this;if(H==null||![0,1,2,3].includes(H))throw new Error("recovery id invalid");if(o*Sae<L&&H>1)throw new Error("recovery id is ambiguous for h>1 curve");const V=H===2||H===3?M+o:M;if(!s.isValid(V))throw new Error("recovery id 2 or 3 invalid");const F=s.toBytes(V),q=t.fromBytes(r2(Aae((H&1)===0),F)),G=a.inv(V),Y=I(Cs("msgHash",T)),X=a.create(-Y*G),te=a.create(Z*G),ie=t.BASE.multiplyUnsafe(X).add(q.multiplyUnsafe(te));if(ie.is0())throw new Error("point at infinify");return ie.assertValidity(),ie}hasHighS(){return _(this.s)}toBytes(T=v){if(jL(T),T==="der")return mv(du.hexFromSig(this));const L=a.toBytes(this.r),M=a.toBytes(this.s);if(T==="recovered"){if(this.recovery==null)throw new Error("recovery bit must be present");return r2(Uint8Array.of(this.recovery),L,M)}return r2(L,M)}toHex(T){return K0(this.toBytes(T))}assertValidity(){}static fromCompact(T){return x.fromBytes(Cs("sig",T),"compact")}static fromDER(T){return x.fromBytes(Cs("sig",T),"der")}normalizeS(){return this.hasHighS()?new x(this.r,a.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return K0(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return K0(this.toBytes("compact"))}}const A=n.bits2int||function(W){if(W.length>8192)throw new Error("input is too large");const T=m9(W),L=W.length*8-l;return L>0?T>>BigInt(L):T},I=n.bits2int_modN||function(W){return a.create(A(W))},$=w5(l);function O(W){return PL("num < 2^"+l,W,vu,$),a.toBytes(W)}function P(W,T){return Xh(W,void 0,"message"),T?Xh(e(W),void 0,"prehashed message"):W}function j(W,T,L){if(["recovered","canonical"].some(te=>te in L))throw new Error("sign() legacy options not supported");const{lowS:M,prehash:Z,extraEntropy:H}=TS(L,b);W=P(W,Z);const V=I(W),F=I0(a,T),q=[O(F),O(V)];if(H!=null&&H!==!1){const te=H===!0?r(g.secretKey):H;q.push(Cs("extraEntropy",te))}const G=r2(...q),Y=V;function X(te){const ie=A(te);if(!a.isValidNot0(ie))return;const se=a.inv(ie),pe=t.BASE.multiply(ie).toAffine(),Ce=a.create(pe.x);if(Ce===vu)return;const xe=a.create(se*a.create(Y+Ce*F));if(xe===vu)return;let Te=(pe.x===Ce?0:2)|Number(pe.y&G0),Et=xe;return M&&_(xe)&&(Et=a.neg(xe),Te^=1),new x(Ce,Et,Te)}return{seed:G,k2sig:X}}function U(W,T,L={}){W=Cs("message",W);const{seed:M,k2sig:Z}=j(W,T,L);return lqe(e.outputLen,a.BYTES,i)(M,Z)}function z(W){let T;const L=typeof W=="string"||c9(W),M=!L&&W!==null&&typeof W=="object"&&typeof W.r=="bigint"&&typeof W.s=="bigint";if(!L&&!M)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(M)T=new x(W.r,W.s);else if(L){try{T=x.fromBytes(Cs("sig",W),"der")}catch(Z){if(!(Z instanceof du.Err))throw Z}if(!T)try{T=x.fromBytes(Cs("sig",W),"compact")}catch{return!1}}return T||!1}function D(W,T,L,M={}){const{lowS:Z,prehash:H,format:V}=TS(M,b);if(L=Cs("publicKey",L),T=P(Cs("message",T),H),"strict"in M)throw new Error("options.strict was renamed to lowS");const F=V===void 0?z(W):x.fromBytes(Cs("sig",W),V);if(F===!1)return!1;try{const q=t.fromBytes(L);if(Z&&F.hasHighS())return!1;const{r:G,s:Y}=F,X=I(T),te=a.inv(Y),ie=a.create(X*te),se=a.create(G*te),pe=t.BASE.multiplyUnsafe(ie).add(q.multiplyUnsafe(se));return pe.is0()?!1:a.create(pe.x)===G}catch{return!1}}function R(W,T,L={}){const{prehash:M}=TS(L,b);return T=P(T,M),x.fromBytes(W,"recovered").recoverPublicKey(T).toBytes()}return Object.freeze({keygen:u,getPublicKey:f,getSharedSecret:p,utils:y,lengths:g,Point:t,sign:U,verify:D,recoverPublicKey:R,Signature:x,hash:e})}function Uqe(t){const e={a:t.a,b:t.b,p:t.Fp.ORDER,n:t.n,h:t.h,Gx:t.Gx,Gy:t.Gy},n=t.Fp;let r=t.allowedPrivateKeyLengths?Array.from(new Set(t.allowedPrivateKeyLengths.map(a=>Math.ceil(a/2)))):void 0;const i=q2(e.n,{BITS:t.nBitLength,allowedLengths:r,modFromBytes:t.wrapPrivateKey}),s={Fp:n,Fn:i,allowInfinityPoint:t.allowInfinityPoint,endo:t.endo,isTorsionFree:t.isTorsionFree,clearCofactor:t.clearCofactor,fromBytes:t.fromBytes,toBytes:t.toBytes};return{CURVE:e,curveOpts:s}}function Bqe(t){const{CURVE:e,curveOpts:n}=Uqe(t),r={hmac:t.hmac,randomBytes:t.randomBytes,lowS:t.lowS,bits2int:t.bits2int,bits2int_modN:t.bits2int_modN};return{CURVE:e,curveOpts:n,hash:t.hash,ecdsaOpts:r}}function Fqe(t,e){const n=e.Point;return Object.assign({},e,{ProjectivePoint:n,CURVE:Object.assign({},t,wae(n.Fn.ORDER,n.Fn.BITS))})}function zqe(t){const{CURVE:e,curveOpts:n,hash:r,ecdsaOpts:i}=Bqe(t),s=jqe(e,n),a=Dqe(s,r,i);return Fqe(t,a)}function ML(t,e){const n=r=>zqe({...t,hash:r});return{...n(e),create:n}}const Tae={p:BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff"),n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),h:BigInt(1),a:BigInt("0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc"),b:BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),Gy:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5")},Lae={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff"),n:BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973"),h:BigInt(1),a:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffc"),b:BigInt("0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef"),Gx:BigInt("0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7"),Gy:BigInt("0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f")},$ae={p:BigInt("0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),n:BigInt("0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409"),h:BigInt(1),a:BigInt("0x1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc"),b:BigInt("0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00"),Gx:BigInt("0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66"),Gy:BigInt("0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650")},Vqe=q2(Tae.p),Hqe=q2(Lae.p),Wqe=q2($ae.p),qqe=ML({...Tae,Fp:Vqe,lowS:!1},h9);ML({...Lae,Fp:Hqe,lowS:!1},QHe),ML({...$ae,Fp:Wqe,lowS:!1,allowedPrivateKeyLengths:[130,131,132]},XHe);const Zqe=qqe,Iae="base10",Ms="base16",ta="base64pad",i2="base64url",v5="utf8",Nae=0,Au=1,_5=2,Kqe=0,uq=1,Bg=12,eP=32;function Gqe(){const t=RL.utils.randomPrivateKey(),e=RL.getPublicKey(t);return{privateKey:ca(t,Ms),publicKey:ca(e,Ms)}}function DL(){const t=Yf(eP);return ca(t,Ms)}function Yqe(t,e){const n=RL.getSharedSecret(Eo(t,Ms),Eo(e,Ms)),r=aqe(p9,n,void 0,void 0,eP);return ca(r,Ms)}function Fw(t){const e=p9(Eo(t,Ms));return ca(e,Ms)}function vo(t){const e=p9(Eo(t,v5));return ca(e,Ms)}function Oae(t){return Eo(`${t}`,Iae)}function If(t){return Number(ca(t,Iae))}function Pae(t){return t.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Rae(t){const e=t.replace(/-/g,"+").replace(/_/g,"/"),n=(4-e.length%4)%4;return e+"=".repeat(n)}function Jqe(t){const e=Oae(typeof t.type<"u"?t.type:Nae);if(If(e)===Au&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const n=typeof t.senderPublicKey<"u"?Eo(t.senderPublicKey,Ms):void 0,r=typeof t.iv<"u"?Eo(t.iv,Ms):Yf(Bg),i=Eo(t.symKey,Ms),s=oae(i,r).encrypt
549(Eo(t.message,v5)),a=jae({type:e,sealed:s,iv:r,senderPublicKey:n});return t.encoding===i2?Pae(a):a}function Xqe(t){const e=Eo(t.symKey,Ms),{sealed:n,iv:r}=w6({encoded:t.encoded,encoding:t.encoding}),i=oae(e,r).decrypt(n);if(i===null)throw new Error("Failed to decrypt");return ca(i,v5)}function Qqe(t,e){const n=Oae(_5),r=Yf(Bg),i=Eo(t,v5),s=jae({type:n,sealed:i,iv:r});return e===i2?Pae(s):s}function eZe(t,e){const{sealed:n}=w6({encoded:t,encoding:e});return ca(n,v5)}function jae(t){if(If(t.type)===_5)return ca(Ug([t.type,t.sealed]),ta);if(If(t.type)===Au){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return ca(Ug([t.type,t.senderPublicKey,t.iv,t.sealed]),ta)}return ca(Ug([t.type,t.iv,t.sealed]),ta)}function w6(t){const e=(t.encoding||ta)===i2?Rae(t.encoded):t.encoded,n=Eo(e,ta),r=n.slice(Kqe,uq),i=uq;if(If(r)===Au){const l=i+eP,u=l+Bg,f=n.slice(i,l),p=n.slice(l,u),y=n.slice(u);return{type:r,sealed:y,iv:p,senderPublicKey:f}}if(If(r)===_5){const l=n.slice(i),u=Yf(Bg);return{type:r,sealed:l,iv:u}}const s=i+Bg,a=n.slice(i,s),o=n.slice(s);return{type:r,sealed:o,iv:a}}function tZe(t,e){const n=w6({encoded:t,encoding:e==null?void 0:e.encoding});return Mae({type:If(n.type),senderPublicKey:typeof n.senderPublicKey<"u"?ca(n.senderPublicKey,Ms):void 0,receiverPublicKey:e==null?void 0:e.receiverPublicKey})}function Mae(t){const e=(t==null?void 0:t.type)||Nae;if(e===Au){if(typeof(t==null?void 0:t.senderPublicKey)>"u")throw new Error("missing sender public key");if(typeof(t==null?void 0:t.receiverPublicKey)>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:t==null?void 0:t.senderPublicKey,receiverPublicKey:t==null?void 0:t.receiverPublicKey}}function dq(t){return t.type===Au&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}function hq(t){return t.type===_5}function nZe(t){const e=Buffer.from(t.x,"base64"),n=Buffer.from(t.y,"base64");
vendor: 1,511 bytes, line 549
549return Ug([new Uint8Array([4]),e,n])}function rZe(t,e){const[n,r,i]=t.split("."),s=Buffer.from(Rae(i),"base64");if(s.length!==64)throw new Error("Invalid signature length");const a=s.slice(0,32),o=s.slice(32,64),l=`${n}.${r}`,u=p9(l),f=nZe(e);if(!Zqe.verify(Ug([a,o]),u,f))throw new Error("Invalid signature");return EL(t).payload}const iZe="irn";function vv(t){return(t==null?void 0:t.relay)||{protocol:iZe}}function N0(t){const e=pVe[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var sZe=Object.defineProperty,aZe=Object.defineProperties,oZe=Object.getOwnPropertyDescriptors,fq=Object.getOwnPropertySymbols,lZe=Object.prototype.hasOwnProperty,cZe=Object.prototype.propertyIsEnumerable,pq=(t,e,n)=>e in t?sZe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,LS=(t,e)=>{for(var n in e||(e={}))lZe.call(e,n)&&pq(t,n,e[n]);if(fq)for(var n of fq(e))cZe.call(e,n)&&pq(t,n,e[n]);return t},uZe=(t,e)=>aZe(t,oZe(e));function dZe(t,e="-"){const n={},r="relay"+e;return Object.keys(t).forEach(i=>{if(i.startsWith(r)){const s=i.replace(r,""),a=t[i];n[s]=a}}),n}function mq(t){if(!t.includes("wc:")){const u=Fse(t);u!=null&&u.includes("wc:")&&(t=u)}t=t.includes("wc://")?t.replace("wc://",""):t,t=t.includes("wc:")?t.replace("wc:",""):t;const e=t.indexOf(":"),n=t.indexOf("?")!==-1?t.indexOf("?"):void 0,r=t.substring(0,e),i=t.substring(e+1,n).split("@"),s=typeof n<"u"?t.substring(n):"",a=new URLSearchParams(s),o=Object.fromEntries(a.entries()),l=typeof o.methods=="str
549ing"?o.methods.split(","):void 0;return{protocol:r,topic:hZe(i[0]),version:parseInt(i[1],10),symKey:o.symKey,relay:dZe(o),methods:l,expiryTimestamp:o.expiryTimestamp?parseInt(o.expiryTimestamp,10):void 0}}function hZe(t){return t.startsWith("//")?t.substring(2):t}function fZe(t,e="-"){const n="relay",r={};return Object.keys(t).forEach(i=>{const s=i,a=n+e+s;t[s]&&(r[a]=t[s])}),r}function yq(t){const e=new URLSearchParams,n=LS(LS(uZe(LS({},fZe(t.relay)),{symKey:t.symKey}),t.expiryTimestamp&&{expiryTimestamp:t.expiryTimestamp.toString()}),t.methods&&{methods:t.methods.join(",")});return Object.entries(n).sort(([r],[i])=>r.localeCompare(i)).forEach(([r,i])=>{i!==void 0&&e.append(r,String(i))}),`${t.protocol}:${t.topic}@${t.version}?${e}`}function ew(t,e,n){return`${t}?wc_ev=${n}&topic=${e}`}var pZe=Object.defineProperty,mZe=Object.defineProperties,yZe=Object.getOwnPropertyDescriptors,gq=Object.getOwnPropertySymbols,gZe=Object.prototype.hasOwnProperty,bZe=Object.prototype.propertyIsEnumerable,bq=(t,e,n)=>e in t?pZe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,wZe=(t,e)=>{for(var n in e||(e={}))gZe.call(e,n)&&bq(t,n,e[n]);if(gq)for(var n of gq(e))bZe.call(e,n)&&bq(t,n,e[n]);return t},vZe=(t,e)=>mZe(t,yZe(e));function ym(t){const e=[];return t.forEach(n=>{const[r,i]=n.split(":");e.push(`${r}:${i}`)}),e}function _Ze(t){const e=[];return Object.values(t).forEach(n=>{e.push(...ym(n.accounts))}),e}function xZe(t,e){const n=[];return Object.values(t).forEach(r=>{ym(r.accounts).includes(e)&&n.push(...r.methods)}),n}function CZe(t,e){const n=[];return Object.values(t).forEach(r=>{ym(r.accounts).includes(e)&&n.push(...r.events)}),n}function g9(t){return t.includes(":")}function O0(t){return g9(t)?t.split(":")[0]:t}function wq(t){var e,n,r;const i={};if(!nc(t))return i;for(const[s,a]of Object.entries(t)){const o=g9(s)?[s]:a.chains,l=a.methods||[],u=a.events||[],f=O0(s);i[f]=vZe(wZe({},i[f]),{chains:tc(o,(e=i[f])==null?void 0:e.chains),methods:tc(l,(n=i[f])==null?void 0:n.methods),events:tc(u,(r=i[f])==null?void 0:r.events)})}return i}function EZe(t){const e={};return t==null||t.forEach(n=>{var r;const[i,s]=n.split(":");e[i]||(e[i]={accounts:[],chains:[],events:[],methods:[]}),e[i].accounts.push(n),(r=e[i].chains)==null||r.push(`${i}:${s}`)}),e}function vq(t,e){e=e.map(r=>r.replace("did:pkh:",""));const n=EZe(e);for(const[r,i]of Object.entries(n))i.methods?i.methods=tc(i.methods,t):i.methods=t,i.events=["chainChanged","accountsChanged"];return n}function SZe(t,e){var n,r,i,s,a,o;const l=wq(t),u=wq(e),f={},p=Object.keys(l).concat(Object.keys(u));for(const y of p)f[y]={chains:tc((n=l[y])==null?void 0:n.chains,(r=u[y])==null?void 0:r.chains),methods:tc((i=l[y])==null?void 0:i.methods,(s=u[y])==null?void 0:s.methods),events:tc((a=l[y])==null?void 0:a.events,(o=u[y])==null?void 0:o.events)};return f}const AZe={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},kZe={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};
vendor: 29,491 bytes, lines 549-568
549function We(t,e){const{message:n,code:r}=kZe[t];return{message:e?`${n} ${e}`:n,code:r}}function Er(t,e){const{message:n,code:r}=AZe[t];return{message:e?`${n} ${e}`:n,code:r}}function To(t,e){return!!Array.isArray(t)}function nc(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function Ii(t){return typeof t>"u"}function gi(t,e){return e&&Ii(t)?!0:typeof t=="string"&&!!t.trim().length}function tP(t,e){return e&&Ii(t)?!0:typeof t=="number"&&!isNaN(t)}function TZe(t,e){const{requiredNamespaces:n}=e,r=Object.keys(t.namespaces),i=Object.keys(n);let s=!0;return Jh(i,r)?(r.forEach(a=>{const{accounts:o,methods:l,events:u}=t.namespaces[a],f=ym(o),p=n[a];(!Jh(jse(a,p),f)||!Jh(p.methods,l)||!Jh(p.events,u))&&(s=!1)}),s):!1}function _v(t){return gi(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function LZe(t){if(gi(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const n=e[0]+":"+e[1];return!!e[2]&&_v(n)}}return!1}function $Ze(t){function e(n){try{return typeof new URL(n)<"u"}catch{return!1}}try{if(gi(t,!1)){if(e(t))return!0;const n=Fse(t);return e(n)}}catch{}return!1}function IZe(t){var e;return(e=t==null?void 0:t.proposer)==null?void 0:e.publicKey}function NZe(t){return t==null?void 0:t.topic}function OZe(t,e){let n=null;return gi(t==null?void 0:t.publicKey,!1)||(n=We("MISSING_OR_INVALID",`${e} controller public key should be a string`)),n}function _q(t){let e=!0;return To(t)?t.length&&(e=t.every(n=>gi(n,!1))):e=!1,e}function PZe(t,e,n){let r=null;return To(e)&&e.length?e.forEach(i=>{r||_v(i)||(r=Er("UNSUPPORTED_CHAINS",`${n}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):_v(t)||(r=Er("UNSUPPORTED_CHAINS",`${n}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),r}function RZe(t,e,n){let r=null;return Object.entries(t).forEach(([i,s])=>{if(r)return;const a=PZe(i,jse(i,s),`${e} ${n}`);a&&(r=a)}),r}function jZe(t,e){let n=null;return To(t)?t.forEach(r=>{n||LZe(r)||(n=Er("UNSUPPORTED_ACCOUNTS",`${e}, account ${r} should be a string and conform to "namespace:chainId:address" format`))}):n=Er("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),n}function MZe(t,e){let n=null;return Object.values(t).forEach(r=>{if(n)return;const i=jZe(r==null?void 0:r.accounts,`${e} namespace`);i&&(n=i)}),n}function DZe(t,e){let n=null;return _q(t==null?void 0:t.methods)?_q(t==null?void 0:t.events)||(n=Er("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):n=Er("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),n}function Dae(t,e){let n=null;return Object.values(t).forEach(r=>{if(n)return;const i=DZe(r,`${e}, namespace`);i&&(n=i)}),n}function UZe(t,e,n){let r=null;if(t&&nc(t)){const i=Dae(t,e);i&&(r=i);const s=RZe(t,e,n);s&&(r=s)}else r=We("MISSING_OR_INVALID",`${e}, ${n} should be an object with data`);return r}function $S(t,e){let n=null;if(t&&nc(t)){const r=Dae(t,e);r&&(n=r);const i=MZe(t,e);i&&(n=i)}else n=We("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return n}function Uae(t){return gi(t.protocol,!0)}function BZe(t,e){let n=!1;return t?t&&To(t)&&t.length&&t.forEach(r=>{n=Uae(r)}):n=!0,n}function FZe(t){return typeof t=="number"}function Js(t){return typeof t<"u"&&typeof t!==null}function zZe(t){return!(!t||typeof t!="object"||!t.code||!tP(t.code,!1)||!t.message||!gi(t.message,!1))}function VZe(t){return!(Ii(t)||!gi(t.method,!1))}function HZe(t){return!(Ii(t)||Ii(t.result)&&Ii(t.error)||!tP(t.id,!1)||!gi(t.jsonrpc,!1))}function WZe(t){return!(Ii(t)||!gi(t.name,!1))}function xq(t,e){return!(!_v(e)||!_Ze(t).includes(e))}function qZe(t,e,n){return gi(n,!1)?xZe(t,e).includes(n):!1}function ZZe(t,e,n){return gi(n,!1)?CZe(t,e).includes(n):!1}function Cq(t,e,n){let r=null;const i=KZe(t),s=GZe(e),a=Object.keys(i),o=Object.keys(s),l=Eq(Object.keys(t)),u=Eq(Object.keys(e)),f=l.filter(p=>!u.includes(p));return f.length&&(r=We("NON_CONFORMING_NAMESPACES",`${n} namespaces keys don't satisfy requiredNamespaces. 550 Required: ${f.toString()} 551 Received: ${Object.keys(e).toString()}`)),Jh(a,o)||(r=We("NON_CONFORMING_NAMESPACES",`${n} namespaces chains don't satisfy required namespaces. 552 Required: ${a.toString()} 553 Approved: ${o.toString()}`)),Object.keys(e).forEach(p=>{if(!p.includes(":")||r)return;const y=ym(e[p].accounts);y.includes(p)||(r=We("NON_CONFORMING_NAMESPACES",`${n} namespaces accounts don't satisfy namespace accounts for ${p} 554 Required: ${p} 555 Approved: ${y.toString()}`))}),a.forEach(p=>{r||(Jh(i[p].methods,s[p].methods)?Jh(i[p].events,s[p].events)||(r=We("NON_CONFORMING_NAMESPACES",`${n} namespaces events don't satisfy namespace events for ${p}`)):r=We("NON_CONFORMING_NAMESPACES",`${n} namespaces methods don't satisfy namespace methods for ${p}`))}),r}function KZe(t){const e={};return Object.keys(t).forEach(n=>{var r;n.includes(":")?e[n]=t[n]:(r=t[n].chains)==null||r.forEach(i=>{e[i]={methods:t[n].methods,events:t[n].events}})}),e}function Eq(t){return[...new Set(t.map(e=>e.includes(":")?e.split(":")[0]:e))]}function GZe(t){const e={};return Object.keys(t).forEach(n=>{if(n.includes(":"))e[n]=t[n];else{const r=ym(t[n].accounts);r==null||r.forEach(i=>{e[i]={accounts:t[n].accounts.filter(s=>s.includes(`${i}:`)),methods:t[n].methods,events:t[n].events}})}}),e}function YZe(t,e){return tP(t,!1)&&t<=e.max&&t>=e.min}function Sq(){const t=g5();return new Promise(e=>{switch(t){case Fa.browser:e(JZe());break;case Fa.reactNative:e(XZe());break;case Fa.node:e(QZe());break;default:e(!0)}})}function JZe(){return mm()&&(navigator==null?void 0:navigator.onLine)}async function XZe(){if(W2()&&typeof global<"u"&&global!=null&&global.NetInfo){const t=await(global==null?void 0:global.NetInfo.fetch());return t==null?void 0:t.isConnected}return!0}function QZe(){return!0}function eKe(t){switch(g5()){case Fa.browser:tKe(t);break;case Fa.reactNative:nKe(t);break}}function tKe(t){!W2()&&mm()&&(window.addEventListener("online",()=>t(!0)),window.addEventListener("offline",()=>t(!1)))}function nKe(t){W2()&&typeof global<"u"&&global!=null&&global.NetInfo&&(global==null||global.NetInfo.addEventListener(e=>t(e==null?void 0:e.isConnected)))}function rKe(){var t;return mm()&&Ru.getDocument()?((t=Ru.getDocument())==null?void 0:t.visibilityState)==="visible":!0}const IS={};class Wy{static get(e){return IS[e]}static set(e,n){IS[e]=n}static delete(e){delete IS[e]}}function iKe(t){const e=p5.decode(t);if(e.length<33)throw new Error("Too short to contain a public key");return e.slice(1,33)}function sKe({publicKey:t,signature:e,payload:n}){var r;const i=UL(n.method),s=128|parseInt(((r=n.version)==null?void 0:r.toString())||"4"),a=lKe(n.address),o=n.era==="00"?new Uint8Array([0]):UL(n.era);if(o.length!==1&&o.length!==2)throw new Error("Invalid era length");const l=parseInt(n.nonce,16),u=new Uint8Array([l&255,l>>8&255]),f=BigInt(`0x${oKe(n.tip)}`),p=uKe(f),y=new Uint8Array([0,...t,a,...e,...o,...u,...p,...i]),g=cKe(y.length+1);return new Uint8Array([...g,s,...y])}function aKe(t){const e=UL(t),n=bVe.blake2b(e,void 0,32);return"0x"+Buffer.from(n).toString("hex")}function UL(t){return new Uint8Array(t.replace(/^0x/,"").match(/.{1,2}/g).map(e=>parseInt(e,16)))}function oKe(t){return t.startsWith("0x")?t.slice(2):t}function lKe(t){const e=p5.decode(t)[0];return e===42?0:e===60?2:1}function cKe(t){if(t<64)return new Uint8Array([t<<2]);if(t<16384){const e=t<<2|1;return new Uint8Array([e&255,e>>8&255])}else if(t<1<<30){const e=t<<2|2;return new Uint8Array([e&255,e>>8&255,e>>16&255,e>>24&255])}else throw new Error("Compact encoding > 2^30 not supported")}function uKe(t){if(t<BigInt(1)<<BigInt(6))return new Uint8Array([Number(t<<BigInt(2))]);if(t<BigInt(1)<<BigInt(14)){const e=t<<BigInt(2)|BigInt(1);return new Uint8Array([Number(e&BigInt(255)),Number(e>>BigInt(8)&BigInt(255))])}else if(t<BigInt(1)<<BigInt(30)){const e=t<<BigInt(2)|BigInt(2);return new Uint8Array([Number(e&BigInt(255)),Number(e>>BigInt(8)&BigInt(255)),Number(e>>BigInt(16)&BigInt(255)),Number(e>>BigInt(24)&BigInt(255))])}else throw new Error("BigInt compact encoding not supported > 2^30")}function dKe(t){const e=Uint8Array.from(Buffer.from(t.signature,"hex")),n=iKe(t.transaction.address),r=sKe({publicKey:n,signature:e,payload:t.transaction}),i=Buffer.from(r).toString("hex");return aKe(i)}function nP({logger:t,name:e}){const n=typeof t=="string"?Rse({opts:{level:t,name:e}}).logger:t;return n.level=typeof t=="string"?t:t.level,n}class Jf{}let hKe=class extends Jf{constructor(e){super()}};const Aq=qe.FIVE_SECONDS,Xf={pulse:"heartbeat_pulse"};let fKe=class Bae extends hKe{constructor(e){super(e),this.events=new Za.EventEmitter,this.interval=Aq,this.interval=(e==null?void 0:e.interval)||Aq}static async init(e){const n=new Bae(e);return await n.init(),n}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(e,n){this.events.on(e,n)}once(e,n){this.events.once(e,n)}off(e,n){this.events.off(e,n)}removeListener(e,n){this.events.removeListener(e,n)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),qe.toMiliseconds(this.interval))}pulse(){this.events.emit(Xf.pulse)}};function pKe(t){return!t||typeof t.then!="function"?Promise.resolve(t):t}function Bi(t,...e){try{return pKe(t(...e))}catch(n){return Promise.reject(n)}}function mKe(t){const e=typeof t;return t===null||e!=="object"&&e!=="function"}function yKe(t){const e=Object.getPrototypeOf(t);return!e||e.isPrototypeOf(Object)}function zw(t){if(mKe(t))return String(t);if(yKe(t)||Array.isArray(t))return JSON.stringify(t);if(typeof t.toJSON=="function")return zw(t.toJSON());throw new Error("[unstorage] Cannot stringify value!")}const BL="base64:";function gKe(t){return typeof t=="string"?t:BL+vKe(t)}function bKe(t){return typeof t!="string"||!t.startsWith(BL)?t:wKe(t.slice(BL.length))}function wKe(t){return globalThis.Buffer?Buffer.from(t,"base64"):Uint8Array.from(globalThis.atob(t),e=>e.codePointAt(0))}function vKe(t){return globalThis.Buffer?Buffer.from(t).toString("base64"):globalThis.btoa(String.fromCodePoint(...t))}function Ys(t){var e;return t&&((e=t.split("?")[0])==null?void 0:e.replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""))||""}function _Ke(...t){return Ys(t.join(":"))}function tw(t){return t=Ys(t),t?t+":":""}function xKe(t,e){if(e===void 0)return!0;let n=0,r=t.indexOf(":");for(;r>-1;)n++,r=t.indexOf(":",r+1);return n<=e}function CKe(t,e){return e?t.startsWith(e)&&t[t.length-1]!=="$":t[t.length-1]!=="$"}const EKe="memory",SKe=()=>{const t=new Map;return{name:EKe,getInstance:()=>t,hasItem(e){return t.has(e)},getItem(e){return t.get(e)??null},getItemRaw(e){return t.get(e)??null},setItem(e,n){t.set(e,n)},setItemRaw(e,n){t.set(e,n)},removeItem(e){t.delete(e)},getKeys(){return[...t.keys()]},clear(){t.clear()},dispose(){t.clear()}}};function AKe(t={}){const e={mounts:{"":t.driver||SKe()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},n=u=>{for(const f of e.mountpoints)if(u.startsWith(f))return{base:f,relativeKey:u.slice(f.length),driver:e.mounts[f]};return{base:"",relativeKey:u,driver:e.mounts[""]}},r=(u,f)=>e.mountpoints.filter(p=>p.startsWith(u)||f&&u.startsWith(p)).map(p=>({relativeBase:u.length>p.length?u.slice(p.length):void 0,mountpoint:p,driver:e.mounts[p]})),i=(u,f)=>{if(e.watching){f=Ys(f);for(const p of e.watchListeners)p(u,f)}},s=async()=>{if(!e.watching){e.watching=!0;for(const u in e.mounts)e.unwatch[u]=await kq(e.mounts[u],i,u)}},a=async()=>{if(e.watching){for(const u in e.unwatch)await e.unwatch[u]();e.unwatch={},e.watching=!1}},o=(u,f,p)=>{const y=new Map,g=b=>{let v=y.get(b.base);return v||(v={driver:b.driver,base:b.base,items:[]},y.set(b.base,v)),v};for(const b of u){const v=typeof b=="string",_=Ys(v?b:b.key),C=v?void 0:b.value,S=v||!b.options?f:{...f,...b.options},x=n(_);g(x).items.push({key:_,value:C,relativeKey:x.relativeKey,options:S})}return Promise.all([...y.values()].map(b=>p(b))).then(b=>b.flat())},l={hasItem(u,f={}){u=Ys(u);const{relativeKey:p,driver:y}=n(u);return Bi(y.hasItem,p,f)},getItem(u,f={}){u=Ys(u);const{relativeKey:p,driver:y}=n(u);return Bi(y.getItem,p,f).then(g=>fg(g))},getItems(u,f={}){return o(u,f,p=>p.driver.getItems?Bi(p.driver.getItems,p.items.map(y=>({key:y.relativeKey,options:y.options})),f).then(y=>y.map(g=>({key:_Ke(p.base,g.key),value:fg(g.value)}))):Promise.all(p.items.map(y=>Bi(p.driver.getItem,y.relativeKey,y.options).then(g=>({key:y.key,value:fg(g)})))))},getItemRaw(u,f={}){u=Ys(u);const{relativeKey:p,driver:y}=n(u);return y.getItemRaw?Bi(y.getItemRaw,p,f):Bi(y.getItem,p,f).then(g=>bKe(g))},async setItem(u,f,p={}){if(f===void 0)return l.removeItem(u);u=Ys(u);const{relativeKey:y,driver:g}=n(u);g.setItem&&(await Bi(g.setItem,y,zw(f),p),g.watch||i("update",u))},async setItems(u,f){await o(u,f,async p=>{if(p.driver.setItems)return Bi(p.driver.setItems,p.items.map(y=>({key:y.relativeKey,value:zw(y.value),options:y.options})),f);p.driver.setItem&&await Promise.all(p.items.map(y=>Bi(p.driver.setItem,y.relativeKey,zw(y.value),y.options)))})},async setItemRaw(u,f,p={}){if(f===void 0)return l.removeItem(u,p);u=Ys(u);const{relativeKey:y,driver:g}=n(u);if(g.setItemRaw)await Bi(g.setItemRaw,y,f,p);else if(g.setItem)await Bi(g.setItem,y,gKe(f),p);else return;g.watch||i("update",u)},async removeItem(u,f={}){typeof f=="boolean"&&(f={removeMeta:f}),u=Ys(u);const{relativeKey:p,driver:y}=n(u);y.removeItem&&(await Bi(y.removeItem,p,f),(f.removeMeta||f.removeMata)&&await Bi(y.removeItem,p+"$",f),y.watch||i("remove",u))},async getMeta(u,f={}){typeof f=="boolean"&&(f={nativeOnly:f}),u=Ys(u);const{relativeKey:p,driver:y}=n(u),g=Object.create(null);if(y.getMeta&&Object.assign(g,await Bi(y.getMeta,p,f)),!f.nativeOnly){const b=await Bi(y.getItem,p+"$",f).then(v=>fg(v));b&&typeof b=="object"&&(typeof b.atime=="string"&&(b.atime=new Date(b.atime)),typeof b.mtime=="string"&&(b.mtime=new Date(b.mtime)),Object.assign(g,b))}return g},setMeta(u,f,p={}){return this.setItem(u+"$",f,p)},removeMeta(u,f={}){return this.removeItem(u+"$",f)},async getKeys(u,f={}){var _;u=tw(u);const p=r(u,!0);let y=[];const g=[];let b=!0;for(const C of p){(_=C.driver.flags)!=null&&_.maxDepth||(b=!1);const S=await Bi(C.driver.getKeys,C.relativeBase,f);for(const x of S){const A=C.mountpoint+Ys(x);y.some(I=>A.startsWith(I))||g.push(A)}y=[C.mountpoint,...y.filter(x=>!x.startsWith(C.mountpoint))]}const v=f.maxDepth!==void 0&&!b;return g.filter(C=>(!v||xKe(C,f.maxDepth))&&CKe(C,u))},async clear(u,f={}){u=tw(u),await Promise.all(r(u,!1).map(async p=>{if(p.driver.clear)return Bi(p.driver.clear,p.relativeBase,f);if(p.driver.removeItem){const y=await p.driver.getKeys(p.relativeBase||"",f);return Promise.all(y.map(g=>p.driver.removeItem(g,f)))}}))},async dispose(){await Promise.all(Object.values(e.mounts).map(u=>Tq(u)))},async watch(u){return await s(),e.watchListeners.push(u),async()=>{e.watchListeners=e.watchListeners.filter(f=>f!==u),e.watchListeners.length===0&&await a()}},async unwatch(){e.watchListeners=[],await a()},mount(u,f){if(u=tw(u),u&&e.mounts[u])throw new Error(`already mounted at ${u}`);return u&&(e.mountpoints.push(u),e.mountpoints.sort((p,y)=>y.length-p.length)),e.mounts[u]=f,e.watching&&Promise.resolve(kq(f,i,u)).then(p=>{e.unwatch[u]=p}).catch(console.error),l},async unmount(u,f=!0){var p,y;u=tw(u),!(!u||!e.mounts[u])&&(e.watching&&u in e.unwatch&&((y=(p=e.unwatch)[u])==null||y.call(p),delete e.unwatch[u]),f&&await Tq(e.mounts[u]),e.mountpoints=e.mountpoints.filter(g=>g!==u),delete e.mounts[u])},getMount(u=""){u=Ys(u)+":";const f=n(u);return{driver:f.driver,base:f.base}},getMounts(u="",f={}){return u=Ys(u),r(u,f.parents).map(y=>({driver:y.driver,base:y.mountpoint}))},keys:(u,f={})=>l.getKeys(u,f),get:(u,f={})=>l.getItem(u,f),set:(u,f,p={})=>l.setItem(u,f,p),has:(u,f={})=>l.hasItem(u,f),del:(u,f={})=>l.removeItem(u,f),remove:(u,f={})=>l.removeItem(u,f)};return l}function kq(t,e,n){return t.watch?t.watch((r,i)=>e(r,n+i)):()=>{}}async function Tq(t){typeof t.dispose=="function"&&await Bi(t.dispose)}function Qf(t){return new Promise((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)})}function Fae(t,e){const n=indexedDB.open(t);n.onupgradeneeded=()=>n.result.createObjectStore(e);const r=Qf(n);return(i,s)=>r.then(a=>s(a.transaction(e,i).objectStore(e)))}let NS;function x5(){return NS||(NS=Fae("keyval-store","keyval")),NS}function Lq(t,e=x5()){return e("readonly",n=>Qf(n.get(t)))}function kKe(t,e,n=x5()){return n("readwrite",r=>(r.put(e,t),Qf(r.transaction)))}function TKe(t,e=x5()){return e("readwrite",n=>(n.delete(t),Qf(n.transaction)))}function LKe(t=x5()){return t("readwrite",e=>(e.clear(),Qf(e.transaction)))}function $Ke(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},Qf(t.transaction)}function IKe(t=x5()){return t("readonly",e=>{if(e.getAllKeys)return Qf(e.getAllKeys());const n=[];return $Ke(e,r=>n.push(r.key)).then(()=>n)})}const NKe="idb-keyval";var OKe=(t={})=>{const e=t.base&&t.base.length>0?`${t.base}:`:"",n=i=>e+i;let r;return t.dbName&&t.storeName&&(r=Fae(t.dbName,t.storeName)),{name:NKe,options:t,async hasItem(i){return!(typeof await Lq(n(i),r)>"u")},async getItem(i){return await Lq(n(i),r)??null},setItem(i,s){return kKe(n(i),s,r)},removeItem(i){return TKe(n(i),r)},getKeys(){return IKe(r)},clear(){return LKe(r)}}};const PKe="WALLET_CONNECT_V2_INDEXED_DB",RKe="keyvaluestorage";let jKe=class{constructor(){this.indexedDb=AKe({driver:OKe({dbName:PKe,storeName:RKe})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){const n=await this.indexedDb.getItem(e);if(n!==null)return n}async setItem(e,n){await this.indexedDb.setItem(e,ju(n))}async removeItem(e){await this.indexedDb.removeItem(e)}};var OS=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Vw={exports:{}};(function(){let t;function e(){}t=e,t.prototype.getItem=function(n){return this.hasOwnProperty(n)?String(this[n]):null},t.prototype.setItem=function(n,r){this[n]=String(r)},t.prototype.removeItem=function(n){delete this[n]},t.prototype.clear=function(){const n=this;Object.keys(n).forEach(function(r){n[r]=void 0,delete n[r]})},t.prototype.key=function(n){return n=n||0,Object.keys(this)[n]},t.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof OS<"u"&&OS.localStorage?Vw.exports=OS.localStorage:typeof window<"u"&&window.localStorage?Vw.exports=window.localStorage:Vw.exports=new e})();function MKe(t){var e;return[t[0],Lf((e=t[1])!=null?e:"")]}let DKe=class{constructor(){this.localStorage=Vw.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(MKe)}async getItem(e){const n=this.localStorage.getItem(e);if(n!==null)return Lf(n)}async setItem(e,n){this.localStorage.setItem(e,ju(n))}async removeItem(e){this.localStorage.removeItem(e)}};const UKe="wc_storage_version",$q=1,BKe=async(t,e,n)=>{const r=UKe,i=await e.getItem(r);if(i&&i>=$q){n(e);return}const s=await t.getKeys();if(!s.length){n(e);return}const a=[];for(;s.length;){const o=s.shift();if(!o)continue;const l=o.toLowerCase();if(l.includes("wc@")||l.includes("walletconnect")||l.includes("wc_")||l.includes("wallet_connect")){const u=await t.getItem(o);await e.setItem(o,u),a.push(o)}}await e.setItem(r,$q),n(e),FKe(t,a)},FKe=async(t,e)=>{e.length&&e.forEach(async n=>{await t.removeItem(n)})};let zKe=class{constructor(){this.initialized=!1,this.setInitialized=n=>{this.storage=n,this.initialized=!0};const e=new DKe;this.storage=e;try{const n=new jKe;BKe(e,n,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,n){return await this.initialize(),this.storage.setItem(e,n)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{const n=setInterval(()=>{this.initialized&&(clearInterval(n),e())},20)})}};var VKe=Object.defineProperty,HKe=(t,e,n)=>e in t?VKe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Iq=(t,e,n)=>HKe(t,typeof e!="symbol"?e+"":e,n);let WKe=class extends Jf{constructor(e){super(),this.opts=e,Iq(this,"protocol","wc"),Iq(this,"version",2)}};var qKe=Object.defineProperty,ZKe=(t,e,n)=>e in t?qKe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,KKe=(t,e,n)=>ZKe(t,e+"",n);let GKe=class extends Jf{constructor(e,n){super(),this.core=e,this.logger=n,KKe(this,"records",new Map)}},YKe=class{constructor(e,n){this.logger=e,this.core=n}},JKe=class extends Jf{constructor(e,n){super(),this.relayer=e,this.logger=n}},XKe=class extends Jf{constructor(e){super()}},QKe=class{constructor(e,n,r,i){this.core=e,this.logger=n,this.name=r}},eGe=class extends Jf{constructor(e,n){super(),this.relayer=e,this.logger=n}},tGe=class extends Jf{constructor(e,n){super(),this.core=e,this.logger=n}},nGe=class{constructor(e,n,r){this.core=e,this.logger=n,this.store=r}},rGe=class{constructor(e,n){this.projectId=e,this.logger=n}},iGe=class{constructor(e,n,r){this.core=e,this.logger=n,this.telemetryEnabled=r}};var sGe=Object.defineProperty,aGe=(t,e,n)=>e in t?sGe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Nq=(t,e,n)=>aGe(t,typeof e!="symbol"?e+"":e,n);let oGe=class{constructor(e){this.opts=e,Nq(this,"protocol","wc"),Nq(this,"version",2)}},lGe=class{constructor(e){this.client=e}};const cGe="PARSE_ERROR",uGe="INVALID_REQUEST",dGe="METHOD_NOT_FOUND",hGe="INVALID_PARAMS",zae="INTERNAL_ERROR",rP="SERVER_ERROR",fGe=[-32700,-32600,-32601,-32602,-32603],Fg={[cGe]:{code:-32700,message:"Parse error"},[uGe]:{code:-32600,message:"Invalid Request"},[dGe]:{code:-32601,message:"Method not found"},[hGe]:{code:-32602,message:"Invalid params"},[zae]:{code:-32603,message:"Internal error"},[rP]:{code:-32e3,message:"Server error"}},Vae=rP;function pGe(t){return fGe.includes(t)}function Oq(t){return Object.keys(Fg).includes(t)?Fg[t]:Fg[Vae]}function mGe(t){const e=Object.values(Fg).find(n=>n.code===t);return e||Fg[Vae]}function Hae(t,e,n){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${n} RPC url at ${e}`):t}var PS={};/*! ***************************************************************************** 556Copyright (c) Microsoft Corporation. 557 558Permission to use, copy, modify, and/or distribute this software for any 559purpose with or without fee is hereby granted. 560 561THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 562REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 563AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 564INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 565LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 566OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 567PERFORMANCE OF THIS SOFTWARE. 568***************************************************************************** */var FL=function(t,e){return FL=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)r.hasOwnProperty(i)&&(n[i]=r[i])},FL(t,e)};function yGe(t,e){FL(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var zL=function(){return zL=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},zL.apply(this,arguments)};function gGe(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function bGe(t,e,n,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,n,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(s=(i<3?a(s):i>3?a(e,n,s):a(e,n))||s);return i>3&&s&&Object.defineProperty(e,n,s),s}function wGe(t,e){return function(n,r){e(n,r,t)}}function vGe(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function _Ge(t,e,n,r){function i(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function o(f){try{u(r.next(f))}catch(p){a(p)}}function l(f){try{u(r.throw(f))}catch(p){a(p)}}function u(f){f.done?s(f.value):i(f.value).then(o,l)}u((r=r.apply(t,e||[])).next())})}function xGe(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(u){return function(f){return l([u,f])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(t,n)}catch(f){u=[6,f],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function CGe(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}function EGe(t,e){for(var n in t)n!=="default"&&!e.hasOwnProperty(n)&&(e[n]=t[n])}function VL(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Wae(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(o){a={error:o}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return s}function SGe(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Wae(arguments[e]));return t}function AGe(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;for(var r=Array(t),i=0,e=0;e<n;e++)for(var s=arguments[e],a=0,o=s.length;a<o;a++,i++)r[i]=s[a];return r}function v6(t){return this instanceof v6?(this.v=t,this):new v6(t)}function kGe(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,s=[];return i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i;function a(y){r[y]&&(i[y]=function(g){return new Promise(function(b,v){s.push([y,g,b,v])>1||o(y,g)})})}function o(y,g){try{l(r[y](g))}catch(b){p(s[0][3],b)}}function l(y){y.value instanceof v6?Promise.resolve(y.value.v).then(u,f):p(s[0][2],y)}function u(y){o("next",y)}function f(y){o("throw",y)}function p(y,g){y(g),s.shift(),s.length&&o(s[0][0],s[0][1])}}function TGe(t){var e,n;return e={},r("next"),r("throw",function(i){throw i}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(i,s){e[i]=t[i]?function(a){return(n=!n)?{value:v6(t[i](a)),done:i==="return"}:s?s(a):a}:s}}function LGe(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof VL=="function"?VL(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(s){n[s]=t[s]&&function(a){return new Promise(function(o,l){a=t[s](a),i(o,l,a.done,a.value)})}}function i(s,a,o,l){Promise.resolve(l).then(function(u){s({value:u,done:o})},a)}}function $Ge(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function IGe(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function NGe(t){return t&&t.__esModule?t:{default:t}}function OGe(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function PGe(t,e,n){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,n),n}const RGe=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return zL},__asyncDelegator:TGe,__asyncGenerator:kGe,__asyncValues:LGe,__await:v6,__awaiter:_Ge,__classPrivateFieldGet:OGe,__classPrivateFieldSet:PGe,__createBinding:CGe,__decorate:bGe,__exportStar:EGe,__extends:yGe,__generator:xGe,__importDefault:NGe,__importStar:IGe,__makeTemplateOb
568ject:$Ge,__metadata:vGe,__param:wGe,__read:Wae,__rest:gGe,__spread:SGe,__spreadArrays:AGe,__values:VL},Symbol.toStringTag,{value:"Module"})),jGe=AY(RGe);var Jc={},Pq;function MGe(){if(Pq)return Jc;Pq=1,Object.defineProperty(Jc,"__esModule",{value:!0}),Jc.isBrowserCryptoAvailable=Jc.getSubtleCrypto=Jc.getBrowerCrypto=void 0;function t(){return(ql==null?void 0:ql.crypto)||(ql==null?void 0:ql.msCrypto)||{}}Jc.getBrowerCrypto=t;function e(){const r=t();return r.subtle||r.webkitSubtle}Jc.getSubtleCrypto=e;function n(){return!!t()&&!!e()}return Jc.isBrowserCryptoAvailable=n,Jc}var Xc={},Rq;function DGe(){if(Rq)return Xc;Rq=1,Object.defineProperty(Xc,"__esModule",{value:!0}),Xc.isBrowser=Xc.isNode=Xc.isReactNative=void 0;function t(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}Xc.isReactNative=t;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}Xc.isNode=e;function n(){return!t()&&!e()}return Xc.isBrowser=n,Xc}var jq;function UGe(){return jq||(jq=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=jGe;
vendor: 17,831 bytes, line 568
568e.__exportStar(MGe(),t),e.__exportStar(DGe(),t)})(PS)),PS}var BGe=UGe();function Hl(t=3){const e=Date.now()*Math.pow(10,t),n=Math.floor(Math.random()*Math.pow(10,t));return e+n}function f2(t=6){return BigInt(Hl(t))}function ul(t,e,n){return{id:n||Hl(),jsonrpc:"2.0",method:t,params:e}}function _6(t,e){return{id:t,jsonrpc:"2.0",result:e}}function b9(t,e,n){return{id:t,jsonrpc:"2.0",error:FGe(e)}}function FGe(t,e){return typeof t>"u"?Oq(zae):(typeof t=="string"&&(t=Object.assign(Object.assign({},Oq(rP)),{message:t})),pGe(t.code)&&(t=mGe(t.code)),t)}let zGe=class{},VGe=class extends zGe{constructor(){super()}},HGe=class extends VGe{constructor(e){super()}};const WGe="^https?:",qGe="^wss?:";function ZGe(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function qae(t,e){const n=ZGe(t);return typeof n>"u"?!1:new RegExp(e).test(n)}function Mq(t){return qae(t,WGe)}function Dq(t){return qae(t,qGe)}function KGe(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function Zae(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function iP(t){return Zae(t)&&"method"in t}function w9(t){return Zae(t)&&(Wl(t)||_o(t))}function Wl(t){return"result"in t}function _o(t){return"error"in t}let sP=class extends HGe{constructor(e){super(e),this.events=new Za.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,n){this.events.on(e,n)}once(e,n){this.events.once(e,n)}off(e,n){this.events.off(e,n)}removeListener(e,n){this.events.removeListener(e,n)}async request(e,n){return this.requestStrict(ul(e.method,e.params||[],e.id||f2().toString()),n)}async requestStrict(e,n){return new Promise(async(r,i)=>{if(!this.connection.connected)try{await this.open()}catch(s){i(s)}this.events.on(`${e.id}`,s=>{_o(s)?i(s.error):r(s.result)});try{await this.connection.send(e,n)}catch(s){i(s)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),w9(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}};const GGe=()=>typeof WebSocket<"u"?WebSocket:typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),YGe=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",Uq=t=>t.split("?")[0],Bq=10,JGe=GGe();let XGe=class{constructor(e){if(this.url=e,this.events=new Za.EventEmitter,this.registering=!1,!Dq(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(e,n){this.events.on(e,n)}once(e,n){this.events.once(e,n)}off(e,n){this.events.off(e,n)}removeListener(e,n){this.events.removeListener(e,n)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,n)=>{if(typeof this.socket>"u"){n(new Error("Connection already closed"));return}this.socket.onclose=r=>{this.onClose(r),e()},this.socket.close()})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(ju(e))}catch(n){this.onError(e.id,n)}}register(e=this.url){if(!Dq(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const n=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=n||this.events.listenerCount("open")>=n)&&this.events.setMaxListeners(n+1),new Promise((r,i)=>{this.events.once("register_error",s=>{this.resetMaxListeners(),i(s)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return i(new Error("WebSocket connection is missing or invalid"));r(this.socket)})})}return this.url=e,this.registering=!0,new Promise((n,r)=>{const i=BGe.isReactNative()?void 0:{rejectUnauthorized:!KGe(e)},s=new JGe(e,[],i);YGe()?s.onerror=a=>{const o=a;r(this.emitError(o.error))}:s.on("error",a=>{r(this.emitError(a))}),s.onopen=()=>{this.onOpen(s),n(s)}})}onOpen(e){e.onmessage=n=>this.onPayload(n),e.onclose=n=>this.onClose(n),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;const n=typeof e.data=="string"?Lf(e.data):e.data;this.events.emit("payload",n)}onError(e,n){const r=this.parseError(n),i=r.message||r.toString(),s=b9(e,i);this.events.emit("payload",s)}parseError(e,n=this.url){return Hae(e,Uq(n),"WS")}resetMaxListeners(){this.events.getMaxListeners()>Bq&&this.events.setMaxListeners(Bq)}emitError(e){const n=this.parseError(new Error((e==null?void 0:e.message)||`WebSocket connection failed for host: ${Uq(this.url)}`));return this.events.emit("register_error",n),n}};var QGe={};const Kae="wc",Gae=2,HL="core",uc=`${Kae}@2:${HL}:`,eYe={logger:"error"},tYe={database:":memory:"},nYe="crypto",Fq="client_ed25519_seed",rYe=qe.ONE_DAY,iYe="keychain",sYe="0.3",aYe="messages",oYe="0.3",lYe=qe.SIX_HOURS,cYe="publisher",Yae="irn",uYe="error",Jae="wss://relay.walletconnect.org",dYe="relayer",ei={message:"relayer_message",message_ack:"relayer_message_ack",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",transport_closed:"relayer_transport_closed",publish:"relayer_publish"},hYe="_subscription",lo={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},fYe=.1,WL="2.22.4",Cr={link_mode:"link_mode",relay:"relay"},Hw={inbound:"inbound",outbound:"outbound"},pYe="0.3",mYe="WALLETCONNECT_CLIENT_ID",zq="WALLETCONNECT_LINK_MODE_APPS",Oa={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},yYe="subscription",gYe="0.3",bYe="pairing",wYe="0.3",qy={wc_pairingDelete:{req:{ttl:qe.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:qe.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:qe.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:qe.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:qe.ONE_DAY,prompt:!1,tag:0},res:{ttl:qe.ONE_DAY,prompt:!1,tag:0}}},Uh={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},Xo={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},vYe="history",_Ye="0.3",xYe="expirer",po={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},CYe="0.3",EYe="verify-api",SYe="https://verify.walletconnect.com",Xae="https://verify.walletconnect.org",zg=Xae,AYe=`${zg}/v3`,kYe=[SYe,Xae],TYe="echo",LYe="https://echo.walletconnect.com",zl={pairing_started:"pairing_started",pairing_uri_validation_success:"pairing_uri_validation_success",pairing_uri_not_expired:"pairing_uri_not_expired",store_new_pairing:"store_new_pairing",subscribing_pairing_topic:"subscribing_pairing_topic",subscribe_pairing_topic_success:"subscribe_pairing_topic_success",existing_pairing:"existing_pairing",pairing_not_expired:"pairing_not_expired",emit_inactive_pairing:"emit_inactive_pairing",emit_session_proposal:"emit_session_proposal",subscribing_to_pairing_topic:"subscribing_to_pairing_topic"},tu={no_wss_connection:"no_wss_connection",no_internet_connection:"no_internet_connection",malformed_pairing_uri:"malformed_pairing_uri",active_pairing_already_exists:"active_pairing_already_exists",subscribe_pairing_topic_failure:"subscribe_pairing_topic_failure",pairing_expired:"pairing_expired",proposal_expired:"proposal_expired",proposal_listener_not_found:"proposal_listener_not_found"},Qo={session_approve_started:"session_approve_started",proposal_not_expired:"proposal_not_expired",session_namespaces_validation_success:"session_namespaces_validation_success",create_session_topic:"create_session_topic",subscribing_session_topic:"subscribing_session_topic",subscribe_session_topic_success:"subscribe_session_topic_success",publishing_session_approve:"publishing_session_approve",session_approve_publish_success:"session_approve_publish_success",store_session:"store_session",publishing_session_settle:"publishing_session_settle",session_settle_publish_success:"session_settle_publish_success",session_request_response_started:"session_request_response_started",session_request_response_validation_success:"session_request_response_validation_success",session_request_response_publish_started:"session_request_response_publish_started"},_h={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",proposal_expired:"proposal_expired",subscribe_session_topic_failure:"subscribe_session_topic_failure",session_approve_publish_failure:"session_approve_publish_failure",session_settle_publish_failure:"session_settle_publish_failure",session_approve_namespace_validation_failure:"session_approve_namespace_validation_failure",proposal_not_found:"proposal_not_found",session_request_response_validation_failure:"session_request_response_validation_failure",session_request_response_publish_failure:"session_request_response_publish_failure"},xh={authenticated_session_approve_started:"authenticated_session_approve_started",create_authenticated_session_topic:"create_authenticated_session_topic",cacaos_verified:"cacaos_verified",store_authenticated_session:"store_authenticated_session",subscribing_authenticated_session_topic:"subscribing_authenticated_session_topic",subscribe_authenticated_session_topic_success:"subscribe_authenticated_session_topic_success",publishing_authenticated_session_approve:"publishing_authenticated_session_approve"},Zy={no_internet_connection:"no_internet_connection",invalid_cacao:"invalid_cacao",subscribe_authenticated_session_topic_failure:"subscribe_authenticated_session_topic_failure",authenticated_session_approve_publish_failure:"authenticated_session_approve_publish_failure",authenticated_session_pending_request_not_found:"authenticated_session_pending_request_not_found"},$Ye=.1,IYe="event-client",NYe=86400,OYe="https://pulse.walletconnect.org/batch";function PYe(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),r=0;r<n.length;r++)n[r]=255;for(var i=0;i<t.length;i++){var s=t.charAt(i),a=s.charCodeAt(0);if(n[a]!==255)throw new TypeError(s+" is ambiguous");n[a]=i}var o=t.length,l=t.charAt(0),u=Math.log(o)/Math.log(256),f=Math.log(256)/Math.log(o);function p(b){if(b instanceof Uint8Array||(ArrayBuffer.isView(b)?b=new Uint8Array(b.buffer,b.byteOffset,b.byteLength):Array.isArray(b)&&(b=Uint8Array.from(b))),!(b instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(b.length===0)return"";for(var v=0,_=0,C=0,S=b.length;C!==S&&b[C]===0;)C++,v++;for(var x=(S-C)*f+1>>>0,A=new Uint8Array(x);C!==S;){for(var I=b[C],$=0,O=x-1;(I!==0||$<_)&&O!==-1;O--,$++)I+=256*A[O]>>>0,A[O]=I%o>>>0,I=I/o>>>0;if(I!==0)throw new Error("Non-zero carry");_=$,C++}for(var P=x-_;P!==x&&A[P]===0;)P++;for(var j=l.repeat(v);P<x;++P)j+=t.charAt(A[P]);return j}function y(b){if(typeof b!="string")throw new TypeError("Expected String");if(b.length===0)return new Uint8Array;var v=0;if(b[v]!==" "){for(var _=0,C=0;b[v]===l;)_++,v++;for(var S=(b.length-v)*u+1>>>0,x=new Uint8Array(S);b[v];){var A=n[b.charCodeAt(v)];if(A===255)return;for(var I=0,$=S-1;(A!==0||I<C)&&$!==-1;$--,I++)A+=o*x[$]>>>0,x[$]=A%256>>>0,A=A/256>>>0;if(A!==0)throw new Error("Non-zero carry");C=I,v++}if(b[v]!==" "){for(var O=S-C;O!==S&&x[O]===0;)O++;for(var P=new Uint8Array(_+(S-O)),j=_;O!==S;)P[j++]=x[O++];return P}}}function g(b){var v=y(b);if(v)return v;throw new Error(`Non-${e} character`)}return{encode:p,decodeUnsafe:y,decode:g}}var RYe=PYe,jYe=RYe;const Qae=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},MYe=t=>new TextEncoder().encode(t),DYe=t=>new TextDecoder().decode(t);let UYe=class{constructor(e,n,r){this.name=e,this.prefix=n,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},BYe=class{constructor(e,n,r){if(this.name=e,this.prefix=n,n.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=n.codePointAt(0),this.baseDecode=r}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return eoe(this,e)}},FYe=class{constructor(e){this.decoders=e}or(e){return eoe(this,e)}decode(e){const n=e[0],r=this.decoders[n];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};const eoe=(t,e)=>new FYe({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});let zYe=class{constructor(e,n,r,i){this.name=e,this.prefix=n,this.baseEncode=r,this.baseDecode=i,this.encoder=new UYe(e,n,r),this.decoder=new BYe(e,n,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};const v9=({name:t,prefix:e,encode:n,decode:r})=>new zYe(t,e,n,r),C5=({prefix:t,name:e,alphabet:n})=>{const{encode:r,decode:i}=jYe(n,e);return v9({prefix:t,name:e,encode:r,decode:s=>Qae(i(s))})},VYe=(t,e,n,r)=>{const i={};for(let f=0;f<e.length;++f)i[e[f]]=f;let s=t.length;for(;t[s-1]==="=";)--s;const a=new Uint8Array(s*n/8|0);let o=0,l=0,u=0;for(let f=0;f<s;++f){const p=i[t[f]];if(p===void 0)throw new SyntaxError(`Non-${r} character`);l=l<<n|p,o+=n,o>=8&&(o-=8,a[u++]=255&l>>o)}if(o>=n||255&l<<8-o)throw new SyntaxError("Unexpected end of data");return a},HYe=(t,e,n)=>{const r=e[e.length-1]==="=",i=(1<<n)-1;let s="",a=0,o=0;for(let l=0;l<t.length;++l)for(o=o<<8|t[l],a+=8;a>n;)a-=n,s+=e[i&o>>a];if(a&&(s+=e[i&o<<n-a]),r)for(;s.length*n&7;)s+="=";return s},fs=({name:t,prefix:e,bitsPerChar:n,alphabet:r})=>v9({prefix:e,name:t,encode(i){return HYe(i,r,n)},decode(i){return VYe(i,r,n,t)}}),WYe=v9({prefix:"\0",name:"identity",encode:t=>DYe(t),decode:t=>MYe(t)});var qYe=Object.freeze({__proto__:null,identity:WYe});const ZYe=fs({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var KYe=Object.freeze({__proto__:null,base2:ZYe});const GYe=fs({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var YYe=Object.freeze({__proto__:null,base8:GYe});const JYe=C5({prefix:"9",name:"base10",alphabet:"0123456789"});var XYe=Object.freeze({__proto__:null,base10:JYe});const QYe=fs({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),eJe=fs({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var tJe=Object.freeze({__proto__:null,base16:QYe,base16upper:eJe});const nJe=fs({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),rJe=fs({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),iJe=fs({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),sJe=fs({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),aJe=fs({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),oJe=fs({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),lJe=fs({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),cJe=fs({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),uJe=fs({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var dJe=Object.freeze({__proto__:null,base32:nJe,base32upper:rJe,base32pad:iJe,base32padupper:sJe,base32hex:aJe,base32hexupper:oJe,base32hexpad:lJe,base32hexpadupper:cJe,base32z:uJe});const hJe=C5({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),fJe=C5({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var pJe=Object.freeze({__proto__:null,base36:hJe,base36upper:fJe});const mJe=C5({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),yJe=C5({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var gJe=Object.freeze({__proto__:null,base58btc:mJe,base58flickr:yJe});const bJe=fs({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
568+/",bitsPerChar:6}),wJe=fs({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),vJe=fs({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),_Je=fs({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var xJe=Object.freeze({__proto__:null,base64:bJe,base64pad:wJe,base64url:vJe,base64urlpad:_Je});const toe=Array.from("ððªâð°ðððððððððððððâð»ð¥ð¾ð¿ðâ¤ðð¤£ððððððð
ððð¥ð¥°ðððð¢ð¤ðððªðâºðð¤ððððð¹ð¤¦ððââ¨ð¤·ð±ðð¸ððððððððð¤©ððð¤ðð¯ððð¶ðð¤â£ððððªðð¥ððð©ð¡ð¤ªðð¥³ð¥ð¤¤ððð³âððð´ðð¬ððð·ð»ðââ
ð¥ºððð¤ð¦âð£ððâ¹ððð âððºðð»ððððð¹ð£ð«ðððµð¤ðð´ð¤ð¼ð«â½ð¤âðð¤«ðð®ðð»ðð¶ðð²ð¿ð§¡ðâ¡ððââðð°ð¤¨ð¶ð¤ð¶ð°ðð¢ð¤ðð¨ð¨ð¤¬âððºð¤ððð±ðð¶ð¥´â¶â¡âðð¸â¬ð¨ðð¦ð·ðºâ ð
ððµðð¤²ð¤ ð¤§ððµð
ð§ð¾ððð¤ðð¤¯ð·âð§ð¯ððð¤ððâð´ð£ð¸ððð¥ð¤¢ð
ð¡ð©ðð¸ð»ð¤ð¤®ð¼ð¥µð©ððð¼ðð£ð¥"),CJe=toe.reduce((t,e,n)=>(t[n]=e,t),[]),EJe=toe.reduce((t,e,n)=>(t[e.codePointAt(0)]=n,t),[]);function SJe(t){return t.reduce((e,n)=>(e+=CJe[n],e),"")}function AJe(t){const e=[];for(const n of t){const r=EJe[n.codePointAt(0)];if(r===void 0)throw new Error(`Non-base256emoji character: ${n}`);e.push(r)}return new Uint8Array(e)}const kJe=v9({prefix:"ð",name:"base256emoji",encode:SJe,decode:AJe});var TJe=Object.freeze({__proto__:null,base256emoji:kJe}),LJe=noe,Vq=128,$Je=-128,IJe=Math.pow(2,31);function noe(t,e,n){e=e||[],n=n||0;for(var r=n;t>=IJe;)e[n++]=t&255|Vq,t/=128;for(;t&$Je;)e[n++]=t&255|Vq,t>>>=7;return e[n]=t|0,noe.bytes=n-r+1,e}var NJe=qL,OJe=128,Hq=127;function qL(t,r){var n=0,r=r||0,i=0,s=r,a,o=t.length;do{if(s>=o)throw qL.bytes=0,new RangeError("Could not decode varint");a=t[s++],n+=i<28?(a&Hq)<<i:(a&Hq)*Math.pow(2,i),i+=7}while(a>=OJe);return qL.bytes=s-r,n}var PJe=Math.pow(2,7),RJe=Math.pow(2,14),jJe=Math.pow(2,21),MJe=Math.pow(2,28),DJe=Math.pow(2,35),UJe=Math.pow(2,42),BJe=Math.pow(2,49),FJe=Math.pow(2,56),zJe=Math.pow(2,63),VJe=function(t){return t<PJe?1:t<RJe?2:t<jJe?3:t<MJe?4:t<DJe?5:t<UJe?6:t<BJe?7:t<FJe?8:t<zJe?9:10},HJe={encode:LJe,decode:NJe,encodingLength:VJe},roe=HJe;const Wq=(t,e,n=0)=>(roe.encode(t,e,n),e),qq=t=>roe.encodingLength(t),ZL=(t,e)=>{const n=e.byteLength,r=qq(t),i=r+qq(n),s=new Uint8Array(i+n);return Wq(t,s,0),Wq(n,s,r),s.set(e,i),new WJe(t,n,e,s)};let WJe=class{constructor(e,n,r,i){this.code=e,this.size=n,this.digest=r,this.bytes=i}};const ioe=({name:t,code:e,encode:n})=>new qJe(t,e,n);let qJe=class{constructor(e,n,r){this.name=e,this.code=n,this.encode=r}digest(e){if(e instanceof Uint8Array){const n=this.encode(e);return n instanceof Uint8Array?ZL(this.code,n):n.then(r=>ZL(this.code,r))}else throw Error("Unknown type, must be binary type")}};const soe=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),ZJe=ioe({name:"sha2-256",code:18,encode:soe("SHA-256")}),KJe=ioe({name:"sha2-512",code:19,encode:soe("SHA-512")});var GJe=Object.freeze({__proto__:null,sha256:ZJe,sha512:KJe});const aoe=0,YJe="identity",ooe=Qae,JJe=t=>ZL(aoe,ooe(t)),XJe={code:aoe,name:YJe,encode:ooe,digest:JJe};var QJe=Object.freeze({__proto__:null,identity:XJe});new TextEncoder,new TextDecoder;const Zq={...qYe,...KYe,...YYe,...XYe,...tJe,...dJe,...pJe,...gJe,...xJe,...TJe};({...GJe,...QJe});function loe(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function eXe(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?loe(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function coe(t,e,n,r){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:n},decoder:{decode:r}}}const Kq=coe("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),RS=coe("ascii","a",t=>{let e="a";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return e},t=>{t=t.substring(1);const e=eXe(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}),tXe={utf8:Kq,"utf-8":Kq,hex:Zq.base16,latin1:RS,ascii:RS,binary:RS,...Zq};function nXe(t,e="utf8"){const n=tXe[e];if(!n)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?loe(globalThis.Buffer.from(t,"utf-8")):n.decoder.decode(`${n.prefix}${t}`)}var rXe=Object.defineProperty,iXe=(t,e,n)=>e in t?rXe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ml=(t,e,n)=>iXe(t,typeof e!="symbol"?e+"":e,n);let sXe=class{constructor(e,n){this.core=e,this.logger=n,Ml(this,"keychain",new Map),Ml(this,"name",iYe),Ml(this,"version",sYe),Ml(this,"initialized",!1),Ml(this,"storagePrefix",uc),Ml(this,"init",async()=>
vendor: 52,598 bytes, line 568
568{if(!this.initialized){const r=await this.getKeyChain();typeof r<"u"&&(this.keychain=r),this.initialized=!0}}),Ml(this,"has",r=>(this.isInitialized(),this.keychain.has(r))),Ml(this,"set",async(r,i)=>{this.isInitialized(),this.keychain.set(r,i),await this.persist()}),Ml(this,"get",r=>{this.isInitialized();const i=this.keychain.get(r);if(typeof i>"u"){const{message:s}=We("NO_MATCHING_KEY",`${this.name}: ${r}`);throw new Error(s)}return i}),Ml(this,"del",async r=>{this.isInitialized(),this.keychain.delete(r),await this.persist()}),this.core=e,this.logger=Ka(n,this.name)}get context(){return ma(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,AL(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?kL(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=We("NOT_INITIALIZED",this.name);throw new Error(e)}}};var aXe=Object.defineProperty,oXe=(t,e,n)=>e in t?aXe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Mi=(t,e,n)=>oXe(t,typeof e!="symbol"?e+"":e,n);let lXe=class{constructor(e,n,r){this.core=e,this.logger=n,Mi(this,"name",nYe),Mi(this,"keychain"),Mi(this,"randomSessionIdentifier",DL()),Mi(this,"initialized",!1),Mi(this,"clientId"),Mi(this,"init",async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)}),Mi(this,"hasKeys",i=>(this.isInitialized(),this.keychain.has(i))),Mi(this,"getClientId",async()=>{if(this.isInitialized(),this.clientId)return this.clientId;const i=await this.getClientSeed(),s=gW(i),a=Ase(s.publicKey);return this.clientId=a,a}),Mi(this,"generateKeyPair",()=>{this.isInitialized();const i=Gqe();return this.setPrivateKey(i.publicKey,i.privateKey)}),Mi(this,"signJWT",async i=>{this.isInitialized();const s=await this.getClientSeed(),a=gW(s),o=this.randomSessionIdentifier;return await gze(o,i,rYe,a)}),Mi(this,"generateSharedKey",(i,s,a)=>{this.isInitialized();const o=this.getPrivateKey(i),l=Yqe(o,s);return this.setSymKey(l,a)}),Mi(this,"setSymKey",async(i,s)=>{this.isInitialized();const a=s||Fw(i);return await this.keychain.set(a,i),a}),Mi(this,"deleteKeyPair",async i=>{this.isInitialized(),await this.keychain.del(i)}),Mi(this,"deleteSymKey",async i=>{this.isInitialized(),await this.keychain.del(i)}),Mi(this,"encode",async(i,s,a)=>{this.isInitialized();const o=Mae(a),l=ju(s);if(hq(o))return Qqe(l,a==null?void 0:a.encoding);if(dq(o)){const y=o.senderPublicKey,g=o.receiverPublicKey;i=await this.generateSharedKey(y,g)}const u=this.getSymKey(i),{type:f,senderPublicKey:p}=o;return Jqe({type:f,symKey:u,message:l,senderPublicKey:p,encoding:a==null?void 0:a.encoding})}),Mi(this,"decode",async(i,s,a)=>{this.isInitialized();const o=tZe(s,a);if(hq(o)){const l=eZe(s,a==null?void 0:a.encoding);return Lf(l)}if(dq(o)){const l=o.receiverPublicKey,u=o.senderPublicKey;i=await this.generateSharedKey(l,u)}try{const l=this.getSymKey(i),u=Xqe({symKey:l,encoded:s,encoding:a==null?void 0:a.encoding});return Lf(u)}catch(l){this.logger.error(`Failed to decode message from topic: '${i}', clientId: '${await this.getClientId()}'`),this.logger.error(l)}}),Mi(this,"getPayloadType",(i,s=ta)=>{const a=w6({encoded:i,encoding:s});return If(a.type)}),Mi(this,"getPayloadSenderPublicKey",(i,s=ta)=>{const a=w6({encoded:i,encoding:s});return a.senderPublicKey?ca(a.senderPublicKey,Ms):void 0}),this.core=e,this.logger=Ka(n,this.name),this.keychain=r||new sXe(this.core,this.logger)}get context(){return ma(this.logger)}async setPrivateKey(e,n){return await this.keychain.set(e,n),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(Fq)}catch{e=DL(),await this.keychain.set(Fq,e)}return nXe(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=We("NOT_INITIALIZED",this.name);throw new Error(e)}}};var cXe=Object.defineProperty,uXe=Object.defineProperties,dXe=Object.getOwnPropertyDescriptors,Gq=Object.getOwnPropertySymbols,hXe=Object.prototype.hasOwnProperty,fXe=Object.prototype.propertyIsEnumerable,KL=(t,e,n)=>e in t?cXe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,pXe=(t,e)=>{for(var n in e||(e={}))hXe.call(e,n)&&KL(t,n,e[n]);if(Gq)for(var n of Gq(e))fXe.call(e,n)&&KL(t,n,e[n]);return t},mXe=(t,e)=>uXe(t,dXe(e)),Sa=(t,e,n)=>KL(t,typeof e!="symbol"?e+"":e,n);let yXe=class extends YKe{constructor(e,n){super(e,n),this.logger=e,this.core=n,Sa(this,"messages",new Map),Sa(this,"messagesWithoutClientAck",new Map),Sa(this,"name",aYe),Sa(this,"version",oYe),Sa(this,"initialized",!1),Sa(this,"storagePrefix",uc),Sa(this,"init",async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const r=await this.getRelayerMessages();typeof r<"u"&&(this.messages=r);const i=await this.getRelayerMessagesWithoutClientAck();typeof i<"u"&&(this.messagesWithoutClientAck=i),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(r){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(r)}finally{this.initialized=!0}}}),Sa(this,"set",async(r,i,s)=>{this.isInitialized();const a=vo(i);let o=this.messages.get(r);if(typeof o>"u"&&(o={}),typeof o[a]<"u")return a;if(o[a]=i,this.messages.set(r,o),s===Hw.inbound){const l=this.messagesWithoutClientAck.get(r)||{};this.messagesWithoutClientAck.set(r,mXe(pXe({},l),{[a]:i}))}return await this.persist(),a}),Sa(this,"get",r=>{this.isInitialized();let i=this.messages.get(r);return typeof i>"u"&&(i={}),i}),Sa(this,"getWithoutAck",r=>{this.isInitialized();const i={};for(const s of r){const a=this.messagesWithoutClientAck.get(s)||{};i[s]=Object.values(a)}return i}),Sa(this,"has",(r,i)=>{this.isInitialized();const s=this.get(r),a=vo(i);return typeof s[a]<"u"}),Sa(this,"ack",async(r,i)=>{this.isInitialized();const s=this.messagesWithoutClientAck.get(r);if(typeof s>"u")return;const a=vo(i);delete s[a],Object.keys(s).length===0?this.messagesWithoutClientAck.delete(r):this.messagesWithoutClientAck.set(r,s),await this.persist()}),Sa(this,"del",async r=>{this.isInitialized(),this.messages.delete(r),this.messagesWithoutClientAck.delete(r),await this.persist()}),this.logger=Ka(e,this.name),this.core=n}get context(){return ma(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get storageKeyWithoutClientAck(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name+"_withoutClientAck"}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,AL(e))}async setRelayerMessagesWithoutClientAck(e){await this.core.storage.setItem(this.storageKeyWithoutClientAck,AL(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?kL(e):void 0}async getRelayerMessagesWithoutClientAck(){const e=await this.core.storage.getItem(this.storageKeyWithoutClientAck);return typeof e<"u"?kL(e):void 0}async persist(){await this.setRelayerMessages(this.messages),await this.setRelayerMessagesWithoutClientAck(this.messagesWithoutClientAck)}isInitialized(){if(!this.initialized){const{message:e}=We("NOT_INITIALIZED",this.name);throw new Error(e)}}};var gXe=Object.defineProperty,bXe=Object.defineProperties,wXe=Object.getOwnPropertyDescriptors,Yq=Object.getOwnPropertySymbols,vXe=Object.prototype.hasOwnProperty,_Xe=Object.prototype.propertyIsEnumerable,GL=(t,e,n)=>e in t?gXe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,o0=(t,e)=>{for(var n in e||(e={}))vXe.call(e,n)&&GL(t,n,e[n]);if(Yq)for(var n of Yq(e))_Xe.call(e,n)&&GL(t,n,e[n]);return t},Jq=(t,e)=>bXe(t,wXe(e)),co=(t,e,n)=>GL(t,typeof e!="symbol"?e+"":e,n);let xXe=class extends JKe{constructor(e,n){super(e,n),this.relayer=e,this.logger=n,co(this,"events",new Za.EventEmitter),co(this,"name",cYe),co(this,"queue",new Map),co(this,"publishTimeout",qe.toMiliseconds(qe.ONE_MINUTE)),co(this,"initialPublishTimeout",qe.toMiliseconds(qe.ONE_SECOND*15)),co(this,"needsTransportRestart",!1),co(this,"publish",async(r,i,s)=>{var a,o,l,u,f;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:r,message:i,opts:s}});const p=(s==null?void 0:s.ttl)||lYe,y=(s==null?void 0:s.prompt)||!1,g=(s==null?void 0:s.tag)||0,b=(s==null?void 0:s.id)||f2().toString(),v=N0(vv().protocol),_={id:b,method:(s==null?void 0:s.publishMethod)||v.publish,params:o0({topic:r,message:i,ttl:p,prompt:y,tag:g,attestation:s==null?void 0:s.attestation},s==null?void 0:s.tvf)},C=`Failed to publish payload, please try again. id:${b} tag:${g}`;try{Ii((a=_.params)==null?void 0:a.prompt)&&((o=_.params)==null||delete o.prompt),Ii((l=_.params)==null?void 0:l.tag)&&((u=_.params)==null||delete u.tag);const S=new Promise(async x=>{const A=({id:$})=>{var O;((O=_.id)==null?void 0:O.toString())===$.toString()&&(this.removeRequestFromQueue($),this.relayer.events.removeListener(ei.publish,A),x())};this.relayer.events.on(ei.publish,A);const I=Jl(new Promise(($,O)=>{this.rpcPublish(_,s).then($).catch(P=>{this.logger.warn(P,P==null?void 0:P.message),O(P)})}),this.initialPublishTimeout,`Failed initial publish, retrying.... id:${b} tag:${g}`);try{await I,this.events.removeListener(ei.publish,A)}catch($){this.queue.set(b,{request:_,opts:s,attempt:1}),this.logger.warn($,$==null?void 0:$.message)}});this.logger.trace({type:"method",method:"publish",params:{id:b,topic:r,message:i,opts:s}}),await Jl(S,this.publishTimeout,C)}catch(S){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(S),(f=s==null?void 0:s.internal)!=null&&f.throwOnFailedPublish)throw S}finally{this.queue.delete(b)}}),co(this,"publishCustom",async r=>{var i,s,a,o,l;this.logger.debug("Publishing custom payload"),this.logger.trace({type:"method",method:"publishCustom",params:r});const{payload:u,opts:f={}}=r,{attestation:p,tvf:y,publishMethod:g,prompt:b,tag:v,ttl:_=qe.FIVE_MINUTES}=f,C=f.id||f2().toString(),S=N0(vv().protocol),x=g||S.publish,A={id:C,method:x,params:o0(Jq(o0({},u),{ttl:_,prompt:b,tag:v,attestation:p}),y)},I=`Failed to publish custom payload, please try again. id:${C} tag:${v}`;try{Ii((i=A.params)==null?void 0:i.prompt)&&((s=A.params)==null||delete s.prompt),Ii((a=A.params)==null?void 0:a.tag)&&((o=A.params)==null||delete o.tag);const $=new Promise(async O=>{const P=({id:U})=>{var z;((z=A.id)==null?void 0:z.toString())===U.toString()&&(this.removeRequestFromQueue(U),this.relayer.events.removeListener(ei.publish,P),O())};this.relayer.events.on(ei.publish,P);const j=Jl(new Promise((U,z)=>{this.rpcPublish(A,f).then(U).catch(D=>{this.logger.warn(D,D==null?void 0:D.message),z(D)})}),this.initialPublishTimeout,`Failed initial custom payload publish, retrying.... method:${x} id:${C} tag:${v}`);try{await j,this.events.removeListener(ei.publish,P)}catch(U){this.queue.set(C,{request:A,opts:f,attempt:1}),this.logger.warn(U,U==null?void 0:U.message)}});this.logger.trace({type:"method",method:"publish",params:{id:C,payload:u,opts:f}}),await Jl($,this.publishTimeout,I)}catch($){if(this.logger.debug("Failed to Publish Payload"),this.logger.error($),(l=f==null?void 0:f.internal)!=null&&l.throwOnFailedPublish)throw $}finally{this.queue.delete(C)}}),co(this,"on",(r,i)=>{this.events.on(r,i)}),co(this,"once",(r,i)=>{this.events.once(r,i)}),co(this,"off",(r,i)=>{this.events.off(r,i)}),co(this,"removeListener",(r,i)=>{this.events.removeListener(r,i)}),this.relayer=e,this.logger=Ka(n,this.name),this.registerEventListeners()}get context(){return ma(this.logger)}async rpcPublish(e,n){this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:e});const r=await this.relayer.request(e);return this.relayer.events.emit(ei.publish,o0(o0({},e),n)),this.logger.debug("Successfully Published Payload"),r}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async(e,n)=>{var r;const i=e.attempt+1;this.queue.set(n,Jq(o0({},e),{attempt:i})),this.logger.warn({},`Publisher: queue->publishing: ${e.request.id}, tag: ${(r=e.request.params)==null?void 0:r.tag}, attempt: ${i}`),await this.rpcPublish(e.request,e.opts),this.logger.warn({},`Publisher: queue->published: ${e.request.id}`)})}registerEventListeners(){this.relayer.core.heartbeat.on(Xf.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(ei.connection_stalled);return}this.checkQueue()}),this.relayer.on(ei.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}};var CXe=Object.defineProperty,EXe=(t,e,n)=>e in t?CXe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,l0=(t,e,n)=>EXe(t,typeof e!="symbol"?e+"":e,n);let SXe=class{constructor(){l0(this,"map",new Map),l0(this,"set",(e,n)=>{const r=this.get(e);this.exists(e,n)||this.map.set(e,[...r,n])}),l0(this,"get",e=>this.map.get(e)||[]),l0(this,"exists",(e,n)=>this.get(e).includes(n)),l0(this,"delete",(e,n)=>{if(typeof n>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const r=this.get(e);if(!this.exists(e,n))return;const i=r.filter(s=>s!==n);if(!i.length){this.map.delete(e);return}this.map.set(e,i)}),l0(this,"clear",()=>{this.map.clear()})}get topics(){return Array.from(this.map.keys())}};var AXe=Object.defineProperty,kXe=Object.defineProperties,TXe=Object.getOwnPropertyDescriptors,Xq=Object.getOwnPropertySymbols,LXe=Object.prototype.hasOwnProperty,$Xe=Object.prototype.propertyIsEnumerable,YL=(t,e,n)=>e in t?AXe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ky=(t,e)=>{for(var n in e||(e={}))LXe.call(e,n)&&YL(t,n,e[n]);if(Xq)for(var n of Xq(e))$Xe.call(e,n)&&YL(t,n,e[n]);return t},jS=(t,e)=>kXe(t,TXe(e)),tr=(t,e,n)=>YL(t,typeof e!="symbol"?e+"":e,n);let IXe=class extends eGe{constructor(e,n){super(e,n),this.relayer=e,this.logger=n,tr(this,"subscriptions",new Map),tr(this,"topicMap",new SXe),tr(this,"events",new Za.EventEmitter),tr(this,"name",yYe),tr(this,"version",gYe),tr(this,"pending",new Map),tr(this,"cached",[]),tr(this,"initialized",!1),tr(this,"storagePrefix",uc),tr(this,"subscribeTimeout",qe.toMiliseconds(qe.ONE_MINUTE)),tr(this,"initialSubscribeTimeout",qe.toMiliseconds(qe.ONE_SECOND*15)),tr(this,"clientId"),tr(this,"batchSubscribeTopicsLimit",500),tr(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),await this.restore()),this.initialized=!0}),tr(this,"subscribe",async(r,i)=>{var s;this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:r,opts:i}});try{const a=vv(i),o={topic:r,relay:a,transportType:i==null?void 0:i.transportType};(s=i==null?void 0:i.internal)!=null&&s.skipSubscribe||this.pending.set(r,o);const l=await this.rpcSubscribe(r,a,i);return typeof l=="string"&&(this.onSubscribe(l,o),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:r,opts:i}})),l}catch(a){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(a),a}}),tr(this,"unsubscribe",async(r,i)=>{this.isInitialized(),typeof(i==null?void 0:i.id)<"u"?await this.unsubscribeById(r,i.id,i):await this.unsubscribeByTopic(r,i)}),tr(this,"isSubscribed",r=>new Promise(i=>{i(this.topicMap.topics.includes(r))})),tr(this,"isKnownTopic",r=>new Promise(i=>{i(this.topicMap.topics.includes(r)||this.pending.has(r)||this.cached.some(s=>s.topic===r))})),tr(this,"on",(r,i)=>{this.events.on(r,i)}),tr(this,"once",(r,i)=>{this.events.once(r,i)}),tr(this,"off",(r,i)=>{this.events.off(r,i)}),tr(this,"removeListener",(r,i)=>{this.events.removeListener(r,i)}),tr(this,"start",async()=>{await this.onConnect()}),tr(this,"stop",async()=>{await this.onDisconnect()}),tr(this,"restart",async()=>{await this.restore(),await this.onRestart()}),tr(this,"checkPending",async()=>{if(this.pending.size===0&&(!this.initialized||!this.relayer.connected))return;const r=[];this.pending.forEach(i=>{r.push(i)}),await this.batchSubscribe(r)}),tr(this,"registerEventListeners",()=>{this.relayer.core.heartbeat.on(Xf.pulse,async()=>{await this.checkPending()}),this.events.on(Oa.created,async r=>{const i=Oa.created;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,data:r}),await this.persist()}),this.events.on(Oa.deleted,async r=>{const i=Oa.deleted;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,data:r}),await this.persist()})}),this.relayer=e,this.logger=Ka(n,this.name),this.clientId=""}get context(){return ma(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}get hasAnyTopics(){return this.topicMap.topics.length>0||this.pending.size>0||this.cached.length>0||this.subscriptions.size>0}hasSubscription(e,n){let r=!1;try{r=this.getSubscription(e).topic===n}catch{}return r}reset(){this.cached=[],this.initialized=!0}onDisable(){this.values.length>0&&(this.cached=this.values),this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,n){const r=this.topicMap.get(e);await Promise.all(r.map(async i=>await this.unsubscribeById(e,i,n)))}async unsubscribeById(e,n,r){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:n,opts:r}});try{const i=vv(r);await this.restartToComplete({topic:e,id:n,relay:i}),await this.rpcUnsubscribe(e,n,i);const s=Er("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,n,s),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:n,opts:r}})}catch(i){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(i),i}}async rpcSubscribe(e,n,r){var i,s;const a=await this.getSubscriptionId(e);if((i=r==null?void 0:r.internal)!=null&&i.skipSubscribe)return a;(!r||(r==null?void 0:r.transportType)===Cr.relay)&&await this.restartToComplete({topic:e,id:e,relay:n});const o={method:N0(n.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:o});const l=(s=r==null?void 0:r.internal)==null?void 0:s.throwOnFailedPublish;try{if((r==null?void 0:r.transportType)===Cr.link_mode)return setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(o).catch(p=>this.logger.warn(p))},qe.toMiliseconds(qe.ONE_SECOND)),a;const u=new Promise(async p=>{const y=g=>{g.topic===e&&(this.events.removeListener(Oa.created,y),p(g.id))};this.events.on(Oa.created,y);try{const g=await Jl(new Promise((b,v)=>{this.relayer.request(o).catch(_=>{this.logger.warn(_,_==null?void 0:_.message),v(_)}).then(b)}),this.initialSubscribeTimeout,`Subscribing to ${e} failed, please try again`);this.events.removeListener(Oa.created,y),p(g)}catch{}}),f=await Jl(u,this.subscribeTimeout,`Subscribing to ${e} failed, please try again`);if(!f&&l)throw new Error(`Subscribing to ${e} failed, please try again`);return f?a:null}catch(u){if(this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(ei.connection_stalled),l)throw u}return null}async rpcBatchSubscribe(e){if(!e.length)return;const n=e[0].relay,r={method:N0(n.protocol).batchSubscribe,params:{topics:e.map(i=>i.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:r});try{await await Jl(new Promise(i=>{this.relayer.request(r).catch(s=>this.logger.warn(s)).then(i)}),this.subscribeTimeout,"rpcBatchSubscribe failed, please try again")}catch{this.relayer.events.emit(ei.connection_stalled)}}async rpcBatchFetchMessages(e){if(!e.length)return;const n=e[0].relay,r={method:N0(n.protocol).batchFetchMessages,params:{topics:e.map(s=>s.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:r});let i;try{i=await await Jl(new Promise((s,a)=>{this.relayer.request(r).catch(o=>{this.logger.warn(o),a(o)}).then(s)}),this.subscribeTimeout,"rpcBatchFetchMessages failed, please try again")}catch{this.relayer.events.emit(ei.connection_stalled)}return i}rpcUnsubscribe(e,n,r){const i={method:N0(r.protocol).unsubscribe,params:{topic:e,id:n}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.request(i)}onSubscribe(e,n){this.setSubscription(e,jS(Ky({},n),{id:e})),this.pending.delete(n.topic)}onBatchSubscribe(e){e.length&&e.forEach(n=>{this.setSubscription(n.id,Ky({},n)),this.pending.delete(n.topic)})}async onUnsubscribe(e,n,r){this.events.removeAllListeners(n),this.hasSubscription(n,e)&&this.deleteSubscription(n,r),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,n){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:n}),this.addSubscription(e,n)}addSubscription(e,n){this.subscriptions.set(e,Ky({},n)),this.topicMap.set(n.topic,e),this.events.emit(Oa.created,n)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const n=this.subscriptions.get(e);if(!n){const{message:r}=We("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(r)}return n}deleteSubscription(e,n){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:n});const r=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(r.topic,e),this.events.emit(Oa.deleted,jS(Ky({},r),{reason:n}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Oa.sync)}async onRestart(){if(this.cached.length){const e=[...this.cached],n=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let r=0;r<n;r++){const i=e.splice(0,this.batchSubscribeTopicsLimit);await this.batchSubscribe(i)}}this.events.emit(Oa.resubscribed)}async restore(){try{const e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size&&!e.every(n=>{var r;return n.topic===((r=this.subscriptions.get(n.id))==null?void 0:r.topic)})){const{message:n}=We("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(n),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(n)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){e.length&&(await this.rpcBatchSubscribe(e),this.onBatchSubscribe(await Promise.all(e.map(async n=>jS(Ky({},n),{id:await this.getSubscriptionId(n.topic)})))))}async batchFetchMessages(e){if(!e.length)return;this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);const n=await this.rpcBatchFetchMessages(e);n&&n.messages&&(await gHe(qe.toMiliseconds(qe.ONE_SECOND)),await this.relayer.handleBatchMessageEvents(n.messages))}async onConnect(){await this.restart(),this.reset()}onDisconnect(){this.onDisable()}isInitialized(){if(!this.initialized){const{message:e}=We("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(e){!this.relayer.connected&&!this.relayer.connecting&&(this.cached.push(e),await this.relayer.transportOpen())}async getClientId(){return this.clientId||(this.clientId=await this.relayer.core.crypto.getClientId()),this.clientId}async getSubscriptionId(e){return vo(e+await this.getClientId())}};var NXe=Object.defineProperty,Qq=Object.getOwnPropertySymbols,OXe=Object.prototype.hasOwnProperty,PXe=Object.prototype.propertyIsEnumerable,JL=(t,e,n)=>e in t?NXe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,eZ=(t,e)=>{for(var n in e||(e={}))OXe.call(e,n)&&JL(t,n,e[n]);if(Qq)for(var n of Qq(e))PXe.call(e,n)&&JL(t,n,e[n]);return t},Tn=(t,e,n)=>JL(t,typeof e!="symbol"?e+"":e,n);let RXe=class extends XKe{constructor(e){var n;super(e),Tn(this,"protocol","wc"),Tn(this,"version",2),Tn(this,"core"),Tn(this,"logger"),Tn(this,"events",new Za.EventEmitter),Tn(this,"provider"),Tn(this,"messages"),Tn(this,"subscriber"),Tn(this,"publisher"),Tn(this,"name",dYe),Tn(this,"transportExplicitlyClosed",!1),Tn(this,"initialized",!1),Tn(this,"connectionAttemptInProgress",!1),Tn(this,"relayUrl"),Tn(this,"projectId"),Tn(this,"packageName"),Tn(this,"bundleId"),Tn(this,"hasExperiencedNetworkDisruption",!1),Tn(this,"pingTimeout"),Tn(this,"heartBeatTimeout",qe.toMiliseconds(qe.THIRTY_SECONDS+qe.FIVE_SECONDS)),Tn(this,"reconnectTimeout"),Tn(this,"connectPromise"),Tn(this,"reconnectInProgress",!1),Tn(this,"requestsInFlight",[]),Tn(this,"connectTimeout",qe.toMiliseconds(qe.ONE_SECOND*15)),Tn(this,"request",async r=>{var i,s;this.logger.debug("Publishing Request Payload");const a=r.id||f2().toString();await this.toEstablishConnection();try{this.logger.trace({id:a,method:r.method,topic:(i=r.params)==null?void 0:i.topic},"relayer.request - publishing...");const o=`${a}:${((s=r.params)==null?void 0:s.tag)||""}`;this.requestsInFlight.push(o);const l=await this.provider.request(r);return this.requestsInFlight=this.requestsInFlight.filter(u=>u!==o),l}catch(o){throw this.logger.debug(`Failed to Publish Request: ${a}`),o}}),Tn(this,"resetPingTimeout",()=>{pv()&&(clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var r,i,s,a;try{this.logger.debug({},"pingTimeout: Connection stalled, terminating..."),(a=(s=(i=(r=this.provider)==null?void 0:r.connection)==null?void 0:i.socket)==null?void 0:s.terminate)==null||a.call(s)}catch(o){this.logger.warn(o,o==null?void 0:o.message)}},this.heartBeatTimeout))}),Tn(this,"onPayloadHandler",r=>{this.onProviderPayload(r),this.resetPingTimeout()}),Tn(this,"onConnectHandler",()=>{this.logger.warn({},"Relayer connected ð"),this.startPingTimeout(),this.events.emit(ei.connect)}),Tn(this,"onDisconnectHandler",()=>{this.logger.warn({},"Relayer disconnected ð"),this.requestsInFlight=[],this.onProviderDisconnect()}),Tn(this,"onProviderErrorHandler",r=>{this.logger.fatal(`Fatal socket error: ${r.message}`),this.events.emit(ei.error,r),this.logger.fatal("Fatal socket error received, closing transport"),this.transportClose()}),Tn(this,"registerProviderListeners",()=>{this.provider.on(lo.payload,this.onPayloadHandler),this.provider.on(lo.connect,this.onConnectHandler),this.provider.on(lo.disconnect,this.onDisconnectHandler),this.provider.on(lo.error,this.onProviderErrorHandler)}),this.core=e.core,this.logger=nP({logger:(n=e.logger)!=null?n:uYe,name:this.name}),this.messages=new yXe(this.logger,e.core),this.subscriber=new IXe(this,this.logger),this.publisher=new xXe(this,this.logger),this.projectId=e==null?void 0:e.projectId,this.relayUrl=(e==null?void 0:e.relayUrl)||Jae,tHe()?this.packageName=OW():nHe()&&(this.bundleId=OW()),this.provider={}}async init(){this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),this.initialized=!0,this.transportOpen().catch(e=>this.logger.warn(e,e==null?void 0:e.message))}get context(){return ma(this.logger)}get connected(){var e,n,r;return((r=(n=(e=this.provider)==null?void 0:e.connection)==null?void 0:n.socket)==null?void 0:r.readyState)===1||!1}get connecting(){var e,n,r;return((r=(n=(e=this.provider)==null?void 0:e.connection)==null?void 0:n.socket)==null?void 0:r.readyState)===0||this.connectPromise!==void 0||!1}async publish(e,n,r){this.isInitialized(),await this.publisher.publish(e,n,r),await this.recordMessageEvent({topic:e,message:n,publishedAt:Date.now(),transportType:Cr.relay},Hw.outbound)}async publishCustom(e){this.isInitialized(),await this.publisher.publishCustom(e)}async subscribe(e,n){var r,i,s;this.isInitialized(),(!(n!=null&&n.transportType)||(n==null?void 0:n.transportType)==="relay")&&await this.toEstablishConnection();const a=typeof((r=n==null?void 0:n.internal)==null?void 0:r.throwOnFailedPublish)>"u"?!0:(i=n==null?void 0:n.internal)==null?void 0:i.throwOnFailedPublish;let o=((s=this.subscriber.topicMap.get(e))==null?void 0:s[0])||"",l;const u=f=>{f.topic===e&&(this.subscriber.off(Oa.created,u),l())};return await Promise.all([new Promise(f=>{l=f,this.subscriber.on(Oa.created,u)}),new Promise(async(f,p)=>{o=await this.subscriber.subscribe(e,eZ({internal:{throwOnFailedPublish:a}},n)).catch(y=>{a&&p(y)})||o,f()})]),o}async unsubscribe(e,n){this.isInitialized(),await this.subscriber.unsubscribe(e,n)}on(e,n){this.events.on(e,n)}once(e,n){this.events.once(e,n)}off(e,n){this.events.off(e,n)}removeListener(e,n){this.events.removeListener(e,n)}async transportDisconnect(){this.provider.disconnect&&(this.hasExperiencedNetworkDisruption||this.connected)?await Jl(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(e){if(!this.subscriber.hasAnyTopics){this.logger.info("Starting WS connection skipped because the client has no topics to work with.");return}if(this.connectPromise?(this.logger.debug({},"Waiting for existing connection attempt to resolve..."),await this.connectPromise,this.logger.debug({},"Existing connection attempt resolved")):(this.connectPromise=new Promise(async(n,r)=>{await this.connect(e).then(n).catch(r).finally(()=>{this.connectPromise=void 0})}),await this.connectPromise),!this.connected)throw new Error(`Couldn't establish socket connection to the relay server: ${this.relayUrl}`)}async restartTransport(e){this.logger.debug({},"Restarting transport..."),!this.connectionAttemptInProgress&&(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await Sq())throw new Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(e){if((e==null?void 0:e.length)===0){this.logger.trace("Batch message events is empty. Ignoring...");return}const n=e.sort((r,i)=>r.publishedAt-i.publishedAt);this.logger.debug(`Batch of ${n.length} message events sorted`);for(const r of n)try{await this.onMessageEvent(r)}catch(i){this.logger.warn(i,"Error while processing batch message event: "+(i==null?void 0:i.message))}this.logger.trace(`Batch of ${n.length} message events processed`)}async onLinkMessageEvent(e,n){const{topic:r}=e;if(!n.sessionExists){const i=hi(qe.FIVE_MINUTES),s={topic:r,expiry:i,relay:{protocol:"irn"},active:!1};await this.core.pairing.pairings.set(r,s)}this.events.emit(ei.message,e),await this.recordMessageEvent(e,Hw.inbound)}async connect(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;let n=1;for(;n<6;){try{if(this.transportExplicitlyClosed)break;this.logger.debug({},`Connecting to ${this.relayUrl}, attempt: ${n}...`),await this.createProvider(),await new Promise(async(r,i)=>{const s=()=>{i(new Error("Connection interrupted while trying to connect"))};this.provider.once(lo.disconnect,s),await Jl(new Promise((a,o)=>{this.provider.connect().then(a).catch(o)}),this.connectTimeout,`Socket stalled when trying to connect to ${this.relayUrl}`).catch(a=>{i(a)}).finally(()=>{this.provider.off(lo.disconnect,s),clearTimeout(this.reconnectTimeout)}),await new Promise(async(a,o)=>{const l=()=>{i(new Error("Connection interrupted while trying to subscribe"))};this.provider.once(lo.disconnect,l),await this.subscriber.start().then(a).catch(o).finally(()=>{this.provider.off(lo.disconnect,l)})}),this.hasExperiencedNetworkDisruption=!1,r()})}catch(r){await this.subscriber.stop();const i=r;this.logger.warn({},i.message),this.hasExperiencedNetworkDisruption=!0}finally{this.connectionAttemptInProgress=!1}if(this.connected){this.logger.debug({},`Connected to ${this.relayUrl} successfully on attempt: ${n}`);break}await new Promise(r=>setTimeout(r,qe.toMiliseconds(n*1))),n++}}startPingTimeout(){var e,n,r,i,s;if(pv())try{(n=(e=this.provider)==null?void 0:e.connection)!=null&&n.socket&&((s=(i=(r=this.provider)==null?void 0:r.connection)==null?void 0:i.socket)==null||s.on("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(a){this.logger.warn(a,a==null?void 0:a.message)}}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new sP(new XGe(oHe({sdkVersion:WL,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId,packageName:this.packageName}))),this.registerProviderListeners()}async recordMessageEvent(e,n){const{topic:r,message:i}=e;await this.messages.set(r,i,n)}async shouldIgnoreMessageEvent(e){const{topic:n,message:r}=e;if(!r||r.length===0)return this.logger.warn(`Ignoring invalid/empty message: ${r}`),!0;if(!await this.subscriber.isKnownTopic(n))return this.logger.warn(`Ignoring message for unknown topic ${n}`),!0;const i=this.messages.has(n,r);return i&&this.logger.warn(`Ignoring duplicate message: ${r}`),i}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),iP(e)){if(!e.method.endsWith(hYe))return;const n=e.params,{topic:r,message:i,publishedAt:s,attestation:a}=n.data,o={topic:r,message:i,publishedAt:s,transportType:Cr.relay,attestation:a};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(eZ({type:"event",event:n.id},o)),this.events.emit(n.id,o),await this.acknowledgePayload(e),await this.onMessageEvent(o)}else w9(e)&&this.events.emit(ei.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(await this.recordMessageEvent(e,Hw.inbound),this.events.emit(ei.message,e))}async acknowledgePayload(e){const n=_6(e.id,!0);await this.provider.connection.send(n)}unregisterProviderListeners(){this.provider.off(lo.payload,this.onPayloadHandler),this.provider.off(lo.connect,this.onConnectHandler),this.provider.off(lo.disconnect,this.onDisconnectHandler),this.provider.off(lo.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await Sq();eKe(async n=>{e!==n&&(e=n,n?await this.transportOpen().catch(r=>this.logger.error(r,r==null?void 0:r.message)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))}),this.core.heartbeat.on(Xf.pulse,async()=>{if(!this.transportExplicitlyClosed&&!this.connected&&rKe())try{await this.confirmOnlineStateOrThrow(),await this.transportOpen()}catch(n){this.logger.warn(n,n==null?void 0:n.message)}})}async onProviderDisconnect(){clearTimeout(this.pingTimeout),this.events.emit(ei.disconnect),this.connectionAttemptInProgress=!1,!this.reconnectInProgress&&(this.reconnectInProgress=!0,await this.subscriber.stop(),this.subscriber.hasAnyTopics&&(this.transportExplicitlyClosed||(this.reconnectTimeout=setTimeout(async()=>{await this.transportOpen().catch(e=>this.logger.error(e,e==null?void 0:e.message)),this.reconnectTimeout=void 0,this.reconnectInProgress=!1},qe.toMiliseconds(fYe)))))}isInitialized(){if(!this.initialized){const{message:e}=We("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){if(await this.confirmOnlineStateOrThrow(),!this.connected){if(this.connectPromise){await this.connectPromise;return}await this.connect()}}};function jXe(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function tZ(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function nZ(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const MXe="[object RegExp]",DXe="[object String]",UXe="[object Number]",BXe="[object Boolean]",rZ="[object Arguments]",FXe="[object Symbol]",zXe="[object Date]",VXe="[object Map]",HXe="[object Set]",WXe="[object Array]",qXe="[object Function]",ZXe="[object ArrayBuffer]",MS="[object Object]",KXe="[object Error]",GXe="[object DataView]",YXe="[object Uint8Array]",JXe="[object Uint8ClampedArray]",XXe="[object Uint16Array]",QXe="[object Uint32Array]",eQe="[object BigUint64Array]",tQe="[object Int8Array]",nQe="[object Int16Array]",rQe="[object Int32Array]",iQe="[object BigInt64Array]",sQe="[object Float32Array]",aQe="[object Float64Array]";function oQe(){}function iZ(t){if(!t||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype||Object.getPrototypeOf(e)===null?Object.prototype.toString.call(t)==="[object Object]":!1}function lQe(t,e,n){return gg(t,e,void 0,void 0,void 0,void 0,n)}function gg(t,e,n,r,i,s,a){const o=a(t,e,n,r,i,s);if(o!==void 0)return o;if(typeof t==typeof e)switch(typeof t){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return t===e;case"number":return t===e||Object.is(t,e);case"function":return t===e;case"object":return Vg(t,e,s,a)}return Vg(t,e,s,a)}function Vg(t,e,n,r){if(Object.is(t,e))return!0;let i=nZ(t),s=nZ(e);if(i===rZ&&(i=MS),s===rZ&&(s=MS),i!==s)return!1;switch(i){case DXe:return t.toString()===e.toString();case UXe:{const l=t.valueOf(),u=e.valueOf();return jXe(l,u)}case BXe:case zXe:case FXe:return Object.is(t.valueOf(),e.valueOf());case MXe:return t.source===e.source&&t.flags===e.flags;case qXe:return t===e}n=n??new Map;const a=n.get(t),o=n.get(e);if(a!=null&&o!=null)return a===e;n.set(t,e),n.set(e,t);try{switch(i){case VXe:{if(t.size!==e.size)return!1;for(const[l,u]of t.entries())if(!e.has(l)||!gg(u,e.get(l),l,t,e,n,r))return!1;return!0}case HXe:{if(t.size!==e.size)return!1;const l=Array.from(t.values()),u=Array.from(e.values());for(let f=0;f<l.length;f++){const p=l[f],y=u.findIndex(g=>gg(p,g,void 0,t,e,n,r));if(y===-1)return!1;u.splice(y,1)}return!0}case WXe:case YXe:case JXe:case XXe:case QXe:case eQe:case tQe:case nQe:case rQe:case iQe:case sQe:case aQe:{if(typeof Buffer<"u"&&Buffer.isBuffer(t)!==Buffer.isBuffer(e)||t.length!==e.length)return!1;for(let l=0;l<t.length;l++)if(!gg(t[l],e[l],l,t,e,n,r))return!1;return!0}case ZXe:return t.byteLength!==e.byteLength?!1:Vg(new Uint8Array(t),new Uint8Array(e),n,r);case GXe:return t.byteLength!==e.byteLength||t.byteOffset!==e.byteOffset?!1:Vg(new Uint8Array(t),new Uint8Array(e),n,r);case KXe:return t.name===e.name&&t.message===e.message;case MS:{if(!(Vg(t.constructor,e.constructor,n,r)||iZ(t)&&iZ(e)))return!1;const l=[...Object.keys(t),...tZ(t)],u=[...Object.keys(e),...tZ(e)];if(l.length!==u.length)return!1;for(let f=0;f<l.length;f++){const p=l[f],y=t[p];if(!Object.hasOwn(e,p))return!1;const g=e[p];if(!gg(y,g,p,t,e,n,r))return!1}return!0}default:return!1}}finally{n.delete(t),n.delete(e)}}function cQe(t,e){return lQe(t,e,oQe)}var uQe=Object.defineProperty,sZ=Object.getOwnPropertySymbols,dQe=Object.prototype.hasOwnProperty,hQe=Object.prototype.propertyIsEnumerable,XL=(t,e,n)=>e in t?uQe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,aZ=(t,e)=>{for(var n in e||(e={}))dQe.call(e,n)&&XL(t,n,e[n]);if(sZ)for(var n of sZ(e))hQe.call(e,n)&&XL(t,n,e[n]);return t},Gs=(t,e,n)=>XL(t,typeof e!="symbol"?e+"":e,n);let ep=class extends QKe{constructor(e,n,r,i=uc,s=void 0){super(e,n,r,i),this.core=e,this.logger=n,this.name=r,Gs(this,"map",new Map),Gs(this,"version",pYe),Gs(this,"cached",[]),Gs(this,"initialized",!1),Gs(this,"getKey"),Gs(this,"storagePrefix",uc),Gs(this,"recentlyDeleted",[]),Gs(this,"recentlyDeletedLimit",200),Gs(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(a=>{this.getKey&&a!==null&&!Ii(a)?this.map.set(this.getKey(a),a):IZe(a)?this.map.set(a.id,a):NZe(a)&&this.map.set(a.topic,a)}),this.cached=[],this.initialized=!0)}),Gs(this,"set",async(a,o)=>{this.isInitialized(),this.map.has(a)?await this.update(a,o):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:a,value:o}),this.map.set(a,o),await this.persist())}),Gs(this,"get",a=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:a}),this.getData(a))),Gs(this,"getAll",a=>(this.isInitialized(),a?this.values.filter(o=>Object.keys(a).every(l=>cQe(o[l],a[l]))):this.values)),Gs(this,"update",async(a,o)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:a,update:o});const l=aZ(aZ({},this.getData(a)),o);this.map.set(a,l),await this.persist()}),Gs(this,"delete",async(a,o)=>{this.isInitialized(),this.map.has(a)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:a,reason:o}),this.map.delete(a),this.addToRecentlyDeleted(a),await this.persist())}),this.logger=Ka(n,this.name),this.storagePrefix=i,this.getKey=s}get context(){return ma(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const n=this.map.get(e);if(!n){if(this.recentlyDeleted.includes(e)){const{message:i}=We("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(i),new Error(i)}const{message:r}=We("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(r),new Error(r)}return n}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:n}=We("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(n),new Error(n)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=We("NOT_INITIALIZED",this.name);throw new Error(e)}}};var fQe=Object.defineProperty,pQe=(t,e,n)=>e in t?fQe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,yn=(t,e,n)=>pQe(t,typeof e!="symbol"?e+"":e,n);let mQe=class{constructor(e,n){this.core=e,this.logger=n,yn(this,"name",bYe),yn(this,"version",wYe),yn(this,"events",new SO),yn(this,"pairings"),yn(this,"initialized",!1),yn(this,"storagePrefix",uc),yn(this,"ignoredPayloadTypes",[Au]),yn(this,"registeredMethods",[]),yn(this,"init",async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))}),yn(this,"register",({methods:r})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...r])]}),yn(this,"create",async r=>{this.isInitialized();const i=DL(),s=await this.core.crypto.setSymKey(i),a=hi(qe.FIVE_MINUTES),o={protocol:Yae},l={topic:s,expiry:a,relay:o,active:!1,methods:r==null?void 0:r.methods},u=yq({protocol:this.core.protocol,version:this.core.version,topic:s,symKey:i,relay:o,expiryTimestamp:a,methods:r==null?void 0:r.methods});return this.events.emit(Uh.create,l),this.core.expirer.set(s,a),await this.pairings.set(s,l),await this.core.relayer.subscribe(s,{transportType:r==null?void 0:r.transportType,internal:r==null?void 0:r.internal}),{topic:s,uri:u}}),yn(this,"pair",async r=>{this.isInitialized();const i=this.core.eventClient.createEvent({properties:{topic:r==null?void 0:r.uri,trace:[zl.pairing_started]}});this.isValidPair(r,i);const{topic:s,symKey:a,relay:o,expiryTimestamp:l,methods:u}=mq(r.uri);i.props.properties.topic=s,i.addTrace(zl.pairing_uri_validation_success),i.addTrace(zl.pairing_uri_not_expired);let f;if(this.pairings.keys.includes(s)){if(f=this.pairings.get(s),i.addTrace(zl.existing_pairing),f.active)throw i.setError(tu.active_pairing_already_exists),new Error(`Pairing already exists: ${s}. Please try again with a new connection URI.`);i.addTrace(zl.pairing_not_expired)}const p=l||hi(qe.FIVE_MINUTES),y={topic:s,relay:o,expiry:p,active:!1,methods:u};this.core.expirer.set(s,p),await this.pairings.set(s,y),i.addTrace(zl.store_new_pairing),r.activatePairing&&await this.activate({topic:s}),this.events.emit(Uh.create,y),i.addTrace(zl.emit_inactive_pairing),this.core.crypto.keychain.has(s)||await this.core.crypto.setSymKey(a,s),i.addTrace(zl.subscribing_pairing_topic);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{i.setError(tu.no_internet_connection)}try{await this.core.relayer.subscribe(s,{relay:o})}catch(g){throw i.setError(tu.subscribe_pairing_topic_failure),g}return i.addTrace(zl.subscribe_pairing_topic_success),y}),yn(this,"activate",async({topic:r})=>{this.isInitialized();const i=hi(qe.FIVE_MINUTES);this.core.expirer.set(r,i),await this.pairings.update(r,{active:!0,expiry:i})}),yn(this,"ping",async r=>{this.isInitialized(),await this.isValidPing(r),this.logger.warn("ping() is deprecated and will be removed in the next major release.");const{topic:i}=r;if(this.pairings.keys.includes(i)){const s=await this.sendRequest(i,"wc_pairingPing",{}),{done:a,resolve:o,reject:l}=Lh();this.events.once(jn("pairing_ping",s),({error:u})=>{u?l(u):o()}),await a()}}),yn(this,"updateExpiry",async({topic:r,expiry:i})=>{this.isInitialized(),await this.pairings.update(r,{expiry:i})}),yn(this,"updateMetadata",async({topic:r,metadata:i})=>{this.isInitialized(),await this.pairings.update(r,{peerMetadata:i})}),yn(this,"getPairings",()=>(this.isInitialized(),this.pairings.values)),yn(this,"disconnect",async r=>{this.isInitialized(),await this.isValidDisconnect(r);const{topic:i}=r;this.pairings.keys.includes(i)&&(await this.sendRequest(i,"wc_pairingDelete",Er("USER_DISCONNECTED")),await this.deletePairing(i))}),yn(this,"formatUriFromPairing",r=>{this.isInitialized();const{topic:i,relay:s,expiry:a,methods:o}=r,l=this.core.crypto.keychain.get(i);return yq({protocol:this.core.protocol,version:this.core.version,topic:i,symKey:l,relay:s,expiryTimestamp:a,methods:o})}),yn(this,"sendRequest",async(r,i,s)=>{const a=ul(i,s),o=await this.core.crypto.encode(r,a),l=qy[i].req;return this.core.history.set(r,a),this.core.relayer.publish(r,o,l),a.id}),yn(this,"sendResult",async(r,i,s)=>{const a=_6(r,s),o=await this.core.crypto.encode(i,a),l=(await this.core.history.get(i,r)).request.method,u=qy[l].res;await this.core.relayer.publish(i,o,u),await this.core.history.resolve(a)}),yn(this,"sendError",async(r,i,s)=>{const a=b9(r,s),o=await this.core.crypto.encode(i,a),l=(await this.core.history.get(i,r)).request.method,u=qy[l]?qy[l].res:qy.unregistered_method.res;await this.core.relayer.publish(i,o,u),await this.core.history.resolve(a)}),yn(this,"deletePairing",async(r,i)=>{await this.core.relayer.unsubscribe(r),await Promise.all([this.pairings.delete(r,Er("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(r),i?Promise.resolve():this.core.expirer.del(r)])}),yn(this,"cleanup",async()=>{const r=this.pairings.getAll().filter(i=>Zl(i.expiry));await Promise.all(r.map(i=>this.deletePairing(i.topic)))}),yn(this,"onRelayEventRequest",async r=>{const{topic:i,payload:s}=r;switch(s.method){case"wc_pairingPing":return await this.onPairingPingRequest(i,s);case"wc_pairingDelete":return await this.onPairingDeleteRequest(i,s);default:return await this.onUnknownRpcMethodRequest(i,s)}}),yn(this,"onRelayEventResponse",async r=>{const{topic:i,payload:s}=r,a=(await this.core.history.get(i,s.id)).request.method;switch(a){case"wc_pairingPing":return this.onPairingPingResponse(i,s);default:return this.onUnknownRpcMethodResponse(a)}}),yn(this,"onPairingPingRequest",async(r,i)=>{const{id:s}=i;try{this.isValidPing({topic:r}),await this.sendResult(s,r,!0),this.events.emit(Uh.ping,{id:s,topic:r})}catch(a){await this.sendError(s,r,a),this.logger.error(a)}}),yn(this,"onPairingPingResponse",(r,i)=>{const{id:s}=i;setTimeout(()=>{Wl(i)?this.events.emit(jn("pairing_ping",s),{}):_o(i)&&this.events.emit(jn("pairing_ping",s),{error:i.error})},500)}),yn(this,"onPairingDeleteRequest",async(r,i)=>{const{id:s}=i;try{this.isValidDisconnect({topic:r}),await this.deletePairing(r),this.events.emit(Uh.delete,{id:s,topic:r})}catch(a){await this.sendError(s,r,a),this.logger.error(a)}}),yn(this,"onUnknownRpcMethodRequest",async(r,i)=>{const{id:s,method:a}=i;try{if(this.registeredMethods.includes(a))return;const o=Er("WC_METHOD_UNSUPPORTED",a);await this.sendError(s,r,o),this.logger.error(o)}catch(o){await this.sendError(s,r,o),this.logger.error(o)}}),yn(this,"onUnknownRpcMethodResponse",r=>{this.registeredMethods.includes(r)||this.logger.error(Er("WC_METHOD_UNSUPPORTED",r))}),yn(this,"isValidPair",(r,i)=>{var s;if(!Js(r)){const{message:o}=We("MISSING_OR_INVALID",`pair() params: ${r}`);throw i.setError(tu.malformed_pairing_uri),new Error(o)}if(!$Ze(r.uri)){const{message:o}=We("MISSING_OR_INVALID",`pair() uri: ${r.uri}`);throw i.setError(tu.malformed_pairing_uri),new Error(o)}const a=mq(r==null?void 0:r.uri);if(!((s=a==null?void 0:a.relay)!=null&&s.protocol)){const{message:o}=We("MISSING_OR_INVALID","pair() uri#relay-protocol");throw i.setError(tu.malformed_pairing_uri),new Error(o)}if(!(a!=null&&a.symKey)){const{message:o}=We("MISSING_OR_INVALID","pair() uri#symKey");throw i.setError(tu.malformed_pairing_uri),new Error(o)}if(a!=null&&a.expiryTimestamp&&qe.toMiliseconds(a==null?void 0:a.expiryTimestamp)<Date.now()){i.setError(tu.pairing_expired);const{message:o}=We("EXPIRED","pair() URI has expired. Please try again with a new connection URI.");throw new Error(o)}}),yn(this,"isValidPing",async r=>{if(!Js(r)){const{message:s}=We("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(s)}const{topic:i}=r;await this.isValidPairingTopic(i)}),yn(this,"isValidDisconnect",async r=>{if(!Js(r)){const{message:s}=We("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(s)}const{topic:i}=r;await this.isValidPairingTopic(i)}),yn(this,"isValidPairingTopic",async r=>{if(!gi(r,!1)){const{message:i}=We("MISSING_OR_INVALID",`pairing topic should be a string: ${r}`);throw new Error(i)}if(!this.pairings.keys.includes(r)){const{message:i}=We("NO_MATCHING_KEY",`pairing topic doesn't exist: ${r}`);throw new Error(i)}if(Zl(this.pairings.get(r).expiry)){await this.deletePairing(r);const{message:i}=We("EXPIRED",`pairing topic: ${r}`);throw new Error(i)}}),this.core=e,this.logger=Ka(n,this.name),this.pairings=new ep(this.core,this.logger,this.name,this.storagePrefix)}get context(){return ma(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=We("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(ei.message,async e=>{const{topic:n,message:r,transportType:i}=e;if(this.pairings.keys.includes(n)&&i!==Cr.link_mode&&!this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(r)))try{const s=await this.core.crypto.decode(n,r);iP(s)?(this.core.history.set(n,s),await this.onRelayEventRequest({topic:n,payload:s})):w9(s)&&(await this.core.history.resolve(s),await this.onRelayEventResponse({topic:n,payload:s}),this.core.history.delete(n,s.id)),await this.core.relayer.messages.ack(n,r)}catch(s){this.logger.error(s)}})}registerExpirerEvents(){this.core.expirer.on(po.expired,async e=>{const{topic:n}=Bse(e.target);n&&this.pairings.keys.includes(n)&&(await this.deletePairing(n,!0),this.events.emit(Uh.expire,{topic:n}))})}};var yQe=Object.defineProperty,gQe=(t,e,n)=>e in t?yQe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,is=(t,e,n)=>gQe(t,typeof e!="symbol"?e+"":e,n);let bQe=class extends GKe{constructor(e,n){super(e,n),this.core=e,this.logger=n,is(this,"records",new Map),is(this,"events",new Za.EventEmitter),is(this,"name",vYe),is(this,"version",_Ye),is(this,"cac
568hed",[]),is(this,"initialized",!1),is(this,"storagePrefix",uc),is(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(r=>this.records.set(r.id,r)),this.cached=[],this.registerEventListeners(),this.initialized=!0)}),is(this,"set",(r,i,s)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:r,request:i,chainId:s}),this.records.has(i.id))return;const a={id:i.id,topic:r,request:{method:i.method,params:i.params||null},chainId:s,expiry:hi(qe.THIRTY_DAYS)};this.records.set(a.id,a),this.persist(),this.events.emit(Xo.created,a)}),is(this,"resolve",async r=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:r}),!this.records.has(r.id))return;const i=await this.getRecord(r.id);typeof i.response>"u"&&(i.response=_o(r)?{error:r.error}:{result:r.result},this.records.set(i.id,i),this.persist(),this.events.emit(Xo.updated,i))}),is(this,"get",async(r,i)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:r,id:i}),await this.getRecord(i))),is(this,"delete",(r,i)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:i}),this.values.forEach(s=>{if(s.topic===r){if(typeof i<"u"&&s.id!==i)return;this.records.delete(s.id),this.events.emit(Xo.deleted,s)}}),this.persist()}),is(this,"exists",async(r,i)=>(this.isInitialized(),this.records.has(i)?(await this.getRecord(i)).topic===r:!1)),is(this,"on",(r,i)=>{this.events.on(r,i)}),is(this,"once",(r,i)=>{this.events.once(r,i)}),is(this,"off",(r,i)=>{this.events.off(r,i)}),is(this,"removeListener",(r,i)=>{this.events.removeListener(r,i)}),this.logger=Ka(n,this.name)}get context(){return ma(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(n=>{if(typeof n.response<"u")return;const r={topic:n.topic,request:ul(n.request.method,n.request.params,n.id),chainId:n.chainId};return e.push(r)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const n=this.records.get(e);if(!n){const{message:r}=We("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(r)}return n}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(Xo.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:n}=We("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(n),new Error(n)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(Xo.created,e=>{const n=Xo.created;this.logger.info(`Emitting ${n}`),this.logger.debug({type:"event",event:n,record:e})}),this.events.on(Xo.updated,e=>{const n=Xo.updated;this.logger.info(`Emitting ${n}`),this.logger.debug({type:"event",event:n,record:e})}),this.events.on(Xo.deleted,e=>{const n=Xo.deleted;this.logger.info(`Emitting ${n}`),this.logger.debug({type:"event",event:n,record:e})}),this.core.heartbeat.on(Xf.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(n=>{qe.toMiliseconds(n.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${n.id}`),this.records.delete(n.id),this.events.emit(Xo.deleted,n,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=We("NOT_INITIALIZED",this.name);throw new Error(e)}}};var wQe=Object.defineProperty,vQe=(t,e,n)=>e in t?wQe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,vs=(t,e,n)=>vQe(t,typeof e!="symbol"?e+"":e,n);let _Qe=class extends tGe{constructor(e,n){super(e,n),this.core=e,this.logger=n,vs(this,"expirations",new Map),vs(this,"events",new Za.EventEmitter),vs(this,"name",xYe),vs(this,"version",CYe),vs(this,"cac
568hed",[]),vs(this,"initialized",!1),vs(this,"storagePrefix",uc),vs(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(r=>this.expirations.set(r.target,r)),this.cached=[],this.registerEventListeners(),this.initialized=!0)}),vs(this,"has",r=>{try{const i=this.formatTarget(r);return typeof this.getExpiration(i)<"u"}catch{return!1}}),vs(this,"set",(r,i)=>{this.isInitialized();const s=this.formatTarget(r),a={target:s,expiry:i};this.expirations.set(s,a),this.checkExpiry(s,a),this.events.emit(po.created,{target:s,expiration:a})}),vs(this,"get",r=>{this.isInitialized();const i=this.formatTarget(r);return this.getExpiration(i)}),vs(this,"del",r=>{if(this.isInitialized(),this.has(r)){const i=this.formatTarget(r),s=this.getExpiration(i);this.expirations.delete(i),this.events.emit(po.deleted,{target:i,expiration:s})}}),vs(this,"on",(r,i)=>{this.events.on(r,i)}),vs(this,"once",(r,i)=>{this.events.once(r,i)}),vs(this,"off",(r,i)=>{this.events.off(r,i)}),vs(this,"removeListener",(r,i)=>{this.events.removeListener(r,i)}),this.logger=Ka(n,this.name)}get context(){return ma(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e=="string")return lHe(e);if(typeof e=="number")return cHe(e);const{message:n}=We("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(n)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(po.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:n}=We("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(n),new Error(n)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const n=this.expirations.get(e);if(!n){const{message:r}=We("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.warn(r),new Error(r)}return n}checkExpiry(e,n){const{expiry:r}=n;qe.toMiliseconds(r)-Date.now()<=0&&this.expire(e,n)}expire(e,n){this.expirations.delete(e),this.events.emit(po.expired,{target:e,expiration:n})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,n)=>this.checkExpiry(n,e))}registerEventListeners(){this.core.heartbeat.on(Xf.pulse,()=>this.checkExpirations()),this.events.on(po.created,e=>{const n=po.created;this.logger.info(`Emitting ${n}`),this.logger.debug({type:"event",event:n,data:e}),this.persist()}),this.events.on(po.expired,e=>{const n=po.expired;this.logger.info(`Emitting ${n}`),this.logger.debug({type:"event",event:n,data:e}),this.persist()}),this.events.on(po.deleted,e=>{const n=po.deleted;this.logger.info(`Emitting ${n}`),this.logger.debug({type:"event",event:n,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=We("NOT_INITIALIZED",this.name);throw new Error(e)}}};var xQe=Object.defineProperty,CQe=(t,e,n)=>e in t?xQe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ui=(t,e,n)=>CQe(t,typeof e!="symbol"?e+"":e,n);let EQe=class extends nGe{constructor(e,n,r){super(e,n,r),this.core=e,this.logger=n,this.store=r,ui(this,"name",EYe),ui(this,"abortController"),ui(this,"isDevEnv"),ui(this,"verifyUrlV3",AYe),ui(this,"storagePrefix",uc),ui(this,"version",Gae),ui(this,"publicKey"),ui(this,"fetchPromise"),ui(this,"init",async()=>{var i;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&qe.toMiliseconds((i=this.publicKey)==null?void 0:i.expiresAt)<Date.now()&&(this.logger.debug("verify v2 public key expired"),await this.removePublicKey()))}),ui(this,"register",async i=>{if(!mm()||this.isDevEnv)return;const s=window.location.origin,{id:a,decryptedId:o}=i,l=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${s}&id=${a}&decryptedId=${o}`;try{const u=Ru.getDocument(),f=this.startAbortTimer(qe.ONE_SECOND*5),p=await new Promise((y,g)=>{const b=()=>{window.removeEventListener("message",_),u.body.removeChild(v),g("attestation aborted")};this.abortController.signal.addEventListener("abort",b);const v=u.createElement("iframe");v.src=l,v.style.display="none",v.addEventListener("error",b,{signal:this.abortController.signal});const _=C=>
vendor: 7,415 bytes, line 568
568{if(C.data&&typeof C.data=="string")try{const S=JSON.parse(C.data);if(S.type==="verify_attestation"){if(EL(S.attestation).payload.id!==a)return;clearInterval(f),u.body.removeChild(v),this.abortController.signal.removeEventListener("abort",b),window.removeEventListener("message",_),y(S.attestation===null?"":S.attestation)}}catch(S){this.logger.warn(S)}};u.body.appendChild(v),window.addEventListener("message",_,{signal:this.abortController.signal})});return this.logger.debug(p,"jwt attestation"),p}catch(u){this.logger.warn(u)}return""}),ui(this,"resolve",async i=>{if(this.isDevEnv)return"";const{attestationId:s,hash:a,encryptedId:o}=i;if(s===""){this.logger.debug("resolve: attestationId is empty, skipping");return}if(s){if(EL(s).payload.id!==o)return;const u=await this.isValidJwtAttestation(s);if(u){if(!u.isVerified){this.logger.warn("resolve: jwt attestation: origin url not verified");return}return u}}if(!a)return;const l=this.getVerifyUrl(i==null?void 0:i.verifyUrl);return this.fetchAttestation(a,l)}),ui(this,"fetchAttestation",async(i,s)=>{this.logger.debug(`resolving attestation: ${i} from url: ${s}`);const a=this.startAbortTimer(qe.ONE_SECOND*5),o=await fetch(`${s}/attestation/${i}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(a),o.status===200?await o.json():void 0}),ui(this,"getVerifyUrl",i=>{let s=i||zg;return kYe.includes(s)||(this.logger.info(`verify url: ${s}, not included in trusted list, assigning default: ${zg}`),s=zg),s}),ui(this,"fetchPublicKey",async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);const i=this.startAbortTimer(qe.FIVE_SECONDS),s=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(i),await s.json()}catch(i){this.logger.warn(i)}}),ui(this,"persistPublicKey",async i=>{this.logger.debug(i,"persisting public key to local storage"),await this.store.setItem(this.storeKey,i),this.publicKey=i}),ui(this,"removePublicKey",async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0}),ui(this,"isValidJwtAttestation",async i=>{const s=await this.getPublicKey();try{if(s)return this.validateAttestation(i,s)}catch(o){this.logger.error(o),this.logger.warn("error validating attestation")}const a=await this.fetchAndPersistPublicKey();try{if(a)return this.validateAttestation(i,a)}catch(o){this.logger.error(o),this.logger.warn("error validating attestation")}}),ui(this,"getPublicKey",async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey()),ui(this,"fetchAndPersistPublicKey",async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async s=>{const a=await this.fetchPublicKey();a&&(await this.persistPublicKey(a),s(a))});const i=await this.fetchPromise;return this.fetchPromise=void 0,i}),ui(this,"validateAttestation",(i,s)=>{const a=rZe(i,s.publicKey),o={hasExpired:qe.toMiliseconds(a.exp)<Date.now(),payload:a};if(o.hasExpired)throw this.logger.warn("resolve: jwt attestation expired"),new Error("JWT attestation expired");return{origin:o.payload.origin,isScam:o.payload.isScam,isVerified:o.payload.isVerified}}),this.logger=Ka(n,this.name),this.abortController=new AbortController,this.isDevEnv=HO(),this.init()}get storeKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//verify:public:key"}get context(){return ma(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),qe.toMiliseconds(e))}};var SQe=Object.defineProperty,AQe=(t,e,n)=>e in t?SQe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,oZ=(t,e,n)=>AQe(t,typeof e!="symbol"?e+"":e,n);let kQe=class extends rGe{constructor(e,n){super(e,n),this.projectId=e,this.logger=n,oZ(this,"context",TYe),oZ(this,"registerDeviceToken",async r=>{const{clientId:i,token:s,notificationType:a,enableEncrypted:o=!1}=r,l=`${LYe}/${this.projectId}/clients`;await fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:i,type:a,token:s,always_raw:o})})}),this.logger=Ka(n,this.context)}};var TQe=Object.defineProperty,lZ=Object.getOwnPropertySymbols,LQe=Object.prototype.hasOwnProperty,$Qe=Object.prototype.propertyIsEnumerable,QL=(t,e,n)=>e in t?TQe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Gy=(t,e)=>{for(var n in e||(e={}))LQe.call(e,n)&&QL(t,n,e[n]);if(lZ)for(var n of lZ(e))$Qe.call(e,n)&&QL(t,n,e[n]);return t},Di=(t,e,n)=>QL(t,typeof e!="symbol"?e+"":e,n);let IQe=class extends iGe{constructor(e,n,r=!0){super(e,n,r),this.core=e,this.logger=n,Di(this,"context",IYe),Di(this,"storagePrefix",uc),Di(this,"storageVersion",$Ye),Di(this,"events",new Map),Di(this,"shouldPersist",!1),Di(this,"init",async()=>{if(!HO())try{const i={eventId:RW(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:"INIT",type:"",properties:{client_id:await this.core.crypto.getClientId(),user_agent:Dse(this.core.relayer.protocol,this.core.relayer.version,WL)}}};await this.sendEvent([i])}catch(i){this.logger.warn(i)}}),Di(this,"createEvent",i=>{const{event:s="ERROR",type:a="",properties:{topic:o,trace:l}}=i,u=RW(),f=this.core.projectId||"",p=Date.now(),y=Gy({eventId:u,timestamp:p,props:{event:s,type:a,properties:{topic:o,trace:l}},bundleId:f,domain:this.getAppDomain()},this.setMethods(u));return this.telemetryEnabled&&(this.events.set(u,y),this.shouldPersist=!0),y}),Di(this,"getEvent",i=>{const{eventId:s,topic:a}=i;if(s)return this.events.get(s);const o=Array.from(this.events.values()).find(l=>l.props.properties.topic===a);if(o)return Gy(Gy({},o),this.setMethods(o.eventId))}),Di(this,"deleteEvent",i=>{const{eventId:s}=i;this.events.delete(s),this.shouldPersist=!0}),Di(this,"setEventListeners",()=>{this.core.heartbeat.on(Xf.pulse,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(i=>{qe.fromMiliseconds(Date.now())-qe.fromMiliseconds(i.timestamp)>NYe&&(this.events.delete(i.eventId),this.shouldPersist=!0)})})}),Di(this,"setMethods",i=>({addTrace:s=>this.addTrace(i,s),setError:s=>this.setError(i,s)})),Di(this,"addTrace",(i,s)=>{const a=this.events.get(i);a&&(a.props.properties.trace.push(s),this.events.set(i,a),this.shouldPersist=!0)}),Di(this,"setError",(i,s)=>{const a=this.events.get(i);a&&(a.props.type=s,a.timestamp=Date.now(),this.events.set(i,a),this.shouldPersist=!0)}),Di(this,"persist",async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1}),Di(this,"restore",async()=>{try{const i=await this.core.storage.getItem(this.storageKey)||[];if(!i.length)return;i.forEach(s=>{this.events.set(s.eventId,Gy(Gy({},s),this.setMethods(s.eventId)))})}catch(i){this.logger.warn(i)}}),Di(this,"submit",async()=>{if(!this.telemetryEnabled||this.events.size===0)return;const i=[];for(const[s,a]of this.events)a.props.type&&i.push(a);if(i.length!==0)try{if((await this.sendEvent(i)).ok)for(const s of i)this.events.delete(s.eventId),this.shouldPersist=!0}catch(s){this.logger.warn(s)}}),Di(this,"sendEvent",async i=>{const s=this.getAppDomain()?"":"&sp=desktop";return await fetch(`${OYe}?projectId=${this.core.projectId}&st=events_sdk&sv=js-${WL}${s}`,{method:"POST",body:JSON.stringify(i)})}),Di(this,"getAppDomain",()=>Mse().url),this.logger=Ka(n,this.context),this.telemetryEnabled=r,r?this.restore(
568).then(async()=>{await this.submit(),this.setEventListeners()}):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+"//"+this.context}};var NQe=Object.defineProperty,cZ=Object.getOwnPropertySymbols,OQe=Object.prototype.hasOwnProperty,PQe=Object.prototype.propertyIsEnumerable,e$=(t,e,n)=>e in t?NQe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,uZ=(t,e)=>{for(var n in e||(e={}))OQe.call(e,n)&&e$(t,n,e[n]);if(cZ)for(var n of cZ(e))PQe.call(e,n)&&e$(t,n,e[n]);return t},ur=(t,e,n)=>e$(t,typeof e!="symbol"?e+"":e,n);let RQe=class uoe extends WKe{constructor(e){var n;super(e),ur(this,"protocol",Kae),ur(this,"version",Gae),ur(this,"name",HL),ur(this,"relayUrl"),ur(this,"projectId"),ur(this,"customStoragePrefix"),ur(this,"events",new Za.EventEmitter),ur(this,"logger"),ur(this,"heartbeat"),ur(this,"relayer"),ur(this,"crypto"),ur(this,"storage"),ur(this,"history"),ur(this,"expirer"),ur(this,"pairing"),ur(this,"verify"),ur(this,"echoClient"),ur(this,"linkModeSupportedApps"),ur(this,"eventClient"),ur(this,"initialized",!1),ur(this,"logChunkController"),ur(this,"on",(o,l)=>this.events.on(o,l)),ur(this,"once",(o,l)=>this.events.once(o,l)),ur(this,"off",(o,l)=>this.events.off(o,l)),ur(this,"removeListener",(o,l)=>this.events.removeListener(o,l)),ur(this,"dispatchEnvelope",({topic:o,message:l,sessionExists:u})=>{if(!o||!l)return;const f={topic:o,message:l,publishedAt:Date.now(),transportType:Cr.link_mode};this.relayer.onLinkMessageEvent(f,{sessionExists:u})});const r=this.getGlobalCore(e==null?void 0:e.customStoragePrefix);if(r)try{return this.customStoragePrefix=r.customStoragePrefix,this.logger=r.logger,this.heartbeat=r.heartbeat,this.crypto=r.crypto,this.history=r.history,this.expirer=r.expirer,this.storage=r.storage,this.relayer=r.relayer,this.pairing=r.pairing,this.verify=r.verify,this.echoClient=r.echoClient,this.linkModeSupportedApps=r.linkModeSupportedApps,this.eventClient=r.eventClient,this.initialized=r.initialized,this.logChunkController=r.logChunkController,r}catch(o){console.warn("Failed to copy global core",o)}this.projectId=e==null?void 0:e.projectId,this.relayUrl=(e==null?void 0:e.relayUrl)||Jae,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const i=BVe({level:typeof(e==null?void 0:e.logger)=="string"&&e.logger?e.logger:eYe.logger,name:HL}),{logger:s,chunkLoggerController:a}=Rse({opts:i,maxSizeInBytes:e==null?void 0:e.maxLogBlobSizeInBytes,loggerOverride:e==null?void 0:e.logger});this.logChunkController=a,(n=this.logChunkController)!=null&&n.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var o,l;(o=this.logChunkController)!=null&&o.downloadLogsBlobInBrowser&&((l=this.logChunkController)==null||l.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=Ka(s,this.name),this.heartbeat=new fKe,this.crypto=new lXe(this,this.logger,e==null?void 0:e.keychain),this.history=new bQe(this,this.logger),this.expirer=new _Qe(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new zKe(uZ(uZ({},tYe),e==null?void 0:e.storageOptions)),this.relayer=new RXe({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new mQe(this,this.logger),this.verify=new EQe(this,this.logger,this.storage),this.echoClient=new kQe(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new IQe(this,this.logger,e==null?void 0:e.telemetryEnabled),this.setGlobalCore(this)}static async init(e){const n=new uoe(e);await n.initialize();const r=await n.crypto.getClientId();return await n.storage.setItem(mYe,r),n}get context(){return ma(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var e;return(e=this.logChunkController)==null?void 0:e.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(e){this.linkModeSupportedApps.includes(e)||(this.linkModeSupportedApps.push(e),await this.storage.setItem(zq,this.linkModeSupportedApps))}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(
vendor: 61,676 bytes, line 568
568),await this.pairing.init(),this.linkModeSupportedApps=await this.storage.getItem(zq)||[],this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(e,`Core Initialization Failure at epoch ${Date.now()}`),this.logger.error(e.message),e}}getGlobalCore(e=""){try{if(this.isGlobalCoreDisabled())return;const n=`_walletConnectCore_${e}`,r=`${n}_count`;return globalThis[r]=(globalThis[r]||0)+1,globalThis[r]>1&&console.warn(`WalletConnect Core is already initialized. This is probably a mistake and can lead to unexpected behavior. Init() was called ${globalThis[r]} times.`),globalThis[n]}catch(n){console.warn("Failed to get global WalletConnect core",n);return}}setGlobalCore(e){var n;try{if(this.isGlobalCoreDisabled())return;const r=`_walletConnectCore_${((n=e.opts)==null?void 0:n.customStoragePrefix)||""}`;globalThis[r]=e}catch(r){console.warn("Failed to set global WalletConnect core",r)}}isGlobalCoreDisabled(){try{return typeof process<"u"&&QGe.DISABLE_GLOBAL_CORE==="true"}catch{return!0}}};const jQe=RQe,doe="wc",hoe=2,foe="client",aP=`${doe}@${hoe}:${foe}:`,DS={name:foe,logger:"error"},dZ="WALLETCONNECT_DEEPLINK_CHOICE",MQe="proposal",hZ="Proposal expired",DQe="session",c0=qe.SEVEN_DAYS,UQe="engine",ss={wc_sessionPropose:{req:{ttl:qe.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:qe.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:qe.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:qe.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:qe.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:qe.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:qe.ONE_DAY,prompt:!1,tag:1104},res:{ttl:qe.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:qe.ONE_DAY,prompt:!1,tag:1106},res:{ttl:qe.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:qe.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:qe.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:qe.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:qe.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:qe.ONE_DAY,prompt:!1,tag:1112},res:{ttl:qe.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:qe.ONE_DAY,prompt:!1,tag:1114},res:{ttl:qe.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:qe.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:qe.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:qe.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:qe.FIVE_MINUTES,prompt:!1,tag:1119}}},US={min:qe.FIVE_MINUTES,max:qe.SEVEN_DAYS},Dl={idle:"IDLE",active:"ACTIVE"},BQe={eth_sendTransaction:{key:""},eth_sendRawTransaction:{key:""},wallet_sendCalls:{key:""},solana_signTransaction:{key:"signature"},solana_signAllTransactions:{key:"transactions"},solana_signAndSendTransaction:{key:"signature"},sui_signAndExecuteTransaction:{key:"digest"},sui_signTransaction:{key:""},hedera_signAndExecuteTransaction:{key:"transactionId"},hedera_executeTransaction:{key:"transactionId"},near_signTransaction:{key:""},near_signTransactions:{key:""},tron_signTransaction:{key:"txID"},xrpl_signTransaction:{key:""},xrpl_signTransactionFor:{key:""},algo_signTxn:{key:""},sendTransfer:{key:"txid"},stacks_stxTransfer:{key:"txId"},polkadot_signTransaction:{key:""},cosmos_signDirect:{key:""}},FQe="request",zQe=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],VQe="wc",HQe="auth",WQe="authKeys",qQe="pairingTopics",ZQe="requests",_9=`${VQe}@${1.5}:${HQe}:`,Ww=`${_9}:PUB_KEY`;var KQe=Object.defineProperty,GQe=Object.defineProperties,YQe=Object.getOwnPropertyDescriptors,fZ=Object.getOwnPropertySymbols,JQe=Object.prototype.hasOwnProperty,XQe=Object.prototype.propertyIsEnumerable,t$=(t,e,n)=>e in t?KQe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,zn=(t,e)=>{for(var n in e||(e={}))JQe.call(e,n)&&t$(t,n,e[n]);if(fZ)for(var n of fZ(e))XQe.call(e,n)&&t$(t,n,e[n]);return t},_s=(t,e)=>GQe(t,YQe(e)),Me=(t,e,n)=>t$(t,typeof e!="symbol"?e+"":e,n);class QQe extends lGe{constructor(e){super(e),Me(this,"name",UQe),Me(this,"events",new SO),Me(this,"initialized",!1),Me(this,"requestQueue",{state:Dl.idle,queue:[]}),Me(this,"sessionRequestQueue",{state:Dl.idle,queue:[]}),Me(this,"emittedSessionRequests",new bHe({limit:500})),Me(this,"requestQueueDelay",qe.ONE_SECOND),Me(this,"expectedPairingMethodMap",new Map),Me(this,"recentlyDeletedMap",new Map),Me(this,"recentlyDeletedLimit",200),Me(this,"relayMessageCache",[]),Me(this,"pendingSessions",new Map),Me(this,"init",async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),await this.registerLinkModeListeners(),this.client.core.pairing.register({methods:Object.keys(ss)}),this.initialized=!0,setTimeout(async()=>{await this.processPendingMessageEvents(),this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},qe.toMiliseconds(this.requestQueueDelay)))}),Me(this,"connect",async n=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();const r=_s(zn({},n),{requiredNamespaces:n.requiredNamespaces||{},optionalNamespaces:n.optionalNamespaces||{}});await this.isValidConnect(r),r.optionalNamespaces=SZe(r.requiredNamespaces,r.optionalNamespaces),r.requiredNamespaces={};const{pairingTopic:i,requiredNamespaces:s,optionalNamespaces:a,sessionProperties:o,scopedProperties:l,relays:u}=r;let f=i,p,y=!1;try{if(f){const $=this.client.core.pairing.pairings.get(f);this.client.logger.warn("connect() with existing pairing topic is deprecated and will be removed in the next major release."),y=$.active}}catch($){throw this.client.logger.error(`connect() -> pairing.get(${f}) failed`),$}if(!f||!y){const{topic:$,uri:O}=await this.client.core.pairing.create({internal:{skipSubscribe:!0}});f=$,p=O}if(!f){const{message:$}=We("NO_MATCHING_KEY",`connect() pairing topic: ${f}`);throw new Error($)}const g=await this.client.core.crypto.generateKeyPair(),b=ss.wc_sessionPropose.req.ttl||qe.FIVE_MINUTES,v=hi(b),_=_s(zn(zn({requiredNamespaces:s,optionalNamespaces:a,relays:u??[{protocol:Yae}],proposer:{publicKey:g,metadata:this.client.metadata},expiryTimestamp:v,pairingTopic:f},o&&{sessionProperties:o}),l&&{scopedProperties:l}),{id:Hl()}),C=jn("session_connect",_.id),{reject:S,resolve:x,done:A}=Lh(b,hZ),I=({id:$})=>{$===_.id&&(this.client.events.off("proposal_expire",I),this.pendingSessions.delete(_.id),this.events.emit(C,{error:{message:hZ,code:0}}))};return this.client.events.on("proposal_expire",I),this.events.once(C,({error:$,session:O})=>{this.client.events.off("proposal_expire",I),$?S($):O&&x(O)}),await this.sendProposeSession({proposal:_,publishOpts:{internal:{throwOnFailedPublish:!0},tvf:{correlationId:_.id}}}),await this.setProposal(_.id,_),{uri:p,approval:A}}),Me(this,"pair",async n=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(n)}catch(r){throw this.client.logger.error("pair() failed"),r}}),Me(this,"approve",async n=>{var r,i,s;const a=this.client.core.eventClient.createEvent({properties:{topic:(r=n==null?void 0:n.id)==null?void 0:r.toString(),trace:[Qo.session_approve_started]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(j){throw a.setError(_h.no_internet_connection),j}try{await this.isValidProposalId(n==null?void 0:n.id)}catch(j){throw this.client.logger.error(`approve() -> proposal.get(${n==null?void 0:n.id}) failed`),a.setError(_h.proposal_not_found),j}try{await this.isValidApprove(n)}catch(j){throw this.client.logger.error("approve() -> isValidApprove() failed"),a.setError(_h.session_approve_namespace_validation_failure),j}const{id:o,relayProtocol:l,namespaces:u,sessionProperties:f,scopedProperties:p,sessionConfig:y}=n,g=this.client.proposal.get(o);this.client.core.eventClient.deleteEvent({eventId:a.eventId});const{pairingTopic:b,proposer:v,requiredNamespaces:_,optionalNamespaces:C}=g;let S=(i=this.client.core.eventClient)==null?void 0:i.getEvent({topic:b});S||(S=(s=this.client.core.eventClient)==null?void 0:s.createEvent({type:Qo.session_approve_started,properties:{topic:b,trace:[Qo.session_approve_started,Qo.session_namespaces_validation_success]}}));const x=await this.client.core.crypto.generateKeyPair(),A=v.publicKey,I=await this.client.core.crypto.generateSharedKey(x,A),$=zn(zn(zn({relay:{protocol:l??"irn"},namespaces:u,controller:{publicKey:x,metadata:this.client.metadata},expiry:hi(c0)},f&&{sessionProperties:f}),p&&{scopedProperties:p}),y&&{sessionConfig:y}),O=Cr.relay;S.addTrace(Qo.subscribing_session_topic);try{await this.client.core.relayer.subscribe(I,{transportType:O,internal:{skipSubscribe:!0}})}catch(j){throw S.setError(_h.subscribe_session_topic_failure),j}S.addTrace(Qo.subscribe_session_topic_success);const P=_s(zn({},$),{topic:I,requiredNamespaces:_,optionalNamespaces:C,pairingTopic:b,acknowledged:!1,self:$.controller,peer:{publicKey:v.publicKey,metadata:v.metadata},controller:x,transportType:Cr.relay});await this.client.session.set(I,P),S.addTrace(Qo.store_session);try{await this.sendApproveSession({sessionTopic:I,proposal:g,pairingProposalResponse:{relay:{protocol:l??"irn"},responderPublicKey:x},sessionSettleRequest:$,publishOpts:{internal:{throwOnFailedPublish:!0},tvf:{correlationId:o}}}),S.addTrace(Qo.session_approve_publish_success)}catch(j){throw this.client.logger.error(j),this.client.session.delete(I,Er("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(I),j}return this.client.core.eventClient.deleteEvent({eventId:S.eventId}),await this.client.core.pairing.updateMetadata({topic:b,metadata:v.metadata}),await this.deleteProposal(o),await this.client.core.pairing.activate({topic:b}),await this.setExpiry(I,hi(c0)),{topic:I,acknowledged:()=>Promise.resolve(this.client.session.get(I))}}),Me(this,"reject",async n=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(n)}catch(a){throw this.client.logger.error("reject() -> isValidReject() failed"),a}const{id:r,reason:i}=n;let s;try{s=this.client.proposal.get(r).pairingTopic}catch(a){throw this.client.logger.error(`reject() -> proposal.get(${r}) failed`),a}s&&await this.sendError({id:r,topic:s,error:i,rpcOpts:ss.wc_sessionPropose.reject}),await this.deleteProposal(r)}),Me(this,"update",async n=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(n)}catch(p){throw this.client.logger.error("update() -> isValidUpdate() failed"),p}const{topic:r,namespaces:i}=n,{done:s,resolve:a,reject:o}=Lh(),l=Hl(),u=f2().toString(),f=this.client.session.get(r).namespaces;return this.events.once(jn("session_update",l),({error:p})=>{p?o(p):a()}),await this.client.session.update(r,{namespaces:i}),await this.sendRequest({topic:r,method:"wc_sessionUpdate",params:{namespaces:i},throwOnFailedPublish:!0,clientRpcId:l,relayRpcId:u}).catch(p=>{this.client.logger.error(p),this.client.session.update(r,{namespaces:f}),o(p)}),{acknowledged:s}}),Me(this,"extend",async n=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(n)}catch(l){throw this.client.logger.error("extend() -> isValidExtend() failed"),l}const{topic:r}=n,i=Hl(),{done:s,resolve:a,reject:o}=Lh();return this.events.once(jn("session_extend",i),({error:l})=>{l?o(l):a()}),await this.setExpiry(r,hi(c0)),this.sendRequest({topic:r,method:"wc_sessionExtend",params:{},clientRpcId:i,throwOnFailedPublish:!0}).catch(l=>{o(l)}),{acknowledged:s}}),Me(this,"request",async n=>{this.isInitialized();try{await this.isValidRequest(n)}catch(_){throw this.client.logger.error("request() -> isValidRequest() failed"),_}const{chainId:r,request:i,topic:s,expiry:a=ss.wc_sessionRequest.req.ttl}=n,o=this.client.session.get(s);(o==null?void 0:o.transportType)===Cr.relay&&await this.confirmOnlineStateOrThrow();const l=Hl(),u=f2().toString(),{done:f,resolve:p,reject:y}=Lh(a,"Request expired. Please try again.");this.events.once(jn("session_request",l),({error:_,result:C})=>{_?y(_):p(C)});const g="wc_sessionRequest",b=this.getAppLinkIfEnabled(o.peer.metadata,o.transportType);if(b)return await this.sendRequest({clientRpcId:l,relayRpcId:u,topic:s,method:g,params:{request:_s(zn({},i),{expiryTimestamp:hi(a)}),chainId:r},expiry:a,throwOnFailedPublish:!0,appLink:b}).catch(_=>y(_)),this.client.events.emit("session_request_sent",{topic:s,request:i,chainId:r,id:l}),await f();const v={request:_s(zn({},i),{expiryTimestamp:hi(a)}),chainId:r};return await Promise.all([new Promise(async _=>{await this.sendRequest({clientRpcId:l,relayRpcId:u,topic:s,method:g,params:v,expiry:a,throwOnFailedPublish:!0,tvf:this.getTVFParams(l,v)}).catch(C=>y(C)),this.client.events.emit("session_request_sent",{topic:s,request:i,chainId:r,id:l}),_()}),new Promise(async _=>{var C;if(!((C=o.sessionConfig)!=null&&C.disableDeepLink)){const S=await fHe(this.client.core.storage,dZ);await uHe({id:l,topic:s,wcDeepLink:S})}_()}),f()]).then(_=>_[2])}),Me(this,"respond",async n=>{var r,i;this.isInitialized();const s=this.client.core.eventClient.createEvent({properties:{topic:(n==null?void 0:n.topic)||((i=(r=n==null?void 0:n.response)==null?void 0:r.id)==null?void 0:i.toString()),trace:[Qo.session_request_response_started]}});try{await this.isValidRespond(n)}catch(p){throw s.addTrace(p==null?void 0:p.message),s.setError(_h.session_request_response_validation_failure),p}s.addTrace(Qo.session_request_response_validation_success);const{topic:a,response:o}=n,{id:l}=o,u=this.client.session.get(a);u.transportType===Cr.relay&&await this.confirmOnlineStateOrThrow();const f=this.getAppLinkIfEnabled(u.peer.metadata,u.transportType);try{s.addTrace(Qo.session_request_response_publish_started),Wl(o)?await this.sendResult({id:l,topic:a,result:o.result,throwOnFailedPublish:!0,appLink:f}):_o(o)&&await this.sendError({id:l,topic:a,error:o.error,appLink:f}),this.cleanupAfterResponse(n)}catch(p){throw s.addTrace(p==null?void 0:p.message),s.setError(_h.session_request_response_publish_failure),p}}),Me(this,"ping",async n=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(n)}catch(i){throw this.client.logger.error("ping() -> isValidPing() failed"),i}const{topic:r}=n;if(this.client.session.keys.includes(r)){const i=Hl(),s=f2().toString(),{done:a,resolve:o,reject:l}=Lh();this.events.once(jn("session_ping",i),({error:u})=>{u?l(u):o()}),await Promise.all([this.sendRequest({topic:r,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:i,relayRpcId:s}),a()])}else this.client.core.pairing.pairings.keys.includes(r)&&(this.client.logger.warn("ping() on pairing topic is deprecated and will be removed in the next major release."),await this.client.core.pairing.ping({topic:r}))}),Me(this,"emit",async n=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(n);const{topic:r,event:i,chainId:s}=n,a=f2().toString(),o=Hl();await this.sendRequest({topic:r,method:"wc_sessionEvent",params:{event:i,chainId:s},throwOnFailedPublish:!0,relayRpcId:a,clientRpcId:o})}),Me(this,"disconnect",async n=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(n);const{topic:r}=n;if(this.client.session.keys.includes(r))await this.sendRequest({topic:r,method:"wc_sessionDelete",params:Er("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:r,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(r))await this.client.core.pairing.disconnect({topic:r});else{const{message:i}=We("MISMATCHED_TOPIC",`Session or pairing topic not found: ${r}`);throw new Error(i)}}),Me(this,"find",n=>(this.isInitialized(),this.client.session.getAll().filter(r=>TZe(r,n)))),Me(this,"getPendingSessionRequests",()=>this.client.pendingRequest.getAll()),Me(this,"authenticate",async(n,r)=>{var i;this.isInitialized(),this.isValidAuthenticate(n);const s=r&&this.client.core.linkModeSupportedApps.includes(r)&&((i=this.client.metadata.redirect)==null?void 0:i.linkMode),a=s?Cr.link_mode:Cr.relay;a===Cr.relay&&await this.confirmOnlineStateOrThrow();const{chains:o,statement:l="",uri:u,domain:f,nonce:p,type:y,exp:g,nbf:b,methods:v=[],expiry:_}=n,C=[...n.resources||[]],{topic:S,uri:x}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:a});this.client.logger.info({message:"Generated new pairing",pairing:{topic:S,uri:x}});const A=await this.client.core.crypto.generateKeyPair(),I=Fw(A);if(await Promise.all([this.client.auth.authKeys.set(Ww,{responseTopic:I,publicKey:A}),this.client.auth.pairingTopics.set(I,{topic:I,pairingTopic:S})]),await this.client.core.relayer.subscribe(I,{transportType:a}),this.client.logger.info(`sending request to new pairing topic: ${S}`),v.length>0){const{namespace:H}=Su(o[0]);let V=LWe(H,"request",v);Bw(C)&&(V=IWe(V,C.pop())),C.push(V)}const $=_&&_>ss.wc_sessionAuthenticate.req.ttl?_:ss.wc_sessionAuthenticate.req.ttl,O={authPayload:{type:y??"caip122",chains:o,statement:l,aud:u,domain:f,version:"1",nonce:p,iat:new Date().toISOString(),exp:g,nbf:b,resources:C},requester:{publicKey:A,metadata:this.client.metadata},expiryTimestamp:hi($)},P={eip155:{chains:o,methods:[...new Set(["personal_sign",...v])],events:["chainChanged","accountsChanged"]}},j={requiredNamespaces:{},optionalNamespaces:P,relays:[{protocol:"irn"}],pairingTopic:S,proposer:{publicKey:A,metadata:this.client.metadata},expiryTimestamp:hi(ss.wc_sessionPropose.req.ttl),id:Hl()},{done:U,resolve:z,reject:D}=Lh($,"Request expired"),R=Hl(),W=jn("session_connect",j.id),T=jn("session_request",R),L=async({error:H,session:V})=>{this.events.off(T,M),H?D(H):V&&z({session:V})},M=async H=>{var V,F,q;if(await this.deletePendingAuthRequest(R,{message:"fulfilled",code:0}),H.error){const pe=Er("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return H.error.code===pe.code?void 0:(this.events.off(W,L),D(H.error.message))}await this.deleteProposal(j.id),this.events.off(W,L);const{cacaos:G,responder:Y}=H.result,X=[],te=[];for(const pe of G){await qW({cacao:pe,projectId:this.client.core.projectId})||(this.client.logger.error(pe,"Signature verification failed"),D(Er("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:Ce}=pe,xe=Bw(Ce.resources),Te=[TL(Ce.iss)],Et=yv(Ce.iss);if(xe){const Ke=ZW(xe),Ge=KW(xe);X.push(...Ke),Te.push(...Ge)}for(const Ke of Te)te.push(`${Ke}:${Et}`)}const ie=await this.client.core.crypto.generateSharedKey(A,Y.publicKey);let se;X.length>0&&(se={topic:ie,acknowledged:!0,self:{publicKey:A,metadata:this.client.metadata},peer:Y,controller:Y.publicKey,expiry:hi(c0),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:S,namespaces:vq([...new Set(X)],[...new Set(te)]),transportType:a},await this.client.core.relayer.subscribe(ie,{transportType:a}),await this.client.session.set(ie,se),S&&await this.client.core.pairing.updateMetadata({topic:S,metadata:Y.metadata}),se=this.client.session.get(ie)),(V=this.client.metadata.redirect)!=null&&V.linkMode&&(F=Y.metadata.redirect)!=null&&F.linkMode&&(q=Y.metadata.redirect)!=null&&q.universal&&r&&(this.client.core.addLinkModeSupportedApp(Y.metadata.redirect.universal),this.client.session.update(ie,{transportType:Cr.link_mode})),z({auths:G,session:se})};this.events.once(W,L),this.events.once(T,M);let Z;try{if(s){const H=ul("wc_sessionAuthenticate",O,R);this.client.core.history.set(S,H);const V=await this.client.core.crypto.encode("",H,{type:_5,encoding:i2});Z=ew(r,S,V)}else await Promise.all([this.sendRequest({topic:S,method:"wc_sessionAuthenticate",params:O,expiry:n.expiry,throwOnFailedPublish:!0,clientRpcId:R}),this.sendRequest({topic:S,method:"wc_sessionPropose",params:j,expiry:ss.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:j.id})])}catch(H){throw this.events.off(W,L),this.events.off(T,M),H}return await this.setProposal(j.id,j),await this.setAuthRequest(R,{request:_s(zn({},O),{verifyContext:{}}),pairingTopic:S,transportType:a}),{uri:Z??x,response:U}}),Me(this,"approveSessionAuthenticate",async n=>{const{id:r,auths:i}=n,s=this.client.core.eventClient.createEvent({properties:{topic:r.toString(),trace:[xh.authenticated_session_approve_started]}});try{this.isInitialized()}catch(_){throw s.setError(Zy.no_internet_connection),_}const a=this.getPendingAuthRequest(r);if(!a)throw s.setError(Zy.authenticated_session_pending_request_not_found),new Error(`Could not find pending auth request with id ${r}`);const o=a.transportType||Cr.relay;o===Cr.relay&&await this.confirmOnlineStateOrThrow();const l=a.requester.publicKey,u=await this.client.core.crypto.generateKeyPair(),f=Fw(l),p={type:Au,receiverPublicKey:l,senderPublicKey:u},y=[],g=[];for(const _ of i){if(!await qW({cacao:_,projectId:this.client.core.projectId})){s.setError(Zy.invalid_cacao);const I=Er("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:r,topic:f,error:I,encodeOpts:p}),new Error(I.message)}s.addTrace(xh.cacaos_verified);const{p:C}=_,S=Bw(C.resources),x=[TL(C.iss)],A=yv(C.iss);if(S){const I=ZW(S),$=KW(S);y.push(...I),x.push(...$)}for(const I of x)g.push(`${I}:${A}`)}const b=await this.client.core.crypto.generateSharedKey(u,l);s.addTrace(xh.create_authenticated_session_topic);let v;if((y==null?void 0:y.length)>0){v={topic:b,acknowledged:!0,self:{publicKey:u,metadata:this.client.metadata},peer:{publicKey:l,metadata:a.requester.metadata},controller:l,expiry:hi(c0),authentication:i,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:a.pairingTopic,namespaces:vq([...new Set(y)],[...new Set(g)]),transportType:o},s.addTrace(xh.subscribing_authenticated_session_topic);try{await this.client.core.relayer.subscribe(b,{transportType:o})}catch(_){throw s.setError(Zy.subscribe_authenticated_session_topic_failure),_}s.addTrace(xh.subscribe_authenticated_session_topic_success),await this.client.session.set(b,v),s.addTrace(xh.store_authenticated_session),await this.client.core.pairing.updateMetadata({topic:a.pairingTopic,metadata:a.requester.metadata})}s.addTrace(xh.publishing_authenticated_session_approve);try{await this.sendResult({topic:f,id:r,result:{cacaos:i,responder:{publicKey:u,metadata:this.client.metadata}},encodeOpts:p,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(a.requester.metadata,o)})}catch(_){throw s.setError(Zy.authenticated_session_approve_publish_failure),_}return await this.client.auth.requests.delete(r,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:a.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:s.eventId}),{session:v}}),Me(this,"rejectSessionAuthenticate",async n=>{this.isInitialized();const{id:r,reason:i}=n,s=this.getPendingAuthRequest(r);if(!s)throw new Error(`Could not find pending auth request with id ${r}`);s.transportType===Cr.relay&&await this.confirmOnlineStateOrThrow();const a=s.requester.publicKey,o=await this.client.core.crypto.generateKeyPair(),l=Fw(a),u={type:Au,receiverPublicKey:a,senderPublicKey:o};await this.sendError({id:r,topic:l,error:i,encodeOpts:u,rpcOpts:ss.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(s.requester.metadata,s.transportType)}),await this.client.auth.requests.delete(r,{message:"rejected",code:0}),await this.deleteProposal(r)}),Me(this,"formatAuthMessage",n=>{this.isInitialized();const{request:r,iss:i}=n;return nae(r,i)}),Me(this,"processRelayMessageCache",()=>{setTimeout(async()=>{if(this.relayMessageCache.length!==0)for(;this.relayMessageCache.length>0;)try{const n=this.relayMessageCache.shift();n&&await this.onRelayMessage(n)}catch(n){this.client.logger.error(n)}},50)}),Me(this,"cleanupDuplicatePairings",async n=>{if(n.pairingTopic)try{const r=this.client.core.pairing.pairings.get(n.pairingTopic),i=this.client.core.pairing.pairings.getAll().filter(s=>{var a,o;return((a=s.peerMetadata)==null?void 0:a.url)&&((o=s.peerMetadata)==null?void 0:o.url)===n.peer.metadata.url&&s.topic&&s.topic!==r.topic});if(i.length===0)return;this.client.logger.info(`Cleaning up ${i.length} duplicate pairing(s)`),await Promise.all(i.map(s=>this.client.core.pairing.disconnect({topic:s.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(r){this.client.logger.error(r)}}),Me(this,"deleteSession",async n=>{var r;const{topic:i,expirerHasDeleted:s=!1,emitEvent:a=!0,id:o=0}=n,{self:l}=this.client.session.get(i);await this.client.core.relayer.unsubscribe(i),await this.client.session.delete(i,Er("USER_DISCONNECTED")),this.addToRecentlyDeleted(i,"session"),this.client.core.crypto.keychain.has(l.publicKey)&&await this.client.core.crypto.deleteKeyPair(l.publicKey),this.client.core.crypto.keychain.has(i)&&await this.client.core.crypto.deleteSymKey(i),s||this.client.core.expirer.del(i),this.client.core.storage.removeItem(dZ).catch(u=>this.client.logger.warn(u)),this.getPendingSessionRequests().forEach(u=>{u.topic===i&&this.deletePendingSessionRequest(u.id,Er("USER_DISCONNECTED"))}),i===((r=this.sessionRequestQueue.queue[0])==null?void 0:r.topic)&&(this.sessionRequestQueue.state=Dl.idle),a&&this.client.events.emit("session_delete",{id:o,topic:i})}),Me(this,"deleteProposal",async(n,r)=>{if(r)try{const i=this.client.proposal.get(n),s=this.client.core.eventClient.getEvent({topic:i.pairingTopic});s==null||s.setError(_h.proposal_expired)}catch{}await Promise.all([this.client.proposal.delete(n,Er("USER_DISCONNECTED")),r?Promise.resolve():this.client.core.expirer.del(n)]),this.addToRecentlyDeleted(n,"proposal")}),Me(this,"deletePendingSessionRequest",async(n,r,i=!1)=>{await Promise.all([this.client.pendingRequest.delete(n,r),i?Promise.resolve():this.client.core.expirer.del(n)]),this.addToRecentlyDeleted(n,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(s=>s.id!==n),i&&(this.sessionRequestQueue.state=Dl.idle,this.client.events.emit("session_request_expire",{id:n}))}),Me(this,"deletePendingAuthRequest",async(n,r,i=!1)=>{await Promise.all([this.client.auth.requests.delete(n,r),i?Promise.resolve():this.client.core.expirer.del(n)])}),Me(this,"setExpiry",async(n,r)=>{this.client.session.keys.includes(n)&&(this.client.core.expirer.set(n,r),await this.client.session.update(n,{expiry:r}))}),Me(this,"setProposal",async(n,r)=>{this.client.core.expirer.set(n,hi(ss.wc_sessionPropose.req.ttl)),await this.client.proposal.set(n,r)}),Me(this,"setAuthRequest",async(n,r)=>{const{request:i,pairingTopic:s,transportType:a=Cr.relay}=r;this.client.core.expirer.set(n,i.expiryTimestamp),await this.client.auth.requests.set(n,{authPayload:i.authPayload,requester:i.requester,expiryTimestamp:i.expiryTimestamp,id:n,pairingTopic:s,verifyContext:i.verifyContext,transportType:a})}),Me(this,"setPendingSessionRequest",async n=>{const{id:r,topic:i,params:s,verifyContext:a}=n,o=s.request.expiryTimestamp||hi(ss.wc_sessionRequest.req.ttl);this.client.core.expirer.set(r,o),await this.client.pendingRequest.set(r,{id:r,topic:i,params:s,verifyContext:a})}),Me(this,"sendRequest",async n=>{const{topic:r,method:i,params:s,expiry:a,relayRpcId:o,clientRpcId:l,throwOnFailedPublish:u,appLink:f,tvf:p,publishOpts:y={}}=n,g=ul(i,s,l);let b;const v=!!f;try{const S=v?i2:ta;b=await this.client.core.crypto.encode(r,g,{encoding:S})}catch(S){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${r} failed`),S}let _;if(zQe.includes(i)){const S=vo(JSON.stringify(g)),x=vo(b);_=await this.client.core.verify.register({id:x,decryptedId:S})}const C=zn(zn({},ss[i].req),y);if(C.attestation=_,a&&(C.ttl=a),o&&(C.id=o),this.client.core.history.set(r,g),v){const S=ew(f,r,b);await global.Linking.openURL(S,this.client.name)}else C.tvf=_s(zn({},p),{correlationId:g.id}),u?(C.internal=_s(zn({},C.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(r,b,C)):this.client.core.relayer.publish(r,b,C).catch(S=>this.client.logger.error(S));return g.id}),Me(this,"sendProposeSession",async n=>{const{proposal:r,publishOpts:i}=n,s=ul("wc_sessionPropose",r,r.id);this.client.core.history.set(r.pairingTopic,s);const a=await this.client.core.crypto.encode(r.pairingTopic,s,{encoding:ta}),o=vo(JSON.stringify(s)),l=vo(a),u=await this.client.core.verify.register({id:l,decryptedId:o});await this.client.core.relayer.publishCustom({payload:{pairingTopic:r.pairingTopic,sessionProposal:a},opts:_s(zn({},i),{publishMethod:"wc_proposeSession",attestation:u})})}),Me(this,"sendApproveSession",async n=>{const{sessionTopic:r,pairingProposalResponse:i,proposal:s,sessionSettleRequest:a,publishOpts:o}=n,l=_6(s.id,i),u=await this.client.core.crypto.encode(s.pairingTopic,l,{encoding:ta}),f=ul("wc_sessionSettle",a,o==null?void 0:o.id),p=await this.client.core.crypto.encode(r,f,{encoding:ta});this.client.core.history.set(r,f),await this.client.core.relayer.publishCustom({payload:{sessionTopic:r,pairingTopic:s.pairingTopic,sessionProposalResponse:u,sessionSettlementRequest:p},opts:_s(zn({},o),{publishMethod:"wc_approveSession"})})}),Me(this,"sendResult",async n=>{const{id:r,topic:i,result:s,throwOnFailedPublish:a,encodeOpts:o,appLink:l}=n,u=_6(r,s);let f;const p=l&&typeof(global==null?void 0:global.Linking)<"u";try{const b=p?i2:ta;f=await this.client.core.crypto.encode(i,u,_s(zn({},o||{}),{encoding:b}))}catch(b){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${i} failed`),b}let y,g;try{y=await this.client.core.history.get(i,r);const b=y.request;try{g=this.getTVFParams(r,b.params,s)}catch(v){this.client.logger.warn(`sendResult() -> getTVFParams() failed: ${v==null?void 0:v.message}`)}}catch(b){throw this.client.logger.error(`sendResult() -> history.get(${i}, ${r}) failed`),b}if(p){const b=ew(l,i,f);await global.Linking.openURL(b,this.client.name)}else{const b=y.request.method,v=ss[b].res;v.tvf=_s(zn({},g),{correlationId:r}),a?(v.internal=_s(zn({},v.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,f,v)):this.client.core.relayer.publish(i,f,v).catch(_=>this.client.logger.error(_))}await this.client.core.history.resolve(u)}),Me(this,"sendError",async n=>{const{id:r,topic:i,error:s,encodeOpts:a,rpcOpts:o,appLink:l}=n,u=b9(r,s);let f;const p=l&&typeof(global==null?void 0:global.Linking)<"u";try{const g=p?i2:ta;f=await this.client.core.crypto.encode(i,u,_s(zn({},a||{}),{encoding:g}))}catch(g){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${i} failed`),g}let y;try{y=await this.client.core.history.get(i,r)}catch(g){throw this.client.logger.error(`sendError() -> history.get(${i}, ${r}) failed`),g}if(p){const g=ew(l,i,f);await global.Linking.openURL(g,this.client.name)}else{const g=y.request.method,b=o||ss[g].res;this.client.core.relayer.publish(i,f,b)}await this.client.core.history.resolve(u)}),Me(this,"cleanup",async()=>{const n=[],r=[];this.client.session.getAll().forEach(i=>{let s=!1;Zl(i.expiry)&&(s=!0),this.client.core.crypto.keychain.has(i.topic)||(s=!0),s&&n.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{Zl(i.expiryTimestamp)&&r.push(i.id)}),await Promise.all([...n.map(i=>this.deleteSession({topic:i})),...r.map(i=>this.deleteProposal(i))])}),Me(this,"onProviderMessageEvent",async n=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(n):await this.onRelayMessage(n)}),Me(this,"onRelayEventRequest",async n=>{this.requestQueue.queue.push(n),await this.processRequestsQueue()}),Me(this,"processRequestsQueue",async()=>{if(this.requestQueue.state===Dl.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=Dl.active;const n=this.requestQueue.queue.shift();if(n)try{await this.processRequest(n)}catch(r){this.client.logger.warn(r)}}this.requestQueue.state=Dl.idle}),Me(this,"processRequest",async n=>{const{topic:r,payload:i,attestation:s,transportType:a,encryptedId:o}=n,l=i.method;if(!this.shouldIgnorePairingRequest({topic:r,requestMethod:l}))switch(l){case"wc_sessionPropose":return await this.onSessionProposeRequest({topic:r,payload:i,attestation:s,encryptedId:o});case"wc_sessionSettle":return await this.onSessionSettleRequest(r,i);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(r,i);case"wc_sessionExtend":return await this.onSessionExtendRequest(r,i);case"wc_sessionPing":return await this.onSessionPingRequest(r,i);case"wc_sessionDelete":return await this.onSessionDeleteRequest(r,i);case"wc_sessionRequest":return await this.onSessionRequest({topic:r,payload:i,attestation:s,encryptedId:o,transportType:a});case"wc_sessionEvent":return await this.onSessionEventRequest(r,i);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:r,payload:i,attestation:s,encryptedId:o,transportType:a});default:return this.client.logger.info(`Unsupported request method ${l}`)}}),Me(this,"onRelayEventResponse",async n=>{const{topic:r,payload:i,transportType:s}=n,a=(await this.client.core.history.get(r,i.id)).request.method;switch(a){case"wc_sessionPropose":return this.onSessionProposeResponse(r,i,s);case"wc_sessionSettle":return this.onSessionSettleResponse(r,i);case"wc_sessionUpdate":return this.onSessionUpdateResponse(r,i);case"wc_sessionExtend":return this.onSessionExtendResponse(r,i);case"wc_sessionPing":return this.onSessionPingResponse(r,i);case"wc_sessionRequest":return this.onSessionRequestResponse(r,i);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(r,i);default:return this.client.logger.info(`Unsupported response method ${a}`)}}),Me(this,"onRelayEventUnknownPayload",n=>{const{topic:r}=n,{message:i}=We("MISSING_OR_INVALID",`Decoded payload on topic ${r} is not identifiable as a JSON-RPC request or a response.`);throw new Error(i)}),Me(this,"shouldIgnorePairingRequest",n=>{const{topic:r,requestMethod:i}=n,s=this.expectedPairingMethodMap.get(r);return!s||s.includes(i)?!1:!!(s.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)}),Me(this,"onSessionProposeRequest",async n=>{const{topic:r,payload:i,attestation:s,encryptedId:a}=n,{params:o,id:l}=i;try{const u=this.client.core.eventClient.getEvent({topic:r});this.client.events.listenerCount("session_proposal")===0&&(console.warn("No listener for session_proposal event"),u==null||u.setError(tu.proposal_listener_not_found)),this.isValidConnect(zn({},i.params));const f=o.expiryTimestamp||hi(ss.wc_sessionPropose.req.ttl),p=zn({id:l,pairingTopic:r,expiryTimestamp:f,attestation:s,encryptedId:a},o);await this.setProposal(l,p);const y=await this.getVerifyContext({attestationId:s,hash:vo(JSON.stringify(i)),encryptedId:a,metadata:p.proposer.metadata});u==null||u.addTrace(zl.emit_session_proposal),this.client.events.emit("session_proposal",{id:l,params:p,verifyContext:y})}catch(u){await this.sendError({id:l,topic:r,error:u,rpcOpts:ss.wc_sessionPropose.autoReject}),this.client.logger.error(u)}}),Me(this,"onSessionProposeResponse",async(n,r,i)=>{const{id:s}=r;if(Wl(r)){const{result:a}=r;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:a});const o=this.client.proposal.get(s);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:o});const l=o.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:l});const u=a.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:u});const f=await this.client.core.crypto.generateSharedKey(l,u);this.pendingSessions.set(s,{sessionTopic:f,pairingTopic:n,proposalId:s,publicKey:l});const p=await this.client.core.relayer.subscribe(f,{transportType:i});this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:p}),await this.client.core.pairing.activate({topic:n})}else if(_o(r)){await this.deleteProposal(s);const a=jn("session_connect",s);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners, 954`);this.events.emit(a,{error:r.error})}}),Me(this,"onSessionSettleRequest",async(n,r)=>{const{id:i,params:s}=r;try{this.isValidSessionSettleRequest(s);const{relay:a,controller:o,expiry:l,namespaces:u,sessionProperties:f,scopedProperties:p,sessionConfig:y}=r.params,g=[...this.pendingSessions.values()].find(_=>_.sessionTopic===n);if(!g)return this.client.logger.error(`Pending session not found for topic ${n}`);const b=this.client.proposal.get(g.proposalId),v=_s(zn(zn(zn({topic:n,relay:a,expiry:l,namespaces:u,acknowledged:!0,pairingTopic:g.pairingTopic,requiredNamespaces:b.requiredNamespaces,optionalNamespaces:b.optionalNamespaces,controller:o.publicKey,self:{publicKey:g.publicKey,metadata:this.client.metadata},peer:{publicKey:o.publicKey,metadata:o.metadata}},f&&{sessionProperties:f}),p&&{scopedProperties:p}),y&&{sessionConfig:y}),{transportType:Cr.relay});await this.client.session.set(v.topic,v),await this.setExpiry(v.topic,v.expiry),await this.client.core.pairing.updateMetadata({topic:g.pairingTopic,metadata:v.peer.metadata}),this.client.events.emit("session_connect",{session:v}),this.events.emit(jn("session_connect",g.proposalId),{session:v}),this.pendingSessions.delete(g.proposalId),this.deleteProposal(g.proposalId,!1),this.cleanupDuplicatePairings(v),await this.sendResult({id:r.id,topic:n,result:!0})}catch(a){await this.sendError({id:i,topic:n,error:a}),this.client.logger.error(a)}}),Me(this,"onSessionSettleResponse",async(n,r)=>{const{id:i}=r;Wl(r)?(await this.client.session.update(n,{acknowledged:!0}),this.events.emit(jn("session_approve",i),{})):_o(r)&&(await this.client.session.delete(n,Er("USER_DISCONNECTED")),this.events.emit(jn("session_approve",i),{error:r.error}))}),Me(this,"onSessionUpdateRequest",async(n,r)=>{const{params:i,id:s}=r;try{const a=`${n}_session_update`,o=Wy.get(a);if(o&&this.isRequestOutOfSync(o,s)){this.client.logger.warn(`Discarding out of sync request - ${s}`),this.sendError({id:s,topic:n,error:Er("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(zn({topic:n},i));try{Wy.set(a,s),await this.client.session.update(n,{namespaces:i.namespaces}),await this.sendResult({id:s,topic:n,result:!0})}catch(l){throw Wy.delete(a),l}this.client.events.emit("session_update",{id:s,topic:n,params:i})}catch(a){await this.sendError({id:s,topic:n,error:a}),this.client.logger.error(a)}}),Me(this,"isRequestOutOfSync",(n,r)=>r.toString().slice(0,-3)<n.toString().slice(0,-3)),Me(this,"onSessionUpdateResponse",(n,r)=>{const{id:i}=r,s=jn("session_update",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);Wl(r)?this.events.emit(jn("session_update",i),{}):_o(r)&&this.events.emit(jn("session_update",i),{error:r.error})}),Me(this,"onSessionExtendRequest",async(n,r)=>{const{id:i}=r;try{this.isValidExtend({topic:n}),await this.setExpiry(n,hi(c0)),await this.sendResult({id:i,topic:n,result:!0}),this.client.events.emit("session_extend",{id:i,topic:n})}catch(s){await this.sendError({id:i,topic:n,error:s}),this.client.logger.error(s)}}),Me(this,"onSessionExtendResponse",(n,r)=>{const{id:i}=r,s=jn("session_extend",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);Wl(r)?this.events.emit(jn("session_extend",i),{}):_o(r)&&this.events.emit(jn("session_extend",i),{error:r.error})}),Me(this,"onSessionPingRequest",async(n,r)=>{const{id:i}=r;try{this.isValidPing({topic:n}),await this.sendResult({id:i,topic:n,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:i,topic:n})}catch(s){await this.sendError({id:i,topic:n,error:s}),this.client.logger.error(s)}}),Me(this,"onSessionPingResponse",(n,r)=>{const{id:i}=r,s=jn("session_ping",i);setTimeout(()=>{if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners 2176`);Wl(r)?this.events.emit(jn("session_ping",i),{}):_o(r)&&this.events.emit(jn("session_ping",i),{error:r.error})},500)}),Me(this,"onSessionDeleteRequest",async(n,r)=>{const{id:i}=r;try{this.isValidDisconnect({topic:n,reason:r.params}),await Promise.all([new Promise(s=>{this.client.core.relayer.once(ei.publish,async()=>{s(await this.deleteSession({topic:n,id:i}))})}),this.sendResult({id:i,topic:n,result:!0}),this.cleanupPendingSentRequestsForTopic({topic:n,error:Er("USER_DISCONNECTED")})]).catch(s=>this.client.logger.error(s))}catch(s){this.client.logger.error(s)}}),Me(this,"onSessionRequest",async n=>{var r,i,s;const{topic:a,payload:o,attestation:l,encryptedId:u,transportType:f}=n,{id:p,params:y}=o;try{await this.isValidRequest(zn({topic:a},y));const g=this.client.session.get(a),b=await this.getVerifyContext({attestationId:l,hash:vo(JSON.stringify(ul("wc_sessionRequest",y,p))),encryptedId:u,metadata:g.peer.metadata,transportType:f}),v={id:p,topic:a,params:y,verifyContext:b};await this.setPendingSessionRequest(v),f===Cr.link_mode&&(r=g.peer.metadata.redirect)!=null&&r.universal&&this.client.core.addLinkModeSupportedApp((i=g.peer.metadata.redirect)==null?void 0:i.universal),(s=this.client.signConfig)!=null&&s.disableRequestQueue?this.emitSessionRequest(v):(this.addSessionRequestToSessionRequestQueue(v),this.processSessionRequestQueue())}catch(g){await this.sendError({id:p,topic:a,error:g}),this.client.logger.error(g)}}),Me(this,"onSessionRequestResponse",(n,r)=>{const{id:i}=r,s=jn("session_request",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);Wl(r)?this.events.emit(jn("session_request",i),{result:r.result}):_o(r)&&this.events.emit(jn("session_request",i),{error:r.error})}),Me(this,"onSessionEventRequest",async(n,r)=>{const{id:i,params:s}=r;try{const a=`${n}_session_event_${s.event.name}`,o=Wy.get(a);if(o&&this.isRequestOutOfSync(o,i)){this.client.logger.info(`Discarding out of sync request - ${i}`);return}this.isValidEmit(zn({topic:n},s)),this.client.events.emit("session_event",{id:i,topic:n,params:s}),Wy.set(a,i)}catch(a){await this.sendError({id:i,topic:n,error:a}),this.client.logger.error(a)}}),Me(this,"onSessionAuthenticateResponse",(n,r)=>{const{id:i}=r;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:n,payload:r}),Wl(r)?this.events.emit(jn("session_request",i),{result:r.result}):_o(r)&&this.events.emit(jn("session_request",i),{error:r.error})}),Me(this,"onSessionAuthenticateRequest",async n=>{var r;const{topic:i,payload:s,attestation:a,encryptedId:o,transportType:l}=n;try{const{requester:u,authPayload:f,expiryTimestamp:p}=s.params,y=await this.getVerifyContext({attestationId:a,hash:vo(JSON.stringify(s)),encryptedId:o,metadata:u.metadata,transportType:l}),g={requester:u,pairingTopic:i,id:s.id,authPayload:f,verifyContext:y,expiryTimestamp:p};await this.setAuthRequest(s.id,{request:g,pairingTopic:i,transportType:l}),l===Cr.link_mode&&(r=u.metadata.redirect)!=null&&r.universal&&this.client.core.addLinkModeSupportedApp(u.metadata.redirect.universal),this.client.events.emit("session_authenticate",{topic:i,params:s.params,id:s.id,verifyContext:y})}catch(u){this.client.logger.error(u);const f=s.params.requester.publicKey,p=await this.client.core.crypto.generateKeyPair(),y=this.getAppLinkIfEnabled(s.params.requester.metadata,l),g={type:Au,receiverPublicKey:f,senderPublicKey:p};await this.sendError({id:s.id,topic:i,error:u,encodeOpts:g,rpcOpts:ss.wc_sessionAuthenticate.autoReject,appLink:y})}}),Me(this,"addSessionRequestToSessionRequestQueue",n=>{this.sessionRequestQueue.queue.push(n)}),Me(this,"cleanupAfterResponse",n=>{this.deletePendingSessionRequest(n.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=Dl.idle,this.processSessionRequestQueue()},qe.toMiliseconds(this.requestQueueDelay))}),Me(this,"cleanupPendingSentRequestsForTopic",({topic:n,error:r})=>{const i=this.client.core.history.pending;i.length>0&&i.filter(s=>s.topic===n&&s.request.method==="wc_sessionRequest").forEach(s=>{const a=s.request.id,o=jn("session_request",a);if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners`);this.events.emit(jn("session_request",s.request.id),{error:r})})}),Me(this,"processSessionRequestQueue",()=>{if(this.sessionRequestQueue.state===Dl.active){this.client.logger.info("session request queue is already active.");return}const n=this.sessionRequestQueue.queue[0];if(!n){this.client.logger.info("session request queue is empty.");return}try{this.emitSessionRequest(n)}catch(r){this.client.logger.error(r)}}),Me(this,"emitSessionRequest",n=>{if(this.emittedSessionRequests.has(n.id)){this.client.logger.warn({id:n.id},`Skipping emitting \`session_request\` event for duplicate request. id: ${n.id}`);return}this.sessionRequestQueue.state=Dl.active,this.emittedSessionRequests.add(n.id),this.client.events.emit("session_request",n)}),Me(this,"onPairingCreated",n=>{if(n.methods&&this.expectedPairingMethodMap.set(n.topic,n.methods),n.active)return;const r=this.client.proposal.getAll().find(i=>i.pairingTopic===n.topic);r&&this.onSessionProposeRequest({topic:n.topic,payload:ul("wc_sessionPropose",_s(zn({},r),{requiredNamespaces:r.requiredNamespaces,optionalNamespaces:r.optionalNamespaces,relays:r.relays,proposer:r.proposer,sessionProperties:r.sessionProperties,scopedProperties:r.scopedProperties}),r.id),attestation:r.attestation,encryptedId:r.encryptedId})}),Me(this,"isValidConnect",async n=>{if(!Js(n)){const{message:u}=We("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(n)}`);throw new Error(u)}const{pairingTopic:r,requiredNamespaces:i,optionalNamespaces:s,sessionProperties:a,scopedProperties:o,relays:l}=n;if(Ii(r)||await this.isValidPairingTopic(r),!BZe(l)){const{message:u}=We("MISSING_OR_INVALID",`connect() relays: ${l}`);throw new Error(u)}if(i&&!Ii(i)&&nc(i)!==0){const u="requiredNamespaces are deprecated and are automatically assigned to optionalNamespaces";["fatal","error","silent"].includes(this.client.logger.level)?console.warn(u):this.client.logger.warn(u),this.validateNamespaces(i,"requiredNamespaces")}if(s&&!Ii(s)&&nc(s)!==0&&this.validateNamespaces(s,"optionalNamespaces"),a&&!Ii(a)&&this.validateSessionProps(a,"sessionProperties"),o&&!Ii(o)){this.validateSessionProps(o,"scopedProperties");const u=Object.keys(i||{}).concat(Object.keys(s||{}));if(!Object.keys(o).every(f=>u.includes(f.split(":")[0])))throw new Error(`Scoped properties must be a subset of required/optional namespaces, received: ${JSON.stringify(o)}, required/optional namespaces: ${JSON.stringify(u)}`)}}),Me(this,"validateNamespaces",(n,r)=>{const i=UZe(n,"connect()",r);if(i)throw new Error(i.message)}),Me(this,"isValidApprove",async n=>{if(!Js(n))throw new Error(We("MISSING_OR_INVALID",`approve() params: ${n}`).message);const{id:r,namespaces:i,relayProtocol:s,sessionProperties:a,scopedProperties:o}=n;this.checkRecentlyDeleted(r),await this.isValidProposalId(r);const l=this.client.proposal.get(r),u=$S(i,"approve()");if(u)throw new Error(u.message);const f=Cq(l.requiredNamespaces,i,"approve()");if(f)throw new Error(f.message);if(!gi(s,!0)){const{message:p}=We("MISSING_OR_INVALID",`approve() relayProtocol: ${s}`);throw new Error(p)}if(a&&!Ii(a)&&this.validateSessionProps(a,"sessionProperties"),o&&!Ii(o)){this.validateSessionProps(o,"scopedProperties");const p=new Set(Object.keys(i));if(!Object.keys(o).every(y=>p.has(y.split(":")[0])))throw new Error(`Scoped properties must be a subset of approved namespaces, received: ${JSON.stringify(o)}, approved namespaces: ${Array.from(p).join(", ")}`)}}),Me(this,"isValidReject",async n=>{if(!Js(n)){const{message:s}=We("MISSING_OR_INVALID",`reject() params: ${n}`);throw new Error(s)}const{id:r,reason:i}=n;if(this.checkRecentlyDeleted(r),await this.isValidProposalId(r),!zZe(i)){const{message:s}=We("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(s)}}),Me(this,"isValidSessionSettleRequest",n=>{if(!Js(n)){const{message:u}=We("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${n}`);throw new Error(u)}const{relay:r,controller:i,namespaces:s,expiry:a}=n;if(!Uae(r)){const{message:u}=We("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(u)}const o=OZe(i,"onSessionSettleRequest()");if(o)throw new Error(o.message);const l=$S(s,"onSessionSettleRequest()");if(l)throw new Error(l.message);if(Zl(a)){const{message:u}=We("EXPIRED","onSessionSettleRequest()");throw new Error(u)}}),Me(this,"isValidUpdate",async n=>{if(!Js(n)){const{message:l}=We("MISSING_OR_INVALID",`update() params: ${n}`);throw new Error(l)}const{topic:r,namespaces:i}=n;this.checkRecentlyDeleted(r),await this.isValidSessionTopic(r);const s=this.client.session.get(r),a=$S(i,"update()");if(a)throw new Error(a.message);const o=Cq(s.requiredNamespaces,i,"update()");if(o)throw new Error(o.message)}),Me(this,"isValidExtend",async n=>{if(!Js(n)){const{message:i}=We("MISSING_OR_INVALID",`extend() params: ${n}`);throw new Error(i)}const{topic:r}=n;this.checkRecentlyDeleted(r),await this.isValidSessionTopic(r)}),Me(this,"isValidRequest",async n=>{if(!Js(n)){const{message:l}=We("MISSING_OR_INVALID",`request() params: ${n}`);throw new Error(l)}const{topic:r,request:i,chainId:s,expiry:a}=n;this.checkRecentlyDeleted(r),await this.isValidSessionTopic(r);const{namespaces:o}=this.client.session.get(r);if(!xq(o,s)){const{message:l}=We("MISSING_OR_INVALID",`request() chainId: ${s}`);throw new Error(l)}if(!VZe(i)){const{message:l}=We("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(l)}if(!qZe(o,s,i.method)){const{message:l}=We("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(l)}if(a&&!YZe(a,US)){const{message:l}=We("MISSING_OR_INVALID",`request() expiry: ${a}. Expiry must be a number (in seconds) between ${US.min} and ${US.max}`);throw new Error(l)}}),Me(this,"isValidRespond",async n=>{var r;if(!Js(n)){const{message:o}=We("MISSING_OR_INVALID",`respond() params: ${n}`);throw new Error(o)}const{topic:i,response:s}=n;try{await this.isValidSessionTopic(i)}catch(o){throw(r=n==null?void 0:n.response)!=null&&r.id&&this.cleanupAfterResponse(n),o}if(!HZe(s)){const{message:o}=We("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(s)}`);throw new Error(o)}const a=this.client.pendingRequest.get(s.id);if(a.topic!==i){const{message:o}=We("MISMATCHED_TOPIC",`Request response topic mismatch. reqId: ${s.id}, expected topic: ${a.topic}, received topic: ${i}`);throw new Error(o)}}),Me(this,"isValidPing",async n=>{if(!Js(n)){const{message:i}=We("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(i)}const{topic:r}=n;await this.isValidSessionOrPairingTopic(r)}),Me(this,"isValidEmit",async n=>{if(!Js(n)){const{message:o}=We("MISSING_OR_INVALID",`emit() params: ${n}`);throw new Error(o)}const{topic:r,event:i,chainId:s}=n;await this.isValidSessionTopic(r);const{namespaces:a}=this.client.session.get(r);if(!xq(a,s)){const{message:o}=We("MISSING_OR_INVALID",`emit() chainId: ${s}`);throw new Error(o)}if(!WZe(i)){const{message:o}=We("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(o)}if(!ZZe(a,s,i.name)){const{message:o}=We("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(o)}}),Me(this,"isValidDisconnect",async n=>{if(!Js(n)){const{message:i}=We("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(i)}const{topic:r}=n;await this.isValidSessionOrPairingTopic(r)}),Me(this,"isValidAuthenticate",n=>{const{chains:r,uri:i,domain:s,nonce:a}=n;if(!Array.isArray(r)||r.length===0)throw new Error("chains is required and must be a non-empty array");if(!gi(i,!1))throw new Error("uri is required parameter");if(!gi(s,!1))throw new Error("domain is required parameter");if(!gi(a,!1))throw new Error("nonce is required parameter");if([...new Set(r.map(l=>Su(l).namespace))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:o}=Su(r[0]);if(o!=="eip155")throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")}),Me(this,"getVerifyContext",async n=>{const{attestationId:r,hash:i,encryptedId:s,metadata:a,transportType:o}=n,l={verified:{verifyUrl:a.verifyUrl||zg,validation:"UNKNOWN",origin:a.url||""}};try{if(o===Cr.link_mode){const f=this.getAppLinkIfEnabled(a,o);return l.verified.validation=f&&new URL(f).origin===new URL(a.url).origin?"VALID":"INVALID",l}const u=await this.client.core.verify.resolve({attestationId:r,hash:i,encryptedId:s,verifyUrl:a.verifyUrl});u&&(l.verified.origin=u.origin,l.verified.isScam=u.isScam,l.verified.validation=u.origin===new URL(a.url).origin?"VALID":"INVALID")}catch(u){this.client.logger.warn(u)}return this.client.logger.debug(`Verify context: ${JSON.stringify(l)}`),l}),Me(this,"validateSessionProps",(n,r)=>{Object.values(n).forEach((i,s)=>{if(i==null){const{message:a}=We("MISSING_OR_INVALID",`${r} must contain an existing value for each key. Received: ${i} for key ${Object.keys(n)[s]}`);throw new Error(a)}})}),Me(this,"getPendingAuthRequest",n=>{const r=this.client.auth.requests.get(n);return typeof r=="object"?r:void 0}),Me(this,"addToRecentlyDeleted",(n,r)=>{if(this.recentlyDeletedMap.set(n,r),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let i=0;const s=this.recentlyDeletedLimit/2;for(const a of this.recentlyDeletedMap.keys()){if(i++>=s)break;this.recentlyDeletedMap.delete(a)}}}),Me(this,"checkRecentlyDeleted",n=>{const r=this.recentlyDeletedMap.get(n);if(r){const{message:i}=We("MISSING_OR_INVALID",`Record was recently deleted - ${r}: ${n}`);throw new Error(i)}}),Me(this,"isLinkModeEnabled",(n,r)=>{var i,s,a,o,l,u,f,p,y;return!n||r!==Cr.link_mode?!1:((s=(i=this.client.metadata)==null?void 0:i.redirect)==null?void 0:s.linkMode)===!0&&((o=(a=this.client.metadata)==null?void 0:a.redirect)==null?void 0:o.universal)!==void 0&&((u=(l=this.client.metadata)==null?void 0:l.redirect)==null?void 0:u.universal)!==""&&((f=n==null?void 0:n.redirect)==null?void 0:f.universal)!==void 0&&((p=n==null?void 0:n.redirect)==null?void 0:p.universal)!==""&&((y=n==null?void 0:n.redirect)==null?void 0:y.linkMode)===!0&&this.client.core.linkModeSupportedApps.includes(n.redirect.universal)&&typeof(global==null?void 0:global.Linking)<"u"}),Me(this,"getAppLinkIfEnabled",(n,r)=>{var i;return this.isLinkModeEnabled(n,r)?(i=n==null?void 0:n.redirect)==null?void 0:i.universal:void 0}),Me(this,"handleLinkModeMessage",({url:n})=>{if(!n||!n.includes("wc_ev")||!n.includes("topic"))return;const r=PW(n,"topic")||"",i=decodeURIComponent(PW(n,"wc_ev")||""),s=this.client.session.keys.includes(r);s&&this.client.session.update(r,{transportType:Cr.link_mode}),this.client.core.dispatchEnvelope({topic:r,message:i,sessionExists:s})}),Me(this,"registerLinkModeListeners",async()=>{var n;if(HO()||W2()&&(n=this.client.metadata.redirect)!=null&&n.linkMode){const r=global==null?void 0:global.Linking;if(typeof r<"u"){r.addEventListener("url",this.handleLinkModeMessage,this.client.name);const i=await r.getInitialURL();i&&setTimeout(()=>{this.handleLinkModeMessage({url:i})},50)}}}),Me(this,"getTVFParams",(n,r,i)=>{var s,a,o;if(!((s=r.request)!=null&&s.method))return{};const l={correlationId:n,rpcMethods:[r.request.method],chainId:r.chainId};try{const u=this.extractTxHashesFromResult(r.request,i);l.txHashes=u,l.contractAddresses=this.isValidContractData(r.request.params)?[(o=(a=r.request.params)==null?void 0:a[0])==null?void 0:o.to]:[]}catch(u){this.client.logger.warn(u,"Error getting TVF params")}return l}),Me(this,"isValidContractData",n=>{var r;if(!n)return!1;try{const i=(n==null?void 0:n.data)||((r=n==null?void 0:n[0])==null?void 0:r.data);if(!i.startsWith("0x"))return!1;const s=i.slice(2);return/^[0-9a-fA-F]*$/.test(s)?s.length%2===0:!1}catch{}return!1}),Me(this,"extractTxHashesFromResult",(n,r)=>{var i;try{if(!r)return[];const s=n.method,a=BQe[s];if(s==="sui_signTransaction")return[hWe(r.transactionBytes)];if(s==="near_signTransaction")return[zW(r)];if(s==="near_signTransactions")return r.map(l=>zW(l));if(s==="xrpl_signTransactionFor"||s==="xrpl_signTransaction")return[(i=r.tx_json)==null?void 0:i.hash];if(s==="polkadot_signTransaction")return[dKe({transaction:n.params.transactionPayload,signature:r.signature})];if(s==="algo_signTxn")return To(r)?r.map(l=>VW(l)):[VW(r)];if(s==="cosmos_signDirect")return[pWe(r)];if(s==="wallet_sendCalls")return mWe(r);if(typeof r=="string")return[r];const o=r[a.key];if(To(o))return s==="solana_signAllTransactions"?o.map(l=>dWe(l)):o;if(typeof o=="string")return[o]}catch(s){this.client.logger.warn(s,"Error extracting tx hashes from result")}return[]})}async processPendingMessageEvents(){try{const e=this.client.session.keys,n=this.client.core.relayer.messages.getWithoutAck(e);for(const[r,i]of Object.entries(n))for(const s of i)try{await this.onProviderMessageEvent({topic:r,message:s,publishedAt:Date.now()})}catch{this.client.logger.warn(`Error processing pending message event for topic: ${r}, message: ${s}`)}}catch(e){this.client.logger.warn(e,"processPendingMessageEvents failed")}}isInitialized(){if(!this.initialized){const{message:e}=We("NOT_INITIALIZED",this.name);throw new Error(e)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(ei.message,e=>{this.onProviderMessageEvent(e)})}async onRelayMessage(e){const{topic:n,message:r,attestation:i,transportType:s}=e,{publicKey:a}=this.client.auth.authKeys.keys.includes(Ww)?this.client.auth.authKeys.get(Ww):{publicKey:void 0};try{const o=await this.client.core.crypto.decode(n,r,{receiverPublicKey:a,encoding:s===Cr.link_mode?i2:ta});iP(o)?(this.client.core.history.set(n,o),await this.onRelayEventRequest({topic:n,payload:o,attestation:i,transportType:s,encryptedId:vo(r)})):w9(o)?(await this.client.core.history.resolve(o),await this.onRelayEventResponse({topic:n,payload:o,transportType:s}),this.client.core.history.delete(n,o.id)):await this.onRelayEventUnknownPayload({topic:n,payload:o,transportType:s}),await this.client.core.relayer.messages.ack(n,r)}catch(o){this.client.logger.error(o)}}registerExpirerEvents(){this.client.core.expirer.on(po.expired,async e=>{const{topic:n,id:r}=Bse(e.target);if(r&&this.client.pendingRequest.keys.includes(r))return await this.deletePendingSessionRequest(r,We("EXPIRED"),!0);if(r&&this.client.auth.requests.keys.includes(r))return await this.deletePendingAuthRequest(r,We("EXPIRED"),!0);n?this.client.session.keys.includes(n)&&(await this.deleteSession({topic:n,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:n})):r&&(await this.deleteProposal(r,!0),this.client.events.emit("proposal_expire",{id:r}))})}registerPairingEvents(){this.client.core.pairing.events.on(Uh.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(Uh.delete,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!gi(e,!1)){const{message:n}=We("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(n)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:n}=We("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(n)}if(Zl(this.client.core.pairing.pairings.get(e).expiry)){const{message:n}=We("EXPIRED",`pairing topic: ${e}`);throw new Error(n)}}async isValidSessionTopic(e){if(!gi(e,!1)){const{message:n}=We("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(n)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){const{message:n}=We("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(n)}if(Zl(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});const{message:n}=We("EXPIRED",`session topic: ${e}`);throw new Error(n)}if(!this.client.core.crypto.keychain.has(e)){const{message:n}=We("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),new Error(n)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(gi(e,!1)){const{message:n}=We("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(n)}else{const{message:n}=We("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(n)}}async isValidProposalId(e){if(!FZe(e)){const{message:n}=We("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(n)}if(!this.client.proposal.keys.includes(e)){const{message:n}=We("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(n)}if(Zl(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);const{message:n}=We("EXPIRED",`proposal id: ${e}`);throw new Error(n)}}}class eet extends ep{constructor(e,n){super(e,n,MQe,aP),this.core=e,this.logger=n}}let tet=class extends ep{constructor(e,n){super(e,n,DQe,aP),this.core=e,this.logger=n}};class net extends ep{constructor(e,n){super(e,n,FQe,aP,r=>r.id),this.core=e,this.logger=n}}class ret extends ep{constructor(e,n){super(e,n,WQe,_9,()=>Ww),this.core=e,this.logger=n}}class iet extends ep{constructor(e,n){super(e,n,qQe,_9),this.core=e,this.logger=n}}class set extends ep{constructor(e,n){super(e,n,ZQe,_9,r=>r.id),this.core=e,this.logger=n}}var aet=Object.defineProperty,oet=(t,e,n)=>e in t?aet(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,BS=(t,e,n)=>oet(t,typeof e!="symbol"?e+"":e,n);class cet{constructor(e,n){this.core=e,this.logger=n,BS(this,"authKeys"),BS(this,"pairingTopics"),BS(this,"requests"),this.authKeys=new ret(this.core,this.logger),this.pairingTopics=new iet(this.core,this.logger),this.requests=new set(this.core,this.logger)}
568async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}var uet=Object.defineProperty,det=(t,e,n)=>e in t?uet(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,gn=(t,e,n)=>det(t,typeof e!="symbol"?e+"":e,n);let het=class poe extends oGe{constructor(e){super(e),gn(this,"protocol",doe),gn(this,"version",hoe),gn(this,"name",DS.name),gn(this,"metadata"),gn(this,"core"),gn(this,"logger"),gn(this,"events",new Za.EventEmitter),gn(this,"engine"),gn(this,"session"),gn(this,"proposal"),gn(this,"pendingRequest"),gn(this,"auth"),gn(this,"signConfig"),gn(this,"on",(r,i)=>this.events.on(r,i)),gn(this,"once",(r,i)=>this.events.once(r,i)),gn(this,"off",(r,i)=>this.events.off(r,i)),gn(this,"removeListener",(r,i)=>this.events.removeListener(r,i)),gn(this,"removeAllListeners",r=>this.events.removeAllListeners(r)),gn(this,"connect",async r=>{try{return await this.engine.connect(r)}catch(i){throw this.logger.error(i.message),i}}),gn(this,"pair",async r=>{try{return await this.engine.pair(r)}catch(i){throw this.logger.error(i.message),i}}),gn(this,"approve",async r=>{try{return await this.engine.approve(r)}catch(i){throw this.logger.error(i.message),i}}),gn(this,"reject",async r=>{try{return await this.engine.reject(r)}catch(i){throw this.logger.error(i.message),i}}),gn(this,"update",async r=>{try{return await this.engine.update(r)}catch(i){throw this.logger.error(i.message),i}}),gn(this,"extend",async r=>{try{return await this.engine.extend(r)}catch(i){throw this.logger.error(i.message),i}}),gn(this,"request",async r=>{try{return await this.engine.request(r)}catch(i){throw this.logger.error(i.message),i}}),gn(this,"respond",async r=>{try{return await this.engine.respond(r)}catch(i){throw this.logger.error(i.message),i}}),gn(this,"ping",async r=>{try{return await this.engine.ping(r)}catch(i){throw this.logger.error(i.message),i}}),gn(this,"emit",async r=>{try{return await this.engine.emit(r)}catch(i){throw this.logger.error(i.message),i}}),gn(this,"disconnect",async r=>{try{return await this.engine.disconnect(r)}catch(i){throw this.logger.error(i.message),i}}),gn(this,"find",r=>{try{return this.engine.find(r)}catch(i){throw this.logger.error(i.message),i}}),gn(this,"getPendingSessionRequests",()=>{try{return this.engine.getPendingSessionRequests()}catch(r){throw this.logger.error(r.message),r}}),gn(this,"authenticate",async(r,i)=>{try{return await this.engine.authenticate(r,i)}catch(s){throw this.logger.error(s.message),s}}),gn(this,"formatAuthMessage",r=>{try{return this.engine.formatAuthMessage(r)}catch(i){throw this.logger.error(i.message),i}}),gn(this,"approveSessionAuthenticate",async r=>{try{return await this.engine.approveSessionAuthenticate(r)}catch(i){throw this.logger.error(i.message),i}}),gn(this,"rejectSessionAuthenticate",async r=>{try{return await this.engine.rejectSessionAuthenticate(r)}catch(i){throw this.logger.error(i.message),i}}),this.name=(e==null?void 0:e.name)||DS.name,this.metadata=iHe(e==null?void 0:e.metadata),this.signConfig=e==null?void 0:e.signConfig;const n=nP({logger:(e==null?void 0:e.logger)||DS.logger,name:this.name});this.logger=n,this.core=(e==null?void 0:e.core)||new jQe(e),this.session=new tet(this.core,this.logger),this.proposal=new eet(this.core,this.logger),this.pendingRequest=new net(this.core,this.logger),this.engine=new QQe(this),this.auth=new cet(this.core,this.logger)}static async init(e){const n=new poe(e);return await n.initialize(),n}get context(){return ma(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.auth.init(),await this.engine.init(),this.logger.info("SignClient Initialization Success")}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}};const fet=het;var nw={exports:{}},pZ;function pet(){return pZ||(pZ=1,(function(t,e){var n=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof ql<"u"&&ql,r=(function(){function s(){this.fetch=!1,this.DOMException=n.DOMException}return s.prototype=n,new s})();(function(s){(function(a){var o=typeof s<"u"&&s||typeof self<"u"&&self||typeof ql<"u"&&ql||{},l={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function u(T){return T&&DataView.prototype.isPrototypeOf(T)}if(l.arrayBuffer)var f=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array
568]"],p=ArrayBuffer.isView||function(T){return T&&f.indexOf(Object.prototype.toString.call(T))>-1};function y(T){if(typeof T!="string"&&(T=String(T)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(T)||T==="")throw new TypeError('Invalid character in header field name: "'+T+'"');return T.toLowerCase()}function g(T){return typeof T!="string"&&(T=String(T)),T}function b(T){var L={next:function(){var M=T.shift();return{done:M===void 0,value:M}}};return l.iterable&&(L[Symbol.iterator]=function(){return L}),L}function v(T){this.map={},T instanceof v?T.forEach(function(L,M){this.append(M,L)},this):Array.isArray(T)?T.forEach(function(L){if(L.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+L.length);this.append(L[0],L[1])},this):T&&Object.getOwnPropertyNames(T).forEach(function(L){this.append(L,T[L])},this)}v.prototype.append=function(T,L){T=y(T),L=g(L);var M=this.map[T];this.map[T]=M?M+", "+L:L},v.prototype.delete=function(T){delete this.map[y(T)]},v.prototype.get=function(T){return T=y(T),this.has(T)?this.map[T]:null},v.prototype.has=function(T){return this.map.hasOwnProperty(y(T))},v.prototype.set=function(T,L){this.map[y(T)]=g(L)},v.prototype.forEach=function(T,L){for(var M in this.map)this.map.hasOwnProperty(M)&&T.call(L,this.map[M],M,this)},v.prototype.keys=function(){var T=[];return this.forEach(function(L,M){T.push(M)}),b(T)},v.prototype.values=function(){var T=[];return this.forEach(function(L){T.push(L)}),b(T)},v.prototype.entries=function(){var T=[];return this.forEach(function(L,M){T.push([M,L])}),b(T)},l.iterable&&(v.prototype[Symbol.iterator]=v.prototype.entries);function _(T){if(!T._noBody){if(T.bodyUsed)return Promise.reject(new TypeError("Already read"));T.bodyUsed=!0}}function C(T){return new Promise(function(L,M){T.onload=function(){L(T.result)},T.onerror=function(){M(T.error)}})}function S(T){var L=new FileReader,M=C(L);return L.readAsArrayBuffer(T),M}function x(T){var L=new FileReader,M=C(L),Z=/charset=([A-Za-z0-9_-]+)/.exec(T.type),H=Z?Z[1]:"utf-8";return L.readAsText(T,H),M}function A(T){for(var L=new Uint8Array(T),M=new Array(L.length),Z=0;Z<L.length;Z++)M[Z]=String.fromCharCode(L[Z]);return M.join("")}function I(T){if(T.slice)return T.slice(0);var L=new Uint8Array(T.byteLength);return L.set(new Uint8Array(T)),L.buffer}function $(){return this.bodyUsed=!1,this._initBody=function(T){this.bodyUsed=this.bodyUsed,this._bodyInit=T,T?typeof T=="string"?this._bodyText=T:l.blob&&Blob.prototype.isPrototypeOf(T)?this._bodyBlob=T:l.formData&&FormData.prototype.isPrototypeOf(T)?this._bodyFormData=T:l.searchParams&&URLSearchParams.prototype.isPrototypeOf(T)?this._bodyText=T.toString():l.arrayBuffer&&l.blob&&u(T)?(this._bodyArrayBuffer=I(T.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):l.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(T)||p(T))?this._bodyArrayBuffer=I(T):this._bodyText=T=Object.prototype.toString.call(T):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof T=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):l.searchParams&&URLSearchParams.prototype.isPrototypeOf(T)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},l.blob&&(this.blob=function(){var T=_(this);if(T)return T;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var T=_(this);return T||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(l.blob)return this.blob().then(S);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var T=_(this);if(T)return T;if(this._bodyBlob)return x(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(A(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},l.formData&&(this.formData=function(){return this.text().then(U)}),this.json=function(){return this.text().then(JSON.parse)},this}var O=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function P(T){var L=T.toUpperCase();return O.indexOf(L)>-1?L:T}function j(T,L){if(!(this instanceof j))throw new TypeError('Please use the "new" operator, this DOM object c
568onstructor cannot be called as a function.');L=L||{};var M=L.body;if(T instanceof j){if(T.bodyUsed)throw new TypeError("Already read");this.url=T.url,this.credentials=T.credentials,L.headers||(this.headers=new v(T.headers)),this.method=T.method,this.mode=T.mode,this.signal=T.signal,!M&&T._bodyInit!=null&&(M=T._bodyInit,T.bodyUsed=!0)}else this.url=String(T);if(this.credentials=L.credentials||this.credentials||"same-origin",(L.headers||!this.headers)&&(this.headers=new v(L.headers)),this.method=P(L.method||this.method||"GET"),this.mode=L.mode||this.mode||null,this.signal=L.signal||this.signal||(function(){if("AbortController"in o){var V=new AbortController;return V.signal}})(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&M)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(M),(this.method==="GET"||this.method==="HEAD")&&(L.cache==="no-store"||L.cache==="no-cache")){var Z=/([?&])_=[^&]*/;if(Z.test(this.url))this.url=this.url.replace(Z,"$1_="+new Date().getTime());else{var H=/\?/;this.url+=(H.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}j.prototype.clone=function(){return new j(this,{body:this._bodyInit})};function U(T){var L=new FormData;return T.trim().split("&").forEach(function(M){if(M){var Z=M.split("="),H=Z.shift().replace(/\+/g," "),V=Z.join("=").replace(/\+/g," ");L.append(decodeURIComponent(H),decodeURIComponent(V))}}),L}function z(T){var L=new v,M=T.replace(/\r?\n[\t ]+/g," ");return M.split("\r").map(function(Z){return Z.indexOf(` 569`)===0?Z.substr(1,Z.length):Z}).forEach(function(Z){var H=Z.split(":"),V=H.shift().trim();if(V){var F=H.join(":").trim();try{L.append(V,F)}catch(q){console.warn("Response "+q.message)}}}),L}$.call(j.prototype);function D(T,L){if(!(this instanceof D))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(L||(L={}),this.type="default",this.status=L.status===void 0?200:L.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=L.statusText===void 0?"":""+L.statusText,this.headers=new v(L.headers),this.url=L.url||"",this._initBody(T)}$.call(D.prototype),D.prototype.clone=function(){return new D(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new v(this.headers),url:this.url})},D.error=function(){var T=new D(null,{status:200,statusText:""});return T.ok=!1,T.status=0,T.type="error",T};var R=[301,302,303,307,308];D.redirect=function(T,L){if(R.indexOf(L)===-1)throw new RangeError("Invalid status code");return new D(null,{status:L,headers:{location:T}})},a.DOMException=o.DOMException;try{new a.DOMException}catch{a.DOMException=function(L,M){this.message=L,this.name=M;var Z=Error(L);this.stack=Z.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function W(T,L){return new Promise(function(M,Z){var H=new j(T,L);if(H.signal&&H.signal.aborted)return Z(new a.DOMException("Aborted","AbortError"));var V=new XMLHttpRequest;function F(){V.abort()}V.onload=function(){var Y={statusText:V.statusText,headers:z(V.getAllResponseHeaders()||"")};H.url.indexOf("file://")===0&&(V.status<200||V.status>599)?Y.status=200:Y.status=V.status,Y.url="responseURL"in V?V.responseURL:Y.headers.get("X-Request-URL");var X="response"in V?V.response:V.responseText;setTimeout(function(){M(new D(X,Y))},0)},V.onerror=function(){setTimeout(function(){Z(new TypeError("Network request failed"))},0)},V.ontimeout=function(){setTimeout(function(){Z(new TypeError("Network request timed out"))},0)},V.onabort=function(){setTimeout(function(){Z(new a.DOMException("Aborted","AbortError"))},0)};function q(Y){try{return Y===""&&o.location.href?o.location.href:Y}catch{return Y}}if(V.open(H.method,q(H.url),!0),H.credentials==="include"?V.withCredentials=!0:H.credentials==="omit"&&(V.withCredentials=!1),"responseType"in V&&(l.blob?V.responseType="blob":l.arrayBuffer&&(V.responseType="arraybuffer")),L&&typeof L.headers=="object"&&!(L.headers instanceof v||o.Headers&&L.headers instanceof o.Headers)){var G=[];
vendor: 4,407 bytes, line 569
569Object.getOwnPropertyNames(L.headers).forEach(function(Y){G.push(y(Y)),V.setRequestHeader(Y,g(L.headers[Y]))}),H.headers.forEach(function(Y,X){G.indexOf(X)===-1&&V.setRequestHeader(X,Y)})}else H.headers.forEach(function(Y,X){V.setRequestHeader(X,Y)});H.signal&&(H.signal.addEventListener("abort",F),V.onreadystatechange=function(){V.readyState===4&&H.signal.removeEventListener("abort",F)}),V.send(typeof H._bodyInit>"u"?null:H._bodyInit)})}return W.polyfill=!0,o.fetch||(o.fetch=W,o.Headers=v,o.Request=j,o.Response=D),a.Headers=v,a.Request=j,a.Response=D,a.fetch=W,Object.defineProperty(a,"__esModule",{value:!0}),a})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=n.fetch?n:r;e=i.fetch,e.default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e})(nw,nw.exports)),nw.exports}var met=pet();const mZ=Wa(met);var yet=Object.defineProperty,get=Object.defineProperties,bet=Object.getOwnPropertyDescriptors,yZ=Object.getOwnPropertySymbols,wet=Object.prototype.hasOwnProperty,vet=Object.prototype.propertyIsEnumerable,gZ=(t,e,n)=>e in t?yet(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,bZ=(t,e)=>{for(var n in e||(e={}))wet.call(e,n)&&gZ(t,n,e[n]);if(yZ)for(var n of yZ(e))vet.call(e,n)&&gZ(t,n,e[n]);return t},wZ=(t,e)=>get(t,bet(e));const _et={Accept:"application/json","Content-Type":"application/json"},xet="POST",vZ={headers:_et,method:xet},_Z=10;let moe=class{constructor(e,n=!1){if(this.url=e,this.disableProviderPing=n,this.events=new Za.EventEmitter,this.isAvailable=!1,this.registering=!1,!Mq(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=n}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,n){this.events.on(e,n)}once(e,n){this.events.once(e,n)}off(e,n){this.events.off(e,n)}removeListener(e,n){this.events.removeListener(e,n)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e){this.isAvailable||await this.register();try{const n=ju(e),r=await(await mZ(this.url,wZ(bZ({},vZ),{body:n}))).json();this.onPayload({data:r})}catch(n){this.onError(e.id,n)}}async register(e=this.url){if(!Mq(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const n=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=n||this.events.listenerCount("open")>=n)&&this.events.setMaxListeners(n+1),new Promise((r,i)=>{this.events.once("register_error",s=>{this.resetMaxListeners(),i(s)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return i(new Error("HTTP connection is missing or invalid"));r()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const n=ju({id:1,jsonrpc:"2.0",method:"test",params:[]});await mZ(e,wZ(bZ({},vZ),{body:n}))}this.onOpen()}catch(n){const r=this.parseError(n);throw this.events.emit("register_error",r),this.onClose(),r}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const n=typeof e.data=="string"?Lf(e.data):e.data;this.events.emit("payload",n)}onError(e,n){const r=this.parseError(n),i=r.message||r.toString(),s=b9(e,i);this.events.emit("payload",s)}parseError(e,n=this.url){return Hae(e,n,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>_Z&&this.events.setMaxListeners(_Z)}};function oP(t){return t==null||typeof t!="object"&&typeof t!="function"}function yoe(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function goe(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const Cet="[object RegExp]",boe="[object String]",woe="[object Number]",voe="[object Boolean]",_oe="[object Arguments]",Eet="[object Symbol]",Aet="[object Date]",ket="[object Map]",Tet="[object Set]",Let="[object Array]",$et="[object ArrayBuffer]",Iet="[object Object]",Net="[object DataView]",Oet="[object Uint8Array]",Pet="[object Uint8ClampedArray]",Ret="[object Uint16Array]",jet="[object Uint32Array]",Met="[object Int8Array]",Det="[object Int16Array]",Uet="[object Int32Array]",Bet="[object Float32Array]",Fet="[object Float64Array
569]";function lP(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function zet(t,e){return P0(t,void 0,t,new Map,e)}function P0(t,e,n,r=new Map,i=void 0){const s=i==null?void 0:i(t,e,n,r);if(s!=null)return s;if(oP(t))return t;if(r.has(t))return r.get(t);if(Array.isArray(t)){const a=new Array(t.length);r.set(t,a);for(let o=0;o<t.length;o++)a[o]=P0(t[o],o,n,r,i);return Object.hasOwn(t,"index")&&(a.index=t.index),Object.hasOwn(t,"input")&&(a.input=t.input),a}if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){const a=new RegExp(t.source,t.flags);return a.lastIndex=t.lastIndex,a}if(t instanceof Map){const a=new Map;r.set(t,a);for(const[o,l]of t)a.set(o,P0(l,o,n,r,i));return a}if(t instanceof Set){const a=new Set;r.set(t,a);for(const o of t)a.add(P0(o,void 0,n,r,i));return a}if(typeof Buffer<"u"&&Buffer.isBuffer(t))return t.subarray();if(lP(t)){const a=new(Object.getPrototypeOf(t)).constructor(t.length);r.set(t,a);for(let o=0;o<t.length;o++)a[o]=P0(t[o],o,n,r,i);return a}if(t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer)return t.slice(0);if(t instanceof DataView){const a=new DataView(t.buffer.slice(0),t.byteOffset,t.byteLength);return r.set(t,a),Bh(a,t,n,r,i),a}if(typeof File<"u"&&t instanceof File){const a=new File([t],t.name,{type:t.type});return r.set(t,a),Bh(a,t,n,r,i),a}if(t instanceof Blob){const a=new Blob([t],{type:t.type});return r.set(t,a),Bh(a,t,n,r,i),a}if(t instanceof Error){const a=new t.constructor;return r.set(t,a),a.message=t.message,a.name=t.name,a.stack=t.stack,a.cause=t.cause,Bh(a,t,n,r,i),a}if(typeof t=="object"&&Vet(t)){const a=Object.create(Object.getPrototypeOf(t));return r.set(t,a),Bh(a,t,n,r,i),a}return t}function Bh(t,e,n=t,r,i){const s=[...Object.keys(e),...yoe(e)];for(let a=0;a<s.length;a++){const o=s[a],l=Object.getOwnPropertyDescriptor(t,o);(l==null||l.writable)&&(t[o]=P0(e[o],o,n,r,i))}}function Vet(t){switch(goe(t)){case _oe:case Let:case $et:case Net:case voe:case Aet:case Bet:case Fet:case Met:case Det:case Uet:case ket:case woe:case Iet:case Cet:case Tet:case boe:case Eet:case Oet:case Pet:case Ret:case jet:return!0;default:return!1}}function Het(t,e){return zet(t,(n,r,i,s)=>{if(typeof t=="object")switch(Object.prototype.toString.call(t)){case woe:case boe:case voe:{const a=new t.constructor(t==null?void 0:t.valueOf());return Bh(a,t),a}case _oe:{const a={};return Bh(a,t),a.length=t.length,a[Symbol.iterator]=t[Symbol.iterator],a}default:return}})}function xZ(t){return Het(t)}function CZ(t){return t!==null&&typeof t=="object"&&goe(t)==="[object Arguments]"}function EZ(t){return typeof t=="object"&&t!==null}function Wet(){}function qet(t){return lP(t)}function Zet(t){var n;if(typeof t!="object"||t==null)return!1;if(Object.getPrototypeOf(t)===null)return!0;if(Object.prototype.toString.call(t)!=="[object Object]"){const r=t[Symbol.toStringTag];return r==null||!((n=Object.getOwnPropertyDescriptor(t,Symbol.toStringTag))!=null&&n.writable)?!1:t.toString()===`[object ${r}]`}let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function Ket(t){if(oP(t))return t;if(Array.isArray(t)||lP(t)||t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer)return t.slice(0);const e=Object.getPrototypeOf(t),n=e.constructor;if(t instanceof Date||t instanceof Map||t instanceof Set)return new n(t);if(t instanceof RegExp){const r=new n(t);return r.lastIndex=t.lastIndex,r}if(t instanceof DataView)return new n(t.buffer.slice(0));if(t instanceof Error){const r=new n(t.message);return r.stack=t.stack,r.name=t.name,r.cause=t.cause,r}if(typeof File<"u"&&t instanceof File)return new n([t],t.name,{type:t.type,lastModified:t.lastModified});if(typeof t=="object"){const r=Object.create(e);return Object.assign(r,t)}return t}function Get(t,...e){const n=e.slice(0,-1),r=e[e.length-1];let i=t;for(let s=0;s<n.length;s++){const a=n[s];i=n$(i,a,r,new Map)}return i}function n$(t,e,n,r){if(oP(t)&&(t=Object(t)),e==null||typeof e!="object")return t;if(r.has(e))return Ket(r.get(e));if(r.set(e,t),Array.isArray(e)){e=e.slice();for(let s=0;s<e.length;s++)e[s]=e[s]??void 0}const i=[...Object.keys(e),...yoe(e)];for(let s=0;s<i.length;s++){const a=i[s];let o=e[a],l=t[a];if(CZ(o)&&(o={...o}),CZ(l)&&(l={...l}),typeof Buffer<"u"&&Buffer.isBuffer(o)&&(o=xZ(o)),Array.isArray(o))if(typeof l=="object"&&l!=null){const f=[],p=Reflect.ownKeys(l);for(let y=0;y<p.length;y++){const g=p[y];f[g]=l[g]}l=f}else l=[];const u=n(l,o,a,t,e,r);u!=null?t[a]=u:Array.isArray(o)||EZ(l)&&EZ(o)?t[a]=n$(l,o,n,r):l==null&&Zet(o)?t[a]=n$({},o,n,r):l==null&&qet(o)?t[a]=xZ(o):(l===void 0||o!==void 0)&&(t[a]=o)}return t}function Yet(t,...e){return Get(t,...e,Wet)}const SZ="error",Jet="wss://relay.walletconnect.org",Xet="wc",xoe="universal_provider",rw=`${Xet}@2:${xoe}:`,Coe="https://rpc.walletconnect.org/v1/",Eoe="generic",Qet=`${Coe}bundler`,Y0="call_status",ett=86400,cP={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var ttt=Object.defineProperty,ntt=Object.defineProperties,rtt=Object.getOwnPropertyDescriptors,AZ=Object.getOwnPropertySymbols,itt=Object.prototype.hasOwnProperty,stt=Object.prototype.propertyIsEnumerable,kZ=(t,e,n)=>e in t?ttt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,iw=(t,e)=>{for(var n in e||(e={}))itt.call(e,n)&&kZ(t,n,e[n]);if(AZ)for(var n of AZ(e))stt.call(e,n)&&kZ(t,n,e[n]);return t},att=(t,e)=>ntt(t,rtt(e));function Soe(t,e,n){var r;const i=Su(t);return((r=e.rpcMap)==null?void 0:r[i.reference])||`${Coe}?chainId=${i.namespace}:${i.reference}&projectId=${n}`}function ott(t){return t.includes(":")?t.split(":")[1]:t}function Aoe(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function ltt(t,e){const n=Object.keys(e.namespaces).filter(i=>i.includes(t));if(!n.length)return[];const r=[];
vendor: 20,669 bytes, line 569
569return n.forEach(i=>{const s=e.namespaces[i].accounts;r.push(...s)}),r}function TZ(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>{var r,i;return((r=n==null?void 0:n.chains)==null?void 0:r.length)&&((i=n==null?void 0:n.chains)==null?void 0:i.length)>0}))}function sw(t={},e={}){const n=TZ(LZ(t)),r=TZ(LZ(e));return Yet(n,r)}function LZ(t){var e,n,r,i,s;const a={};if(!nc(t))return a;for(const[o,l]of Object.entries(t)){const u=g9(o)?[o]:l.chains,f=l.methods||[],p=l.events||[],y=l.rpcMap||{},g=O0(o);a[g]=att(iw(iw({},a[g]),l),{chains:tc(u,(e=a[g])==null?void 0:e.chains),methods:tc(f,(n=a[g])==null?void 0:n.methods),events:tc(p,(r=a[g])==null?void 0:r.events)}),(nc(y)||nc(((i=a[g])==null?void 0:i.rpcMap)||{}))&&(a[g].rpcMap=iw(iw({},y),(s=a[g])==null?void 0:s.rpcMap))}return a}function $Z(t){return t.includes(":")?t.split(":")[2]:t}function IZ(t){const e={};for(const[n,r]of Object.entries(t)){const i=r.methods||[],s=r.events||[],a=r.accounts||[],o=g9(n)?[n]:r.chains?r.chains:Aoe(r.accounts);e[n]={chains:o,methods:i,events:s,accounts:a}}return e}function FS(t){return typeof t=="number"?t:t.includes("0x")?parseInt(t,16):(t=t.includes(":")?t.split(":")[1]:t,isNaN(Number(t))?t:Number(t))}function ctt(t){try{const e=JSON.parse(t);return typeof e=="object"&&e!==null&&!Array.isArray(e)}catch{return!1}}const koe={},J0=t=>koe[t],zS=(t,e)=>{koe[t]=e};var utt=Object.defineProperty,NZ=Object.getOwnPropertySymbols,dtt=Object.prototype.hasOwnProperty,htt=Object.prototype.propertyIsEnumerable,OZ=(t,e,n)=>e in t?utt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,PZ=(t,e)=>{for(var n in e||(e={}))dtt.call(e,n)&&OZ(t,n,e[n]);if(NZ)for(var n of NZ(e))htt.call(e,n)&&OZ(t,n,e[n]);return t};const RZ="eip155",ftt=["atomic","flow-control","paymasterService","sessionKeys","auxiliaryFunds"],ptt=t=>t&&t.startsWith("0x")?BigInt(t).toString(10):t,VS=t=>t&&t.startsWith("0x")?t:`0x${BigInt(t).toString(16)}`,jZ=t=>Object.keys(t).filter(e=>ftt.includes(e)).reduce((e,n)=>(e[n]=mtt(t[n]),e),{}),mtt=t=>typeof t=="string"&&ctt(t)?JSON.parse(t):t,ytt=(t,e,n)=>{const{sessionProperties:r={},scopedProperties:i={}}=t,s={};if(!nc(i)&&!nc(r))return;const a=jZ(r);for(const o of n){const l=ptt(o);if(!l)continue;s[VS(l)]=a;const u=i==null?void 0:i[`${RZ}:${l}`];if(u){const f=u==null?void 0:u[`${RZ}:${l}:${e}`];s[VS(l)]=PZ(PZ({},s[VS(l)]),jZ(f||u))}}for(const[o,l]of Object.entries(s))Object.keys(l).length===0&&delete s[o];return Object.keys(s).length>0?s:void 0};var gtt=Object.defineProperty,btt=(t,e,n)=>e in t?gtt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,wtt=(t,e,n)=>btt(t,e+"",n);let HS,vtt=class Toe{constructor(e){wtt(this,"storage"),this.storage=e}async getItem(e){return await this.storage.getItem(e)}async setItem(e,n){return await this.storage.setItem(e,n)}async removeItem(e){return await this.storage.removeItem(e)}static getStorage(e){return HS||(HS=new Toe(e)),HS}};var _tt=Object.defineProperty,xtt=Object.defineProperties,Ctt=Object.getOwnPropertyDescriptors,MZ=Object.getOwnPropertySymbols,Ett=Object.prototype.hasOwnProperty,Stt=Object.prototype.propertyIsEnumerable,DZ=(t,e,n)=>e in t?_tt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Att=(t,e)=>{for(var n in e||(e={}))Ett.call(e,n)&&DZ(t,n,e[n]);if(MZ)for(var n of MZ(e))Stt.call(e,n)&&DZ(t,n,e[n]);return t},ktt=(t,e)=>xtt(t,Ctt(e));async function Ttt(t,e){const n=Su(t.result.capabilities.caip345.caip2),r=t.result.capabilities.caip345.transactionHashes,i=await Promise.allSettled(r.map(p=>Ltt(n.reference,p,e))),s=i.filter(p=>p.status==="fulfilled").map(p=>p.value).filter(p=>p);i.filter(p=>p.status==="rejected").forEach(p=>console.warn("Failed to fetch transaction receipt:",p.reason));const a=!s.length||s.some(p=>!p),o=s.every(p=>(p==null?void 0:p.status)==="0x1"),l=s.every(p=>(p==null?void 0:p.status)==="0x0"),u=s.some(p=>(p==null?void 0:p.status)==="0x0");let f;return a?f=100:o?f=200:l?f=500:u&&(f=600),{id:t.result.id,version:t.request.version,atomic:t.request.atomicRequired,chainId:t.request.chainId,capabilities:t.result.capabilities,receipts:s,status:f}}async function Ltt(t,e,n){return await n(parseInt(t)).request(ul("eth_getTransactionReceipt",[e]))}async function $tt({sendCalls:t,storage:e}){const n=await e.getItem(Y0);await e.setItem(Y0,ktt(Att({},n),{[t.result.id]:{request:t.request,result:t.result,expiry:hi(ett)}}))}async function Itt({resultId:t,storage:e}){const n=await e.getItem(Y0);if(n){delete n[t],await e.setItem(Y0,n);for(const r in n)Zl(n[r].expiry)&&delete n[r];await e.setItem(Y0,n)}}async function Ntt({resultId:t,storage:e}){const n=await e.getItem(Y0),r=n==null?void 0:n[t];if(r&&!Zl(r.expiry))return r;await Itt({resultId:t,storage:e})}var Ott=Object.defineProperty,Ptt=Object.defineProperties,Rtt=Object.getOwnPropertyDescriptors,UZ=Object.getOwnPropertySymbols,jtt=Object.prototype.hasOwnProperty,Mtt=Object.prototype.propertyIsEnumerable,r$=(t,e,n)=>e in t?Ott(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,WS=(t,e)=>{for(var n in e||(e={}))jtt.call(e,n)&&r$(t,n,e[n]);if(UZ)for(var n of UZ(e))Mtt.call(e,n)&&r$(t,n,e[n]);return t},qS=(t,e)=>Ptt(t,Rtt(e)),Ch=(t,e,n)=>r$(t,typeof e!="symbol"?e+"":e,n);let Dtt=class{constructor(e){Ch(this,"name","eip155"),Ch(this,"client"),Ch(this,"chainId"),Ch(this,"namespace"),Ch(this,"httpProviders"),Ch(this,"events"),Ch(this,"storage"),this.namespace=e.namespace,this.events=J0("events"),this.client=J0("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain()),this.storage=vtt.getStorage(this.client.core.storage)}async request(e){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(e);case"wallet_getCallsStatus":return await this.getCallStatus(e);case"wallet_sendCalls":return await this.sendCalls(e)}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,n){this.httpProviders[e]||this.setHttpProvider(parseInt(e),n);const r=this.chainId;this.chainId=parseInt(e),this.events.emit(cP.DEFAULT_CHAIN_CHANGED,{currentCaipChainId:`${this.name}:${e}`,previousCaipChainId:`${this.name}:${r}`})}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,n){const r=n||Soe(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${e}`);return new sP(new moe(r,J0("disableProviderPing")))}setHttpProvider(e,n){const r=this.createHttpProvider(e,n);r&&(this.httpProviders[e]=r)}createHttpProviders(){const e={};return this.namespace.chains.forEach(n=>{var r;const i=parseInt(ott(n));e[i]=this.createHttpProvider(i,(r=this.namespace.rpcMap)==null?void 0:r[n])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(n=>n.split(":")[1]===this.chainId.toString()).map(n=>n.split(":")[2]))]:[]}getHttpProvider(e){const n=e||this.chainId;return this.httpProviders[n]||(this.httpProviders=qS(WS({},this.httpProviders),{[n]:this.createHttpProvider(n)}),this.httpProviders[n])}async handleSwitchChain(e){var n,r;let i=e.request.params?(n=e.request.params[0])==null?void 0:n.chainId:"0x0";i=i.startsWith("0x")?i:`0x${i}`;const s=parseInt(i,16);if(this.isChainApproved(s))this.setDefaultChain(`${s}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:i}]},chainId:(r=this.namespace.chains)==null?void 0:r[0]}),this.setDefaultChain(`${s}`);else throw new Error(`Failed to switch to chain 'eip155:${s}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}async getCapabilities(e){var n,r,i,s,a;const o=(r=(n=e.request)==null?void 0:n.params)==null?void 0:r[0],l=((s=(i=e.request)==null?void 0:i.params)==null?void 0:s[1])||[];if(!o)throw new Error("Missing address parameter in `wallet_getCapabilities` request");const u=this.client.session.get(e.topic),f=((a=u==null?void 0:u.sessionProperties)==null?void 0:a.capabilities)||{},p=`${o}${l.join(",")}`,y=f==null?void 0:f[p];if(y)return y;let g;try{g=ytt(u,o,l)}catch(v){console.warn("Failed to extract capabilities from session",v)}if(g)return g;const b=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:qS(WS({},u.sessionProperties||{}),{capabilities:qS(WS({},f||{}),{[p]:b})})})}catch(v){console.warn("Failed to update session with capabilities",v)}return b}async getCallStatus(e){var n,r,i;const s=this.client.session.get(e.topic),a=(n=s.sessionProperties)==null?void 0:n.bundler_name;if(a){const u=this.getBundlerUrl(e.chainId,a);try{return await this.getUserOperationReceipt(u,e)}catch(f){console.warn("Failed to fetch call status from bundler",f,u)}}const o=(r=s.sessionProperties)==null?void 0:r.bundler_url;if(o)try{return await this.getUserOperationReceipt(o,e)}catch(u){console.warn("Failed to fetch call status from custom bundler",u,o)}const l=await Ntt({resultId:(i=e.request.params)==null?void 0:i[0],storage:this.storage});if(l)try{return await Ttt(l,this.getHttpProvider.bind(this))}catch(u){console.warn("Failed to fetch call status from stored send calls",u,l)}if(this.namespace.methods.includes(e.request.method))return await this.client.request(e);throw new Error("Fetching call status not approved by the wallet.")}async getUserOperationReceipt(e,n){var r;const i=new URL(e),s=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ul("eth_getUserOperationReceipt",[(r=n.request.params)==null?void 0:r[0]]))});if(!s.ok)throw new Error(`Failed to fetch user operation receipt - ${s.status}`);return await s.json()}getBundlerUrl(e,n){return`${Qet}?projectId=${this.client.core.projectId}&chainId=${e}&bundler=${n}`}async sendCalls(e){var n,r,i;const s=await this.client.request(e),a=(n=e.request.params)==null?void 0:n[0],o=s==null?void 0:s.id,l=(s==null?void 0:s.capabilities)||{},u=(r=l==null?void 0:l.caip345)==null?void 0:r.caip2,f=(i=l==null?void 0:l.caip345)==null?void 0:i.transactionHashes;return!o||!u||!(f!=null&&f.length)||await $tt({sendCalls:{request:a,result:s},storage:this.storage}),s}};var Utt=Object.defineProperty,Btt=(t,e,n)=>e in t?Utt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,u0=(t,e,n)=>Btt(t,typeof e!="symbol"?e+"":e,n);let Ftt=class{constructor(e){u0(this,"name",Eoe),u0(this,"client"),u0(this,"httpProviders"),u0(this,"events"),u0(this,"namespace"),u0(this,"chainId"),this.namespace=e.namespace,this.events=J0("events"),this.client=J0("client"),this.chainId=this.getDefaultChain(),this.name=this.getNamespaceName(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(e.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(e.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(e.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(e.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider(e.chainId).request(e.request)}setDefaultChain(e,n){this.httpProviders[e]||this.setHttpProvider(e,n);const r=this.chainId;this.chainId=e,this.events.emit(cP.DEFAULT_CHAIN_CHANGED,{currentCaipChainId:`${this.name}:${e}`,previousCaipChainId:`${this.name}:${r}`})}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getNamespaceName(){const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return Su(e).namespace}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(n=>n.split(":")[1]===this.chainId.toString()).map(n=>n.split(":")[2]))]:[]}createHttpProviders(){var e,n;const r={};return(n=(e=this.namespace)==null?void 0:e.accounts)==null||n.forEach(i=>{var s,a;const o=Su(i),l=(a=(s=this.namespace)==null?void 0:s.rpcMap)==null?void 0:a[`${o.namespace}:${o.reference}`];r[o.reference]=this.createHttpProvider(i,l)}),r}getHttpProvider(e){const n=Su(e).reference,r=this.httpProviders[n];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,n){const r=this.createHttpProvider(e,n);r&&(this.httpProviders[e]=r)}createHttpProvider(e,n){const r=n||Soe(e,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${e}`);return new sP(new moe(r,J0("disableProviderPing")))}};var ztt=Object.defineProperty,Vtt=Object.defineProperties,Htt=Object.getOwnPropertyDescriptors,BZ=Object.getOwnPropertySymbols,Wtt=Object.prototype.hasOwnProperty,qtt=Object.prototype.propertyIsEnumerable,i$=(t,e,n)=>e in t?ztt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Yy=(t,e)=>{for(var n in e||(e={}))Wtt.call(e,n)&&i$(t,n,e[n]);if(BZ)for(var n of BZ(e))qtt.call(e,n)&&i$(t,n,e[n]);return t},aw=(t,e)=>Vtt(t,Htt(e)),uo=(t,e,n)=>i$(t,typeof e!="symbol"?e+"":e,n);let Ztt=class Loe{constructor(e){uo(this,"client"),uo(this,"namespaces"),uo(this,"optionalNamespaces"),uo(this,"sessionProperties"),uo(this,"scopedProperties"),uo(this,"events",new SO),uo(this,"rpcProviders",{}),uo(this,"session"),uo(this,"providerOpts"),uo(this,"logger"),uo(this,"uri"),uo(this,"disableProviderPing",!1);var n,r;this.providerOpts=e,this.logger=nP({logger:(n=e.logger)!=null?n:SZ,name:(r=this.providerOpts.name)!=null?r:xoe}),this.disableProviderPing=(e==null?void 0:e.disableProviderPing)||!1}static async init(e){const n=new Loe(e);return await n.initialize(),n}async request(e,n,r){const[i,s]=this.validateChain(n);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(i).request({request:Yy({},e),chainId:`${i}:${s}`,topic:this.session.topic,expiry:r})}sendAsync(e,n,r,i){const s=new Date().getTime();this.request(e,r,i).then(a=>n(null,_6(s,a))).catch(a=>n(a,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties,scopedProperties:this.scopedProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:Er("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}async authenticate(e,n){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(e),await this.cleanupPendingPairings();const{uri:r,response:i}=await this.client.authenticate(e,n);r&&(this.uri=r,this.events.emit("display_uri",r));const s=await i();if(this.session=s.session,this.session){const a=IZ(this.session.namespaces);this.namespaces=sw(this.namespaces,a),await this.persist("namespaces",this.namespaces),this.onConnect()}return s}on(e,n){this.events.on(e,n)}once(e,n){this.events.once(e,n)}removeListener(e,n){this.events.removeListener(e,n)}off(e,n){this.events.off(e,n)}get isWalletConnect(){return!0}async pair(e){const{uri:n,approval:r}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties,scopedProperties:this.scopedProperties});n&&(this.uri=n,this.events.emit("display_uri",n));const i=await r();this.session=i;const s=IZ(i.namespaces);return this.namespaces=sw(this.namespaces,s),await this.persist("namespaces",this.namespaces),await this.persist("optionalNamespaces",this.optionalNamespaces),this.onConnect(),this.session}setDefaultChain(e,n){try{if(!this.session)return;const[r,i]=this.validateChain(e);this.getProvider(r).setDefaultChain(i,n)}catch(r){if(!/Please call connect/.test(r.message))throw r}}async cleanupPendingPairings(e={}){try{this.logger.info("Cleaning up inactive pairings...");const n=this.client.pairing.getAll();if(!To(n))return;for(const r of n)e.deletePairings?this.client.core.expirer.set(r.topic,0):await this.client.core.relayer.subscriber.unsubscribe(r.topic);this.logger.info(`Inactive pairings cleared: ${n.length}`)}catch(n){this.logger.warn(n,"Failed to cleanup pending pairings")}}abortPairingAttempt(){this.logger.warn("abortPairingAttempt is deprecated. This is now a no-op.")}async checkStorage(){this.namespaces=await this.getFromStore("namespaces")||{},this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.session&&this.createProviders()}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){var e,n;if(this.client=this.providerOpts.client||await fet.init({core:this.providerOpts.core,logger:this.providerOpts.logger||SZ,relayUrl:this.providerOpts.relayUrl||Jet,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name,customStoragePrefix:this.providerOpts.customStoragePrefix,telemetryEnabled:this.providerOpts.telemetryEnabled}),this.providerOpts.session)try{this.session=this.client.session.get(this.providerOpts.session.topic)}catch(r){throw this.logger.error(r,"Failed to get session"),new Error(`The provided session: ${(n=(e=this.providerOpts)==null?void 0:e.session)==null?void 0:n.topic} doesn't exist in the Sign client`)}else{const r=this.client.session.getAll();this.session=r[0]}this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(n=>O0(n)))];zS("client",this.client),zS("events",this.events),zS("disableProviderPing",this.disableProviderPing),e.forEach(n=>{if(!this.session)return;const r=ltt(n,this.session);if((r==null?void 0:r.length)===0)return;const i=Aoe(r),s=sw(this.namespaces,this.optionalNamespaces),a=aw(Yy({},s[n]),{accounts:r,chains:i});switch(n){case"eip155":this.rpcProviders[n]=new Dtt({namespace:a});break;default:this.rpcProviders[n]=new Ftt({namespace:a})}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{var n;const{topic:r}=e;r===((n=this.session)==null?void 0:n.topic)&&this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{var n;const{params:r,topic:i}=e;if(i!==((n=this.session)==null?void 0:n.topic))return;const{event:s}=r;if(s.name==="accountsChanged"){const a=s.data;a&&To(a)&&this.events.emit("accountsChanged",a.map($Z))}else if(s.name==="chainChanged"){const a=r.chainId,o=r.event.data,l=O0(a),u=FS(a)!==FS(o)?`${l}:${FS(o)}`:a;this.onChainChanged({currentCaipChainId:u})}else this.events.emit(s.name,s.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:n})=>{var r,i;if(e!==((r=this.session)==null?void 0:r.topic))return;const{namespaces:s}=n,a=(i=this.client)==null?void 0:i.session.get(e);this.session=aw(Yy({},a),{namespaces:s}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:n})}),this.client.on("session_delete",async e=>{var n;e.topic===((n=this.session)==null?void 0:n.topic)&&(await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",aw(Yy({},Er("USER_DISCONNECTED")),{data:e.topic})))}),this.on(cP.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(aw(Yy({},e),{internal:!0}))})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[Eoe]}
569onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var n;this.getProvider(e).updateNamespace((n=this.session)==null?void 0:n.namespaces[e])})}setNamespaces(e){const{namespaces:n={},optionalNamespaces:r={},sessionProperties:i,scopedProperties:s}=e;this.optionalNamespaces=sw(n,r),this.sessionProperties=i,this.scopedProperties=s}validateChain(e){const[n,r]=(e==null?void 0:e.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[n,r];if(n&&!Object.keys(this.namespaces||{}).map(a=>O0(a)).includes(n))throw new Error(`Namespace '${n}' is not configured. Please call connect() first with namespace config.`);if(n&&r)return[n,r];const i=O0(Object.keys(this.namespaces)[0]),s=this.rpcProviders[i].getDefaultChain();return[i,s]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}async onChainChanged({currentCaipChainId:e,previousCaipChainId:n,internal:r=!1}){if(!this.namespaces)return;const[i,s]=this.validateChain(e);s&&(this.updateNamespaceChain(i,s),r?(this.events.emit("chainChanged",s),this.emitAccountsChangedOnChainChange({namespace:i,currentCaipChainId:e,previousCaipChainId:n})):this.getProvider(i).setDefaultChain(s),await this.persist("namespaces",this.namespaces))}emitAccountsChangedOnChainChange({namespace:e,currentCaipChainId:n,previousCaipChainId:r}){var i,s;try{if(r===n)return;const a=(s=(i=this.session)==null?void 0:i.namespaces[e])==null?void 0:s.accounts;if(!a)return;const o=a.filter(l=>l.includes(`${n}:`)).map($Z);if(!To(o))return;this.events.emit("accountsChanged",o)}catch(a){this.logger.warn(a,"Failed to emit accountsChanged on chain change")}}updateNamespaceChain(e,n){if(!this.namespaces)return;const r=this.namespaces[e]?e:`${e}:${n}`,i={chains:[],methods:[],events:[],defaultChain:n};this.namespaces[r]?this.namespaces[r]&&(this.namespaces[r].defaultChain=n):this.namespaces[r]=i}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,await this.deleteFromStore("namespaces"),await this.deleteFromStore("optionalNamespaces"),await this.deleteFromStore("sessionProperties"),this.session=void 0,this.cleanupPendingPairings({deletePairings:!0}),await this.cleanupStorage()}async persist(e,n){var r;const i=((r=this.session)==null?void 0:r.topic)||"";await this.client.core.storage.setItem(`${rw}/${e}${i}`,n)}async getFromStore(e){var n;const r=((n=this.session)==null?void 0:n.topic)||"";return await this.client.core.storage.getItem(`${rw}/${e}${r}`)}async deleteFromStore(e){var n;const r=((n=this.session)==null?void 0:n.topic)||"";await this.client.core.storage.removeItem(`${rw}/${e}${r}`)}async cleanupStorage(){var e;try{if(((e=this.client)==null?void 0:e.session.length)>0)return;const n=await this.client.core.storage.getKeys();for(const r of n)r.startsWith(rw)&&await this.client.core.storage.removeItem(r)}catch(n){this.logger.warn(n,"Failed to cleanup storage")}}};const Ktt=Ztt,Gtt="wc",Ytt="ethereum_provider",Jtt=`${Gtt}@2:${Ytt}:`,Xtt="https://rpc.walletconnect.org/v1/",s$=["eth_sendTransaction","personal_sign"],$oe=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_sendCalls","wallet_getCapabilities","wallet_getCallsStatus","wallet_showCallsStatus"],a$=["chainChanged","accountsChanged"],Ioe=["chainChanged","accountsChanged","message","disconnect","connect"],Qtt=async()=>{const{createAppKit:t}=await Le(()=>import("./core-CwHXyt9s.js").then(e=>e.ai),[]);return t};var ent=Object.defineProperty,tnt=Object.defineProperties,nnt=Object.getOwnPropertyDescriptors,FZ=Object.getOwnPropertySymbols,rnt=Object.prototype.hasOwnProperty,int=Object.prototype.propertyIsEnumerable,o$=(t,e,n)=>e in t?ent(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,$h=(t,e)=>{for(var n in e||(e={}))rnt.call(e,n)&&o$(t,n,e[n]);if(FZ)for(var n of FZ(e))int.call(e,n)&&o$(t,n,e[n]);return t},Jy=(t,e)=>tnt(t,nnt(e)),Aa=(t,e,n)=>o$(t,typeof e!="symbol"?e+"":e,n);function xv(t){return Number(t[0].split(":")[1])}function ow(t){return`0x${t.toString(16)}`}function snt(t){const{chains:e,optionalChains:n,methods:r,optionalMethods:i,events:s,optionalEvents:a,rpcMap:o}=t;if(!To(e))throw new Error("Invalid chains");const l={chains:e,methods:r||s$,events:s||a$,rpcMap:$h({},e.length?{[xv(e)]:o[xv(e)]}:{})},u=s==null?void 0:s.filter(g=>!a$.includes(g)),f=r==null?void 0:r.filter(g=>!s$.includes(g));if(!n&&!a&&!i&&!(u!=null&&u.length)&&!(f!=null&&f.length))return{required:e.length?l:void 0};const p=(u==null?void 0:u.length)&&(f==null?void 0:f.length)||!n,y={chains:[...new Set(p?l.chains.concat(n||[]):n)],methods:[...new Set(l.methods.concat(i!=null&&i.length?i:$oe))],events:[...new Set(l.events.concat(a!=null&&a.length?a:Ioe))],rpcMap:o};return{required:e.length?l:void 0,optional:n.length?y:void 0}}let ant=class Noe{constructor(){Aa(this,"events",new Za.EventEmitter),Aa(this,"namespace","eip155"),Aa(this,"accounts",[]),Aa(this,"signer"),Aa(this,"chainId",1),Aa(this,"modal"),Aa(this,"rpc"),Aa(this,"STORAGE_KEY",Jtt),Aa(this,"on",(e,n)=>(this.events.on(e,n),this)),Aa(this,"once",(e,n)=>(this.events.once(e,n),this)),Aa(this,"removeListener",(e,n)=>(this.events.removeListener(e,n),this)),Aa(this,"off",(e,n)=>(this.events.off(e,n),this)),Aa(this,"parseAccount",e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e),this.signer={},this.rpc={}}static async init(e){const n=new Noe;return await n.initialize(e),n}async request(e,n){return await this.signer.request(e,this.formatChainId(this.chainId),n)}sendAsync(e,n,r){this.signer.sendAsync(e,n,this.formatChainId(this.chainId),r)}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){var n;if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:r,optional:i}=snt(this.rpc);try{const s=await new Promise(async(o,l)=>{var u,f;this.rpc.showQrModal&&((u=this.modal)==null||u.open(),(f=this.modal)==null||f.subscribeState(y=>{!y.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),l(new Error("Connection request reset. Please try again.")))}));const p=e!=null&&e.scopedProperties?{[this.namespace]:e.scopedProperties}:void 0;await this.signer.connect(Jy($h({namespaces:$h({},r&&{[this.namespace]:r})},i&&{optionalNamespaces:{[this.namespace]:i}}),{pairingTopic:e==null?void 0:e.pairingTopic,scopedProperties:p})).then(y=>{o(y)}).catch(y=>{var g;(g=this.modal)==null||g.showErrorMessage("Unable to connect"),l(new Error(y.message))})});if(!s)return;const a=LW(s.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:a),this.setAccounts(a),this.events.emit("connect",{chainId:ow(this.chainId)})}catch(s){throw this.signer.logger.error(s),s}finally{(n=this.modal)==null||n.close()}}async authenticate(e,n){var r;if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts({chains:e==null?void 0:e.chains});try{const i=await new Promise(async(a,o)=>{var l,u;this.rpc.showQrModal&&((l=this.modal)==null||l.open(),(u=this.modal)==null||u.subscribeState(f=>{!f.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),o(new Error("Connection request reset. Please try again.")))})),await this.signer.authenticate(Jy($h({},e),{chains:this.rpc.chains}),n).then(f=>{a(f)}
569).catch(f=>{var p;(p=this.modal)==null||p.showErrorMessage("Unable to connect"),o(new Error(f.message))})}),s=i.session;if(s){const a=LW(s.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:a),this.setAccounts(a),this.events.emit("connect",{chainId:ow(this.chainId)})}return i}catch(i){throw this.signer.logger.error(i),i}finally{(r=this.modal)==null||r.close()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:n}=e,{event:r}=n;r.name==="accountsChanged"?(this.accounts=this.parseAccounts(r.data),this.events.emit("accountsChanged",this.accounts)):r.name==="chainChanged"?this.setChainId(this.formatChainId(r.data)):this.events.emit(r.name,r.data),this.events.emit("session_event",e)}),this.signer.on("accountsChanged",e=>{this.accounts=this.parseAccounts(e),this.events.emit("accountsChanged",this.accounts)}),this.signer.on("chainChanged",e=>{const n=parseInt(e);this.chainId=n,this.events.emit("chainChanged",ow(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",Jy($h({},Er("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return typeof e=="string"?e.startsWith(`${this.namespace}:`):!1}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const n=e.filter(r=>this.isCompatibleChainId(r)).map(r=>this.parseChainId(r));n.length&&(this.chainId=n[0],this.events.emit("chainChanged",ow(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const n=this.parseChainId(e);this.chainId=n,this.switchEthereumChain(n)}}parseAccountId(e){const[n,r,i]=e.split(":");return{chainId:`${n}:${r}`,address:i}}setAccounts(e){this.accounts=e.filter(n=>this.parseChainId(this.parseAccountId(n).chainId)===this.chainId).map(n=>this.parseAccountId(n).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var n,r;const i=(n=e==null?void 0:e.chains)!=null?n:[],s=(r=e==null?void 0:e.optionalChains)!=null?r:[],a=i.concat(s);if(!a.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const o=i.length?(e==null?void 0:e.methods)||s$:[],l=i.length?(e==null?void 0:e.events)||a$:[],u=(e==null?void 0:e.optionalMethods)||[],f=(e==null?void 0:e.optionalEvents)||[],p=(e==null?void 0:e.rpcMap)||this.buildRpcMap(a,e.projectId),y=(e==null?void 0:e.qrModalOptions)||void 0;return{chains:i==null?void 0:i.map(g=>this.formatChainId(g)),optionalChains:s.map(g=>this.formatChainId(g)),methods:o,events:l,optionalMethods:u,optionalEvents:f,rpcMap:p,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:y,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,n){const r={};return e.forEach(i=>{r[i]=this.getRpcUrl(i,n)}),r}async initialize(e){var n;if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?xv(this.rpc.chains):xv(this.rpc.optionalChains),this.signer=await Ktt.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storage:e.storage,storageOptions:e.storageOptions,customStoragePrefix:e.customStoragePrefix,telemetryEnabled:e.telemetryEnabled,logger:e.logger}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let r;try{const i=await Qtt(),{convertWCMToAppKitOptions:s}=await Promise.resolve().then(function(){return gnt}),a=s(Jy($h({},this.rpc.qrModalOptions),{chains:[...new Set([...this.rpc.chains,...this.rpc.optionalChains])],metadata:this.rpc.metadata,projectId:this.rpc.projectId}));if(!a.networks.length)throw new Error("No networks found for WalletConnect·");r=i(Jy($h({},a),{universalProvider:this.signer,manualWCControl:!0,enableMobileFullScreen:((n=this.rpc.qrModalOptions)==null?void 0:n.enableMobileFullScreen)===!0}))}catch(i){throw console.warn(i),new Error("To use QR modal, please install @reown/appkit package")}if(r)try{this.modal=r}catch(i){throw this.signer.logger.error(i),new Error("Could not generate WalletConnectMod
569al Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:n,optionalChains:r,rpcMap:i}=e;n&&To(n)&&(this.rpc.chains=n.map(s=>this.formatChainId(s)),n.forEach(s=>{this.rpc.rpcMap[s]=(i==null?void 0:i[s])||this.getRpcUrl(s)})),r&&To(r)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=r==null?void 0:r.map(s=>this.formatChainId(s)),r.forEach(s=>{this.rpc.rpcMap[s]=(i==null?void 0:i[s])||this.getRpcUrl(s)}))}getRpcUrl(e,n){var r;return((r=this.rpc.rpcMap)==null?void 0:r[e])||`${Xtt}?chainId=eip155:${e}&projectId=${n||this.rpc.projectId}`}async loadPersistedSession(){if(this.session)try{const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),n=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:n==null?void 0:n.accounts),this.setAccounts(n==null?void 0:n.accounts)}catch(e){this.signer.logger.error("Failed to load persisted session, clearing state..."),this.signer.logger.error(e),await this.disconnect().catch(n=>this.signer.logger.warn(n))}}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return typeof e=="string"||e instanceof String?[this.parseAccount(e)]:e.map(n=>this.parseAccount(n))}};const ont=ant;var lnt=Object.defineProperty,cnt=Object.defineProperties,unt=Object.getOwnPropertyDescriptors,zZ=Object.getOwnPropertySymbols,dnt=Object.prototype.hasOwnProperty,hnt=Object.prototype.propertyIsEnumerable,VZ=(t,e,n)=>e in t?lnt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ooe=(t,e)=>{for(var n in e||(e={}))dnt.call(e,n)&&VZ(t,n,e[n]);if(zZ)for(var n of zZ(e))hnt.call(e,n)&&VZ(t,n,e[n]);return t},fnt=(t,e)=>cnt(t,unt(e));function pnt(t){if(t)return{"--w3m-font-family":t["--wcm-font-family"],"--w3m-accent":t["--wcm-accent-color"],"--w3m-color-mix":t["--wcm-background-color"],"--w3m-z-index":t["--wcm-z-index"]?Number(t["--wcm-z-index"]):void 0,"--w3m-qr-color":t["--wcm-accent-color"],"--w3m-font-size-master":t["--wcm-text-medium-regular-size"],"--w3m-border-radius-master":t["--wcm-container-border-radius"],"--w3m-color-mix-strength":0}}const mnt=t=>{const[e,n]=t.split(":");return Poe({id:n,caipNetworkId:t,chainNamespace:e,name:"",nativeCurrency:{name:"",symbol:"",decimals:8},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}}})};function ynt(t){var e,n,r,i,s,a,o;const l=(e=t.chains)==null?void 0:e.map(mnt).filter(Boolean);if(l.length===0)throw new Error("At least one chain must be specified");const u=l.find(p=>{var y;return p.id===((y=t.defaultChain)==null?void 0:y.id)}),f={projectId:t.projectId,networks:l,themeMode:t.themeMode,themeVariables:pnt(t.themeVariables),chainImages:t.chainImages,connectorImages:t.walletImages,defaultNetwork:u,metadata:fnt(Ooe({},t.metadata),{name:((n=t.metadata)==null?void 0:n.name)||"WalletConnect",description:((r=t.metadata)==null?void 0:r.description)||"Connect to WalletConnect-compatible wallets",url:((i=t.metadata)==null?void 0:i.url)||"https://walletconnect.org",icons:((s=t.metadata)==null?void 0:s.icons)||["https://walletconnect.org/walletconnect-logo.png"]}),showWallets:!0,featuredWalletIds:t.explorerRecommendedWalletIds==="NONE"?[]:Array.isArray(t.explorerRecommendedWalletIds)?t.explorerRecommendedWalletIds:[],excludeWalletIds:t.explorerExcludedWalletIds==="ALL"?[]:Array.isArray(t.explorerExcludedWalletIds)?t.explorerExcludedWalletIds:[],enableEIP6963:!1,enableInjected:!1,enableCoinbase:!0,enableWalletConnect:!0,features:{email:!1,socials:!1}};if((a=t.mobileWallets)!=null&&a.length||(o=t.desktopWallets)!=null&&o.length){const p=[...(t.mobileWallets||[]).map(b=>({id:b.id,name:b.name,links:b.links})),...(t.desktopWallets||[]).map(b=>({id:b.id,name:b.name,links:{native:b.links.native,universal:b.links.universal}}))],y=[...f.featuredWalletIds||[],...f.excludeWalletIds||[]],g=p.filter(b=>!y.includes(b.id));g.length&&(f.customWallets=g)}return f}function Poe(t){return Ooe({formatters:void 0,fees:void 0,serializers:void 0},t)}var gnt=Object.freeze({__proto__:null,convertWCMToAppKitOptions:ynt,defineChain:Poe});function Roe(t){var e;return{name:((e=t.metadata)==null?void 0:e.shortName)||t.name||"",universalLink:t.mobile.universal,deepLink:t.mobile.native}}function bnt(t,e){let n=Roe(e);if(El.isMobile&&El.isAndroid&&n.universalLink)return Cv(n.universalLink,t);if(n.deepLink)return Moe(n.deepLink,t);if(n.universalLink)return Cv(n.universalLink,t);throw new ue(`Unsupported wallet ${e.id}`)}function HZ(t,e){let n=Roe(e);if(n.universalLink)return Cv(n.universalLink,t)}let uP="WALLETCONNECT_DEEPLINK_CHOICE";function wnt(){try{localStorage.removeItem(uP)}catch{}}function vnt({href:t,name:e}){try{localStorage.setItem(uP,JSON.stringify({href:t,name:e}))}catch{}}function _nt(){try{localStorage.removeItem(uP)}catch{}}function joe(t){return t.startsWith("http://")||t.startsWith("https://")}function Moe(t,e){if(joe(t))return Cv(t,e);let n=t;return n.includes("://")||(n=t.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),{redirect:`${n}wc?uri=${encodeURIComponent(e)}`,href:n}}function Cv(t,e){if(!joe(t))return Moe(t,e);let n=t;return n.endsWith("/")||(n=`${n}/`),{redirect:`${n}wc?uri=${encodeURIComponent(e)}`,href:n}}function Doe(t,e){window.open(t,e,"noreferrer noopener")}const Uoe="/api/v1/sessions",Boe="/api/v1/sessions/logout",xnt="/api/v1/siwe/init",Cnt="/api/v1/siwe/authenticate",Ent="/api/v1/siwe/link",Snt="/api/v1/siwe/link_smart_wallet",Ant="/api/v1/siwe/unlink",knt="/api/v1/siwe/transfer",Tnt="/api/v1/siws/init",Lnt="/api/v1/siws/authenticate",$nt="/api/v1/siws/link",Int="/api/v1/siws/unlink",Nnt="/api/v1/siws/transfer",Ont="/api/v1/farcaster/init",Pnt="/api/v1/farcaster/authenticate",Rnt="/api/v1/farcaster/link",jnt="/api/v1/farcaster/status",Mnt="/api/v1/farcaster/unlink",Dnt="/api/v1/farcaster/transfer",Unt="/api/v1/passwordless/init",Bnt="/api/v1/passwordless/authenticate",Fnt="/api/v1/passwordless/link",znt="/api/v1/passwordless/unlink",Vnt="/api/v1/passwordless/update",Hnt="/api/v1/passwordless/transfer",Wnt="/api/v1/passwordless_sms/init",qnt="/api/v1/passwordless_sms/link",Znt="/api/v1/passwordless_sms/unlink",Knt="/api/v1/passwordless_sms/authenticate",Gnt="/api/v1/passwordless_sms/update",Ynt="/api/v1/passwordless_sms/transfer",Foe="/api/v1/oauth/init",zoe
569="/api/v1/oauth/authenticate",Voe="/api/v1/oauth/link",Jnt="/api/v1/oauth/unlink",Xnt="/api/v1/oauth/transfer",Abt="/api/v1/recovery/oauth/init",kbt="/api/v1/recovery/oauth/init_icloud",Tbt="/api/v1/recovery/oauth/authenticate",Qnt="/api/v1/passkeys/link/init",ert="/api/v1/passkeys/authenticate/init",trt="/api/v1/passkeys/register/init",nrt="/api/v1/passkeys/link",rrt="/api/v1/passkeys/authenticate",irt="/api/v1/passkeys/register",srt="/api/v1/telegram/authenticate",art="/api/v1/telegram/link",ort="/api/v1/telegram/unlink",lrt="/api/v1/telegram/transfer",crt="/api/v1/mfa/passwordless_sms/init",urt="/api/v1/mfa/passkeys/init",drt="/api/v1/users/me/accept_terms",Hoe="/api/v1/analytics_events",hrt="/api/v1/custom_jwt_account/authenticate",frt="/api/v1/custom_jwt_account/link",prt="/api/v1/guest/authenticate",mrt="/api/v1/plugins/moonpay_on_ramp/sign",yrt="/api/v1/funding/coinbase_on_ramp/init",grt="/api/v1/funding/coinbase_on_ramp/status",brt="/api/v1/wallets/revoke",wrt="/api/v1/users/me",vrt="/api/v1/scan/transaction";let l$=Bo((()=>({})));const _rt=({children:t,configPlugins:e})=>(N.useEffect((()=>{if(e&&e.length!==0)return l$.setState(Object.fromEntries(e.map((n=>[n.id,n])))),()=>{l$.setState(Object.fromEntries(e.map((n=>[n.id,void 0]))))}}),[e]),h.jsx(h.Fragment,{children:t})),R0=t=>l$.getState()[t],xrt=()=>N.useCallback((t=>R0(t)),[]);function c$(t){return crypto.getRandomValues(new Uint8Array(t))}function dP(){return K8(c$(36))}function Woe(){return dP()}async function qoe(t,e="S256"){if(e!="S256")return t;{let n=await(async function(r){let i=new TextEncoder().encode(r);return new Uint8Array(await crypto.subtle.digest("SHA-256",i))})(t);return K8(n)}}function Crt(){let t=vt.get(dg);if(!t)throw new ue("Authentication error.");return t}function Ert(t){if(typeof t=="string"){if(!Yn(t,{strict:!1}))throw new vi({address:t});return{address:t,type:"json-rpc"}}if(!Yn(t.address,{strict:!1}))throw new vi({address:t.address});return{address:t.address,nonceManager:t.nonceManager,sign:t.sign,signAuthorization:t.signAuthorization,signMessage:t.signMessage,signTransaction:t.signTransaction,signTypedData:t.signTypedData,source:"custom",type:"local"}}let ZS=!1;async function E5({hash:t,privateKey:e,to:n="object"}){const{r,s:i,recovery:s}=lm.sign(t.slice(2),e.slice(2),{lowS:!0,extraEntropy:Ss(ZS,{strict:!1})?Os(ZS):ZS}),a={r:ze(r,{size:32}),s:ze(i,{size:32}),v:s?28n:27n,yParity:s};return n==="bytes"||n==="hex"?dte({...a,to:n}):a}async function Srt(t){const{chainId:e,nonce:n,privateKey:r,to:i="object"}=t,s=t.contractAddress??t.address,a=await E5({hash:vQ({address:s,chainId:e,nonce:n}),privateKey:r,to:i});return i==="object"?{address:s,chainId:e,nonce:n,...a}:a}async function Art({message:t,privateKey:e}){return await E5({hash:mN(t),privateKey:e,to:"hex"})}async function krt(t){const{privateKey:e,transaction:n,serializer:r=U3}=t,i=n.type==="eip4844"?{...n,sidecars:!1}:n,s=await E5({hash:Ni(await r(i)),privateKey:e});return await r(n,s)}async function Trt(t){const{privateKey:e,...n}=t;return await E5({hash:Aee(n),privateKey:e,to:"hex"})}function Lrt(t,e={}){const{nonceManager:n}=e,r=Dt(lm.getPublicKey(t.slice(2),!1)),i=gQ(r);return{...Ert({address:i,nonceManager:n,async sign({hash:a}){return E5({hash:a,privateKey:t,to:"hex"})},async signAuthorization(a){return Srt({...a,privateKey:t})},async signMessage({message:a}){return Art({message:a,privateKey:t})},async signTransaction(a,{serializer:o}={}){return krt({privateKey:t,transaction:a,serializer:o})},async signTypedData(a){return Trt({...a,privateKey:t})}}),publicKey:r,source:"privateKey"}}class s2{static parse(e){try{return new s2(e)}catch{return null}}static throwIfNotWellFormedJwt(e){return cV(e),e}get subject(){return this._decoded.sub}get expiration(){return this._decoded.exp}get issuer(){return this._decoded.iss}get audience(){return this._decoded.aud}isExpired(e=0){return Date.now()>=1e3*(this.expiration-e)}constructor(e){this.value=e,this._decoded=cV(e)}}class hP extends s2{static parse(e){try{return new hP(e)}catch{return null}}get appId(){return this._decoded.aid?this._decoded.aid:this.audience}}const Lbt=({style:t,...e})=>h.jsxs("svg",{viewBox:"0 0 1024 1024",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...t},...e,children:[h.jsx("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]}),$rt="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTAyNCAxMDI0JyBmaWxsPSdub25lJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHN0eWxlPSdoZWlnaHQ6MjhweDt3aWR0aDoyOHB4Jz48cmVjdCB3aWR0aD0nMTAyNCcgaGVpZ2h0PScxMDI0JyBmaWxsPScjMDA1MkZGJyByeD0nMTAwJyByeT0nMTAwJz48L3JlY3Q+PHBhdGggZmlsbC1ydWxlPSdldmVub2RkJyBjbGlwLXJ1bGU9J2V2ZW5vZGQnIGQ9J00xNTIgNTEyQzE1MiA3MTAuODIzIDMxMy4xNzcgODcyIDUxMiA4NzJDNzEwLjgyMyA4NzIgODcyIDcxMC44MjMgODcyIDUxMkM4NzIgMzEzLjE3NyA3MTAuODIzIDE1MiA1MTIgMTUyQzMxMy4xNzcgMTUyIDE1MiAzMTMuMTc3IDE1MiA1MTJaTTQyMCAzOTZDNDA2Ljc0NSAzOTYgMzk2IDQwNi43NDUgMzk2IDQyMFY2MDRDMzk2IDYxNy4yNTUgNDA2Ljc0NSA2MjggNDIwIDYyOEg2MDRDNjE3LjI1NSA2MjggNjI4IDYxNy4yNTUgNjI4IDYwNFY0MjBDNjI4IDQwNi43NDUgNjE3LjI1NSAzOTYgNjA0IDM5Nkg0MjBaJyBmaWxsPSd3aGl0ZSc+PC9wYXRoPjwvc3ZnPg==",Irt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAALZJREFUaEPtmjEOhDAMBNc/O14GvOzys3CAKK6eAlmaVGl2Zc+kTOU685vkc9/bnD2prZK5/TZY24z9P+g4F5hNh7/GdoG37WlAA5CATwgCxHENYISwQAMQII5rACOEBRqAAHFcAxghLNAABIjjGsAIYYEGIEAc1wBGCAs0AAHiuAYwQligAQgQxzWAEcICDUCAOK4BjBAWaAACxHENYISwQAMQII6fBjr+VHkW3+u+tfyxMpJaDgYzYxb/ALZVAAAAAElFTkSuQmCC";let d0,Xy;
569class Nrt extends fm{async initialize(){await this.importPromise,await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}disconnect(){this.proxyProvider.walletProvider.disconnect(),this.onDisconnect()}get walletBranding(){return{name:this.displayName,icon:Irt,id:"com.coinbase.wallet"}}async promptConnection(){Ue.debug("Prompting connection via Base Account",{wallet:this.walletClientType});try{await this.importPromise,Ue.rpcRequest("eth_requestAccounts",this.walletClientType);let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(Ue.rpcResponse("eth_requestAccounts",this.walletClientType),!e||e.length===0||!e[0])throw new Sr("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([e[0]])}catch(e){throw Ue.connectionFailed(this.walletClientType,e,{method:"base_account"}),H2(e)}}constructor(e,n,r,i,s){super("base_account",e,n,r),this.connectorType="base_account",this.walletClientType="base_account",this.displayName="Base",this.setBaseAccountSdk=s,this.proxyProvider=new Gf(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.baseAccountConfig={...i,appChainIds:[n.id].concat(e.map((a=>a.id)))},d0?(this.proxyProvider.setWalletProvider(d0.getProvider()),this.setBaseAccountSdk(d0)):this.importPromise=Le(()=>import("./index-Cuqwd3E8.js"),__vite__mapDeps([8,9])).then((({createBaseAccountSDK:a})=>{d0=a(this.baseAccountConfig),this.proxyProvider.setWalletProvider(d0.getProvider()),this.setBaseAccountSdk(d0)})).catch(console.error)}}let Ort=[1,11155111,137,10,8453,84532,42161,7777777,43114,56];class Prt extends fm{async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}disconnect(){this.proxyProvider.walletProvider.disconnect(),this.onDisconnect()}get walletBranding(){return{name:this.displayName,icon:$rt,id:"c
569om.coinbase.wallet"}}async promptConnection(){Ue.debug("Prompting connection via Coinbase Wallet",{wallet:this.walletClientType});try{Ue.rpcRequest("eth_requestAccounts",this.walletClientType);let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(Ue.rpcResponse("eth_requestAccounts",this.walletClientType),!e||e.length===0||!e[0])throw new Sr("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([e[0]])}catch(e){throw Ue.connectionFailed(this.walletClientType,e,{method:"coinbase_wallet"}),H2(e)}}updateConnectionPreference(e){this.coinbaseWalletConfig={...this.coinbaseWalletConfig,preference:{...this.coinbaseWalletConfig.preference,options:e}},this.walletClientType=e==="smartWalletOnly"?"coinbase_smart_wallet":"coinbase_wallet",Xy=yH({...this.coinbaseWalletConfig}),this.proxyProvider.setWalletProvider(Xy.getProvider())}constructor(e,n,r,i){var s,a;if(super("coinbase_wallet",e,n,r),this.connectorType="coinbase_wallet",this.displayName="Coinbase Wallet",this.proxyProvider=new Gf(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.coinbaseWalletConfig={...i,appChainIds:[n.id].concat(e.map((o=>o.id)))},this.walletClientType=((s=this.coinbaseWalletConfig.preference)==null?void 0:s.options)==="smartWalletOnly"?"coinbase_smart_wallet":"coinbase_wallet",this.walletClientType==="coinbase_smart_wallet"&&(this.displayName="Coinbase Smart Wallet"),!Xy){let o=((a=this.coinbaseWalletConfig.preference)==null?void 0:a.options)!=="eoaOnly"?(this.coinbaseWalletConfig.appChainIds??[]).filter((l=>!Ort.includes(l))):[];o.length>0&&!o.every((l=>EX.has(l)))&&console.info(`The configured chains are not supported by Coinbase Smart Wallet: ${o.join(", ")}`),Xy=yH(this.coinbaseWalletConfig)}this.proxyProvider.setWalletProvider(Xy.getProvider())}}const Rrt=({style:t,...e}={})=>h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...t},...e,children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})}),jrt=({style:t,...e}={})=>h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"108",height:"108",viewBox:"0 0 108 108",fill:"none",style:{height:"28px",width:"28px",...t},...e,children:[h.jsx("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M46.5267 69.9229C42.0054 76.8509 34.4292 85.6182 24.348 85.6182C19.5824 85.6182 15 83.6563 15 75.1342C15 53.4305 44.6326 19.8327 72.1268 19.8327C87.768 19.8327 94 30.6846 94 43.0079C94 58.8258 83.7355 76.9122 73.5321 76.9122C70.2939 76.9122 68.7053 75.1342 68.7053 72.314C68.7053 71.5783 68.8275 70.7812 69.0719 69.9229C65.5893 75.8699 58.8685 81.3878 52.5754 81.3878C47.993 81.3878 45.6713 78.5063 45.6713 74.4598C45.6713 72.9884 45.9768 71.4556 46.5267 69.9229ZM83.6761 42.5794C83.6761 46.1704 81.5575 47.9658 79.1875 47.9658C76.7816 47.9658 74.6989 46.1704 74.6989 42.5794C74.6989 38.9885 76.7816 37.1931 79.1875 37.1931C81.5575 37.1931 83.6761 38.9885 83.6761 42.5794ZM70.2103 42.5795C70.2103 46.1704 68.0916 47.9658 65.7216 47.9658C63.3157 47.9658 61.233 46.1704 61.233 42.5795C61.233 38.9885 63.3157 37.1931 65.7216 37.1931C68.0916 37.1931 70.2103 38.9885 70.2103 42.5795Z",fill:"#FFFDF8"})]});function KS(t,e){if(!Object.prototype.hasOwnProperty.call(t,e))throw TypeError("attempted to use private field on non-instance");return t}var Mrt=0;async function Zoe(t,e){var n;try{Ue.rpcRequest("eth_requestAccounts",e);let r=await t.request({method:"eth_requestAccounts"});return Ue.rpcResponse("eth_requestAccounts",e),r}catch(r){if(r.code===-32002&&((n=r.message)!=null&&n.includes("Already processing"))){Ue.debug("eth_requestAccounts already processing, retrying after delay",{wallet:e}),await new Promise((s=>setTimeout(s,500))),Ue.rpcRequest("eth_requestAccounts",e);let i=await t.request({method:"eth_requestAccounts"});return Ue.rpcResponse("eth_requestAccounts",e),i}throw r}}
569class Koe extends fm{async initialize(){Ue.debug("Initializing injected connector (EIP-6963)",{wallet:this.walletClientType}),await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){if(Ue.connectionStart(this.walletClientType,"injected",{showPrompt:e.showPrompt}),e.showPrompt&&await this.promptConnection(),!await this.isConnected())return Ue.debug("Not connected after prompt",{wallet:this.walletClientType}),null;let n=await this.getConnectedWallet();return n&&Ue.connectionSuccess(this.walletClientType),n}get walletBranding(){return{name:this.providerDetail.info.name,icon:this.providerDetail.info.icon,id:this.providerDetail.info.rdns}}disconnect(){console.warn(`Programmatic disconnect with ${this.providerDetail.info.name} is not yet supported.`)}async promptConnection(){Ue.debug("Prompting connection via eth_requestAccounts",{wallet:this.walletClientType});try{let e=await Zoe(this.proxyProvider,this.walletClientType);if(!e||e.length===0||!e[0])throw new Sr("Unable to retrieve accounts");await this.syncAccounts([e[0]])}catch(e){throw Ue.connectionFailed(this.walletClientType,e,{method:"injected"}),H2(e)}}constructor(e,n,r,i,s){super(s||"unknown",e,n,r),this.connectorType="injected",this.proxyProvider=new Gf(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.providerDetail=i;let a=i.provider;this.proxyProvider.setWalletProvider(a)}}var Eh="__private_"+Mrt+++"__walletBranding";class GS extends fm{async initialize(){Ue.debug("Initializing legacy injected connector",{wallet:this.walletClientType}),await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){if(Ue.connectionStart(this.walletClientType,"injected (legacy)",{showPrompt:e.showPrompt}),e.showPrompt&&await this.promptConnection(),!await this.isConnected())return Ue.debug("Not connected after prompt",{wallet:this.walletClientType}),null;let n=await this.getConnectedWallet();return n&&Ue.connectionSuccess(this.walletClientType),n}get walletBranding(){return KS(this,Eh)[Eh]??{name:"Browser Extension",icon:Rrt,id:"extension"}}disconnect(){Ue.debug("Disconnect requested (not supported for legacy injected)",{wallet:this.walletClientType})}async promptConnection(){Ue.debug("Prompting connection via eth_requestAccounts (legacy)",{wallet:this.walletClientType});try{let e=await Zoe(this.proxyProvider,this.walletClientType);if(!e||e.length===0||!e[0])throw new Sr("Unable to retrieve accounts");await this.syncAccounts([e[0]])}catch(e){throw Ue.connectionFailed(this.walletClientType,e,{method:"injected (legacy)"}),H2(e)}}constructor(e,n,r,i,s){super(s??"unknown",e,n,r),Object.defineProperty(this,Eh,{writable:!0,value:void 0}),this.connectorType="injected",this.proxyProvider=new Gf(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(i),s==="metamask"?KS(this,Eh)[Eh]={name:"MetaMask",icon:rPe,id:"io.metamask"}:s==="phantom"&&(KS(this,Eh)[Eh]={name:"Phantom",icon:jrt,id:"phantom"})}}class Drt extends Koe{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){Ue.debug("Prompting connection via MetaMask",{wallet:this.walletClientType});try{El.isMobile||(Ue.rpcRequest("wallet_requestPermissions",this.walletClientType),await this.proxyProvider.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}),Ue.rpcResponse("wallet_requestPermissions",this.walletClientType)),Ue.rpcRequest("eth_requestAccounts",this.walletClientType);let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(Ue.rpcResponse("eth_requestAccounts",this.walletClientType),!e||e.length===0||!e[0])throw new Sr("Unable to retrieve accounts");await this.syncAccounts([e[0]])}catch(e){throw Ue.connectionFailed(this.walletClientType,e,{method:"metamask"}),H2(e)}}}class u$ extends fm{async initialize(){var n,r,i,s,a,o,l,u,f;Ue.debug("Initializing WalletConnect V2 connector",{wallet:this.walletClientType});let e=await this.createProvider();if(this.provider=e,this.proxyProvider.setWalletProvider(e),this.subscribeListeners(),e.session){let p=(r=(n=this.walletProvider)==null?void 0:n.session)==null?void 0:r.peer.metadata;Ue.debug("Restoring existing WalletConnect session",{peerName:p==null?void 0:p.name,accountsCount:(s=(i=this.walletProvider)==null?void 0:i.accounts)==null?void 0:s.length}),(o=(a=this.walletProvider)==null?void 0:a.session)!=null&&o.peer.metadata.url&&(this.walletEntry=$E((u=(l=this.walletProvider)==null?void 0:l.session)==null?void 0:u.peer.metadata.url),this.walletClientType=((f=this.walletEntry)==null?void 0:f.slug)||"unknown"),this.connected=!0,await this.syncAccounts()}
569this.initialized=!0,this.emit("initialized")}async connect(e){Ue.connectionStart(this.walletClientType,"wallet_connect_v2",{showPrompt:e.showPrompt}),e.showPrompt&&await this.promptConnection();let n=await this.getConnectedWallet();return n&&Ue.connectionSuccess(this.walletClientType),n}async isConnected(){var e;return!!((e=this.walletProvider)!=null&&e.connected)}get walletBranding(){var n,r,i,s,a,o,l;let e=(i=(r=(n=this.walletProvider)==null?void 0:n.session)==null?void 0:r.peer.metadata.icons)==null?void 0:i[0];return{name:VOe(((a=(s=this.walletProvider)==null?void 0:s.session)==null?void 0:a.peer.metadata.name)||"")||"WalletConnect",icon:typeof e=="string"?e:JOe,id:((l=(o=this.walletProvider)==null?void 0:o.session)==null?void 0:l.peer.metadata.name.toLowerCase())||"wallet_connect_v2"}}async resetConnection(e){let n=this.walletClientType;Ue.debug("Resetting WalletConnect connection for new wallet",{previousWallet:n,newWallet:e}),this.walletProvider&&this.walletProvider.connected&&(await this.walletProvider.disconnect(),this.walletProvider.signer.session=void 0,this.walletClientType=e,this.redirectUri=void 0,this.fallbackUniversalRedirectUri=void 0,wnt(),this.onDisconnect())}async promptConnection(){if(this.provider)return Ue.debug("Prompting WalletConnect connection",{wallet:this.walletClientType}),new Promise(((e,n)=>{(async()=>{var s,a,o,l,u,f;Ue.debug("Enabling WalletConnect provider",{wallet:this.walletClientType,timeoutMs:this.proxyProvider.rpcTimeoutDuration});let r="",i=await Promise.race([(s=this.walletProvider)==null?void 0:s.enable(),this.proxyProvider.walletTimeout().then((()=>{}))]);if(i!=null&&i.length&&(r=i[0],Ue.debug("WalletConnect accounts received",{address:r,accountsCount:i.length})),!r||r==="")throw new Sr("Unable to retrieve address");(o=(a=this.walletProvider)==null?void 0:a.session)!=null&&o.peer.metadata.url&&(this.walletEntry=$E((u=(l=this.walletProvider)==null?void 0:l.session)==null?void 0:u.peer.metadata.url),this.walletClientType=((f=this.walletEntry)==null?void 0:f.slug)||"unknown",Ue.debug("Identified wallet from session",{wallet:this.walletClientType}),this.proxyProvider.rpcTimeoutDuration=hO(this.rpcConfig,this.walletClientType)),this.connected=!0,await this.syncAccounts(i),e()})().catch((r=>{Ue.connectionFailed(this.walletClientType,r,{method:"wallet_connect_v2"}),n(r?H2(r):new Sr("Unknown error during connection"))}))}));Ue.warn("WalletConnect provider not initialized")}disconnect(){var e;(e=this.walletProvider)==null||e.disconnect().then((()=>this.onDisconnect())).catch((()=>console.warn("Unable to disconnect WalletConnect provider")))}get walletProvider(){return this.proxyProvider.walletProvider}setWalletProvider(e){this.proxyProvider.setWalletProvider(e)}async createProvider(){Ue.debug("Creating WalletConnect EthereumProvider",{chainsCount:this.chains.length,defaultChainId:this.defaultChain.id});let e={};for(let s of this.chains){let a=WOe(s.id,this.chains,this.rpcConfig,this.privyAppId);a&&(e[s.id]=a)}let n=this.shouldEnforceDefaultChainOnConnect?[this.defaultChain.id]:[],r=this.chains.map((s=>s.id));Ue.debug("Initializing WalletConnect EthereumProvider",{requiredChains:n.join(", ")||"none",optionalChainsCount:r.length});let i=await ont.init({projectId:this.walletConnectCloudProjectId,chains:n,optionalChains:r,optionalEvents:Ioe,optionalMethods:$oe,rpcMap:e,showQrModal:!1,metadata:{description:this.privyAppName,name:this.privyAppName,url:window.location.origin,icons:[]}});return i.on("display_uri",(s=>{var a,o;if(Ue.debug("WalletConnect URI generated",{wallet:this.walletClientType,isMobile:El.isMobile,hasWalletEntry:!!this.walletEntry}),Ue.debug("Aborting WalletConnect pairing attempt"),i.signer.abortPairingAttempt(),_nt(),!this.showPrivyQrModal)throw new Sr("WalletConnect modal not available - Privy handles wallet connections through its own UI");if(El.isMobile&&this.walletEntry){let{redirect:l,href:u}=bnt(s,this.walletEntry),f=l.startsWith("http");Ue.debug("Opening mobile wallet via deep link",{wallet:this.walletEntry.name,redirectType:f?"universal":"native"}),Doe(l,"_self"),vnt({href:u,name:((a=this.walletEntry.metadata)==null?void 0:a.shortName)||this.walletEntry.name});let p=HZ(s,this.walletEntry);return this.redirectUri=l,this.fallbackUniversalRedirectUri=p==null?void 0:p.redirect,this.showPrivyQrModal({native:l,universal:l})}if(Ue.debug("Displaying WalletConnect QR code",{wallet:((o=this.walletEntry)==null?void 0:o.name)||"generic"}),this.redirectUri=void 0,this.walletEntry){let l=HZ(s,this.walletEntry);this.fallbackUniversalRedirectUri=l==null?void 0:l.redirect}this.showPrivyQrModal({native:s,universal:void 0})})),i.on("connect",(()=>{var a,o,l,u,f;let s=(a=i.session)==null?void 0:a.peer.metadata;Ue.debug("WalletConnect session established",{peerName:s==null?void 0:s.name,peerIcon:(o=s==null?void 0:s.icons)!=null&&o[0]?"present":"none"}),(l=i.session)!=null&&l.peer.metadata.url&&(this.walletEntry=$E((u=i.session)==null?void 0:u.peer.metadata.url),this.walletClientType=((f=this.walletEntry)==null?void 0:f.slug)||"unknown")})),i}async enableProvider(){var e,n;return(e=this.walletProvider)!=null&&e.connected?Promise.resolve(this.walletProvider.accounts):await((n=this.walletProvider)==null?void 0:n.enable())}setWalletEntry(e,n){this.walletEntry=e,this.showPrivyQrModal=n}constructor({walletConnectCloudProjectId:e,rpcConfig:n,chains:r,defaultChain:i,shouldEnforceDefaultChainOnConnect:s,privyAppId:a,privyAppName:o,walletClientType:l}){super(l||"unknown",r,i,n),this.connectorType="wallet_connect_v2",this.privyAppId=a,this.privyAppName=o,this.walletConnectCloudProjectId=e,this.rpcConfig=n,this.shouldEnforceDefaultChainOnConnect=s,this.proxyProvider=new Gf(void 0,this.rpcTimeoutDuration),l&&(this.walletEntry=tPe(l),this.walletClientType=l)}}class Urt extends qf{get wallets(){let e=new Set;return this.walletConnectors.flatMap((n=>n.wallets)).sort(((n,r)=>n.connectedAt&&r.connectedAt?r.connectedAt-n.connectedAt:0)).filter((n=>{let r=`${n.address}${n.walletClientType}${n.connectorType}${n.meta.id}`;return!e.has(r)&&(e.add(r),!0)}))}async initialize(e){var l,u,f;if(Ue.info("Starting connector initialization",{reInit:e??!1}),this.initialized&&!e)return;if(e&&this.removeAllConnectors(),this.externalWalletConfig.disableAllExternalWallets)return void Ue.info("All external wallets disabled, skipping initialization");let n=HOe({store:this.store,walletList:this.walletList,externalWalletConfig:this.externalWalletConfig,walletChainType:this.walletChainType}).then((p=>{Ue.info("Detected injected providers",{count:p.length,wallets:p.map((y=>y.type)).join(", ")}),p.forEach((({type:y,eip6963InjectedProvider:g,legacyInjectedProvider:b})=>{this.createEthereumWalletConnector({connectorType:"injected",walletClientType:y,providers:{eip6963InjectedProvider:g,legacyInjectedProvider:b}})}))}));for(let p of(this.walletList.includes("coinbase_wallet")&&this.createEthereumWalletConnector({connectorType:"coinbase_wallet",walletClientType:"coinbase_wallet"}),this.walletList.includes("base_account")&&this.createEthereumWalletConnector({connectorType:"base_account",walletClientType:"base_account"}),Object.values(Sre)))!p.isInstalled&&this.walletList.includes(p.client)&&(["ethereum-only","ethereum-and-solana"].includes(this.walletChainType)&&p.chainTypes.includes("ethereum")&&this.createEthereumWalletConnector({connectorType:"null",walletClientType:p.client,walletConfig:p}),["ethereum-and-solana","solana-only"].includes(this.walletChainType)&&p.chainTypes.includes("solana")&&this.addSolanaWalletConnector(new sPe({id:p.client,name:p.name})));let r=this.walletList.includes("wallet_connect_qr_solana")||XT(this.walletList)&&this.walletChainType!=="ethereum-only",i=this.externalWalletConfig.walletConnect.enabled&&(this.walletList.includes("wallet_connect_qr")||
569XT(this.walletList))&&this.walletChainType!=="solana-only",s=((l=this.externalWalletConfig.solana.connectors)==null?void 0:l.get())||[],a=async p=>{await p.initializeProvider({walletConnectCloudProjectId:this.walletConnectCloudProjectId,privyAppName:this.privyAppName});let y=await p.hideSolanaSessionsFromSignClient();try{this.ethereumWalletConnectInitPromise||(this.ethereumWalletConnectInitPromise=this.initEthereumWalletConnect()),await this.ethereumWalletConnectInitPromise}finally{await p.unhideSolanaSessionsInSignClient(y)}await p.restoreSession()},o=async p=>{let y=p.find((b=>{var v;return((v=b.walletBranding)==null?void 0:v.id)==="walletconnect_solana"})),g=(y==null?void 0:y.wallet)??null;!i||r&&g?r&&!i&&g?await g.initialize({walletConnectCloudProjectId:this.walletConnectCloudProjectId,privyAppName:this.privyAppName}):r&&i&&g&&await a(g):this.ethereumWalletConnectInitPromise||(this.ethereumWalletConnectInitPromise=this.initEthereumWalletConnect())};o(s),s.filter((p=>{var y;return r||((y=p.walletBranding)==null?void 0:y.id)!=="walletconnect_solana"})).forEach(this.addSolanaWalletConnector),(f=(u=this.externalWalletConfig.solana.connectors)==null?void 0:u._setOnConnectorsUpdated)==null||f.call(u,(p=>{o(p),p==null||p.filter((y=>{var g;return r||((g=y.walletBranding)==null?void 0:g.id)!=="walletconnect_solana"})).forEach(this.addSolanaWalletConnector)})),await n,this.initialized=!0}findWalletConnector(e,n,r){return e==="wallet_connect_v2"?this.walletConnectors.filter(IE).find((i=>i.connectorType===e&&(!r||i.wallets.some((s=>s.address===r)))))??null:this.walletConnectors.filter(IE).find((i=>i.connectorType===e&&i.walletClientType===n&&(!r||i.wallets.some((s=>s.address===r)))))??null}findSolanaWalletConnector(e){return this.walletConnectors.filter(aPe).find((n=>n.walletClientType==="unknown"?n.walletBranding.id===e:n.walletClientType===e))??null}onInitialized(e){Ue.connectorInit(e.connectorType,e.walletClientType,{walletsCount:e.wallets.length}),e.wallets.forEach((n=>{let r=this.storedConnections.find((i=>i.address===n.address&&i.connectorType===n.connectorType&&(n.type==="solana"&&i.walletClientType==="unknown"&&n.walletClientType==="unknown"?n.meta.id===i.id:i.walletClientType===n.walletClientType)));r&&(n.connectedAt=r.connectedAt)})),this.emit("walletsUpdated"),this.emit("connectorInitialized")}onWalletsUpdated(e){e.initialized&&this.emit("walletsUpdated")}initEthereumWalletConnect(){return this.createEthereumWalletConnector({connectorType:"wallet_connect_v2",walletClientType:"unknown"}).then((e=>{if(e)return new Promise((n=>{if(e.initialized)return void n();let r=setTimeout((()=>n()),5e3);e.once("initialized",(()=>{clearTimeout(r),n()}))}))}))}async createEthereumWalletConnector({connectorType:e,walletClientType:n,providers:r,walletConfig:i}){Ue.debug("Creating Ethereum wallet connector",{connector:e,wallet:n});let s=this.findWalletConnector(e,n);if(s&&IE(s))return Ue.debug("Found existing connector, reusing",{connector:e,wallet:n}),s instanceof u$&&s.resetConnection(n),s;let a=e!=="injected"?e==="coinbase_wallet"?new Prt(this.chains,this.defaultChain,this.rpcConfig,this.externalWalletConfig.coinbaseWallet.config):e==="base_account"?new Nrt(this.chains,this.defaultChain,this.rpcConfig,this.externalWalletConfig.baseAccount.config,this.setBaseAccountSdk):e!=="null"?new u$({walletConnectCloudProjectId:this.walletConnectCloudProjectId,rpcConfig:this.rpcConfig,chains:this.chains,defaultChain:this.defaultChain,shouldEnforceDefaultChainOnConnect:this.shouldEnforceDefaultChainOnConnect,privyAppId:this.privyAppId,privyAppName:this.privyAppName,walletClientType:n}):i?new nPe({id:i.client,name:i.name,defaultChain:this.defaultChain,walletClientType:i.client}):null:n==="metamask"&&(r!=null&&r.eip6963InjectedProvider)?new Drt(this.chains,this.defaultChain,this.rpcConfig,r==null?void 0:r.eip6963InjectedProvider,"metamask"):n==="metamask"&&(r!=null&&r.legacyInjectedProvider)?new GS(this.chains,this.defaultChain,this.rpcConfig,r==null?void 0:r.legacyInjectedProvider,"metamask"):n==="phantom"&&(r!=null&&r.legacyInjectedProvider)?new GS(this.chains,this.defaultChain,this.rpcConfig,r==null?void 0:r.legacyInjectedProvider,"phantom"):r!=null&&r.legacyInjectedProvider&&n==="unknown_browser_extension"?new GS(this.chains,this.defaultChain,this.rpcConfig,r==null?void 0:r.legacyInjectedProvider):r
569!=null&&r.eip6963InjectedProvider?new Koe(this.chains,this.defaultChain,this.rpcConfig,r==null?void 0:r.eip6963InjectedProvider,n):void 0;return a?(Ue.connectorCreated(e,n),this.addWalletConnector(a)):Ue.debug("No connector created",{connector:e,wallet:n}),a||null}addWalletConnector(e){Ue.debug("Adding wallet connector",{connector:e.connectorType,wallet:e.walletClientType}),this.walletConnectors.push(e),e.on("initialized",(()=>this.onInitialized(e))),e.on("walletsUpdated",(()=>this.onWalletsUpdated(e))),e.initialize().catch((n=>{Ue.error("Failed to initialize connector",n,{connector:e.connectorType,wallet:e.walletClientType})}))}setWalletList(e){this.walletList=e,this.initialized&&this.initialize(!0).catch(console.error)}removeAllConnectors(){for(let e of this.walletConnectors)e.removeAllListeners();this.walletConnectors=[]}constructor(e,n,r,i,s,a,o,l,u,f,p,y,g){super(),this.ethereumWalletConnectInitPromise=null,this.addSolanaWalletConnector=async b=>{let v=this.findSolanaWalletConnector(b.walletClientType);if(!v||v.connectorType==="null"){if((v==null?void 0:v.connectorType)==="null"){let _=this.walletConnectors.indexOf(v);this.walletConnectors.splice(_,1)}this.addWalletConnector(b)}},Ue.setEnabled(g??!1),Ue.info("ConnectorManager initializing",{walletChainType:y||void 0,walletListCount:o.length}),this.privyAppId=e,this.walletConnectCloudProjectId=n,this.rpcConfig=r,this.chains=i,this.defaultChain=s,this.walletConnectors=[],this.initialized=!1,this.store=a,this.walletList=o,this.shouldEnforceDefaultChainOnConnect=l,this.externalWalletConfig=u,this.privyAppName=f,this.walletChainType=y||"ethereum-only",this.setBaseAccountSdk=p,this.storedConnections=dO()}}const WZ=Bo((()=>({identityToken:null})));let Brt=[Uoe,Boe,Hoe];class Frt{async get(e,n){try{return await this.baseFetch(e,n)}catch(r){throw vn(r)}}async post(e,n,r){try{return await this.baseFetch(e,{method:"POST",...n?{body:n}:{},...r})}catch(i){throw vn(i)}}async delete(e,n){try{return await this.baseFetch(e,{method:"DELETE",...n})}catch(r){throw vn(r)}}constructor({appId:e,appClientId:n,client:r,defaults:i}){this.appId=e,this.appClientId=n,this.clientAnalyticsId=r.clientAnalyticsId,this.sdkVersion=ONe,this.client=r,this.defaults=i,this.fallbackApiUrl=r.fallbackApiUrl,this.baseFetch=BOe.create({baseURL:this.defaults.baseURL,timeout:this.defaults.timeout,retry:3,retryDelay:500,retryStatusCodes:[408,409,425,500,502,503,504],credentials:"include",onRequest:async({request:s,options:a})=>{let o=new Headers(a.headers);o.set("privy-app-id",this.appId),this.appClientId&&o.set("privy-client-id",this.appClientId),o.set("privy-ca-id",this.clientAnalyticsId||""),o.set("privy-client",`react-auth:${this.sdkVersion}`);let l=Brt.includes(s.toString());if(!o.has("authorization")){let u=await this.client.getAccessToken({disableAutoRefresh:l});u!==null&&o.set("authorization",`Bearer ${u}`)}a.headers=o,a.retryDelay&&typeof a.retryDelay=="number"&&(a.retryDelay=3*a.retryDelay)},onRequestError:({error:s})=>{if(s instanceof DOMException&&s.name==="AbortError")throw new FOe}})}}const zrt=t=>{var e,n,r,i;return{rpId:t.rp_id,challenge:t.challenge,allowCredentials:((e=t.allow_credentials)==null?void 0:e.map((s=>({id:s.id,type:s.type,transports:s.transports}))))||[],timeout:t.timeout,extensions:{appid:(n=t.extensions)==null?void 0:n.app_id,credProps:(r=t.extensions)==null?void 0:r.cred_props,hmacCreateSecret:(i=t.extensions)==null?void 0:i.hmac_create_secret},userVerification:t.user_verification}},Vrt=Symbol("cross-tab-user-sync-plugin");class Goe{async authenticate(){if(!this.api)throw new ue("Auth flow has no API instance");try{return await this.api.post(hrt,{token:this.meta.token})}catch(e){throw vn(e)}}async link(){if(!this.api)throw new ue("Auth flow has no API instance");try{return await this.api.post(frt,{token:this.meta.token})}catch(e){throw vn(e)}}constructor(e){this.meta={token:e}}}function x6(t){return t?{"privy-ui":"t"}:void 0}let j0=class{async authenticate(){if(!this.api)throw new ue("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new ue("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(Bnt,{email:this.meta.email,code:this.meta.emailCode,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw vn(e)}}async link(){if(!this.api)throw new ue("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new ue("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(Fnt,{email:this.meta.email,code:this.meta.emailCode})}catch(e){throw vn(e)}}async sendCodeEmail({email:e,captchaToken:n,withPrivyUi:r}){if(!this.api)throw new ue("Auth flow has no API instance");if(e&&(this.meta.email=e),n&&(this.meta.captchaToken=n),!this.meta.email)throw new ue("Email must be set when initialzing authentication.");let i=x6(r);try{return await this.api.post(Unt,{email:this.meta.email,token:this.meta.captchaToken},{headers:{...i}})}catch(s){throw vn(s)}}constructor({email:e,captchaToken:n,disableSignup:r}){this.meta={email:e,captchaToken:n,disableSignup:r??!1}}},Hrt=class extends j0{async link(){if(!this.api)throw new ue("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new ue("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post(Vnt,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(e){throw vn(e)}}constructor(e,n,r){super({email:n,captchaToken:r}),this.meta={email:n,captchaToken:r,oldAddress:e,disableSignup:!1}}},Wrt=class{getOrCreateGuestCredential(e){let n=lre(e);
569if(JT()){if(vt.get(n))return vt.get(n);{let r=K8(c$(32));return vt.put(n,r),r}}return K8(c$(32))}async authenticate(){if(!this.api)throw new ue("Auth flow has no API instance");try{return await this.api.post(prt,{guest_credential:this.meta.guestCredential})}catch(e){throw vn(e)}}async link(){throw Error("Linking is not supported for the guest flow")}constructor(e){this.meta={guestCredential:this.getOrCreateGuestCredential(e)}}};function fP(){return typeof window<"u"&&window.location.protocol==="chrome-extension:"&&"chrome"in window}function Yoe(){var e;if(!fP())return;let t=window.chrome;return(e=t==null?void 0:t.runtime)==null?void 0:e.id}function d$(){var e;if(!fP())return!1;let t=window.chrome;return typeof((e=t==null?void 0:t.identity)==null?void 0:e.launchWebAuthFlow)=="function"}async function qZ(t){return new Promise(((e,n)=>{d$()?window.chrome.identity.launchWebAuthFlow({url:t,interactive:!0},(async r=>{try{let i=(function(){var f,p;if(!fP())return;let u=window.chrome;return(p=(f=u==null?void 0:u.runtime)==null?void 0:f.lastError)==null?void 0:p.message})();if(i||!r){let u=`WebAuthFlow failed: ${i||"Response URI missing"}`;throw Error(u)}let s=new URL(r),a=Yoe();if(!a)throw Error("Invalid extension context");if(s.protocol==="chrome-extension:"){if(s.hostname!==a)throw Error("Invalid responseUri origin")}else{if(s.protocol!=="https:")throw Error("Invalid responseUri protocol");{let u=s.hostname.split(".");if(u.length!==3||u[1]!=="chromiumapp"||u[2]!=="org"||u[0]!==a)throw Error("Invalid responseUri origin")}}let o=s.searchParams.get("privy_oauth_state"),l=s.searchParams.get("privy_oauth_code");if(!o||!l)throw Error("Invalid responseUri - missing required parameters");e({privyOAuthState:o,privyOAuthCode:l})}catch(i){n(i)}})):n(Error("Chrome identity API not available"))}))}let E0=class{addCaptchaToken(e){this.meta.captchaToken=e}isActive(){return!!(this.meta.authorizationCode&&this.meta.stateCode&&this.meta.provider)}async authenticate(){if(!this.api)throw new ue("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new ue("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new ue("User denied confirmation during OAuth flow");let e=Crt();try{let n=await this.api.post(zoe,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:e,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});return vt.del(dg),vt.del(X8),vt.del(Og),n}catch(n){let r=vn(n);throw r.privyErrorCode?new ue(r.message||"Invalid code during OAuth flow.",void 0,r.privyErrorCode):r.message==="User denied confirmation during OAuth flow"?new ue("Invalid code during oauth flow.",void 0,Oe.OAUTH_USER_DENIED):new ue("Invalid code during OAuth flow.",void 0,Oe.UNKNOWN_AUTH_ERROR)}}async link(){if(!this.api)throw new ue("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new ue("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new ue("User denied confirmation during OAuth flow");let e=vt.get(dg);if(!e)throw new ue("Authentication error.");try{let n=await this.api.post(Voe,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:e});return vt.del(dg),n}catch(n){throw vn(n)}}async getAuthorizationUrl(){if(!this.api)throw new ue("Auth flow has no API instance");if(!this.meta.provider)throw new ue("Provider must be set when initializing OAuth authentication.");let e=dP();vt.put(dg,e);let n=Woe();vt.put(J8,n);let r=await qoe(e);this.meta.withPrivyUi||vt.put(X8,!0),this.meta.disableSignup?vt.put(Og,!0):vt.del(Og);let i=x6(this.meta.withPrivyUi),s=window.location.href,a=(function(){let o=Yoe();if(o)return`https://${o}.chromiumapp.org`})();a&&(s=a);try{return await this.api.post(Foe,{provider:this.meta.provider,redirect_to:this.meta.customOAuthRedirectUrl||s,token:this.meta.captchaToken,code_challenge:r,state_code:n},{headers:{...i}})}catch(o){throw vn(o)}}constructor(e){this.meta=e}},fl=class{execute(e){return this.promise===null&&(this.promise=(async()=>{try{return await this.fn(e)}finally{this.promise=null}})()),this.promise}constructor(e){this.promise=null,this.fn=e}};const h$=({address:t,chainId:e,nonce:n})=>`${window.location.host} wants you to sign in with your Ethereum account: 570${t} 571 572By signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees. 573 574URI: ${window.location.origin} 575Version: 1 576Chain ID: ${e} 577Nonce: ${n} 578Issued At: ${new Date().toISOString()} 579Resources: 580- https://privy.io`;let qw=class{get meta(){var e,n,r,i;return{connectorType:(e=this.wallet)==null?void 0:e.connectorType,walletClientType:(n=this.wallet)==null?void 0:n.walletClientType,chainId:(r=this.wallet)==null?void 0:r.chainId,address:(i=this.wallet)==null?void 0:i.address,disableSignup:this._meta.disableSignup}}async authenticate(){var e,n,r;if(!this.client)throw new ue("SiweFlow has no client instance");try{if(this.preparedMessage&&this.signature)return await this.client.authenticateWithSiweInternal({message:this.preparedMessage,signature:this.signature,chainId:(e=this.wallet)==null?void 0:e.chainId,walletClientType:this.walletClientType??((n=this.wallet)==null?void 0:n.walletClientType),connectorType:this.connectorType??((r=this.wallet)==null?void 0:r.connectorType),mode:this._meta.disableSignup?"no-signup":"login-or-sign-up"});if(!this.wallet)throw new ue("SiweFlow has no wallet instance");let{message:i,signature:s}=await this.sign();return await this.client.authenticateWithSiweInternal({message:i,signature:s,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(i){throw vn(i)}}async link(){if(!this.client)throw new ue("SiweFlow has no client instance");try{if(!this.wallet)throw new ue("SiweFlow has no wallet instance");let{message:e,signature:n}=await this.sign();return await this.client.linkWithSiweInternal({message:e,signature:n,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(e){throw vn(e)}}async sign(){if(!this.client)throw new ue("SiweFlow has no client instance");if(await this.buildMessage(),!this.preparedMessage)throw new ue("Could not prepare SIWE message");if(!this.wallet)throw new ue("SiweFlow has no wallet instance");let e=await this.wallet.sign(this.preparedMessage);return{message:this.preparedMessage,signature:e}}async _getNonceOnce(){if(!this.client)throw new ue("SiweFlow has no client instance");if(!this.wallet)throw new ue("UI SiweFlow has no wallet instance");return await this.client.generateSiweNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildMessage(){if(!this.client)throw new ue("SiweFlow has no client instance");if(!this.wallet)throw new ue("SiweFlow has no wallet instance");let e=this.wallet.address,n=this.wallet.chainId.replace("eip155:","");return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=h$({address:e,chainId:n,nonce:this.nonce}),this.preparedMessage}constructor(e,n,r,i=!1,s){this._meta={disableSignup:!1}
580,this.getNonceOnce=new fl(this._getNonceOnce.bind(this)),this.wallet=n,this.captchaToken=r,this.client=e,this._meta.disableSignup=i,this.preparedMessage=s==null?void 0:s.message,this.signature=s==null?void 0:s.signature,this.walletClientType=s==null?void 0:s.walletClientType,this.connectorType=s==null?void 0:s.connectorType}},M0=class{async authenticate(){if(!this.api)throw new ue("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new ue("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(Knt,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw vn(e)}}async link(){if(!this.api)throw new ue("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new ue("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(qnt,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(e){throw vn(e)}}async sendSmsCode({phoneNumber:e,captchaToken:n,withPrivyUi:r}){if(!this.api)throw new ue("Auth flow has no API instance");if(e&&(this.meta.phoneNumber=e),n&&(this.meta.captchaToken=n),!this.meta.phoneNumber)throw new ue("phone nNumber must be set when initialzing authentication.");let i=x6(r);try{return await this.api.post(Wnt,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken},{headers:{...i}})}catch(s){throw vn(s)}}constructor({phoneNumber:e,captchaToken:n,disableSignup:r}){this.meta={phoneNumber:e,captchaToken:n,disableSignup:r??!1}}},qrt=class extends M0{async link(){if(!this.api)throw new ue("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode||!this.meta.oldPhoneNumber)throw new ue("Phone number, sms code, and an old phone number must be set prior to calling update.");try{return await this.api.post(Gnt,{old_phone_number:this.meta.oldPhoneNumber,new_phone_number:this.meta.phoneNumber,code:this.meta.smsCode})}catch(e){throw vn(e)}}constructor(e,n,r){super({phoneNumber:n,captchaToken:r}),this.meta={phoneNumber:n,captchaToken:r,oldPhoneNumber:e,disableSignup:!1}}};var YS,ZZ=((YS={}).PRIVY="privy_access_token",YS.CUSTOMER="customer_access_token",YS);let Zrt=class{get token(){return this.privyAccessToken||this.customerAccessToken}getToken(e){return e==="privy_access_token"?this.privyAccessToken:this.customerAccessToken}get customerAccessToken(){return this._getToken(ug)}get privyAccessToken(){return this._getToken(Ow)}_getToken(e){try{let n=vt.get(e);return typeof n=="string"?s2.throwIfNotWellFormedJwt(n):null}catch(n){return console.error(n),this.destroyLocalState(),null}}get refreshToken(){try{let e=vt.get(EE);return typeof e=="string"?e:null}catch(e){return console.error(e),this.destroyLocalState(),null}}getProviderAccessToken(e){try{let n=vt.get(I4(e));if(typeof n!="string")return null;{let r=new s2(n);return r.isExpired()?(vt.del(I4(e)),null):r.value}}catch(n){return console.error(n),null}}get mightHaveServerCookies(){try{let e=Qr.get(SE);return e!==void 0&&e.length>0}catch(e){console.error(e)}return!1}hasRefreshCredentials(e="privy_access_token"){let n=typeof this.getToken(e)=="string",r=typeof this.refreshToken=="string"&&this.refreshToken!==jNe;return this.mightHaveServerCookies||n&&r}hasActiveAccessToken(e){let n=s2.parse(this.getToken(e));return n!==null&&!n.isExpired(30)}authenticate(e){return this.authenticateOnce.execute(e)}link(e){return this.linkOnce.execute(e)}refresh(){return this.refreshOnce.execute()}destroy(){return this.destroyOnce.execute()}storeProviderAccessToken(e,n){typeof n=="string"?vt.put(I4(e),n):vt.del(I4(e))}updateIdentityToken(e){typeof e=="string"?this.storeIdentityToken(e):this.clearIdentityToken()}async _authenticate(e){try{let n=await e.authenticate(),{user:r,is_new_user:i,oauth_tokens:s}=n;this.handleTokenResponse(n);let a=s?{provider:s.provider,accessToken:s.access_token,accessTokenExpiresInSeconds:s.access_token_expires_in_seconds,refreshToken:s.refresh_token,refreshTokenExpiresInSeconds:s.refresh_token_expires_in_seconds,scopes:s.scopes}:void 0;return this._trackAuthenticateEvents(e,i),{user:os(r),isNewUser:i,oAuthTokens:a}}catch(n){throw console.warn("Error authenticating session"),Nr(n)}}_trackAuthenticateEvents(e,n){let r=(function(i){return i instanceof j0?"email":i instanceof M0?"sms":i instanceof qw?"siwe":i instanceof Wrt?"guest":i instanceof Goe?"custom_auth":i instanceof E0?i.meta.provider:null})(e);r&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate",payload:{method:r,isNewUser:n}}),r==="siwe"&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate_siwe",payload:{connectorType:e.meta.connectorType,walletClientType:e.meta.walletClientType}})}async _link(e){try{let n=await e.link(),r=n.oauth_tokens,i=r?{provider:r.provider,accessToken:r.access_token,accessTokenExpiresInSeconds:r.access_token_expires_in_seconds,refreshToken:r.refresh_token,refreshTokenExpiresInSeconds:r.refresh_token_expires_in_seconds,scopes:r.scopes}:void 0;return{user:os(n),oAuthTokens:i}}catch(n){throw console.warn("Error linking account"),Nr(n)}}async _refresh(){if(!this.api)throw new ue("Session has no API instance");if(!this.client)throw new ue("Session has no PrivyClient instance");await this.client.getAccessToken({disableAutoRefresh:!0});let e=this.token,n=this.refreshToken;if(this.client.useServerCookies&&!this.mightHaveServerCookies&&this.token&&window.location.origin===this.client.apiUrl)return this.destroyLocalState(),null;try{let r;if(!(e&&n||this.mightHaveServerCookies))return null;{let i={};e&&(i.authorization=`Bearer ${e}`),r=await this.api.post(Uoe,n?{refresh_token:n}:{},{headers:i})}return this.handleTokenResponse(r),os(r.user)}catch(r){if(r instanceof ev&&r.privyErrorCode===Oe.MISSING_OR_INVALID_TOKEN)return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw Nr(r)}}handleTokenResponse(e){e.session_update_action&&e.session_update_action!=="set"?e.session_update_action==="clear"?this.destroyLocalState():e.session_update_action==="ignore"&&(e.token&&(this.storeCustomerAccessToken(e.token),this.storePrivyAccessToken(e.privy_access_token)),e.identity_token&&this.storeIdentityToken(e.identity_token)):this._storeAllTokens(e)}_storeAllTokens(e){this.storeRefreshToken(e.refresh_token),this.storeCustomerAccessToken(e.token),this.storePrivyAccessToken(e.privy_access_token),e.identity_token&&this.storeIdentityToken(e.identity_token)}async _destroy(){var e;try{await((e=this.api)==null?void 0:e.post(Boe,{refresh_token:this.refreshToken}
580))}catch{console.warn("Error destroying session")}this.destroyLocalState()}destroyLocalState(){this.storeRefreshToken(null),this.storeCustomerAccessToken(null),this.storePrivyAccessToken(null),this.clearIdentityToken()}storeCustomerAccessToken(e){var n,r,i,s,a;if(typeof e=="string"){let o=vt.get(ug);vt.put(ug,e);let l=(n=s2.parse(e))==null?void 0:n.expiration;this.writeCookie(bV,e,{expires:l?new Date(1e3*l):void 0}),o!==e&&((i=(r=this.client)==null?void 0:r.onStoreCustomerAccessToken)==null||i.call(r,e))}else vt.del(ug),Qr.remove(bV),(a=(s=this.client)==null?void 0:s.onDeleteCustomerAccessToken)==null||a.call(s)}storeRefreshToken(e){typeof e=="string"?(vt.put(EE,e),this.writeCookie(SE,"t",{expires:30})):(vt.del(EE),Qr.remove(PNe),Qr.remove(SE))}storePrivyAccessToken(e){typeof e=="string"?vt.put(Ow,e):vt.del(Ow)}storeIdentityToken(e){var r,i;if(WZ.setState({identityToken:e}),(r=this.client)==null?void 0:r.useServerCookies)return;vt.put(wV,e);let n=(i=s2.parse(e))==null?void 0:i.expiration;this.writeCookie(vV,e,{expires:n?new Date(1e3*n):void 0})}writeCookie(e,n,r){var i,s;Bne({useServerCookies:(i=this.client)==null?void 0:i.useServerCookies,cookieWriteBehavior:(s=this.client)==null?void 0:s.cookieWriteBehavior})&&Qr.set(e,n,{sameSite:"Strict",secure:!(El.isSafari&&window.location.origin.startsWith("http://localhost")),...r})}clearIdentityToken(){vt.del(wV),WZ.setState({identityToken:null}),Qr.remove(vV)}constructor(){this.authenticateOnce=new fl((async e=>this._authenticate(e))),this.linkOnce=new fl((async e=>this._link(e))),this.refreshOnce=new fl(this._refresh.bind(this)),this.destroyOnce=new fl(this._destroy.bind(this))}},JS,Ev;var Krt=0,XS="__private_"+Krt+++"__getOrGenerateClientAnalyticsId";let Grt=class{getAppId(){return this.appId}initializeConnectorManager({walletConnectCloudProjectId:e,rpcConfig:n,chains:r,defaultChain:i,store:s,walletList:a,shouldEnforceDefaultChainOnConnect:o,externalWalletConfig:l,appName:u,walletChainType:f,setBaseAccountSdk:p,connectorsDebugLogs:y}){this.connectors||(this.connectors=new Urt(this.appId,e,n,r,i,s,a,o,l,u,p,f,y))}generateApi(){let e=new Frt({appId:this.appId,appClientId:this.appClientId,client:this,defaults:{baseURL:this.apiUrl,timeout:this.timeout}});return this.session.api=e,e}updateApiUrl(e){this.apiUrl=e||this.fallbackApiUrl,this.api=this.generateApi(),e&&(this.useServerCookies=!0)}authenticate(){if(!this.authFlow)throw new ue("No auth flow in progress.");return this.session.authenticate(this.authFlow)}async link(){if(!this.authFlow)throw new ue("No auth flow in progress.");let{oAuthTokens:e}=await this.session.link(this.authFlow);return{user:await this.getAuthenticatedUser(),oAuthTokens:e}}storeProviderAccessToken(e,n){this.session.storeProviderAccessToken(e,n)}getProviderAccessToken(e){return this.session.getProviderAccessToken(e)}async logout(){await this.session.destroy(),this.authFlow=void 0}clearProviderAcccessTokens(e){e.linkedAccounts.filter((n=>n.type==="cross_app")).forEach((n=>{this.storeProviderAccessToken(n.providerApp.id,null)}))}startAuthFlow(e){return e.api=this.api,this.authFlow=e,this.authFlow}async initMfaSmsVerification(){try{await this.api.post(crt,{action:"verify"})}catch(e){throw vn(e)}}async initMfaPasskeyVerification(){try{let e=await this.api.post(urt,{});return zrt(e.options)}catch(e){throw vn(e)}}async getCrossAppProviderDetails(e){try{return this._cachedProviderAppDetails[e]||(this._cachedProviderAppDetails[e]=await this.api.get(`/api/v1/apps/${e}/cross-app/details`)),this._cachedProviderAppDetails[e]}catch(n){console.error("Error fetching cross app provider details",n)}}async acceptTerms(){try{let e=await this.api.post(drt,{});return os(e)}catch(e){throw Nr(e)}}async unlinkEmail(e){try{let n=await this.api.post(znt,{address:e});return await this.getAuthenticatedUser()??os(n)}catch(n){throw Nr(n)}}async unlinkPhone(e){try{let n=await this.api.post(Znt,{phoneNumber:e});return await this.getAuthenticatedUser()??os(n)}catch(n){throw Nr(n)}}async unlinkEthereumWallet(e){try{let n=await this.api.post(Ant,{address:e});return await this.getAuthenticatedUser()??os(n)}catch(n){throw Nr(n)}}async unlinkSolanaWallet(e){try{let n=await this.api.post(Int,{address:e});return await this.getAuthenticatedUser()??os(n)}catch(n){throw Nr(n)}}async unlinkOAuth(e,n){try{let r=await this.api.post(Jnt,{provider:e,subject:n});return await this.getAuthenticatedUser()??os(r)}catch(r){throw Nr(r)}}async unlinkFarcaster(e){try{let n=await this.api.post(Mnt,{fid:e});return await this.getAuthenticatedUser()??os(n)}catch(n){throw Nr(n)}}async unlinkTelegram(e){try{let n=await this.api.post(ort,{telegram_user_id:e});return await this.getAuthenticatedUser()??os(n)}catch(n){throw Nr(n)}}async revokeDelegatedWallet(){try{await this.api.post(brt,{})}catch(e){throw Nr(e)}}async createAnalyticsEvent({eventName:e,payload:n,timestamp:r,options:i}){if(typeof window<"u")try{if(!this.clientAnalyticsId)return void console.warn("No client analytics id set, refusing to send analytics event");await this.api.post(Hoe,{event_name:e,client_id:this.clientAnalyticsId,payload:{...n||{},clientTimestamp:r?r.toISOString():new Date().toISOString()}}
580,{retry:-1,keepalive:(i==null?void 0:i.keepAlive)??!1})}catch{}}async signMoonpayOnRampUrl(e){try{return this.api.post(mrt,e)}catch(n){throw Nr(n)}}async initCoinbaseOnRamp(e){try{return this.api.post(yrt,e)}catch(n){throw Nr(n)}}async getCoinbaseOnRampStatus({partnerUserId:e}){try{return this.api.get(`${grt}?partnerUserId=${e}`)}catch(n){throw Nr(n)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()?this.session.refresh():null}async getAccessToken(e){return await this.getPrivyAccessToken(e)||await this.getCustomerAccessToken(e)}async getCustomerAccessToken(e){return await this._getToken(ZZ.CUSTOMER,e)}async getPrivyAccessToken(e){return await this._getToken(ZZ.PRIVY,e)}async _getToken(e,n){var r;if(this.session.getToken(e)){if(this.session.hasActiveAccessToken(e))return this.session.hasRefreshCredentials(e)?((r=hP.parse(this.session.getToken(e)))==null?void 0:r.appId)!==this.appId?(await this.logout(),null):this.session.getToken(e):(this.session.destroyLocalState(),null);{if(n!=null&&n.disableAutoRefresh||!this.session.hasRefreshCredentials(e))return null;let i=R0(Vrt);if(i){let s=async()=>(await this.session.refresh(),this.session.getToken(e));return await i.withRefreshLock({onLeader:s,onFollowerReleased:async()=>this.session.hasActiveAccessToken(e)?this.session.getToken(e):s()})}return await this.session.refresh(),this.session.getToken(e)}}return!(n!=null&&n.disableAutoRefresh)&&this.useServerCookies&&this.session.mightHaveServerCookies?(await this.session.refresh(),this.session.getToken(e)):null}async getUsdTokenPrice(e){try{return(await this.api.get(`/api/v1/token_price?chainId=${e.id}&tokenSymbol=${e.nativeCurrency.symbol}`)).usd}catch{return void console.error(`Unable to fetch token price for chain with id ${e.id}`)}}async getUsdPriceForSol(){try{return(await this.api.get("/api/v1/token_price?chainId=0&tokenSymbol=SOL")).usd}catch{return void console.error("Unable to fetch token price for SOL")}}async getSplTokenMetadata({mintAddress:e,cluster:n}){try{return await this.api.get(`/api/v1/spl_token_info?mint_address=${e}&cluster=${n}`)}catch{return void console.error(`Unable to fetch token metadata for ${n}:${e}`)}}async requestFarcasterSignerStatus(e){try{return await this.api.post("/api/v1/farcaster/signer/status",{ed25519_public_key:e})}catch(n){throw console.error("Unable to fetch Farcaster signer status"),n}}async generateSiweNonce({address:e,captchaToken:n}){try{return(await this.api.post(xnt,{address:e,token:n})).nonce}catch(r){throw Nr(r)}}async authenticateWithSiweInternal({message:e,signature:n,chainId:r,walletClientType:i,connectorType:s,mode:a}){return await this.api.post(Cnt,{message:e,signature:n,chainId:r,walletClientType:i,connectorType:s,mode:a})}async linkWithSiweInternal({message:e,signature:n,chainId:r,walletClientType:i,connectorType:s}){return await this.api.post(Ent,{message:e,signature:n,chainId:r,walletClientType:i,connectorType:s})}async linkSmartWallet({message:e,signature:n,smartWalletType:r,smartWalletVersion:i}){try{let s=await this.api.post(Snt,{message:e,signature:n,smart_wallet_type:r,smart_wallet_version:i});return os(s)}catch(s){throw Nr(s)}}async linkWithSiwe({message:e,signature:n,chainId:r,walletClientType:i,connectorType:s}){try{let a=await this.linkWithSiweInternal({message:e,signature:n,chainId:r,walletClientType:i,connectorType:s});return os(a)}catch(a){throw Nr(a)}}async generateSiwsNonce({address:e,captchaToken:n}){try{return(await this.api.post(Tnt,{address:e,token:n})).nonce}catch(r){throw Nr(r)}}async authenticateWithSiwsInternal({message:e,signature:n,walletClientType:r,connectorType:i,mode:s,messageType:a="plain"}){return await this.api.post(Lnt,{message:e,signature:n,walletClientType:r,connectorType:i,mode:s,message_type:a})}async authenticateWithSiws({message:e,signature:n,walletClientType:r,connectorType:i,mode:s,messageType:a="plain"}){let o=await this.authenticateWithSiwsInternal({message:e,signature:n,walletClientType:r,connectorType:i,mode:s,messageType:a});this.session.handleTokenResponse(o);let l=os(o.user);if(!l)throw Error("Authentication failed - no user returned");return{user:l,isNewUser:o.is_new_user||!1}}
580async sendAccountTransferRequest({nonce:e,account:n,accountType:r,externalWalletMetadata:i,telegramAuthResult:s,telegramWebAppData:a,farcasterEmbeddedAddress:o,oAuthUserInfo:l}){try{let u,f;switch(r){case"email":u=Hnt,f={nonce:e,email:n};break;case"sms":u=Ynt,f={nonce:e,phoneNumber:n};break;case"siwe":if(u=knt,!i)throw Error("Wallet parameters must be defined");f={nonce:e,address:n,...i};break;case"farcaster":u=Dnt,f={nonce:e,farcaster_id:n,farcaster_embedded_address:o};break;case"telegram":u=lrt,f={nonce:e,telegram_auth_result:s,telegram_web_app_data:a};break;case"siws":u=Nnt,f={nonce:e,address:n,...i};break;case"custom":case"guest":case"passkey":throw Error("Invalid transfer account type");default:u=Xnt,f={nonce:e,userInfo:l}}let p=await this.api.post(u,f);return await this.getAuthenticatedUser()??os(p)}catch(u){throw Nr(u)}}async linkWithSiwsInternal({message:e,signature:n,walletClientType:r,connectorType:i,messageType:s="plain"}){return await this.api.post($nt,{message:e,signature:n,walletClientType:r,connectorType:i,message_type:s})}async linkWithSiws({message:e,signature:n,walletClientType:r,connectorType:i,messageType:s="plain"}){try{let a=await this.linkWithSiwsInternal({message:e,signature:n,walletClientType:r,connectorType:i,messageType:s});return os(a)}catch(a){throw Nr(a)}}async updateUserAndIdToken(){try{let e=await this.api.get(wrt);return this.session.updateIdentityToken(e.identity_token),os(e.user)}catch(e){throw Nr(e)}}async scanTransaction(e){try{return await this.api.post(vrt,e)}catch(n){throw Nr(n)}}constructor({apiUrl:e=ZT,appId:n,appClientId:r,timeout:i=NNe,cookieWriteBehavior:s}){Object.defineProperty(this,XS,{value:Yrt}),this._cachedProviderAppDetails={},this.apiUrl=e,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=e!==ZT&&e.startsWith("https://privy."),this.cookieWriteBehavior=s,this.timeout=i,this.appId=n,this.appClientId=r,this.clientAnalyticsId=(function(a,o){if(!Object.prototype.hasOwnProperty.call(a,o))throw TypeError("attempted to use private field on non-instance");return a})(this,XS)[XS](),JS||(JS=new Zrt),this.session=JS,this.api=this.generateApi(),this.session.client=this}};function Yrt(){if(typeof window>"u")return null;try{let e=vt.get(KT);if(typeof e=="string"&&e.length>0)return e}catch{}let t=crypto.randomUUID();try{return vt.put(KT,t),t}catch{return t}}function Joe(){if(!Ev)throw new ue("No global PrivyClient instance found. Please ensure you have initialized the PrivyProvider.");return Ev}function Jrt(t){var e,n;Ev||(Ev=new Grt({appId:t.appId,appClientId:t.clientId,apiUrl:t.apiUrl,cookieWriteBehavior:(n=(e=t.config)==null?void 0:e.sessions)==null?void 0:n.cookieWriteBehavior}))}async function Xr(){let t=Joe();return t?t.getAccessToken():Promise.resolve(vt.get(Ow)||vt.get(ug)||null)}async function KZ(t,e,n,r){let i=A8(t),{chain:s,authorizationList:a,...o}=await(async()=>r?await r():await e.prepareTransactionRequest({...i,account:{address:n,type:"json-rpc"}}))();return{...o,type:_te[o.type],authorizationList:t.authorizationList}}let Xrt=["calls","feePayer","feePayerSignature","feeToken","keyAuthorization","nonceKey","signature","validBefore","validAfter"];const Qrt=t=>{if(!t||typeof t!="object")return!1;if(t.type===U7||typeof t.type=="string"&&t.type.toLowerCase()===xte)return!0;let e=t.account;return!!(e!=null&&e.keyType)&&e.keyType!=="secp256k1"||(e==null?void 0:e.source)==="accessKey"||Xrt.some((n=>t[n]!==void 0))},eit=t=>({type:U7,from:t.from,chainId:t.chainId,nonce:t.nonce,gasLimit:t.gasLimit??t.gas,maxFeePerGas:t.maxFeePerGas,maxPriorityFeePerGas:t.maxPriorityFeePerGas,calls:tit(t),feeToken:nit(t.feeToken),nonceKey:rit(t.nonceKey),validBefore:t.validBefore,validAfter:t.validAfter,feePayerSignature:t.feePayerSignature??void 0,accessList:t.accessList});let tit=t=>{let e=t.calls&&t.calls.length>0?t.calls:t.to?[{to:t.to,data:t.data,value:t.value}]:[];if(e.length===0)throw Error("Tempo transactions require at least one call");return e.map((n=>{if(!n.to)throw Error("Tempo transaction calls require a `to` address");return{to:n.to,data:n.data,value:n.value}}))},nit=t=>{if(t!==void 0)return typeof t=="string"?t:`0x20c0${t.toString(16).padStart(36,"0")}`},rit=t=>{if(t!=="expiring"&&t!=="random")return t};function iit(t){if(typeof window>"u")return;const e=n=>t(n.detail);return window.addEventListener("eip6963:announceProvider",e),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",e)}function sit(){const t=new Set;let e=[];const n=()=>iit(i=>{e.some(({info:s})=>s.uuid===i.info.uuid)||(e=[...e,i],t.forEach(s=>s(e,{added:[i]})))});let r=n();return{_listeners(){return t},clear(){t.forEach(i=>
vendor: 5,208 bytes, lines 580-591
580i([],{removed:[...e]})),e=[]},destroy(){this.clear(),t.clear(),r==null||r()},findProvider({rdns:i}){return e.find(s=>s.info.rdns===i)},getProviders(){return e},reset(){this.clear(),r==null||r(),r=n()},subscribe(i,{emitImmediately:s}={}){return t.add(i),s&&i(e,{added:e}),()=>t.delete(i)}}}const ait=({address:t,nonce:e})=>`${window.location.host} wants you to sign in with your Solana account: 581${t} 582 583${`You are proving you own ${t}.`} 584 585URI: ${window.location.origin} 586Version: 1 587Chain ID: mainnet 588Nonce: ${e} 589Issued At: ${new Date().toISOString()} 590Resources: 591- https://privy.io`,oit=Symbol("solana-funding-plugin"),lit=Symbol("solana-ledger-plugin");var xr="-ms-",Hg="-moz-",Pn="-webkit-",Xoe="comm",x9="rule",pP="decl",cit="@import",uit="@namespace",Qoe="@keyframes",dit="@layer",ele=Math.abs,mP=String.fromCharCode,f$=Object.assign;function hit(t,e){return $i(t,0)^45?(((e<<2^$i(t,0))<<2^$i(t,1))<<2^$i(t,2))<<2^$i(t,3):0}function tle(t){return t.trim()}function su(t,e){return(t=e.exec(t))?t[0]:t}function Qt(t,e,n){return t.replace(e,n)}function Zw(t,e,n){return t.indexOf(e,n)}function $i(t,e){return t.charCodeAt(e)|0}function Nf(t,e,n){return t.slice(e,n)}function cl(t){return t.length}function nle(t){return t.length}function bg(t,e){return e.push(t),t}function fit(t,e){return t.map(e).join("")}function GZ(t,e){return t.filter(function(n){return!su(n,e)})}var C9=1,$1=1,rle=0,Po=0,bi=0,gm="";function E9(t,e,n,r,i,s,a,o){return{value:t,root:e,parent:n,type:r,props:i,children:s,line:C9,column:$1,length:a,return:"",siblings:o}}function Hd(t,e){return f$(E9("",null,null,"",null,null,0,t.siblings),t,{length:-t.length},e)}function h0(t){for(;t.root;)t=Hd(t.root,{children:[t]});bg(t,t.siblings)}function pit(){return bi}function mit(){return bi=Po>0?$i(gm,--Po):0,$1--,bi===10&&($1=1,C9--),bi}function bl(){return bi=Po<rle?$i(gm,Po++):0,$1++,bi===10&&($1=1,C9++),bi}function p2(){return $i(gm,Po)}function Kw(){return Po}function S9(t,e){return Nf(gm,t,e)}function C6(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function yit(t){return C9=$1=1,rle=cl(gm=t),Po=0,[]}function git(t){return gm="",t}function QS(t){return tle(S9(Po-1,p$(t===91?t+2:t===40?t+1:t)))}function bit(t){for(;(bi=p2())&&bi<33;)bl();return C6(t)>2||C6(bi)>3?"":" "}function wit(t,e){for(;--e&&bl()&&!(bi<48||bi>102||bi>57&&bi<65||bi>70&&bi<97););return S9(t,Kw()+(e<6&&p2()==32&&bl()==32))}function p$(t){for(;bl();)switch(bi){case t:return Po;case 34:case 39:t!==34&&t!==39&&p$(bi);break;case 40:t===41&&p$(t);break;case 92:bl();break}return Po}function vit(t,e){for(;bl()&&t+bi!==57;)if(t+bi===84&&p2()===47)break;return"/*"+S9(e,Po-1)+"*"+mP(t===47?t:bl())}function _it(t){for(;!C6(p2());)bl();return S9(t,Po)}function xit(t){return git(Gw("",null,null,null,[""],t=yit(t),0,[0],t))}function Gw(t,e,n,r,i,s,a,o,l){for(var u=0,f=0,p=a,y=0,g=0,b=0,v=1,_=1,C=1,S=0,x="",A=i,I=s,$=r,O=x;_;)switch(b=S,S=bl()){case 40:if(b!=108&&$i(O,p-1)==58){Zw(O+=Qt(QS(S),"&","&\f"),"&\f",ele(u?o[u-1]:0))!=-1&&(C=-1);break}case 34:case 39:case 91:O+=QS(S);break;case 9:case 10:case 13:case 32:O+=bit(b);break;case 92:O+=wit(Kw()-1,7);continue;case 47:switch(p2()){case 42:case 47:bg(Cit(vit(bl(),Kw()),e,n,l),l),(C6(b||1)==5||C6(p2()||1)==5)&&cl(O)&&Nf(O,-1,void 0)!==" "&&(O+=" ");break;default:O+="/"}break;case 123*v:o[u++]=cl(O)*C;case 125*v:case 59:case 0:switch(S){case 0:case 125:_=0;case 59+f:C==-1&&(O=Qt(O,/\f/g,"")),g>0&&(cl(O)-p||v===0&&b===47)&&bg(g>32?JZ(O+";",r,n,p-1,l):JZ(Qt(O," ","")+";",r,n,p-2,l),l);break;case 59:O+=";";default:if(bg($=YZ(O,e,n,u,f,i,o,x,A=[],I=[],p,s),s),S===123)if(f===0)Gw(O,e,$,$,A,s,p,o,I);else{switch(y){case 99:if($i(O,3)===110)break;case 108:if($i(O,2)===97)break;default:f=0;case 100:case 109:case 115:}f?Gw(t,$,$,r&&bg(YZ(t,$,$,0,0,i,o,x,i,A=[],p,I),I),i,I,p,o,r?A:I):Gw(O,$,$,$,[""],I,0,o,I)}}u=f=g=0,v=C=1,x=O="",p=a;break;case 58:p=1+cl(O),g=b;default:if(v<1){if(S==123)--v;else if(S==125&&v++==0&&mit()==125)continue}switch(O+=mP(S),S*v){case 38:C=f>0?1:(O+="\f",-1);break;case 44:o[u++]=(cl(O)-1)*C,C=1;break;case 64:p2()===45&&(O+=QS(bl())),y=p2(),f=p=cl(x=O+=_it(Kw())),S++;break;case 45:b===45&&cl(O)==2&&(v=0)}}return s}function YZ(t,e,n,r,i,s,a,o,l,u,f,p){for(var y=i-1,g=i===0?s:[""],b=nle(g),v=0,_=0,C=0;v<r;++v)for(var S=0,x=Nf(t,y+1,y=ele(_=a[v])),A=t;S<b;++S)(A=tle(_>0?g[S]+" "+x:Qt(x,/&\f/g,g[S])))&&(l[C++]=A);return E9(t,e,n,i===0?x9:o,l,u,f,p)}function Cit(t,e,n,r){return E9(t,e,n,Xoe,mP(pit()),Nf(t,2,-2),0,r)}function JZ(t,e,n,r,i){return E9(t,e,n,pP,Nf(t,0,r),Nf(t,r+1,-1),r,i)}function ile(t,e,n){switch(hit(t,e)){case 5103:return Pn+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:case 6391:case 5879:case 5623:case 6135:case 4599:return Pn+t+t;case 4855:return Pn+t.replace("add","source-over").replace("substract","source-out").replace("intersect","source-in").replace("exclude","xor")+t;case 4789:return Hg+t+t;
591case 5349:case 4246:case 4810:case 6968:case 2756:return Pn+t+Hg+t+xr+t+t;case 5936:switch($i(t,e+11)){case 114:return Pn+t+xr+Qt(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return Pn+t+xr+Qt(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return Pn+t+xr+Qt(t,/[svh]\w+-[tblr]{2}/,"lr")+t}case 6828:case 4268:case 2903:return Pn+t+xr+t+t;case 6165:return Pn+t+xr+"flex-"+t+t;case 5187:return Pn+t+Qt(t,/(\w+).+(:[^]+)/,Pn+"box-$1$2"+xr+"flex-$1$2")+t;case 5443:return Pn+t+xr+"flex-item-"+Qt(t,/flex-|-self/g,"")+(su(t,/flex-|baseline/)?"":xr+"grid-row-"+Qt(t,/flex-|-self/g,""))+t;case 4675:return Pn+t+xr+"flex-line-pack"+Qt(t,/align-content|flex-|-self/g,"")+t;case 5548:return Pn+t+xr+Qt(t,"shrink","negative")+t;case 5292:return Pn+t+xr+Qt(t,"basis","preferred-size")+t;case 6060:return Pn+"box-"+Qt(t,"-grow","")+Pn+t+xr+Qt(t,"grow","positive")+t;case 4554:return Pn+Qt(t,/([^-])(transform)/g,"$1"+Pn+"$2")+t;case 6187:return Qt(Qt(Qt(t,/(zoom-|grab)/,Pn+"$1"),/(image-set)/,Pn+"$1"),t,"")+t;case 5495:case 3959:return Qt(t,/(image-set\([^]*)/,Pn+"$1$`$1");case 4968:return Qt(Qt(t,/(.+:)(flex-)?(.*)/,Pn+"box-pack:$3"+xr+"flex-pack:$3"),/space-between/,"justify")+Pn+t+t;case 4200:if(!su(t,/flex-|baseline/))return xr+"grid-column-align"+Nf(t,e)+t;break;case 2592:case 3360:return xr+Qt(t,"template-","")+t;case 4384:case 3616:return n&&n.some(function(r,i){return e=i,su(r.props,/grid-\w+-end/)})?~Zw(t+(n=n[e].value),"span",0)?t:xr+Qt(t,"-start","")+t+xr+"grid-row-span:"+(~Zw(n,"span",0)?su(n,/\d+/):+su(n,/\d+/)-+su(t,/\d+/))+";":xr+Qt(t,"-start","")+t;case 4896:case 4128:return n&&n.some(function(r){return su(r.props,/grid-\w+-start/)})?t:xr+Qt(Qt(t,"-end","-span"),"span ","")+t;case 4095:case 3583:case 4068:case 2532:return Qt(t,/(.+)-inline(.+)/,Pn+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(cl(t)-1-e>6)switch($i(t,e+1)){case 109:if($i(t,e+4)!==45)break;case 102:return Qt(t,/(.+:)(.+)-([^]+)/,"$1"+Pn+"$2-$3$1"+Hg+($i(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~Zw(t,"stretch",0)?ile(Qt(t,"stretch","fill-available"),e,n)+t:t}break;case 5152:case 5920:return Qt(t,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,i,s,a,o,l,u){return xr+i+":"+s+u+(a?xr+i+"-span:"+(o?l:+l-+s)+u:"")+t});case 4949:if($i(t,e+6)===121)return Qt(t,":",":"+Pn)+t;break;case 6444:switch($i(t,$i(t,14)===45?18:11)){case 120:return Qt(t,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+Pn+($i(t,14)===45?"inline-":"")+"box$3$1"+Pn+"$2$3$1"+xr+"$2box$3")+t;case 100:return Qt(t,":",":"+xr)+t}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Qt(t,"scroll-","scroll-snap-")+t}return t}function Sv(t,e){for(var n="",r=0;r<t.length;r++)n+=e(t[r],r,t,e)||"";return n}function Eit(t,e,n,r){switch(t.type){case dit:if(t.children.length)break;case cit:case uit:case pP:return t.return=t.return||t.value;case Xoe:return"";case Qoe:return t.return=t.value+"{"+Sv(t.children,r)+"}";case x9:if(!cl(t.value=t.props.join(",")))return""}return cl(n=Sv(t.children,r))?t.return=t.value+"{"+n+"}":""}function Sit(t){var e=nle(t);return function(n,r,i,s){for(var a="",o=0;o<e;o++)a+=t[o](n,r,i,s)||"";return a}}function Ait(t){return function(e){e.root||(e=e.return)&&t(e)}}function kit(t,e,n,r){if(t.length>-1&&!t.return)switch(t.type){case pP:t.return=ile(t.value,t.length,n);return;case Qoe:return Sv([Hd(t,{value:Qt(t.value,"@","@"+Pn)})],r);case x9:if(t.length)return fit(n=t.props,function(i){switch(su(i,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":h0(Hd(t,{props:[Qt(i,/:(read-\w+)/,":"+Hg+"$1")]})),h0(Hd(t,{props:[i]})),f$(t,{props:GZ(n,r)});break;case"::placeholder":h0(Hd(t,{props:[Qt(i,/:(plac\w+)/,":"+Pn+"input-$1")]})),h0(Hd(t,{props:[Qt(i,/:(plac\w+)/,":"+Hg+"$1")]})),h0(Hd(t,{props:[Qt(i,/:(plac\w+)/,xr+"input-$1")]})),h0(Hd(t,{props:[i]})),f$(t,{props:GZ(n,r)});break}return""})}}var X0={},eA,tA;const I1=typeof process<"u"&&X0!==void 0&&(X0.REACT_APP_SC_ATTR||X0.SC_ATTR)||"data-styled",sle="active",ale="data-styled-version",A9="6.5.3",yP=`/*!sc*/ 592`,Wg=typeof window<"u"&&typeof document<"u";function XZ(t){if(typeof process<"u"&&X0!==void 0){const e=X0[t];if(e!==void 0&&e!=="")return e!=="false"}}const Tit=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:(tA=(eA=XZ("REACT_APP_SC_DISABLE_SPEEDY"))!==null&&eA!==void 0?eA:XZ("SC_DISABLE_SPEEDY"))!==null&&tA!==void 0?tA:typeof process<"u"&&X0!==void 0&&!1),ole="sc-keyframes-",Lit={};function S5(t,...e){return new Error(`An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#${t} for more information.${e.length>0?` Args: ${e.join(", ")}`:""}`)}let Yw=new Map,Av=new Map,Jw=1;const wg=t=>{if(Yw.has(t))return Yw.get(t);for(;Av.has(Jw);)Jw++;const e=Jw++;return Yw.set(t,e),Av.set(e,t),e},$it=t=>Av.get(t),Iit=(t,e)=>{Jw=e+1,Yw.set(t,e),Av.set(e,t)},gP=Object.freeze([]),N1=Object.freeze({});function lle(t,e,n=N1){return t.theme!==n.theme&&t.theme||e||n.theme}const Nit=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Oit=/(^-|-$)/g;function cle(t){return t.replace(Nit,"-").replace(Oit,"")}const Pit=/(a)(d)/gi,QZ=t=>String.fromCharCode(t+(t>25?39:97));function bP(t){let e,n="";for(e=Math.abs(t);e>52;e=e/52|0)n=QZ(e%52)+n;return(QZ(e%52)+n).replace(Pit,"$1-$2")}const m$=5381,ff=(t,e)=>{let n=e.length;for(;n;)t=33*t^e.charCodeAt(--n);return t},ule=t=>ff(m$,t);function wP(t){return bP(ule(t)>>>0)}function Rit(t){return t.displayName||t.name||"Component"}function y$(t){return typeof t=="string"&&!0}function jit(t){return y$(t)?`styled.${t}`:`Styled(${Rit(t)})`}const dle=Symbol.for("react.memo"),Mit=Symbol.for("react.forward_ref"),Dit={contextType:!0,defaultProps:!0,displayName:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,propTypes:!0,type:!0},Uit={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},hle={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Bit={[Mit]:{$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},[dle]:hle};function eK(t){return("type"in(e=t)&&e.type.$$typeof)===dle?hle:"$$typeof"in t?Bit[t.$$typeof]:Dit;var e}const Fit=Object.defineProperty,zit=Object.getOwnPropertyNames,Vit=Object.getOwnPropertySymbols,Hit=Object.getOwnPropertyDescriptor,Wit=Object.getPrototypeOf,qit=Object.prototype;function fle(t,e,n){if(typeof e!="string"){const r=Wit(e);r&&r!==qit&&fle(t,r,n);const i=zit(e).concat(Vit(e)),s=eK(t),a=eK(e);for(let o=0;o<i.length;++o){const l=i[o];if(!(l in Uit||n&&n[l]||a&&l in a||s&&l in s)){const u=Hit(e,l);try{Fit(t,l,u)}catch{}}}}return t}function A5(t){return typeof t=="function"}const Zit=Symbol.for("react.forward_ref");function vP(t){return t!=null&&(typeof t=="object"||typeof t=="function")&&t.$$typeof===Zit&&"styledComponentId"in t}function vg(t,e){return t&&e?t+" "+e:t||e||""}function kv(t,e){return t.join("")}function E6(t){return t!==null&&typeof t=="object"&&t.constructor.name===Object.name&&!("props"in t&&t.$$typeof)}function g$(t,e,n=!1){if(!n&&!E6(t)&&!Array.isArray(t))return e;if(Array.isArray(e))for(let r=0;r<e.length;r++)t[r]=g$(t[r],e[r]);else if(E6(e))for(const r in e)t[r]=g$(t[r],e[r]);return t}function _P(t,e){Object.defineProperty(t,"toString",{value:e})}const Kit=class{constructor(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t,this._cGroup=0,this._cIndex=0}indexOfGroup(t){if(t===this._cGroup)return this._cIndex;let e=this._cIndex;if(t>this._cGroup)for(let n=this._cGroup;n<t;n++)e+=this.groupSizes[n];else for(let n=this._cGroup-1;n>=t;n--)e-=this.groupSizes[n];return this._cGroup=t,this._cIndex=e,e}insertRules(t,e){if(t>=this.groupSizes.length){const i=this.groupSizes,s=i.length;let a=s;for(;t>=a;)if(a<<=1,a<0)throw S5(16,`${t}`);this.groupSizes=new Uint32Array(a),this.groupSizes.set(i),this.length=a;for(let o=s;o<a;o++)this.groupSizes[o]=0}let n=this.indexOfGroup(t+1),r=0;for(let i=0,s=e.length;i<s;i++)this.tag.insertRule(n,e[i])&&(this.groupSizes[t]++,n++,r++);r>0&&this._cGroup>t&&(this._cIndex+=r)}clearGroup(t){if(t<this.length){const e=this.groupSizes[t],n=this.indexOfGroup(t),r=n+e;this.groupSizes[t]=0;for(let i=n;i<r;i++)this.tag.deleteRule(n);e>0&&this._cGroup>t&&(this._cIndex-=e)}}getGroup(t){let e="";if(t>=this.length||this.groupSizes[t]===0)return e;const n=this.groupSizes[t],r=this.indexOfGroup(t),i=r+n;for(let s=r;s<i;s++)e+=this.tag.getRule(s)+yP;return e}},Git=`style[${I1}][${ale}="${A9}"]`,Yit=new RegExp(`^${I1}\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)`),tK=t=>typeof ShadowRoot<"u"&&t instanceof ShadowRoot||"host"in t&&t.nodeType===11,b$=t=>{if(!t)return document;if(tK(t))return t;if("getRootNode"in t){const e=t.getRootNode();if(tK(e))return e}return document},Jit=(t,e,n)=>{const r=n.split(",");let i;for(let s=0,a=r.length;s<a;s++)(i=r[s])&&t.registerName(e,i)},Xit=(t,e)=>{var n;const r=((n=e.textContent)!==null&&n!==void 0?n:"").split(yP),i=[];for(let s=0,a=r.length;s<a;s++){const o=r[s].trim();if(!o)continue;const l=o.match(Yit);if(l){const u=0|parseInt(l[1],10),f=l[2];u!==0&&(Iit(f,u),Jit(t,f,l[3]),t.getTag().insertRules(u,i)),i.length=0}else i.push(o)}},nA=t=>{const e=b$(t.options.target).querySelectorAll(Git);for(let n=0,r=e.length;n<r;n++){const i=e[n];i&&i.getAttribute(I1)!==sle&&(Xit(t,i),i.parentNode&&i.parentNode.removeChild(i))}};let Qy=!1;function Qit(){if(Qy!==!1)return Qy;if(typeof document<"u"){const t=document.head.querySelector('meta[property="csp-nonce"]');if(t)return Qy=t.nonce||t.getAttribute("content")||void 0;const e=document.head.querySelector('meta[name="sc-nonce"]');if(e)return Qy=e.getAttribute("content")||void 0}return Qy=typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0}const ple=(t,e)=>{const n=document.head,r=t||n,i=document.createElement("style"),s=(l=>{const u=Array.from(l.querySelectorAll(`style[${I1}]`));return u[u.length-1]})(r),a=s!==void 0?s.nextSibling:null;i.setAttribute(I1,sle),i.setAttribute(ale,A9);const o=e||Qit();return o&&i.setAttribute("nonce",o),r.insertBefore(i,a),i},est=class{constructor(e,n){this.element=ple(e,n),this.element.appendChild(document.createTextNode("")),this.sheet=(r=>{var i;if(r.sheet)return r.sheet;const s=(i=r.getRootNode().styleSheets)!==null&&i!==void 0?i:document.styleSheets;for(let a=0,o=s.length;a<o;a++){const l=s[a];if(l.ownerNode===r)return l}throw S5(17)})(this.element),this.length=0}insertRule(e,n){try{return this.sheet.insertRule(n,e),this.length++,!0}catch{return!1}}deleteRule(e){this.sheet.deleteRule(e),this.length--}getRule(e){const n=this.sheet.cssRules[e];return n&&n.cssText?n.cssText:""}}
592,tst=class{constructor(t,e){this.element=ple(t,e),this.nodes=this.element.childNodes,this.length=0}insertRule(t,e){if(t<=this.length&&t>=0){const n=document.createTextNode(e);return this.element.insertBefore(n,this.nodes[t]||null),this.length++,!0}return!1}deleteRule(t){this.element.removeChild(this.nodes[t]),this.length--}getRule(t){return t<this.length?this.nodes[t].textContent:""}};let nK=Wg;const nst={isServer:!Wg,useCSSOMInjection:!Tit};class k5{static registerId(e){return wg(e)}constructor(e=N1,n={},r){this.options=Object.assign(Object.assign({},nst),e),this.gs=n,this.keyframeIds=new Set,this.names=new Map(r),this.server=!!e.isServer,!this.server&&Wg&&nK&&(nK=!1,nA(this)),_P(this,()=>(i=>{const s=i.getTag(),{length:a}=s;let o="";for(let l=0;l<a;l++){const u=$it(l);if(u===void 0)continue;const f=i.names.get(u);if(f===void 0||!f.size)continue;const p=s.getGroup(l);if(p.length===0)continue;const y=I1+".g"+l+'[id="'+u+'"]';let g="";for(const b of f)b.length>0&&(g+=b+",");o+=p+y+'{content:"'+g+'"}'+yP}return o})(this))}rehydrate(){!this.server&&Wg&&nA(this)}reconstructWithOptions(e,n=!0){const r=new k5(Object.assign(Object.assign({},this.options),e),this.gs,n&&this.names||void 0);return r.keyframeIds=new Set(this.keyframeIds),!this.server&&Wg&&e.target!==this.options.target&&b$(this.options.target)!==b$(e.target)&&nA(r),r}allocateGSInstance(e){return this.gs[e]=(this.gs[e]||0)+1}getTag(){return this.tag||(this.tag=(e=(({useCSSOMInjection:n,target:r,nonce:i})=>n?new est(r,i):new tst(r,i))(this.options),new Kit(e)));var e}hasNameForId(e,n){var r,i;return(i=(r=this.names.get(e))===null||r===void 0?void 0:r.has(n))!==null&&i!==void 0&&i}registerName(e,n){wg(e),e.startsWith(ole)&&this.keyframeIds.add(e);const r=this.names.get(e);r?r.add(n):this.names.set(e,new Set([n]))}insertRules(e,n,r){this.registerName(e,n),this.getTag().insertRules(wg(e),r)}clearNames(e){this.names.has(e)&&this.names.get(e).clear()}clearRules(e){this.getTag().clearGroup(wg(e)),this.clearNames(e)}clearTag(){this.tag=void 0}}const mle=new WeakSet,rst={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexShrink:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function ist(t,e){return e==null||typeof e=="boolean"||e===""?"":typeof e!="number"||e===0||t in rst||t.startsWith("--")?String(e).trim():e+"px"}const Fh=47;function rK(t){if(t.charCodeAt(0)===45&&t.charCodeAt(1)===45)return t;let e="";for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);e+=r>=65&&r<=90?"-"+String.fromCharCode(r+32):t[n]}return e.startsWith("ms-")?"-"+e:e}const yle=Symbol.for("sc-keyframes");function sst(t){return typeof t=="object"&&t!==null&&yle in t}function gle(t){return A5(t)&&!(t.prototype&&t.prototype.isReactComponent)}const ble=t=>t==null||t===!1||t==="",ast=Symbol.for("react.client.reference");function iK(t){return t.$$typeof===ast}function wle(t,e){for(const n in t){const r=t[n];t.hasOwnProperty(n)&&!ble(r)&&(Array.isArray(r)&&mle.has(r)||A5(r)?e.push(rK(n)+":",r,";"):E6(r)?(e.push(n+" {"),wle(r,e),e.push("}")):e.push(rK(n)+": "+ist(n,r)+";"))}}function x2(t,e,n,r,i=[]){if(ble(t))return i;const s=typeof t;if(s==="string")return i.push(t),i;if(s==="function"){if(iK(t))return i;if(gle(t)&&e){const a=t(e);return x2(a,e,n,r,i)}return i.push(t),i}if(Array.isArray(t)){for(let a=0;a<t.length;a++)x2(t[a],e,n,r,i);return i}return vP(t)?(i.push(`.${t.styledComponentId}`),i):sst(t)?(n?(t.inject(n,r),i.push(t.getName(r))):i.push(t),i):iK(t)?i:E6(t)?t.toString!==Object.prototype.toString?(i.push(t.toString()),i):(wle(t,i),i):(i.push(t.toString()),i)}const ost=ule(A9);let lst=class{constructor(e,n,r){this.rules=e,this.componentId=n,this.baseHash=ff(ost,n),this.baseStyle=r,k5.registerId(n)}generateAndInjectStyles(e,n,r){let i=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,n,r):"";{let s="";for(let a=0;a<this.rules.length;a++){const o=this.rules[a];
592if(typeof o=="string")s+=o;else if(o)if(gle(o)){const l=o(e);typeof l=="string"?s+=l:l!=null&&l!==!1&&(s+=kv(x2(l,e,n,r)))}else s+=kv(x2(o,e,n,r))}if(s){this.dynamicNameCache||(this.dynamicNameCache=new Map);const a=r.hash?r.hash+s:s;let o=this.dynamicNameCache.get(a);if(!o){if(o=bP(ff(ff(this.baseHash,r.hash),s)>>>0),this.dynamicNameCache.size>=200){const l=this.dynamicNameCache.keys().next().value;l!==void 0&&this.dynamicNameCache.delete(l)}this.dynamicNameCache.set(a,o)}if(!n.hasNameForId(this.componentId,o)){const l=r(s,"."+o,void 0,this.componentId);n.insertRules(this.componentId,o,l)}i=vg(i,o)}}return i}};const cst=/&/g;function vle(t,e){let n=0;for(;--e>=0&&t.charCodeAt(e)===92;)n++;return!(1&~n)}function rA(t){const e=t.length;let n="",r=0,i=0,s=0,a=!1,o=!1;for(let l=0;l<e;l++){const u=t.charCodeAt(l);if(s!==0||a||u!==Fh||t.charCodeAt(l+1)!==42)if(a)u===42&&t.charCodeAt(l+1)===Fh&&(a=!1,l++);else if(u!==34&&u!==39||vle(t,l)){if(s===0)if(u===123)i++;else if(u===125){if(i--,i<0){o=!0;let f=l+1;for(;f<e;){const p=t.charCodeAt(f);if(p===59||p===10)break;f++}f<e&&t.charCodeAt(f)===59&&f++,i=0,l=f-1,r=f;continue}i===0&&(n+=t.substring(r,l+1),r=l+1)}else u===59&&i===0&&(n+=t.substring(r,l+1),r=l+1)}else s===0?s=u:s===u&&(s=0);else a=!0,l++}return o||i!==0||s!==0?(r<e&&i===0&&s===0&&(n+=t.substring(r)),n):t}function _le(t,e){const n=e+" ",r=","+n;for(let i=0;i<t.length;i++){const s=t[i];if(s.type==="rule"){s.value=(n+s.value).replaceAll(",",r);const a=s.props,o=[];for(let l=0;l<a.length;l++)o[l]=n+a[l];s.props=o}Array.isArray(s.children)&&s.type!=="@keyframes"&&_le(s.children,e)}return t}function ust({options:t=N1,plugins:e=gP}=N1){let n,r,i;const s=(y,g,b)=>b.startsWith(r)&&b.endsWith(r)&&b.replaceAll(r,"").length>0?`.${n}`:y,a=e.slice();a.push(y=>{y.type===x9&&y.value.includes("&")&&(i||(i=new RegExp(`\\${r}\\b`,"g")),y.props[0]=y.props[0].replace(cst,r).replace(i,s))}),t.prefix&&a.push(kit),a.push(Eit);let o=[];const l=Sit(a.concat(Ait(y=>o.push(y)))),u=(y,g="",b="",v="&")=>{n=v,r=g,i=void 0;const _=(function(S){const x=S.indexOf("//")!==-1,A=S.indexOf("}")!==-1;if(!x&&!A)return S;if(!x)return rA(S);const I=S.length;let $="",O=0,P=0,j=0,U=0,z=0,D=!1;for(;P<I;){const R=S.charCodeAt(P);if(R!==34&&R!==39||vle(S,P))if(j===0)if(R===Fh&&P+1<I&&S.charCodeAt(P+1)===42){for(P+=2;P+1<I&&(S.charCodeAt(P)!==42||S.charCodeAt(P+1)!==Fh);)P++;P+=2}else if(R!==40)if(R!==41)if(U>0)P++;else if(R===42&&P+1<I&&S.charCodeAt(P+1)===Fh)$+=S.substring(O,P),P+=2,O=P,D=!0;else if(R===Fh&&P+1<I&&S.charCodeAt(P+1)===Fh){for($+=S.substring(O,P);P<I&&S.charCodeAt(P)!==10;)P++;O=P,D=!0}else R===123?z++:R===125&&z--,P++;else U>0&&U--,P++;else U++,P++;else P++;else j===0?j=R:j===R&&(j=0),P++}return D?(O<I&&($+=S.substring(O)),z===0?$:rA($)):z===0?S:rA(S)})(y);let C=xit(b||g?b+" "+g+" { "+_+" }":_);return t.namespace&&(C=_le(C,t.namespace)),o=[],Sv(C,l),o},f=t;let p=m$;for(let y=0;y<e.length;y++)e[y].name||S5(15),p=ff(p,e[y].name);return f!=null&&f.namespace&&(p=ff(p,f.namespace)),f!=null&&f.prefix&&(p=ff(p,"p")),u.hash=p!==m$?p.toString():"",u}const dst=new k5,w$=ust(),xle=Qe.createContext({shouldForwardProp:void 0,styleSheet:dst,stylis:w$,stylisPlugins:void 0});xle.Consumer;function Cle(){return Qe.useContext(xle)}const xP=Qe.createContext(void 0);xP.Consumer;const sK=Object.prototype.hasOwnProperty,iA={};function hst(t,e){const n=typeof t!="string"?"sc":cle(t);iA[n]=(iA[n]||0)+1;const r=n+"-"+wP(A9+n+iA[n]);return e?e+"-"+r:r}function fst(t,e,n){const r=vP(t),i=t,s=!y$(t),{attrs:a=gP,componentId:o=hst(e.displayName,e.parentComponentId),displayName:l=jit(t)}=e,u=e.displayName&&e.componentId?cle(e.displayName)+"-"+e.componentId:e.componentId||o,f=r&&i.attrs?i.attrs.concat(a).filter(Boolean):a;let{shouldForwardProp:p}=e;if(r&&i.shouldForwardProp){const v=i.shouldForwardProp;if(e.shouldForwardProp){const _=e.shouldForwardProp;p=(C,S)=>v(C,S)&&_(C,S)}else p=v}const y=new lst(n,u,r?i.componentStyle:void 0);function g(v,_){return(function(C,S,x){const{attrs:A,componentStyle:I,defaultProps:$,foldedComponentIds:O,styledComponentId:P,target:j}=C,U=Qe.useContext(xP),z=Cle(),D=C.shouldForwardProp||z.shouldForwardProp,R=lle(S,U,$)||N1;let W,T;{const H=Qe.useRef(null),V=H.current;
592if(V!==null&&V[1]===R&&V[2]===z.styleSheet&&V[3]===z.stylis&&V[7]===I&&(function(F,q,G){const Y=F,X=q;let te=0;for(const ie in X)if(sK.call(X,ie)&&(te++,Y[ie]!==X[ie]))return!1;return te===G})(V[0],S,V[4]))W=V[5],T=V[6];else{W=(function(q,G,Y){const X=Object.assign(Object.assign({},G),{className:void 0,theme:Y}),te=q.length>1;for(let ie=0;ie<q.length;ie++){const se=q[ie],pe=A5(se)?se(te?Object.assign({},X):X):se;for(const Ce in pe)Ce==="className"?X.className=vg(X.className,pe[Ce]):Ce==="style"?X.style=Object.assign(Object.assign({},X.style),pe[Ce]):Ce in G&&G[Ce]===void 0||(X[Ce]=pe[Ce])}return"className"in G&&typeof G.className=="string"&&(X.className=vg(X.className,G.className)),X})(A,S,R),T=I.generateAndInjectStyles(W,z.styleSheet,z.stylis);let F=0;for(const q in S)sK.call(S,q)&&F++;H.current=[S,R,z.styleSheet,z.stylis,F,W,T,I]}}const L=W.as||j,M=(function(H,V,F,q){const G={};for(const Y in H)H[Y]===void 0||Y[0]==="$"||Y==="as"||Y==="theme"&&H.theme===F||(Y==="forwardedAs"?G.as=H.forwardedAs:q&&!q(Y,V)||(G[Y]=H[Y]));return G})(W,L,R,D);let Z=vg(O,P);return T&&(Z+=" "+T),W.className&&(Z+=" "+W.className),M[y$(L)&&L.includes("-")?"class":"className"]=Z,x&&(M.ref=x),N.createElement(L,M)})(b,v,_)}g.displayName=l;let b=Qe.forwardRef(g);return b.attrs=f,b.componentStyle=y,b.displayName=l,b.shouldForwardProp=p,b.foldedComponentIds=r?vg(i.foldedComponentIds,i.styledComponentId):"",b.styledComponentId=u,b.target=r?i.target:t,Object.defineProperty(b,"defaultProps",{get(){return this._foldedDefaultProps},set(v){this._foldedDefaultProps=r?(function(_,...C){for(const S of C)g$(_,S,!0);return _})({},i.defaultProps,v):v}}),_P(b,()=>`.${b.styledComponentId}`),s&&fle(b,t,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),b}var pst=new Set(["a","abbr","address","area","article","aside","audio","b","bdi","bdo","blockquote","body","button","br","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","map","mark","menu","meter","nav","object","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","slot","small","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","switch","symbol","text","textPath","tspan","use"]);function aK(t,e){const n=[t[0]];for(let r=0,i=e.length;r<i;r+=1)n.push(e[r],t[r+1]);return n}const oK=t=>(mle.add(t),t);function bm(t,...e){if(A5(t)||E6(t))return oK(x2(aK(gP,[t,...e])));const n=t;return e.length===0&&n.length===1&&typeof n[0]=="string"?x2(n):oK(x2(aK(n,e)))}function v$(t,e,n=N1){if(!e)throw S5(1,e);const r=(i,...s)=>t(e,n,bm(i,...s));return r.attrs=i=>v$(t,e,Object.assign(Object.assign({},n),{attrs:Array.prototype.concat(n.attrs,i).filter(Boolean)})),r.withConfig=i=>v$(t,e,Object.assign(Object.assign({},n),i)),r}const Ele=t=>v$(fst,t),mr=Ele;pst.forEach(t=>{mr[t]=Ele(t)});class mst{constructor(e,n){this.instanceRules=new Map,this.rules=e,this.componentId=n,this.isStatic=(function(r){for(let i=0;i<r.length;i+=1){const s=r[i];if(A5(s)&&!vP(s))return!1}return!0})(e),k5.registerId(this.componentId)}removeStyles(e,n){this.instanceRules.delete(e),this.rebuildGroup(n)}renderStyles(e,n,r,i){const s=this.componentId;if(this.isStatic){if(r.hasNameForId(s,s+e))this.instanceRules.has(e)||this.computeRules(e,n,r,i);else{const o=this.computeRules(e,n,r,i);r.insertRules(s,o.name,o.rules)}return}const a=this.instanceRules.get(e);if(this.computeRules(e,n,r,i),!r.server&&a){const o=a.rules,l=this.instanceRules.get(e).rules;if(o.length===l.length){let u=!0;for(let f=0;f<o.length;f++)if(o[f]!==l[f]){u=!1;break}if(u)return}}this.rebuildGroup(r)}computeRules(e,n,r,i){const s=kv(x2(this.rules,n,r,i)),a={name:this.componentId+e,rules:i(s,"")};return this.instanceRules.set(e,a),a}rebuildGroup(e){const n=this.componentId;e.clearRules(n);for(const r of this.instanceRules.values())e.insertRules(n,r.name,r.rules)}}function yst(t,...e){const n=bm(t,...e),r=`sc-global-${wP(JSON.stringify(n))}`,i=new mst(n,r),s=o=>{const l=Cle(),u=Qe.useContext(xP);let f;{const p=Qe.useRef(null);p.current===null&&(p.current=l.styleSheet.allocateGSInstance(r)),f=p.current}l.styleSheet.server&&a(f,o,l.styleSheet,u,l.stylis);{const p=i.isStatic?[f,l.styleSheet,i]:[f,o,l.styleSheet,u,l.stylis,i],y=Qe.useRef(i);Qe.useLayoutEffect(()=>{l.styleSheet.server||(y.current!==i&&(l.styleSheet.clearRules(r),y.current=i),a(f,o,l.styleSheet,u,l.stylis))},p),Qe.useLayoutEffect(()=>()=>{l.styleSheet.server||i.removeStyles(f,l.styleSheet)},[f,l.styleSheet,i])}return l.styleSheet.server&&i.instanceRules.delete(f),null};function a(o,l,u,f,p){if(i.isStatic)i.renderStyles(o,Lit,u,p);else{const y=Object.assign(Object.assign({},l),{theme:lle(l,f,s.defaultProps)});i.renderStyles(o,y,u,p)}}return Qe.memo(s)}var Sle;class gst{constructor(e,n){this[Sle]=!0,this.inject=(r,i=w$)=>{const s=this.getName(i);if(!r.hasNameForId(this.id,s)){const a=i(this.rules,s,"@keyframes");r.insertRules(this.id,s,a)}}
592,this.name=e,this.id=ole+e,this.rules=n,wg(this.id),_P(this,()=>{throw S5(12,String(this.name))})}getName(e=w$){return e.hash?this.name+bP(+e.hash>>>0):this.name}}function zbt(t,...e){const n=kv(bm(t,...e)),r=wP(n);return new gst(r,n)}Sle=yle;function bst({src:t,...e}){return h.jsx("img",{src:t,...e,style:{display:"none"}})}const Ale=N.createContext({currentScreen:null,lastScreen:null,navigate:Ae,navigateBack:Ae,resetNavigation:Ae,setModalData:Ae,onUserCloseViaDialogOrKeybindRef:void 0}),wst=t=>{var a;let e=Ts(),[n,r]=N.useState(t.initialScreen),i=N.useRef(null);N.useEffect((()=>{t.open||(i.current=null)}),[t.open]),N.useEffect((()=>{i.current=null}),[t.initialScreen]);let s={data:t.data,setModalData:t.setModalData,currentScreen:t.initialScreen,lastScreen:n,navigate:(o,l=!0)=>{t.setInitialScreen(o),l&&r(t.initialScreen)},navigateBack:()=>{t.setInitialScreen(n)},resetNavigation:()=>{t.setInitialScreen(null),r(null)},onUserCloseViaDialogOrKeybindRef:i};return h.jsxs(Ale.Provider,{value:s,children:[(typeof e.appearance.logo=="string"||((a=e.appearance.logo)==null?void 0:a.type)==="img")&&h.jsx(bst,{src:typeof e.appearance.logo=="string"?e.appearance.logo:e.appearance.logo.props.src}),t.children]})},R2=()=>N.useContext(Ale),vst={login:{onComplete:[],onError:[]},logout:{onSuccess:[]},connectWallet:{onSuccess:[],onError:[]},connectOrCreateWallet:{onSuccess:[],onError:[]},createWallet:{onSuccess:[],onError:[]},linkAccount:{onSuccess:[],onError:[]},update:{onSuccess:[],onError:[]},configureMfa:{onMfaRequired:[]},setWalletPassword:{onSuccess:[],onError:[]},setWalletRecovery:{onSuccess:[],onError:[]},signMessage:{onSuccess:[],onError:[]},signTypedData:{onSuccess:[],onError:[]},sendTransaction:{onSuccess:[],onError:[]},signTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]},oAuthAuthorization:{onOAuthTokenGrant:[]},fundWallet:{onUserExited:[]},fundSolanaWallet:{onUserExited:[]},customAuth:{onAuthenticated:[],onUnauthenticated:[]}},kle=N.createContext(void 0);let Tle=()=>N.useContext(kle);function Z2(t,e){if(!e)return;let n=Tle().current[t];return N.useEffect((()=>{var r;for(let[i,s]of Object.entries(e))Object.prototype.hasOwnProperty.call(n,i)||console.warn(`Invalid event type "${i}" for action "${t}"`),(r=n[i])==null||r.push(s);return()=>{var i;for(let[s,a]of Object.entries(e))Object.prototype.hasOwnProperty.call(n,s)||console.warn(`Invalid event type "${s}" for action "${t}"`),n[s]=(i=n[s])==null?void 0:i.filter((o=>o!==a))}}),[e])}function je(t,e,n,...r){for(let i of t.current[e][n])i(...r)}function tp(){let t=Tle();return(e,n,...r)=>je(t,e,n,...r)}const Of=Bo((()=>({user:null,authenticated:!1,hasResolvedInitialUser:!1}))),dr=t=>Of.setState({user:t}),_st=t=>Of.setState({authenticated:t}),xst=t=>Of.setState({hasResolvedInitialUser:t}),k9=(t,{chainType:e,walletIndex:n}={})=>(t==null?void 0:t.linkedAccounts.filter((r=>!(r.type!=="wallet"||r.walletClientType!=="privy"||n!==void 0&&r.walletIndex!==n||e!==void 0&&r.chainType!==e))))??[],C2=Bo((()=>({ethereumExternal:[],areExternalConnectorsReady:!1,ethereumEmbedded:[]}))),lK=t=>C2.setState({areExternalConnectorsReady:t}),CP=N.createContext(!1),Cst=()=>{if(N.useContext(CP))throw new ue("Multiple PrivyProvider instances found","Found multiple instances of PrivyProvider, ensure there is only one mounted in your application tree.")};function Est(){let t=N.useContext(CP),e=Br(),n=C2((p=>p.ethereumEmbedded)),r=C2((p=>p.ethereumExternal)),i=C2((p=>p.areExternalConnectorsReady)),s=Of((p=>p.user)),a=Of((p=>p.hasResolvedInitialUser)),o=N.useMemo((()=>[...n,...r].sort(((p,y)=>y.connectedAt-p.connectedAt))),[n,r]),l=k9(s,{chainType:"ethereum"}).length>0,u=n.length>0,f=!!i&&!!a&&!!e.walletProxy&&(!l||u);return t?N.useMemo((()=>({wallets:o,ready:f})),[o,f]):(console.warn("`useWallets` was called outside the PrivyProvider component"),{wallets:[],ready:!1})}const Tv=t=>{if(t.chainType==="ethereum")return{entropyId:t.address,entropyIdVerifier:"ethereum-address-verifier"};if(t.chainType==="solana")return{entropyId:t.address,entropyIdVerifier:"solana-address-ver
592ifier"};throw Error("Failed to get account entropy details")},a2=(t,e)=>{if(e!=null&&e.imported)return Tv(e);let n=l6(t);if(!n)throw Error("Failed to find primary wallet");return Tv(n)};function T9(t){return["ethereum","solana"].includes(t.chainType)}function Lle(t){let e=t.replace("eip155:","");if(e)return parseInt(e);throw Error("Chain ID not compatible with CAIP-2 format.")}const EP=t=>t.filter((e=>e.method==="wallets"||(e.method==="exchange"?e.provider==="coinbase":e.method==="card"||e.method==="payment-request"?e.provider==="coinbase"||e.provider==="moonpay":(e.method,!1)))),cK={[pc.id]:"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",[kI.id]:"0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",[Wf.id]:"0x0b2c639c533813f4aa9d7837caf62653d097ff85",[SI.id]:"0x5fd84259d66Cd46123540766Be93DFE6D43130D7",[mc.id]:"0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",[AI.id]:"0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582",[Hu.id]:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",[CI.id]:"0x036CbD53842c5426634e7929541eC2318f3dCF7e",[Vu.id]:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",[xI.id]:"0x5425890298aed601595a70ab815c96711a31bc65",[zu.id]:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",[_I.id]:"0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d",[Abe.id]:"0xb88339CB7199b77E23DB6E890353E22632Ba630f",[Z1.id]:"0x754704Bc059F8C67012fEd69BC8A327a5aafb603"},uK=({address:t,appConfig:e,fundWalletConfig:n,methodScreen:r,chainIdOverride:i,comingFromSendTransactionScreen:s=!1,onComplete:a,onError:o})=>{var C;let l,u;if(!e.fundingConfig)throw Error("Wallet funding is not enabled");let f=EP(e.fundingConfig.options);if(f.length<1)throw Error("Wallet funding is not enabled");l=i||(n!=null&&n.chain?n.chain.id:Lle(e.fundingConfig.defaultRecommendedCurrency.chain));let p=e.chains.find((S=>S.id===l));if(!p)throw new ue(`Funding chain ${l} is not in PrivyProvider chains list`);let y=(n==null?void 0:n.amount)??e.fundingConfig.defaultRecommendedAmount,g=!1;function b(){if(!l)return;let S=cK[l];f.find((x=>x.method==="wallets"))&&!S&&console.warn("Attempting to fund with USDC on chain where USDC address is not known. Funding via external wallet will be disabled."),u=S,g=!0}var v;n&&"asset"in n?n.asset==="USDC"?b():typeof n.asset!="string"&&"erc20"in n.asset&&(v=u=n.asset.erc20,g=v===cK[p.id]):e.fundingConfig.defaultRecommendedCurrency.asset==="USDC"&&b();let _=n==null?void 0:n.defaultFundingMethod;return{chainType:"ethereum",address:t,amount:y,chain:p,erc20Address:u,erc20ContractInfo:g?{symbol:"USDC",decimals:6}:void 0,isUSDC:g,methodScreen:r,supportedOptions:f,comingFromSendTransactionScreen:s,defaultFundingMethod:_,usingDefaultFundingMethod:!!_,preferredCardProvider:(C=n==null?void 0:n.card)==null?void 0:C.preferredProvider,crossChainBridgingEnabled:e.fundingConfig.crossChainBridgingEnabled??!1,solanaChain:"solana:mainnet",uiConfig:n&&"uiConfig"in n?n.uiConfig:void 0,externalSolanaFundingScreen:null,onComplete:a??(()=>{}),onError:o??(()=>{})}};function Vbt({address:t,fundWalletConfig:e,appConfig:n,comingFromSendTransactionScreen:r,externalSolanaFundingScreen:i,methodScreen:s}){var u;if(!n.fundingConfig)throw Error("Wallet funding is not enabled");let a=EP(n.fundingConfig.options);if(a.length<1)throw Error("Wallet funding is not enabled");let o=(e==null?void 0:e.amount)??n.fundingConfig.defaultRecommendedAmount,l=e==null?void 0:e.defaultFundingMethod;return{chainType:"solana",address:t,supportedOptions:a,amount:o,isUSDC:(e==null?void 0:e.asset)==="USDC",methodScreen:s,comingFromSendTransactionScreen:r,chain:(e==null?void 0:e.chain)||"solana:mainnet",crossChainBridgingEnabled:n.fundingConfig.crossChainBridgingEnabled??!1,defaultFundingMethod:l,preferredCardProvider:(u=e==null?void 0:e.card)==null?void 0:u.preferredProvider,usingDefaultFundingMethod:!!l,uiConfig:e==null?void 0:e.uiConfig,externalSolanaFundingScreen:i,onComplete:()=>{},onError:()=>{}}}function Sst(){let{user:t,getAccessToken:e}=Uo(),{walletProxy:n,openModal:r,client:i}=Br(),{setModalData:s}=R2(),a=Ts();return N.useMemo((()=>({exportWallet:o=>new Promise((async(l,u)=>{if(!t)return void u(Error("User must be authenticated before exporting their Privy wallet"));o&&"target"in o&&o&&(o=void 0);let f=o!=null&&o.address?x0(t,o.address):v2(t);if(!f)return void u(new ue("User must have an embedded wallet."));let p=f.address,{entropyId:y,entropyIdVerifier:g}=a2(t,f),b=Da(f);if(!p)return void u(Error("User does not have an HD Ethereum wallet. To export an imported wallet, pass the `address` of the wallet to `exportWallet`."));
592if(!Yn(p))return void u(Error("Must provide a valid Ethereum address."));let v={recoveryMethod:f.recoveryMethod,connectingWalletAddress:f.address,isUnifiedWallet:b,entropyId:y,entropyIdVerifier:g,onCompleteNavigateTo:"EmbeddedWalletKeyExportScreen",onFailure:u,shouldForceMFA:!0};await e()&&n?T9(f)?(s({keyExport:{appId:a.id,appClientId:a.appClientId,origin:i.apiUrl,address:f.address,entropyId:y,entropyIdVerifier:g,hdWalletIndex:f.walletIndex,chainType:f.chainType,walletId:f.id,isUnifiedWallet:b,imported:f.imported,onSuccess:l,onFailure:u,showBackButton:o==null?void 0:o.showBackButton},connectWallet:v}),r("EmbeddedWalletConnectingScreen")):u(Error(`Export is not supported for ${f.chainType} wallets`)):u(Error("Must have valid access token."))}))})),[t,e,n,r,i,s,a])}const Ast=()=>{let{authenticated:t,user:e}=Uo(),{openModal:n,inProgressAuthFlowRef:r,inProgressLoginOrLinkMethodRef:i}=Br(),s=tp();return{update:N.useCallback((()=>{if(!t)throw s("linkAccount","onError",Oe.MUST_BE_AUTHENTICATED,{linkMethod:"email"}),new ue("User must be authenticated before linking an account.");if(!(e!=null&&e.email))throw new ue("User does not have an email linked to their account.");r.current="update",i.current="email",n("UpdateEmailScreen")}),[t,s,r,i,n,e])}},kst=()=>{let{authenticated:t,user:e}=Uo(),{openModal:n,inProgressAuthFlowRef:r,inProgressLoginOrLinkMethodRef:i}=Br(),s=tp();return{update:N.useCallback((()=>{if(!t)throw s("linkAccount","onError",Oe.MUST_BE_AUTHENTICATED,{linkMethod:"sms"}),new ue("User must be authenticated before linking an account.");if(!(e!=null&&e.phone))throw new ue("User does not have a phone number linked to their account.");r.current="update",i.current="sms",n("UpdatePhoneScreen")}),[t,s,r,i,n,e])}},Tst=()=>{let{client:t,setUser:e}=Br();return{unlink:N.useCallback((async({address:n})=>{let r;return e(r=n.startsWith("0x")?await t.unlinkEthereumWallet(n):await t.unlinkSolanaWallet(n)),r}),[t,e])}},Lst=t=>{let[e,n]=N.useState("auto");return N.useEffect((()=>{let r=new ResizeObserver((i=>{var s;n(((s=i[0])==null?void 0:s.contentRect.height)??"auto")}));return t.current&&r.observe(t.current),()=>{t.current&&r.unobserve(t.current)}}),[t.current]),e},Hbt=mr.div` 593 text-align: left; 594 flex-grow: 1; 595`,Wbt=mr.div` 596 display: flex; 597 flex-direction: column; 598 justify-content: flex-end; 599 flex-grow: 1; 600`,$st=mr.div` 601 display: flex; 602 flex-direction: column; 603 gap: 8px; 604 605 /* for Internet Explorer, Edge */ 606 -ms-overflow-style: none; 607 608 /* for Firefox */ 609 scrollbar-width: none; 610 611 /* for Chrome, Safari, and Opera */ 612 &::-webkit-scrollbar {
613 display: none; 614 } 615`,qbt=mr($st)` 616 ${t=>t.$colorScheme==="light"?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0.06)) bottom;":t.$colorScheme==="dark"?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.06)) bottom;":void 0} 617 618 background-repeat: no-repeat; 619 background-size: 620 100% 32px, 621 100% 16px; 622 background-attachment: local, scroll; 623 max-height: 400px; 624 overflow-y: auto; 625 scrollbar-width: none; 626 padding: 3px; 627`;let $le=bm` 628 && { 629 width: 100%; 630 font-size: 16px; 631 line-height: 24px; 632 min-height: 56px; 633 634 /* Tablet and Up */ 635 @media (min-width: 440px) { 636 font-size: 14px; 637 } 638 639 display: flex; 640 gap: 12px; 641 align-items: center; 642 color: var(--privy-color-foreground); 643 644 padding: 10px 12px; 645 border: 1px solid var(--privy-color-foreground-4) !important; 646 border-radius: var(--privy-border-radius-md); 647 transition: background-color 200ms ease; 648 649 cursor: pointer; 650 651 &:hover { 652 background-color: var(--privy-color-background-2); 653 } 654 655 &:disabled { 656 cursor: pointer; 657 background-color: var(--privy-color-background-2); 658 } 659 } 660`;const Zbt=mr.div` 661 text-align: center; 662 font-size: 14px; 663 margin-bottom: 24px; 664`,Kbt=mr.button.attrs({className:"login-method-button"})` 665 ${$le} 666`;mr.a` 667 ${$le} 668`;const Gbt=mr.div` 669 width: 32px; 670 height: 32px; 671 border-radius: ${t=>t.$fullSize?"0":"4px"}; 672 background: ${t=>t.$fullSize?"transparent":"var(--privy-color-background-2)"}; 673 display: flex; 674 align-items: center; 675 justify-content: center; 676 flex-shrink: 0; 677 678 svg { 679 width: ${t=>t.$fullSize?"32px":"18px"}; 680 height: ${t=>t.$fullSize?"32px":"18px"}; 681 color: ${t=>t.$fullSize?"inherit":"var(--privy-color-icon-muted)"}; 682 } 683`,Ile=mr.div` 684 width: 100%; 685 height: 100%; 686 min-height: inherit; 687 display: flex; 688 flex-direction: column; 689 ${t=>t.$if?"display: none;":""} 690`,Ybt=mr.div` 691 width: 100%; 692 height: 100%; 693 padding: ${t=>t.$withPadding?"64px 0px":"0px"}; 694`,Jbt=mr.div` 695 display: flex; 696 flex-direction: column; 697 align-items: center; 698 justify-content: center; 699 margin-bottom: 32px; 700 gap: 12px; 701 & h3 { 702 font-size: 18px; 703 font-style: normal; 704 font-weight: 600; 705 line-height: 24px; 706 } 707 & p { 708 max-width: 300px; 709 font-size: 14px; 710 font-style: normal; 711 font-weight: 400; 712 line-height: 20px; 713 } 714`;async function Ist(t,e,n){if(!e.shouldEnforceDefaultChainOnConnect)return;let r=Number(t.chainId.replace("eip155:",""));if(!e.chains.find((i=>i.id===r))&&(t.connectorType!=="wallet_connect_v2"||t.walletClientType!=="metamask")){n==null||n();try{await t.switchChain(e.defaultChain.id),t.chainId=Pg(Dt(e.defaultChain.id))}catch{Ue.warn("Unable to switch to default chain after connect",{chainId:e.defaultChain.id})}}}let Nle=N.createContext({});const Nst=({children:t})=>{let e=Ts(),[n,r]=N.useState({});return Z2("login",{onComplete:({loginAccount:i})=>{i&&i.type!=="passkey"&&i.type!=="cross_app"&&(i.type!=="wallet"||i.walletClientType!=="privy")&&(vt.put(dK(e.id),i.type),i.type==="wallet"?(vt.put(sA(e.id),i.walletClientType),vt.put(aA(e.id),i.chainType),r({accountType:i.type,walletClientType:i.walletClientType,chainType:i.chainType})):(vt.del(sA(e.id)),vt.del(aA(e.id)),r({accountType:i.type})))}}),N.useEffect((()=>{if(!e.id)return;let i=vt.get(dK(e.id)),s=vt.get(sA(e.id)),a=vt.get(aA(e.id));i&&r(i==="wallet"?{accountType:i,walletClientType:s,chainType:a}:{accountType:i})}),[e.id]),h.jsx(Nle.Provider,{value:n,children:t})};let dK=t=>`privy:${t}:recent-login-method`,sA=t=>`privy:${t}:recent-login-wallet-client`,aA=t=>`privy:${t}:recent-login-chain-type`;const Xbt=()=>N.useContext(Nle),Ost=t=>{Z2("fundWallet",t);let{fundWallet:e}=Br();return{fundWallet:({address:n,options:r})=>e(n,r)}};function Qbt(t){let{logout:e}=N.useContext(Ku);return Z2("logout",t),{logout:e}}const Pst=Bo((()=>({isModalOpen:!1,resolvers:null})));Bo((()=>({})));const e4t=({address:t,client:e,appId:n})=>{let r=`${e}:${t}`;n&&vt.put(Rst(n),r),Pst.setState({wallet:r})},Rst=t=>`privy:${t}:active-wallet-connection`;var jst=Object.defineProperty,Mst=(t,e,n)=>e in t?jst(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,oA=(t,e,n)=>(Mst(t,typeof e!="symbol"?e+"":e,n),n);let Dst=class{constructor(){oA(this,"current",this.detect()),oA(this,"handoffState","pending"),oA(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>
vendor: 11,313 bytes, lines 714-717
714"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},rc=new Dst;function T5(t){var e;return rc.isServer?null:t==null?document:(e=t==null?void 0:t.ownerDocument)!=null?e:document}function Lv(t){var e,n;return rc.isServer?null:t==null?document:(n=(e=t==null?void 0:t.getRootNode)==null?void 0:e.call(t))!=null?n:document}function SP(t){var e,n;return(n=(e=Lv(t))==null?void 0:e.activeElement)!=null?n:null}function Ust(t){return SP(t)===t}function L9(t){typeof queueMicrotask=="function"?queueMicrotask(t):Promise.resolve().then(t).catch(e=>setTimeout(()=>{throw e}))}function Al(){let t=[],e={addEventListener(n,r,i,s){return n.addEventListener(r,i,s),e.add(()=>n.removeEventListener(r,i,s))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return e.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return e.requestAnimationFrame(()=>e.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return e.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return L9(()=>{r.current&&n[0]()}),e.add(()=>{r.current=!1})},style(n,r,i){let s=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:i}),this.add(()=>{Object.assign(n.style,{[r]:s})})},group(n){let r=Al();return n(r),this.add(()=>r.dispose())},add(n){return t.includes(n)||t.push(n),()=>{let r=t.indexOf(n);if(r>=0)for(let i of t.splice(r,1))i()}},dispose(){for(let n of t.splice(0))n()}};return e}function $9(){let[t]=N.useState(Al);return N.useEffect(()=>()=>t.dispose(),[t]),t}let ua=(t,e)=>{rc.isServer?N.useEffect(t,e):N.useLayoutEffect(t,e)};function np(t){let e=N.useRef(t);return ua(()=>{e.current=t},[t]),e}let rr=function(t){let e=np(t);return Qe.useCallback((...n)=>e.current(...n),[e])};function L5(t){return N.useMemo(()=>t,Object.values(t))}let Bst=N.createContext(void 0);function Fst(){return N.useContext(Bst)}function _$(...t){return Array.from(new Set(t.flatMap(e=>typeof e=="string"?e.split(" "):[]))).filter(Boolean).join(" ")}function Du(t,e,...n){if(t in e){let i=e[t];return typeof i=="function"?i(...n):i}let r=new Error(`Tried to handle "${t}" but there is no handler defined. Only defined handlers are: ${Object.keys(e).map(i=>`"${i}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Du),r}var $v=(t=>(t[t.None=0]="None",t[t.RenderStrategy=1]="RenderStrategy",t[t.Static=2]="Static",t))($v||{}),m2=(t=>(t[t.Unmount=0]="Unmount",t[t.Hidden=1]="Hidden",t))(m2||{});function Fo(){let t=Vst();return N.useCallback(e=>zst({mergeRefs:t,...e}),[t])}function zst({ourProps:t,theirProps:e,slot:n,defaultTag:r,features:i,visible:s=!0,name:a,mergeRefs:o}){o=o??Hst;let l=Ole(e,t);if(s)return lw(l,n,r,a,o);let u=i??0;if(u&2){let{static:f=!1,...p}=l;if(f)return lw(p,n,r,a,o)}if(u&1){let{unmount:f=!0,...p}=l;return Du(f?0:1,{0(){return null},1(){return lw({...p,hidden:!0,style:{display:"none"}},n,r,a,o)}})}return lw(l,n,r,a,o)}function lw(t,e={},n,r,i){let{as:s=n,children:a,refName:o="ref",...l}=lA(t,["unmount","static"]),u=t.ref!==void 0?{[o]:t.ref}:{},f=typeof a=="function"?a(e):a;f=Ple(f),"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(e)),l["aria-labelledby"]&&l["aria-labelledby"]===l.id&&(l["aria-labelledby"]=void 0);let p={};if(e){let y=!1,g=[];for(let[b,v]of Object.entries(e))typeof v=="boolean"&&(y=!0),v===!0&&g.push(b.replace(/([A-Z])/g,_=>`-${_.toLowerCase()}`));if(y){p["data-headlessui-state"]=g.join(" ");for(let b of g)p[`data-${b}`]=""}}if(qg(s)&&(Object.keys(Ih(l)).length>0||Object.keys(Ih(p)).length>0))if(!N.isValidElement(f)||Array.isArray(f)&&f.length>1||qst(f)){if(Object.keys(Ih(l)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(Ih(l)).concat(Object.keys(Ih(p))).map(y=>` - ${y}`).join(` 715`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(y=>` - ${y}`).join(` 716`)].join(` 717`))}else{let y=f.props,g=y==null?void 0:y.className,b=typeof g=="function"?(...C)=>_$(g(...C),l.className):_$(g,l.className),v=b?{className:b}:{},_=Ole(f.props,Ih(lA(l,["ref"])));for(let C in p)C in _&&delete p[C];return N.cloneElement(f,Object.assign({},_,p,u,{ref:i(Wst(f),u.ref)},v))}return N.createElement(s,Object.assign({},lA(l,["ref"]),!qg(s)&&u,!qg(s)&&p),f)}function Vst(){let t=N.useRef([]),e=N.useCallback(n=>{for(let r of t.current)r!=null&&(typeof r=="function"?r(n):r.current=n)},[]);return(...n)=>{if(!n.every(r=>r==null))return t.current=n,e}}function Hst(...t){return t.every(e=>e==null)?void 0:e=>{for(let n of t)n!=null&&(typeof n=="function"?n(e):n.current=e)}}function Ole(...t){if(t.length===0)return{};if(t.length===1)return t[0];let e={},n={};for(let r of t)for(let i in r)i.startsWith("on")&&typeof r[i]=="function"?(n[i]!=null||(n[i]=[]),n[i].push(r[i])):e[i]=r[i];if(e.disabled||e["aria-disabled"])for(let r in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r)&&(n[r]=[i=>{var s;return(s=i==null?void 0:i.preventDefault)==null?void 0:s.call(i)}]);for(let r in n)Object.assign(e,{[r](i,...s){let a=n[r];for(let o of a){if((i instanceof Event||(i==null?void 0:i.nativeEvent)instanceof Event)&&i.defaultPrevented)return;o(i,...s)}}});return e}function n4t(...t){if(t.length===0)return{};if(t.length===1)return t[0];let e={},n={};for(let r of t)for(let i in r)i.startsWith("on")&&typeof r[i]=="function"?(n[i]!=null||(n[i]=[]),n[i].push(r[i])):e[i]=r[i];for(let r in n)Object.assign(e,{[r](...i){let s=n[r];for(let a of s)a==null||a(...i)}});return e}function ya(t){var e;return Object.assign(N.forwardRef(t),{displayName:(e=t.displayName)!=null?e:t.name})}function Ih(t){let e=Object.assign({},t);for(let n in e)e[n]===void 0&&delete e[n];return e}function lA(t,e=[]){let n=Object.assign({},t);for(let r of e)r in n&&delete n[r];return n}function Wst(t){return Qe.version.split(".")[0]>="19"?t.props.ref:t.ref}function Ple(t){if(t!=null&&t.$$typeof===Symbol.for("react.lazy")){let e=t._payload;if(e!=null&&e.status==="fulfilled")return Ple(e.value)}return t}function qg(t){return t===N.Fragment||t===Symbol.for("react.fragment")}function qst(t){return qg(t.type)}let Zst="span";var Iv=(t=>(t[t.None=1]="None",t[t.Focusable=2]="Focusable",t[t.Hidden=4]="Hidden",t))(Iv||{});function Kst(t,e){var n;let{features:r=1,...i}=t,s={ref:e,"aria-hidden":(r&2)===2?!0:(n=i["aria-hidden"])!=null?n:void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return Fo()({ourProps:s,theirProps:i,slot:{},defaultTag:Zst,name:"Hidden"})}let x$=ya(Kst);function Gst(t){return typeof t!="object"||t===null?!1:"nodeType"in t}function ku(t){return Gst(t)&&"tagName"in t}function dc(t){return ku(t)&&"accessKey"in t}function _u(t){return ku(t)&&"tabIndex"in t}function Yst(t){return ku(t)&&"style"in t}function Jst(t){return dc(t)&&t.nodeName==="IFRAME"}function Xst(t){return dc(t)&&t.nodeName==="INPUT"}function r4t(t){return dc(t)&&t.nodeName==="LABEL"}function i4t(t){return dc(t)&&t.nodeName==="FIELDSET"}function s4t(t){return dc(t)&&t.nodeName==="LEGEND"}function a4t(t){return ku(t)?t.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]'):!1}let Rle=Symbol();function Qst(t,e=!0){return Object.assign(t,{[Rle]:e})}function vc(...t){let e=N.useRef(t);N.useEffect(()=>{e.current=t},[t]);let n=rr(r=>{for(let i of e.current)i!=null&&(typeof i=="function"?i(r):i.current=r)});return t.every(r=>r==null||(r==null?void 0:r[Rle]))?void 0:n}let AP=N.createContext(null);AP.displayName="DescriptionContext";function jle(){let t=N.useContext(AP);if(t===null){let e=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,jle),e}return t}function eat(){let[t,e]=N.useState([]);return[t.length>0?t.join(" "):void 0,N.useMemo(()=>function(n){let r=rr(s=>(e(a=>[...a,s]),()=>e(a=>{let o=a.slice(),l=o.indexOf(s);return l!==-1&&o.splice(l,1),o}))),i=N.useMemo(()=>({register:r,slot:n.slot,name:n.name,props:n.props,value:n.value}),[r,n.slot,n.name,n.props,n.value]);return Qe.createElement(AP.Provider,{value:i},n.children)},[e])]}let tat="p";function nat(t,e){let n=N.useId(),r=Fst(),{id:i=`headlessui-description-${n}`,...s}=t,a=jle(),o=vc(e);ua(()=>a.register(i),[i,a.register]);let l=L5({...a.slot,disabled:r||!1}),u={ref:o,...a.props,id:i};return Fo()({ourProps:u,theirProps:s,slot:l,defaultTag:tat,name:a.name||"Description"})}let rat=ya(nat),iat=Object.assign(rat,{});var Mle=(t=>(t.Space=" ",t.Enter="Enter",t.Escape="Escape",t.Backspace="Backspace",t.Delete="Delete",t.ArrowLeft="ArrowLeft",t.ArrowUp="ArrowUp",t.ArrowRight="ArrowRight",t.ArrowDown="ArrowDown",t.Home="Home",t.End="End",t.PageUp="PageUp",t.PageDown="PageDown",t.Tab="Tab",t))(Mle||{});let sat=N.createContext(()=>{});function aat({value:t,children:e}){return Qe.createElement(sat.Provider,{value:t},e)}let Dle=class extends Map{constructor(e){super(),this.factory=e}get(e){let n=super.get(e);return n===void 0&&(n=this.factory(e),this.set(e,n)),n}};var oat=Object.defineProperty,lat=(t,e,n)=>e in t?oat(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,cat=(t,e,n)=>(lat(t,e+"",n),n),Ule=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},ho=(t,e,n)=>(Ule(t,e,"read from private field"),n?n.call(t):e.get(t)),cA=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},hK=(t,e,n,r)=>(Ule(t,e,"write to private field"),e.set(t,n),n),Vl,_g,xg;let uat=class{constructor(e){cA(this,Vl,{}),cA(this,_g,new Dle(()=>new Set)),cA(this,xg,new Set),cat(this,"disposables",Al()),hK(this,Vl,e),rc.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return ho(this,Vl)}subscribe(e,n){if(rc.isServer)return()=>{};let r={selector:e,callback:n,current:e(ho(this,Vl))};return ho(this,xg).add(r),this.disposables.add(()=>{ho(this,xg).delete(r)})}on(e,n){return rc.isServer?()=>{}:(ho(this,_g).get(e).add(n),this.disposables.add(()=>{ho(this,_g).get(e).delete(n)}))}send(e){let n=this.reduce(ho(this,Vl),e);if(n!==ho(this,Vl)){hK(this,Vl,n);for(let r of ho(this,xg)){let i=r.selector(ho(this,Vl));Ble(r.current,i)||(r.current=i,r.callback(i))}for(let r of ho(this,_g).get(e.type))r(ho(this,Vl),e)}}};Vl=new WeakMap,_g=new WeakMap,xg=new WeakMap;function Ble(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null?!1:Array.isArray(t)&&Array.isArray(e)?t.length!==e.length?!1:uA(t[Symbol.iterator](),e[Symbol.iterator]()):t instanceof Map&&e instanceof Map||t instanceof Set&&e instanceof Set?t.size!==e.size?!1:uA(t.entries(),e.entries()):fK(t)&&fK(e)?uA(Object.entries(t)[Symbol.iterator](),Object.entries(e)[Symbol.iterator]()):!1}function uA(t,e){do{let n=t.next(),r=e.next();if(n.done&&r.done)return!0;
717if(n.done||r.done||!Object.is(n.value,r.value))return!1}while(!0)}function fK(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;let e=Object.getPrototypeOf(t);return e===null||Object.getPrototypeOf(e)===null}function c4t(t){let[e,n]=t(),r=Al();return(...i)=>{e(...i),r.dispose(),r.microTask(n)}}var dat=Object.defineProperty,hat=(t,e,n)=>e in t?dat(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,pK=(t,e,n)=>(hat(t,typeof e!="symbol"?e+"":e,n),n),fat=(t=>(t[t.Push=0]="Push",t[t.Pop=1]="Pop",t))(fat||{});let pat={0(t,e){let n=e.id,r=t.stack,i=t.stack.indexOf(n);if(i!==-1){let s=t.stack.slice();return s.splice(i,1),s.push(n),r=s,{...t,stack:r}}return{...t,stack:[...t.stack,n]}},1(t,e){let n=e.id,r=t.stack.indexOf(n);if(r===-1)return t;let i=t.stack.slice();return i.splice(r,1),{...t,stack:i}}},mat=class Fle extends uat{constructor(){super(...arguments),pK(this,"actions",{push:e=>this.send({type:0,id:e}),pop:e=>this.send({type:1,id:e})}),pK(this,"selectors",{isTop:(e,n)=>e.stack[e.stack.length-1]===n,inStack:(e,n)=>e.stack.includes(n)})}static new(){return new Fle({stack:[]})}reduce(e,n){return Du(n.type,pat,e,n)}};const zle=new Dle(()=>mat.new());var dA={exports:{}},hA={};/** 718 * @license React 719 * use-sync-external-store-with-selector.production.js 720 * 721 * Copyright (c) Meta Platforms, Inc. and affiliates. 722 * 723 * This source code is licensed under the MIT license found in the 724 * LICENSE file in the root directory of this source tree. 725 */var mK;function yat(){if(mK)return hA;mK=1;var t=B1();function e(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,i=t.useRef,s=t.useEffect,a=t.useMemo,o=t.useDebugValue;return hA.useSyncExternalStoreWithSelector=function(l,u,f,p,y){var g=i(null);if(g.current===null){var b={hasValue:!1,value:null};g.current=b}else b=g.current;g=a(function(){function _(I){if(!C){if(C=!0,S=I,I=p(I),y!==void 0&&b.hasValue){var $=b.value;if(y($,I))return x=$}return x=I}if($=x,n(S,I))return $;var O=p(I);return y!==void 0&&y($,O)?(S=I,$):(S=I,x=O)}var C=!1,S,x,A=f===void 0?null:f;return[function(){return _(u())},A===null?void 0:function(){return _(A())}]},[u,f,p,y]);var v=r(l,g[0],g[1]);return s(function(){b.hasValue=!0,b.value=v},[v]),o(v),v},hA}var yK;function gat(){return yK||(yK=1,dA.exports=yat()),dA.exports}var bat=gat();function Vle(t,e,n=Ble){return bat.useSyncExternalStoreWithSelector(rr(r=>t.subscribe(wat,r)),rr(()=>t.state),rr(()=>t.state),rr(e),n)}function wat(t){return t}function $5(t,e){let n=N.useId(),r=zle.get(e),[i,s]=Vle(r,N.useCallback(a=>[r.selectors.isTop(a,n),r.selectors.inStack(a,n)],[r,n]));return ua(()=>{if(t)return r.actions.push(n),()=>r.actions.pop(n)},[r,t,n]),t?s?i:!0:!1}let C$=new Map,Zg=new Map;function gK(t){var e;let n=(e=Zg.get(t))!=null?e:0;return Zg.set(t,n+1),n!==0?()=>bK(t):(C$.set(t,{"aria-hidden":t.getAttribute("aria-hidden"),inert:t.inert}),t.setAttribute("aria-hidden","true"),t.inert=!0,()=>bK(t))}function bK(t){var e;let n=(e=Zg.get(t))!=null?e:1;if(n===1?Zg.delete(t):Zg.set(t,n-1),n!==1)return;let r=C$.get(t);r&&(r["aria-hidden"]===null?t.removeAttribute("aria-hidden"):t.setAttribute("aria-hidden",r["aria-hidden"]),t.inert=r.inert,C$.delete(t))}function vat(t,{allowed:e,disallowed:n}={}){let r=$5(t,"inert-others");ua(()=>{var i,s;if(!r)return;let a=Al();for(let l of(i=n==null?void 0:n())!=null?i:[])l&&a.add(gK(l));let o=(s=e==null?void 0:e())!=null?s:[];for(let l of o){if(!l)continue;let u=T5(l);if(!u)continue;let f=l.parentElement;for(;f&&f!==u.body;){for(let p of f.children)o.some(y=>p.contains(y))||a.add(gK(p));f=f.parentElement}}return a.dispose},[r,e,n])}function _at(t,e,n){let r=np(i=>{let s=i.getBoundingClientRect();s.x===0&&s.y===0&&s.width===0&&s.height===0&&n()});N.useEffect(()=>{if(!t)return;let i=e===null?null:dc(e)?e:e.current;if(!i)return;let s=Al();if(typeof ResizeObserver<"u"){let a=new ResizeObserver(()=>r.current(i));a.observe(i),s.add(()=>a.disconnect())}if(typeof IntersectionObserver<"u"){let a=new IntersectionObserver(()=>r.current(i));a.observe(i),s.add(()=>a.disconnect())}return()=>s.dispose()},[e,r,t])}let Nv=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","details>summary","textarea:not([disabled])"].map(t=>`${t}:not([tabindex='-1'])`).join(","),xat=["[data-autofocus]"].map(t=>`${t}:not([tabindex='-1'])`).join(",");var mu=(t=>(t[t.First=1]="First",t[t.Previous=2]="Previous",t[t.Next=4]="Next",t[t.Last=8]="Last",t[t.WrapAround=16]="WrapAround",t[t.NoScroll=32]="NoScroll",t[t.AutoFocus=64]="AutoFocus",t))(mu||{}),E$=(t=>(t[t.Error=0]="Error",t[t.Overflow=1]="Overflow",t[t.Success=2]="Success",t[t.Underflow=3]="Underflow",t))(E$||{}),Cat=(t=>(t[t.Previous=-1]="Previous",t[t.Next=1]="Next",t))(Cat||{});function Hle(t=document.body){return t==null?[]:Array.from(t.querySelectorAll(Nv)).sort((e,n)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function Eat(t=document.body){return t==null?[]:Array.from(t.querySelectorAll(xat)).sort((e,n)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var Wle=(t=>(t[t.Strict=0]="Strict",t[t.Loose=1]="Loose",t))(Wle||{});function qle(t,e=0){var n;return t===((n=T5(t))==null?void 0:n.body)?!1:Du(e,{0(){return t.matches(Nv)},1(){let r=t;for(;r!==null;){if(r.matches(Nv))return!0;r=r.parentElement}return!1}})}function u4t(t){Al().nextFrame(()=>{let e=SP(t);e&&_u(e)&&!qle(e,0)&&ic(t)})}var Sat=(t=>(t[t.Keyboard=0]="Keyboard",t[t.Mouse=1]="Mouse",t))(Sat||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",t=>{t.metaKey||t.altKey||t.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",t=>{t.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:t.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function ic(t){t==null||t.focus({preventScroll:!0})}let Aat=["textarea","input"].join(",");function kat(t){var e,n;return(n=(e=t==null?void 0:t.matches)==null?void 0:e.call(t,Aat))!=null?n:!1}function Tat(t,e=n=>n){return t.slice().sort((n,r)=>{let i=e(n),s=e(r);if(i===null||s===null)return 0;let a=i.compareDocumentPosition(s);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function d4t(t,e,n=t===null?document.body:Lv(t)){return Q0(Hle(n),e,{relativeTo:t})}function Q0(t,e,{sorted:n=!0,relativeTo:r=null,skipElements:i=[]}={}){let s=Array.isArray(t)?t.length>0?Lv(t[0]):document:Lv(t),a=Array.isArray(t)?n?Tat(t):t:e&64?Eat(t):Hle(t);i.length>0&&a.length>1&&(a=a.filter(g=>!i.some(b=>b!=null&&"current"in b?(b==null?void 0:b.current)===g:b===g))),r=r??(s==null?void 0:s.activeElement);let o=(()=>
vendor: 10,178 bytes, lines 725-726
725{if(e&5)return 1;if(e&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=(()=>{if(e&1)return 0;if(e&2)return Math.max(0,a.indexOf(r))-1;if(e&4)return Math.max(0,a.indexOf(r))+1;if(e&8)return a.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=e&32?{preventScroll:!0}:{},f=0,p=a.length,y;do{if(f>=p||f+p<=0)return 0;let g=l+f;if(e&16)g=(g+p)%p;else{if(g<0)return 3;if(g>=p)return 1}y=a[g],y==null||y.focus(u),f+=o}while(y!==SP(y));return e&6&&kat(y)&&y.select(),2}function Zle(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Lat(){return/Android/gi.test(window.navigator.userAgent)}function wK(){return Zle()||Lat()}function cw(t,e,n,r){let i=np(n);N.useEffect(()=>{if(!t)return;function s(a){i.current(a)}return document.addEventListener(e,s,r),()=>document.removeEventListener(e,s,r)},[t,e,r])}function Kle(t,e,n,r){let i=np(n);N.useEffect(()=>{if(!t)return;function s(a){i.current(a)}return window.addEventListener(e,s,r),()=>window.removeEventListener(e,s,r)},[t,e,r])}const vK=30;function $at(t,e,n){let r=np(n),i=N.useCallback(function(o,l){if(o.defaultPrevented)return;let u=l(o);if(u===null||!u.getRootNode().contains(u)||!u.isConnected)return;let f=(function p(y){return typeof y=="function"?p(y()):Array.isArray(y)||y instanceof Set?y:[y]})(e);for(let p of f)if(p!==null&&(p.contains(u)||o.composed&&o.composedPath().includes(p)))return;return!qle(u,Wle.Loose)&&u.tabIndex!==-1&&o.preventDefault(),r.current(o,u)},[r,e]),s=N.useRef(null);cw(t,"pointerdown",o=>{var l,u;wK()||(s.current=((u=(l=o.composedPath)==null?void 0:l.call(o))==null?void 0:u[0])||o.target)},!0),cw(t,"pointerup",o=>{if(wK()||!s.current)return;let l=s.current;return s.current=null,i(o,()=>l)},!0);let a=N.useRef({x:0,y:0});cw(t,"touchstart",o=>{a.current.x=o.touches[0].clientX,a.current.y=o.touches[0].clientY},!0),cw(t,"touchend",o=>{let l={x:o.changedTouches[0].clientX,y:o.changedTouches[0].clientY};if(!(Math.abs(l.x-a.current.x)>=vK||Math.abs(l.y-a.current.y)>=vK))return i(o,()=>_u(o.target)?o.target:null)},!0),Kle(t,"blur",o=>i(o,()=>Jst(window.document.activeElement)?window.document.activeElement:null),!0)}function kP(...t){return N.useMemo(()=>T5(...t),[...t])}function Gle(t,e,n,r){let i=np(n);N.useEffect(()=>{t=t??window;function s(a){i.current(a)}return t.addEventListener(e,s,r),()=>t.removeEventListener(e,s,r)},[t,e,r])}function Iat(t){return N.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot)}function Nat(t,e){let n=t(),r=new Set;return{getSnapshot(){return n},subscribe(i){return r.add(i),()=>r.delete(i)},dispatch(i,...s){let a=e[i].call(n,...s);a&&(n=a,r.forEach(o=>o()))}}}function Oat(){let t;return{before({doc:e}){var n;let r=e.documentElement,i=(n=e.defaultView)!=null?n:window;t=Math.max(0,i.innerWidth-r.clientWidth)},after({doc:e,d:n}){let r=e.documentElement,i=Math.max(0,r.clientWidth-r.offsetWidth),s=Math.max(0,t-i);n.style(r,"paddingRight",`${s}px`)}}}function Pat(){return Zle()?{before({doc:t,d:e,meta:n}){function r(i){for(let s of n().containers)for(let a of s())if(a.contains(i))return!0;return!1}e.microTask(()=>{var i;if(window.getComputedStyle(t.documentElement).scrollBehavior!=="auto"){let o=Al();o.style(t.documentElement,"scrollBehavior","auto"),e.add(()=>e.microTask(()=>o.dispose()))}let s=(i=window.scrollY)!=null?i:window.pageYOffset,a=null;e.addEventListener(t,"click",o=>{if(_u(o.target))try{let l=o.target.closest("a");if(!l)return;let{hash:u}=new URL(l.href),f=t.querySelector(u);_u(f)&&!r(f)&&(a=f)}catch{}},!0),e.group(o=>{e.addEventListener(t,"touchstart",l=>{if(o.dispose(),_u(l.target)&&Yst(l.target))if(r(l.target)){let u=l.target;for(;u.parentElement&&r(u.parentElement);)u=u.parentElement;o.style(u,"overscrollBehavior","contain")}else o.style(l.target,"touchAction","none")})}),e.addEventListener(t,"touchmove",o=>{if(_u(o.target)){if(Xst(o.target))return;if(r(o.target)){let l=o.target;for(;l.parentElement&&l.dataset.headlessuiPortal!==""&&!(l.scrollHeight>l.clientHeight||l.scrollWidth>l.clientWidth);)l=l.parentElement;l.dataset.headlessuiPortal===""&&o.preventDefault()}else o.preventDefault()}},{passive:!1}),e.add(()=>{var o;let l=(o=window.scrollY)!=null?o:window.pageYOffset;s!==l&&window.scrollTo(0,s),a&&a.isConnected&&(a.scrollIntoView({block:"nearest"}),a=null)})})}}:{}}function Rat(){return{before({doc:t,d:e}){e.style(t.documentElement,"overflow","hidden")}}}function _K(t){let e={};for(let n of t)Object.assign(e,n(e));return e}let tf=Nat(()=>new Map,{PUSH(t,e){var n;let r=(n=this.get(t))!=null?n:{doc:t,count:0,d:Al(),meta:new Set,computedMeta:{}};return r.count++,r.meta.add(e),r.computedMeta=_K(r.meta),this.set(t,r),this},POP(t,e){let n=this.get(t);return n&&(n.count--,n.meta.delete(e),n.computedMeta=_K(n.meta)),this},SCROLL_PREVENT(t){let e={doc:t.doc,d:t.d,meta(){return t.computedMeta}},n=[Pat(),Oat(),Rat()];n.forEach(({before:r})=>r==null?void 0:r(e)),n.forEach(({after:r})=>r==null?void 0:r(e))},SCROLL_ALLOW({d:t}){t.dispose()},TEARDOWN({doc:t}){this.delete(t)}});tf.subscribe(()=>{let t=tf.getSnapshot(),e=new Map;for(let[n]of t)e.set(n,n.documentElement.style.overflow);for(let n of t.values()){let r=e.get(n.doc)==="hidden",i=n.count!==0;(i&&!r||!i&&r)&&tf.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&tf.dispatch("TEARDOWN",n)}});function jat(t,e,n=()=>({containers:[]})){let r=Iat(tf),i=e?r.get(e):void 0,s=i?i.count>0:!1;return ua(()=>{if(!(!e||!t))return tf.dispatch("PUSH",e,n),()=>tf.dispatch("POP",e,n)},[t,e]),s}function Mat(t,e,n=()=>[document.body]){let r=$5(t,"scroll-lock");jat(r,e,i=>{var s;return{containers:[...(s=i.containers)!=null?s:[],n]}})}function Dat(t=0){let[e,n]=N.useState(t),r=N.useCallback(l=>n(l),[]),i=N.useCallback(l=>n(u=>u|l),[]),s=N.useCallback(l=>(e&l)===l,[e]),a=N.useCallback(l=>n(u=>u&~l),[]),o=N.useCallback(l=>n(u=>u^l),[]);return{flags:e,setFlag:r,addFlag:i,hasFlag:s,removeFlag:a,toggleFlag:o}}var Uat={},xK,CK;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((xK=process==null?void 0:Uat)==null?void 0:xK.NODE_ENV)==="test"&&typeof((CK=Element==null?void 0:Element.prototype)==null?void 0:CK.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(` 726`)),[]});var Bat=(t=>(t[t.None=0]="None",t[t.Closed=1]="Closed",t[t.Enter=2]="Enter",t[t.Leave=4]="Leave",t))(Bat||{});function Fat(t){let e={};for(let n in t)t[n]===!0&&(e[`data-${n}`]="");return e}function zat(t,e,n,r){let[i,s]=N.useState(n),{hasFlag:a,addFlag:o,removeFlag:l}=Dat(t&&i?3:0),u=N.useRef(!1),f=N.useRef(!1),p=$9();return ua(()=>{var y;if(t){if(n&&s(!0),!e){n&&o(3);return}return(y=r==null?void 0:r.start)==null||y.call(r,n),Vat(e,{inFlight:u,prepare(){f.current?f.current=!1:f.current=u.current,u.current=!0,!f.current&&(n?(o(3),l(4)):(o(4),l(2)))},run(){f.current?n?(l(3),o(4)):(l(4),o(3)):n?l(1):o(1)},done(){var g;f.current&&qat(e)||(u.current=!1,l(7),n||s(!1),(g=r==null?void 0:r.end)==null||g.call(r,n))}})}},[t,n,e,p]),t?[i,{closed:a(1),enter:a(2),leave:a(4),transition:a(2)||a(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function Vat(t,{prepare:e,run:n,done:r,inFlight:i}){let s=Al();return Wat(t,{prepare:e,inFlight:i}),s.nextFrame(()=>{n(),s.requestAnimationFrame(()=>{s.add(Hat(t,r))})}),s.dispose}function Hat(t,e){var n,r;let i=Al();if(!t)return i.dispose;let s=!1;i.add(()=>{s=!0});let a=(r=(n=t.getAnimations)==null?void 0:n.call(t).filter(o=>o instanceof CSSTransition))!=null?r:[];return a.length===0?(e(),i.dispose):(Promise.allSettled(a.map(o=>o.finished)).then(()=>{s||e()}),i.dispose)}function Wat(t,{inFlight:e,prepare:n}){if(e!=null&&e.current){n();return}let r=t.style.transition;t.style.transition="none",n(),t.offsetHeight,t.style.transition=r}function qat(t){var e,n;return((n=(e=t.getAnimations)==null?void 0:e.call(t))!=null?n:[]).some(r=>r instanceof CSSTransition&&r.playState!=="finished")}function TP(t,e){let n=N.useRef([]),r=rr(t);N.useEffect(()=>{let i=[...n.current];for(let[s,a]of e.entries())if(n.current[s]!==a){let o=r(e,i);return n.current=e,o}},[r,...e])}let I9=N.createContext(null);I9.displayName="OpenClosedContext";var pl=(t=>(t[t.Open=1]="Open",t[t.Closed=2]="Closed",t[t.Closing=4]="Closing",t[t.Opening=8]="Opening",t))(pl||{});function N9(){return N.useContext(I9)}function Zat({value:t,children:e}){return Qe.createElement(I9.Provider,{value:t},e)}function Kat({children:t}){return Qe.createElement(I9.Provider,{value:null},t)}function Gat(t){function e(){document.readyState!=="loading"&&(t(),document.removeEventListener("DOMContentLoaded",e))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",e),e())}let o2=[];Gat(()=>{function t(e){if(!_u(e.target)||e.target===document.body||o2[0]===e.target)return;let n=e.target;n=n.closest(Nv),o2.unshift(n??e.target),o2=o2.filter(r=>r!=null&&r.isConnected),o2.splice(10)}window.addEventListener("click",t,{capture:!0}),window.addEventListener("mousedown",t,{capture:!0}),window.addEventListener("focus",t,{capture:!0}),document.body.addEventListener("click",t,{capture:!0}),document.body.addEventListener("mousedown",t,{capture:!0}),document.body.addEventListener("focus",t,{capture:!0})});function Yle(t){let e=rr(t),n=N.useRef(!1);N.useEffect(()=>(n.current=!1,()=>{n.current=!0,L9(()=>{n.current&&e()})}),[e])}function Yat(){let t=typeof document>"u";return"useSyncExternalStore"in PD?(e=>e.useSyncExternalStore)(PD)(()=>()=>{},()=>!1,()=>!t):!1}function I5(){let t=Yat(),[e,n]=N.useState(rc.isHandoffComplete);return e&&rc.isHandoffComplete===!1&&n(!1),N.useEffect(()=>{e!==!0&&n(!0)},[e]),N.useEffect(()=>rc.handoff(),[]),t?!1:e}let Jle=N.createContext(!1);function Jat(){return N.useContext(Jle)}function EK(t){return Qe.createElement(Jle.Provider,{value:t.force},t.children)}
726function Xat(t){let e=Jat(),n=N.useContext(Qle),[r,i]=N.useState(()=>{var s;if(!e&&n!==null)return(s=n.current)!=null?s:null;if(rc.isServer)return null;let a=t==null?void 0:t.getElementById("headlessui-portal-root");if(a)return a;if(t===null)return null;let o=t.createElement("div");return o.setAttribute("id","headlessui-portal-root"),t.body.appendChild(o)});return N.useEffect(()=>{r!==null&&(t!=null&&t.body.contains(r)||t==null||t.body.appendChild(r))},[r,t]),N.useEffect(()=>{e||n!==null&&i(n.current)},[n,i,e]),r}let Xle=N.Fragment,Qat=ya(function(t,e){let{ownerDocument:n=null,...r}=t,i=N.useRef(null),s=vc(Qst(g=>{i.current=g}),e),a=kP(i.current),o=n??a,l=Xat(o),u=N.useContext(S$),f=$9(),p=I5(),y=Fo();return Yle(()=>{var g;l&&l.childNodes.length<=0&&((g=l.parentElement)==null||g.removeChild(l))}),!l||!p?null:yu.createPortal(Qe.createElement("div",{"data-headlessui-portal":"",ref:g=>{f.dispose(),u&&g&&f.add(u.register(g))}},y({ourProps:{ref:s},theirProps:r,slot:{},defaultTag:Xle,name:"Portal"})),l)});function eot(t,e){let n=vc(e),{enabled:r=!0,ownerDocument:i,...s}=t,a=Fo();return r?Qe.createElement(Qat,{...s,ownerDocument:i,ref:n}):a({ourProps:{ref:n},theirProps:s,slot:{},defaultTag:Xle,name:"Portal"})}let tot=N.Fragment,Qle=N.createContext(null);function not(t,e){let{target:n,...r}=t,i={ref:vc(e)},s=Fo();return Qe.createElement(Qle.Provider,{value:n},s({ourProps:i,theirProps:r,defaultTag:tot,name:"Popover.Group"}))}let S$=N.createContext(null);function rot(){let t=N.useContext(S$),e=N.useRef([]),n=rr(s=>(e.current.push(s),t&&t.register(s),()=>r(s))),r=rr(s=>{let a=e.current.indexOf(s);a!==-1&&e.current.splice(a,1),t&&t.unregister(s)}),i=N.useMemo(()=>({register:n,unregister:r,portals:e}),[n,r,e]);return[e,N.useMemo(()=>function({children:s}){return Qe.createElement(S$.Provider,{value:i},s)},[i])]}let iot=ya(eot),ece=ya(not),sot=Object.assign(iot,{Group:ece});function aot(t,e=typeof document<"u"?document.defaultView:null,n){let r=$5(t,"escape");Gle(e,"keydown",i=>{r&&(i.defaultPrevented||i.key===Mle.Escape&&n(i))})}function oot(){var t;let[e]=N.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[n,r]=N.useState((t=e==null?void 0:e.matches)!=null?t:!1);return ua(()=>{if(!e)return;function i(s){r(s.matches)}return e.addEventListener("change",i),()=>e.removeEventListener("change",i)},[e]),n}function lot({defaultContainers:t=[],portals:e,mainTreeNode:n}={}){let r=rr(()=>{var i,s;let a=T5(n),o=[];for(let l of t)l!==null&&(ku(l)?o.push(l):"current"in l&&ku(l.current)&&o.push(l.current));if(e!=null&&e.current)for(let l of e.current)o.push(l);for(let l of(i=a==null?void 0:a.querySelectorAll("html > *, body > *"))!=null?i:[])l!==document.body&&l!==document.head&&ku(l)&&l.id!=="headlessui-portal-root"&&(n&&(l.contains(n)||l.contains((s=n==null?void 0:n.getRootNode())==null?void 0:s.host))||o.some(u=>l.contains(u))||o.push(l));return o}
vendor: 5,606 bytes, line 726
726);return{resolveContainers:r,contains:rr(i=>r().some(s=>s.contains(i)))}}let tce=N.createContext(null);function SK({children:t,node:e}){let[n,r]=N.useState(null),i=nce(e??n);return Qe.createElement(tce.Provider,{value:i},t,i===null&&Qe.createElement(x$,{features:Iv.Hidden,ref:s=>{var a,o;if(s){for(let l of(o=(a=T5(s))==null?void 0:a.querySelectorAll("html > *, body > *"))!=null?o:[])if(l!==document.body&&l!==document.head&&ku(l)&&l!=null&&l.contains(s)){r(l);break}}}}))}function nce(t=null){var e;return(e=N.useContext(tce))!=null?e:t}function LP(){let t=N.useRef(!1);return ua(()=>(t.current=!0,()=>{t.current=!1}),[]),t}var Cg=(t=>(t[t.Forwards=0]="Forwards",t[t.Backwards=1]="Backwards",t))(Cg||{});function cot(){let t=N.useRef(0);return Kle(!0,"keydown",e=>{e.key==="Tab"&&(t.current=e.shiftKey?1:0)},!0),t}function rce(t){if(!t)return new Set;if(typeof t=="function")return new Set(t());let e=new Set;for(let n of t.current)ku(n.current)&&e.add(n.current);return e}let uot="div";var zh=(t=>(t[t.None=0]="None",t[t.InitialFocus=1]="InitialFocus",t[t.TabLock=2]="TabLock",t[t.FocusLock=4]="FocusLock",t[t.RestoreFocus=8]="RestoreFocus",t[t.AutoFocus=16]="AutoFocus",t))(zh||{});function dot(t,e){let n=N.useRef(null),r=vc(n,e),{initialFocus:i,initialFocusFallback:s,containers:a,features:o=15,...l}=t;I5()||(o=0);let u=kP(n.current);mot(o,{ownerDocument:u});let f=yot(o,{ownerDocument:u,container:n,initialFocus:i,initialFocusFallback:s});got(o,{ownerDocument:u,container:n,containers:a,previousActiveElement:f});let p=cot(),y=rr(S=>{if(!dc(n.current))return;let x=n.current;(A=>A())(()=>{Du(p.current,{[Cg.Forwards]:()=>{Q0(x,mu.First,{skipElements:[S.relatedTarget,s]})},[Cg.Backwards]:()=>{Q0(x,mu.Last,{skipElements:[S.relatedTarget,s]})}})})}),g=$5(!!(o&2),"focus-trap#tab-lock"),b=$9(),v=N.useRef(!1),_={ref:r,onKeyDown(S){S.key=="Tab"&&(v.current=!0,b.requestAnimationFrame(()=>{v.current=!1}))},onBlur(S){if(!(o&4))return;let x=rce(a);dc(n.current)&&x.add(n.current);let A=S.relatedTarget;_u(A)&&A.dataset.headlessuiFocusGuard!=="true"&&(ice(x,A)||(v.current?Q0(n.current,Du(p.current,{[Cg.Forwards]:()=>mu.Next,[Cg.Backwards]:()=>mu.Previous})|mu.WrapAround,{relativeTo:S.target}):_u(S.target)&&ic(S.target)))}},C=Fo();return Qe.createElement(Qe.Fragment,null,g&&Qe.createElement(x$,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:y,features:Iv.Focusable}),C({ourProps:_,theirProps:l,defaultTag:uot,name:"FocusTrap"}),g&&Qe.createElement(x$,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:y,features:Iv.Focusable}))}let hot=ya(dot),fot=Object.assign(hot,{features:zh});function pot(t=!0){let e=N.useRef(o2.slice());return TP(([n],[r])=>{r===!0&&n===!1&&L9(()=>{e.current.splice(0)}),r===!1&&n===!0&&(e.current=o2.slice())},[t,o2,e]),rr(()=>{var n;return(n=e.current.find(r=>r!=null&&r.isConnected))!=null?n:null})}function mot(t,{ownerDocument:e}){let n=!!(t&8),r=pot(n);TP(()=>{n||Ust(e==null?void 0:e.body)&&ic(r())},[n]),Yle(()=>{n&&ic(r())})}function yot(t,{ownerDocument:e,container:n,initialFocus:r,initialFocusFallback:i}){let s=N.useRef(null),a=$5(!!(t&1),"focus-trap#initial-focus"),o=LP();return TP(()=>{if(t===0)return;if(!a){i!=null&&i.current&&ic(i.current);return}let l=n.current;l&&L9(()=>{if(!o.current)return;let u=e==null?void 0:e.activeElement;if(r!=null&&r.current){if((r==null?void 0:r.current)===u){s.current=u;return}}else if(l.contains(u)){s.current=u;return}if(r!=null&&r.current)ic(r.current);else{if(t&16){if(Q0(l,mu.First|mu.AutoFocus)!==E$.Error)return}else if(Q0(l,mu.First)!==E$.Error)return;if(i!=null&&i.current&&(ic(i.current),(e==null?void 0:e.activeElement)===i.current))return;console.warn("There are no focusable elements inside the <FocusTrap />")}s.current=e==null?void 0:e.activeElement})},[i,a,t]),s}function got(t,{ownerDocument:e,container:n,containers:r,previousActiveElement:i}){let s=LP(),a=!!(t&4);Gle(e==null?void 0:e.defaultView,"focus",o=>{if(!a||!s.current)return;let l=rce(r);dc(n.current)&&l.add(n.current);let u=i.current;if(!u)return;let f=o.target;dc(f)?ice(l,f)?(i.current=f,ic(f)):(o.preventDefault(),o.stopPropagation(),ic(u)):ic(i.current)},!0)}function ice(t,e){for(let n of t)if(n.contains(e))return!0;return!1}function sce(t){var e;return!!(t.enter||t.enterFrom||t.enterTo||t.leave||t.leaveFrom||t.leaveTo)||!qg((e=t.as)!=null?e:oce)||Qe.Children.count(t.children)===1}let O9=N.createContext(null);O9.displayName="TransitionContext";var bot=(t=>(t.Visible="visible",t.Hidden="hidden",t))(bot||{});function wot(){let t=N.useContext(O9);if(t===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return t}function vot(){let t=N.useContext(P9);if(t===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return t}let P9=N.createContext(null);P9.displayName="NestingContext";function R9(t){return"children"in t?R9(t.children):t.current.filter(({el:e})=>e.current!==null).filter(({state:e})=>e==="visible").length>0}function ace(t,e){let n=np(t),r=N.useRef([]),i=LP(),s=$9(),a=rr((g,b=m2.Hidden)=>{let v=r.current.findIndex(({el:_})=>_===g);v!==-1&&(Du(b,{[m2.Unmount](){r.current.splice(v,1)},[m2.Hidden](){r.current[v].state="hidden"}}),s.microTask(()=>{var _;!R9(r)&&i.current&&((_=n.current)==null||_.call(n))}))}),o=rr(g=>{let b=r.current.find(({el:v})=>v===g);return b?b.state!=="visible"&&(b.state="visible"):r.current.push({el:g,state:"visible"}),()=>a(g,m2.Unmount)}),l=N.useRef([]),u=N.useRef(Promise.resolve()),f=N.useRef({enter:[],leave:[]}
vendor: 9,755 bytes, lines 726-797
726),p=rr((g,b,v)=>{l.current.splice(0),e&&(e.chains.current[b]=e.chains.current[b].filter(([_])=>_!==g)),e==null||e.chains.current[b].push([g,new Promise(_=>{l.current.push(_)})]),e==null||e.chains.current[b].push([g,new Promise(_=>{Promise.all(f.current[b].map(([C,S])=>S)).then(()=>_())})]),b==="enter"?u.current=u.current.then(()=>e==null?void 0:e.wait.current).then(()=>v(b)):v(b)}),y=rr((g,b,v)=>{Promise.all(f.current[b].splice(0).map(([_,C])=>C)).then(()=>{var _;(_=l.current.shift())==null||_()}).then(()=>v(b))});return N.useMemo(()=>({children:r,register:o,unregister:a,onStart:p,onStop:y,wait:u,chains:f}),[o,a,r,p,y,f,u])}let oce=N.Fragment,lce=$v.RenderStrategy;function _ot(t,e){var n,r;let{transition:i=!0,beforeEnter:s,afterEnter:a,beforeLeave:o,afterLeave:l,enter:u,enterFrom:f,enterTo:p,entered:y,leave:g,leaveFrom:b,leaveTo:v,..._}=t,[C,S]=N.useState(null),x=N.useRef(null),A=sce(t),I=vc(...A?[x,e,S]:e===null?[]:[e]),$=(n=_.unmount)==null||n?m2.Unmount:m2.Hidden,{show:O,appear:P,initial:j}=wot(),[U,z]=N.useState(O?"visible":"hidden"),D=vot(),{register:R,unregister:W}=D;ua(()=>R(x),[R,x]),ua(()=>{if($===m2.Hidden&&x.current){if(O&&U!=="visible"){z("visible");return}return Du(U,{hidden:()=>W(x),visible:()=>R(x)})}},[U,x,R,W,O,$]);let T=I5();ua(()=>{if(A&&T&&U==="visible"&&x.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[x,U,T,A]);let L=j&&!P,M=P&&O&&j,Z=N.useRef(!1),H=ace(()=>{Z.current||(z("hidden"),W(x))},D),V=rr(ie=>{Z.current=!0;let se=ie?"enter":"leave";H.onStart(x,se,pe=>{pe==="enter"?s==null||s():pe==="leave"&&(o==null||o())})}),F=rr(ie=>{let se=ie?"enter":"leave";Z.current=!1,H.onStop(x,se,pe=>{pe==="enter"?a==null||a():pe==="leave"&&(l==null||l())}),se==="leave"&&!R9(H)&&(z("hidden"),W(x))});N.useEffect(()=>{A&&i||(V(O),F(O))},[O,A,i]);let q=!(!i||!A||!T||L),[,G]=zat(q,C,O,{start:V,end:F}),Y=Ih({ref:I,className:((r=_$(_.className,M&&u,M&&f,G.enter&&u,G.enter&&G.closed&&f,G.enter&&!G.closed&&p,G.leave&&g,G.leave&&!G.closed&&b,G.leave&&G.closed&&v,!G.transition&&O&&y))==null?void 0:r.trim())||void 0,...Fat(G)}),X=0;U==="visible"&&(X|=pl.Open),U==="hidden"&&(X|=pl.Closed),O&&U==="hidden"&&(X|=pl.Opening),!O&&U==="visible"&&(X|=pl.Closing);let te=Fo();return Qe.createElement(P9.Provider,{value:H},Qe.createElement(Zat,{value:X},te({ourProps:Y,theirProps:_,defaultTag:oce,features:lce,visible:U==="visible",name:"Transition.Child"})))}function xot(t,e){let{show:n,appear:r=!1,unmount:i=!0,...s}=t,a=N.useRef(null),o=sce(t),l=vc(...o?[a,e]:e===null?[]:[e]);I5();let u=N9();if(n===void 0&&u!==null&&(n=(u&pl.Open)===pl.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[f,p]=N.useState(n?"visible":"hidden"),y=ace(()=>{n||p("hidden")}),[g,b]=N.useState(!0),v=N.useRef([n]);ua(()=>{g!==!1&&v.current[v.current.length-1]!==n&&(v.current.push(n),b(!1))},[v,n]);let _=N.useMemo(()=>({show:n,appear:r,initial:g}),[n,r,g]);ua(()=>{n?p("visible"):!R9(y)&&a.current!==null&&p("hidden")},[n,y]);let C={unmount:i},S=rr(()=>{var I;g&&b(!1),(I=t.beforeEnter)==null||I.call(t)}),x=rr(()=>{var I;g&&b(!1),(I=t.beforeLeave)==null||I.call(t)}),A=Fo();return Qe.createElement(P9.Provider,{value:y},Qe.createElement(O9.Provider,{value:_},A({ourProps:{...C,as:N.Fragment,children:Qe.createElement(cce,{ref:l,...C,...s,beforeEnter:S,beforeLeave:x})},theirProps:{},defaultTag:N.Fragment,features:lce,visible:f==="visible",name:"Transition"})))}function Cot(t,e){let n=N.useContext(O9)!==null,r=N9()!==null;return Qe.createElement(Qe.Fragment,null,!n&&r?Qe.createElement(A$,{ref:e,...t}):Qe.createElement(cce,{ref:e,...t}))}let A$=ya(xot),cce=ya(_ot),S6=ya(Cot),uce=Object.assign(A$,{Child:S6,Root:A$});var Eot=(t=>(t[t.Open=0]="Open",t[t.Closed=1]="Closed",t))(Eot||{}),Sot=(t=>(t[t.SetTitleId=0]="SetTitleId",t))(Sot||{});let Aot={0(t,e){return t.titleId===e.id?t:{...t,titleId:e.id}}},$P=N.createContext(null);$P.displayName="DialogContext";function j9(t){let e=N.useContext($P);if(e===null){let n=new Error(`<${t} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,j9),n}return e}function kot(t,e){return Du(e.type,Aot,t,e)}let AK=ya(function(t,e){let n=N.useId(),{id:r=`headlessui-dialog-${n}`,open:i,onClose:s,initialFocus:a,role:o="dialog",autoFocus:l=!0,__demoMode:u=!1,unmount:f=!1,...p}=t,y=N.useRef(!1);o=(function(){return o==="dialog"||o==="alertdialog"?o:(y.current||(y.current=!0,console.warn(`Invalid role [${o}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")})();let g=N9();i===void 0&&g!==null&&(i=(g&pl.Open)===pl.Open);let b=N.useRef(null),v=vc(b,e),_=kP(b.current),C=i?0:1,[S,x]=N.useReducer(kot,{titleId:null,descriptionId:null,panelRef:N.createRef()}),A=rr(()=>s(!1)),I=rr(G=>x({type:0,id:G})),$=I5()?C===0:!1,[O,P]=rot(),j={get current(){var G;return(G=S.panelRef.current)!=null?G:b.current}},U=nce(),{resolveContainers:z}=lot({mainTreeNode:U,portals:O,defaultContainers:[j]}),D=g!==null?(g&pl.Closing)===pl.Closing:!1;vat(u||D?!1:$,{allowed:rr(()=>{var G,Y;return[(Y=(G=b.current)==null?void 0:G.closest("[data-headlessui-portal]"))!=null?Y:null]}),disallowed:rr(()=>{var G;return[(G=U==null?void 0:U.closest("body > *:not(#headlessui-portal-root)"))!=null?G:null]})});let R=zle.get(null);ua(()=>{if($)return R.actions.push(r),()=>R.actions.pop(r)},[R,r,$]);let W=Vle(R,N.useCallback(G=>R.selectors.isTop(G,r),[R,r]));$at(W,z,G=>{G.preventDefault(),A()}),aot(W,_==null?void 0:_.defaultView,G=>{G.preventDefault(),G.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),A()}),Mat(u||D?!1:$,_,z),_at($,b,A);let[T,L]=eat(),M=N.useMemo(()=>[{dialogState:C,close:A,setTitleId:I,unmount:f},S],[C,A,I,f,S]),Z=L5({open:C===0}),H={ref:v,id:r,role:o,tabIndex:-1,"aria-modal":u?void 0:C===0?!0:void 0,"aria-labelledby":S.titleId,"aria-describedby":T,unmount:f},V=!oot(),F=zh.None;$&&!u&&(F|=zh.RestoreFocus,F|=zh.TabLock,l&&(F|=zh.AutoFocus),V&&(F|=zh.InitialFocus));let q=Fo();return Qe.createElement(Kat,null,Qe.createElement(EK,{force:!0},Qe.createElement(sot,null,Qe.createElement($P.Provider,{value:M},Qe.createElement(ece,{target:b},Qe.createElement(EK,{force:!1},Qe.createElement(L,{slot:Z},Qe.createElement(P,null,Qe.createElement(fot,{initialFocus:a,initialFocusFallback:b,containers:z,features:F},Qe.createElement(aat,{value:A},q({ourProps:H,theirProps:p,slot:Z,defaultTag:Tot,features:Lot,visible:C===0,name:"Dialog"})))))))))))}),Tot="div",Lot=$v.RenderStrategy|$v.Static;function $ot(t,e){let{transition:n=!1,open:r,...i}=t,s=N9(),a=t.hasOwnProperty("open")||s!==null,o=t.hasOwnProperty("onClose");if(!a&&!o)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!a)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!o)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!s&&typeof t.open!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${t.open}`);if(typeof t.onClose!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${t.onClose}`);return(r!==void 0||n)&&!i.static?Qe.createElement(SK,null,Qe.createElement(uce,{show:r,transition:n,unmount:i.unmount},Qe.createElement(AK,{ref:e,...i}))):Qe.createElement(SK,null,Qe.createElement(AK,{ref:e,open:r,...i}))}let Iot="div";function Not(t,e){let n=N.useId(),{id:r=`headlessui-dialog-panel-${n}`,transition:i=!1,...s}=t,[{dialogState:a,unmount:o},l]=j9("Dialog.Panel"),u=vc(e,l.panelRef),f=L5({open:a===0}),p=rr(_=>{_.stopPropagation()}),y={ref:u,id:r,onClick:p},g=i?S6:N.Fragment,b=i?{unmount:o}:{},v=Fo();return Qe.createElement(g,{...b},v({ourProps:y,theirProps:s,slot:f,defaultTag:Iot,name:"Dialog.Panel"}))}let Oot="div";function Pot(t,e){let{transition:n=!1,...r}=t,[{dialogState:i,unmount:s}]=j9("Dialog.Backdrop"),a=L5({open:i===0}),o={ref:e,"aria-hidden":!0},l=n?S6:N.Fragment,u=n?{unmount:s}:{},f=Fo();return Qe.createElement(l,{...u},f({ourProps:o,theirProps:r,slot:a,defaultTag:Oot,name:"Dialog.Backdrop"}))}let Rot="h2";function jot(t,e){let n=N.useId(),{id:r=`headlessui-dialog-title-${n}`,...i}=t,[{dialogState:s,setTitleId:a}]=j9("Dialog.Title"),o=vc(e);N.useEffect(()=>(a(r),()=>a(null)),[r,a]);let l=L5({open:s===0}),u={ref:o,id:r};return Fo()({ourProps:u,theirProps:i,slot:l,defaultTag:Rot,name:"Dialog.Title"})}let Mot=ya($ot),dce=ya(Not);ya(Pot);let Dot=ya(jot),Uot=Object.assign(Mot,{Panel:dce,Title:Dot,Description:iat}),Bot=bm` 727 *, 728 ::before, 729 ::after { 730 box-sizing: border-box; 731 border-width: 0; 732 border-style: solid; 733 } 734 735 line-height: 1.15; 736 -webkit-text-size-adjust: 100%; 737 -moz-tab-size: 4; 738 tab-size: 4; 739 font-feature-settings: normal; 740 741 margin: 0; 742 font-family: 743 system-ui, 744 -apple-system, 745 'Segoe UI', 746 Roboto, 747 Helvetica, 748 Arial, 749 sans-serif, 750 'Apple Color Emoji', 751 'Segoe UI Emoji'; 752 753 hr { 754 height: 0; 755 color: inherit; 756 border-top-width: 1px; 757 } 758 759 abbr:where([title]) { 760 text-decoration: underline dotted; 761 } 762 763 h1, 764 h2, 765 h3, 766 h4, 767 h5, 768 h6 { 769 font-size: inherit; 770 font-weight: inherit; 771 font-family: 772 system-ui, 773 -apple-system, 774 'Segoe UI', 775 Roboto, 776 Helvetica, 777 Arial, 778 sans-serif, 779 'Apple Color Emoji', 780 'Segoe UI Emoji'; 781 display: inline; 782 } 783 784 a { 785 color: inherit; 786 text-decoration: inherit; 787 } 788 789 b, 790 strong { 791 font-weight: bolder; 792 } 793 794 code, 795 kbd, 796 samp, 797 pre {
798 font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace; 799 font-size: 1em; 800 } 801 802 small { 803 font-size: 80%; 804 } 805 806 sub, 807 sup { 808 font-size: 75%; 809 line-height: 0; 810 position: relative; 811 vertical-align: baseline; 812 } 813 814 sub { 815 bottom: -0.25em; 816 } 817 818 sup { 819 top: -0.5em; 820 } 821 822 table { 823 text-indent: 0; 824 border-color: inherit; 825 border-collapse: collapse; 826 } 827 828 button, 829 input, 830 optgroup, 831 select, 832 textarea { 833 font-family: inherit; 834 font-size: 100%; 835 font-weight: inherit; 836 line-height: inherit; 837 color: inherit; 838 margin: 0; 839 padding: 0; 840 } 841 842 button, 843 select { 844 text-transform: none; 845 } 846 847 button, 848 [type='button'], 849 [type='reset'], 850 [type='submit'] { 851 -webkit-appearance: button; 852 background-color: transparent; 853 background-image: none; 854 } 855 856 ::-moz-focus-inner { 857 border-style: none; 858 padding: 0; 859 } 860 861 :-moz-focusring { 862 outline: 1px dotted ButtonText; 863 } 864 865 :-moz-ui-invalid { 866 box-shadow: none; 867 } 868 869 legend { 870 padding: 0; 871 } 872 873 progress { 874 vertical-align: baseline; 875 } 876 877 ::-webkit-inner-spin-button, 878 ::-webkit-outer-spin-button { 879 height: auto; 880 } 881 882 [type='search'] { 883 -webkit-appearance: textfield; 884 outline-offset: -2px; 885 } 886 887 ::-webkit-search-decoration { 888 -webkit-appearance: none; 889 } 890 891 ::-webkit-file-upload-button { 892 -webkit-appearance: button; 893 font: inherit; 894 } 895 896 summary { 897 display: list-item; 898 } 899 900 blockquote, 901 dl, 902 dd, 903 h1, 904 h2, 905 h3, 906 h4, 907 h5, 908 h6, 909 hr, 910 figure, 911 p, 912 pre { 913 margin: 0; 914 } 915 916 fieldset { 917 margin: 0; 918 padding: 0; 919 } 920 921 legend { 922 padding: 0; 923 } 924 925 ol, 926 ul, 927 menu { 928 list-style: none; 929 margin: 0; 930 padding: 0; 931 } 932 933 textarea { 934 resize: vertical; 935 } 936 937 input::placeholder, 938 textarea::placeholder { 939 opacity: 1; 940 color: #9ca3af; 941 } 942 943 button, 944 [role='button'] { 945 cursor: pointer; 946 } 947 948 :disabled { 949 cursor: default; 950 } 951 952 img, 953 svg, 954 video, 955 canvas, 956 audio, 957 iframe, 958 embed, 959 object { 960 display: block; 961 } 962 963 img, 964 video { 965 max-width: 100%; 966 height: auto; 967 } 968 969 [hidden] { 970 display: none; 971 } 972`;const Fot=yst` 973 :root { 974 ${t=>zot(t.palette)} 975 }; 976`,zot=t=>{let e=(function(n){return{"--privy-color-background":n.background,"--privy-color-background-2":n.background2,"--privy-color-background-3":n.background3,"--privy-color-foreground":n.foreground,"--privy-color-foreground-2":n.foreground2,"--privy-color-foreground-3":n.foreground3,"--privy-color-foreground-4":n.foreground4,"--privy-color-foreground-accent":n.foregroundAccent,"--privy-color-accent":n.accent,"--privy-color-accent-light":n.accentLight,"--privy-color-accent-hover":n.accentHover,"--privy-color-accent-dark":n.accentDark,"--privy-color-accent-darkest":n.accentDarkest,"--privy-color-success":n.success,"--privy-color-success-dark":n.successDark,"--privy-color-success-light":n.successLight,"--privy-color-success-bg":n.successBg,"--privy-color-error":n.error,"--privy-color-error-light":n.errorLight,"--privy-color-error-bg":n.errorBg,"--privy-color-error-bg-hover":n.errorBgHover,"--privy-color-warn":n.warn,"--privy-color-warn-light":n.warnLight,"--privy-color-warn-bg":n.warnBg,"--privy-color-warning-dark":n.warningDark,"--privy-color-error-dark":n.errorDark,"--privy-color-info-bg":n.infoBg,"--privy-color-info-bg-hover":n.infoBgHover,"--privy-color-border-default":n.borderDefault,"--privy-color-border-hover":n.borderHover,"--privy-color-border-focus":n.borderFocus,"--privy-color-border-error":n.borderError,"--privy-color-border-success":n.borderSuccess,"--privy-color-border-warning":n.borderWarning,"--privy-color-border-info":n.borderInfo,"--privy-color-border-interactive":n.borderInteractive,"--privy-color-border-interactive-hover":n.borderInteractiveHover,"--privy-color-background-hover":n.backgroundHover,"--privy-color-background-clicked":n.backgroundClicked,"--privy-color-background-disabled":n.backgroundDisabled,"--privy-color-background-interactive":n.backgroundInteractive,"--privy-color-background-interactive-hover":n.backgroundInteractiveHover,"--privy-color-background-interactive-clicked":n.backgroundInteractiveClicked,"--privy-color-background-interactive-disabled":n.backgroundInteractiveDisabled,"--privy-color-foreground-hover":n.foregroundHover,"--privy-color-foreground-clicked":n.foregroundClicked,"--privy-color-foreground-disabled":n.foregroundDisabled,"--privy-color-foreground-interactive":n.foregroundInteractive,"--privy-color-foreground-interactive-hover":n.foregroundInteractiveHover,"--privy-link-navigation-color":n.linkNavigationColor,"--privy-link-navigation-decoration":n.linkNavigationDecoration,"--privy-accent-has-good-contrast":n.accentHasGoodContrast,"--privy-color-icon-default":n.iconDefault,"--privy-color-icon-muted":n.iconMuted,"--privy-color-icon-subtle":n.iconSubtle,"--privy-color-icon-inverse":n.iconInverse,"--privy-color-icon-success":n.iconSuccess,"--privy-color-icon-warning":n.iconWarning,"--privy-color-icon-error":n.iconError,"--privy-color-icon-interactive":n.iconInteractive,"--privy-color-icon-default-hover":n.iconDefaultHover,"--privy-color-icon-muted-hover":n.iconMutedHover,"--privy-color-icon-subtle-hover":n.iconSubtleHover,"--privy-color-icon-default-clicked":n.iconDefaultClicked,"--privy-color-icon-muted-clicked":n.iconMutedClicked,"--privy-color-icon-subtle-clicked":n.iconSubtleClicked,"--privy-color-icon-default-disabled":n.iconDefaultDisabled,"--privy-color-icon-muted-disabled":n.iconMutedDisabled,"--privy-color-icon-subtle-disabled":n.iconSubtleDisabled,"--privy-color-icon-error-hover":n.iconErrorHover,"--privy-color-icon-interactive-hover":n.iconInteractiveHover,"--privy-color-icon-error-clicked":n.iconErrorClicked,"--privy-color-icon-interactive-clicked":n.iconInteractiveClicked,"--privy-color-icon-muted-disabled-alt":n.iconMutedDisabledAlt,"--privy-color-icon-subtle-disabled-alt":n.iconSubtleDisabledAlt,"--privy-border-radius-xs":"6px","--privy-border-radius-sm":"8px","--privy-border-radius-md":"12px","--privy-border-radius-mdlg":"16px","--privy-border-radius-lg":"24px","--privy-border-radius-full":"9999px","--privy-height-modal-full":"620px","--privy-height-modal-compact":"480px"}})(t);return bm` 977 ${Object.entries(e).map((([n,r])=>`${n}: ${r};`)).join(` 978`)} 979 `},kK=mr.div` 980 /* css normalize only the privy application to avoid conflicts 981 with consuming application */ 982 ${Bot} 983 984 /* Privy styles */ 985 color: var(--privy-color-foreground-2); 986 987 h3 { 988 font-size: 16px; 989 line-height: 24px; 990 font-weight: 500; 991 color: var(--privy-color-foreground-2); 992 } 993 994 h4 { 995 font-size: 14px; 996 line-height: 20px; 997 font-weight: 500; 998 color: var(--privy-color-foreground); 999 } 1000 1001 p { 1002 font-size: 13px; 1003 line-height: 20px; 1004 color: var(--privy-color-foreground-2); 1005 } 1006 1007 button:focus, 1008 input:focus, 1009 optgroup:focus, 1010 select:focus, 1011 textarea:focus { 1012 outline: none; 1013 } 1014 1015 button:focus-visible, 1016 input:focus-visible, 1017 optgroup:focus-visible, 1018 select:focus-visible, 1019 textarea:focus-visible { 1020 outline: none; 1021 border-color: var(--privy-color-accent-light); 1022 box-shadow: 0 0 0 3px var(--privy-color-border-focus); 1023 } 1024 1025 .mobile-only { 1026 @media (min-width: 441px) { 1027 display: none; 1028 } 1029 } 1030 1031 /* Animations */ 1032 1033 @keyframes fadein { 1034 0% { 1035 opacity: 0; 1036 } 1037 100% { 1038 opacity: 1; 1039 } 1040 } 1041`,Vot=({children:t,open:e,onClick:n,...r})=>h.jsx(uce,{show:e,as:Qe.Fragment,children:h.jsxs(Uot,{onClose:n,...r,as:Wot,children:[h.jsx(S6,{as:Qe.Fragment,enterFrom:"entering",leaveTo:"leaving",children:h.jsx(Hot,{id:"privy-dialog-backdrop","aria-hidden":"true"})}),h.jsx(qot,{children:h.jsx(S6,{as:Qe.Fragment,enterFrom:"entering",leaveTo:"leaving",children:h.jsx(dce,{as:Zot,children:t})})})]})});let Hot=mr.div` 1042 position: fixed; 1043 inset: 0; 1044 1045 transition: backdrop-filter 100ms ease; 1046 backdrop-filter: blur(3px); 1047 -webkit-backdrop-filter: blur(3px); 1048 1049 &.entering, 1050 &.leaving { 1051 backdrop-filter: unset; 1052 -webkit-backdrop-filter: unset; 1053 } 1054`,Wot=mr.div` 1055 position: relative; 1056 z-index: 999999; 1057`,qot=mr.div` 1058 position: fixed; 1059 inset: 0; 1060 display: flex; 1061 align-items: center; 1062 justify-content: center; 1063 width: 100vw; 1064 min-height: 100dvh; 1065 /* overflow-y: auto allows the browser to scroll the focused input into view 1066 when the mobile keyboard opens, preventing the keyboard from covering inputs */ 1067 overflow-y: auto; 1068 1069 @media (max-width: 440px) {
1070 align-items: flex-end; 1071 } 1072`;const Zot=mr.div` 1073 /* reset some default dialog styles */ 1074 padding: 0; 1075 background: transparent; 1076 border: none; 1077 width: 100%; 1078 pointer-events: auto; 1079 1080 outline: none; 1081 display: block; 1082 1083 /* 1084 * Normally it is bad to mix media queries like this We are doing 1085 * this here specifically for animations to avoid weird jank. 1086 */ 1087 /* Mobile animation is a bottom drawer */ 1088 @media (max-width: 440px) { 1089 opacity: 1; 1090 transform: translate3d(0, 0, 0); 1091 transition: transform 200ms ease-in; 1092 position: sticky; 1093 bottom: 0; 1094 1095 &.entering, 1096 &.leaving { 1097 opacity: 0; 1098 transform: translate3d(0, 100%, 0); 1099 transition: 1100 transform 150ms ease-in 0ms, 1101 opacity 0ms ease 150ms; 1102 } 1103 } 1104 1105 /* Tablet/Desktop animation is a fade in */ 1106 @media (min-width: 441px) { 1107 opacity: 1; 1108 transition: opacity 100ms ease-in; 1109 1110 &.entering, 1111 &.leaving { 1112 opacity: 0; 1113 transition-delay: 5ms; 1114 } 1115 1116 margin: auto; 1117 width: 360px; 1118 box-shadow: 0 8px 36px rgb(55 65 81 / 15%); 1119 border-radius: var(--privy-border-radius-lg); 1120 } 1121`;function h4t(t){let{sendTransaction:e}=N.useContext(Ku);return Z2("sendTransaction",t),{sendTransaction:e}}mr.div` 1122 display: flex; 1123 flex-direction: column; 1124 align-items: center; 1125 justify-content: center; 1126 height: 100%; 1127`;const f4t=({success:t,fail:e})=>h.jsxs(Kot,{children:[h.jsx(TK,{children:h.jsx(Got,{className:t?"success":e?"fail":""})}),h.jsx(TK,{children:h.jsx(M9,{className:t?"success":e?"fail":""})})]});let TK=mr.span` 1128 && { 1129 position: absolute; 1130 top: 0; 1131 left: 0; 1132 z-index: 2; 1133 } 1134`,Kot=mr.span` 1135 position: relative; 1136 width: 82px; 1137 height: 82px; 1138 display: inline-block; 1139`;const M9=mr.span` 1140 && { 1141 width: 82px; 1142 height: 82px; 1143 border-width: 4px; 1144 border-style: solid; 1145 border-color: ${t=>t.color??"var(--privy-color-icon-subtle)"}; 1146 border-bottom-color: transparent; 1147 border-radius: 50%; 1148 display: inline-block; 1149 box-sizing: border-box; 1150 animation: rotation 1.2s linear infinite; 1151 transition: border-color 800ms; 1152 } 1153 1154 @keyframes rotation { 1155 0% { 1156 transform: rotate(0deg); 1157 } 1158 100% { 1159 transform: rotate(360deg); 1160 } 1161 } 1162 1163 &&&.success { 1164 border-color: var(--privy-color-icon-success); 1165 } 1166 1167 &&&.fail { 1168 border-color: var(--privy-color-icon-error); 1169 } 1170`,Got=mr(M9)` 1171 && { 1172 border-color: ${t=>t.color??"var(--privy-color-border-default)"}; 1173 animation: none; 1174 opacity: 0.5; 1175 } 1176`,p4t=t=>h.jsx(Yot,{color:t.color||"var(--privy-color-foreground-3)"});let Yot=mr(M9)` 1177 && { 1178 height: 1rem; 1179 width: 1rem; 1180 margin: 2px 0; 1181 border-width: 1.5px; 1182 1183 /* Override default Loader to match button transitions */ 1184 transition: border-color 200ms ease; 1185 } 1186`;const Jot=({origin:t,path:e,query:n={},hash:r={}})=>{let i=t.endsWith("/")?t:`${t}/`,s=new URL(e,i);for(let[o,l]of Object.entries(n))l!==void 0&&s.searchParams.set(o,l);let a=Object.entries(r);if(a.length>0){let o=new URLSearchParams;for(let[l,u]of a)u!==void 0&&o.append(l,u);s.hash=o.toString()}return s.href};var SY;const hce=((SY=Promise.withResolvers)==null?void 0:SY.bind(Promise))??(()=>{let t,e;return{promise:new Promise(((n,r)=>{t=n,e=r})),resolve:t,reject:e}});class Xot extends Error{constructor(){super("Back navigation"),this.name="BackNavigationError"}}function Qot(t,e){return n=>{t({eventName:n.eventName,payload:{...n.payload,flowId:e}})}}const Ov=Bo((()=>null)),Xw=t=>{Ov.getState()!==null&&Ov.setState(t)};async function elt(t,e){let n=await t.fetchPrivyRoute(vX,{}),r={config:{status:"ready",data:{currencies:n.currencies,chains:n.chains}}};e!=null&&e.aborted||Xw(r)}function tlt(){let t=Ov(),{closePrivyModal:e,privy:n,createAnalyticsEvent:r}=Br(),i=t==null?void 0:t.flowId,s=N.useMemo((()=>i?Qot(r,i):()=>{}),[r,i]),a=(t==null?void 0:t.params)??null,o=(t==null?void 0:t.config)??{status:"loading"},l=N.useCallback((p=>{let y=LK(i);if(!y||(Xw({modalState:p}),y.modalState.step===p.step))return;s({eventName:"sdk_deposit_address_step_viewed",payload:{step:p.step,...p.step==="error"?{errorCode:p.code}:{}}});let g=(function(b){switch(b.step){case"complete":return{outcome:"completed",step:"complete"};case"failed":return{outcome:"failed",step:"failed",errorCode:"DEPOSIT_FAILED"};case"refunded":return{outcome:"refunded",step:"refunded",errorCode:"DEPOSIT_REFUNDED"};default:return null}})(p);g&&s({eventName:"sdk_deposit_address_concluded",payload:g})}),[s,i]),u=N.useCallback((async()=>{let p=t==null?void 0:t.controller;if(a&&p&&!p.signal.aborted){Xw({config:{status:"loading"}});try{await elt(n,p.signal)}catch(y){if(p.signal.aborted)return;throw Xw({config:{status:"error",error:y instanceof Error?y:Error("Failed to load deposit config")}}),y}}}),[a,n,t==null?void 0:t.controller]),f=N.useCallback((()=>{let p=LK(i);if(!p)return;let{modalState:y}=p;s({eventName:"sdk_deposit_address_exited",payload:{step:y.step,...y.step==="error"?{errorCode:y.code}:{}}});let g=(function(b){switch(b.step){case"complete":case"failed":case"refunded":return null;case"error":return{outcome:"failed",step:"error",errorCode:b.code};default:return{outcome:"abandoned",step:b.step}}})(y);g&&s({eventName:"sdk_deposit_address_concluded",payload:g}),y.step==="complete"?p.onComplete():y.step==="failed"?p.onError(Error("DEPOSIT_FAILED")):y.step==="error"?p.onError(Error(y.code)):y.step==="refunded"?p.onError(Error("DEPOSIT_REFUNDED")):p.onError(Error("USER_EXITED")),e({shouldCallAuthOnSuccess:!1})}),[i,e,s]);return{modalState:(t==null?void 0:t.modalState)??{step:"intro"},setModalState:l,config:o,retryConfig:u,params:a,close:f,onBack:t==null?void 0:t.onBack,createDepositAddressEvent:s}}function LK(t){let e=Ov.getState();return e&&e.flowId===t?e:null}function m4t(t){let{modalState:e,config:n,params:r,...i}=tlt();if((function(s,a){if(s.step!==a)throw Error("UNEXPECTED_STATE")})(e,t),!r||n.status!=="ready")throw Error("UNEXPECTED_STATE");return{state:e,configData:n.data,params:r,...i}}const nlt=({w:t,h:e})=>{let n=window.screenLeft===void 0?window.screenX:window.screenLeft,r=window.screenTop===void 0?window.screenY:window.screenTop,i=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,s=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,a=i/window.screen.availWi
1186dth,o=s/window.screen.availHeight;return`toolbar=0,location=0,menubar=0,height=${e},width=${t},popup=1,left=${(i-t)/2/a+n},top=${(s-e)/2/o+r}`},fce=t=>window.open(t==null?void 0:t.location,void 0,nlt({w:440,h:680}));class rlt{async authenticate(){if(!this.api)throw new ue("Auth flow has no API instance");try{return await this.api.post(zoe,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:this.meta.codeVerifier,provider:this.meta.provider,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw vn(e)}}async link(){if(!this.api)throw new ue("Auth flow has no API instance");try{return await this.api.post(Voe,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:this.meta.codeVerifier,provider:this.meta.provider})}catch(e){throw vn(e)}}constructor(e){this.meta=e}}async function pce({api:t,requesterAppId:e,providerAppId:n}){let r=(await t.get(`/api/v1/apps/${e}/cross-app/connections`)).connections.find((i=>i.provider_app_id===n));if(!r)throw new ue("Invalid connected app");return{name:r.provider_app_name,logoUrl:r.provider_app_icon_url||void 0,apiUrl:r.provider_app_custom_api_url,readOnly:r.read_only,customAuthAuthorizeUrl:r.provider_app_custom_auth_authorize_url,customAuthTransactUrl:r.provider_app_custom_auth_transact_url}}async function ilt({api:t,appId:e}){let n=dP(),r=Woe(),i=await qoe(n);try{let{url:s}=await t.post(Foe,{provider:`privy:${e}`,redirect_to:window.location.href,code_challenge:i,state_code:r});return{url:s,stateCode:r,codeVerifier:n}}catch(s){throw vn(s)}}async function slt({appId:t,stateCode:e,codeVerifier:n,authorizationCode:r,action:i,client:s,disableSignup:a}){var o;if(!r||!e)throw new ue("[Cross-App AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if(r==="undefined")throw new ue("User denied confirmation during cross-app auth flow");try{let l=new rlt({authorizationCode:r,stateCode:e,codeVerifier:n,provider:`privy:${t}`,disableSignup:!!a});s.startAuthFlow(l);let u=i==="link"?await s.link():await s.authenticate(),f=(o=u.oAuthTokens)==null?void 0:o.accessToken;return console.debug(),f}catch(l){let u=vn(l);throw u.privyErrorCode===Oe.ACCOUNT_TRANSFER_REQUIRED?u:u.privyErrorCode?new ue(u.message||"Invalid code during cross-app auth flow.",void 0,u.privyErrorCode):u.message==="User denied confirmation during cross-app auth flow"?new ue("Invalid code during cross-app auth flow.",void 0,Oe.OAUTH_USER_DENIED):new ue("Invalid code during cross-app auth flow.",void 0,Oe.UNKNOWN_AUTH_ERROR)}}const mce=async({user:t,accessToken:e,proxy:n,refreshSessionAndUser:r,privy:i,appConfig:s,recoverEmbeddedWallet:a,setUser:o,walletIndex:l,chainType:u,recoveryMethod:f,recoveryPassword:p,recoveryAccessToken:y,idempotencyKey:g,additionalSigners:b})=>{if(l===0)if(s.embeddedWallets.mode==="user-controlled-server-wallets-only")await HT(i,{request:{chain_type:u,additional_signers:b?TV(b):void 0},headers:g?{"privy-idempotency-key":g}:void 0});else if(u==="ethereum"){let C=G8(t);C&&await a({address:C.address}),await n.create({accessToken:e,solanaAddress:C==null?void 0:C.address,recoveryMethod:f,recoveryPassword:p,recoveryAccessToken:y})}else{if(u!=="solana")throw Error("Invalid input to create wallet");{let C=v2(t);C&&await a({address:C.address}),await n.createSolana({accessToken:e,ethereumAddress:C==null?void 0:C.address,recoveryMethod:f,recoveryPassword:p,recoveryAccessToken:y})}}else if(s.embeddedWallets.mode==="user-controlled-server-wallets-only")await HT(i,{request:{chain_type:u,additional_signers:b?TV(b):void 0}});else{let{entropyId:C,entropyIdVerifier:S}=a2(t);await a(),await n.addWallet({accessToken:e,entropyId:C,entropyIdVerifier:S,chainType:u,hdWalletIndex:l})}let v=await r(),_=k9(v,{chainType:u,walletIndex:l})[0];return o(v),{user:v,account:_}},uw=async({user:t,address:e,client:n,request:r,requesterAppId:i,reconnect:s})=>{n.createAnalyticsEvent({eventName:"cross_app_request_started",payload:{address:e,method:r.method}});let a=t==null?void 0:t.linkedAccounts.find((p=>p.type==="cross_app"&&(p.embeddedWallets.some((y=>y.address===e))||p.smartWallets.some((y=>y.address===e)))));if(!t||!a)throw n.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Cannot request a signature with this wallet address",address:e}}),new ue("Cannot request a signature with this wallet address");let o=n.getProviderAccessToken(a.providerApp.id),l=await pce({api:n.api,requesterAppId:i,providerAppId:a.providerApp.id});if(!o){if(l.readOnly)throw console.error("cannot transact against a read-only provider app"),new ue("Cannot transact against a read-only provider app");await s({appId:a.providerApp.id,action:"link"})&&(o=n.getProviderAccessToken(a.providerApp.id))}if(!o)throw n.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Transactions require a valid token",address:e}}),new ue("Transactions require a valid token");let u=new URL(l.customAuthTransactUrl||`${l.apiUrl}/oauth/transact`);u.searchParams.set("token",o||""),u.searchParams.set("request",alt(r));let f=fce({location:u.href});if(!f)throw n.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Missing token",address:e}}),new ue("Failed to initialize signature request");return new Promise(((p,y)=>{let g=setTimeout((()=>{_(),y(new ue("Request timeout")),n.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Request timeout",address:e}})}),12e4),b=setInterval((()=>{f.closed&&(_(),y(new ue("User rejected request")),n.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"User rejected request",address:e}}))}),300),v=C=>{var S,x,A;C.data&&(((S=C.data.token)==null?void 0:S.action)==="set"&&((x=C.data.token)==null?void 0:x.value)!==void 0?n.storeProviderAccessToken(a.providerApp.id,C.data.token.value):((A=C.data.token)==null?void 0:A.action)==="clear"&&n.storeProviderAccessToken(a.providerApp.id,null),C.data.type==="PRIVY_CROSS_APP_ACTION_RESPONSE"&&C.data.result&&(_(),p(C.data.result),n.createAnalyticsEvent({eventName:"cross_app_request_success",payload:{address:e,method:r.method}})),C.data.type==="PRIVY_CROSS_APP_ACTION_ERROR"&&C.data.error&&(_(),y(C.data.error),n.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:C.data.error,address:e}})))};window.addEventListener("message",v);let _=()=>{f.close(),clearInterval(b),clearTimeout(g),window.removeEventListener("message",v)}
1186}))};let alt=t=>JSON.stringify({content:{request:{request:k$(t,Dt)}},timestamp:Date.now(),callbackUrl:window.origin});const k$=(t,e)=>typeof t=="bigint"?e(t):Array.isArray(t)?t.map((n=>k$(n,e))):t&&typeof t=="object"?Object.fromEntries(Object.entries(t).map((([n,r])=>[n,k$(r,e)]))):t,olt=()=>{let{user:t,getAccessToken:e}=Uo(),{client:n,setUser:r,openModal:i,inProgressAuthFlowRef:s,inProgressLoginOrLinkMethodRef:a}=Br(),o=Ts(),l=tp(),{setModalData:u}=R2(),f=N.useCallback((C=>(t==null?void 0:t.linkedAccounts.some((S=>S.type==="cross_app"&&S.smartWallets.some((x=>x.address===C)))))??!1),[t]),p=N.useCallback((async({appId:C,action:S,disableSignup:x})=>{let A=await e();if(S==="link"&&!A)throw l("linkAccount","onError",Oe.MUST_BE_AUTHENTICATED,{linkMethod:`privy:${C}`}),new ue("User must be authenticated before linking an account.");if(S==="login"&&A)throw l("login","onError",Oe.UNKNOWN_AUTH_ERROR),new ue("Attempted to log in, but user is already logged in. Use a `link` helper instead.");a.current=`privy:${C}`,s.current=S;let I=fce();return n.createAnalyticsEvent({eventName:"cross_app_auth_started",payload:{providerAppId:C}}),new Promise((async($,O)=>{let{name:P,logoUrl:j}=await pce({api:n.api,providerAppId:C,requesterAppId:o.id});u({crossAppAuth:{appId:C,name:P,logoUrl:j,action:S,popup:I,disableSignup:x,onSuccess:$,onError:O}}),i("CrossAppAuthScreen")}))}),[e,l,a,s,n,o.id,u,i]),y=N.useCallback((async({subject:C})=>{var A;let S=(A=t==null?void 0:t.linkedAccounts.find((I=>I.type==="cross_app"&&I.subject===C)))==null?void 0:A.providerApp;if(!S)throw new ue("Invalid subject");n.storeProviderAccessToken(S.id,null);let x=await n.unlinkOAuth(`privy:${S.id}`,C);return r(x),x}),[t,n,r]),g=N.useCallback(((C,{address:S,chainId:x})=>uw({user:t,client:n,address:S,requesterAppId:o.id,request:{method:f(S)?"privy_signSmartWalletMessage":"personal_sign",params:[C,S],chainId:x},reconnect:p})),[t,n,o.id,f,p]),b=N.useCallback(((C,{address:S,chainId:x})=>{let A=rv(C);return uw({user:t,client:n,address:S,requesterAppId:o.id,request:{method:f(S)?"privy_signSmartWalletTypedData":"eth_signTypedData_v4",params:[S,A],chainId:x},reconnect:p})}),[t,n,o.id,f,p]),v=N.useCallback(((C,{address:S})=>uw({user:t,client:n,address:S,requesterAppId:o.id,request:{method:f(S)?"privy_sendSmartWalletTx":"eth_sendTransaction",params:[C],chainId:C.chainId},reconnect:p})),[t,n,o.id,f,p]),_=N.useCallback(((C,{address:S})=>uw({user:t,client:n,address:S,requesterAppId:o.id,request:{method:f(S)?"privy_signSmartWalletTx":"eth_signTransaction",params:[C],chainId:C.chainId},reconnect:p})),[t,n,o.id,f,p]);return N.useMemo((()=>({startCrossAppAuthFlow:p,unlinkCrossAppAccount:y,signMessageWithCrossAppWallet:g,signTypedDataWithCrossAppWallet:b,sendTransactionWithCrossAppWallet:v,signTransactionWithCrossAppWallet:_})),[p,y,g,b,v,_])},llt=()=>{let{client:t,setUser:e}=Br();return{unlink:N.useCallback((async({address:n})=>{let r=await t.unlinkEmail(n);return e(r),r}),[t,e])}},clt=()=>{let{client:t,setUser:e}=Br();return{unlink:N.useCallback((async({fid:n})=>{let r=await t.unlinkFarcaster(n);return e(r),r}),[t,e])}},ult=()=>{let{client:t,setUser:e}=Br();return{unlink:N.useCallback((async({provider:n,subject:r})=>{let i=await t.unlinkOAuth(n,r);return e(i),i}),[t,e])}},dlt=()=>{var a;let{client:t,setUser:e,walletProxy:n}=Br(),{getAccessToken:r}=Uo(),i=Ts(),s=((a=i==null?void 0:i.passkeys)==null?void 0:a.shouldUnenrollMfaOnUnlink)??!1;return{unlink:N.useCallback((async({credentialId:o})=>{let l=await r();if(!l)throw Error("Must have valid access token to enroll in MFA");if(!n)throw Error("Wallet proxy not initialized.");await n.unlinkPasskeyAccount({credentialId:o,accessToken:l,removeAsMfa:s});let u=await t.getAuthenticatedUser();return e(u),u}),[s,t,r,e,n])}},hlt=()=>{let{client:t,setUser:e}=Br();return{unlink:N.useCallback((async({phoneNumber:n})=>{let r=await t.unlinkPhone(n);return e(r),r}),[t,e])}},flt=()=>{let{client:t,setUser:e}=Br();return{unlink:N.useCallback((async({telegramUserId:n})=>{let r=await t.unlinkTelegram(n);return e(r),r}),[t,e])}},plt=t=>t.reduce(((e,n)=>!e||e.walletIndex<n.walletIndex?n:e),null),mlt=async({appConfig:t,getAccessToken:e,initializeWalletProxy:n,user:r,privy:i,emitPrivyEvent:s,recoverEmbeddedWallet:
1186a,setModalData:o,openModal:l,setUser:u,options:f,timeoutDuration:p,refreshSessionAndUser:y,chainType:g,idempotencyKey:b,additionalSigners:v})=>{var A,I;let[_,C]=await Promise.all([n(p),e()]);if(!C||!r)throw s("createWallet","onError",Oe.MUST_BE_AUTHENTICATED),Error("User must be authenticated before creating a Privy wallet");if(!_&&((A=t.customAuth)!=null&&A.enabled))throw s("createWallet","onError",Oe.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to connect to wallet proxy");if(v&&t.embeddedWallets.mode!=="user-controlled-server-wallets-only")throw new ue("Specifying additionalSigners is only supported for TEE execution and this app uses on-device execution. Learn more https://docs.privy.io/recipes/tee-wallet-migration-guide");if(f&&"walletIndex"in f&&typeof f.walletIndex=="number"){if(t.embeddedWallets.mode==="user-controlled-server-wallets-only")throw s("createWallet","onError",Oe.INVALID_DATA),Error("Invalid input, use `createAdditional` instead of `walletIndex` to create additional wallets.");return $K({accessToken:C,appConfig:t,privy:i,emitPrivyEvent:s,openModal:l,proxy:_,refreshSessionAndUser:y,recoverEmbeddedWallet:a,setModalData:o,user:r,walletIndex:f.walletIndex,chainType:g,setUser:u,additionalSigners:v})}let S=f&&"createAdditional"in f&&f.createAdditional,x=k9(r,{chainType:g});if(x[0]&&!S)throw s("createWallet","onError",Oe.EMBEDDED_WALLET_ALREADY_EXISTS),Error("User already has an embedded wallet.");return $K({accessToken:C,appConfig:t,privy:i,emitPrivyEvent:s,openModal:l,proxy:_,recoverEmbeddedWallet:a,setModalData:o,user:r,walletIndex:(((I=plt(x))==null?void 0:I.walletIndex)??-1)+1,chainType:g,refreshSessionAndUser:y,setUser:u,idempotencyKey:b,additionalSigners:v})};let $K=async({accessToken:t,appConfig:e,privy:n,emitPrivyEvent:r,proxy:i,refreshSessionAndUser:s,recoverEmbeddedWallet:a,user:o,walletIndex:l,setModalData:u,openModal:f,chainType:p,setUser:y,idempotencyKey:g,additionalSigners:b})=>{if(l<0)throw r("createWallet","onError",Oe.EMBEDDED_WALLET_CREATE_ERROR),Error(`A negative walletIndex (${l}
1186) is invalid.`);let v=l6(o);if(l>0&&!v)throw r("createWallet","onError",Oe.EMBEDDED_WALLET_NOT_FOUND),Error("Must have an existing embedded wallet to create an additional wallet.");if(e.embeddedWallets.requireUserOwnedRecoveryOnCreate&&e.embeddedWallets.mode==="user-controlled-server-wallets-only")throw r("createWallet","onError",Oe.EMBEDDED_WALLET_CREATE_ERROR),Error("User owned recovery not yet supported for this app.");if(!v&&e.embeddedWallets.requireUserOwnedRecoveryOnCreate)return await IK({emitPrivyEvent:r,setModalData:u,openModal:f,chainType:p});let _=k9(o,{chainType:p,walletIndex:l})[0];if(_)return{user:o,account:_};if(l===0&&!i)return IK({emitPrivyEvent:r,setModalData:u,openModal:f,chainType:p});if(!i)throw r("createWallet","onError",Oe.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to connect to wallet proxy");return mce({appConfig:e,walletIndex:l,chainType:p,user:o,accessToken:t,proxy:i,refreshSessionAndUser:s,privy:n,recoverEmbeddedWallet:a,setUser:y,idempotencyKey:g,additionalSigners:b})},IK=async({emitPrivyEvent:t,setModalData:e,openModal:n,chainType:r})=>new Promise(((i,s)=>{e({createWallet:{onSuccess:({user:a,account:o})=>{t("createWallet","onSuccess",{wallet:o}),i({user:a,account:o})},onFailure:a=>{t("createWallet","onError",Oe.UNKNOWN_EMBEDDED_WALLET_ERROR),s(a)},callAuthOnSuccessOnClose:!1,shouldCreateEth:r==="ethereum",shouldCreateSol:r==="solana"}}),n("EmbeddedWalletOnAccountCreateScreen")}));const ylt=()=>{let t=Ts(),e=tp(),{setModalData:n}=R2(),{initializeWalletProxy:r,recoverEmbeddedWallet:i,setUser:s,openModal:a,refreshSessionAndUser:o,privy:l,client:u}=Br();return{create:async({chainType:f,options:p,latestUser:y,idempotencyKey:g})=>{let b=y;if(b||(b=await o()),!b)throw e("createWallet","onError",Oe.MUST_BE_AUTHENTICATED),Error("User must be authenticated before creating a Privy wallet");return await mlt({appConfig:t,privy:l,getAccessToken:()=>u.getAccessToken(),refreshSessionAndUser:o,initializeWalletProxy:r,user:b,emitPrivyEvent:e,recoverEmbeddedWallet:i,setModalData:n,openModal:a,setUser:s,options:p,timeoutDuration:RNe,chainType:f,idempotencyKey:g,additionalSigners:p==null?void 0:p.signers})}}};function glt(t){let{create:e}=ylt();return Z2("createWallet",t),{createWallet:async n=>{n&&"target"in n&&n&&(n=void 0);let{account:r}=await e({chainType:"ethereum",options:n});return r}}}const blt=async({emitPrivyEvent:t,getAccessToken:e,initializeWalletProxy:n,refreshSessionAndUser:r,user:i,appConfig:s},{privateKey:a,chainType:o,additionalSigners:l})=>{if(!i)throw t("linkAccount","onError",Oe.MUST_BE_AUTHENTICATED,{linkMethod:"siwe"}),new ue("User must be authenticated before linking an account.");let u=s.embeddedWallets.mode==="user-controlled-server-wallets-only"?"tee":"on-device";if(l&&u==="on-device")throw new ue("Specifying additionalSigners is only supported for TEE execution and this app uses on-device execution. Learn more https://docs.privy.io/recipes/tee-wallet-migration-guide");let[f,p]=await Promise.all([e(),n(15e3)]);if(!p||!f)throw t("linkAccount","onError",Oe.MUST_BE_AUTHENTICATED,{linkMethod:"siwe"}),new ue("User must be authenticated before linking an account.");let{address:y}=await p.importWallet({privateKey:a,accessToken:f,chainType:o,mode:u,additionalSigners:l}),g=await r(),b=cO(g),v=b==null?void 0:b.find((_=>_.address===y));if(!v)throw t("createWallet","onError",Oe.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to import wallet");return t("createWallet","onSuccess",{wallet:v}),v},wlt=()=>{let{user:t}=Uo(),{client:e,refreshSessionAndUser:n,initializeWalletProxy:r}=Br(),i=tp(),s=Ts();return{importWallet:N.useCallback((({privateKey:a,additionalSigners:o})=>blt({getAccessToken:()=>e.getAccessToken(),user:t,initializeWalletProxy:r,refreshSessionAndUser:n,emitPrivyEvent:i,appConfig:s},{privateKey:a,chainType:"ethereum",additionalSigners:o})),[t,e,n,r,i,s])}},vlt=()=>{let t=N.useContext(Ku),{importWallet:e}=wlt(),{exportWallet:n}=Sst(),{createWallet:r}=glt(),{unlinkCrossAppAccount:i}=olt(),{unlink:s}=Tst(),{unlink:a}=llt(),{unlink:o}=hlt(),{unlink:l}=clt(),{unlink:u}=flt(),{unlink:f}=dlt(),{unlink:p}=ult(),y=N.useCallback((L=>s({address:L})),[s]),g=N.useCallback((L=>a({address:L})),[a]),b=N.useCallback((L=>o({phoneNumber:L})),[o]),v=N.useCallback((L=>l({fid:L})),[l]),_=N.useCallback((L=>u({telegramUserId:L})),[u]),C=N.useCallback((L=>f({credentialId:L})),[f]),S=N.useCallback((L=>p(L)),[p]),x=N.useCallback((L=>p({provider:"google",subject:L})),[p]),A=N.useCallback((L=>p({provider:"twitter",subject:L})),[p]),I=N.useCallback((L=>p({provider:"twitch",subject:L})),[p]),$=N.useCallback((L=>p({provider:"discord",subject:L})),[p]),O=N.useCallback((L=>p({provider:"github",subject:L})),[p]),P=N.useCallback((L=>p({provider:"spotify",subject:L})),[p]),j=N.useCallback((L=>p({provider:"instagram",subject:L})),[p]),U=N.useCallback((L=>p({provider:"tiktok",subject:L})),[p]),z=N.useCallback((L=>p({provider:"line",subject:L})),[p]),D=N.useCallback((L=>p({provider:"linkedin",subject:L})),[p]),R=N.useCallback((L=>p({provider:"apple",subject:L})),[p]),{update:W}=Ast(),{update:T}=kst();return{...t,importWallet:e,createWallet:r,exportWallet:n,unlinkCrossAppAccount:i,unlinkWallet:y,unlinkEmail:g,unlinkPhone:b,unlinkGoogle:x,unlinkTwitter:A,unlinkTwitch:I,unlinkDiscord:$,unlinkGithub:O,unlinkSpotify:P,unlinkInstagram:j,unlinkTiktok:U,unlinkLine:z,unlinkLinkedIn:D,unlinkApple:R,unlinkFarcaster:v,unlinkTelegram:_,unlinkPasskey:C,unlinkOAuth:S,updateEmail:W,updatePhone:T}};var _lt=Object.defineProperty,IP=(t,e)=>{for(var n in e)_lt(t,n,{get:e[n],enumerable:!0})},xlt={84532:{usdcAddress:"0x036CbD53842c5426634e7929541eC2318f3dCF7e",usdcName:"USDC"},8453:{usdcAddress:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",usdcName:"USD Coin"},43113:{usdcAddress:"0x5425890298aed601595a70AB815c96711a31Bc65",usdcName:"USD Coin"},43114:{usdcAddress:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",usdcName:"USD Coin"},4689:{usdcAddress:"0xcdf79194c6c285077a58da47641d4dbe51f63542",usdcName:"Bridged USDC"},103:{usdcAddress:"4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU",usdcName:"USDC"},101:{usdcAddress:"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",usdcName:"USDC"},1328:{usdcAddress:"0x4fcf1784b31630811181f670aea7a7bef803eaed",usdcName:"USDC"},1329:{usdcAddress:"0xe15fc38f6d8c56af07bbcbe3baf5708a2bf42392",usdcName:"USDC"},137:{usdcAddress:"0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",usdcName:"USD Coin"},80002:{usdcAddress:"0x41E94Eb019C0762f9Bfcf9Fb1E58725BfB0e7582",usdcName:"USDC"},3338:{usdcAddress:"0xbbA60da06c2c5424f03f7434542280FCAd453d10",usdcName:"USDC"},2741:{usdcAddress:"0x84a71ccd554cc1b02749b35d22f684cc8ec987e1",usdcName:"Bridged USDC"},11124:{usdcAddress:"0xe4C7fBB0a626ed208021ccabA6Be1566905E2dFc",usdcName:"Bridged USDC"},1514:{usdcAddress:"0xF1815bd50389c46847f0Bda824eC8da914045D14",usdcName:"Bridged USDC"},41923:{usdcAddress:"0x12a272A581feE5577A5dFa371afEB4b2F3a8C2F8",usdcName:"Bridged USDC (Stargate)"},324705682:{usdcAddress:"0x2e08028E3C4c2356572E096d8EF835cD5C6030bD",usdcName:"Bridged USDC (SKALE Bridge)"}},Clt=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"authorizer",type:"address"},{indexed:!0,internalType:"bytes32",name:"nonce",type:"bytes32"}],name:"AuthorizationCanceled",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"authorizer",type:"address"},{indexed:!0,internalType:"bytes32",name:"nonce",type:"bytes32"}],name:"AuthorizationUsed",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_account",type:"address"}],name:"Blacklisted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"newBlacklister",type:"address"}],name:"BlacklisterChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"burner",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Burn",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"newMasterMinter",type:"address"}],name:"MasterMinterChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"minter",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Mint",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"minter",type:"address"},{indexed:!1,internalType:"uint256",name:"minterAllowedAmount",type:"uint256"}],name:"MinterConfigured",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldMinter",type:"address"}],name:"MinterRemoved",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousOwner",type:"address"},{indexed:!1,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[],name:"Pause",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"newAddress",type:"address"}],name:"PauserChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"newRescuer",type:"address"}],name:"RescuerChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_account",type:"address"}],name:"UnBlacklisted",type:"event"},{anonymous:!1,inputs:[],name:"Unpause",type:"event"},{inputs:[],name:"CANCEL_AUTHORIZATION_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"PERMIT_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"RECEIVE_WITH_AUTHORIZATION_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"TRANSFER_WITH_AUTHORIZATION_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"authorizer",type:"address"},{internalType:"bytes32",name:"nonce",type:"bytes32"}],name:"authorizationState",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_account",type:"address"}
vendor: 11,850 bytes, line 1186
1186],name:"blacklist",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"blacklister",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_amount",type:"uint256"}],name:"burn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"authorizer",type:"address"},{internalType:"bytes32",name:"nonce",type:"bytes32"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"cancelAuthorization",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"authorizer",type:"address"},{internalType:"bytes32",name:"nonce",type:"bytes32"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"cancelAuthorization",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"minter",type:"address"},{internalType:"uint256",name:"minterAllowedAmount",type:"uint256"}],name:"configureMinter",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"currency",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"decrement",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"increment",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"tokenName",type:"string"},{internalType:"string",name:"tokenSymbol",type:"string"},{internalType:"string",name:"tokenCurrency",type:"string"},{internalType:"uint8",name:"tokenDecimals",type:"uint8"},{internalType:"address",name:"newMasterMinter",type:"address"},{internalType:"address",name:"newPauser",type:"address"},{internalType:"address",name:"newBlacklister",type:"address"},{internalType:"address",name:"newOwner",type:"address"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"newName",type:"string"}],name:"initializeV2",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"lostAndFound",type:"address"}],name:"initializeV2_1",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"accountsToBlacklist",type:"address[]"},{internalType:"string",name:"newSymbol",type:"string"}],name:"initializeV2_2",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_account",type:"address"}],name:"isBlacklisted",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"isMinter",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"masterMinter",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_to",type:"address"},{internalType:"uint256",name:"_amount",type:"uint256"}],name:"mint",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"minter",type:"address"}],name:"minterAllowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"pause",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"paused",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"pauser",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"permit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"validAfter",type:"uint256"},{internalType:"uint256",name:"validBefore",type:"uint256"},{internalType:"bytes32",name:"nonce",type:"bytes32"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"receiveWithAuthorization",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"validAfter",type:"uint256"},{internalType:"uint256",name:"validBefore",type:"uint256"},{internalType:"bytes32",name:"nonce",type:"bytes32"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"receiveWithAuthorization",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"minter",type:"address"}],name:"removeMinter",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract IERC20",name:"tokenContract",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"rescueERC20",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"rescuer",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"validAfter",type:"uint256"},{internalType:"uint256",name:"validBefore",type:"uint256"},{internalType:"bytes32",name:"nonce",type:"bytes32"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"transferWithAuthorization",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"validAfter",type:"uint256"},{internalType:"uint256",name:"validBefore",type:"uint256"},{internalType:"bytes32",name:"nonce",type:"bytes32"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"transferWithAuthorization",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_account",type:"address"}],name:"unBlacklist",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"unpause",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_newBlacklister",type:"address"}],name:"updateBlacklister",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_newMasterMinter",type:"address"}],name:"updateMasterMinter",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_newPauser",type:"address"}],name:"updatePauser",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newRescuer",type:"address"}],name:"updateRescuer",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"version",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"pure",type:"function"}],Cn;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const s={};for(const a of i)s[a]=a;return s},t.getValidEnumValues=i=>{const s=t.objectKeys(i).filter(o=>typeof i[i[o]]!="number"),a={};for(const o of s)a[o]=i[o];return t.objectValues(a)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&s.push(a);return s},t.find=(i,s)=>{for(const a of i)if(s(a))return a},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(s)}t.joinValues=r,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(Cn||(Cn={}));var NK;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(NK||(NK={}));const st=Cn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Jd=t=>{switch(typeof t){case"undefined":return st.undefined;case"string":return st.string;case"number":return Number.isNaN(t)?st.nan:st.number;case"boolean":return st.boolean;case"function":return st.function;case"bigint":return st.bigint;case"symbol":return st.symbol;case"object":return Array.isArray(t)?st.array:t===null?st.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?st.promise:typeof Map<"u"&&t instanceof Map?st.map:typeof Set<"u"&&t instanceof Set?st.set:typeof Date<"u"&&t instanceof Date?st.date:st.object;default:return st.unknown}},Fe=Cn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invali
1186d_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Uu extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(s){return s.message},r={_errors:[]},i=s=>{for(const a of s.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let o=r,l=0;for(;l<a.path.length;){const u=a.path[l];l===a.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(n(a))):o[u]=o[u]||{_errors:[]},o=o[u],l++}}};return i(this),r}static assert(e){if(!(e instanceof Uu))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Cn.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const i of this.issues)if(i.path.length>0){const s=i.path[0];n[s]=n[s]||[],n[s].push(e(i))}else r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Uu.create=t=>new Uu(t);const T$=(t,e)=>{let n;switch(t.code){case Fe.invalid_type:t.received===st.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case Fe.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Cn.jsonStringifyReplacer)}`;break;case Fe.unrecognized_keys:n=`Unrecognized key(s) in object: ${Cn.joinValues(t.keys,", ")}`;break;case Fe.invalid_union:n="Invalid input";break;case Fe.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Cn.joinValues(t.options)}`;break;case Fe.invalid_enum_value:n=`Invalid enum value. Expected ${Cn.joinValues(t.options)}, received '${t.received}'`;break;case Fe.invalid_arguments:n="Invalid function arguments";break;case Fe.invalid_return_type:n="Invalid function return type";break;case Fe.invalid_date:n="Invalid date";break;case Fe.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Cn.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case Fe.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case Fe.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case Fe.custom:n="Invalid input";break;case Fe.invalid_intersection_types:n="Intersection results could not be merged";break;case Fe.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case Fe.not_finite:n="Number must be finite";break;default:n=e.defaultError,Cn.assertNever(t)}return{message:n}};let Elt=T$;function Slt(){return Elt}const Alt=t=>
vendor: 4,819 bytes, line 1186
1186{const{data:e,path:n,errorMaps:r,issueData:i}=t,s=[...n,...i.path||[]],a={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let o="";const l=r.filter(u=>!!u).slice().reverse();for(const u of l)o=u(a,{data:e,defaultError:o}).message;return{...i,path:s,message:o}};function Xe(t,e){const n=Slt(),r=Alt({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===T$?void 0:T$].filter(i=>!!i)});t.common.issues.push(r)}class Us{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const i of n){if(i.status==="aborted")return Ot;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const i of n){const s=await i.key,a=await i.value;r.push({key:s,value:a})}return Us.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const i of n){const{key:s,value:a}=i;if(s.status==="aborted"||a.status==="aborted")return Ot;s.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(r[s.value]=a.value)}return{status:e.value,value:r}}}const Ot=Object.freeze({status:"aborted"}),Eg=t=>({status:"dirty",value:t}),zo=t=>({status:"valid",value:t}),OK=t=>t.status==="aborted",PK=t=>t.status==="dirty",O1=t=>t.status==="valid",Pv=t=>typeof Promise<"u"&&t instanceof Promise;var mt;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(mt||(mt={}));class hc{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const RK=(t,e)=>{if(O1(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Uu(t.common.issues);return this._error=n,this._error}}};function Jt(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(a,o)=>{const{message:l}=t;return a.code==="invalid_enum_value"?{message:l??o.defaultError}:typeof o.data>"u"?{message:l??r??o.defaultError}:a.code!=="invalid_type"?{message:o.defaultError}:{message:l??n??o.defaultError}},description:i}}class fn{get description(){return this._def.description}_getType(e){return Jd(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Jd(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Us,ctx:{common:e.parent.common,data:e.data,parsedType:Jd(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Pv(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Jd(e)},i=this._parseSync({data:e,path:r.path,parent:r});return RK(r,i)}"~validate"(e){var r,i;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Jd(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:n});return O1(s)?{value:s.value}:{issues:n.common.issues}}catch(s){(i=(r=s==null?void 0:s.message)==null?void 0:r.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(s=>O1(s)?{value:s.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Jd(e)},i=this._parse({data:e,path:r.path,parent:r}),s=await(Pv(i)?i:Promise.resolve(i));return RK(r,s)}refine(e,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,s)=>{const a=e(i),o=()=>s.addIssue({code:Fe.custom,...r(i)});
vendor: 6,200 bytes, line 1186
1186return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(o(),!1)):a?!0:(o(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new Df({schema:this,typeName:Pt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Tu.create(this,this._def)}nullable(){return Uf.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return sc.create(this)}promise(){return Bv.create(this,this._def)}or(e){return jv.create([this,e],this._def)}and(e){return Mv.create(this,e,this._def)}transform(e){return new Df({...Jt(this._def),schema:this,typeName:Pt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Fv({...Jt(this._def),innerType:this,defaultValue:n,typeName:Pt.ZodDefault})}brand(){return new wce({typeName:Pt.ZodBranded,type:this,...Jt(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new zv({...Jt(this._def),innerType:this,catchValue:n,typeName:Pt.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return OP.create(this,e)}readonly(){return Vv.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const klt=/^c[^\s-]{8,}$/i,Tlt=/^[0-9a-z]+$/,Llt=/^[0-9A-HJKMNP-TV-Z]{26}$/i,$lt=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Ilt=/^[a-z0-9_-]{21}$/i,Nlt=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Olt=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Plt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Rlt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let fA;const jlt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Mlt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Dlt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Ult=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Blt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Flt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,yce="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",zlt=new RegExp(`^${yce}$`);function gce(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function Vlt(t){return new RegExp(`^${gce(t)}$`)}function Hlt(t){let e=`${yce}T${gce(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function Wlt(t,e){return!!((e==="v4"||!e)&&jlt.test(t)||(e==="v6"||!e)&&Dlt.test(t))}function qlt(t,e){if(!Nlt.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function Zlt(t,e){return!!((e==="v4"||!e)&&Mlt.test(t)||(e==="v6"||!e)&&Ult.test(t))}class Xl extends fn{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==st.string){const s=this._getOrReturnCtx(e);return Xe(s,{code:Fe.invalid_type,expected:st.string,received:s.parsedType}),Ot}
vendor: 18,286 bytes, line 1186
1186const r=new Us;let i;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),Xe(i,{code:Fe.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),Xe(i,{code:Fe.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const a=e.data.length>s.value,o=e.data.length<s.value;(a||o)&&(i=this._getOrReturnCtx(e,i),a?Xe(i,{code:Fe.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&Xe(i,{code:Fe.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")Plt.test(e.data)||(i=this._getOrReturnCtx(e,i),Xe(i,{validation:"email",code:Fe.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")fA||(fA=new RegExp(Rlt,"u")),fA.test(e.data)||(i=this._getOrReturnCtx(e,i),Xe(i,{validation:"emoji",code:Fe.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")$lt.test(e.data)||(i=this._getOrReturnCtx(e,i),Xe(i,{validation:"uuid",code:Fe.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")Ilt.test(e.data)||(i=this._getOrReturnCtx(e,i),Xe(i,{validation:"nanoid",code:Fe.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")klt.test(e.data)||(i=this._getOrReturnCtx(e,i),Xe(i,{validation:"cuid",code:Fe.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")Tlt.test(e.data)||(i=this._getOrReturnCtx(e,i),Xe(i,{validation:"cuid2",code:Fe.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")Llt.test(e.data)||(i=this._getOrReturnCtx(e,i),Xe(i,{validation:"ulid",code:Fe.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),Xe(i,{validation:"url",code:Fe.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Xe(i,{validation:"regex",code:Fe.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),Xe(i,{code:Fe.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),Xe(i,{code:Fe.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),Xe(i,{code:Fe.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?Hlt(s).test(e.data)||(i=this._getOrReturnCtx(e,i),Xe(i,{code:Fe.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?zlt.test(e.data)||(i=this._getOrReturnCtx(e,i),Xe(i,{code:Fe.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?Vlt(s).test(e.data)||(i=this._getOrReturnCtx(e,i),Xe(i,{code:Fe.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?Olt.test(e.data)||(i=this._getOrReturnCtx(e,i),Xe(i,{validation:"duration",code:Fe.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?Wlt(e.data,s.version)||(i=this._getOrReturnCtx(e,i),Xe(i,{validation:"ip",code:Fe.invalid_string,message:s.message}),r.dirty()):s.kind==="jwt"?qlt(e.data,s.alg)||(i=this._getOrReturnCtx(e,i),Xe(i,{validation:"jwt",code:Fe.invalid_string,message:s.message}),r.dirty()):s.kind==="cidr"?Zlt(e.data,s.version)||(i=this._getOrReturnCtx(e,i),Xe(i,{validation:"cidr",code:Fe.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?Blt.test(e.data)||(i=this._getOrReturnCtx(e,i),Xe(i,{validation:"base64",code:Fe.invalid_string,message:s.message}),r.dirty()):s.kind==="base64url"?Flt.test(e.data)||(i=this._getOrReturnCtx(e,i),Xe(i,{validation:"base64url",code:Fe.invalid_string,message:s.message}),r.dirty()):Cn.assertNever(s);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:Fe.invalid_string,...mt.errToObj(r)})}_addCheck(e){return new Xl({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...mt.errToObj(e)})}url(e){return this._addCheck({kind:"url",...mt.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...mt.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...mt.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...mt.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...mt.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...mt.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...mt.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...mt.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...mt.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...mt.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...mt.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...mt.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...mt.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...mt.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...mt.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...mt.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...mt.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...mt.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...mt.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...mt.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...mt.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...mt.errToObj(n)})}nonempty(e){return this.min(1,mt.errToObj(e))}trim(){return new Xl({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Xl({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Xl({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Xl.create=t=>new Xl({checks:[],typeName:Pt.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...Jt(t)});function Klt(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,s=Number.parseInt(t.toFixed(i).replace(".","")),a=Number.parseInt(e.toFixed(i).replace(".",""));return s%a/10**i}class Pf extends fn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==st.number){const s=this._getOrReturnCtx(e);return Xe(s,{code:Fe.invalid_type,expected:st.number,received:s.parsedType}),Ot}let r;const i=new Us;for(const s of this._def.checks)s.kind==="int"?Cn.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),Xe(r,{code:Fe.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),Xe(r,{code:Fe.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),Xe(r,{code:Fe.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?Klt(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),Xe(r,{code:Fe.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),Xe(r,{code:Fe.not_finite,message:s.message}),i.dirty()):Cn.assertNever(s);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,mt.toString(n))}gt(e,n){return this.setLimit("min",e,!1,mt.toString(n))}lte(e,n){return this.setLimit("max",e,!0,mt.toString(n))}lt(e,n){return this.setLimit("max",e,!1,mt.toString(n))}setLimit(e,n,r,i){return new Pf({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:mt.toString(i)}]})}_addCheck(e){return new Pf({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:mt.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:mt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:mt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:mt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:mt.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:mt.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:mt.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:mt.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:mt.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Cn.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}Pf.create=t=>new Pf({checks:[],typeName:Pt.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Jt(t)});class Rf extends fn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==st.bigint)return this._getInvalidInput(e);let r;const i=new Us;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),Xe(r,{code:Fe.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),Xe(r,{code:Fe.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),Xe(r,{code:Fe.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):Cn.assertNever(s);return{status:i.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return Xe(n,{code:Fe.invalid_type,expected:st.bigint,received:n.parsedType}),Ot}gte(e,n){return this.setLimit("min",e,!0,mt.toString(n))}gt(e,n){return this.setLimit("min",e,!1,mt.toString(n))}lte(e,n){return this.setLimit("max",e,!0,mt.toString(n))}lt(e,n){return this.setLimit("max",e,!1,mt.toString(n))}setLimit(e,n,r,i){return new Rf({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:mt.toString(i)}]})}_addCheck(e){return new Rf({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:mt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:mt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:mt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:mt.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:mt.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Rf.create=t=>new Rf({checks:[],typeName:Pt.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...Jt(t)});class Rv extends fn{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==st.boolean){const r=this._getOrReturnCtx(e);return Xe(r,{code:Fe.invalid_type,expected:st.boolean,received:r.parsedType}),Ot}return zo(e.data)}}Rv.create=t=>new Rv({typeName:Pt.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Jt(t)});class P1 extends fn{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==st.date){const s=this._getOrReturnCtx(e);return Xe(s,{code:Fe.invalid_type,expected:st.date,received:s.parsedType}),Ot}if(Number.isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return Xe(s,{code:Fe.invalid_date}),Ot}const r=new Us;let i;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),Xe(i,{code:Fe.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),Xe(i,{code:Fe.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):Cn.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new P1({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:mt.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:mt.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}P1.create=t=>new P1({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:Pt.ZodDate,...Jt(t)});class jK extends fn{_parse(e){if(this._getType(e)!==st.symbol){const r=this._getOrReturnCtx(e);return Xe(r,{code:Fe.invalid_type,expected:st.symbol,received:r.parsedType}),Ot}return zo(e.data)}}jK.create=t=>new jK({typeName:Pt.ZodSymbol,...Jt(t)});class L$ extends fn{_parse(e){if(this._getType(e)!==st.undefined){const r=this._getOrReturnCtx(e);return Xe(r,{code:Fe.invalid_type,expected:st.undefined,received:r.parsedType}),Ot}return zo(e.data)}}L$.create=t=>new L$({typeName:Pt.ZodUndefined,...Jt(t)});class $$ extends fn{_parse(e){if(this._getType(e)!==st.null){const r=this._getOrReturnCtx(e);return Xe(r,{code:Fe.invalid_type,expected:st.null,received:r.parsedType}),Ot}return zo(e.data)}}$$.create=t=>new $$({typeName:Pt.ZodNull,...Jt(t)});class I$ extends fn{constructor(){super(...arguments),this._any=!0}_parse(e){return zo(e.data)}}I$.create=t=>new I$({typeName:Pt.ZodAny,...Jt(t)});class MK extends fn{constructor(){super(...arguments),this._unknown=!0}_parse(e){return zo(e.data)}}MK.create=t=>new MK({typeName:Pt.ZodUnknown,...Jt(t)});class j2 extends fn{_parse(e){const n=this._getOrReturnCtx(e);return Xe(n,{code:Fe.invalid_type,expected:st.never,received:n.parsedType}),Ot}}j2.create=t=>new j2({typeName:Pt.ZodNever,...Jt(t)});class DK extends fn{_parse(e){if(this._getType(e)!==st.undefined){const r=this._getOrReturnCtx(e);return Xe(r,{code:Fe.invalid_type,expected:st.void,received:r.parsedType}),Ot}return zo(e.data)}}DK.create=t=>new DK({typeName:Pt.ZodVoid,...Jt(t)});class sc extends fn{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==st.array)return Xe(n,{code:Fe.invalid_type,expected:st.array,received:n.parsedType}),Ot;if(i.exactLength!==null){const a=n.data.length>i.exactLength.value,o=n.data.length<i.exactLength.value;(a||o)&&(Xe(n,{code:a?Fe.too_big:Fe.too_small,minimum:o?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(Xe(n,{code:Fe.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(Xe(n,{code:Fe.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,o)=>i.type._parseAsync(new hc(n,a,n.path,o)))).then(a=>Us.mergeArray(r,a));const s=[...n.data].map((a,o)=>i.type._parseSync(new hc(n,a,n.path,o)));return Us.mergeArray(r,s)}
vendor: 4,181 bytes, line 1186
1186get element(){return this._def.type}min(e,n){return new sc({...this._def,minLength:{value:e,message:mt.toString(n)}})}max(e,n){return new sc({...this._def,maxLength:{value:e,message:mt.toString(n)}})}length(e,n){return new sc({...this._def,exactLength:{value:e,message:mt.toString(n)}})}nonempty(e){return this.min(1,e)}}sc.create=(t,e)=>new sc({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Pt.ZodArray,...Jt(e)});function S0(t){if(t instanceof yi){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=Tu.create(S0(r))}return new yi({...t._def,shape:()=>e})}else return t instanceof sc?new sc({...t._def,type:S0(t.element)}):t instanceof Tu?Tu.create(S0(t.unwrap())):t instanceof Uf?Uf.create(S0(t.unwrap())):t instanceof jf?jf.create(t.items.map(e=>S0(e))):t}class yi extends fn{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Cn.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==st.object){const u=this._getOrReturnCtx(e);return Xe(u,{code:Fe.invalid_type,expected:st.object,received:u.parsedType}),Ot}const{status:r,ctx:i}=this._processInputParams(e),{shape:s,keys:a}=this._getCached(),o=[];if(!(this._def.catchall instanceof j2&&this._def.unknownKeys==="strip"))for(const u in i.data)a.includes(u)||o.push(u);const l=[];for(const u of a){const f=s[u],p=i.data[u];l.push({key:{status:"valid",value:u},value:f._parse(new hc(i,p,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof j2){const u=this._def.unknownKeys;if(u==="passthrough")for(const f of o)l.push({key:{status:"valid",value:f},value:{status:"valid",value:i.data[f]}});else if(u==="strict")o.length>0&&(Xe(i,{code:Fe.unrecognized_keys,keys:o}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const f of o){const p=i.data[f];l.push({key:{status:"valid",value:f},value:u._parse(new hc(i,p,i.path,f)),alwaysSet:f in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const f of l){const p=await f.key,y=await f.value;u.push({key:p,value:y,alwaysSet:f.alwaysSet})}return u}).then(u=>Us.mergeObjectSync(r,u)):Us.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return mt.errToObj,new yi({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var s,a;const i=((a=(s=this._def).errorMap)==null?void 0:a.call(s,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:mt.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new yi({...this._def,unknownKeys:"strip"})}passthrough(){return new yi({...this._def,unknownKeys:"passthrough"})}extend(e){return new yi({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new yi({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Pt.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new yi({...this._def,catchall:e})}pick(e){const n={};for(const r of Cn.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new yi({...this._def,shape:()=>n})}omit(e){const n={};for(const r of Cn.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new yi({...this._def,shape:()=>n})}deepPartial(){return S0(this)}partial(e){const n={};for(const r of Cn.objectKeys(this.shape)){const i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}return new yi({...this._def,shape:()=>n})}required(e){const n={};for(const r of Cn.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof Tu;)s=s._def.innerType;n[r]=s}return new yi({...this._def,shape:()=>n})}keyof(){return bce(Cn.objectKeys(this.shape))}}yi.create=(t,e)=>new yi({shape:()=>t,unknownKeys:"strip",catchall:j2.create(),typeName:Pt.ZodObject,...Jt(e)});yi.strictCreate=(t,e)=>new yi({shape:()=>t,unknownKeys:"strict",catchall:j2.create(),typeName:Pt.ZodObject,...Jt(e)});yi.lazycreate=(t,e)=>new yi({shape:t,unknownKeys:"strip",catchall:j2.create(),typeName:Pt.ZodObject,...Jt(e)});
vendor: 5,201 bytes, line 1186
1186class jv extends fn{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function i(s){for(const o of s)if(o.result.status==="valid")return o.result;for(const o of s)if(o.result.status==="dirty")return n.common.issues.push(...o.ctx.common.issues),o.result;const a=s.map(o=>new Uu(o.ctx.common.issues));return Xe(n,{code:Fe.invalid_union,unionErrors:a}),Ot}if(n.common.async)return Promise.all(r.map(async s=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(i);{let s;const a=[];for(const l of r){const u={...n,common:{...n.common,issues:[]},parent:null},f=l._parseSync({data:n.data,path:n.path,parent:u});if(f.status==="valid")return f;f.status==="dirty"&&!s&&(s={result:f,ctx:u}),u.common.issues.length&&a.push(u.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const o=a.map(l=>new Uu(l));return Xe(n,{code:Fe.invalid_union,unionErrors:o}),Ot}}get options(){return this._def.options}}jv.create=(t,e)=>new jv({options:t,typeName:Pt.ZodUnion,...Jt(e)});const nu=t=>t instanceof O$?nu(t.schema):t instanceof Df?nu(t.innerType()):t instanceof Uv?[t.value]:t instanceof Mf?t.options:t instanceof P$?Cn.objectValues(t.enum):t instanceof Fv?nu(t._def.innerType):t instanceof L$?[void 0]:t instanceof $$?[null]:t instanceof Tu?[void 0,...nu(t.unwrap())]:t instanceof Uf?[null,...nu(t.unwrap())]:t instanceof wce||t instanceof Vv?nu(t.unwrap()):t instanceof zv?nu(t._def.innerType):[];class NP extends fn{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==st.object)return Xe(n,{code:Fe.invalid_type,expected:st.object,received:n.parsedType}),Ot;const r=this.discriminator,i=n.data[r],s=this.optionsMap.get(i);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(Xe(n,{code:Fe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Ot)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const i=new Map;for(const s of n){const a=nu(s.shape[e]);if(!a.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of a){if(i.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);i.set(o,s)}}return new NP({typeName:Pt.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...Jt(r)})}}function N$(t,e){const n=Jd(t),r=Jd(e);if(t===e)return{valid:!0,data:t};if(n===st.object&&r===st.object){const i=Cn.objectKeys(e),s=Cn.objectKeys(t).filter(o=>i.indexOf(o)!==-1),a={...t,...e};for(const o of s){const l=N$(t[o],e[o]);if(!l.valid)return{valid:!1};a[o]=l.data}return{valid:!0,data:a}}else if(n===st.array&&r===st.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let s=0;s<t.length;s++){const a=t[s],o=e[s],l=N$(a,o);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===st.date&&r===st.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Mv extends fn{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=(s,a)=>{if(OK(s)||OK(a))return Ot;const o=N$(s.value,a.value);return o.valid?((PK(s)||PK(a))&&n.dirty(),{status:n.value,value:o.data}):(Xe(r,{code:Fe.invalid_intersection_types}),Ot)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,a])=>i(s,a)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Mv.create=(t,e,n)=>new Mv({left:t,right:e,typeName:Pt.ZodIntersection,...Jt(n)});class jf extends fn{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==st.array)return Xe(r,{code:Fe.invalid_type,expected:st.array,received:r.parsedType}),Ot;if(r.data.length<this._def.items.length)return Xe(r,{code:Fe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ot;!this._def.rest&&r.data.length>this._def.items.length&&(Xe(r,{code:Fe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((a,o)=>{const l=this._def.items[o]||this._def.rest;return l?l._parse(new hc(r,a,r.path,o)):null}).filter(a=>!!a);return r.common.async?Promise.all(s).then(a=>Us.mergeArray(n,a)):Us.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new jf({...this._def,rest:e})}}jf.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new jf({items:t,typeName:Pt.ZodTuple,rest:null,...Jt(e)})};class Dv extends fn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==st.object)return Xe(r,{code:Fe.invalid_type,expected:st.object,received:r.parsedType}),Ot;const i=[],s=this._def.keyType,a=this._def.valueType;for(const o in r.data)i.push({key:s._parse(new hc(r,o,r.path,o)),value:a._parse(new hc(r,r.data[o],r.path,o)),al
vendor: 4,850 bytes, line 1186
1186waysSet:o in r.data});return r.common.async?Us.mergeObjectAsync(n,i):Us.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof fn?new Dv({keyType:e,valueType:n,typeName:Pt.ZodRecord,...Jt(r)}):new Dv({keyType:Xl.create(),valueType:e,typeName:Pt.ZodRecord,...Jt(n)})}}class UK extends fn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==st.map)return Xe(r,{code:Fe.invalid_type,expected:st.map,received:r.parsedType}),Ot;const i=this._def.keyType,s=this._def.valueType,a=[...r.data.entries()].map(([o,l],u)=>({key:i._parse(new hc(r,o,r.path,[u,"key"])),value:s._parse(new hc(r,l,r.path,[u,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const l of a){const u=await l.key,f=await l.value;if(u.status==="aborted"||f.status==="aborted")return Ot;(u.status==="dirty"||f.status==="dirty")&&n.dirty(),o.set(u.value,f.value)}return{status:n.value,value:o}})}else{const o=new Map;for(const l of a){const u=l.key,f=l.value;if(u.status==="aborted"||f.status==="aborted")return Ot;(u.status==="dirty"||f.status==="dirty")&&n.dirty(),o.set(u.value,f.value)}return{status:n.value,value:o}}}}UK.create=(t,e,n)=>new UK({valueType:e,keyType:t,typeName:Pt.ZodMap,...Jt(n)});class A6 extends fn{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==st.set)return Xe(r,{code:Fe.invalid_type,expected:st.set,received:r.parsedType}),Ot;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(Xe(r,{code:Fe.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(Xe(r,{code:Fe.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const s=this._def.valueType;function a(l){const u=new Set;for(const f of l){if(f.status==="aborted")return Ot;f.status==="dirty"&&n.dirty(),u.add(f.value)}return{status:n.value,value:u}}const o=[...r.data.values()].map((l,u)=>s._parse(new hc(r,l,r.path,u)));return r.common.async?Promise.all(o).then(l=>a(l)):a(o)}min(e,n){return new A6({...this._def,minSize:{value:e,message:mt.toString(n)}})}max(e,n){return new A6({...this._def,maxSize:{value:e,message:mt.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}A6.create=(t,e)=>new A6({valueType:t,minSize:null,maxSize:null,typeName:Pt.ZodSet,...Jt(e)});class O$ extends fn{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}O$.create=(t,e)=>new O$({getter:t,typeName:Pt.ZodLazy,...Jt(e)});class Uv extends fn{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return Xe(n,{received:n.data,code:Fe.invalid_literal,expected:this._def.value}),Ot}return{status:"valid",value:e.data}}get value(){return this._def.value}}Uv.create=(t,e)=>new Uv({value:t,typeName:Pt.ZodLiteral,...Jt(e)});function bce(t,e){return new Mf({values:t,typeName:Pt.ZodEnum,...Jt(e)})}class Mf extends fn{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return Xe(n,{expected:Cn.joinValues(r),received:n.parsedType,code:Fe.invalid_type}),Ot}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return Xe(n,{received:n.data,code:Fe.invalid_enum_value,options:r}),Ot}return zo(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return Mf.create(e,{...this._def,...n})}exclude(e,n=this._def){return Mf.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}Mf.create=bce;class P$ extends fn{_parse(e){const n=Cn.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==st.string&&r.parsedType!==st.number){const i=Cn.objectValues(n);return Xe(r,{expected:Cn.joinValues(i),received:r.parsedType,code:Fe.invalid_type}),Ot}if(this._cache||(this._cache=new Set(Cn.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const i=Cn.objectValues(n);return Xe(r,{received:r.data,code:Fe.invalid_enum_value,options:i}),Ot}return zo(e.data)}get enum(){return this._def.values}}P$.create=(t,e)=>new P$({values:t,typeName:Pt.ZodNativeEnum,...Jt(e)});class Bv extends fn{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==st.promise&&n.common.async===!1)return Xe(n,{code:Fe.invalid_type,expected:st.promise,received:n.parsedType}),Ot;
vendor: 4,098 bytes, line 1186
1186const r=n.parsedType===st.promise?n.data:Promise.resolve(n.data);return zo(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Bv.create=(t,e)=>new Bv({type:t,typeName:Pt.ZodPromise,...Jt(e)});class Df extends fn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Pt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:a=>{Xe(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const a=i.transform(r.data,s);if(r.common.async)return Promise.resolve(a).then(async o=>{if(n.value==="aborted")return Ot;const l=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return l.status==="aborted"?Ot:l.status==="dirty"||n.value==="dirty"?Eg(l.value):l});{if(n.value==="aborted")return Ot;const o=this._def.schema._parseSync({data:a,path:r.path,parent:r});return o.status==="aborted"?Ot:o.status==="dirty"||n.value==="dirty"?Eg(o.value):o}}if(i.type==="refinement"){const a=o=>{const l=i.refinement(o,s);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Ot:(o.status==="dirty"&&n.dirty(),a(o.value),{status:n.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?Ot:(o.status==="dirty"&&n.dirty(),a(o.value).then(()=>({status:n.value,value:o.value}))))}if(i.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!O1(a))return Ot;const o=i.transform(a.value,s);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>O1(a)?Promise.resolve(i.transform(a.value,s)).then(o=>({status:n.value,value:o})):Ot);Cn.assertNever(i)}}Df.create=(t,e,n)=>new Df({schema:t,typeName:Pt.ZodEffects,effect:e,...Jt(n)});Df.createWithPreprocess=(t,e,n)=>new Df({schema:e,effect:{type:"preprocess",transform:t},typeName:Pt.ZodEffects,...Jt(n)});class Tu extends fn{_parse(e){return this._getType(e)===st.undefined?zo(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Tu.create=(t,e)=>new Tu({innerType:t,typeName:Pt.ZodOptional,...Jt(e)});class Uf extends fn{_parse(e){return this._getType(e)===st.null?zo(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Uf.create=(t,e)=>new Uf({innerType:t,typeName:Pt.ZodNullable,...Jt(e)});class Fv extends fn{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===st.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Fv.create=(t,e)=>new Fv({innerType:t,typeName:Pt.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Jt(e)});class zv extends fn{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Pv(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Uu(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Uu(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}zv.create=(t,e)=>new zv({innerType:t,typeName:Pt.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Jt(e)});class BK extends fn{_parse(e){if(this._getType(e)!==st.nan){const r=this._getOrReturnCtx(e);return Xe(r,{code:Fe.invalid_type,expected:st.nan,received:r.parsedType}),Ot}
1186return{status:"valid",value:e.data}}}BK.create=t=>new BK({typeName:Pt.ZodNaN,...Jt(t)});class wce extends fn{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class OP extends fn{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Ot:s.status==="dirty"?(n.dirty(),Eg(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Ot:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new OP({in:e,out:n,typeName:Pt.ZodPipeline})}}class Vv extends fn{_parse(e){const n=this._def.innerType._parse(e),r=i=>(O1(i)&&(i.value=Object.freeze(i.value)),i);return Pv(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}Vv.create=(t,e)=>new Vv({innerType:t,typeName:Pt.ZodReadonly,...Jt(e)});var Pt;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Pt||(Pt={}));const pr=Xl.create,So=Pf.create;Rf.create;const vce=Rv.create,Glt=P1.create,R1=I$.create;j2.create;const D9=sc.create,qi=yi.create,_ce=jv.create,Ylt=NP.create;Mv.create;jf.create;const pf=Dv.create,Jlt=Uv.create,_c=Mf.create;Bv.create;Tu.create;Uf.create;const Xlt={string:(t=>Xl.create({...t,coerce:!0})),number:(t=>Pf.create({...t,coerce:!0})),boolean:(t=>Rv.create({...t,coerce:!0})),bigint:(t=>Rf.create({...t,coerce:!0})),date:(t=>P1.create({...t,coerce:!0}))},Qlt="0x0000000000000000000000000000000000008006",ect="0x0000000000000000000000000000000000010000",FK=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"accountAddress",type:"address"},{indexed:!1,internalType:"enum IContractDeployer.AccountNonceOrdering",name:"nonceOrdering",type:"uint8"}],name:"AccountNonceOrderingUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"accountAddress",type:"address"},{indexed:!1,internalType:"enum IContractDeployer.AccountAbstractionVersion",name:"aaVersion",type:"uint8"}],name:"AccountVersionUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"deployerAddress",type:"address"},{indexed:!0,internalType:"bytes32",name:"bytecodeHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"contractAddress",type:"address"}],name:"ContractDeployed",type:"event"},{inputs:[{internalType:"bytes32",name:"_salt",type:"bytes32"},{internalType:"bytes32",name:"_bytecodeHash",type:"bytes32"},{internalType:"bytes",name:"_input",type:"bytes"}],name:"create",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes32",name:"_salt",type:"bytes32"},{internalType:"bytes32",name:"_bytecodeHash",type:"bytes32"},{internalType:"bytes",name:"_input",type:"bytes"}],name:"create2",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes32",name:"_salt",type:"bytes32"},{internalType:"bytes32",name:"_bytecodeHash",type:"bytes32"},{internalType:"bytes",name:"_input",type:"bytes"},{internalType:"enum IContractDeployer.AccountAbstractionVersion",name:"_aaVersion",type:"uint8"}],name:"create2Account",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"bytes32",name:"_bytecodeHash",type:"bytes32"},{internalType:"bytes",name:"_input",type:"bytes"},{internalType:"enum IContractDeployer.AccountAbstractionVersion",name:"_aaVersion",type:"uint8"}],name:"createAccount",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"_address",type:"address"}],name:"extendedAccountVersion",outputs:[{internalType:"enum IContractDeployer.AccountAbstractionVersion",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"_keccak256BytecodeHash",type:"bytes32"}],name:"forceDeployKeccak256",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"bytes32",name:"bytecodeHash",type:"bytes32"},{internalType:"address",name:"newAddress",type:"address"},{internalType:"bool",name:"callConstructor",type:"bool"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"input",type:"bytes"}],internalType:"struct ContractDeployer.ForceDeployment",name:"_deployment",type:"tuple"},{internalType:"address",name:"_sender",type:"address"}],name:"forceDeployOnAddress",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"bytes32",name:"bytecodeHash",type:"bytes32"},{internalType:"address",name:"newAddress",type:"address"},{internalType:"bool",name:"callConstructor",type:"bool"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"input",type:"bytes"}],internalType:"struct ContractDeployer.ForceDeployment[]",name:"_deployments",type:"tuple[]"}],name:"forceDeployOnAddresses",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"_address",type:"address"}],name:"getAccountInfo",outputs:[{components:[{internalType:"enum IContractDeployer.AccountAbstractionVersion",name:"supportedAAVersion",type:"uint8"},{internalType:"enum IContractDeployer.AccountNonceOrdering",name:"nonceOrdering",type:"uint8"}],internalType:"struct IContractDeployer.AccountInfo",name:"info",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_sender",type:"address"},{internalType:"uint256",name:"_senderNonce",type:"uint256"}],name:"getNewAddressCreate",outputs:[{internalType:"address",name:"newAddress",type:"address"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"_sender",type:"address"},{internalType:"bytes32",name:"_bytecodeHash",type:"bytes32"},{internalType:"bytes32",name:"_salt",type:"bytes32"},{internalType:"bytes",name:"_input",type:"bytes"}],name:"getNewAddressCreate2",outputs:[{internalType:"address",name:"newAddress",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"enum IContractDeployer.AccountAbstractionVersion",name:"_version",type:"uint8"}],name:"updateAccountVersion",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"enum IContractDeployer.AccountNonceOrdering",name:"_nonceOrdering",type:"uint8"}],name:"updateNonceOrdering",outputs:[],stateMutability:"nonpayable",type:"function"}],zK=1,pA="/docs/contract/encodeDeployData";function tct(t){const{abi:e,args:n,bytecode:r,deploymentType:i,salt:s}=t;if(!n||n.length===0){const{functionName:f,argsContractDeployer:p}=VK(i,s??SF,Dt(eT(r)),"0x");return cs({abi:FK,functionName:f,args:p})}const a=e.find(f=>"type"in f&&f.type==="constructor");if(!a)throw new BX({docsPath:pA});if(!("inputs"in a))throw new f8({docsPath:pA});if(!a.inputs||a.inputs.length===0)throw new f8({docsPath:pA});const o=U2(a.inputs,n),{functionName:l,argsContractDeployer:u}=VK(i,s??SF,Dt(eT(r)),o);return cs({abi:FK,functionName:l,args:u})}function VK(t,e,n,r){const i=[e,n,r];
1186return{create:{functionName:"create",argsContractDeployer:i},create2:{functionName:"create2",argsContractDeployer:i},createAccount:{functionName:"createAccount",argsContractDeployer:[...i,zK]},create2Account:{functionName:"create2Account",argsContractDeployer:[...i,zK]}}[t||"create"]}function xce(t){if(!r5(t))throw new Lte;gc(t)}async function nct(t,e){var u,f,p;const{account:n=t.account,chain:r=t.chain,...i}=e,s=n?hn(n):t.account;if(!s)throw new Mo({docsPath:"/docs/actions/wallet/signTransaction"});if(xce({account:s,chain:r,...e}),!((u=r==null?void 0:r.custom)!=null&&u.getEip712Domain))throw new Se("`getEip712Domain` not found on chain.");if(!((f=r==null?void 0:r.serializers)!=null&&f.transaction))throw new Se("transaction serializer not found on chain.");const a=await Ye(t,bc,"getChainId")({});r!==null&&Y6({currentChainId:a,chain:r});const o=r==null?void 0:r.custom.getEip712Domain({...i,chainId:a,from:s.address,type:"eip712"}),l=await vte(t,{...o,account:s});return(p=r==null?void 0:r.serializers)==null?void 0:p.transaction({chainId:a,...i,customSignature:l,type:"eip712"},{r:"0x0",s:"0x0",v:0n})}async function Cce(t,e){return r5(e)?nct(t,e):await wte(t,e)}async function Ece(t,e){const{account:n=t.account,chain:r=t.chain}=e,i=n?hn(n):t.account;if(!i)throw new Mo({docsPath:"/docs/actions/wallet/sendTransaction"});try{xce(e);const s=await Q1(t,{...e,nonceManager:i.nonceManager,parameters:["gas","nonce","fees"]});let a;r!==null&&(a=await Ye(t,bc,"getChainId")({}),Y6({currentChainId:a,chain:r}));const o=await Cce(t,{...s,chainId:a});return await Ye(t,$7,"sendRawTransaction")({serializedTransaction:o})}catch(s){throw W6(s,{...e,account:i,chain:r})}}function rct(t,e){const{abi:n,args:r,bytecode:i,deploymentType:s,salt:a,...o}=e,l=tct({abi:n,args:r,bytecode:i,deploymentType:s,salt:a});return o.factoryDeps=o.factoryDeps||[],o.factoryDeps.includes(i)||o.factoryDeps.push(i),Ece(t,{...o,data:l,to:s==="create2"||s==="create2Account"?ect:Qlt})}async function HK(t,e){return r5(e)?Ece(t,e):am(t,e)}function ict(){return t=>({sendTransaction:e=>HK(t,e),signTransaction:e=>Cce(t,e),deployContract:e=>rct(t,e),writeContract:e=>$o(Object.assign(t,{sendTransaction:n=>HK(t,n)}),e)})}var sct=10,act=-32700,oct=-32603,lct=-32602,cct=-32601,uct=-32600,dct=-32015,hct=-32014,fct=-32012,pct=-32010,mct=-32009,yct=-32007,gct=-32006,bct=-32004,WK=-32002,wct=-32001,vct=28e5,_ct=2800001,xct=2800003,Cct=2800006,Ect=2800007,Sce=2800008,Sct=2800009,y4t=32300001,g4t=3230004,Act=361e4,kct=3610001,Tct=3610003,Lct=3610005,$ct=3610006,Ict=3610007,Nct=3611e3,Oct=3704e3,Pct=3704001,Rct=3704004,jct=4615e3,Mct=4615026,Dct=5663e3,qK=5663001,Uct=5663004,Bct=5663005,Fct=5663006,zct=5663007,Vct=5663008,Hct=5663015,Wct=5663016,qct=5663017,Ace=5663021,Zct=705e4,Kct=7050030,Gct=7050031,Yct=7050035,Jct=8078e3,Xct=8078001,Qct=8078004,eut=8078005,tut=8078006,nut=8078007,rut=8078011,Hv=8078012,iut=8078013,sut=8078014,aut=8078017,kce=81e5,out=8100002,lut=8100003,cut=819e4,uut=8190001,dut=8190002,R$=8190003,hut=8190004,fut=99e5,put=9900001,mut=9900004;function Tce(t){return Array.isArray(t)?"%5B"+t.map(Tce).join("%2C%20")+"%5D":typeof t=="bigint"?`${t}n`:encodeURIComponent(String(t!=null&&Object.getPrototypeOf(t)===null?{...t}:t))}function yut([t,e]){return`${t}=${Tce(e)}`}function gut(t){const e=Object.entries(t).map(yut).join("&");return btoa(e)}function but(t,e={}){{let n=`Solana error #${t}; Decode this error by running \`npx @solana/errors decode -- ${t}`;return Object.keys(e).length&&(n+=` '${gut(e)}'`),`${n}\``}}function Lce(t,e){return t instanceof Error&&t.name==="SolanaError"?e!==void 0?t.context.__code===e:!0:!1}var ht=class extends Error{constructor(...[e,n]){let r,i;n&&Object.entries(Object.getOwnPropertyDescriptors(n)).forEach(([a,o])=>{a==="cause"?i={cause:o.value}:(r===void 0&&(r={__code:e}),Object.defineProperty(r,a,o))});const s=but(e,r);super(s,i);fe(this,"cause",this.cause);fe(this,"context");this.context=Object.freeze(r===void 0?{__code:e}:r),this.name="SolanaError"}};function U9(...t){"captureStackTrace"in Error&&typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(...t)}function $ce({errorCodeBaseOffset:t,getErrorContext:e,orderedErrorNames:n,rpcEnumError:r},i){let s,a;typeof r=="string"?s=r:(s=Object.keys(r)[0],a=r[s]);const o=n.indexOf(s),l=t+o,u=e(l,s,a),f=new ht(l,u);return U9(f,i),f}var wut=["GenericError","InvalidArgument","InvalidInstructionData","InvalidAccountData","AccountDataTooSmall","InsufficientFunds","IncorrectProgramId","MissingRequiredSignature","AccountAlreadyInitialized","UninitializedAccount","UnbalancedInstruction","ModifiedProgramId","ExternalAccountLamportSpend","ExternalAccountDataModified","ReadonlyLamportChange","ReadonlyDataModified","DuplicateAccountIndex","ExecutableModified","RentEpochModified","NotEnoughAccountKeys","A
1186ccountDataSizeChanged","AccountNotExecutable","AccountBorrowFailed","AccountBorrowOutstanding","DuplicateAccountOutOfSync","Custom","InvalidError","ExecutableDataModified","ExecutableLamportChange","ExecutableAccountNotRentExempt","UnsupportedProgramId","CallDepth","MissingAccount","ReentrancyNotAllowed","MaxSeedLengthExceeded","InvalidSeeds","InvalidRealloc","ComputationalBudgetExceeded","PrivilegeEscalation","ProgramEnvironmentSetupFailure","ProgramFailedToComplete","ProgramFailedToCompile","Immutable","IncorrectAuthority","BorshIoError","AccountNotRentExempt","InvalidAccountOwner","ArithmeticOverflow","UnsupportedSysvar","IllegalOwner","MaxAccountsDataAllocationsExceeded","MaxAccountsExceeded","MaxInstructionTraceLengthExceeded","BuiltinProgramsMustConsumeComputeUnits"];function Ice(t,e){const n=Number(t);return $ce({errorCodeBaseOffset:4615001,getErrorContext(r,i,s){return r===jct?{errorName:i,index:n,...s!==void 0?{instructionErrorContext:s}:null}:r===Mct?{code:Number(s),index:n}:{index:n}},orderedErrorNames:wut,rpcEnumError:e},Ice)}var vut=["AccountInUse","AccountLoadedTwice","AccountNotFound","ProgramAccountNotFound","InsufficientFundsForFee","InvalidAccountForFee","AlreadyProcessed","BlockhashNotFound","CallChainTooDeep","MissingSignatureForFee","InvalidAccountIndex","SignatureFailure","InvalidProgramForExecution","SanitizeFailure","ClusterMaintenance","AccountBorrowOutstanding","WouldExceedMaxBlockCostLimit","UnsupportedVersion","InvalidWritableAccount","WouldExceedMaxAccountCostLimit","WouldExceedAccountDataBlockLimit","TooManyAccountLocks","AddressLookupTableNotFound","InvalidAddressLookupTableOwner","InvalidAddressLookupTableData","InvalidAddressLookupTableIndex","InvalidRentPayingAccount","WouldExceedMaxVoteCostLimit","WouldExceedAccountDataTotalLimit","DuplicateInstruction","InsufficientFundsForRent","MaxLoadedAccountsDataSizeExceeded","InvalidLoadedAccountsDataSizeLimit","ResanitizationNeeded","ProgramExecutionTemporarilyRestricted","UnbalancedTransaction"];function Nce(t){return typeof t=="object"&&"InstructionError"in t?Ice(...t.InstructionError):$ce({errorCodeBaseOffset:7050001,getErrorContext(e,n,r){if(e===Zct)return{errorName:n,...r!==void 0?{transactionErrorContext:r}:null};if(e===Kct)return{index:Number(r)};if(e===Gct||e===Yct)return{accountIndex:Number(r.account_index)}},orderedErrorNames:vut,rpcEnumError:t},Nce)}function Wv(t){let e;if(_ut(t)){const{code:n,data:r,message:i}=t,s=Number(n);if(s===WK){const{err:a,...o}=r,l=a?{cause:Nce(a)}:null;e=new ht(WK,{...o,...l})}else{let a;switch(s){case oct:case lct:case uct:case cct:case act:case fct:case wct:case bct:case hct:case pct:case mct:case yct:case gct:case dct:a={__serverMessage:i};break;default:typeof r=="object"&&!Array.isArray(r)&&(a=r)}e=new ht(s,a)}}else{const n=typeof t=="object"&&t!==null&&"message"in t&&typeof t.message=="string"?t.message:"Malformed JSON-RPC error with no message attribute";e=new ht(sct,{error:t,message:n})}return U9(e,Wv),e}function _ut(t){return typeof t=="object"&&t!==null&&"code"in t&&"message"in t&&(typeof t.code=="number"||typeof t.code=="bigint")&&typeof t.message=="string"}function xut(t,e){if(t.length>=e)return t;const n=new Uint8Array(e).fill(0);return n.set(t),n}var Cut=(t,e)=>xut(t.length<=e?t:t.slice(0,e),e);function Eut(t,e){return t.length===e.length&&t.every((n,r)=>n===e[r])}function Bf(t,e){return"fixedSize"in e?e.fixedSize:e.getSizeFromValue(t)}function us(t){return Object.freeze({...t,encode:e=>{const n=new Uint8Array(Bf(e,t));return t.write(e,n,0),n}})}function As(t){return Object.freeze({...t,decode:(e,n=0)=>t.read(e,n)[0]})}function ri(t){return"fixedSize"in t&&typeof t.fixedSize=="number"}function Sut(t){return!ri(t)}function Aut(t,e){if(ri(t)!==ri(e))throw new ht(Qct);if(ri(t)&&ri(e)&&t.fixedSize!==e.fixedSize)throw new ht(eut,{decoderFixedSize:e.fixedSize,encoderFixedSize:t.fixedSize});if(!ri(t)&&!ri(e)&&t.maxSize!==e.maxSize)throw new ht(tut,{decoderMaxSize:e.maxSize,encoderMaxSize:t.maxSize});return{...e,...t,decode:e.decode,encode:t.encode,read:e.read,write:t.write}}function kut(t,e,n=0){if(e.length-n<=0)throw new ht(Jct,{codecDescription:t})}function PP(t,e,n,r=0){const i=n.length-r;if(i<e)throw new ht(Xct,{bytesLength:i,codecDescription:t,expected:e})}function ZK(t,e,n){if(e<0||e>n)throw new ht(sut,{bytesLength:n,codecDescription:t,offset:e})}function Tut(t,e){const n=((a,o,l)=>{const u=t.encode(a);return l=e.write(u.length,o,l),o.set(u,l),l+u.length});if(ri(e)&&ri(t))return us({...t,fixedSize:e.fixedSize+t.fixedSize,write:n});const r=ri(e)?e.fixedSize:e.maxSize??null,i=ri(t)?t.fixedSize:t.maxSize??null,s=r!==null&&i!==null?r+i:null;return us({...t,...s!==null?{maxSize:s}:{}
1186,getSizeFromValue:a=>{const o=Bf(a,t);return Bf(o,e)+o},write:n})}function Lut(t,e){const n=((a,o)=>{const[l,u]=e.read(a,o),f=Number(l);return o=u,(o>0||a.length>f)&&(a=a.slice(o,o+f)),PP("addDecoderSizePrefix",f,a),[t.decode(a),o+f]});if(ri(e)&&ri(t))return As({...t,fixedSize:e.fixedSize+t.fixedSize,read:n});const r=ri(e)?e.fixedSize:e.maxSize??null,i=ri(t)?t.fixedSize:t.maxSize??null,s=r!==null&&i!==null?r+i:null;return As({...t,...s!==null?{maxSize:s}:{},read:n})}function qv(t,e,n){const r=t.byteOffset+(e??0),i=n??t.byteLength;let s;return typeof SharedArrayBuffer>"u"?s=t.buffer:t.buffer instanceof SharedArrayBuffer?(s=new ArrayBuffer(t.length),new Uint8Array(s).set(new Uint8Array(t))):s=t.buffer,(r===0||r===-t.byteLength)&&i===t.byteLength?s:s.slice(r,r+i)}function RP(t,e){return us({fixedSize:e,write:(n,r,i)=>{const s=t.encode(n),a=s.length>e?s.slice(0,e):s;return r.set(a,i),i+e}})}function jP(t,e){return As({fixedSize:e,read:(n,r)=>{PP("fixCodecSize",e,n,r),(r>0||n.length>e)&&(n=n.slice(r,r+e)),ri(t)&&(n=Cut(n,t.fixedSize));const[i]=t.read(n,0);return[i,r+e]}})}function $ut(t,e){return As({...t,read:(n,r)=>{const i=u=>Iut(u,n.length),s=e.preOffset?e.preOffset({bytes:n,preOffset:r,wrapBytes:i}):r;ZK("offsetDecoder",s,n.length);const[a,o]=t.read(n,s),l=e.postOffset?e.postOffset({bytes:n,newPreOffset:s,postOffset:o,preOffset:r,wrapBytes:i}):o;return ZK("offsetDecoder",l,n.length),[a,l]}})}function Iut(t,e){return e===0?0:(t%e+e)%e}function Nut(t,e){if(ri(t)){const n=e(t.fixedSize);if(n<0)throw new ht(iut,{bytesLength:n,codecDescription:"resizeDecoder"});return As({...t,fixedSize:n})}return t}function Out(t,e){return $ut(Nut(t,n=>n+e),{postOffset:({postOffset:n})=>n+e})}function wm(t,e){return us({...Sut(t)?{...t,getSizeFromValue:n=>t.getSizeFromValue(e(n))}:t,write:(n,r,i)=>t.write(e(n),r,i)})}function MP(t,e){return As({...t,read:(n,r)=>{const[i,s]=t.read(n,r);return[e(i,n,r),s]}})}function Put(t,e,n=e){if(!e.match(new RegExp(`^[${t}]*$`)))throw new ht(Hv,{alphabet:t,base:t.length,value:n})}var Rut=t=>us({getSizeFromValue:e=>{const[n,r]=KK(e,t[0]);if(!r)return e.length;const i=GK(r,t);return n.length+Math.ceil(i.toString(16).length/2)},write(e,n,r){if(Put(t,e),e==="")return r;const[i,s]=KK(e,t[0]);if(!s)return n.set(new Uint8Array(i.length).fill(0),r),r+i.length;let a=GK(s,t);const o=[];for(;a>0n;)o.unshift(Number(a%256n)),a/=256n;const l=[...Array(i.length).fill(0),...o];return n.set(l,r),r+l.length}}),jut=t=>As({read(e,n){const r=n===0?e:e.slice(n);if(r.length===0)return["",0];let i=r.findIndex(l=>l!==0);i=i===-1?r.length:i;const s=t[0].repeat(i);if(i===r.length)return[s,e.length];const a=r.slice(i).reduce((l,u)=>l*256n+BigInt(u),0n),o=Mut(a,t);return[s+o,e.length]}});function KK(t,e){const[n,r]=t.split(new RegExp(`((?!${e}).*)`));return[n,r]}function GK(t,e){const n=BigInt(e.length);let r=0n;for(const i of t)r*=n,r+=BigInt(e.indexOf(i));return r}function Mut(t,e){const n=BigInt(e.length),r=[];for(;t>0n;)r.unshift(e[Number(t%n)]),t/=n;return r.join("")}var Oce="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",Dut=()=>Rut(Oce),Uut=()=>jut(Oce),YK="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",But=()=>us({getSizeFromValue:t=>{try{return atob(t).length}catch{throw new ht(Hv,{alphabet:YK,base:64,value:t})}},write(t,e,n){try{const r=atob(t).split("").map(i=>i.charCodeAt(0));return e.set(r,n),r.length+n}catch{throw new ht(Hv,{alphabet:YK,base:64,value:t})}}}),Fut=()=>As({read(t,e=0){const n=t.slice(e);return[btoa(String.fromCharCode(...n)),t.length]}});function zut(){if(typeof globalThis.crypto>"u"||typeof globalThis.crypto.getRandomValues!="function")throw new ht(Nct)}function B9(){if(!globalThis.isSecureContext)throw new ht(Act)}function Vut(){var t;if(B9(),typeof globalThis.crypto>"u"||typeof((t=globalThis.crypto.subtle)==null?void 0:t.digest)!="function")throw new ht(kct)}function Pce(){var t;if(B9(),typeof globalThis.crypto>"u"||typeof((t=globalThis.crypto.subtle)==null?void 0:t.exportKey)!="function")throw new ht(Tct)}function Hut(){var t;if(B9(),typeof globalThis.crypto>"u"||typeof((t=globalThis.crypto.subtle)==null?void 0:t.sign)!="function")throw new ht(Lct)}function Wut(){var t;if(B9(),typeof globalThis.crypto>"u"||typeof((t=globalThis.crypto.subtle)==null?void 0:t.verify)!="function")throw new ht($ct)}var mA,yA;function DP(){return mA||(mA=Dut()),mA}function qut(){return yA||(yA=Uut()),yA}function Zut(t){if(t.length<32||t.length>44)return!1;const e=DP();try{return e.encode(t).byteLength===32}catch{return!1}}function j$(t){if(t.length<32||t.length>44)throw new ht(_ct,{actualLength:t.length});const r=DP().encode(t).byteLength;if(r!==32)throw new ht(vct,{actualLength:r})}function Kut(t){return j$(t),t}function e1(){return wm(RP(DP(),32),t=>Kut(t))}function N5(){return jP(qut(),32)}function Gut(){return Aut(e1(),N5())}function UP(){return new Intl.Collator("en",{caseFirst:"lower",ignorePunctuation:!1,localeMatcher:"best fit",numeric:!1,sensitivity:"variant",usage:"sort"}).compare}var Yut=37095705934669439343138083508754565189542113879843219016388785533085940283555n,$s=57896044618658097711785492504343953926634992332820282019728792003956564819949n,JK=19681161376707505956807079304988542015446066515923890162744021073123829784752n;function bo(t){const e=t%$s;return e>=0n?e:$s+e}function Ul(t,e){let n=t;for(;e-- >0n;)n*=n,n%=$s;return n}function Jut(t){const n=t*t%$s*t%$s,r=Ul(n,2n)*n%$s,i=Ul(r,1n)*t%$s,s=Ul(i,5n)*i%$s,a=Ul(s,10n)*s%$s,o=Ul(a,20n)*a%$s,l=Ul(o,40n)*o%$s,u=Ul(l,80n)*l%$s,f=Ul(u,80n)*l%$s,p=Ul(f,10n)*s%$s;return Ul(p,2n)*t%$s}function Xut(t,e){const n=bo(e*e*e),r=bo(n*n*e),i=Jut(t*r);let s=bo(t*n*i);const a=bo(e*s*s),o=s,l=bo(s*JK),u=a===t,f=a===bo(-t),p=a===bo(-t*JK);return u&&(s=o),(f||p)&&(s=l),(bo(s)&1n)===1n&&(s=bo(-s)),!u&&!f?null:s}function Qut(t,e){const n=bo(t*t),r=bo(n-1n),i=bo(Yut*n+1n),s=Xut(r,i);if(s===null)return!1;const a=(e&128)!==0;return!(s===0n&&a)}function edt(t){const e=t.toString(16);return e.length===1?`0${e}`:e}function tdt(t){const n=`0x${t.reduce((r,i,s)=>`${edt(s===31?i&-129:i)}${r}`,"")}`;return BigInt(n)}
1186function ndt(t){if(t.byteLength!==32)return!1;const e=tdt(t);return Qut(e,t[31])}var XK=32,QK=16,rdt=[80,114,111,103,114,97,109,68,101,114,105,118,101,100,65,100,100,114,101,115,115];async function idt({programAddress:t,seeds:e}){if(Vut(),e.length>QK)throw new ht(Cct,{actual:e.length,maxSeeds:QK});let n;const r=e.reduce((l,u,f)=>{const p=typeof u=="string"?(n||(n=new TextEncoder)).encode(u):u;if(p.byteLength>XK)throw new ht(Ect,{actual:p.byteLength,index:f,maxSeedLength:XK});return l.push(...p),l},[]),i=Gut(),s=i.encode(t),a=await crypto.subtle.digest("SHA-256",new Uint8Array([...r,...s,...rdt])),o=new Uint8Array(a);if(ndt(o))throw new ht(Sce);return i.decode(o)}async function sdt({programAddress:t,seeds:e}){let n=255;for(;n>0;)try{return[await idt({programAddress:t,seeds:[...e,new Uint8Array([n])]}),n]}catch(r){if(Lce(r,Sce))n--;else throw r}throw new ht(Sct)}async function Rce(t){if(Pce(),t.type!=="public"||t.algorithm.name!=="Ed25519")throw new ht(xct);const e=await crypto.subtle.exportKey("raw",t);return N5().decode(new Uint8Array(e))}function jce(t,e,n,r){if(r<e||r>n)throw new ht(rut,{codecDescription:t,max:n,min:e,value:r})}function Mce(t){return(t==null?void 0:t.endian)!==1}function BP(t){return us({fixedSize:t.size,write(e,n,r){t.range&&jce(t.name,t.range[0],t.range[1],e);const i=new ArrayBuffer(t.size);return t.set(new DataView(i),e,Mce(t.config)),n.set(new Uint8Array(i),r),r+t.size}})}function Dce(t){return As({fixedSize:t.size,read(e,n=0){kut(t.name,e,n),PP(t.name,t.size,e,n);const r=new DataView(qv(e,n,t.size));return[t.get(r,Mce(t.config)),n+t.size]}})}var Ff=()=>us({getSizeFromValue:t=>t<=127?1:t<=16383?2:3,maxSize:3,write:(t,e,n)=>{jce("shortU16",0,65535,t);const r=[0];for(let i=0;;i+=1){const s=Number(t)>>i*7;if(s===0)break;const a=127&s;r[i]=a,i>0&&(r[i-1]|=128)}return e.set(r,n),n+r.length}}),M2=()=>As({maxSize:3,read:(t,e)=>{let n=0,r=0;for(;++r;){const i=r-1,s=t[e+i],a=127&s;if(n|=a<<i*7,(s&128)===0)break}return[n,e+r]}}),adt=(t={})=>BP({config:t,name:"u32",range:[0,+"0xffffffff"],set:(e,n,r)=>e.setUint32(0,Number(n),r),size:4}),odt=(t={})=>Dce({config:t,get:(e,n)=>e.getUint32(0,n),name:"u32",size:4}),ldt=(t={})=>BP({config:t,name:"u64",range:[0n,BigInt("0xffffffffffffffff")],set:(e,n,r)=>e.setBigUint64(0,BigInt(n),r),size:8}),j1=()=>BP({name:"u8",range:[0,+"0xff"],set:(t,e)=>t.setUint8(0,Number(e)),size:1}),k6=()=>Dce({get:t=>t.getUint8(0),name:"u8",size:1});function cdt(t,e,n){if(e!==n)throw new ht(nut,{actual:n,codecDescription:t,expected:e})}function udt(t){return t.reduce((e,n)=>e===null||n===null?null:Math.max(e,n),0)}function M1(t){return t.reduce((e,n)=>e===null||n===null?null:e+n,0)}function O5(t){return ri(t)?t.fixedSize:null}function vm(t){return ri(t)?t.fixedSize:t.maxSize??null}function D1(t,e={}){const n=e.size??adt(),r=Zv(n,O5(t)),i=Zv(n,vm(t))??void 0;return us({...r!==null?{fixedSize:r}:{getSizeFromValue:s=>(typeof n=="object"?Bf(s.length,n):0)+[...s].reduce((o,l)=>o+Bf(l,t),0),maxSize:i},write:(s,a,o)=>(typeof n=="number"&&cdt("array",n,s.length),typeof n=="object"&&(o=n.write(s.length,a,o)),s.forEach(l=>{o=t.write(l,a,o)}),o)})}function zf(t,e={}){const n=e.size??odt(),r=O5(t),i=Zv(n,r),s=Zv(n,vm(t))??void 0;return As({...i!==null?{fixedSize:i}:{maxSize:s},read:(a,o)=>{const l=[];if(typeof n=="object"&&a.slice(o).length===0)return[l,o];if(n==="remainder"){for(;o<a.length;){const[p,y]=t.read(a,o);o=y,l.push(p)}return[l,o]}const[u,f]=typeof n=="number"?[n,o]:n.read(a,o);o=f;for(let p=0;p<u;p+=1){const[y,g]=t.read(a,o);o=g,l.push(y)}return[l,o]}})}function Zv(t,e){return typeof t!="number"?null:t===0?0:e===null?null:e*t}function FP(){return us({getSizeFromValue:t=>t.length,write:(t,e,n)=>(e.set(t,n),n+t.length)})}function M$(){return As({read:(t,e)=>{const n=t.slice(e);return[n,e+n.length]}})}function ddt(t){return us({fixedSize:t.length,write:(e,n,r)=>(n.set(t,r),r+t.length)})}function hdt(t){const e=M1(t.map(O5)),n=M1(t.map(vm))??void 0;return As({...e===null?{maxSize:n}:{fixedSize:e},read:(r,i)=>{const s=[];return t.forEach(a=>{const[o,l]=a.read(r,i);s.push(o),i=l}),[s,i]}})}function fdt(t,e){const n=pdt(t),r=(s,a,o)=>{const l=e(s);return eG(t,l),t[l].write(s,a,o)};
1186if(n!==null)return us({fixedSize:n,write:r});const i=mdt(t);return us({...i!==null?{maxSize:i}:{},getSizeFromValue:s=>{const a=e(s);return eG(t,a),Bf(s,t[a])},write:r})}function eG(t,e){if(typeof t[e]>"u")throw new ht(aut,{maxRange:t.length-1,minRange:0,variant:e})}function pdt(t){if(t.length===0)return 0;if(!ri(t[0]))return null;const e=t[0].fixedSize;return t.every(r=>ri(r)&&r.fixedSize===e)?e:null}function mdt(t){return udt(t.map(e=>vm(e)))}function K2(t){const e=t.map(([,i])=>i),n=M1(e.map(O5)),r=M1(e.map(vm))??void 0;return us({...n===null?{getSizeFromValue:i=>t.map(([s,a])=>Bf(i[s],a)).reduce((s,a)=>s+a,0),maxSize:r}:{fixedSize:n},write:(i,s,a)=>(t.forEach(([o,l])=>{a=l.write(i[o],s,a)}),a)})}function P5(t){const e=t.map(([,i])=>i),n=M1(e.map(O5)),r=M1(e.map(vm))??void 0;return As({...n===null?{maxSize:r}:{fixedSize:n},read:(i,s)=>{const a={};return t.forEach(([o,l])=>{const[u,f]=l.read(i,s);s=f,a[o]=u}),[a,s]}})}function rp(t,...e){return e.reduce((n,r)=>r(n),t)}var wi=(t=>(t[t.WRITABLE_SIGNER=3]="WRITABLE_SIGNER",t[t.READONLY_SIGNER=2]="READONLY_SIGNER",t[t.WRITABLE=1]="WRITABLE",t[t.READONLY=0]="READONLY",t))(wi||{}),ydt=2,gdt=1;function U1(t){return t>=2}function T6(t){return(t&gdt)!==0}function tG(t,e){return t|e}function bdt(t){return t|ydt}function wdt(t){return Zut(t)}function vdt(t){return"lifetimeConstraint"in t&&typeof t.lifetimeConstraint.blockhash=="string"&&typeof t.lifetimeConstraint.lastValidBlockHeight=="bigint"&&wdt(t.lifetimeConstraint.blockhash)}function _dt(t,e){return"lifetimeConstraint"in e&&e.lifetimeConstraint&&"blockhash"in e.lifetimeConstraint&&e.lifetimeConstraint.blockhash===t.blockhash&&e.lifetimeConstraint.lastValidBlockHeight===t.lastValidBlockHeight?e:Object.freeze({...e,lifetimeConstraint:Object.freeze(t)})}function xdt(t,e,n=e){if(!e.match(new RegExp(`^[${t}]*$`)))throw new ht(Hv,{alphabet:t,base:t.length,value:n})}var Cdt=t=>us({getSizeFromValue:e=>{const[n,r]=nG(e,t[0]);if(!r)return e.length;const i=rG(r,t);return n.length+Math.ceil(i.toString(16).length/2)},write(e,n,r){if(xdt(t,e),e==="")return r;const[i,s]=nG(e,t[0]);if(!s)return n.set(new Uint8Array(i.length).fill(0),r),r+i.length;let a=rG(s,t);const o=[];for(;a>0n;)o.unshift(Number(a%256n)),a/=256n;const l=[...Array(i.length).fill(0),...o];return n.set(l,r),r+l.length}}),Edt=t=>As({read(e,n){const r=n===0?e:e.slice(n);if(r.length===0)return["",0];let i=r.findIndex(l=>l!==0);i=i===-1?r.length:i;const s=t[0].repeat(i);if(i===r.length)return[s,e.length];const a=r.slice(i).reduce((l,u)=>l*256n+BigInt(u),0n),o=Sdt(a,t);return[s+o,e.length]}});function nG(t,e){const[n,r]=t.split(new RegExp(`((?!${e}).*)`));return[n,r]}function rG(t,e){const n=BigInt(e.length);let r=0n;for(const i of t)r*=n,r+=BigInt(e.indexOf(i));return r}function Sdt(t,e){const n=BigInt(e.length),r=[];for(;t>0n;)r.unshift(e[Number(t%n)]),t/=n;return r.join("")}var Uce="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",Adt=()=>Cdt(Uce),kdt=()=>Edt(Uce),gA;function Tdt(){if(!gA){const t=D1(j1(),{size:Ff()});gA=K2([["lookupTableAddress",e1()],["writableIndexes",t],["readonlyIndexes",t]])}return gA}var bA;function Ldt(){if(!bA){const t=zf(k6(),{size:M2()});bA=P5([["lookupTableAddress",N5()],["writableIndexes",t],["readonlyIndexes",t]])}return bA}var wA;function vA(){return wA||(wA=j1()),wA}var _A;function xA(){return _A||(_A=k6()),_A}function $dt(){return K2([["numSignerAccounts",vA()],["numReadonlySignerAccounts",vA()],["numReadonlyNonSignerAccounts",vA()]])}function Idt(){return P5([["numSignerAccounts",xA()],["numReadonlySignerAccounts",xA()],["numReadonlyNonSignerAccounts",xA()]])}var CA;function Ndt(){return CA||(CA=wm(K2([["programAddressIndex",j1()],["accountIndices",D1(j1(),{size:Ff()})],["data",Tut(FP(),Ff())]]),t=>t.accountIndices!==void 0&&t.data!==void 0?t:{...t,accountIndices:t.accountIndices??[],data:t.data??new Uint8Array(0)})),CA}var EA;function Odt(){return EA||(EA=MP(P5([["programAddressIndex",k6()],["accountIndices",zf(k6(),{size:M2()})],["data",Lut(M$(),M2())]]),t=>{if(t.accountIndices.length&&t.data.byteLength)return t;const{accountIndices:e,data:n,...r}=t;return{...r,...e.length?{accountIndices:e}:null,...n.byteLength?{data:n}:null}})),EA}var Bce=0,D$=128;function Pdt(){return us({getSizeFromValue:t=>t==="legacy"?0:1,maxSize:1,write:(t,e,n)=>{if(t==="legacy")return n;if(t<0||t>127)throw new ht(Uct,{actualVersion:t});if(t>Bce)throw new ht(Ace,{unsupportedVersion:t});return e.set([t|D$],n),n+1}})}function Fce(){return As({maxSize:1,read:(t,e)=>{const n=t[e];if((n&D$)===0)return["legacy",e];{const r=n^D$;if(r>Bce)throw new ht(Ace,{unsupportedVersion:r});return[r,e+1]}}})}function iG(){return K2(zce())}function sG(){return wm(K2([...zce(),["addressTableLookups",jdt()]]),t=>t.version==="legacy"?t:{...t,addressTableLookups:t.addressTableLookups??[]})}
1186function zce(){const t=fdt([ddt(new Uint8Array(32)),RP(Adt(),32)],e=>e===void 0?0:1);return[["version",Pdt()],["header",$dt()],["staticAccounts",D1(e1(),{size:Ff()})],["lifetimeToken",t],["instructions",D1(Ndt(),{size:Ff()})]]}function Rdt(){return[["version",Fce()],["header",Idt()],["staticAccounts",zf(N5(),{size:M2()})],["lifetimeToken",jP(kdt(),32)],["instructions",zf(Odt(),{size:M2()})],["addressTableLookups",Mdt()]]}function jdt(){return D1(Tdt(),{size:Ff()})}function Mdt(){return zf(Ldt(),{size:M2()})}function Ddt(){return us({getSizeFromValue:t=>t.version==="legacy"?iG().getSizeFromValue(t):sG().getSizeFromValue(t),write:(t,e,n)=>t.version==="legacy"?iG().write(t,e,n):sG().write(t,e,n)})}function Udt(){return MP(P5(Rdt()),({addressTableLookups:t,...e})=>e.version==="legacy"||!(t!=null&&t.length)?e:{...e,addressTableLookups:t})}function aG(t,e,n){t[e]=n(t[e]??{role:wi.READONLY})}var pi=Symbol("AddressMapTypeProperty");function Bdt(t,e){const n={[t]:{[pi]:0,role:wi.WRITABLE_SIGNER}},r=new Set;for(const i of e){aG(n,i.programAddress,a=>{if(r.add(i.programAddress),pi in a){if(T6(a.role))switch(a[pi]){case 0:throw new ht(Dct,{programAddress:i.programAddress});default:throw new ht(qK,{programAddress:i.programAddress})}if(a[pi]===2)return a}return{[pi]:2,role:wi.READONLY}});let s;if(i.accounts)for(const a of i.accounts)aG(n,a.address,o=>{const{address:l,...u}=a;if(pi in o)switch(o[pi]){case 0:return o;case 1:{const f=tG(o.role,u.role);if("lookupTableAddress"in u){if(o.lookupTableAddress!==u.lookupTableAddress&&(s||(s=UP()))(u.lookupTableAddress,o.lookupTableAddress)<0)return{[pi]:1,...u,role:f}}else if(U1(u.role))return{[pi]:2,role:f};return o.role!==f?{...o,role:f}:o}case 2:{const f=tG(o.role,u.role);if(r.has(a.address)){if(T6(u.role))throw new ht(qK,{programAddress:a.address});return o.role!==f?{...o,role:f}:o}else return"lookupTableAddress"in u&&!U1(o.role)?{...u,[pi]:1,role:f}:o.role!==f?{...o,role:f}:o}}return"lookupTableAddress"in u?{...u,[pi]:1}:{...u,[pi]:2}})}return n}function Fdt(t){let e;return Object.entries(t).sort(([r,i],[s,a])=>{if(i[pi]!==a[pi]){if(i[pi]===0)return-1;if(a[pi]===0)return 1;if(i[pi]===2)return-1;if(a[pi]===2)return 1}const o=U1(i.role);if(o!==U1(a.role))return o?-1:1;const l=T6(i.role);return l!==T6(a.role)?l?-1:1:(e||(e=UP()),i[pi]===1&&a[pi]===1&&i.lookupTableAddress!==a.lookupTableAddress?e(i.lookupTableAddress,a.lookupTableAddress):e(r,s))}).map(([r,i])=>({address:r,...i}))}function zdt(t){var n;const e={};for(const r of t){if(!("lookupTableAddress"in r))continue;const i=e[n=r.lookupTableAddress]||(e[n]={readonlyIndexes:[],writableIndexes:[]});r.role===wi.WRITABLE?i.writableIndexes.push(r.addressIndex):i.readonlyIndexes.push(r.addressIndex)}return Object.keys(e).sort(UP()).map(r=>({lookupTableAddress:r,...e[r]}))}function Vdt(t){let e=0,n=0,r=0;for(const i of t){if("lookupTableAddress"in i)break;const s=T6(i.role);U1(i.role)?(r++,s||n++):s||e++}return{numReadonlyNonSignerAccounts:e,numReadonlySignerAccounts:n,numSignerAccounts:r}}function Hdt(t){const e={};for(const[n,r]of t.entries())e[r.address]=n;return e}function Wdt(t,e){const n=Hdt(e);return t.map(({accounts:r,data:i,programAddress:s})=>({programAddressIndex:n[s],...r?{accountIndices:r.map(({address:a})=>n[a])}:null,...i?{data:i}:null}))}function qdt(t){return"nonce"in t?t.nonce:t.blockhash}function Zdt(t){const e=t.findIndex(r=>"lookupTableAddress"in r);return(e===-1?t:t.slice(0,e)).map(({address:r})=>r)}function Kdt(t){const e=Bdt(t.feePayer.address,t.instructions),n=Fdt(e),r=t.lifetimeConstraint;return{...t.version!=="legacy"?{addressTableLookups:zdt(n)}:null,...r?{lifetimeToken:qdt(r)}:null,header:Vdt(n),instructions:Wdt(t.instructions,n),staticAccounts:Zdt(n),version:t.version}}function Gdt(t){return Object.freeze({instructions:Object.freeze([]),version:t.version})}var Vce="SysvarRecentB1ockHashes11111111111111111111",Hce="11111111111111111111111111111111";function oG(t,e){return{accounts:[{address:t,role:wi.WRITABLE},{address:Vce,role:wi.READONLY},{address:e,role:wi.READONLY_SIGNER}],data:new Uint8Array([4,0,0,0]),programAddress:Hce}}function zP(t){var e;return t.programAddress===Hce&&t.data!=null&&Ydt(t.data)&&((e=t.accounts)==null?void 0:e.length)===3&&t.accounts[0].address!=null&&t.accounts[0].role===wi.WRITABLE&&t.accounts[1].address===Vce&&t.accounts[1].role===wi.READONLY&&t.accounts[2].address!=null&&U1(t.accounts[2].role)}function Ydt(t){return t.byteLength===4&&t[0]===4&&t[1]===0&&t[2]===0&&t[3]===0}function Wce(t){return"lifetimeConstraint"in t&&typeof t.lifetimeConstraint.nonce=="string"&&t.instructions[0]!=null&&zP(t.instructions[0])}function Jdt(t,e,n){return t.accounts[0].address===e&&t.accounts[2].address===n}function Xdt({nonce:t,nonceAccountAddress:e,nonceAuthorityAddress:n},r){let i;const s=r.instructions[0];if(s&&zP(s))if(Jdt(s,e,n)){if(Wce(r)&&r.lifetimeConstraint.nonce===t)return r;i=[s,...r.instructions.slice(1)]}
1186else i=[Object.freeze(oG(e,n)),...r.instructions.slice(1)];else i=[Object.freeze(oG(e,n)),...r.instructions];return Object.freeze({...r,instructions:Object.freeze(i),lifetimeConstraint:Object.freeze({nonce:t})})}function Qdt(t,e){var r;if("feePayer"in e&&t===((r=e.feePayer)==null?void 0:r.address)&&e2t(e.feePayer))return e;const n={...e,feePayer:Object.freeze({address:t})};return Object.freeze(n),n}function e2t(t){return!!t&&"address"in t&&typeof t.address=="string"&&Object.keys(t).length===1}function t2t(t,e){return n2t([t],e)}function n2t(t,e){return Object.freeze({...e,instructions:Object.freeze([...e.instructions,...t])})}function r2t(t){const{header:e}=t,n=e.numSignerAccounts-e.numReadonlySignerAccounts,r=t.staticAccounts.length-e.numSignerAccounts-e.numReadonlyNonSignerAccounts,i=[];let s=0;for(let a=0;a<n;a++)i.push({address:t.staticAccounts[s],role:wi.WRITABLE_SIGNER}),s++;for(let a=0;a<e.numReadonlySignerAccounts;a++)i.push({address:t.staticAccounts[s],role:wi.READONLY_SIGNER}),s++;for(let a=0;a<r;a++)i.push({address:t.staticAccounts[s],role:wi.WRITABLE}),s++;for(let a=0;a<e.numReadonlyNonSignerAccounts;a++)i.push({address:t.staticAccounts[s],role:wi.READONLY}),s++;return i}function i2t(t,e){const r=t.map(a=>a.lookupTableAddress).filter(a=>e[a]===void 0);if(r.length>0)throw new ht(Bct,{lookupTableAddresses:r});const i=[],s=[];for(const a of t){const o=e[a.lookupTableAddress],l=a.readonlyIndexes,u=a.writableIndexes,f=Math.max(...l,...u);if(f>=o.length)throw new ht(Fct,{highestKnownIndex:o.length-1,highestRequestedIndex:f,lookupTableAddress:a.lookupTableAddress});const p=l.map(g=>({address:o[g],addressIndex:g,lookupTableAddress:a.lookupTableAddress,role:wi.READONLY}));i.push(...p);const y=u.map(g=>({address:o[g],addressIndex:g,lookupTableAddress:a.lookupTableAddress,role:wi.WRITABLE}));s.push(...y)}return[...s,...i]}function s2t(t,e){var s,a;const n=(s=e[t.programAddressIndex])==null?void 0:s.address;if(!n)throw new ht(zct,{index:t.programAddressIndex});const r=(a=t.accountIndices)==null?void 0:a.map(o=>e[o]),{data:i}=t;return Object.freeze({programAddress:n,...r&&r.length?{accounts:Object.freeze(r)}:{},...i&&i.length?{data:i}:{}})}function a2t(t,e,n){if(!e||!zP(e))return{blockhash:t,lastValidBlockHeight:2n**64n-1n};{const r=e.accounts[0].address;j$(r);const i=e.accounts[2].address;return j$(i),{nonce:t,nonceAccountAddress:r,nonceAuthorityAddress:i}}}function b4t(t,e){const n=t.staticAccounts[0];if(!n)throw new ht(Vct);const r=r2t(t),i="addressTableLookups"in t&&t.addressTableLookups!==void 0&&t.addressTableLookups.length>0?i2t(t.addressTableLookups,{}):[],s=[...r,...i],a=t.instructions.map(u=>s2t(u,s)),o=a[0],l=a2t(t.lifetimeToken,o);return rp(Gdt({version:t.version}),u=>Qdt(n,u),u=>a.reduce((f,p)=>t2t(p,f),u),u=>"blockhash"in l?_dt(l,u):Xdt(l,u))}var F9=Object.freeze({name:"Ed25519"});function o2t(t){return new Uint8Array([48,46,2,1,0,48,5,6,3,43,101,112,4,34,4,32,...t])}async function U$(t,e=!1){const n=t.byteLength;if(n!==32)throw new ht(Pct,{actualLength:n});const r=o2t(t);return await crypto.subtle.importKey("pkcs8",r,F9,e,["sign"])}async function l2t(t,e=!1){if(Pce(),t.extractable===!1)throw new ht(Ict,{key:t});const n=await crypto.subtle.exportKey("jwk",t);return await crypto.subtle.importKey("jwk",{crv:"Ed25519",ext:e,key_ops:["verify"],kty:"OKP",x:n.x},"Ed25519",e,["verify"])}async function VP(t,e){Hut();const n=await crypto.subtle.sign(F9,t,qv(e));return new Uint8Array(n)}async function c2t(t,e,n){return Wut(),await crypto.subtle.verify(F9,t,qv(e),qv(n))}async function u2t(t,e=!1){if(zut(),t.byteLength!==64)throw new ht(Oct,{byteLength:t.byteLength});const[n,r]=await Promise.all([crypto.subtle.importKey("raw",t.slice(32),F9,!0,["verify"]),U$(t.slice(0,32),e)]),i=new Uint8Array(32);crypto.getRandomValues(i);const s=await VP(r,i);if(!await c2t(n,s,i))throw new ht(Rct);return{privateKey:r,publicKey:n}}async function d2t(t,e=!1){const n=U$(t,e),[r,i]=await Promise.all([(e?n:U$(t,!0)).then(async s=>await l2t(s,!0)),n]);return{privateKey:i,publicKey:r}}function h2t(t){const e=Object.values(t);if(e.length===0)throw new ht(Wct);return e.map(n=>n||new Uint8Array(64).fill(0))}
1186function f2t(){return wm(D1(RP(FP(),64),{size:Ff()}),h2t)}function p2t(){return K2([["signatures",f2t()],["messageBytes",FP()]])}function m2t(){return MP(P5([["signatures",zf(jP(M$(),64),{size:M2()})],["messageBytes",M$()]]),y2t)}function y2t(t){const{messageBytes:e,signatures:n}=t,r=hdt([Fce(),Out(k6(),2),zf(N5(),{size:M2()})]),[i,s,a]=r.decode(e),o=a.slice(0,s);if(o.length!==n.length)throw new ht(qct,{numRequiredSignatures:s,signaturesLength:n.length,signerAddresses:o});const l={};return o.forEach((u,f)=>{const p=n[f];p.every(y=>y===0)?l[u]=null:l[u]=p}),{messageBytes:e,signatures:Object.freeze(l)}}function w4t(t){const e=Kdt(t),n=Ddt().encode(e),r=e.staticAccounts.slice(0,e.header.numSignerAccounts),i={};for(const a of r)i[a]=null;let s;return vdt(t)?s={blockhash:t.lifetimeConstraint.blockhash,lastValidBlockHeight:t.lifetimeConstraint.lastValidBlockHeight}:Wce(t)&&(s={nonce:t.lifetimeConstraint.nonce,nonceAccountAddress:t.instructions[0].accounts[0].address}),Object.freeze({...s?{lifetimeConstraint:s}:void 0,messageBytes:n,signatures:Object.freeze(i)})}async function g2t(t,e){let n,r;if(await Promise.all(t.map(async i=>{const s=await Rce(i.publicKey),a=e.signatures[s];if(a===void 0){r||(r=new Set),r.add(s);return}if(r)return;const o=await VP(i.privateKey,e.messageBytes);a!==null&&Eut(o,a)||(n||(n={}),n[s]=o)})),r&&r.size>0){const i=Object.keys(e.signatures);throw new ht(Hct,{expectedAddresses:i,unexpectedAddresses:[...r]})}return n?Object.freeze({...e,signatures:Object.freeze({...e.signatures,...n})}):e}function b2t(t){const e=p2t().encode(t);return Fut().decode(e)}function lG(t){return t!==null&&(typeof t=="object"||typeof t=="function")}function w2t(t){const e=new Set,n={deferreds:e,settled:!1};return Promise.resolve(t).then(r=>{for(const{resolve:i}of e)i(r);e.clear(),n.settled=!0},r=>{for(const{reject:i}of e)i(r);e.clear(),n.settled=!0}),n}var SA=new WeakMap;async function v2t(t){let e;return await new Promise((r,i)=>{e={reject:i,resolve:r};for(const s of t){if(!lG(s)){Promise.resolve(s).then(r,i);continue}let a=SA.get(s);a===void 0?(a=w2t(s),a.deferreds.add(e),SA.set(s,a)):a.settled?Promise.resolve(s).then(r,i):a.deferreds.add(e)}}).finally(()=>{for(const r of t)lG(r)&&SA.get(r).deferreds.delete(e)})}function qce(t){return JSON.parse(_2t(t),(e,n)=>S2t(n)?E2t(n):n)}function _2t(t){const e=[];let n=!1;for(let r=0;r<t.length;r++){let i=!1;if(t[r]==="\\"&&(e.push(t[r++]),i=!i),t[r]==='"'){e.push(t[r]),i||(n=!n);continue}if(!n){const s=x2t(t,r);if(s!=null&&s.length){r+=s.length-1,s.match(/\.|[eE]-/)?e.push(s):e.push(C2t(s));continue}}e.push(t[r])}return e.join("")}function x2t(t,e){var i;const n=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?/;if(!((i=t[e])!=null&&i.match(/[-\d]/)))return null;const r=t.slice(e).match(n);return r?r[0]:null}function C2t(t){return`{"$n":"${t}"}`}function E2t({$n:t}){if(t.match(/[eE]/)){const[e,n]=t.split(/[eE]/);return BigInt(e)*BigInt(10)**BigInt(n)}return BigInt(t)}function S2t(t){return!!t&&typeof t=="object"&&"$n"in t&&typeof t.$n=="string"}var cG=0n;function A2t(){const t=cG;return cG++,t.toString()}function B$(t){return{id:A2t(),jsonrpc:"2.0",method:t.methodName,params:t.params}}function Zce(t,e){return T2t(JSON.stringify(t,(n,r)=>typeof r=="bigint"?k2t(r):r,e))}function k2t(t){return{$n:`${t}`}}function T2t(t){return t.replace(/\{\s*"\$n"\s*:\s*"(-?\d+)"\s*\}/g,"$1")}function L2t(t){return $2t(t)}function $2t(t){return new Proxy(t.api,{defineProperty(){return!1},deleteProperty(){return!1},get(e,n,r){if(n!=="then")return function(...i){const s=n.toString(),a=Reflect.get(e,s,r);if(!a)throw new ht(lut,{method:s,params:i});const o=a(...i);return I2t(t,o)}}})}function I2t({transport:t},e){return{async send(n){return await e.execute({signal:n==null?void 0:n.abort
1186Signal,transport:t})}}}function N2t(t){return new Proxy({},{defineProperty(){return!1},deleteProperty(){return!1},get(...e){const[n,r]=e,i=r.toString();return function(...s){const a=Object.freeze({methodName:i,params:s}),o=t!=null&&t.requestTransformer?t==null?void 0:t.requestTransformer(a):a;return Object.freeze({execute:async({signal:l,transport:u})=>{const f=B$(o),p=await u({payload:f,signal:l});return t!=null&&t.responseTransformer?t.responseTransformer(p,o):p}})}}})}function Kce(t){return t==null||typeof t!="object"||Array.isArray(t)?!1:"jsonrpc"in t&&t.jsonrpc==="2.0"&&"method"in t&&typeof t.method=="string"&&"params"in t}function O2t(t){return typeof t=="bigint"?Number(t):t}var Be={};function Gce(t){return function e(n,r){if(Array.isArray(n))return n.map((i,s)=>{const a={...r,keyPath:[...r.keyPath,s]};return e(i,a)});if(typeof n=="object"&&n!==null){const i={};for(const s in n){if(!Object.prototype.hasOwnProperty.call(n,s))continue;const a={...r,keyPath:[...r.keyPath,s]};i[s]=e(n[s],a)}return i}else return t.reduce((i,s)=>s(i,r),n)}}function Yce(t,e){return n=>{const r=Gce(t);return Object.freeze({...n,params:r(n.params,e)})}}function Jce(t,e){return n=>Gce(t)(n,e)}function P2t(){return Yce([O2t],{keyPath:[]})}function R2t({commitmentPropertyName:t,params:e,optionsObjectPositionInParams:n,overrideCommitment:r}){const i=e[n];if(i===void 0||i&&typeof i=="object"&&!Array.isArray(i)){if(i&&t in i){if(!i[t]||i[t]==="finalized"){const s=[...e],{[t]:a,...o}=i;return Object.keys(o).length>0?s[n]=o:n===s.length-1?s.length--:s[n]=void 0,s}}else if(r!=="finalized"){const s=[...e];return s[n]={...i,[t]:r},s}}return e}function j2t({defaultCommitment:t,optionsObjectPositionByMethod:e}){return n=>{const{params:r,methodName:i}=n;if(!Array.isArray(r))return n;const s=e[i];return s==null?n:Object.freeze({methodName:i,params:R2t({commitmentPropertyName:i==="sendTransaction"?"preflightCommitment":"commitment",optionsObjectPositionInParams:s,overrideCommitment:t,params:r})})}}function M2t(t){return(e,{keyPath:n})=>(typeof e=="bigint"&&t&&(e>Number.MAX_SAFE_INTEGER||e<-Number.MAX_SAFE_INTEGER)&&t(n,e),e)}function D2t(t){return e=>Yce([M2t((...r)=>t(e,...r))],{keyPath:[]})(e)}var U2t={accountNotifications:1,blockNotifications:1,getAccountInfo:1,getBalance:1,getBlock:1,getBlockHeight:0,getBlockProduction:0,getBlocks:2,getBlocksWithLimit:2,getEpochInfo:0,getFeeForMessage:1,getInflationGovernor:0,getInflationReward:1,getLargestAccounts:0,getLatestBlockhash:0,getLeaderSchedule:1,getMinimumBalanceForRentExemption:1,getMultipleAccounts:1,getProgramAccounts:1,getSignaturesForAddress:1,getSlot:0,getSlotLeader:0,getStakeMinimumDelegation:0,getSupply:0,getTokenAccountBalance:1,getTokenAccountsByDelegate:2,getTokenAccountsByOwner:2,getTokenLargestAccounts:1,getTokenSupply:1,getTransaction:1,getTransactionCount:0,getVoteAccounts:0,isBlockhashValid:1,logsNotifications:1,programNotifications:1,requestAirdrop:2,sendTransaction:1,signatureNotifications:1,simulateTransaction:1};function Xce(t){const e=t==null?void 0:t.onIntegerOverflow;return n=>rp(n,e?D2t(e):r=>r,P2t(),j2t({defaultCommitment:t==null?void 0:t.defaultCommitment,optionsObjectPositionByMethod:U2t}))}function Qce(t){return function(n,{keyPath:r}){return typeof n=="number"&&Number.isInteger(n)||typeof n=="bigint"?B2t(r,t)?Number(n):BigInt(n):n}}function B2t(t,e){return e.some(n=>{if(n.length!==t.length)return!1;for(let r=t.length-1;r>=0;r--){const i=t[r],s=n[r];if(s!==i&&(s!==Be||typeof i!="number"))return!1}return!0})}function eue(t){return Jce([Qce(t)],{keyPath:[]})}function F2t(){return t=>t.result}var F$=[["data","parsed","info","tokenAmount","decimals"],["data","parsed","info","tokenAmount","uiAmount"],["data","parsed","info","rentExemptReserve","decimals"],["data","parsed","info","rentExemptReserve","uiAmount"],["data","parsed","info","delegatedAmount","decimals"],["data","parsed","info","delegatedAmount","uiAmount"],["data","parsed","info","extensions",Be,"state","olderTransferFee","transferFeeBasisPoints"],["data","parsed","info","extensions",Be,"state","newerTransferFee","transferFeeBasisPoints"],["data","parsed","info","extensions",Be,"state","preUpdateAverageRate"],["data","parsed","info","extensions",Be,"state","currentRate"]],nf=[...F$,["data","parsed","info","lastExtendedSlotStartIndex"],["data","parsed","info","slashPenalty"],["data","parsed","info","warmupCooldownRate"],["data","parsed","info","decimals"],["data","parsed","info","numRequiredSigners"],["data","parsed","info","numValidSigners"],["data","parsed","info","stake","delegation","warmupCooldownRate"],["data","parsed","info","exemptionThreshold"],["data","parsed","info","burnPercent"],["data","parsed","info","commission"],["data","parsed","info","votes",Be,"confirmationCount"]],Qw=[["index"],["
1186instructions",Be,"accounts",Be],["instructions",Be,"programIdIndex"],["instructions",Be,"stackHeight"]],uG=[["addressTableLookups",Be,"writableIndexes",Be],["addressTableLookups",Be,"readonlyIndexes",Be],["header","numReadonlySignedAccounts"],["header","numReadonlyUnsignedAccounts"],["header","numRequiredSignatures"],["instructions",Be,"accounts",Be],["instructions",Be,"programIdIndex"],["instructions",Be,"stackHeight"]];function z2t(){return[["loadedAccountsDataSize"],...nf.map(t=>["accounts",Be,...t]),...Qw.map(t=>["innerInstructions",Be,...t])]}function V2t(){return(t,e)=>{const n=t;if("error"in n){const{error:r}=n;if(r&&typeof r=="object"&&"code"in r&&(r.code===-32002||r.code===-32002n)&&"data"in r&&r.data){const a=Jce([Qce(z2t())],{keyPath:[]})(r.data,e),o={...r,data:a};throw Wv(o)}throw Wv(n.error)}return n}}function H2t(t){return(e,n)=>{const r=n.methodName,i=t!=null&&t.allowedNumericKeyPaths&&r?t.allowedNumericKeyPaths[r]:void 0;return rp(e,s=>V2t()(s,n),s=>F2t()(s,n),s=>eue(i??[])(s,n))}}function W2t(t){return(e,n)=>{const r=n.methodName,i=t!=null&&t.allowedNumericKeyPaths&&r?t.allowedNumericKeyPaths[r]:void 0;return rp(e,s=>eue(i??[])(s,n))}}function q2t(t){return N2t({requestTransformer:Xce(t),responseTransformer:H2t({allowedNumericKeyPaths:Z2t()})})}var AA;function Z2t(){return AA||(AA={getAccountInfo:nf.map(t=>["value",...t]),getBlock:[["transactions",Be,"meta","preTokenBalances",Be,"accountIndex"],["transactions",Be,"meta","preTokenBalances",Be,"uiTokenAmount","decimals"],["transactions",Be,"meta","postTokenBalances",Be,"accountIndex"],["transactions",Be,"meta","postTokenBalances",Be,"uiTokenAmount","decimals"],["transactions",Be,"meta","rewards",Be,"commission"],...Qw.map(t=>["transactions",Be,"meta","innerInstructions",Be,...t]),...uG.map(t=>["transactions",Be,"transaction","message",...t]),["rewards",Be,"commission"]],getClusterNodes:[[Be,"featureSet"],[Be,"shredVersion"]],getInflationGovernor:[["initial"],["foundation"],["foundationTerm"],["taper"],["terminal"]],getInflationRate:[["foundation"],["total"],["validator"]],getInflationReward:[[Be,"commission"]],getMultipleAccounts:nf.map(t=>["value",Be,...t]),getProgramAccounts:nf.flatMap(t=>[["value",Be,"account",...t],[Be,"account",...t]]),getRecentPerformanceSamples:[[Be,"samplePeriodSecs"]],getTokenAccountBalance:[["value","decimals"],["value","uiAmount"]],getTokenAccountsByDelegate:F$.map(t=>["value",Be,"account",...t]),getTokenAccountsByOwner:F$.map(t=>["value",Be,"account",...t]),getTokenLargestAccounts:[["value",Be,"decimals"],["value",Be,"uiAmount"]],getTokenSupply:[["value","decimals"],["value","uiAmount"]],getTransaction:[["meta","preTokenBalances",Be,"accountIndex"],["meta","preTokenBalances",Be,"uiTokenAmount","decimals"],["meta","postTokenBalances",Be,"accountIndex"],["meta","postTokenBalances",Be,"uiTokenAmount","decimals"],["meta","rewards",Be,"commission"],...Qw.map(t=>["meta","innerInstructions",Be,...t]),...uG.map(t=>["transaction","message",...t])],getVersion:[["feature-set"]],getVoteAccounts:[["current",Be,"commission"],["delinquent",Be,"commission"]],simulateTransaction:[["value","loadedAccountsDataSize"],...nf.map(t=>["value","accounts",Be,...t]),...Qw.map(t=>["value","innerInstructions",Be,...t])]}),AA}function K2t(t){const e={};for(const n in t)e[n.toLowerCase()]=t[n];return e}function G2t(t){const{fromJson:e,headers:n,toJson:r,url:i}=t;let s;const a=n&&K2t(n);return async function({payload:l,signal:u}){const f=r?r(l):JSON.stringify(l),p={...s,body:f,headers:{...a,accept:"application/json","content-length":f.length.toString(),"content-type":"application/json; charset=utf-8"},method:"POST",signal:u},y=await fetch(i,p);if(!y.ok)throw new ht(out,{headers:y.headers,message:y.statusText,statusCode:y.status});return e?e(await y.text(),l):await y.json()}}var Y2t=["getAccountInfo","getBalance","getBlock","getBlockCommitment","getBlockHeight","getBlockProduction","getBlocks","getBlocksWithLimit","getBlockTime","getClusterNodes","getEpochInfo","getEpochSchedule","getFeeForMessage","getFirstAvailableBlock","getGenesisHash","getHealth","getHighestSnapshotSlot","getIdentity","getInflationGovernor","getInflationRate","getInflationReward","getLargestAccounts","getLatestBlockhash","getLeaderSchedule","getMaxRetransmitSlot","getMaxShredInsertSlot","getMinimumBalanceForRentExemption","getMultipleAccounts","getProgramAccounts","getRecentPerformanceSamples","getRecentPrioritizationFees","getSignaturesForAddress","getSignatureStatuses","getSlot","getSlotLeader","getSlotLeaders","getStakeMinimumDelegation","getSupply","getTokenAccountBalance","getTokenAccountsByDelegate","getTokenAccountsByOwner","getTokenLargestAccounts","getTokenSupply","getTransaction","getTransactionCount","getVersion","getVoteAccounts","index","isBlockhashValid","minimumLedgerSlot","requestAirdrop","sendTransaction","simulateTransaction"];function dG(t){return Kce(t)&&Y2t.includes(t.method)}function J2t(t){return G2t({...t,fromJson:(e,n)=>dG(n)?qce(e):JSON.parse(e),toJson:e=>dG(e)?Zce(e):JSON.stringify(e)})}var X2t=Object.prototype.toString,Q2t=Object.keys||function(t){const e=[];for(const n in t)e.push(n);return e};function Sg(t,e){let n,r,i,s,a,o,l;if(t===!0)return"true";if(t===!1)return"false";switch(typeof t){case"object":if(t===null)return null;if("toJSON"in t&&typeof t.toJSON=="function")return Sg(t.toJSON(),e);if(l=X2t.call(t),l==="[object Array]"){for(i="[",r=t.length-1,n=0;n<r;n++)i+=Sg(t[n],!0)+",";return r>-1&&(i+=Sg(t[n],!0)),i+"]"}else if(l==="[object Object]"){for(s=Q2t(t).sort(),r=s.length,i="",n=0;n<r;)a=s[n],o=Sg(t[a],!1),o!==void 0&&(i&&(i+=","),i+=JSON.stringify(a)+":"+o),n++;return"{"+i+"}"}else return JSON.stringify(t);case"function":case"undefined":return e?null:void 0;case"bigint":return`${t.toString()}n`;case"string":return JSON.stringify(t);default:return isFinite(t)?t:null}}function tue(t){const e=Sg(t,!1);if(e!==void 0)return""+e}function nue(t,e,n){let r="";if(typeof e[0]=="number"){const a=e[0]+1,o=a%10,l=a%100;o==1&&l!=11?r=a+"st":o==2&&l!=12?r=a+"nd":o==3&&l!=13?r=a+"rd":r=a+"th"}else r=`\`${e[0].toString()}\``;const i=e.length>1?e.slice(1).map(a=>typeof a=="number"?`[${a}]`:a).join("."):void 0,s=new ht(kce,{argumentLabel:r,keyPath:e,methodName:t,optionalPathLabel:i?` at path \`${i}\``:"",value:n,...i!==void 0?{path:i}:void 0});return U9(s,nue),s}var eht={defaultCommitment:"confirmed",onIntegerOverflow(t,e,n){throw nue(t.methodName,e,n)}},tht=globalThis.AbortController,hG;function fG(){return{}}function nht(t,e){let n;return async function(i){const{payload:s,signal:a}=i,o=e(s);if(o===void 0)return await t(i);if(n||(queueMicrotask(()=>{n=void 0}),n={}),n[o]==null){const u=new tht,f=(async()=>{try{return await t({...i,signal:u.signal})}catch(p){if(p===(hG||(hG=fG())))return;throw p}})();n[o]={abortController:u,numConsumers:0,responsePromise:f}}const l=n[o];if(l.numConsumers++,a){const u=l.responsePromise;return await new Promise((f,p)=>{const y=g=>{a.removeEventListener("abort",y),l.numConsumers-=1,queueMicrotask(()=>{l.numConsumers===0&&l.abortController.abort(hG||(hG=fG()))}),p(g.target.reason)};a.addEventListener("abort",y),u.then(f).catch(p).finally(()=>{a.removeEventListener("abort",y)})})}else return await l.responsePromise}}function rht(t){return Kce(t)?tue([t.method,t.params]):void 0}function iht(t){const e={};for(const n in t)e[n.toLowerCase()]=t[n];return e}function sht(t){return rp(J2t({...t,headers:{...t.headers?iht(t.headers):void 0,"solana-client":"js/5.5.1"}}),e=>nht(e,rht))}function rue(t,e){return aht(sht({url:t,...e}))}function aht(t){return L2t({api:q2t(eht),transport:t})}var oht=globalThis.AbortController,lht=globalThis.EventTarget,pG;function mG(){return Symbol(void 0)}var kA=Symbol();function cht({abortSignal:t,dataChannelName:e,dataPublisher:n,errorChannelName:r}){const i=new Map;function s(u){for(const[f,p]of i.entries())p.__hasPolled?(i.delete(f),p.onError(u)):p.publishQueue.push({__type:1,err:u})}const a=new oht;t.addEventListener("abort",()=>{a.abort(),s(pG||(pG=mG()))});const o={signal:a.signal};let l=kA;return n.on(r,u=>{l===kA&&(l=u,a.abort(),s(u))},o),n.on(e,u=>
1186{i.forEach((f,p)=>{if(f.__hasPolled){const{onData:y}=f;i.set(p,{__hasPolled:!1,publishQueue:[]}),y(u)}else f.publishQueue.push({__type:0,data:u})})},o),{async*[Symbol.asyncIterator](){if(t.aborted)return;if(l!==kA)throw l;const u=Symbol();i.set(u,{__hasPolled:!1,publishQueue:[]});try{for(;;){const f=i.get(u);if(!f)throw new ht(fut);if(f.__hasPolled)throw new ht(put);const p=f.publishQueue;try{if(p.length){f.publishQueue=[];for(const y of p)if(y.__type===0)yield y.data;else throw y.err}else yield await new Promise((y,g)=>{i.set(u,{__hasPolled:!0,onData:y,onError:g})})}catch(y){if(y===(pG||(pG=mG())))return;throw y}}}finally{i.delete(u)}}}}function iue(t){return{on(e,n,r){function i(s){if(s instanceof CustomEvent){const a=s.detail;n(a)}else n()}return t.addEventListener(e,i,r),()=>{t.removeEventListener(e,i)}}}}function uht(t,e,n){let r;const i=new lht,s=iue(i);return{...s,on(a,o,l){r||(r={dispose:t.on(e,g=>{const b=n(g);if(!b)return;const[v,_]=b;i.dispatchEvent(new CustomEvent(v,{detail:_}))}),numSubscribers:0}),r.numSubscribers++;const u=s.on(a,o,l);let f=!0;function p(){f&&(f=!1,l==null||l.signal.removeEventListener("abort",p),r.numSubscribers--,r.numSubscribers===0&&(r.dispose(),r=void 0),u())}return l==null||l.signal.addEventListener("abort",p),p}}}function dht(t){return new Proxy(t.api,{defineProperty(){return!1},deleteProperty(){return!1},get(e,n,r){if(n!=="then")return function(...i){const s=n.toString(),a=Reflect.get(e,s,r);if(!a)throw new ht(cut,{notificationName:s});const o=a(...i);return hht(t.transport,o)}}})}function hht(t,e){return{async subscribe({abortSignal:n}){const r=await t({signal:n,...e});return cht({abortSignal:n,dataChannelName:"notification",dataPublisher:r,errorChannelName:"error"})}}}function fht(t){return new Proxy({},{defineProperty(){return!1},deleteProperty(){return!1},get(...e){const[n,r]=e,i=r.toString();return function(...s){const a={methodName:i,params:s},o=t.requestTransformer?t.requestTransformer(a):a;return{execute(l){return t.planExecutor({...l,request:o})},request:o}}}})}function pht(t,e){return Object.freeze({...t,on(n,r,i){return n!=="message"?t.on(n,r,i):t.on("message",s=>r(e(s)),i)}})}function mht(t,e){return Object.freeze({...t,send:n=>t.send(e(n))})}var yht=globalThis.AbortController,z$=new WeakMap;function ght(t,e){return sue(-1,t,e)}function bht(t,e){sue(1,t,e)}function wht(t){let e=z$.get(t);return e||z$.set(t,e={}),e}function sue(t,e,n){if(n===void 0)return;const r=wht(e);!r[n]&&t>0&&(r[n]=0);const i=t+r[n];return i<=0?delete r[n]:r[n]=i,i}var yG=new WeakMap;function vht(t,e,n){let r=yG.get(t);r||yG.set(t,r=new WeakMap);const i=n??t;let s=r.get(i);return s||r.set(i,s=uht(t,"message",a=>{const o=a;if(!("method"in o))return;const l=n?n(o.params.result,e):o.params.result;return[`notification:${o.params.subscription}`,l]})),s}async function _ht({channel:t,responseTransformer:e,signal:n,subscribeRequest:r,unsubscribeMethodName:i}){let s;t.on("error",()=>{s=void 0,z$.delete(t)},{signal:n});const a=new Promise((p,y)=>{function g(){if(ght(t,s)===0){const b=B$({methodName:i,params:[s]});s=void 0,t.send(b).catch(()=>{})}y(this.reason)}n.aborted?g.call(n):n.addEventListener("abort",g)}),o=B$(r);await t.send(o);const l=new Promise((p,y)=>{const g=new yht;n.addEventListener("abort",g.abort.bind(g));const b={signal:g.signal};t.on("error",v=>{g.abort(),y(v)},b),t.on("message",v=>{v&&typeof v=="object"&&"id"in v&&v.id===o.id&&(g.abort(),"error"in v?y(Wv(v.error)):p(v.result))},b)});if(s=await v2t([a,l]),s==null)throw new ht(uut);bht(t,s);const u=vht(t,r,e),f=`notification:${s}`;return{on(p,y,g){switch(p){case"notification":return u.on(f,y,g);case"error":return t.on("error",y,g);default:throw new ht(mut,{channelName:p,supportedChannelNames:["notification","error"]})}}}}function xht(t){const e=Xce(t),n=W2t({allowedNumericKeyPaths:Eht()});return fht({planExecutor({request:r,...i}){return _ht({...i,responseTransformer:n,subscribeRequest:{...r,methodName:r.methodName.replace(/Notifications$/,"Subscribe")},unsubscribeMethodName:r.methodName.replace(/Notifications$/,"Unsubscribe")})},requestTransformer:e})}function Cht(t){return xht(t)}var TA;function Eht(){return TA||(TA={accountNotifications:nf.map(t=>["value",...t]),blockNotifications:[["value","block","transactions",Be,"meta","preTokenBalances",Be,"accountIndex"],["value","block","transactions",Be,"meta","preTokenBalances",Be,"uiTokenAmount","decimals"],["value","block","transactions",Be,"meta","postTokenBalances",Be,"accountIndex"],["value","block","transactions",Be,"meta","postTokenBalances",Be,"uiTokenAmount","decimals"],["value","block","transactions",Be,"meta","rewards",Be,"commission"],["value","block","transactions",Be,"meta","innerInstructions",Be,"index"],["value","block","transactions",Be,"meta","innerInstructions",Be,"instructions",Be,"programIdIndex"],["value","block","transactions",Be,"meta","innerInstructions",Be,"instructions",Be,"accounts",Be],["value","block","transactions",Be,"transaction","message","addressTableLookups",Be,"writableIndexes",Be],["value","block","transactions",Be,"transaction","message","addressTableLookups",Be,"readonlyIndexes",Be],["value","block","transactions",Be,"transaction","message","instructions",Be,"programIdIndex"],["value","block","transactions",Be,"transaction","message","instructions",Be,"accounts",Be],["value","block","transactions",Be,"transaction","message","header","numReadonlySignedAccounts"],["value","block","transactions",Be,"transaction","message","header","numReadonlyUnsignedAccounts"],["value","block","transactions",Be,"transaction","message","header","numRequiredSignatures"],["value","block","rewards",Be,"commission"]],programNotifications:nf.flatMap(t=>[["value",Be,"account",...t],[Be,"account",...t]])}),TA}var Sht=globalThis.EventTarget,eg=globalThis.WebSocket,gG=1e3;function Aht({sendBufferHighWatermark:t,signal:e,url:n}){if(e.aborted)return Promise.reject(e.reason);let r,i=!1;const s=new Set;
1186function a(){s.forEach(C=>{C()}),s.clear()}function o(){a(),i||v(e.reason),b.readyState!==eg.CLOSED&&b.readyState!==eg.CLOSING&&b.close(gG)}function l(C){a(),r==null||r.onCancel(),e.removeEventListener("abort",o),b.removeEventListener("close",l),b.removeEventListener("error",u),b.removeEventListener("message",f),b.removeEventListener("open",g),!e.aborted&&!(C.wasClean&&C.code===gG)&&p.dispatchEvent(new CustomEvent("error",{detail:new ht(R$,{cause:C})}))}function u(C){if(!e.aborted&&!i){const S=new ht(hut,{errorEvent:C});v(S),p.dispatchEvent(new CustomEvent("error",{detail:S}))}}function f(C){e.aborted||p.dispatchEvent(new CustomEvent("message",{detail:C.data}))}const p=new Sht,y=iue(p);function g(){i=!0,_({...y,async send(C){if(b.readyState!==eg.OPEN)throw new ht(R$);if(!r&&b.bufferedAmount>t){let S;const x=new Promise((A,I)=>{const $=setInterval(()=>{(b.readyState!==eg.OPEN||!(b.bufferedAmount>t))&&(clearInterval($),r=void 0,A())},16);S=()=>{r=void 0,clearInterval($),I(new ht(dut))}});r={onCancel:S,promise:x}}if(r){if(ArrayBuffer.isView(C)&&!(C instanceof DataView)){const S=C.constructor;C=new S(C)}await r.promise}b.send(C)}})}const b=new eg(n);e.addEventListener("abort",o),b.addEventListener("close",l),b.addEventListener("error",u),b.addEventListener("message",f),b.addEventListener("open",g);let v,_;return new Promise((C,S)=>{v=S,_=C})}function aue(t,e,n){let r="";if(typeof e[0]=="number"){const a=e[0]+1,o=a%10,l=a%100;o==1&&l!=11?r=a+"st":o==2&&l!=12?r=a+"nd":o==3&&l!=13?r=a+"rd":r=a+"th"}else r=`\`${e[0].toString()}\``;const i=e.length>1?e.slice(1).map(a=>typeof a=="number"?`[${a}]`:a).join("."):void 0,s=new ht(kce,{argumentLabel:r,keyPath:e,methodName:t,optionalPathLabel:i?` at path \`${i}\``:"",value:n,...i!==void 0?{path:i}:void 0});return U9(s,aue),s}var kht={defaultCommitment:"confirmed",onIntegerOverflow(t,e,n){throw aue(t.methodName,e,n)}},HP=globalThis.AbortController,Tht={jsonrpc:"2.0",method:"ping"};function Lht({abortSignal:t,channel:e,intervalMs:n}){let r;function i(){e.send(Tht).catch(o=>{Lce(o,R$)&&a.abort()})}function s(){clearInterval(r),r=setInterval(i,n)}const a=new HP;return a.signal.addEventListener("abort",()=>{clearInterval(r)}),t.addEventListener("abort",()=>{a.abort()}),e.on("error",()=>{a.abort()},{signal:a.signal}),e.on("message",s,{signal:a.signal}),globalThis.navigator.onLine&&s(),globalThis.addEventListener("offline",function(){clearInterval(r)},{signal:a.signal}),globalThis.addEventListener("online",function(){i(),s()},{signal:a.signal}),{...e,send(...o){return a.signal.aborted||s(),e.send(...o)}}}function $ht(){return{entries:[],freeChannelIndex:-1}}function Iht(t,{maxSubscriptionsPerChannel:e,minChannels:n}){const r=$ht();function i(){if(r.entries.length<n){r.freeChannelIndex=-1;return}let s;for(let a=0;a<r.entries.length;a++){const o=(r.freeChannelIndex+a+2)%r.entries.length,l=r.entries[o];l.subscriptionCount<e&&(!s||s.subscriptionCount>=l.subscriptionCount)&&(s={poolIndex:o,subscriptionCount:l.subscriptionCount})}r.freeChannelIndex=(s==null?void 0:s.poolIndex)??-1}return function({abortSignal:a}){let o;function l(){const u=r.entries.findIndex(f=>f===o);r.entries.splice(u,1),o.dispose(),i()}if(r.freeChannelIndex===-1){const u=new HP,f=t({abortSignal:u.signal});f.then(p=>{p.on("error",l,{signal:u.signal})}).catch(l),o={channel:f,dispose(){u.abort()},subscriptionCount:0},r.entries.push(o)}else o=r.entries[r.freeChannelIndex];return o.subscriptionCount++,a.addEventListener("abort",function(){o.subscriptionCount--,o.subscriptionCount===0?l():r.freeChannelIndex!==-1&&(r.freeChannelIndex--,i())}),i(),o.channel}}function Nht(t){return rp(t,e=>pht(e,qce),e=>mht(e,Zce))}function Oht(t){return Pht({...t,jsonSerializer:Nht})}function Pht(t){if(/^wss?:/i.test(t.url)===!1){const i=t.url.match(/^([^:]+):/);throw new DOMException(i?`Failed to construct 'WebSocket': The URL's scheme must be either 'ws' or 'wss'. '${i[1]}:' is not allowed.`:`Failed to construct 'WebSocket': The URL '${t.url}' is invalid.`)}const{intervalMs:e,...n}=t;return Iht((({abortSignal:i})=>Aht({...n,sendBufferHighWatermark:t.sendBufferHighWatermark??131072,signal:i}).then(t.jsonSerializer).then(s=>Lht({abortSignal:i,channel:s,intervalMs:e??5e3}
1186))),{maxSubscriptionsPerChannel:t.maxSubscriptionsPerChannel??100,minChannels:t.minChannels??1})}function Rht(t){const e=new Map;return function(r){const{request:i,signal:s}=r,a=tue([i.methodName,i.params]);let o=e.get(a);if(!o){const l=new HP,u=t({...r,signal:l.signal});u.then(f=>{f.on("error",()=>{e.delete(a),l.abort()},{signal:l.signal})}).catch(()=>{}),e.set(a,o={abortController:l,dataPublisherPromise:u,numSubscribers:0})}return o.numSubscribers++,s.addEventListener("abort",()=>{o.numSubscribers--,o.numSubscribers===0&&queueMicrotask(()=>{o.numSubscribers===0&&(e.delete(a),o.abortController.abort())})},{signal:o.abortController.signal}),o.dataPublisherPromise}}function jht({createChannel:t}){return rp(Mht(t),e=>Rht(e))}function Mht(t){return(async({execute:e,signal:n})=>{const r=await t({abortSignal:n});return await e({channel:r,signal:n})})}function Dht(t,e){const n=jht({createChannel:Oht({...e,url:t})});return Uht(n)}function bG(t,e){return Dht(t,e)}function Uht(t){return dht({api:Cht(kht),transport:t})}function oue(t){return"modifyAndSignTransactions"in t&&typeof t.modifyAndSignTransactions=="function"}function lue(t){return"signTransactions"in t&&typeof t.signTransactions=="function"}function Bht(t){return"signAndSendTransactions"in t&&typeof t.signAndSendTransactions=="function"}function cue(t){return lue(t)||oue(t)||Bht(t)}function v4t(t,e){Object.freeze(t);const n={...e,feePayer:t};return Object.freeze(n),n}async function uue(t){const e=await Rce(t.publicKey);return Object.freeze({address:e,keyPair:t,signMessages:r=>Promise.all(r.map(async i=>Object.freeze({[e]:await VP(t.privateKey,i.content)}))),signTransactions:r=>Promise.all(r.map(async i=>{const s=await g2t([t],i);return Object.freeze({[e]:s.signatures[e]})}))})}async function Fht(t,e){return await uue(await u2t(t,e))}async function zht(t,e){return await uue(await d2t(t,e))}var Vht="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",due="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";function Hht(t){if(!t)throw new Error("Expected a Address.");return typeof t=="object"&&"address"in t?t.address:Array.isArray(t)?t[0]:t}function hue(t,e){return n=>{if(!n.value)return Object.freeze({address:t,role:wi.READONLY});const r=n.isWritable?wi.WRITABLE:wi.READONLY;return Object.freeze({address:Hht(n.value),role:wG(n.value)?bdt(r):r,...wG(n.value)?{signer:n.value}:{}})}}function wG(t){return!!t&&typeof t=="object"&&"address"in t&&cue(t)}async function _4t(t,e={}){const{programAddress:n="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"}=e;return await sdt({programAddress:n,seeds:[e1().encode(t.owner),e1().encode(t.tokenProgram),e1().encode(t.mint)]})}var Wht=1;function qht(){return wm(K2([["discriminator",j1()]]),t=>({...t,discriminator:Wht}))}function x4t(t,e){const n=Vht,i={payer:{value:t.payer??null,isWritable:!0},ata:{value:t.ata??null,isWritable:!0},owner:{value:t.owner??null,isWritable:!1},mint:{value:t.mint??null,isWritable:!1},systemProgram:{value:t.systemProgram??null,isWritable:!1},tokenProgram:{value:t.tokenProgram??null,isWritable:!1}};i.tokenProgram.value||(i.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),i.systemProgram.value||(i.systemProgram.value="11111111111111111111111111111111");const s=hue(n);return Object.freeze({accounts:[s(i.payer),s(i.ata),s(i.owner),s(i.mint),s(i.systemProgram),s(i.tokenProgram)],data:qht().encode({}),programAddress:n})}var Zht=3;function Kht(){return wm(K2([["discriminator",j1()],["amount",ldt()]]),t=>({...t,discriminator:Zht}))}function C4t(t,e){const n=due,i={source:{value:t.source??null,isWritable:!0},destination:{value:t.destination??null,isWritable:!0},authority:{value:t.authority??null,isWritable:!1}},s={...t},a=(s.multiSigners??[]).map(l=>({address:l.address,role:wi.READONLY_SIGNER,signer:l})),o=hue(n);return Object.freeze({accounts:[o(i.source),o(i.destination),o(i.authority),...a],data:Kht().encode(s),programAddress:n})}var Ght="TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";_ce([pr().transform(t=>t.replace(/[^0-9.-]+/g,"")),So()]).pipe(Xlt.number().min(1e-4).max(999999999));var z9=_c(["abstract","abstract-testnet","base-sepolia","base","avalanche-fuji","avalanche","iotex","solana-devnet","solana","sei","sei-testnet","polygon","polygon-amoy","peaq","story","educhain","skale-base-sepolia"]),Yht=["abstract","abstract-testnet","base-sepolia","base","avalanche-fuji","avalanche","iotex","sei","sei-testnet","polygon","polygon-amoy","peaq","story","educhain","skale-base-sepolia"],Jht=new Map([["abstract",2741],["abstract-testnet",11124],["base-sepolia",84532],["base",8453],["avalanche-fuji",43113],["avalanche",43114],["iotex",4689],["sei",1329],["sei-testnet",1328],["polygon",137],["polygon-amoy",80002],["peaq",3338],["story",1514],["educhain",41923],["skale-base-sepolia",324705682]]),fue=["solana-devnet","solana"];Object.fromEntries([...Yht,...fue].map(t=>[Jht.get(t),t]));var Xht={id:324705682,name:"SKALE Base Sepolia",nativeCurrency:{name:"Credits",symbol:"CREDITS",decimals:18},rpcUrls:{default:{http:["https://base-sepolia-testnet.skalenodes.com/v1/jubilant-horrible-ancha"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia-testnet-explorer.skalenodes.com",apiUrl:"https://base-sepolia-testnet-explorer.skalenodes.com/api"}}};function WP(t){const e=ZP(t);return B3({chain:e,transport:y1()}).extend(S8)}function Qht(){return WP("base-sepolia")}function eft(){return WP("avalanche-fuji")}function qP(t,e){const n=ZP(t),r=Gxe({chain:n,transport:y1(),account:Lrt(e)});return pue(n)?r.extend(S8).extend(ict()):r.extend(S8)}function tft(t){return qP("base-sepolia",t)}function nft(t){return qP("avalanche-fuji",t)}function rft(t){return typeof t=="object"&&t!==null&&"chain"in t&&"transport"in t}function ift(t){const e=t;
1186return typeof t=="object"&&t!==null&&typeof e.address=="string"&&typeof e.type=="string"&&typeof e.sign=="function"&&typeof e.signMessage=="function"&&typeof e.signTypedData=="function"&&typeof e.signTransaction=="function"}function ZP(t){if(!t)throw new Error("NETWORK environment variable is not set");switch(t){case"abstract":return ACe;case"abstract-testnet":return kCe;case"base":return UN;case"base-sepolia":return Nte;case"avalanche":return jCe;case"avalanche-fuji":return MCe;case"sei":return VCe;case"sei-testnet":return HCe;case"polygon":return tT;case"polygon-amoy":return zCe;case"peaq":return FCe;case"story":return WCe;case"educhain":return DCe;case"iotex":return UCe;case"iotex-testnet":return BCe;case"skale-base-sepolia":return Xht;default:throw new Error(`Unsupported network: ${t}`)}}var sft=new Set([2741,11124]);function pue(t){return sft.has(t.id)}var aft="https://api.devnet.solana.com",oft="https://api.mainnet-beta.solana.com",lft="wss://api.devnet.solana.com",cft="wss://api.mainnet-beta.solana.com";function mue(t){return rue(t||aft)}function yue(t){return rue(t||oft)}function gue(t,e){if(t==="solana-devnet")return mue(e);if(t==="solana")return yue(e);throw new Error("Invalid network")}function uft(t,e){if(t==="solana-devnet")return bG(e?vG(e):lft);if(t==="solana")return bG(e?vG(e):cft);throw new Error("Invalid network")}function vG(t){return t.startsWith("http")?t.replace("http","ws"):t}function dft(t){if(!fue.find(e=>e===t))throw new Error(`Unsupported SVM network: ${t}`);return gue(t)}async function hft(t){const e=kte.decode(t);if(e.length===64)return await Fht(e);if(e.length===32)return await zht(e);throw new Error(`Unexpected key length: ${e.length}. Expected 32 or 64 bytes.`)}function fft(t){return typeof t=="object"&&t!==null&&cue(t)}var pft={};IP(pft,{authorizationPrimaryType:()=>yft,authorizationTypes:()=>mft,config:()=>xlt,createClientAvalancheFuji:()=>eft,createClientSepolia:()=>Qht,createConnectedClient:()=>WP,createSigner:()=>qP,createSignerAvalancheFuji:()=>nft,createSignerSepolia:()=>tft,getChainFromNetwork:()=>ZP,isAccount:()=>ift,isSignerWallet:()=>rft,isZkStackChain:()=>pue,usdcABI:()=>Clt});var mft={TransferWithAuthorization:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"value",type:"uint256"},{name:"validAfter",type:"uint256"},{name:"validBefore",type:"uint256"},{name:"nonce",type:"bytes32"}]},yft="TransferWithAuthorization",gft={};IP(gft,{SvmAddressRegex:()=>KP});var KP=/^[1-9A-HJ-NP-Za-km-z]{32,44}$/,bft=/^[A-Za-z0-9+/]*={0,2}$/,wft=18,V$=/^0x[0-9a-fA-F]{40}$/,GP=/^0x[a-fA-F0-9]{40}|[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$/,vft=/^0x[0-9a-fA-F]{64}$/,_ft=/^0x[0-9a-fA-F]+$/,YP=["exact"],R5=[1],JP=["insufficient_funds","invalid_exact_evm_payload_authorization_valid_after","invalid_exact_evm_payload_authorization_valid_before","invalid_exact_evm_payload_authorization_value","invalid_exact_evm_payload_signature","invalid_exact_evm_payload_undeployed_smart_wallet","invalid_exact_evm_payload_recipient_mismatch","invalid_exact_svm_payload_transaction","invalid_exact_svm_payload_transaction_amount_mismatch","invalid_exact_svm_payload_transaction_create_ata_instruction","invalid_exact_svm_payload_transaction_create_ata_instruction_incorrect_payee","invalid_exact_svm_payload_transaction_create_ata_instruction_incorrect_asset","invalid_exact_svm_payload_transaction_instructions","invalid_exact_svm_payload_transaction_instructions_length","invalid_exact_svm_payload_transaction_instructions_compute_limit_instruction","invalid_exact_svm_payload_transaction_instructions_compute_price_instruction","invalid_exact_svm_payload_transaction_instructions_compute_price_instruction_too_high","invalid_exact_svm_payload_transaction_instruction_not_spl_token_transfer_checked","invalid_exact_svm_payload_transaction_instruction_not_token_2022_transfer_checked","invalid_exact_svm_payload_transaction_fee_payer_included_in_instruction_accounts","invalid_exact_svm_payload_transaction_fee_payer_transferring_funds","invalid_exact_svm_payload_transaction_not_a_transfer_instruction","invalid_exact_svm_payload_transaction_receiver_ata_not_found","invali
1186d_exact_svm_payload_transaction_sender_ata_not_found","invalid_exact_svm_payload_transaction_simulation_failed","invalid_exact_svm_payload_transaction_transfer_to_incorrect_ata","invalid_network","invalid_payload","invalid_payment_requirements","invalid_scheme","invalid_payment","payment_expired","unsupported_scheme","invalid_x402_version","invalid_transaction_state","invalid_x402_version","settle_exact_svm_block_height_exceeded","settle_exact_svm_transaction_confirmation_timed_out","unsupported_scheme","unexpected_settle_error","unexpected_verify_error"],e8=t=>Number.isInteger(Number(t))&&Number(t)>=0,xft=t=>e=>e.length<=t,XP=pr().regex(V$).or(pr().regex(KP)),Cft=pr().regex(GP).or(pr().regex(KP)),j5=qi({scheme:_c(YP),network:z9,maxAmountRequired:pr().refine(e8),resource:pr().url(),description:pr(),mimeType:pr(),outputSchema:pf(R1()).optional(),payTo:XP,maxTimeoutSeconds:So().int(),asset:Cft,extra:pf(R1()).optional()}),Eft=qi({from:pr().regex(V$),to:pr().regex(V$),value:pr().refine(e8).refine(xft(wft)),validAfter:pr().refine(e8),validBefore:pr().refine(e8),nonce:pr().regex(vft)}),Sft=qi({signature:pr().regex(_ft),authorization:Eft}),Aft=qi({transaction:pr().regex(bft)}),bue=qi({x402Version:So().refine(t=>R5.includes(t)),scheme:_c(YP),network:z9,payload:_ce([Sft,Aft])});qi({x402Version:So().refine(t=>R5.includes(t)),error:_c(JP).optional(),accepts:D9(j5).optional(),payer:pr().regex(GP).optional()});var kft=_c(["GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD"]),Tft=qi({type:Jlt("http"),method:kft,queryParams:pf(pr(),pr()).optional(),bodyType:_c(["json","form-data","multipart-form-data","text","binary"]).optional(),bodyFields:pf(pr(),R1()).optional(),headerFields:pf(pr(),R1()).optional()});Ylt("type",[Tft]);var Lft=qi({resource:pr(),type:_c(["http"]),x402Version:So().refine(t=>R5.includes(t)),accepts:D9(j5),lastUpdated:Glt(),metadata:pf(R1()).optional()});qi({paymentPayload:bue,paymentRequirements:j5});qi({paymentPayload:bue,paymentRequirements:j5});qi({isValid:vce(),invalidReason:_c(JP).optional(),payer:XP.optional()});qi({success:vce(),errorReason:_c(JP).optional(),payer:XP.optional(),transaction:pr().regex(GP),network:z9});qi({type:pr().optional(),limit:So().optional(),offset:So().optional()});qi({x402Version:So().refine(t=>R5.includes(t)),items:D9(Lft),pagination:qi({limit:So(),offset:So(),total:So()})});var $ft=qi({x402Version:So().refine(t=>R5.includes(t)),scheme:_c(YP),network:z9,extra:pf(R1()).optional()});qi({kinds:D9($ft)});var Ift={};IP(Ift,{createDevnetRpcClient:()=>mue,createMainnetRpcClient:()=>yue,createSignerFromBase58:()=>hft,createSvmConnectedClient:()=>dft,decodeTransactionFromPayload:()=>Nft,getRpcClient:()=>gue,getRpcSubscriptions:()=>uft,getTokenPayerFromTransaction:()=>Oft,isSignerWallet:()=>fft,signAndSimulateTransaction:()=>Pft,signTransactionWithSigner:()=>wue});function Nft(t){try{const n=But().encode(t.transaction);return m2t().decode(n)}catch(e){throw console.error("error",e),new Error("invalid_exact_svm_payload_transaction")}}function Oft(t){const e=Udt().decode(t.messageBytes),n=e.staticAccounts??[],r=e.instructions??[];for(const i of r){const s=i.programAddressIndex,a=n[s].toString();if(a===due.toString()||a===Ght.toString()){const o=i.accountIndices??[];if(o.length>=4){const l=o[3],u=n[l].toString();if(u)return u}}}return""}async function Pft(t,e,n){const r=await wue(t,e),i=b2t(r),s={sigVerify:!0,replaceRecentBlockhash:!1,commitment:"confirmed",encoding:"base64",accounts:void 0,innerInstructions:void 0,minContextSlot:void 0};return await n.simulateTransaction(i,s).send()}async function wue(t,e){if(oue(t)){const[n]=await t.modifyAndSignTransactions([e]);if(!n)throw new Error("transaction_signer_failed_to_return_transaction");return n}if(lue(t)){const[n]=await t.signTransactions([e]);if(!n)throw new Error("transaction_signer_failed_to_return_signatures");return Rft(e,n)}throw new Error("transaction_signer_must_support_offline_signing")}function Rft(t,e){return Object.freeze({...t,signatures:Object.freeze({...t.signatures,...e})})}qi({paymentHeader:pr(),paymentRequirements:j5});function jft(){let t=new URLSearchParams(window.location.search),e=t.get("privy_oauth_code"),n=t.get("privy_oauth_state"),r=t.get("privy_oauth_provider");if(!e||!n||!r)return{inProgress:!1};let i=!1;try{i=!!window.opener.location.origin}catch{}return{inProgress:!0,authorizationCode:e,stateCode:n,provider:r,withPrivyUi:!vt.get(X8),popupFlow:window.opener!==null&&i,disableSignup:!!vt.get(Og)}}function E4t(){let t=new URL(window.location.href);t.searchParams.delete("privy_oauth_code"),t.searchParams.delete("privy_oauth_provider"),t.searchParams.delete("privy_oauth_state"),vt.del(J8),window.history.replaceState({},"",t)}class _G{get meta(){return this._meta}async authenticate(){if(!this.api)throw new ue("Auth flow has no API instance");if(!this.meta.channelToken)throw new ue("Auth flow must be initialized first");try{let e=await this.api.post(Pnt,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});if(!e)throw new ue("No response from authentication");return e}catch(e){throw vn(e)}}async link(){if(!this.api)throw new ue("Auth flow has no API instance");try{return await this.api.post(Rnt,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(e){throw vn(e)}}async _startChannelOnce(){if(!this.api)throw new ue("Auth flow has no API instance");let e=await this.api.post(Ont,{token:this.captchaToken});El.isMobile&&!El.isIOS&&e.connect_uri&&Doe(e.connect_uri,"_blank"),this._meta={...this._meta,connectUri:e.connect_uri,channelToken:e.channel_token}}async initializeFarcasterConnect(){if(!this.api)throw new ue("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new ue("Auth flow has no API instance");if(!this.meta.channelToken)throw new ue("Auth flow must be initialized first");let e=await this.api.get(jnt,{headers:{"farcaster-channel-token":this.meta.channelToken}});return e.state==="completed"&&(this.message=e.message,this.signature=e.signature,this.fid=e.fid,!0)}constructor(e,n=!1){this._meta={disableSignup:!1},this.captchaToken=e,this.startChannelOnce=new fl(this._startChannelOnce.bind(this)),this.pollForReady=new fl(this._pollForReady.bind(this)),this._meta.disableSignup=n}}class f0{async initRegisterFlow(e){if(!this.api)throw new ue("Auth flow has no API instance");this.authenticateForRegistration=!0,this.meta.initRegisterResponse=await this.initRegisterOnce.execute(e)}async initAuthenticationFlow(e){if(!this.api)throw new ue("Auth flow has no API instance");this.authenticateForRegistration=!1,this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute(e)}async initLinkFlow(){if(!this.api)throw new ue("Auth flow has no API instance");this.meta.initLinkResponse=await this.initLinkOnce.execute()}async register(){var n,r;let e=await Le(()=>import("./index-BbRoODsT.js"),[]);if(!this.api)throw new ue("Auth flow has no API instance");if(!e.browserSupportsWebAuthn())throw new ue("WebAuthn is not supported in this browser");this.meta.initRegisterResponse||(this.meta.initRegisterResponse=await this.initRegisterOnce.execute());try{let i=this.meta.initRegisterResponse.options,s=await e.startRegistration({optionsJSON:this._transformInitLinkOptionsToCamelCase(i)});return(r=(n=this.meta).setPasskeyAuthState)==null||r.call(n,{status:"submitting-response"}),await this.api.post(irt,{relying_party:this.meta.initRegisterResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(s)})}catch(i){throw i.name==="NotAllowedError"?new ue("Passkey request timed out or rejected by user.",void 0,Oe.PASSKEY_NOT_ALLOWED):vn(i)}}async authenticate(){var r,i,s;if(this.authenticateForRegistration)return this.register();let e=await Le(()=>import("./index-BbRoODsT.js"),[]);if(!this.api)throw new ue("Auth flow has no API instance");if(!e.browserSupportsWebAuthn())throw new ue("WebAuthn is not supported in this browser");this.meta.initAuthenticateResponse||(this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute());let n=((r=this.meta.allowedCredentialsIds)==null?void 0:r.map((a=>({type:"public-key",id:a}))))??this.meta.initAuthenticateResponse.options.allow_credentials;try{let a=await e.startAuthentication({optionsJSON:this._transformInitAuthenticateOptionsToCamelCase({...this.meta.initAuthenticateResponse.options,allow_credentials:n})});return(s=(i=this.meta).setPasskeyAuthState)==null||s.call(i,{status:"submitting-response"}),await this.api.post(rrt,{relying_party:this.meta.initAuthenticateResponse.relying_party,challenge:this.meta.initAuthenticateResponse.options.challenge,authenticator_response:this._transformAuthenticationResponseToSnakeCase(a)})}catch(a){throw a.name==="NotAllowedError"?new ue("Passkey request timed out or rejected by user.",void 0,Oe.PASSKEY_NOT_ALLOWED):vn(a)}}async link(){var n,r;let e=await Le(()=>import("./index-BbRoODsT.js"),[]);if(!this.api)throw new ue("Auth flow has no API instance");if(!e.browserSupportsWebAuthn())throw new ue("WebAuthn is not supported in this browser");this.meta.initLinkResponse||(this.meta.initLinkResponse=await this.initLinkOnce.execute());try{let i=this.meta.initLinkResponse.options,s=await e.startRegistration({optionsJSON:this._transformInitLinkOptionsToCamelCase(i)});return(r=(n=this.meta).setPasskeyAuthState)==null||r.call(n,{status:"submitting-response"}),await this.api.post(nrt,{relying_party:this.meta.initLinkResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(s)})}catch(i){throw i.name==="NotAllowedError"?new ue("Passkey request timed out or rejected by user.",void 0,Oe.PASSKEY_NOT_ALLOWED):vn(i)}}async _initRegisterOnce(e){if(!this.api)throw new ue("Auth flow has no API instance");let n=x6(e);return await this.api.post(trt,{token:this.meta.captchaToken},{headers:{...n}})}async _initAuthenticateOnce(e){if(!this.api)throw new ue("Auth flow has no API instance");let n=x6(e);return await this.api.post(ert,{token:this.meta.captchaToken},{headers:{...n}})}async _initLinkOnce(){if(!this.api)throw new ue("Auth flow has no API instance");return await this.api.post(Qnt,{})}_transformInitLinkOptionsToCamelCase(e){var r,i,s,a,o,l,u,f,p,y;let n=((r=this.meta.name)==null?void 0:r.trim())||void 0;return{rp:e.rp,user:{id:e.user.id,name:n??e.user.name,displayName:n??e.user.display_name},challenge:e.challenge,pubKeyCredParams:e.pub_key_cred_params.map((g=>({type:g.type,alg:g.alg}))),timeout:e.timeout,excludeCredentials:(i=e.exclude_credentials)==null?void 0:i.map((g=>({id:g.id,type:g.type,transports:g.transports}))),authenticatorSelection:{authenticatorAttachment:(s=e.authenticator_selection)==null?void 0:s.authenticator_attachment,requireResidentKey:(a=e.authenticator_selection)==null?void 0:a.require_resident_key,residentKey:(o=e.authenticator_selection)==null?void 0:o.resident_key,userVerification:(l=e.authenticator_selection)==null?void 0:l.user_verification},attestation:e.attestation,extensions:{appid:(u=e.extensions)==null?void 0:u.app_id,credProps:(p=(f=e.extensions)==null?void 0:f.cred_props)==null?void 0:p.rk,hmacCreateSecret:(y=e.extensions)==null?void 0:y.hmac_create_secret},hints:this.meta.hints}}_transformRegistrationResponseToSnakeCase(e){return{id:e.id,raw_i
1186d:e.rawId,response:{client_data_json:e.response.clientDataJSON,attestation_object:e.response.attestationObject,authenticator_data:e.response.authenticatorData},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type}}_transformInitAuthenticateOptionsToCamelCase(e){var n,r,i,s;return{rpId:e.rp_id,challenge:e.challenge,allowCredentials:((n=e.allow_credentials)==null?void 0:n.map((a=>({id:a.id,type:a.type,transports:a.transports}))))||[],timeout:e.timeout,extensions:{appid:(r=e.extensions)==null?void 0:r.app_id,credProps:(i=e.extensions)==null?void 0:i.cred_props,hmacCreateSecret:(s=e.extensions)==null?void 0:s.hmac_create_secret},userVerification:e.user_verification}}_transformAuthenticationResponseToSnakeCase(e){return{id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,authenticator_data:e.response.authenticatorData,signature:e.response.signature,user_handle:e.response.userHandle},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type}}constructor({captchaToken:e,setPasskeyAuthState:n,hints:r}){this.authenticateForRegistration=!1,this.initRegisterOnce=new fl(this._initRegisterOnce.bind(this)),this.initAuthenticateOnce=new fl(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new fl(this._initLinkOnce.bind(this)),this.meta={captchaToken:e,setPasskeyAuthState:n,hints:r}}}class xG{get meta(){var e;return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType,disableSignup:this._meta.disableSignup,messageType:this._meta.messageType,address:(e=this.wallet)==null?void 0:e.address}}set messageType(e){this._meta.messageType=e}async authenticate(){if(!this.client)throw new ue("SiwsFlow has no client instance");try{let{message:e,signature:n}=await this.sign();return await this.client.authenticateWithSiwsInternal({message:e,signature:n,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up",messageType:this.meta.messageType})}catch(e){throw vn(e)}}async link(){if(!this.client)throw new ue("SiwsFlow has no client instance");try{let{message:e,signature:n}=await this.sign();return await this.client.linkWithSiwsInternal({message:e,signature:n,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType,messageType:this.meta.messageType})}catch(e){throw vn(e)}}async sign(){let e,n;if(!this.client)throw new ue("SiwsFlow has no client instance");await this.buildMessage();let r=this.meta.messageType==="transaction",i=this.meta.messageType==="offchain-message";if(!this.preparedMessage)throw new ue("Could not prepare SIWS message");if(!r&&!this.wallet.provider.signMessage||r&&!this.wallet.provider.signTransaction)throw new ue("Wallet does not support the necessary signing methods");if(i){let s=wIe({message:this.preparedMessage,signerPublicKey:kte.decode(this.wallet.address),domain:window.location.origin}),a=await this.wallet.provider.signMessage({message:s});e=this.preparedMessage,n=$0.encode(a.signature)}else if(r&&this._plugin){let s=await this.wallet.provider.signTransaction({transaction:$0.decode(this.preparedMessage)});e=$0.encode(s.signedTransaction),n=this._plugin.getSignatureFromTransaction(s.signedTransaction,this.wallet.address)}else{e=this.preparedMessage;let s=await this.wallet.provider.signMessage({message:new TextEncoder().encode(this.preparedMessage)});n=$0.encode(s.signature)}return{message:e,signature:n}}async _getNonceOnce(){if(!this.client)throw new ue("SiwsFlow has no client instance");return await this.client.generateSiwsNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildMessage(){if(!this.client)throw new ue("SiwsFlow has no client instance");let e=this.wallet.address;return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.meta.messageType==="transaction"&&this._plugin?this.preparedMessage=this._plugin.createSiwsMemoTransaction({address:e,nonce:this.nonce}):this.preparedMessage=ait({address:e,nonce:this.nonce}),this.preparedMessage}constructor(e,n,r,i=!1,s="plain",a){this._meta={disableSignup:!1,messageType:"plain"}
1186,this.getNonceOnce=new fl(this._getNonceOnce.bind(this)),this.wallet=e,this.captchaToken=r,this.client=n,this._meta.disableSignup=i,this._meta.messageType=s,this._plugin=a}}const vue=N.createContext({enabled:!1,siteKey:"",provider:void 0,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:Ae,setError:Ae,setExecuting:Ae,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:nre,reset:Ae,execute:Ae});class H$ extends V2{constructor(e,n,r){super(e||"Captcha failed"),this.type="Captcha",n instanceof Error&&(this.cause=n),this.privyErrorCode=r}}const Mft=({children:t,appId:e,captchaSiteKey:n,enabledCaptchaProvider:r})=>{let i=N.useRef(null),s=N.useRef(null),[a,o]=N.useState(),[l,u]=N.useState(),[f,p]=N.useState(!1),y=N.useMemo((()=>r?f||a||l?!f||a||l?a&&!l?{status:"success",token:a}:l?{status:"error",error:l}:{status:"ready"}:{status:"loading"}:{status:"ready"}:{status:"disabled"}),[r,a,l,f]),g=N.useMemo((()=>r?r==="turnstile"?{remove:()=>{var v;(v=i.current)==null||v.remove(),p(!1),u(void 0),o(void 0)},reset:()=>{var v;(v=i.current)==null||v.reset(),p(!1),u(void 0),o(void 0)},execute:()=>{var v;p(!0),(v=i.current)==null||v.execute()},waitForResult:async()=>{try{return await kV((()=>{var v;return(v=i.current)==null?void 0:v.getResponse()}),{interval:200,timeout:2e4})}catch{throw new H$("Captcha failed",null,Oe.CAPTCHA_TIMEOUT)}}}:{remove:()=>{var v;(v=s.current)==null||v.removeCaptcha(),p(!1),u(void 0),o(void 0)},reset:()=>{var v;(v=s.current)==null||v.resetCaptcha(),p(!1),u(void 0),o(void 0)},execute:()=>{var v;p(!0),(v=s.current)==null||v.execute()},waitForResult:async()=>{try{return await kV((()=>{var _;let v=(_=s.current)==null?void 0:_.getResponse();if(v)return v}),{interval:200,timeout:2e4})}catch{throw new H$("Captcha failed",null,Oe.CAPTCHA_TIMEOUT)}}}:null),[r]),b=N.useMemo((()=>{if(!r||!g)return{...y,enabled:!1,siteKey:"",appId:e,setToken:Ae,setError:Ae,setExecuting:Ae,waitForResult:()=>Promise.resolve(void 0),remove:nre,reset:Ae,execute:Ae,provider:void 0,ref:{current:null}};let v={...y,enabled:!0,appId:e,setToken:o,setError:u,setExecuting:p};return r==="turnstile"?{...v,provider:"turnstile",ref:i,siteKey:n.split("t:")[1]??"",...g}:{...v,provider:"hcaptcha",ref:s,siteKey:n.split("h:")[1]??"",...g}}),[y,r,g,e,n]);return h.jsx(vue.Provider,{value:b,children:t})},_ue=()=>N.useContext(vue);class p0{async authenticate(){if(!this.api)throw new ue("Auth flow has no API instance");try{return await this.api.post(srt,{captcha_token:this.meta.captchaToken,telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw vn(e)}}async link(){if(!this.api)throw new ue("Auth flow has no API instance");try{return await this.api.post(art,{telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData})}catch(e){throw vn(e)}}constructor(e,n=!1){this.meta={disableSignup:!1},this.meta={captchaToken:e,disableSignup:!1},this.meta.disableSignup=n}}function S4t(t){let e={detail:"",retryable:!1};return(t==null?void 0:t.privyErrorCode)===Oe.LINKED_TO_ANOTHER_USER&&(e.detail="This account has already been linked to another user."),(t==null?void 0:t.privyErrorCode)===Oe.DISALLOWED_LOGIN_METHOD&&(e.detail="Login with Telegram not allowed."),(t==null?void 0:t.privyErrorCode)===Oe.INVALID_DATA&&(e.retryable=!0,e.detail="Something went wrong. Try again."),(t==null?void 0:t.privyErrorCode)===Oe.CANNOT_LINK_MORE_OF_TYPE&&(e.retryable=!0,e.detail="Something went wrong. Try again."),(t==null?void 0:t.privyErrorCode)===Oe.INVALID_CREDENTIALS&&(e.retryable=!0,e.detail="Something went wrong. Try again."),(t==null?void 0:t.privyErrorCode)===Oe.TOO_MANY_REQUESTS&&(e.detail="Too many requests. Please wait before trying again."),(t==null?void 0:t.privyErrorCode)===Oe.TOO_MANY_REQUESTS&&t.message.includes("rate limit")&&(e.detail="Request limit reached for Telegram. Please wait a moment and try again."),t instanceof H$&&(e.retryable=!0,e.detail="Something went wrong. Try again."),e}function CG(t){return Object.fromEntries(decodeURIComponent(t).split("&").map((e=>e.split("=").map(decodeURIComponent))))}function EG(){let t=new URL(window.location.href);t.searchParams.delete("id"),t.searchParams.delete("hash"),t.searchParams.delete("auth_date"),t.searchParams.delete("first_name"),t.searchParams.delete("last_name"),t.searchParams.delete("username"),t.searchParams.delete("photo_url"),t.hash="",window.history.replaceState({},"",t)}let Dft=N.lazy((()=>Le(()=>import("./TurnstileWrapper-BmL4TDJu-44E2JYF-.js"),[]))),Uft=N.lazy((()=>Le(()=>import("./HCaptchaWrapper-CUi9LJsp-DAZsDG0L.js"),[])));const Bft=t=>{let e=_ue();return N.useEffect((()=>e.remove),[e.remove]),e.enabled&&e.provider?h.jsx(N.Suspense,{fallback:null,children:h.jsxs("div",{className:"hidden h-0 w-0",children:[e.provider==="turnstile"&&h.jsx(Dft,{...t,captchaContext:e}),e.provider==="hcaptcha"&&h.jsx(Uft,{...t,captchaContext:e})]})}):null};var V9=Object.freeze({__proto__:null,AccountNotFoundScreen:()=>Le(()=>import("./AccountNotFoundScreen-mrDHRRtZ-yvOqa6Xk.js"),__vite__mapDeps([10,11,12,13,14,15])),AddFundsSelectionScreen:()=>Le(()=>import("./AddFundsSelectionScreen-D76JlRA1-BQXVYQyK.js"),__vite__mapDeps([16,17,18,15,11,12,13,14,19])),AffirmativeConsentScreen:()=>Le(()=>import("./AffirmativeConsentScreen-Cva7mCde-TbQtFbIO.js"),__vite__mapDeps([20,12,21,11,13,14,15,22])),AllowlistRejectionScreen:()=>Le(()=>import("./AllowlistRejectionScreen-CJlenrjE-CndA7FUz.js"),__vite__mapDeps([23,24,11,12,13,14,25,15])),AuthenticateWithWalletScreen:()=>Le(()=>import("./AuthenticateWithWalletScreen-C_zdZyDa-DrbpI10y.js"),__vite__mapDeps([26,27,12,28,29,15,30,31,32,33,34,35,36,37,38,17,13,14])),AwaitingEvmToSolBridgingScreen:()=>Le(()=>import("./AwaitingEvmToSolBridgingScreen-Ch3fh4A4-BGLjK7Ac.js"),__vite__mapDeps([39,40,41,12,42,43,14,44,45,46,47,48,49,50,51,52,53,54,36,55,56,57,58,59,60,61,29,15,30,62,63,64,65,66,67,68,69,70,11,13,71,72,73,74,75])),AwaitingExter
1186nalEthereumTransferScreen:()=>Le(()=>import("./AwaitingExternalEthereumTransferScreen-C9yfbYim-BhZL0CfL.js"),__vite__mapDeps([76,40,41,12,42,43,14,44,45,77,65,66,46,47,51,52,53,54,36,55,56,57,48,58,59,60,61,29,15,30,62,63,64,67,68,69,70,11,13,71,72,73,74,78,75])),AwaitingPasswordlessCodeScreen:()=>Le(()=>import("./AwaitingPasswordlessCodeScreen-DkpWm3cl-DJuHZstn.js"),__vite__mapDeps([79,80,81,41,31,21,11,12,13,14])),AwaitingSolToEvmBridgingScreen:()=>Le(()=>import("./AwaitingSolToEvmBridgingScreen-D-2h-r2V-Bnj7mqZD.js"),__vite__mapDeps([82,40,41,12,42,43,14,46,47,59,60,57,53,54,61,29,15,30,62,78])),CaptchaScreen:()=>Le(()=>import("./CaptchaScreen-DTWKq3oC-XQPti3Lg.js"),__vite__mapDeps([83,11,12,13,14,71,15,84])),CoinbaseOnrampStatusScreen:()=>Le(()=>import("./CoinbaseOnrampStatusScreen-yM8i1dq5-Bk0AN1ar.js"),__vite__mapDeps([85,86,87,12,41,46])),ConnectLedgerScreen:()=>Le(()=>import("./ConnectLedgerScreen-COys-OjJ-CVefpSIz.js"),__vite__mapDeps([88,11,12,13,14])),ConnectOnlyLandingScreen:()=>Le(()=>import("./ConnectOnlyLandingScreen-C3myVsvL-uJzwGfci.js"),__vite__mapDeps([89,27,12,28,29,15,30,31,32,33,34,35,36,37,38,17,13,14])),ConnectOnlyStatusScreen:()=>Le(()=>import("./ConnectOnlyStatusScreen-B-uqGIbz-D30TAtk3.js"),__vite__mapDeps([90,11,12,13,14,91,31,37,21])),ConnectOrCreateScreen:()=>Le(()=>import("./ConnectOrCreateScreen-DD7cB8dy-CZF-ruKI.js"),__vite__mapDeps([92,93,12,27,28,29,15,30,31,32,33,34,35,36,37,38,17,13,14,94,58,54,95,96,97,98,99,100,101,102,11,103])),ConnectionStatusScreen:()=>Le(()=>import("./ConnectionStatusScreen-gJeQDnkD-DLT6zRO0.js"),__vite__mapDeps([91,31,37,21,11,12,13,14])),CrossAppAuthScreen:()=>Le(()=>import("./CrossAppAuthScreen-DO1JO_KV-D8FLk5th.js"),__vite__mapDeps([104,21,11,12,13,14])),DelegatedActionsConsentScreen:()=>Le(()=>import("./DelegatedActionsConsentScreen-BCgARvf7-Cf5p3Azg.js"),__vite__mapDeps([105,106,12,36,107,61,29,15,30,63,11,13,14,108,71])),DelegatedActionsRevokeScreen:()=>Le(()=>import("./DelegatedActionsRevokeScreen-BcwL74R--DmMjgi6k.js"),__vite__mapDeps([109,11,12,13,14,108,15,71])),DepositAddressScreen:()=>Le(()=>import("./DepositAddressScreen-CDAmKcTm-Ch_05mVQ.js"),__vite__mapDeps([110,18,15,11,12,13,14,17,32,33,34,73,74,28,29,30,111,112,113])),EmbeddedWalletConnectingScreen:()=>Le(()=>import("./EmbeddedWalletConnectingScreen-CM-Kfv91-BELhZTH4.js"),__vite__mapDeps([114,11,12,13,14,84,15])),EmbeddedWalletCreatedScreen:()=>Le(()=>import("./EmbeddedWalletCreatedScreen-Zscvn5zZ-BNQ71jyT.js"),__vite__mapDeps([115,11,12,13,14,71,15])),EmbeddedWalletKeyExportScreen:()=>Le(()=>import("./EmbeddedWalletKeyExportScreen-CP5NN-uM-DkusIuOy.js"),__vite__mapDeps([116,117,118,106,12,36,107,61,29,15,30,63,11,13,14])),EmbeddedWalletOnAccountCreateScreen:()=>Le(()=>import("./EmbeddedWalletOnAccountCreateScreen-Cc3IEizD-DcGOgDN6.js"),__vite__mapDeps([119,11,12,13,14,84,15])),EmbeddedWalletPasswordCreateScreen:()=>Le(()=>import("./RecoveryPasswordCreateScreen-Dr_WQf6A-Cx14R_gt.js"),__vite__mapDeps([120,121,118,41,12,122,123,87,42])),EmbeddedWalletPasswordUpdateScreen:()=>Le(()=>import("./EmbeddedWalletPasswordUpdateScreen-vT10Bm2m-CSP05FYi.js"),__vite__mapDeps([124,121,118,41,12,122,123,87,42])),EmbeddedWalletPasswordUpdateSplashScreen:()=>Le(()=>import("./EmbeddedWalletPasswordUpdateSplashScreen-BuBFHC6o-B7kRO1tg.js"),__vite__mapDeps([125,11,12,13,14,25,15])),ErrorScreen:()=>Le(()=>import("./ErrorScreen-CudzJvQF-BmqfVLR5.js"),__vite__mapDeps([126,47,24,11,12,13,14,111,15,25])),FarcasterConnectStatusScreen:()=>Le(()=>import("./FarcasterConnectStatusScreen-AJge1G0j-C8JwauiJ.js"),__vite__mapDeps([127,128,32,33,34,12,107,21,11,13,14,96,29,15,30])),FarcasterSignerStatusScreen:()=>Le(()=>import("./FarcasterSignerStatusScreen-Cjd-9_IN-B4EvHSm2.js"),__vite__mapDeps([129,130,128,32,33,34,11,12,13,14,96])),FiatOnrampScreen:()=>Le(()=>
1186import("./FiatOnrampScreen-D-ijGLq9-i3427PbS.js"),__vite__mapDeps([131,132,11,12,13,14,113,15,117,118,98,58,54,28,29,30,133,134,19,84,102,103,70,25,74,135])),FundSolWalletWithExternalSolanaWallet:()=>Le(()=>import("./FundSolWalletWithExternalSolanaWallet-Bu7nN8uS-CKkYAHcX.js"),__vite__mapDeps([136,40,12,41,42,43,60,57,14,53,54,137,44,45,46,50,138,48])),FundWithBankDepositScreen:()=>Le(()=>import("./FundWithBankDepositScreen-CbY8cUX1-CgNeH_Cw.js"),__vite__mapDeps([139,28,29,15,30,11,12,13,14,133,132,113,112,84])),FundingAmountEditScreen:()=>Le(()=>import("./FundingEditAmountScreen-DTonST2j-COk5t_2M.js"),__vite__mapDeps([140,12,41,43,14,56,44,45,66,67,68,69,70,15,29,11,13,71,72])),FundingMethodSelectionScreen:()=>Le(()=>import("./FundingMethodSelectionScreen-CebSau1c-Cv-WlPdS.js"),__vite__mapDeps([141,86,12,43,142,143,133,134,38,144,145,46,67,68,69,70,15,29,11,13,14,71,72])),InAppBrowserLoginNotPossible:()=>Le(()=>import("./InAppBrowserLoginNotPossible-BsOHoSJE-CiXC_UR9.js"),__vite__mapDeps([146,11,12,13,14,22,15])),InstallWalletScreen:()=>Le(()=>import("./InstallWalletScreen-BTkuwBNN-CPC8YbKg.js"),__vite__mapDeps([147,31,69,70,15,29,11,12,13,14])),LandingScreen:()=>Le(()=>import("./LandingScreen-DA4XFqxS-BPuihP7q.js"),__vite__mapDeps([148,93,12,27,28,29,15,30,31,32,33,34,35,36,37,38,17,13,14,94,58,54,95,96,97,98,99,100,101,102,11,103])),LinkConflictScreen:()=>Le(()=>import("./LinkConflictScreen-CZztICqG-CcRmGkRL.js"),__vite__mapDeps([149,118,57,12,150,61,29,15,30,151,143])),LinkEmailScreen:()=>Le(()=>import("./LinkEmailScreen-DGPysBCv-DZNx7cug.js"),__vite__mapDeps([152,80,94,12,58,54,35,36,95,15,41,11,13,14])),LinkPasskeyScreen:()=>Le(()=>import("./LinkPasskeyScreen-CxW7ka3t-DzU8h7yB.js"),__vite__mapDeps([68,69,70,15,29,11,12,13,14,71,72])),LinkPhoneScreen:()=>Le(()=>import("./LinkPhoneScreen-CJcpCkxo-VcOPlYGr.js"),__vite__mapDeps([153,81,98,12,58,54,11,13,14])),LoginFailedScreen:()=>Le(()=>import("./LoginFailedScreen-Dze4SI3Y-CjeUZAHu.js"),__vite__mapDeps([154,11,12,13,14,84,15])),ManualTransferScreen:()=>Le(()=>import("./ManualTransferScreen-Drt1Mp6E-9bOpR5ds.js"),__vite__mapDeps([155,12,41,32,33,34,43,133,55,56,106,36,107,61,29,15,30,63,156,46,48,138,50,49,52])),MfaAuthEnrollmentFlowScreen:()=>Le(()=>import("./MfaAuthEnrollmentFlowScreen-5IWp37BG-RxAcpFQQ.js"),__vite__mapDeps([157,12,158,159,160,97,81,58,54,126,47,24,11,13,14,111,15,25,68,69,70,29,71,72,130,41,107,55,56,63,32,33,34])),MfaAuthVerifyFlowScreen:()=>Le(()=>import("./MfaAuthVerifyFlowScreen-W132fIHD-CXhBtQj9.js"),__vite__mapDeps([161,162,160,97,81,158,12,11,13,14,118,150,44,45,163,164,66,50,49,41,64])),MfaEnrollmentFlowScreen:()=>Le(()=>import("./MfaEnrollmentFlowScreen-B2ZcSeBE-H459ZcuG.js"),__vite__mapDeps([165,12,158,159,160,97,81,58,54,126,47,24,11,13,14,111,15,25,68,69,70,29,71,72,130,41,107,55,56,63,32,33,34,40,98])),MoonpayStatusScreen:()=>Le(()=>import("./MoonpayStatusScreen-Bey2zhxF-BcudI9Ts.js"),__vite__mapDeps([166,86,87,12,41,145,46])),OAuthStatusScreen:()=>Le(()=>import("./OAuthStatusScreen-D8EiVa2Y-bq_Cudyk.js"),__vite__mapDeps([167,99,62,100,21,11,12,13,14,151])),PasskeySelectSignupOrLogin:()=>Le(()=>import("./PasskeySelectSignupOrLogin-CwjunGne-5I6quehn.js"),__vite__mapDeps([168,11,12,13,14,72,15])),PasskeyStatusScreen:()=>Le(()=>import("./PasskeyStatusScreen-D0GgmiKb-C7m3KL3W.js"),__vite__mapDeps([169,21,11,12,13,14,72,15])),PasswordRecoveryScreen:()=>Le(()=>import("./PasswordRecoveryScreen-Q5SHSGfd-BM5QLDlz.js"),__vite__mapDeps([170,158,12,41,122,13,14])),RecoveryOAuthScreen:()=>Le(()=>import("./RecoveryOAuthStatusScreen-CGpbUHkL-BgkzlB0r.js"),__vite__mapDeps([171,12,42,172])),RecoverySelectionScreen:()=>Le(()=>import("./RecoverySelectionScreen-CagonGs_-DMZoTPZi.js"),__vite__mapDeps([173,174,12,42,172])),SendTransactionScreen:()=>Le(()=>import("./index-BKK46WdR-Ez5WWR3m.js"),__vite__mapDeps([175,61,12,29,15,30,44,45,156,144,65,66,126,47,24,11,13,14,111,25,176,177,53,54,36,107,55,56,106,63,123,142,143,117,118,64,41,42,163,164,50,49,77])),SetAutomaticRecoveryScreen:()=>Le(()=>import("./SetAutomaticRecoveryScreen-Dz6S1LST-CB0uVnl6.js"),__vite__mapDeps([178,118,174,12,55,56])),SignRequestScreen:()=>Le(()=>import("./SignRequestScreen-ipPnPIlP-XJkUZvbI.js"),__vite__mapDeps([179,130,41,176,11,12,13,14,15])),StandardSignAndSendTransactionScreen:()=>Le(()=>import("./StandardSignAndSendTransactionScreen-DPcArlC7-B7LzdnTq.js"),__vite__mapDeps([180,45,126,47,24,11,12,13,14,111,15,25,40,41,42,53,54,164,66,50,49,150,177,36,107,55,56,61,29,30,106,63,123,142,143,117,118,64,137])),TelegramAuthScreen:()=>Le(()=>import("./TelegramAuthScreen-Bb_tyqBP-BG8pVDIw.js"),__vite__mapDeps([181,21,11,12,13,14,100])),TransferFromWalletScreen:()=>Le(()=>import("./TransferFromWalletScreen-DTZSqDtC-G8Zw-JFw.js"),__vite__mapDeps([182,12,42,43,60,57,58,54,55,101,102,15,67,68,69,70,29,11,13,14,71,72])),UpdateEmailScreen:()=>Le(()=>import("./UpdateEmailScreen-LL6semse-DM_yVgy2.js"),__vite__mapDeps([183,80,41,12,35,36,11,13,14,95,15])),UpdatePhoneScreen:()=>Le(()=>import("./UpdatePhoneScreen-CS7n7kwA-C7RIt4Sk.js"),__vite__mapDeps([184,81,98,12,58,54,11,13,14])),UserLimitReachedScreen:()=>Le(()=>import("./UserLimitReachedScreen-Cq4YnJkA-DzGBvg6c.js"),__vite__mapDeps([185,11,12,13,14])),WalletInterstitialScreen:()=>Le(()=>import("./WalletInterstitialScreen-CZboB6Va-SkQ5yP9s.js"),__vite__mapDeps([186,11,12,13,14]))});function Fft(t){Z2("configureMfa",t)}const L6=Bo((()=>({inProgressMfaFlow:void 0}))),zft=()=>{let{ready:t}=Uo(),{currentScreen:e}=R2(),[n,r]=N.useState(null),[i,s]=N.useState(!1),a=(function(o){let[l,u]=N.useState(!1),f=N.useRef(null),p=N.useRef(null),y=N.useRef(null);return N.useEffect((()=>
1186{if(f.current&&(clearTimeout(f.current),f.current=null),p.current&&(clearTimeout(p.current),p.current=null),o)y.current=Date.now(),f.current=setTimeout((()=>{u(!0)}),150);else if(y.current!==null){let g=Date.now()-y.current;if(g>=150){let b=Math.max(0,400-(g-150));p.current=setTimeout((()=>{u(!1),y.current=null}),b)}else f.current&&(clearTimeout(f.current),f.current=null),u(!1),y.current=null}return()=>{f.current&&clearTimeout(f.current),p.current&&clearTimeout(p.current)}}),[o]),l})(i);return N.useEffect((()=>{if(!e)return r(null),void s(!1);s(!0),V9[e]().then((o=>{(!e||t||o.default.isShownBeforeReady)&&(r((()=>o.default.component)),s(!1))})).catch((()=>{r(null),s(!1)}))}),[e,t]),{component:n,isLoading:a}};let SG=N.lazy((()=>Le(()=>import("./MfaVerifyFlowScreen-CzNn41ji-BPdGCxpE.js"),__vite__mapDeps([187,162,160,97,81,158,12,11,13,14,118,150,44,45,163,164,66,50,49,41,64])))),Vft=N.lazy((()=>(t=>V9[t]().then((e=>({default:e.default.component}))))("MfaAuthVerifyFlowScreen"))),Hft=()=>h.jsx(Kft,{children:h.jsx(M9,{})}),xue=()=>{let{currentScreen:t}=R2(),e=L6((s=>s.inProgressMfaFlow)),n=()=>L6.setState({inProgressMfaFlow:void 0}),{component:r,isLoading:i}=zft();return(function(){let{isModalOpen:s}=Uo(),{headless:a}=Ts(),{currentScreen:o}=R2(),{status:l,execute:u,reset:f,enabled:p}=_ue(),[y,g]=N.useState(!1);N.useEffect((()=>{!s&&p&&f()}),[s,p,f]),N.useEffect((()=>{o?V9[o]().then((b=>{g(!!b.default.isCaptchaRequired)})).catch((()=>{g(!1)})):g(!1)}),[o]),N.useEffect((()=>{s&&y&&!a&&l==="ready"&&p&&u()}),[s,y,a,l,p,u])})(),t||e!=="txn"?i?h.jsx(Hft,{}):r?h.jsxs(h.Fragment,{children:[h.jsx(Ile,{$if:!!e,children:h.jsx(N.Suspense,{children:h.jsx(r,{})})}),h.jsxs(N.Suspense,{children:[e==="txn"&&h.jsx(SG,{onClose:n}),e==="auth"&&h.jsx(Vft,{})]})]}):null:h.jsx(N.Suspense,{children:h.jsx(SG,{onClose:n})})},Wft=()=>{let t=N.useRef(null);return h.jsx(Zft,{style:{height:Lst(t)},id:"privy-modal-content",children:h.jsx("div",{ref:t,children:h.jsx(xue,{})})})};const qft=({open:t})=>{let e=Ts(),{gracefulClosePrivyModal:n}=(()=>{let{closePrivyModal:i}=Br(),{onUserCloseViaDialogOrKeybindRef:s}=R2();return{gracefulClosePrivyModal:N.useCallback((()=>{if(!(s!=null&&s.current))return i({shouldCallAuthOnSuccess:!1});s.current()}),[i,s])}})(),r=L6((i=>i.inProgressMfaFlow));return Fft({onMfaRequired:()=>{e.mfa.noPromptOnMfaRequired||L6.setState({inProgressMfaFlow:"txn"})}}),e.render.standalone?h.jsx(kK,{children:h.jsx(Cue,{id:"privy-modal-content",children:h.jsx(xue,{})})}):h.jsx(Vot,{open:!(!t&&!r),id:"privy-dialog","aria-label":"log in or sign up","aria-labelledby":"privy-dialog-title",onClick:()=>n(),children:h.jsx(kK,{children:h.jsx(Wft,{})})})};let Cue=mr.div` 1187 display: flex; 1188 flex-direction: column; 1189 text-align: center; 1190 font-size: 14px; 1191 line-height: 20px; 1192 width: 100%; 1193 background: var(--privy-color-background); 1194 padding: 0 16px; 1195`,Zft=mr(Cue)` 1196 transition: height 150ms ease-out; 1197 overflow: hidden auto; 1198 scrollbar-width: none; 1199 1200 /* Ensure the modal gets pinned to the top if it ever gets too tall */ 1201 max-height: calc(100svh - 32px); 1202 1203 border-radius: var(--privy-border-radius-lg) var(--privy-border-radius-lg) 0 0; 1204 box-shadow: 0 0 36px rgb(55 65 81 / 15%); 1205 1206 @media (min-width: 441px) { 1207 box-shadow: 0 8px 36px rgb(55 65 81 / 15%); 1208 border-radius: var(--privy-border-radius-lg); 1209 } 1210`,Kft=mr.div` 1211 display: flex; 1212 align-items: center; 1213 justify-content: center; 1214 min-height: 300px; 1215 padding: 2rem; 1216`;function Gft(t){let e=N.useRef(null),n=N.useRef(null);return N.useEffect((()=>{var r,i;(r=n.current)==null||r.remove(),n.current=(function({botUsername:s,scriptHost:a}){let o=document.createElement("script"),{origin:l}=new URL(a);return o.async=!0,o.src=`${l}/js/telegram-login.js`,o.setAttribute("data-telegram-login",s),o.setAttribute("data-request-access","write"),o.setAttribute("data-lang","en"),o})(t),(i=e.current)==null||i.after(n.current)}),[t]),h.jsx("div",{ref:e,hidden:!0})}const Yft=()=>{let{ready:t,wallets:e}=Est();return N.useEffect((()=>{if(!t)return;let n=e.map((r=>({address:r.address,connectorType:r.connectorType,walletClientType:r.walletClientType,connectedAt:r.connectedAt,id:r.meta.id})));vt.put(cre,n)}),[t,e]),null},Jft=(t,e,n)=>{let{promise:r,reject:i}=hce(),s=setTimeout((()=>i(Error(`Timed out after ${e}ms`))),e);return n&&n.addEventListener("abort",(()=>clearTimeout(s)),{once:!0}),Promise.race([t,r]).finally((()=>clearTimeout(s)))}
1216,Xft=["error","invalid_request_arguments","wallet_not_on_device","invalid_recovery_pin","insufficient_funds","missing_or_invalid_mfa","mfa_verification_max_attempts_reached","mfa_timeout","twilio_verification_failed"];class Ur extends Error{constructor(e,n){super(n),this.type=e}}function _m(t){let e=t.type;return typeof e=="string"&&Xft.includes(e)}function Kv(t){return _m(t)&&t.type==="wallet_not_on_device"}function A4t(t){return _m(t)&&(t.type==="invalid_recovery_pin"||t.type==="invalid_request_arguments")}function k4t(t){return!!_m(t)&&t.type==="mfa_timeout"}function T4t(t){return!!_m(t)&&t.type==="missing_or_invalid_mfa"}function L4t(t){return!!_m(t)&&t.type==="mfa_verification_max_attempts_reached"}function $4t(t){return!(!_m(t)||!t.message.includes("code 429"))}function I4t(t){return!!(function(e){let n=e.type;return typeof n=="string"&&n==="client_error"})(t)&&t.message==="MFA canceled"}async function ka(t,e,n,r,i,s=!1){var u,f,p;let a=s,o=async y=>{var g;if(a&&e&&e.length>0){y===(s?0:1)?i("configureMfa","onMfaRequired",{mfaMethods:e}):(g=r.current)==null||g.reject(new Ur("missing_or_invalid_mfa","MFA verification failed, retry."));let b=await new Promise(((v,_)=>{n.current={resolve:v,reject:_},setTimeout((()=>{var S;let C=new Ur("mfa_timeout","Timed out waiting for MFA code");(S=r.current)==null||S.reject(C),_(C)}),3e5)}));return await t(b)}return await t()},l=null;for(let y=0;y<4;y++)try{l=await o(y),(u=r.current)==null||u.resolve(void 0);break}catch(g){if(g.type!=="missing_or_invalid_mfa")throw(f=r.current)==null||f.resolve(void 0),g;a=!0}if(l===null){let y=new Ur("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw(p=r.current)==null||p.reject(y),y}return l}var AG;let Qft=(AG=0,()=>"id-"+AG++);function Ai(t){return t.error!==void 0}let di=new class{enqueue(t,e){this.callbacks[t]=e}dequeue(t,e){let n=this.callbacks[e];if(!n)throw Error(`cannot dequeue ${t} event: no event found for id ${e}`);switch(delete this.callbacks[e],t){case"privy:iframe:ready":case"privy:user-signer:sign":case"privy:wallets:add":case"privy:wallets:import":case"privy:wallets:set-recovery":case"privy:wallets:connect":case"privy:wallets:recover":case"privy:wallets:rpc":case"privy:wallet:create":case"privy:mfa:verify":case"privy:mfa:init-enrollment":case"privy:mfa:submit-enrollment":case"privy:mfa:unenroll":case"privy:mfa:clear":case"privy:auth:unlink-passkey":case"privy:farcaster:init-signer":case"privy:farcaster:sign":case"privy:solana-wallet:create":case"privy:delegated-actions:consent":return n;default:throw Error(`invalid wallet event type ${t}`)}}constructor(){this.callbacks={}}},LA=new Map,ept=(t,e)=>typeof e=="bigint"?e.toString():e;function ki(t,e,n,r){let i=n.contentWindow;if(!i)throw Error("iframe not initialized");let s=((o,l)=>`${o}${JSON.stringify(l,ept)}`)(t,e);if(t==="privy:wallet:create"||t==="privy:wallets:add"||t==="privy:solana-wallet:create"){let o=LA.get(s);if(o)return o}let a=new Promise(((o,l)=>{let u=Qft();di.enqueue(u,{resolve:o,reject:l}),i.postMessage({id:u,event:t,data:e},r)})).finally((()=>{LA.delete(s)}));return LA.set(s,a),a}function tpt(t){let e=hre(),n=N.useRef(null),r=N.useRef(t.mfaMethods),i=tp(),[s,a]=N.useState(!1);return r.current=t.mfaMethods,N.useEffect((()=>{if(!s)return;let o=n.current;if(!o)return;function l(p){var y;p&&p.origin===t.origin&&typeof(y=p.data).event=="string"&&/^privy:.+/.test(y.event)&&(function(g){switch(g.event){case"privy:iframe:ready":let b=di.dequeue(g.event,g.id);return Ai(g)?b.reject(new Ur(g.error.type,g.error.message)):b.resolve(g.data);case"privy:user-signer:sign":{let x=di.dequeue(g.event,g.id);return Ai(g)?x.reject(new Ur(g.error.type,g.error.message)):x.resolve(g.data)}case"privy:wallets:add":{let x=di.dequeue(g.event,g.id);return Ai(g)?x.reject(new Ur(g.error.type,g.error.message)):x.resolve(g.data)}case"privy:wallets:set-recovery":{let x=di.dequeue(g.event,g.id);return Ai(g)?x.reject(new Ur(g.error.type,g.error.message)):x.resolve(g.data)}case"privy:wallets:connect":{let x=di.dequeue(g.event,g.id);return Ai(g)?x.reject(new Ur(g.error.type,g.error.message)):x.resolve(g.data)}case"privy:wallets:recover":{let x=di.dequeue(g.event,g.id);
1216return Ai(g)?x.reject(new Ur(g.error.type,g.error.message)):x.resolve(g.data)}case"privy:wallets:rpc":{let x=di.dequeue(g.event,g.id);return Ai(g)?x.reject(new Ur(g.error.type,g.error.message)):x.resolve(g.data)}case"privy:wallet:create":let v=di.dequeue(g.event,g.id);return Ai(g)?v.reject(new Ur(g.error.type,g.error.message)):v.resolve(g.data);case"privy:wallets:import":let _=di.dequeue(g.event,g.id);return Ai(g)?_.reject(new Ur(g.error.type,g.error.message)):_.resolve(g.data);case"privy:mfa:verify":let C=di.dequeue(g.event,g.id);return Ai(g)?C.reject(new Ur(g.error.type,g.error.message)):C.resolve(g.data);case"privy:mfa:init-enrollment":{let x=di.dequeue(g.event,g.id);return Ai(g)?x.reject(new Ur(g.error.type,g.error.message)):x.resolve(g.data)}case"privy:mfa:submit-enrollment":{let x=di.dequeue(g.event,g.id);return Ai(g)?x.reject(new Ur(g.error.type,g.error.message)):x.resolve(g.data)}case"privy:mfa:unenroll":{let x=di.dequeue(g.event,g.id);return Ai(g)?x.reject(new Ur(g.error.type,g.error.message)):x.resolve(g.data)}case"privy:mfa:clear":{let x=di.dequeue(g.event,g.id);return Ai(g)?x.reject(new Ur(g.error.type,g.error.message)):x.resolve(g.data)}case"privy:auth:unlink-passkey":{let x=di.dequeue(g.event,g.id);return Ai(g)?x.reject(new Ur(g.error.type,g.error.message)):x.resolve(g.data)}case"privy:solana-wallet:create":let S=di.dequeue(g.event,g.id);return Ai(g)?S.reject(new Ur(g.error.type,g.error.message)):S.resolve(g.data);case"privy:farcaster:init-signer":{let x=di.dequeue(g.event,g.id);return Ai(g)?x.reject(new Ur(g.error.type,g.error.message)):x.resolve(g.data)}case"privy:farcaster:sign":{let x=di.dequeue(g.event,g.id);return Ai(g)?x.reject(new Ur(g.error.type,g.error.message)):x.resolve(g.data)}case"privy:delegated-actions:consent":{let x=di.dequeue(g.event,g.id);return Ai(g)?x.reject(new Ur(g.error.type,g.error.message)):x.resolve(g.data)}default:console.warn("Unsupported wallet proxy method:",g)}})(p.data)}let u={signWithUserSigner:p=>ka((y=>ki("privy:user-signer:sign",{...p,...y},o,t.origin)),r.current,t.mfaPromise,t.mfaSubmitPromise,i),addWallet:p=>ka((y=>ki("privy:wallets:add",{...p,...y},o,t.origin)),r.current,t.mfaPromise,t.mfaSubmitPromise,i),setRecovery:p=>ka((y=>ki("privy:wallets:set-recovery",{...p,...y},o,t.origin)),r.current,t.mfaPromise,t.mfaSubmitPromise,i),connect:p=>ka((y=>ki("privy:wallets:connect",{...p,...y},o,t.origin)),r.current,t.mfaPromise,t.mfaSubmitPromise,i),recover:p=>ka((y=>ki("privy:wallets:recover",{...p,...y},o,t.origin)),r.current,t.mfaPromise,t.mfaSubmitPromise,i,!p.recoveryAccessToken&&!p.recoveryPassword&&!p.recoverySecretOverride),rpc:p=>ka((y=>ki("privy:wallets:rpc",{...p,...y},o,t.origin)),r.current,t.mfaPromise,t.mfaSubmitPromise,i),create:p=>ki("privy:wallet:create",p,o,t.origin),importWallet:p=>ki("privy:wallets:import",p,o,t.origin),createSolana:p=>ka((y=>ki("privy:solana-wallet:create",{...p,...y},o,t.origin)),r.current,t.mfaPromise,t.mfaSubmitPromise,i),createDelegatedAction:p=>ka((y=>ki("privy:delegated-actions:consent",{...p,...y},o,t.origin)),r.current,t.mfaPromise,t.mfaSubmitPromise,i),verifyMfa:p=>ka((y=>ki("privy:mfa:verify",{...p,...y},o,t.origin)),r.current,t.mfaPromise,t.mfaSubmitPromise,i,!0),initEnrollMfa:p=>ka((y=>ki("privy:mfa:init-enrollment",{...p,...y},o,t.origin)),r.current,t.mfaPromise,t.mfaSubmitPromise,i),submitEnrollMfa:p=>ka((y=>ki("privy:mfa:submit-enrollment",{...p,...y},o,t.origin)),r.current,t.mfaPromise,t.mfaSubmitPromise,i),unenrollMfa:p=>ka((y=>ki("privy:mfa:unenroll",{...p,...y},o,t.origin)),r.current,t.mfaPromise,t.mfaSubmitPromise,i),clearMfa:p=>Jft(ki("privy:mfa:clear",p,o,t.origin),15e3).catch((y=>{throw y instanceof Error&&y.message.includes("Timed out")?new Ur("mfa_timeout","MFA operation timed out"):y})),unlinkPasskeyAccount:p=>ka((y=>ki("privy:auth:unlink-passkey",{...p,...y},o,t.origin)),r.current,t.mfaPromise,t.mfaSubmitPromise,i),initFarcasterSigner:p=>ki("privy:farcaster:init-signer",p,o,t.origin),signFarcasterMessage:p=>ki("privy:farcaster:sign",p,o,t.origin)};window.addEventListener("message",l);let f=new AbortController;return YT((()=>ki("privy:iframe:ready",{}
1216,o,t.origin)),{abortSignal:f.signal}).then((()=>t.onLoad(u)),((...p)=>{console.warn("Privy iframe failed to load: ",...p),t.onLoadFailed()})),()=>{window.removeEventListener("message",l),f.abort()}}),[s]),e?h.jsx("iframe",{ref:n,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},onLoad:()=>a(!0),src:Jot({origin:t.origin,path:`/apps/${t.appId}/embedded-wallets`,query:{caid:t.clientAnalyticsId,client_id:t.appClientId}})}):null}const npt=({address:t,user:e})=>{let n=e.linkedAccounts.find((r=>r.type==="wallet"&&r.walletClientType==="privy"&&r.address===t));if(!n)throw new ue("Address to delegate is not associated with current user.");if(!T9(n))throw new ue(`useDelegatedActions is not supported for ${n.chainType} wallets. Use the useSessionSigners hook to provision server side access on behalf of your users.`);return{address:n.address,chainType:n.chainType,walletIndex:n.walletIndex??0}},rpt=({address:t,user:e})=>{let n=e.linkedAccounts.find((i=>i.type==="wallet"&&i.walletClientType==="privy"&&i.address===t));if(!n)throw new ue("Address to delegate is not associated with current user.");let r=n.imported?n:l6(e);if(!r)throw new ue("Unable to determine root address for delegated address.");if(!T9(r))throw new ue(`useDelegatedActions is not supported for ${r.chainType} wallets. Use the useSessionSigners hook to provision server side access on behalf of your users.`);return{address:r.address,chainType:r.chainType,imported:r.imported}},kG=t=>t.linkedAccounts.filter((e=>e.type==="wallet"&&e.walletClientType==="privy"&&e.delegated)),TG="popup-privy-oauth",LG="PRIVY_OAUTH_USE_BROADCAST_CHANNEL";function ipt({isCreatingWallet:t,skipSplashScreen:e}){return t?"EmbeddedWalletPasswordCreateScreen":e?"EmbeddedWalletPasswordUpdateScreen":"EmbeddedWalletPasswordUpdateSplashScreen"}function spt({walletAction:t,availableRecoveryMethods:e,legacySetWalletPasswordFlow:n,isResettingPassword:r,showAutomaticRecovery:i}){return i?"SetAutomaticRecoveryScreen":n||e.length===1?ipt({isCreatingWallet:t==="create",skipSplashScreen:r}):"RecoverySelectionScreen"}function apt(t){switch(t){case"user-passcode":return"PasswordRecoveryScreen";case"google-drive":case"icloud":return"RecoveryOAuthScreen";default:throw Error("Recovery method not supported")}}let opt=["warpcast.com","farcaster.xyz"],lpt=["farcaster","fid"];async function cpt(){if(globalThis.window!==void 0&&(function(){if(globalThis.window===void 0)return!1;try{if(globalThis.document===void 0)return!1;let t=globalThis.window,e=globalThis.document,n=!1;if(e.referrer){let a=e.referrer.toLowerCase();n=opt.some((o=>a.includes(o)))}let r=!!t.farcaster,i=new URLSearchParams(t.location.search),s=lpt.some((a=>i.has(a)));return n||r||s}catch{return!1}})())try{await Le(()=>import("./react-auth-FmFgRqLi.js"),[]),console.debug("[Privy] Farcaster Solana wallet registered")}catch(t){console.debug("[Privy] Farcaster Solana wallet not available (package may not be installed)"),(function(){try{return typeof process<"u"&&!1}catch{return!1}})()&&t&&console.debug("[Privy] Farcaster Solana init error:",t)}}function $G(t,e){if(t.onComplete)switch(e){case"external":t.fundingResult?t.onComplete({...t.fundingResult,fundingMethod:e}):t.onComplete({status:"cancelled",address:t.address,fundingMethod:e,amount:t.amount});break;case null:t.onComplete({status:"cancelled",address:t.address,fundingMethod:void 0,amount:t.amount});break;default:t.onComplete({status:"completed",address:t.address,fundingMethod:e,amount:t.amount})}}function N4t(t,e,n,r,i,s,a){return{...t,funding:t!=null&&t.funding?{...t.funding,fundingResult:{status:e,address:t.funding.address,fundingMethod:void 0,transactionHash:n,amount:t.funding.amount,assetType:i?(s==null?void 0:s.symbol)||"ETH":a.nativeCurrency.symbol||"ETH",metadata:{walletClientType:r}}}:void 0,solanaFundingData:t==null?void 0:t.solanaFundingData,sendTransaction:t==null?void 0:t.sendTransaction}}const $A=new Map([["FundingMethodSelectionScreen",null],["TransferFromWalletScreen","external"],["FundingAmountEditScreen","external"],["ConnectOnlyLandingScreen","external"],["ConnectOnlyStatusScreen","external"],["AwaitingExter
1216nalEthereumTransferScreen","external"],["AwaitingEvmToSolBridgingScreen","external"],["AwaitingSolToEvmBridgingScreen","external"],["ManualTransferScreen","manual"],["MoonpayStatusScreen","moonpay"],["CoinbaseOnrampStatusScreen","coinbase-onramp"]]);function IG(t){var n,r;let e=t.toLowerCase();return!!((r=(n=window==null?void 0:window.webkit)==null?void 0:n.messageHandlers)!=null&&r.ReactNativeWebView)||!!(window!=null&&window.ReactNativeWebView)||["fbav","fban","instagram","snapchat","linkedinapp"].some((i=>e.includes(i)))}async function upt({rpc:t,address:e}){return(await t.getBalance(e,{commitment:"confirmed"}).send()).value??0n}function dpt(){var t,e;return((e=(t=(function(){if(typeof window<"u")return window.Telegram})())==null?void 0:t.WebApp)==null?void 0:e.initData)||void 0}let hpt={apple_oauth:"apple",custom_auth:"custom",discord_oauth:"discord",email:"email",farcaster:"farcaster",github_oauth:"github",google_oauth:"google",instagram_oauth:"instagram",linkedin_oauth:"linkedin",passkey:"passkey",phone:"sms",spotify_oauth:"spotify",telegram:"telegram",tiktok_oauth:"tiktok",line_oauth:"line",twitch_oauth:"twitch",twitter_oauth:"twitter",wallet:"siwe",smart_wallet:"siwe",cross_app:"privy:"};const fpt=t=>{if(lO(t))return{displayName:t.replace("custom:",""),loginMethod:"custom"};let e=hpt[t];return t==="wallet"||t==="phone"?{displayName:t,loginMethod:e}:{displayName:e,loginMethod:e}},ppt=()=>{let t=Ts(),{user:e}=Uo(),{client:n,refreshSessionAndUser:r,walletProxy:i}=Br();return{migrate:N.useCallback((async()=>{if(t.embeddedWallets.mode==="legacy-embedded-wallets-only")return{success:!0,migrated:!1};if(!e)throw new ue("User must be authenticated before migrating wallets",Oe.MUST_BE_AUTHENTICATED);if(!i)throw new ue("Cannot connect to wallet proxy");let s=await n.getAccessToken();if(!s)throw new ue("User must be authenticated before migrating wallets",Oe.MUST_BE_AUTHENTICATED);let a=e.linkedAccounts.filter((u=>u.type==="wallet"&&u.walletClientType==="privy"&&T9(u)&&!Da(u)));if(a.length===0)return{success:!0,migrated:!1};let o=a.filter((u=>u.imported)),l=a.filter((u=>!u.imported));if(l.length>0){let u=l.find((y=>y.chainType==="ethereum"&&y.walletIndex===0))??l.find((y=>y.chainType==="solana"&&y.walletIndex===0))??null;if(!u)throw new ue("Primary wallet not found");let{entropyId:f,entropyIdVerifier:p}=Tv(u);try{await i.connect({accessToken:s,entropyId:f,entropyIdVerifier:p})}catch(y){if(!Kv(y)||u.recoveryMethod!=="privy")throw y;await i.recover({accessToken:s,entropyId:f,entropyIdVerifier:p})}await i.createDelegatedAction({accessToken:s,rootWallet:{address:u.address,chainType:u.chainType,imported:!1},delegatedWallets:l.map((y=>({address:y.address,chainType:y.chainType,walletIndex:y.walletIndex??0})))})}for(let u of o){let{entropyId:f,entropyIdVerifier:p}=Tv(u);try{await i.connect({accessToken:s,entropyId:f,entropyIdVerifier:p})}catch(y){if(!Kv(y)||u.recoveryMethod!=="privy")throw y;await i.recover({accessToken:s,entropyId:f,entropyIdVerifier:p})}await i.createDelegatedAction({accessToken:s,rootWallet:{address:u.address,chainType:u.chainType,imported:!0},delegatedWallets:[{address:u.address,chainType:u.chainType,walletIndex:u.walletIndex??0}]})}return await r(),{success:!0,migrated:!0}}),[t.embeddedWallets.mode,e,i,n,r])}},mpt=({disabled:t})=>{let{migrate:e}=ppt(),{user:n}=Uo(),{walletProxy:r}=Br(),i=N.useRef(!1),s=N.useRef(0);return N.useEffect((()=>{t||s.current>2||i.current||!n||!r||(i.current=!0,s.current++,e().catch((a=>{console.debug("Unable to migrate wallets: ",a)})).finally((()=>{i.current=!1})))}),[n,r,t,e]),null},ypt=t=>({id:t.id,raw_id:t.rawId,response:{client_data_json:t.response.clientDataJSON,authenticator_data:t.response.authenticatorData,signature:t.response.signature,user_handle:t.response.userHandle},authenticator_attachment:t.authenticatorAttachment,client_extension_results:{app_id:t.clientExtensionResults.appid,cred_props:t.clientExtensionResults.credProps,hmac_create_secret:t.clientExtensionResults.hmacCreateSecret},type:t.type}),tg=()=>{let{ethereumEmbedded:t,ethereumExternal:e}=C2.getState();return[...t,...e]},gpt=(t,e,n)=>
1216!(v2(t)||cO(t).length>0||n===!1||e!=="all-users"&&(e!=="users-without-wallets"||bpt(t).length));let bpt=t=>t.linkedAccounts.filter((e=>e.type==="wallet"&&e.chainType==="ethereum"));const wpt=(t,e,n)=>!(G8(t)||sre(t).length>0||n===!1||e!=="all-users"&&(e!=="users-without-wallets"||vpt(t).length));let vpt=t=>t.linkedAccounts.filter((e=>e.type==="wallet"&&e.chainType==="solana"));const _pt=Symbol("wallet-creation-on-login-plugin"),xpt=()=>{let{walletProxy:t,recoverEmbeddedWallet:e,setUser:n,refreshSessionAndUser:r,privy:i,client:s}=Br(),a=Ts();return{create:async({walletIndex:o,chainType:l,latestUser:u,recoveryMethod:f,recoveryPassword:p,recoveryAccessToken:y,idempotencyKey:g})=>{let b=u;b||(b=await r());let v=await s.getAccessToken();if(!b||!v||!t)throw Error("User must be authenticated before creating a Privy wallet");return await mce({appConfig:a,user:b,refreshSessionAndUser:r,privy:i,accessToken:v,proxy:t,recoverEmbeddedWallet:e,setUser:n,walletIndex:o,chainType:l,recoveryMethod:f,recoveryPassword:p,recoveryAccessToken:y,idempotencyKey:g})}}};function Cpt({subscribe:t,getExternalJwt:e,enabled:n=!0,onAuthenticated:r,onUnauthenticated:i,onError:s}){let{client:a,setAuthenticated:o,setUser:l,setIsNewUser:u}=Br(),{logout:f,authenticated:p,ready:y}=vlt(),g=xrt(),{create:b}=xpt(),v=Ts();if(!a)throw new ue("`useSyncJwtBasedAuthState` must be used within a `PrivyProvider`");let[_,C]=N.useState({status:"initial"}),S=N.useRef(void 0),x=N.useRef(!1),A=N.useRef(e);N.useEffect((()=>{A.current=e}),[e]);let I=N.useRef(r);N.useEffect((()=>{I.current=r}),[r]);let $=N.useRef(i);N.useEffect((()=>{$.current=i}),[i]);let O=N.useRef(s);N.useEffect((()=>{O.current=s}),[s]);let P=N.useRef(b);N.useEffect((()=>{P.current=b}),[b]);let j=N.useRef(v.embeddedWallets.ethereum.createOnLogin);N.useEffect((()=>{j.current=v.embeddedWallets.ethereum.createOnLogin}),[v.embeddedWallets.ethereum.createOnLogin]);let U=N.useRef(v.embeddedWallets.solana.createOnLogin);N.useEffect((()=>{U.current=v.embeddedWallets.solana.createOnLogin}),[v.embeddedWallets.solana.createOnLogin]);let z=N.useRef(l);N.useEffect((()=>{z.current=l}),[l]);let D=N.useRef(u);N.useEffect((()=>{D.current=u}),[u]);let R=N.useRef(o);return N.useEffect((()=>{R.current=o}),[o]),N.useEffect((()=>{if(!n||!y)return;let W=async()=>{var T,L,M,Z,H;if(!x.current){x.current=!0;try{C({status:"loading"});let V=await A.current();if(S.current!==void 0&&S.current===V)return void C({status:"done"});if(!V)return p&&(await f(),(T=$.current)==null||T.call($)),S.current=V,void C({status:"done"});a.startAuthFlow(new Goe(V));let{user:F,isNewUser:q=!1}=await a.authenticate();if(!F)throw new ue("Failed to sync with custom auth provider");(L=I.current)==null||L.call(I,{user:F,isNewUser:q}),z.current(F),D.current(q),R.current(!0);let G=(M=g(_pt))==null?void 0:M.shouldCreateWallet({user:F}),Y=gpt(F,j.current,G),X=wpt(F,U.current,G);if(Y&&X){let te=await P.current({chainType:"ethereum",walletIndex:0,latestUser:F});await P.current({chainType:"solana",walletIndex:0,latestUser:te.user})}else X?await P.current({chainType:"solana",walletIndex:0,latestUser:F}):Y&&await P.current({chainType:"ethereum",walletIndex:0,latestUser:F});S.current=V,C({status:"done"})}catch(V){if(console.warn(V),await f().catch((()=>{})),(Z=$.current)==null||Z.call($),V instanceof ev&&V.privyErrorCode===Oe.LINKED_TO_ANOTHER_USER)return C({status:"initial"}),void setTimeout((()=>{W()}),0);(H=O.current)==null||H.call(O,V),C({status:"error",error:V})}finally{x.current=!1}}};return W(),t(W)}),[t,a,p,f,n,y,g]),n?{state:_}:{state:{status:"not-enabled"}}}let Ept=Bo((()=>({jwtAuthFlowState:{status:"not-enabled"}})));function Spt({customAuth:t}){let{jwtAuthFlowState:e}=(function({customAuth:n}){let r=tp(),i=N.useRef(void 0),s=N.useCallback((l=>(i.current=l,()=>{i.current=void 0})),[]),a=(n==null?void 0:n.getCustomAccessToken)??(()=>Promise.resolve(void 0)),{state:o}=Cpt({enabled:(n==null?void 0:n.enabled)===!0,subscribe:s,getExternalJwt:a,onAuthenticated:({user:l,isNewUser:u})=>{r("login","onComplete",{user:l,isNewUser:u,wasAlreadyAuthenticated:!1,loginMethod:"custom",loginAccount:null}),r("customAuth","onAuthenticated",{user:l})},onUnauthenticated:()=>{r("customAuth","onUnauthenticated")},onError:l=>{r("login","onError",l.privyErrorCode||Oe.UNKNOWN_AUTH_ERROR)}});return N.useEffect((()=>{(async()=>{var l;n&&!n.isLoading&&((l=i.current)==null||l.call(i))})()}),[n==null?void 0:n.enabled,n==null?void 0:n.getCustomAccessToken,n==null?void 0:n.isLoading]),{jwtAuthFlowState:o}})({customAuth:t});return N.useEffect((()=>{Ept.setState({jwtAuthFlowState:e})}),[e]),null}const Apt=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4","csw_signUserOperation","secp256k1_sign"];
1216class Ui extends Error{constructor(e,n,r){super(e),this.code=n,this.data=r}}class kpt extends qf{async handleSendTransaction(e){if(!e.params||!Array.isArray(e.params))throw new Ui(`Invalid params for ${e.method}`,4200);let n=e.params[0];if(Gh(n))throw new Ui("Tempo (type 118) transactions are not supported via the EIP-1193 provider. Use useSendTransaction from @privy-io/react-auth/tempo instead.",4200);if(!await Xr()||!this.address)throw new Ui("Disconnected",4900);let r={...n,chainId:n.chainId??P4(this.chainId)},{hash:i}=await jpt(r,{address:this.address});return i}async handleSignTransaction(e){if(!e.params||!Array.isArray(e.params))throw new Ui(`Invalid params for ${e.method}`,4200);let n=e.params[0];if(Qrt(n))return this.handleSignTempoTransaction(n);if(!await Xr()||!this.address)throw new Ui("Disconnected",4900);let r={...n,chainId:n.chainId??P4(this.chainId)},{signature:i}=await Rpt(r,{address:this.address});return i}async handleSignTempoTransaction(e){let n,r=await Xr();if(!r||!this.address)throw new Ui("Disconnected",4900);let i=this.walletAccount;if(!i||!Da(i))throw new Ui("Tempo (type 118) transactions are only supported on Unified embedded wallets",4200);let s=this.privyClient;if(!s)throw new Ui("Disconnected",4900);try{n=jne(eit(e))}catch(o){throw new Ui(o instanceof Error?o.message:"Invalid Tempo transaction",4200)}let a=await xo(s,(async({message:o})=>this.walletProxy.signWithUserSigner({accessToken:r,message:o})),{chain_type:"ethereum",method:"eth_signTransaction",wallet_id:i.id,params:{transaction:n}});if(a.method!=="eth_signTransaction"||!("signed_transaction"in a.data))throw new Ui("Unable to sign transaction",4200);return a.data.signed_transaction}handleSwitchEthereumChain(e){let n;if(!e.params||!Array.isArray(e.params))throw new Ui(`Invalid params for ${e.method}`,4200);if(typeof e.params[0]=="string")n=e.params[0];else{if(!("chainId"in e.params[0])||typeof e.params[0].chainId!="string")throw new Ui(`Invalid params for ${e.method}`,4200);n=e.params[0].chainId}this.chainId=Number(n),this.publicClient=tv(this.chainId,this.chains,this.rpcConfig,{appId:this.appId}),this.emit("chainChanged",n)}async handlePersonalSign(e){if(!e.params||!Array.isArray(e.params))throw Error("Invalid params for personal_sign");let n=e.params[0],r=e.params[1],{signature:i}=await Opt({message:n},{address:r});return i}async handleSignedTypedData(e){if(!e.params||!Array.isArray(e.params))throw Error("Invalid params for eth_signTypedData_v4");let n=e.params[0],r=typeof e.params[1]=="string"?JSON.parse(e.params[1]):e.params[1],i=e.params[2],{signature:s}=await Ppt(rv(r),{address:n,signatureOptions:i==null?void 0:i.signatureOptions,caip2:i==null?void 0:i.caip2});return s}async handleEstimateGas(e){if(!e.params||!Array.isArray(e.params))throw Error("Invalid params for eth_estimateGas");if(delete e.params[0].gasPrice,delete e.params[0].maxFeePerGas,delete e.params[0].maxPriorityFeePerGas,Gh(e.params[0]))throw new Ui("Tempo (type 118) transactions are not supported via the EIP-1193 provider. Use useSendTransaction from @privy-io/react-auth/tempo instead.",4200);let n={...e.params[0],chainId:P4(this.chainId)};return await this.publicClient.estimateGas({account:n.from??this.address,...A8(n)})}async request(e){switch(console.debug("Embedded1193Provider.request() called with args",e),e.method){case"eth_accounts":case"eth_requestAccounts":return this.address?[this.address]:[];case"eth_chainId":return P4(this.chainId);case"eth_estimateGas":return this.handleEstimateGas(e);case"eth_sendTransaction":return this.handleSendTransaction(e);case"eth_signTransaction":return this.handleSignTransaction(e);case"wallet_switchEthereumChain":return this.handleSwitchEthereumChain(e);case"personal_sign":return this.handlePersonalSign(e);case"eth_signTypedData_v4":return this.handleSignedTypedData(e)}if(!(n=>Apt.includes(n))(e.method))return this.publicClient.request({method:e.method,params:e.params});{let n=await Xr();if(await Mpt({address:this.address}),!n||!this.address)throw new Ui("Disconnected",4900);try{let r={method:e.method,params:e.params},i=this.walletAccount;return i&&Da(i)?this.handleWalletApiRequest(r,i,n):(await this.walletProxy.rpc({accessToken:n,entropyId:this.entropyId,entropyIdVerifier:this.entropyIdVerifier,chainType:"ethereum",hdWalletIndex:this.walletIndex,request:r})).response.data}catch(r){throw console.error(r),new Ui("Disconnected",4900)}}}async handleWalletApiRequest(e,n,r){let i=this.privyClient;if(!i)throw new Ui("Disconnected",4900);if(e.method==="secp256k1_sign"){let s=await xo(i,(async({message:a})=>this.walletProxy.signWithUserSigner({accessToken:r,message:a})),{chain_type:"ethereum",method:"secp256k1_sign",wallet_id:n.id,params:{hash:e.params[0]}});if(s.method!=="secp256k1_sign")throw new Ui(`Invalid params for ${e.method}`,4200);return s.data.signature}throw new Ui(`Method not supported: ${e.method}`,4200)}constructor({walletProxy:e,address:n,entropyId:r,entropyIdVerifier:i,rpcConfig:s,chains:a,appId:o,chainId:l=1,walletIndex:u,privyClient:f,walletAccount:p}){super(),this.walletProxy=e,this.address=n,this.entropyId=r,this.entropyIdVerifier=i,this.chainId=l,this.rpcConfig=s,this.chains=a,this.publicClient=tv(l,this.chains,s,{appId:o}),this.rpcTimeoutDuration=hO(s,"privy"),this.appId=o,this.walletIndex=u,this.privyClient=f,this.walletAccount=p}}const Tpt=({...t}={})=>h.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.37126 11.0323C2.37126 12.696 3.90598 13.4421 5.40654 13.4468C8.91753 13.4468 12.8021 11.2897 12.7819 7.67984C12.7673 5.07728 10.3748 2.86167 7.54357 2.88296C4.8495 2.88296 2.21821 4.6411 2.21803 7.03628C2.21803 7.67951 2.58722 8.30178 3.55231 8.37184C2.74763 9.16826 2.37126 10.
12161225 2.37126 11.0323ZM7.55283 8.68012C8.11562 8.68012 8.57186 8.13217 8.57186 7.45624C8.57186 6.78032 8.11562 6.23237 7.55283 6.23237C6.99003 6.23237 6.53379 6.78032 6.53379 7.45624C6.53379 8.13217 6.99003 8.68012 7.55283 8.68012ZM10.4747 8.68012C11.0375 8.68012 11.4937 8.13217 11.4937 7.45625C11.4937 6.78032 11.0375 6.23237 10.4747 6.23237C9.91186 6.23237 9.45562 6.78032 9.45562 7.45625C9.45562 8.13217 9.91186 8.68012 10.4747 8.68012Z",fill:t.color||"var(--privy-color-foreground-3)"})});let Lpt=[],$pt={};const Ipt=()=>((()=>{let t=Ts(),{user:e}=Uo(),{walletProxy:n,privy:r}=Br(),{fundWallet:i}=Ost(),[s,a]=N.useState($pt),o=N.useRef(i);N.useEffect((()=>{o.current=i}),[i]);let l=N.useMemo((()=>e&&n?e.linkedAccounts.filter((u=>u.type==="wallet"&&u.chainType==="ethereum"&&u.walletIndex!==null&&u.walletClientType==="privy")):Lpt),[e,n]);N.useEffect((()=>{if(l.length<1)return void C2.setState({ethereumEmbedded:[]});let u=dO(),f=l.map((p=>{var v,_;let y=s[p.address]??t.defaultChain.id,g=()=>{if(!e||!n)throw new ue("User not ready");let{entropyId:C,entropyIdVerifier:S}=a2(e,p);return new kpt({walletProxy:n,address:p.address,entropyId:C,entropyIdVerifier:S,rpcConfig:t.rpcConfig,chains:t.chains,appId:t.id,chainId:y,walletIndex:p.walletIndex,privyClient:r,walletAccount:p})},b=((v=u.find((C=>C.address===p.address&&C.connectorType===p.connectorType&&C.walletClientType===p.walletClientType)))==null?void 0:v.connectedAt)??((_=p.firstVerifiedAt)==null?void 0:_.getTime())??Date.now();return{fund:async C=>{await o.current({address:p.address,options:C})},type:"ethereum",chainId:`eip155:${y}`,switchChain:async C=>{a((S=>({...S,[p.address]:Number(C)})))},getEthereumProvider:async()=>g(),sign:async C=>await g().request({method:"personal_sign",params:[Dt(C),p.address]}),address:p.address,connectedAt:b,walletClientType:"privy",connectorType:p.imported?"embedded_imported":"embedded",imported:p.imported,meta:{name:"Privy Wallet",icon:Tpt,id:"io.privy.wallet"},isConnected:async()=>!0,disconnect:()=>{},linked:!0,loginOrLink:async()=>{throw new ue("Cannot link or login with embedded wallet")},unlink:async()=>{throw new ue("Cannot unlink with embedded wallet")},walletIndex:p.walletIndex}}));C2.setState((p=>p.ethereumEmbedded.length===f.length&&p.ethereumEmbedded.every(((y,g)=>{let b=f[g];return y.address===b.address&&y.chainId===b.chainId&&y.connectorType===b.connectorType&&y.connectedAt===b.connectedAt}))?{}:{ethereumEmbedded:f}))}),[l,t.chains,t.defaultChain.id,t.id,t.rpcConfig,s,r,e,n])})(),null);let Eue,Sue,Aue,kue,Tue;const Npt=t=>{var Zr;let e=t.client,n=t.privy,r=Ts();Cre(XT((r==null?void 0:r.appearance.walletList)??[]));let[i,s]=N.useState(!1),a=L6((K=>K.inProgressMfaFlow)),[o,l]=N.useState(!1),u=Of((K=>K.user)),[f,p]=N.useState(void 0),[y,g]=N.useState(!1),[b,v]=N.useState(null),[_,C]=N.useState(!1),[S,x]=N.useState({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:Ae}),[A,I]=N.useState({status:"initial"}),[$,O]=N.useState({status:"initial"}),[P,j]=N.useState({status:"initial"}),[U,z]=N.useState({status:"initial"}),[D,R]=N.useState({status:"initial"}),[W,T]=N.useState({status:"initial"}),[L,M]=N.useState(null),Z=hre(),{initializationError:H,setInitializationError:V}=ZNe(),[F,q]=N.useState({}),[G,Y]=N.useState(null),X=N.useRef(null),te=N.useRef(null),ie=N.useRef(null),se=N.useRef(vst),pe=Of((K=>K.authenticated)),Ce=N.useCallback((K=>{_st(K),!K&&b&&V9[b]().then((Q=>{Q.default.isUnauthenticatedScreem&&v(null)}))}),[b]);e.onStoreCustomerAccessToken=K=>{K&&je(se,"accessToken","onAccessTokenGranted",{accessToken:K})},e.onDeleteCustomerAccessToken=()=>{dr(null),Ce(!1),je(se,"accessToken","onAccessTokenRemoved")};let xe=N.useRef(null),Te=N.useRef(null),Et=N.useRef(!1),Ke=({showWalletUIs:K})=>Et.current?Et.current:K!==void 0?!K:!r.embeddedWallets.showWalletUIs,Ge=K=>{v(K),setTimeout((()=>{s(!!K)}),15)};N.useEffect((()=>{var K;L&&((K=X.current)==null||K.call(X,L))}),[L]),N.useEffect((()=>{if(r.externalWallets.solana.connectors)return r.externalWallets.solana.connectors.onMount(),()=>{var K;return(K=r.externalWallets.solana.connectors)==null?void 0:K.onUnmount()}}),[r.externalWallets.solana.connectors]),N.useEffect((()=>{cpt()}),[]),N.useEffect((()=>{!o&&Z&&(async function(){var Pe,Re,it,bt,Ut;let K,Q=nn(),le=yr(),ae=sit();e.initializeConnectorManager({walletConnectCloudProjectId:r.walletConnectCloudProjectId,rpcConfig:r.rpcConfig,chains:r.chains,defaultChain:r.defaultChain,store:ae,walletList:r.appearance.walletList,shouldEnforceDefaultChainOnConnect:r.shouldEnforceDefaultChainOnConnect,externalWalletConfig:r.externalWallets,appName:r.name??"Privy",walletChainType:r.appearance.walletChainType,setBaseAccountSdk:p,connectorsDebugLogs:r.connectorsDebugLogs}),(Pe=e.connectors)==null||Pe.on("connectorInitialized",(()=>{K&&clearTimeout(K);let St=e.connectors.walletConnectors.length,jt=e.connectors.walletConnectors.reduce(((Hn,ot)=>Hn+(ot.initialized?1:0)),0);jt===St?lK(!0):K=setTimeout((()=>{console.debug({message:"Unable to initialize all expected connectors before timeout",initialized:jt,expected:St}),lK(!0)}),1500)})),(Re=e.connectors)==null||Re.initialize().then((()=>{$n()}));let ce=await e.getAuthenticatedUser();if(xst(!0),le&&ce){let St,jt=e.authFlow;if((it=jt.meta.telegramWebAppData)!=null&&it.user)try{St=String(JSON.parse(jt.meta.telegramWebAppData.user).id)}catch{}let Hn=(bt=ce.telegram)==null?void 0:bt.telegramUserId;St&&Hn!==St&&(await e.logout(),e.startAuthFlow(jt),ce=null)}let ye=!!ce;return r.legal.requireUsersAcceptTerms&&ce&&!ce.hasAcceptedTerms?(await e.logout(),Ze.setReadyToTrue(!0),void je(se,"logout","onSuccess")):((Ut=r.customAuth)!=null&&Ut.enabled||(Ce(!!ce),ce&&je(se,"login","onComplete",{user:ce,isNewUser:!1,wasAlreadyAuthenticated:!0,loginMethod:null,loginAccount:null}),dr(ce)),Q?void(Te.current=ye?"link":"login"):le&&!ye||gr(!!ce)&&!ye?(Te.current="login",xe.current="telegram",q({telegramAuthModalData:{seamlessAuth:!0}}),void Ge("TelegramAuthScreen")):void Ze.setReadyToTrue(!!ce))})().catch((K=>{let Q=K instanceof Error?K:Error(String(K));
1216V(Q),console.warn("Error initializing Privy provider: ",Q)}))}),[e,G,o,Z,V]),N.useEffect((()=>{var K;(K=e.connectors)==null||K.setWalletList(r.appearance.walletList)}),[r.appearance.walletList.join()]);let nn=()=>{let K=jft();return K.inProgress&&K.popupFlow?window.opener.location.origin!==window.location.origin?void window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Origins between parent and child windows do not match."}):K.authorizationCode==="error"?void window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Something went wrong. Try again."}):void window.opener.postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:K.stateCode,authorizationCode:K.authorizationCode}):(K.inProgress&&K.provider.startsWith("privy:")&&!K.popupFlow&&(new BroadcastChannel(TG).postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:K.stateCode,authorizationCode:K.authorizationCode}),window.close()),!!K.inProgress&&!!K.withPrivyUi&&(e.startAuthFlow(new E0({...K,customOAuthRedirectUrl:r.customOAuthRedirectUrl})),Ge("OAuthStatusScreen"),!0))},yr=()=>{var le;if(!r.loginConfig.telegramHasHmacCredentials)return;let K=(function(){let ae;return(ae=(function(){let ce=new URLSearchParams(window.location.search),ye=Number(ce.get("id")||""),Pe=ce.get("hash"),Re=Number(ce.get("auth_date")||""),it=ce.get("first_name");if(ye&&it&&Re&&Pe)return Object.fromEntries(ce.entries())})())?(EG(),{flowType:"login-url",authData:ae}):(ae=(function(){let ce=window.location.hash;if(!ce||!ce.startsWith("#tgWebAppData"))return;let ye=CG(ce.replace("#tgWebAppData=","")),{user:Pe,auth_date:Re,hash:it}=ye;return Pe&&Re&&it?ye:void 0})())?(EG(),{flowType:"web-app",authData:ae}):void 0})();if(!K||!r.loginMethods.telegram||!((le=r.loginConfig.telegramAuthConfiguration)!=null&&le.seamlessAuthEnabled))return;let Q=new p0;return e.startAuthFlow(Q),K.flowType==="login-url"&&(Q.meta.telegramWebAppData=void 0,Q.meta.telegramAuthResult=K.authData),K.flowType==="web-app"&&(Q.meta.telegramAuthResult=void 0,Q.meta.telegramWebAppData=K.authData),!0},gr=K=>{if(!r.loginMethods.telegram||r.loginConfig.telegramHasHmacCredentials||!r.loginConfig.telegramSeamlessAuthEnabled||K)return!1;let Q=dpt();if(!Q)return!1;let le=(function(ce){try{let ye=ce.split("&").filter((Re=>Re.length>0)).map((Re=>{let it=Re.indexOf("=");return it===-1?[decodeURIComponent(Re),""]:[decodeURIComponent(Re.slice(0,it)),decodeURIComponent(Re.slice(it+1))]})),Pe=Object.fromEntries(ye);return Pe.signature?Pe:null}catch{return null}})(Q);if(!le)return!1;let ae=new p0;return e.startAuthFlow(ae),ae.meta.telegramAuthResult=void 0,ae.meta.telegramWebAppData=le,!0},ve=async(K,Q,le,ae)=>{var ce,ye;if(K!=="solana_adapter")et(await((ce=e.connectors)==null?void 0:ce.createEthereumWalletConnector({connectorType:K,walletClientType:Q}))||null,Q,le,ae);else{let Pe=(ye=e.connectors)==null?void 0:ye.findSolanaWalletConnector(Q);if(!Pe)return;et(Pe,Q,le,ae)}};async function et(K,Q,le,ae){if(!K)return x({status:"disconnected",connectedWallet:null,connectError:new Sr("Unable to connect to wallet."),connector:null,connectRetry:Ae}),ae==null?void 0:ae(null,le);x({status:"disconnected",connectedWallet:null,connectError:null,connector:K,connectRetry:Ae}),K instanceof u$&&Q&&await K.resetConnection(Q),x({connector:K,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>et(K,Q,le,ae)});
1216try{let ce=await K.connect({showPrompt:!0});return ce&&Zd(ce)&&await Ist(ce,r,(()=>{x((ye=>({...ye,connector:K,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:Ae})))})),x((ye=>({...ye,status:"connected",connectedWallet:ce,connectError:null,connectRetry:Ae}))),ce&&je(se,"connectWallet","onSuccess",{wallet:ce}),ae==null?void 0:ae(ce,le)}catch(ce){return ce instanceof V2?(console.warn(ce.cause?ce.cause:ce.message),je(se,"connectWallet","onError",ce.privyErrorCode||Oe.GENERIC_CONNECT_WALLET_ERROR)):(console.warn(ce),je(se,"connectWallet","onError",Oe.UNKNOWN_CONNECT_WALLET_ERROR)),x((ye=>({...ye,status:"disconnected",connectedWallet:null,connectError:ce}))),ae==null?void 0:ae(null,le)}}let rn=async(K,Q,le)=>{if(K===null||!Zd(K))return;let ae=new qw(e,K,Q,le);e.startAuthFlow(ae)},br=async(K,Q,le,ae="plain")=>{let ce=R0(lit);if(ae==="transaction"&&!ce)throw new ue("useSolanaLedger plugin hook must be mounted");if(K===null||!oPe(K))return;let ye=new xG(K,e,Q,le,ae,ce);e.startAuthFlow(ye)},$n=async()=>{let K=new URLSearchParams(window.location.search),Q=K.get("privy_connector"),le=K.get("privy_wallet_client"),ae=K.get("privy_connect_only")==="true";if(!Q||!le)return;Ue.debug("Mobile wallet return detected",{connectorType:Q,wallet:le,connectOnly:ae});let ce=iPe({connectorType:Q,walletClientType:le});if(!ce||!ce.isInstalled)return Ue.warn("Wallet not installed on mobile return",{wallet:le,hasConfig:!!ce,isInstalled:ce==null?void 0:ce.isInstalled}),Ge("LoginFailedScreen");if(!e.connectors)throw new ue("Connector not initialized");await Ge(ae?"ConnectOnlyStatusScreen":"ConnectionStatusScreen");let ye=new URL(window.location.href);ye.searchParams.delete("privy_connector"),ye.searchParams.delete("privy_wallet_client"),ye.searchParams.delete("privy_connect_only"),window.history.pushState({},"",ye),Ue.debug("Launching connection flow from mobile return",{wallet:le,connectorType:Q,connectOnly:ae}),ve(Q,le,void 0,ae?void 0:Q==="solana_adapter"?br:rn)};N.useEffect((()=>{o&&pe&&u===null&&e.getAuthenticatedUser().then(dr)}),[o,pe,u,e]);let $t=K=>{if(!pe)throw je(se,"linkAccount","onError",Oe.MUST_BE_AUTHENTICATED,{linkMethod:K}),new ue("User must be authenticated before linking an account.")},jr=K=>{if(!pe||!u)return!1;if(K.walletClientType==="privy")return!0;for(let Q of u.linkedAccounts)if(Q.type==="wallet"&&Q.address===K.address&&Q.walletClientType!=="privy")return!0;return!1},ar=()=>{C2.setState((K=>{var le;let Q=((le=e.connectors)==null?void 0:le.wallets.filter(Zd).map((ae=>({...ae,linked:jr(ae),loginOrLink:async()=>{if(!await ae.isConnected())throw new ue("Wallet is not connected");if(ae.connectorType==="embedded"&&ae.walletClientType==="privy")throw new ue("Cannot link or login with embedded wallet");(async ce=>{let ye;if(!e.connectors)throw new ue("Connector not initialized");ye=ce.type==="ethereum"?e.connectors.findWalletConnector(ce.connectorType,ce.walletClientType)||null:e.connectors.findSolanaWalletConnector(ce.walletClientType)||null,x((Pe=>({...Pe,connector:ye,status:"connected",connectedWallet:ce,connectError:null,connectRetry:Ae}))),r.captcha.enabledProvider&&!pe?(q({captchaModalData:{callback:Pe=>Zd(ce)?rn(ce,Pe):br(ce,Pe),userIntentRequired:!1,onSuccessNavigateTo:"ConnectionStatusScreen",onErrorNavigateTo:"ErrorScreen"}}),await Ge("CaptchaScreen")):(Zd(ce)?await rn(ce):await br(ce),await Ge("ConnectionStatusScreen"))})(ae)},fund:async ce=>{await Ze.fundWallet(ae.address,ce)},unlink:async()=>{if(!pe)throw new ue("User is not authenticated.");if(ae.connectorType==="embedded"&&ae.walletClientType==="privy")throw new ue("Cannot unlink an embedded wallet");dr(await e.unlinkEthereumWallet(ae.address))}}))))||[];return Ere(K.ethereumExternal,Q)?{}:{ethereumExternal:Q}}))};N.useEffect((()=>{ar()}),[u==null?void 0:u.linkedAccounts,pe,o]),N.useEffect((()=>{if(o){if(!e.connectors)throw new ue("Connector not initialized");ar(),e.connectors.on("walletsUpdated",ar)}}),[o]),N.useEffect((()=>{var K,Q;[...((K=r.loginMethodsAndOrder)==null?void 0:K.primary)??[],...((Q=r.loginMethodsAndOrder)==null?void 0:Q.overflow)??[]].filter((le=>
1216le.startsWith("privy:"))).forEach((le=>e.getCrossAppProviderDetails(le.replace("privy:",""))))}),[!!e]);let Mr=({transaction:K,sponsor:Q,uiOptions:le,fundWalletConfig:ae,address:ce,signOnly:ye})=>new Promise((async(Pe,Re)=>{let{requesterAppId:it}=le||{},bt=ye?"signTransaction":"sendTransaction",Ut=ce?x0(u,ce):v2(u);if(!Ut&&ce){let Wt=$4(tg(),ce);if(Wt){if(Q)return Re(new ue("Cannot sponsor transactions for externally connected wallet.")),void je(se,bt,"onError",Oe.TRANSACTION_FAILURE);try{let Un=await Wt.getEthereumProvider(),Ct=K.data,wn=R0(zT);wn&&(Ct=wn.appendDataSuffix({data:Ct}));let Wn={...K,from:ce,chainId:K.chainId||Number(Wt.chainId.replace("eip155:","")),value:K.value!==void 0?Dt(K.value):void 0,data:Ct},Dr=await Un.request({method:bt==="sendTransaction"?"eth_sendTransaction":"eth_signTransaction",params:[Wn]});return je(se,bt,"onSuccess",{hash:Dr}),void Pe({hash:Dr})}catch(Un){return je(se,bt,"onError",Oe.TRANSACTION_FAILURE),void Re(Un??new Fl("Unable to "+bt+Un))}}}if(!Ut)return je(se,bt,"onError",Oe.EMBEDDED_WALLET_NOT_FOUND),void Re(new ue("No embedded or connected wallet found for address."));if(!pe||!u)return je(se,bt,"onError",Oe.MUST_BE_AUTHENTICATED),void Re(Error("User must be authenticated before signing with a Privy wallet"));let St=Ut.address,jt=Ut.walletIndex??0,{entropyId:Hn,entropyIdVerifier:ot}=a2(u,Ut),Nn=$4(tg(),St);if(!Nn)return je(se,bt,"onError",Oe.EMBEDDED_WALLET_NOT_FOUND),void Re(Error("Must have a Privy wallet before signing"));let Jn=await Nn.getEthereumProvider(),Fr=await Jn.request({method:"eth_chainId"}),lr=K.chainId?Number(K.chainId):Lle(Fr);(Wt=>{if(!r.chains.map((Un=>Un.id)).includes(Wt))throw new Sr(`Chain ID ${Wt} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,Oe.UNSUPPORTED_CHAIN_ID)})(lr);let en=R0(zT),Dn=K.data;en&&!Q&&(Dn=en.appendDataSuffix({data:Dn}));let cr={...K,from:K.from??St,chainId:lr,data:Dn},zr=await Xr();if(!zr||!L)return je(se,bt,"onError",Oe.EMBEDDED_WALLET_NOT_FOUND),void Re(Error("Must have valid access token and Privy wallet to send transaction"));let ga=tv(cr.chainId,r.chains,r.rpcConfig,{appId:t.appId}),Vo=Da(Ut),Ho=async({transactionRequest:Wt})=>{try{let Un;if(!await Ze.recoverEmbeddedWallet({address:St}))throw je(se,bt,"onError",Oe.UNKNOWN_CONNECT_WALLET_ERROR),Re(Error("Unable to connect to wallet")),Error("Unable to connect to wallet");if(Q){let Ct=await(async({transactionRequest:wn})=>{if(!Vo)throw new ue("Sponsoring is only supported for wallets on the TEE stack");if(ye)throw new ue("Cannot sponsor a sign transaction request");let Wn=_n=>_n==null?void 0:Dt(_n),Dr=await xo(n,(async({message:_n})=>await L.signWithUserSigner({accessToken:zr,requesterAppId:it,message:_n})),{chain_type:"ethereum",method:"eth_sendTransaction",caip2:Pg(Dt(wn.chainId)),sponsor:!0,...en?{experimental_data_suffix:en.suffix}:{},params:{transaction:{from:wn.from,to:wn.to,chain_id:Wn(wn.chainId),data:Ss(wn.data)?wn.data?wn.data:Dt(Uint8Array.from(wn.data)):void 0,value:Wn(wn.value)}},wallet_id:Ut.id});if(Dr.data&&"hash"in Dr.data)return Dr.data.hash;throw new Fl("Unable to sign transaction")})({transactionRequest:Wt});return je(se,"sendTransaction","onSuccess",{hash:Ct}),Ct}if(Vo){let Ct=Wn=>
1216{if(Wn!=null)return Ss(Wn)?Wn:Dt(Wn)},wn=await xo(n,(async({message:Wn})=>await L.signWithUserSigner({accessToken:zr,requesterAppId:it,message:Wn})),{chain_type:"ethereum",method:"eth_signTransaction",params:{transaction:{from:Wt.from,to:Wt.to,nonce:Ct(Wt.nonce),chain_id:Ct(Wt.chainId),data:Ss(Wt.data)?Wt.data?Wt.data:Dt(Uint8Array.from(Wt.data)):void 0,value:Ct(Wt.value),type:Wt.type,gas_limit:Ct(Wt.gasLimit??Wt.gas),gas_price:Ct(Wt.gasPrice??Wt.gas),max_fee_per_gas:Ct(Wt.maxFeePerGas),max_priority_fee_per_gas:Ct(Wt.maxPriorityFeePerGas)}},wallet_id:Ut.id});if(!wn.data||!("signed_transaction"in wn.data))throw new Fl("Unable to sign transaction");Un=wn.data.signed_transaction}else Un=await(async function({accessToken:Ct,entropyId:wn,entropyIdVerifier:Wn,transactingWalletIndex:Dr,walletProxy:_n,transactionRequest:xc,requesterAppId:pn}){return(await _n.rpc({entropyId:wn,entropyIdVerifier:Wn,hdWalletIndex:Dr??0,chainType:"ethereum",accessToken:Ct,requesterAppId:pn,request:{method:"eth_signTransaction",params:[xc]}})).response.data})({accessToken:zr,entropyId:Hn,entropyIdVerifier:ot,transactingWalletIndex:jt,walletProxy:L,transactionRequest:Wt,requesterAppId:it});if(ye)return je(se,"signTransaction","onSuccess",{signature:Un}),Un;{let Ct=await ga.sendRawTransaction({serializedTransaction:Un});return je(se,"sendTransaction","onSuccess",{hash:Ct}),Ct}}catch(Un){throw je(se,bt,"onError",Oe.TRANSACTION_FAILURE),Un}};if(Ke({showWalletUIs:le==null?void 0:le.showWalletUIs}))try{let Wt=ye||Q?cr:await KZ(cr,ga,cr.from),Un=await Ho({transactionRequest:Wt});ye?je(se,"signTransaction","onSuccess",{signature:Un}):je(se,"sendTransaction","onSuccess",{hash:Un}),Pe({hash:Un})}catch(Wt){je(se,bt,"onError",Oe.TRANSACTION_FAILURE),Re(Wt)}else{let Wt={connectingWalletAddress:St,recoveryMethod:Ut.recoveryMethod,entropyId:Hn,entropyIdVerifier:ot,onCompleteNavigateTo:"SendTransactionScreen",isUnifiedWallet:Vo,onFailure:Ct=>{je(se,bt,"onError",Oe.UNKNOWN_CONNECT_WALLET_ERROR),Re(Ct)}},Un=(Ct=>!!Ct.fundingConfig&&EP(Ct.fundingConfig.options).length>=1)(r)?uK({address:St,appConfig:r,fundWalletConfig:ae,methodScreen:"FundingMethodSelectionScreen",chainIdOverride:cr.chainId,comingFromSendTransactionScreen:!0}):void 0;q({connectWallet:Wt,sendTransaction:{transactionRequest:cr,transactingWalletIndex:jt,transactingWalletAddress:St,entropyId:Hn,entropyIdVerifier:ot,signOnly:ye,scanTransaction:async()=>{var wn,Wn,Dr,_n;let Ct=await KZ(cr,ga,cr.from);return await e.scanTransaction({metadata:{domain:r.embeddedWallets.transactionScanning.domain},chain_id:Ct.chainId.toString(),request:{method:"eth_sendTransaction",params:[{from:Ct.from,to:Ct.to,value:(wn=Ct.value)==null?void 0:wn.toString(),gas:(Wn=Ct.gas)==null?void 0:Wn.toString(),gasPrice:(Dr=Ct.gasPrice)==null?void 0:Dr.toString(),nonce:(_n=Ct.nonce)==null?void 0:_n.toString(),data:Ct.data}]}})},getIsSponsored:async()=>!!Q,onConfirm:({transactionRequest:Ct})=>Ho({transactionRequest:Ct}),onSuccess:Ct=>{ye?je(se,"signTransaction","onSuccess",{signature:Ct.hash}):je(se,"sendTransaction","onSuccess",{hash:Ct.hash}),Pe(Ct)},onFailure:Ct=>{je(se,bt,"onError",Oe.TRANSACTION_FAILURE),Re(Ct)},uiOptions:le||{},fundWalletConfig:ae,requesterAppId:it},funding:Un}),Ge("EmbeddedWalletConnectingScreen")}}));function In(){return new Promise((async(K,Q)=>{if(!u||u.mfaMethods.length===0)return K();let le=await Xr();if(!le||!L)throw Error("Must have valid access token to enroll in MFA");try{await L.verifyMfa({accessToken:le}),K()}catch(ae){Q(ae)}}))}let Tr=K=>K==null?void 0:K.linkedAccounts.filter((Q=>Q.latestVerifiedAt!==null&&!(Q.type==="wallet"&&Q.walletClientType==="privy"))).sort(((Q,le)=>le.latestVerifiedAt.getTime()-Q.latestVerifiedAt.getTime()))[0],ln=K=>{let Q=(u==null?void 0:u.linkedAccounts.filter((ce=>ce.type===K)).length)??0,{displayName:le,loginMethod:ae}=fpt(K);if(K==="passkey"&&Q>=5||K!=="passkey"&&Q>=1)throw je(se,"linkAccount","onError",Oe.CANNOT_LINK_MORE_OF_TYPE,{linkMethod:ae}),new ue(`User already has an account of type ${le} linked.`)};async function Rt({showAutomaticRecovery:K=!1,legacySetWalletPasswordFlow:Q=!1}){v(null);let le=Q?"setWalletPassword":"setWalletRecovery";
1216if(!pe||!u)throw je(se,le,"onError",Oe.MUST_BE_AUTHENTICATED),Error("User must be authenticated before adding recovery method to Privy wallet");let ae=l6(u);if(!ae||!L)throw je(se,le,"onError",Oe.EMBEDDED_WALLET_NOT_FOUND),Error("Must have a Privy wallet to add a recovery method");let ce=Da(ae);if(ce)throw je(se,le,"onError",Oe.UNSUPPORTED_WALLET_TYPE),new ue("User owned wallet recovery is only supported for on-device execution and this app uses TEE execution. Learn more https://docs.privy.io/recipes/tee-wallet-migration-guide");try{await In()}catch(ye){throw je(se,le,"onError",Oe.MISSING_MFA_CREDENTIALS),ye}return new Promise(((ye,Pe)=>{let Re=ae.recoveryMethod==="user-passcode",it=spt({walletAction:"update",availableRecoveryMethods:r.embeddedWallets.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:Q,isResettingPassword:Re,showAutomaticRecovery:K}),{entropyId:bt,entropyIdVerifier:Ut}=a2(u),St={recoveryMethod:ae.recoveryMethod,connectingWalletAddress:ae.address,onCompleteNavigateTo:it,shouldForceMFA:!1,entropyId:bt,isUnifiedWallet:ce,entropyIdVerifier:Ut,onFailure:jt=>{je(se,le,"onError",Oe.UNKNOWN_CONNECT_WALLET_ERROR),Pe(jt)}};q({setWalletPassword:{onSuccess:jt=>{je(se,le,"onSuccess",{method:"user-passcode",wallet:jt}),ye(jt)},onFailure:jt=>{je(se,le,"onError",Oe.USER_EXITED_SET_PASSWORD_FLOW),Pe(jt)},callAuthOnSuccessOnClose:!1},recoverWallet:{entropyId:bt,entropyIdVerifier:Ut,onFailure:Pe},connectWallet:St,recoverySelection:{isInAccountCreateFlow:!1,isResettingPassword:Re,shouldCreateEth:!1,shouldCreateSol:!1}}),Ge("EmbeddedWalletConnectingScreen")}))}let Ht={ready:o,authenticated:pe,user:u,error:H,walletConnectors:e.connectors||null,connectWallet:K=>{K&&"target"in K&&K&&(K=void 0),q({externalConnectWallet:{walletList:K!=null&&K.walletList&&(K==null?void 0:K.walletList.length)>0?K.walletList:void 0,walletChainType:K==null?void 0:K.walletChainType,description:K==null?void 0:K.description,hideHeader:K==null?void 0:K.hideHeader}}),Ge("ConnectOnlyLandingScreen")},linkWallet:K=>(K&&"target"in K&&K&&(K=void 0),$t("siwe"),xe.current="siwe",Te.current="link",q({...F,externalConnectWallet:{...F.externalConnectWallet,walletList:K==null?void 0:K.walletList,walletChainType:K==null?void 0:K.walletChainType,description:(K==null?void 0:K.description)||`Link a wallet to your ${r==null?void 0:r.name} account`}}),Ge("AuthenticateWithWalletScreen")),linkEmail:()=>{$t("email"),ln("email"),xe.current="email",Te.current="link",Ge("LinkEmailScreen")},linkPhone:()=>{$t("sms"),ln("phone"),xe.current="sms",Te.current="link",Ge("LinkPhoneScreen")},linkGoogle:async()=>{$t("google"),ln("google_oauth"),Te.current="link",await Ze.initLoginWithOAuth("google")},linkTwitter:async()=>{$t("twitter"),ln("twitter_oauth"),Te.current="link",await Ze.initLoginWithOAuth("twitter")},linkTwitch:async()=>{$t("twitch"),ln("twitch_oauth"),Te.current="link",await Ze.initLoginWithOAuth("twitch")},linkDiscord:async()=>{$t("discord"),ln("discord_oauth"),Te.current="link",await Ze.initLoginWithOAuth("discord")},linkGithub:async()=>{$t("github"),ln("github_oauth"),Te.current="link",await Ze.initLoginWithOAuth("github")},linkSpotify:async()=>{$t("spotify"),ln("spotify_oauth"),Te.current="link",await Ze.initLoginWithOAuth("spotify")},linkInstagram:async()=>{$t("instagram"),ln("instagram_oauth"),Te.current="link",await Ze.initLoginWithOAuth("instagram")},linkTiktok:async()=>{$t("tiktok"),ln("tiktok_oauth"),Te.current="link",await Ze.initLoginWithOAuth("tiktok")},linkLine:async()=>{$t("line"),ln("line_oauth"),Te.current="link",await Ze.initLoginWithOAuth("line")},linkLinkedIn:async()=>{$t("linkedin"),ln("linkedin_oauth"),Te.current="link",await Ze.initLoginWithOAuth("linkedin")},linkApple:async()=>{$t("apple"),ln("apple_oauth"),Te.current="link",await Ze.initLoginWithOAuth("apple")},linkOAuth:async({provider:K})=>{$t(K),ln(lO(K)?K:`${K}_oauth`),Te.current="link",await Ze.initLoginWithOAuth(K)},linkPasskey:async K=>{$t("passkey"),ln("passkey"),await Ze.initLinkWithPasskey(),q({passkeyAuthModalData:{passkeySignupFlow:!1,name:K==null?void 0:K.name}}),Ge("LinkPasskeyScreen")}
1216,linkTelegram:async K=>{if($t("telegram"),ln("telegram"),!r.loginConfig.telegramHasHmacCredentials)throw new ue('linkTelegram requires HMAC bot credentials. Use linkWithOAuth("telegram") for OIDC-configured apps.');if(Te.current="link",xe.current="telegram",K==null?void 0:K.launchParams)if(K.launchParams.initDataRaw){let Q=new p0;e.startAuthFlow(Q),Q.meta.telegramAuthResult=void 0,Q.meta.telegramWebAppData=CG(K.launchParams.initDataRaw),q({telegramAuthModalData:{seamlessAuth:!0}}),Ge("TelegramAuthScreen")}else je(se,"linkAccount","onError",Oe.INVALID_DATA,{linkMethod:"telegram"});else await Ze.initLoginWithTelegram();Ge("TelegramAuthScreen")},linkFarcaster:async()=>{$t("farcaster"),ln("farcaster"),await Ze.initLoginWithFarcaster(),Te.current="link",xe.current="farcaster",Ge("FarcasterConnectStatusScreen")},login:async K=>{K&&"target"in K&&K&&(K=void 0);let Q="Attempted to log in, but user is already logged in. Use a `link` helper instead.";if(!o){let le=await new Promise((ae=>{Y((ce=>ae.bind(ce)))}));if(Y(null),le)return void console.warn(Q)}!u||u.isGuest?(Te.current="login",q({login:K}),Ge("LandingScreen")):console.warn(Q)},connectOrCreateWallet:async()=>{o||(await new Promise((K=>{Y((()=>K))})),Y(null)),pe?console.warn("User must be unauthenticated to `connectOrCreateWallet`"):(Te.current="connect-or-create",Ge("ConnectOrCreateScreen"))},logout:async()=>{if(Te.current=null,xe.current=null,u&&e.clearProviderAcccessTokens(u),v(null),await e.logout(),u&&L)try{await L.clearMfa({userId:u.id})}catch{}dr(null),Ce(!1),g(!1),O({status:"initial"}),j({status:"initial"}),I({status:"initial"}),z({status:"initial"}),R({status:"initial"}),T({status:"initial"}),je(se,"logout","onSuccess"),s(!1),vt.del(KT),vt.del(lre(r.id))},getAccessToken:N.useCallback((async()=>{let K=await e.getCustomerAccessToken();return K&&!pe&&Ce(!0),K}),[e,pe]),setWalletRecovery:async K=>Rt({legacySetWalletPasswordFlow:!1,showAutomaticRecovery:(K==null?void 0:K.showAutomaticRecovery)??!1}),setWalletPassword:async()=>Rt({legacySetWalletPasswordFlow:!0,showAutomaticRecovery:!1}),signMessage:(K,Q)=>new Promise((async(le,ae)=>{var Hn;let{requesterAppId:ce}=(Q==null?void 0:Q.uiOptions)||{},ye=K.message,Pe=Q!=null&&Q.address?x0(u,Q.address):v2(u);
1216if(!Pe&&(Q==null?void 0:Q.address)!==void 0){let ot=$4(tg(),Q.address);if(ot)try{let Nn=await ot.getEthereumProvider(),Jn=await Nn.request({method:"personal_sign",params:[ye,ot.address]});return je(se,"signMessage","onSuccess",{signature:Jn}),void le({signature:Jn})}catch(Nn){return je(se,"signMessage","onError",Oe.UNABLE_TO_SIGN),void ae(Nn??new Fl("Unable to sign message"))}}if(!Pe)throw new ue("No embedded or connected wallet found for address.");if(!pe||!u)return je(se,"signMessage","onError",Oe.MUST_BE_AUTHENTICATED),void ae(Error("User must be authenticated before signing with a Privy wallet"));let Re=Pe.address,it=Pe.walletIndex??0,{entropyId:bt,entropyIdVerifier:Ut}=a2(u,Pe),St=Da(Pe);if(typeof ye!="string"||ye.length<1)return je(se,"signMessage","onError",Oe.INVALID_MESSAGE),void ae(Error("Message must be a non-empty string"));let jt=async()=>{let ot;if(!pe)throw Error("User must be authenticated before signing with a Privy wallet");let Nn=await Xr();if(!L||!Nn||!await Ze.recoverEmbeddedWallet({address:Re}))throw Error("Unable to connect to wallet");if(e.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_started",payload:{walletAddress:Re,requesterAppId:ce}}
1216),St){let Jn=Ss(K.message,{strict:!0}),Fr=await xo(n,(async({message:lr})=>await L.signWithUserSigner({accessToken:Nn,requesterAppId:ce,message:lr})),{chain_type:"ethereum",method:"personal_sign",params:Jn?{message:ye.slice(2),encoding:"hex"}:{message:ye,encoding:"utf-8"},wallet_id:Pe.id});if(!Fr.data||!("signature"in Fr.data))throw new Fl("Unable to sign message");ot=Fr.data.signature}else{let{response:Jn}=await L.rpc({accessToken:Nn,entropyId:bt,entropyIdVerifier:Ut,chainType:"ethereum",hdWalletIndex:it,requesterAppId:ce,request:{method:"personal_sign",params:[ye,Re]}});ot=Jn.data}return e.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_completed",payload:{walletAddress:Re,requesterAppId:ce}}),ot};if(Ke({showWalletUIs:(Hn=Q==null?void 0:Q.uiOptions)==null?void 0:Hn.showWalletUIs}))try{let ot=await jt();je(se,"signMessage","onSuccess",{signature:ot}),le({signature:ot})}catch(ot){je(se,"signMessage","onError",Oe.UNABLE_TO_SIGN),ae(ot??new Fl("Unable to sign message"))}else q({signMessage:{method:"personal_sign",data:ye,confirmAndSign:jt,onSuccess:ot=>{je(se,"signMessage","onSuccess",{signature:ot}),le({signature:ot})},onFailure:ot=>{je(se,"signMessage","onError",Oe.UNABLE_TO_SIGN),ae(ot)},uiOptions:(Q==null?void 0:Q.uiOptions)||{}},connectWallet:{recoveryMethod:Pe.recoveryMethod,connectingWalletAddress:Re,entropyId:bt,entropyIdVerifier:Ut,onCompleteNavigateTo:"SignRequestScreen",isUnifiedWallet:St,onFailure:ot=>{je(se,"signMessage","onError",Oe.UNKNOWN_CONNECT_WALLET_ERROR),ae(ot)}}}),Ge("EmbeddedWalletConnectingScreen")})),signTypedData:(K,Q)=>new Promise((async(le,ae)=>{var Hn;let{requesterAppId:ce}=(Q==null?void 0:Q.uiOptions)||{},ye=Q!=null&&Q.address?x0(u,Q.address):v2(u);
1216if(!ye&&(Q!=null&&Q.address)){let ot=$4(tg(),Q.address);if(ot)try{let Nn=await ot.getEthereumProvider(),Jn=rv(K),Fr=await Nn.request({method:"eth_signTypedData_v4",params:[ot.address,JSON.stringify(Jn,((lr,en)=>typeof en=="bigint"?en.toString():en))]});return je(se,"signTypedData","onSuccess",{signature:Fr}),void le({signature:Fr})}catch(Nn){return je(se,"signTypedData","onError",Oe.UNABLE_TO_SIGN),void ae(Nn??new Fl("Unable to sign typed data "+Nn))}}if(!ye)throw new ue("No embedded or connected wallet found for address.");if(!pe||!u)return je(se,"signTypedData","onError",Oe.MUST_BE_AUTHENTICATED),void ae(Error("User must be authenticated before signing with a Privy wallet"));let Pe=ye.address,Re=ye.walletIndex??0,{entropyId:it,entropyIdVerifier:bt}=a2(u,ye),Ut=Da(ye),St=rv(K),jt=async()=>{let ot;if(!pe)throw Error("User must be authenticated before signing with a Privy wallet");let Nn=await Xr();if(!L||!Nn||!await Ze.recoverEmbeddedWallet({address:Pe}))throw Error("Unable to connect to wallet");if(e.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_started",payload:{walletAddress:Pe,requesterAppId:ce}}),Ut){let{domain:Jn,types:Fr,primaryType:lr,message:en}=St,Dn=await xo(n,(async({message:cr})=>await L.signWithUserSigner({accessToken:Nn,requesterAppId:ce,message:cr})),{chain_type:"ethereum",method:"eth_signTypedData_v4",params:{typed_data:{domain:Jn,types:Fr,primary_type:lr,message:en}},wallet_id:ye.id,...Q!=null&&Q.signatureOptions?{signature_options:Q.signatureOptions}:{},...Q!=null&&Q.caip2?{caip2:Q.caip2}:{}});if(!Dn.data||!("signature"in Dn.data))throw new Fl("Unable to sign message");ot=Dn.data.signature}else{let{response:Jn}=await L.rpc({accessToken:Nn,entropyId:it,entropyIdVerifier:bt,chainType:"ethereum",hdWalletIndex:Re,requesterAppId:ce,request:{method:"eth_signTypedData_v4",params:[Pe,St]}});ot=Jn.data}return e.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_completed",payload:{walletAddress:Pe,requesterAppId:ce}}),ot};if(Ke({showWalletUIs:(Hn=Q==null?void 0:Q.uiOptions)==null?void 0:Hn.showWalletUIs}))try{let ot=await jt();je(se,"signTypedData","onSuccess",{signature:ot}),le({signature:ot})}catch(ot){je(se,"signTypedData","onError",Oe.UNABLE_TO_SIGN),ae(ot??new Fl("Unable to sign message"))}else q({signMessage:{method:"eth_signTypedData_v4",data:St,confirmAndSign:jt,onSuccess:ot=>{je(se,"signTypedData","onSuccess",{signature:ot}),le({signature:ot})},onFailure:ot=>{je(se,"signTypedData","onError",Oe.UNABLE_TO_SIGN),ae(ot)},uiOptions:(Q==null?void 0:Q.uiOptions)||{}},connectWallet:{recoveryMethod:ye.recoveryMethod,connectingWalletAddress:ye.address,entropyId:it,isUnifiedWallet:Ut,entropyIdVerifier:bt,onCompleteNavigateTo:"SignRequestScreen",onFailure:ot=>{je(se,"signMessage","onError",Oe.UNKNOWN_CONNECT_WALLET_ERROR),ae(ot)}}}),Ge("EmbeddedWalletConnectingScreen")})),sendTransaction:async(K,Q)=>await Mr({transaction:K,sponsor:Q==null?void 0:Q.sponsor,uiOptions:Q==null?void 0:Q.uiOptions,fundWalletConfig:Q==null?void 0:Q.fundWalletConfig,address:Q==null?void 0:Q.address,signOnly:!1}),signTransaction:async(K,Q)=>({signature:(await Mr({transaction:K,uiOptions:Q==null?void 0:Q.uiOptions,address:Q==null?void 0:Q.address,signOnly:!0})).hash}),promptMfa:In,async init(K){switch(K){case"sms":return void await e.initMfaSmsVerification();case"passkey":return await e.initMfaPasskeyVerification();case"totp":return;default:throw Error(`Unsupported MFA method: ${K}`)}},async submit(K,Q){var le,ae,ce;switch(K){case"totp":case"sms":if(typeof Q!="string")throw new ue("Invalid MFA code");(le=te.current)==null||le.resolve({mfaMethod:K,mfaCode:Q,relyingParty:window.origin}),await new Promise(((Re,it)=>{ie.current={resolve:Re,reject:it}}));break;case"passkey":if(typeof Q=="string")throw new ue("Invalid authenticator response");let ye=await Le(()=>import("./index-BbRoODsT.js"),[]),Pe=ypt(await ye.startAuthentication({optionsJSON:Q}));(ae=te.current)==null||ae.resolve({mfaMethod:K,mfaCode:Pe,relyingParty:window.origin}),await new Promise(((Re,it)=>{ie.current={resolve:Re,reject:it}}));break;default:throw(ce=te.current)==null||ce.reject(new ue("Unsupported MFA method")),new ue(`Unsupported MFA method: ${K}`)}},cancel(){var K;(K=te.current)==null||K.reject(new ue("MFA canceled"))}
1216,async clear(){if(!u||!L)throw Error("Must be authenticated to clear MFA");await L.clearMfa({userId:u.id})},async initEnrollmentWithSms(K){let Q=await Xr();if(!Q||!L)throw Error("Must have valid access token to enroll in MFA");await L.initEnrollMfa({method:"sms",accessToken:Q,phoneNumber:K.phoneNumber})},enrollInMfa:K=>new Promise(((Q,le)=>{if(!K)return Ze.closePrivyModal(),void Q();r.mfa.noPromptOnMfaRequired&&console.warn("[Privy Warning] Triggering the 'showMfaEnrollmentModal' function when 'noPromptOnMfaRequired' is set to true is unexpected. If this is intentional, ensure that you are building custom UIs for MFA verification."),q({mfaEnrollmentFlow:{mfaMethods:r.mfa.methods,shouldUnlinkOnUnenrollMfa:r.passkeys.shouldUnlinkOnUnenrollMfa,onSuccess:Q,onFailure:le}}),Ge("MfaEnrollmentFlowScreen")})),async initEnrollmentWithTotp(){let K=await Xr();if(!K||!L)throw Error("Must have valid access token to enroll in MFA");let Q=await L.initEnrollMfa({method:"totp",accessToken:K});return{secret:Q.secret,authUrl:Q.authUrl}},async submitEnrollmentWithSms(K){let Q=await Xr();if(!Q||!L)throw Error("Must have valid access token to enroll in MFA");await L.submitEnrollMfa({method:"sms",accessToken:Q,phoneNumber:K.phoneNumber,code:K.mfaCode}),dr(await e.getAuthenticatedUser())},async submitEnrollmentWithTotp(K){let Q=await Xr();if(!Q||!L)throw Error("Must have valid access token to enroll in MFA");await L.submitEnrollMfa({method:"totp",accessToken:Q,code:K.mfaCode}),dr(await e.getAuthenticatedUser())},async initEnrollmentWithPasskey(){},async submitEnrollmentWithPasskey({credentialIds:K},Q={}){let le=await Xr();if(!le||!L)throw Error("Must have valid access token to enroll in MFA");await L.submitEnrollMfa({method:"passkey",accessToken:le,credentialIds:K,removeForLogin:Q.removeForLogin}),dr(await e.getAuthenticatedUser())},async unenroll(K,Q={}){let le=await Xr();if(!le||!L)throw Error("Must have valid access token to remove MFA");K==="passkey"?await L.submitEnrollMfa({method:"passkey",accessToken:le,credentialIds:[],removeForLogin:Q.removeForLogin}):await L.unenrollMfa({method:K,accessToken:le});let ae=await e.getAuthenticatedUser();if(dr(ae),ae&&ae.mfaMethods.length===0)try{await L.clearMfa({userId:ae.id})}catch{}},isModalOpen:i||!!a,mfaMethods:r.mfa.methods};Eue=Ht.signMessage,Sue=Ht.signTypedData,kue=async(K,Q)=>await Mr({transaction:K,...Q,signOnly:!1}),Aue=async(K,Q)=>({signature:(await Mr({transaction:K,...Q,signOnly:!0})).hash});let wt=async K=>{let Q,le,ae;C(!0),R({status:"loading"}),e.startAuthFlow(new E0({...K,customOAuthRedirectUrl:r.customOAuthRedirectUrl}));let ce=vt.get(J8),ye=K.stateCode;if(ce!==ye)throw e.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:K.provider,storedStateCode:ce??"",returnedStateCode:ye??""}}),C(!1),new ue("Unexpected auth flow. This may be a phishing attempt.",void 0,Oe.OAUTH_UNEXPECTED);if(await e.getAccessToken()!==null)try{({user:Q,oAuthTokens:ae}=await e.link()),xe.current=K.provider;let Pe=Tr(Q);Q&&Pe&&je(se,"linkAccount","onSuccess",{user:Q,linkMethod:xe.current,linkedAccount:Pe})}catch(Pe){throw C(!1),je(se,"linkAccount","onError",Pe.privyErrorCode||Oe.FAILED_TO_LINK_ACCOUNT,{linkMethod:K.provider}),Pe}else try{({user:Q,isNewUser:le,oAuthTokens:ae}=await e.authenticate()),xe.current=K.provider;let Pe=Tr(Q);Q&&Pe&&le!==void 0&&je(se,"login","onComplete",{user:Q,isNewUser:le,wasAlreadyAuthenticated:!1,loginMethod:xe.current,loginAccount:Pe})}catch(Pe){throw C(!1),R({status:"error",error:Pe}),je(se,"login","onError",Pe.privyErrorCode||Oe.UNKNOWN_AUTH_ERROR),Pe}return dr(Q),g(le||!1),Ce(!0),C(!1),R({status:"done"}),ae&&Q&&je(se,"oAuthAuthorization","onOAuthTokenGrant",{oAuthTokens:ae,user:Q}),Q??void 0},Ze={privy:n,setAuthenticated:Ce,setUser:dr,setIsNewUser:g,isNewUserThisSession:y,pendingTransaction:null,walletConnectionStatus:S,setWalletConnectionStatus:x,connectors:((Zr=e.connectors)==null?void 0:Zr.walletConnectors)??[],rpcConfig:r.rpcConfig,chains:r.chains,appId:t.appId,showFiatPrices:r.embeddedWallets.priceDisplay.primary!=="native-token",clientAnalyticsId:e.clientAnalyticsId,hideWalletUIs:Et,isHeadlessSigning:N.useCallback(Ke,[r.embeddedWallets.showWalletUIs]),emailOtpState:$,setEmailOtpState:O,smsOtpState:P,setSmsOtpState:j,oAuthState:D,setOAuthState:R,telegramAuthState:W,setTelegramAuthState:T,siweState:U,setSiweState:z,isHeadlessOAuthLoading:_,baseAccountSdk:f,setBaseAccountSdk:p,nativeTokenSymbolForChainId:K=>{var Q;return(Q=r.chains.find((le=>le.id===Number(K))))==null?void 0:Q.nativeCurrency.symbol},initializeWalletProxy:async K=>{if(L)return L;let Q=new Promise((ce=>{X.current=ce})),le=new Promise((ce=>setTimeout((()=>ce(null)),K))),ae=await Promise.race([Q,le]);return X.current=null,ae},getAuthFlow:()=>e.authFlow,getAuthMeta:()=>{var K;return(K=e.authFlow)==null?void 0:K.meta},client:e,closePrivyModal:async(K={shouldCallAuthOnSuccess:!0,isSuccess:!1})=>{var ye,Pe,Re,it;let Q,le=o&&pe&&u;if(le&&xe.current&&(Q=Tr(u)),Te.current==="login")K.shouldCallAuthOnSuccess&&le&&xe.current?je(se,"login","onComplete",{user:u,isNewUser:y,wasAlreadyAuthenticated:!1,loginMethod:xe.current,loginAccount:Q??null}):je(se,"login","onError",Oe.USER_EXITED_AUTH_FLOW);else if(Te.current==="link"&&Q)K.isSuccess&&le&&xe.current?je(se,"linkAccount","onSuccess",{user:u,linkMethod:xe.current,linkedAccount:Q}):xe.current&&je(se,"linkAccount","onError",Oe.USER_EXITED_LINK_FLOW,{linkMethod:xe.current});else if(Te.current==="update"&&Q)K.isSuccess&&le&&xe.current?je(se,"update","onSuccess",{user:u,updateMethod:xe.current,updatedAccount:Q}):xe.current&&je(se,"update","onError",Oe.USER_EXITED_UPDATE_FLOW,{linkMethod:xe.current});else if(Te.current==="connect-or-create"){let bt=tg();bt[0]?je(se,"connectOrCreateWallet","onSuccess",{wallet:bt[0]}):je(se,"connectOrCreateWallet","onError",Oe.USER_EXITED_AUTH_FLOW)}
1216let ae=b&&$A.has(b),ce=b==="ErrorScreen"&&F.errorModalData&&$A.has(F.errorModalData.previousScreen);if((ae||ce)&&F.funding){let bt,Ut=$A.get(b)??null;if(ce&&((ye=F.funding)!=null&&ye.onError)){let St=(Pe=F.errorModalData)==null?void 0:Pe.error,jt=(St==null?void 0:St.privyErrorCode)||Oe.UNKNOWN_FUNDING_ERROR,Hn=new ue((St==null?void 0:St.message)||"Funding failed",St,jt);(it=(Re=F.funding)==null?void 0:Re.onError)==null||it.call(Re,Hn)}if(F.funding.chainType==="solana"){let St=r.solanaRpcs[F.funding.chain];if(!St)return console.warn("Unable to load solana rpc, skipping balance"),je(se,"fundSolanaWallet","onUserExited",{address:F.funding.address,fundingMethod:Ut,chain:F.funding.chain,balance:bt}),s(!1),void $G(F.funding,Ut);if(R0(oit))try{bt=await upt({rpc:St.rpc,address:F.funding.address})}catch{console.error("Unable to pull wallet balance")}else console.warn("Unable to load solana plugin, skipping balance");je(se,"fundSolanaWallet","onUserExited",{address:F.funding.address,fundingMethod:Ut,chain:F.funding.chain,balance:bt})}else{let St=tv(F.funding.chain.id,r.chains,r.rpcConfig,{appId:t.appId});try{bt=await St.getBalance({address:F.funding.address})}catch{console.error("Unable to pull wallet balance")}je(se,"fundWallet","onUserExited",{address:F.funding.address,chain:F.funding.chain,fundingMethod:Ut,balance:bt}),$G(F.funding,Ut)}}q((bt=>({...bt,externalConnectWallet:{}}))),Te.current=null,xe.current=null,g(!1),s(!1),x({status:"disconnected",connectedWallet:null,connector:null,connectError:null,connectRetry:()=>{}}),setTimeout((()=>{e.authFlow=void 0}),200)},openPrivyModal:Ge,connectWallet:et,initLoginWithWallet:async(K,Q,le,ae)=>{Zd(K)?(xe.current="siwe",rn(K,Q,le)):(xe.current="siws",br(K,Q,le,ae))},loginWithWallet:async()=>{let K,Q,le;if(!o)throw new bh;if(e.authFlow instanceof qw?K="siwe":e.authFlow instanceof xG&&(K="siws"),!K)throw new ue("Must initialize SIWE/SIWS flow first.");if(await e.getAccessToken()!==null)try{({user:Q}=await e.link()),xe.current=K}catch(ae){throw je(se,"linkAccount","onError",ae.privyErrorCode||Oe.FAILED_TO_LINK_ACCOUNT,{linkMethod:K}),ae}else try{({user:Q,isNewUser:le}=await e.authenticate()),xe.current=K}catch(ae){throw je(se,"login","onError",ae.privyErrorCode||Oe.GENERIC_CONNECT_WALLET_ERROR),ae}dr(Q||u||null),g(le||!1),Ce(!0)},delegateWallet:async({address:K,chainType:Q,showDelegationUIs:le})=>new Promise((async(ae,ce)=>{let ye=await Xr();if(!pe||!u||!ye)throw new ue("User must be authenticated and have an embedded wallet to delegate actions.");if(Q!=="solana"&&Q!=="ethereum")throw new ue("Only Solana and Ethereum embedded wallets are supported for delegation and revocation.");let Pe=Ze.walletProxy??await Ze.initializeWalletProxy(15e3);if(!Pe)throw new ue("Wallet proxy not initialized.");if((({address:St,user:jt})=>!!kG(jt).find((Hn=>Hn.address===St)))({address:K,user:u}))return ae();let Re=x0(u,K);if(!Re)throw new ue("Address to delegate is not associated with current user.");if(Da(Re))throw new ue("useDelegatedActions is only supported for on-device execution and this app uses TEE execution. Use the useSessionSigners hook to provision server side access on behalf of your users. Learn more at https://docs.privy.io/recipes/tee-wallet-migration-guide");let it=npt({address:K,user:u}),bt=rpt({address:K,user:u}),Ut=async()=>{await Pe.createDelegatedAction({accessToken:ye,rootWallet:bt,delegatedWallets:[it]}),await Ze.refreshSessionAndUser()};if(await Ze.recoverEmbeddedWallet({address:K}),le)q({delegatedActions:{consent:{address:K,onDelegate:Ut,onSuccess:async()=>{ae()},onError:async St=>{ce(St)}}}}),Ge("DelegatedActionsConsentScreen");else try{await Ut(),ae()}catch(St){ce(St)}})),revokeDelegatedWallets:async({showDelegationUIs:K})=>new Promise((async(Q,le)=>{if(!pe||!u)throw new ue("User must be authenticated and have an embedded wallet to revoke a delegated wallet.");let ae=kG(u);
1216if(ae.length===0)throw new ue("User has no delegated wallets to revoke.");if(ae.some(Da))throw new ue("useDelegatedActions is only supported for on-device execution and this app uses TEE execution. Use the useSessionSigners hook to provision server side access on behalf of your users. Learn more at https://docs.privy.io/recipes/tee-wallet-migration-guide");let ce=async()=>{await e.revokeDelegatedWallet(),await Ze.refreshSessionAndUser()};if(K)q({delegatedActions:{revoke:{onRevoke:ce,onSuccess:async()=>{Q()},onError:async ye=>{le(ye)}}}}),Ge("DelegatedActionsRevokeScreen");else try{await ce(),Q()}catch(ye){le(ye)}})),initLoginWithFarcaster:async(K,Q)=>{let le=new _G(K,Q);e.startAuthFlow(le);try{xe.current="farcaster",await le.initializeFarcasterConnect()}catch(ae){throw Te.current==="login"?je(se,"login","onError",ae.privyErrorCode||Oe.UNKNOWN_AUTH_ERROR):Te.current==="link"&&je(se,"linkAccount","onError",ae.privyErrorCode||Oe.UNKNOWN_AUTH_ERROR,{linkMethod:"farcaster"}),ae}},loginWithFarcaster:async()=>{let K,Q;if(!o)throw new bh;if(!(e.authFlow instanceof _G))throw new ue("Must initialize Farcaster flow first.");if(await e.getAccessToken()!==null)try{({user:K}=await e.link()),xe.current="farcaster"}catch(le){throw je(se,"linkAccount","onError",le.privyErrorCode||Oe.FAILED_TO_LINK_ACCOUNT,{linkMethod:"farcaster"}),le}else try{({user:K,isNewUser:Q}=await e.authenticate()),xe.current="farcaster"}catch(le){throw je(se,"login","onError",le.privyErrorCode||Oe.UNKNOWN_AUTH_ERROR),le}dr(K||null),g(Q||!1),Ce(!0)},async crossAppAuthFlow({appId:K,popup:Q,action:le,disableSignup:ae}){let ce=`privy:${K}`;xe.current=ce;let{url:ye,stateCode:Pe,codeVerifier:Re}=await ilt({api:e.api,appId:K});if(!ye)throw e.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:"Unable to open cross-app auth popup",appId:K}}),new ue("No authorization URL returned for cross-app auth.");try{let it=await(async function({url:Hn,popup:ot}){return ot.location=Hn,new Promise(((Nn,Jn)=>{let Fr,lr=setTimeout((()=>{Jn(new ue("Authorization request timed out after 2 minutes.")),en()}),12e4);function en(){ot==null||ot.close(),window.removeEventListener("message",cr)}let Dn=setInterval((()=>{ot!=null&&ot.closed&&!Fr&&(en(),clearInterval(Dn),clearTimeout(lr),Jn(new ue("User rejected request")))}),300);function cr(zr){zr.data&&(zr.data.type==="PRIVY_OAUTH_RESPONSE"&&zr.data.stateCode&&zr.data.authorizationCode&&(clearTimeout(lr),Nn(zr.data),en()),zr.data.type==="PRIVY_OAUTH_ERROR"&&(clearTimeout(lr),Jn(new ue(zr.data.error)),en()),zr.data.type===LG&&((Fr=new BroadcastChannel(TG)).onmessage=cr))}window.addEventListener("message",cr)}))})({url:ye,popup:Q,provider:ce}),bt=it.stateCode,Ut=it.authorizationCode;if(bt!==Pe)throw e.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:ce,storedStateCode:Pe??"",returnedStateCode:bt??""}}),new ue("Unexpected auth flow. This may be a phishing attempt.",void 0,Oe.OAUTH_UNEXPECTED);let St=await slt({appId:K,codeVerifier:Re,stateCode:bt,authorizationCode:Ut,action:le,client:e,disableSignup:ae});St&&e.storeProviderAccessToken(K,St);let jt=await Ze.refreshSessionAndUser();if(!jt)throw new ue("Unable to update user");return e.createAnalyticsEvent({eventName:"cross_app_auth_completed",payload:{providerAppId:K}}),jt}catch(it){throw e.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:it.toString(),provider:ce}}),it}},async initLoginWithOAuth(K,Q,le){if(xe.current=K,!JT()||K==="google"&&!r.allowOAuthInEmbeddedBrowsers&&IG(window.navigator.userAgent))return void Ge("InAppBrowserLoginNotPossible");K==="twitter"&&window.opener&&window.opener.postMessage({type:LG},"*"),vt.del(X8),vt.del(Og);let ae=new E0({provider:K,disableSignup:!!le,withPrivyUi:!0,customOAuthRedirectUrl:r.customOAuthRedirectUrl});Q&&ae.addCaptchaToken(Q),e.startAuthFlow(ae);let ce=await e.authFlow.getAuthorizationUrl();if(ce&&ce.url)if(K==="twitter"&&El.isAndroid&&(ce.url=ce.url.replace("x.com","twitter.com")),window.location.protocol==="chrome-extension:"&&d$())try{let{privyOAuthCode:ye,privyOAuthState:Pe}=await qZ(ce.url);Ge("OAuthStatusScreen"),ae.meta.stateCode=Pe,ae.meta.authorizationCode=ye}catch(ye){throw console.error("OAuth in chrome extension flow failed:",ye),ye}else window.location.assign(ce.url)},async initLoginWithTelegram(K,Q){if(!o)throw new bh;xe.current="telegram";let le=new p0(K,Q);e.startAuthFlow(le),T({status:"loading"}),le.meta.telegramWebAppData=void 0,le.meta.telegramAuthResult=await new Promise(((ae,ce)=>r.loginConfig.telegramAuthConfiguration?window.Telegram?void window.Telegram.Login.auth({bot_id:r.loginConfig.telegramAuthConfiguration.botId,request_access:!0},(ye=>ye?ae(ye):(Te.current==="link"?je(se,"linkAccount","onError",Oe.FAILED_TO_LINK_ACCOUNT,{linkMethod:"telegram"}):Te.current==="login"?je(se,"login","onError",Oe.INVALID_CREDENTIALS):Te.current==="update"&&je(se,"login","onError",Oe.FAILED_TO_UPDATE_ACCOUNT),ce(new ue("Telegram auth failed or was canceled by the client"))))):ce(new ue("Telegram was not initialized")):ce(new ue("Telegram Auth configuration is not loaded"))))},async loginWithTelegram(K){var Pe;let Q,le;if(!(e.authFlow instanceof p0))throw new ue("Must initialize Telegram flow before calling loginWithTelegram");(Pe=e.authFlow.meta).captchaToken||(Pe.captchaToken=K==null?void 0:K.captchaToken);let ae=await Xr(),ce=(K==null?void 0:K.intent)||Te.current;if(ce==="login")try{let Re=await e.authenticate();Q=Re.user,le=Re.isNewUser,xe.current="telegram"}catch(Re){throw je(se,"login","onError",Re.privyErrorCode||Oe.UNKNOWN_AUTH_ERROR),Re}else{if(ce!=="link")throw new ue("Unknown auth intent");try{Q=(await e.link()).user,xe.current="telegram"}catch(Re){throw je(se,"linkAccount","onError",Re.privyErrorCode||Oe.FAILED_TO_LINK_ACCOUNT,{linkMethod:"telegram"}),Re}}dr(Q),g(le||!1),Ce(!0),T({status:"done"});let ye=(Q==null?void 0:Q.linkedAccounts.find((({type:Re})=>Re==="telegram")))||null;return{user:Q,isNewUser:le||!1,wasAlreadyAuthenticated:!!ae,loginAccount:ye}},async loginWithOAuth(K){let Q,le,ae;if(!(e.authFlow instanceof E0))throw new ue("Must initialize OAuth flow before calling loginWithOAuth");let ce=vt.get(J8),ye=e.authFlow.meta.stateCode;if(ce!==ye)throw e.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:K,storedStateCode:ce??"",returnedStateCode:ye??""}}),new ue("Unexpected auth flow. This may be a phishing attempt.",void 0,Oe.OAUTH_UNEXPECTED);if(await e.getAccessToken()!==null)try{let Pe=await e.link();Q=Pe.user,le=!1,ae=Pe.oAuthTokens,xe.current=K}catch(Pe){throw je(se,"linkAccount","onError",Pe.privyErrorCode||Oe.FAILED_TO_LINK_ACCOUNT,{linkMethod:K}),Pe}else try{let Pe=await e.authenticate();Q=Pe.user,le=Pe.isNewUser,ae=Pe.oAuthTokens,xe.current=K}catch(Pe){throw Te.current==="login"?je(se,"login","onError",Pe.privyErrorCode||Oe.UNKNOWN_AUTH_ERROR):Te.current==="link"&&je(se,"linkAccount","onError",Pe.privyErrorCode||Oe.FAILED_TO_LINK_ACCOUNT,{linkMethod:K}),Pe}return dr(Q),g(le||!1),Ce(!0),ae&&Q&&je(se,"oAuthAuthorization","onOAuthTokenGrant",{oAuthTokens:ae,user:Q}),ae},passkeyAuthState:A,setPasskeyAuthState:I,async initSignupWithPasskey({captchaToken:K,withPrivyUi:Q}){var ae;let le=new f0({captchaToken:K,setPasskeyAuthState:I,hints:(ae=r.passkeys.registration)==null?void 0:ae.hints});e.startAuthFlow(le),Te.current="login";try{xe.current="passkey",I({status:"generating-challenge"}),await le.initRegisterFlow(Q),I({status:"awaiting-passkey"})}catch(ce){throw I({status:"error",error:ce}),je(se,"login","onError",ce.privyErrorCode||Oe.UNKNOWN_AUTH_ERROR),ce}},async signupWithPasskey(){let K,Q;
1216if(!o)throw new bh;if(!(e.authFlow instanceof f0))throw new ue("Must initialize Passkey flow first.");if(xe.current!=="passkey"){let ce=new ue("Must init login with Passkey flow first.");throw I({status:"error",error:ce}),ce}let le=await Xr();try{xe.current="passkey",I({status:"awaiting-passkey"}),{user:K,isNewUser:Q}=await e.authenticate()}catch(ce){throw I({status:"error",error:ce}),je(se,"login","onError",ce.privyErrorCode||Oe.UNKNOWN_AUTH_ERROR),ce}dr(K),g(Q||!1),Ce(!0),I({status:"done"});let ae=(K==null?void 0:K.linkedAccounts.find((({type:ce})=>ce==="passkey")))||null;return{user:K,isNewUser:Q||!1,wasAlreadyAuthenticated:!!le,loginAccount:ae}},async initLoginWithPasskey({captchaToken:K,withPrivyUi:Q}){let le=new f0({captchaToken:K,setPasskeyAuthState:I,hints:void 0});e.startAuthFlow(le),Te.current="login";try{xe.current="passkey",I({status:"generating-challenge"}),await le.initAuthenticationFlow(Q),I({status:"awaiting-passkey"})}catch(ae){throw I({status:"error",error:ae}),je(se,"login","onError",ae.privyErrorCode||Oe.UNKNOWN_AUTH_ERROR),ae}},async loginWithPasskey(K){let Q,le;if(!o)throw new bh;if(!(e.authFlow instanceof f0))throw new ue("Must initialize Passkey flow first.");if(K!=null&&K.credentialIds&&(e.authFlow.meta.allowedCredentialsIds=K.credentialIds),xe.current!=="passkey"){let ye=new ue("Must init login with Passkey flow first.");throw I({status:"error",error:ye}),ye}let ae=await Xr();try{xe.current="passkey",I({status:"awaiting-passkey"}),{user:Q,isNewUser:le}=await e.authenticate()}catch(ye){throw I({status:"error",error:ye}),je(se,"login","onError",ye.privyErrorCode||Oe.UNKNOWN_AUTH_ERROR),ye}dr(Q),g(le||!1),Ce(!0),I({status:"done"});let ce=(Q==null?void 0:Q.linkedAccounts.find((({type:ye})=>ye==="passkey")))||null;return{user:Q,isNewUser:le||!1,wasAlreadyAuthenticated:!!ae,loginAccount:ce}},async initLinkWithPasskey(K){var le;let Q=new f0({captchaToken:K,hints:(le=r.passkeys.registration)==null?void 0:le.hints});e.startAuthFlow(Q),Te.current="link",xe.current="passkey",I({status:"generating-challenge"});try{await Q.initLinkFlow(),I({status:"awaiting-passkey"})}catch(ae){throw je(se,"linkAccount","onError",ae.privyErrorCode||Oe.UNKNOWN_AUTH_ERROR,{linkMethod:"passkey"}),I({status:"error",error:ae}),ae}},async linkWithPasskey(K){let Q;if(!o)throw new bh;if(!(e.authFlow instanceof f0))throw new ue("Must initialize Passkey flow first.");if(xe.current!=="passkey")throw new ue("Must init login with Passkey flow first.");try{xe.current="passkey",e.authFlow.meta.name=K==null?void 0:K.name,{user:Q}=await e.link()}catch(le){throw je(se,"linkAccount","onError",le.privyErrorCode||Oe.FAILED_TO_LINK_ACCOUNT,{linkMethod:"passkey"}),le}return dr(Q||u||null),I({status:"done"}),Q},async initLoginWithHeadlessOAuth(K,Q,le){if(!JT()||K==="google"&&!r.allowOAuthInEmbeddedBrowsers&&IG(window.navigator.userAgent))throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.");let ae=new E0({provider:K,withPrivyUi:!1,disableSignup:le??!1,customOAuthRedirectUrl:r.customOAuthRedirectUrl});Q&&ae.addCaptchaToken(Q),R({status:"loading"});let ce=await e.startAuthFlow(ae).getAuthorizationUrl();if(ce!=null&&ce.url)if(window.location.protocol==="chrome-extension:"&&d$())try{let{privyOAuthCode:ye,privyOAuthState:Pe}=await qZ(ce.url);ae.meta.stateCode=Pe,ae.meta.authorizationCode=ye,await wt(ae.meta)}catch(ye){throw R({status:"error",error:ye}),ye}else window.location.assign(ce.url)},loginWithHeadlessOAuth:wt,initLoginWithEmail:async({email:K,captchaToken:Q,disableSignup:le,withPrivyUi:ae})=>{let ce=new j0({email:K,captchaToken:Q,disableSignup:le});e.startAuthFlow(ce);try{xe.current="email",O({status:"sending-code"});let ye=await ce.sendCodeEmail({withPrivyUi:ae});if(ye!=null&&ye.ssoRedirectUrl)return window.location.href=ye.ssoRedirectUrl,void await nv(1e4);O({status:"awaiting-code-input"})}catch(ye){throw O({status:"error",error:ye}),Te.current==="login"?je(se,"login","onError",ye.privyErrorCode||Oe.UNKNOWN_AUTH_ERROR):Te.current==="link"&&je(se,"linkAccount","onError",ye.privyErrorCode||Oe.FAILED_TO_LINK_ACCOUNT,{linkMethod:"email"}),ye}},initUpdateEmail:async({oldAddress:K,newAddress:Q,captchaToken:le})=>{let ae=new Hrt(K,Q,le);e.startAuthFlow(ae);try{await ae.sendCodeEmail({withPrivyUi:!0})}catch(ce){throw je(se,"update","onError",ce.privyErrorCode||Oe.UNKNOWN_AUTH_ERROR,{linkMethod:xe.current}),ce}},initUpdatePhone:async(K,Q,le)=>{let ae=new qrt(K,Q,le);e.startAuthFlow(ae);try{await ae.sendSmsCode({withPrivyUi:!0})}catch(ce){je(se,"update","onError",ce.privyErrorCode||Oe.UNKNOWN_AUTH_ERROR,{linkMethod:xe.current})}},initLoginWithSms:async({phoneNumber:K,captchaToken:Q,disableSignup:le,withPrivyUi:ae})=>{j({status:"sending-code"});let ce=new M0({phoneNumber:K,captchaToken:Q,disableSignup:le});e.startAuthFlow(ce);try{xe.current="sms",await ce.sendSmsCode({withPrivyUi:ae}),j({status:"awaiting-code-input"})}catch(ye){throw j({status:"error",error:ye}),Te.current==="login"?je(se,"login","onError",ye.privyErrorCode||Oe.UNKNOWN_AUTH_ERROR):Te.current==="link"&&je(se,"linkAccount","onError",ye.privyErrorCode||Oe.FAILED_TO_LINK_ACCOUNT,{linkMethod:"sms"}),ye}},resendEmailCode:async()=>{var K;await((K=e.authFlow)==null?void 0:K.sendCodeEmail({withPrivyUi:!0}))},resendSmsCode:async()=>{var K;await((K=e.authFlow)==null?void 0:K.sendSmsCode({withPrivyUi:!0}))},loginWithCode:async K=>{let Q,le;function ae(Re){e.authFlow instanceof j0?O(Re):e.authFlow instanceof M0&&j(Re)}if(ae({status:"submitting-code"}),!o){let Re=new bh;throw ae({status:"error",error:Re}),Re}if(e.authFlow instanceof j0)e.authFlow.meta.emailCode=K.trim();else{if(!(e.authFlow instanceof M0)){let Re=new ue("Must initialize a passwordless code flow first");throw ae({status:"error",error:Re}),Re}e.authFlow.meta.smsCode=K.trim()}let ce=await Xr();if(Te.current==="link")try{({user:Q}=await e.link())}catch(Re){throw ae({status:"error",error:Re}),je(se,"linkAccount","onError",Re.privyErrorCode||Oe.FAILED_TO_LINK_ACCOUNT,{linkMethod:xe.current}),Re}else if(Te.current==="update")try{({user:Q}=await e.link())}catch(Re){throw ae({status:"error",error:Re}),je(se,"update","onError",Re.privyErrorCode||Oe.FAILED_TO_UPDATE_ACCOUNT,{linkMethod:xe.current}),Re}else try{({user:Q,isNewUser:le}=await e.authenticate())}catch(Re){throw ae({status:"error",error:Re}),je(se,"login","onError",Re.privyErrorCode||Oe.UNKNOWN_AUTH_ERROR),Re}let ye=Q||u;dr(ye||null),g(le||!1),Ce(!0),ae({status:"done"});let Pe=null;return e.authFlow instanceof j0?Pe=(ye==null?void 0:ye.linkedAccounts.find((({type:Re})=>Re==="email")))||null:e.authFlow instanceof M0&&(Pe=(ye==null?void 0:ye.linkedAccounts.find((({type:Re})=>Re==="phone")))||null),{user:ye,isNewUser:le||!1,wasAlreadyAuthenticated:!!ce,linkedAccount:Pe}},generateSiweMessage:async({address:K,chainId:Q,captchaToken:le})=>{Te.current=pe?"link":"login",xe.current="siwe",z({status:"generating-message"});let ae=await e.generateSiweNonce({address:K,captchaToken:le});return z({status:"awaiting-signature"}),h$({address:K,chainId:Q.replace("eip155:",""),nonce:ae})},generateSiweMessageForSmartWallet:async({address:K,chainId:Q})=>{let le=await e.generateSiweNonce({address:K});return h$({address:K,chainId:Q.replace("eip155:",""),nonce:le})},linkSmartWallet:async({message:K,signature:Q,smartWalletType:le,smartWalletVersion:ae})=>{let ce;ce=await e.linkSmartWallet({message:K,signature:Q,smartWalletType:le,smartWalletVersion:ae}
1216),dr((ce=await Ze.refreshSessionAndUser()??ce)||u||null)},loginWithSiwe:async({message:K,signature:Q,captchaToken:le,disableSignup:ae,walletClientType:ce,connectorType:ye})=>{let Pe,Re=null;try{if(u)throw Error("User already authenticated");let it=new qw(e,void 0,le,ae,{message:K,signature:Q,walletClientType:ce,connectorType:ye});if(e.startAuthFlow(it),xe.current="siwe",Te.current="login",z({status:"submitting-signature"}),{user:Re,isNewUser:Pe}=await e.authenticate(),!Re)throw Error("Authentication failed - no user returned")}catch(it){throw je(se,"login","onError",it.privyErrorCode||Oe.UNKNOWN_AUTH_ERROR),z({status:"error",error:it}),it}return dr(Re),g(Pe||!1),Ce(!0),z({status:"done"}),Te.current=null,xe.current=null,{user:Re,isNewUser:Pe||!1}},linkWithSiwe:async({message:K,signature:Q,chainId:le,walletClientType:ae,connectorType:ce})=>{let ye;$t("siwe");let Pe=null;try{z({status:"submitting-signature"}),ye=await e.linkWithSiwe({message:K,signature:Q,chainId:le,walletClientType:ae,connectorType:ce}),ye=await Ze.refreshSessionAndUser()??ye,z({status:"done"}),(Pe=Tr(ye)||null)&&je(se,"linkAccount","onSuccess",{user:ye,linkMethod:"siwe",linkedAccount:Pe})}catch(it){throw je(se,"linkAccount","onError",it.privyErrorCode||Oe.FAILED_TO_LINK_ACCOUNT,{linkMethod:"siwe"}),Te.current=null,xe.current=null,z({status:"error",error:it}),it}let Re=ye||u;return dr(Re||null),Te.current=null,xe.current=null,{user:Re,linkedAccount:Pe}},refreshSessionAndUser:async()=>{let K=await e.getAuthenticatedUser();return Ce(!!K),dr(K),K},walletProxy:L,createAnalyticsEvent:({eventName:K,payload:Q,timestamp:le})=>e.createAnalyticsEvent({eventName:K,payload:Q,timestamp:le}),acceptTerms:async()=>{let K=await e.acceptTerms();return dr(K),K},getUsdTokenPrice:K=>e.getUsdTokenPrice(K),getUsdPriceForSol:()=>e.getUsdPriceForSol(),getSplTokenMetadata:K=>e.getSplTokenMetadata(K),recoverEmbeddedWallet:async K=>new Promise((async(Q,le)=>{if(!u)return void Q(!0);let ae=K!=null&&K.address?x0(u,K.address):l6(u)||cO(u).at(0)||sre(u).at(0);if(!ae||Da(ae))return void Q(!0);let ce=await Xr();if(!ce||!L||!ae)return void le(Error("Must have valid access token and Privy wallet to recover wallet"));let{entropyId:ye,entropyIdVerifier:Pe}=a2(u,ae);try{await L.connect({accessToken:ce,entropyId:ye,entropyIdVerifier:Pe}),Q(!0)}catch(Re){if(Kv(Re)&&ae.recoveryMethod==="privy"){let it;e.createAnalyticsEvent({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:ae.address}});try{it=await L.recover({entropyId:ye,entropyIdVerifier:Pe,accessToken:ce})}catch(bt){return void le(bt)}it.entropyId||le(Error("Unable to recover wallet")),e.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:ae.address}}),Q(!0)}else Kv(Re)&&ae.recoveryMethod!=="privy"&&ae.recoveryMethod!=="privy-v2"?(q((it=>({...it,recoverWallet:{entropyId:ye,entropyIdVerifier:Pe,onFailure:le,onSuccess:()=>{Q(!0)},onCompleteNavigateTo:it.createWallet?"EmbeddedWalletOnAccountCreateScreen":void 0},recoveryOAuthStatus:{provider:ae.recoveryMethod,action:"recover",shouldCreateEth:!1,shouldCreateSol:!1,isInAccountCreateFlow:!!it.createWallet}}))),Ge(apt(ae.recoveryMethod))):le(Re)}})),setReadyToTrue:K=>{l(!0),G==null||G(K)},updateWallets:()=>ar(),fundWallet:async(K,Q)=>{let le="FundingMethodSelectionScreen";return new Promise(((ae,ce)=>{q({funding:{...uK({address:K,appConfig:r,fundWalletConfig:Q,methodScreen:le,onComplete:ae,onError:ce})}}),Ge(le)}))},openModal:Ge,requestFarcasterSignerStatus:async K=>{var ce;let Q=await Xr(),le=u==null?void 0:u.linkedAccounts.find((ye=>ye.type==="wallet"&&ye.walletClientType==="privy"));if(!Q)throw Error("Must have valid access token to connect with Farcaster");if(!L||!le)throw Error("Must have an embedded wallet to use Farcaster signers");if(!((ce=u==null?void 0:u.farcaster)!=null&&ce.fid))throw Error("Must have Farcaster account to use Farcaster signers");let ae=await e.requestFarcasterSignerStatus(K);return ae.status==="approved"&&dr(await e.getAuthenticatedUser()||u||null),ae},connectCoinbaseSmartWallet:async()=>{var Q,le;r.externalWallets.coinbaseWallet.config.preference={...r.externalWallets.coinbaseWallet.config.preference,options:"smartWalletOnly"};let K=((Q=e.connectors)==null?void 0:Q.findWalletConnector("coinbase_wallet","coinbase_smart_wallet"))||((le=e.connectors)==null?void 0:le.findWalletConnector("coinbase_wallet","coinbase_wallet"));if(K)return K.updateConnectionPreference("smartWalletOnly"),et(K);await ve("coinbase_wallet","coinbase_smart_wallet")},connectBaseAccount:async()=>{var Q;let K=(Q=e.connectors)==null?void 0:Q.findWalletConnector("base_account","base_account");if(K)return et(K);await ve("base_account","base_account")},initiateAccountTransfer:async({nonce:K,account:Q,accountType:le,externalWalletMetadata:ae,telegramAuthResult:ce,telegramWebAppData:ye,farcasterEmbeddedAddress:Pe,oAuthUserInfo:Re})=>
1216{let it=await e.sendAccountTransferRequest({nonce:K,account:Q,accountType:le,externalWalletMetadata:ae,telegramAuthResult:ce,telegramWebAppData:ye,farcasterEmbeddedAddress:Pe,oAuthUserInfo:Re});return dr(it),it},inProgressAuthFlowRef:Te,inProgressLoginOrLinkMethodRef:xe};Tue=Ze.recoverEmbeddedWallet,Ze.recoverEmbeddedWallet;let or=e.authFlow instanceof p0,{siteKey:bn,enabledProvider:Gt}=r.captcha,_t=!r.headless&&Gt&&!pe&&(o||or);return h.jsx(CP.Provider,{value:!0,children:h.jsx(Ku.Provider,{value:Ht,children:h.jsx(kle.Provider,{value:se,children:h.jsx(Mft,{appId:r.id,captchaSiteKey:bn,enabledCaptchaProvider:Gt,children:h.jsxs(rre.Provider,{value:Ze,children:[h.jsx(Nst,{children:h.jsxs(wst,{data:F,setModalData:q,setInitialScreen:v,initialScreen:b,authenticated:pe,open:i,children:[t.children,h.jsx(Spt,{customAuth:r.customAuth}),_t&&h.jsx(Bft,{delayedExecution:!1}),h.jsx(Yft,{}),h.jsx(Ipt,{}),h.jsx(mpt,{disabled:r.embeddedWallets.disableAutomaticMigration}),h.jsx(Fot,{palette:r.appearance.palette||{}}),!r.render.standalone&&h.jsx(qft,{open:i})]})}),h.jsx(tpt,{appId:t.appId,appClientId:t.clientId,clientAnalyticsId:e.clientAnalyticsId,origin:e.apiUrl,mfaMethods:u==null?void 0:u.mfaMethods,mfaPromise:te,mfaSubmitPromise:ie,onLoad:M,onLoadFailed:()=>null}),r.loginConfig.telegramHasHmacCredentials&&r.loginConfig.telegramAuthConfiguration&&h.jsx(Ile,{$if:!0,children:h.jsx(Gft,{scriptHost:t.apiUrl||ZT,botUsername:r.loginConfig.telegramAuthConfiguration.botName})})]})})})})})},Opt=(t,e)=>Eue(t,e),Ppt=(t,e)=>Sue(t,e),Rpt=(t,e)=>Aue(t,e),jpt=(t,e)=>kue(t,e),Mpt=t=>Tue(t),Dpt=({config:t,...e})=>{Cst(),(function(){if(typeof window>"u")return;let s=["localhost","127.0.0.1"].includes(window.location.hostname),a=window.location.protocol==="https:"||window.location.protocol==="chrome-extension:";if(!s&&!a)throw new ue("Embedded wallet is only available over HTTPS")})(),(function(s){if(typeof s!="string"||s.length!==25)throw new ue("Cannot initialize the Privy provider with an invalid Privy app ID")})(e.appId),Jrt(e);let n=N.useMemo((()=>new ZIe({appId:e.appId,clientId:e.clientId,storage:vt,baseUrl:e.apiUrl,sdkVersion:"react-auth:3.42.0"})),[]),r=Joe(),i=Object.assign({},t);return h.jsx(qNe,{client:n,legacyClient:r,appClientId:e.clientId,clientConfig:i,children:h.jsx(_rt,{configPlugins:t==null?void 0:t.plugins,children:h.jsx(Npt,{...e,client:r,privy:n})})})};function O4t(){let{promptMfa:t,init:e,submit:n,cancel:r,clear:i,mfaMethods:s}=N.useContext(Ku);return{promptMfa:t,init:e,submit:n,cancel:r,clear:i,mfaMethods:s}}function P4t(){let{initEnrollmentWithSms:t,initEnrollmentWithTotp:e,initEnrollmentWithPasskey:n,submitEnrollmentWithSms:r,submitEnrollmentWithTotp:i,submitEnrollmentWithPasskey:s,unenroll:a,enrollInMfa:o}=N.useContext(Ku);return{initEnrollmentWithSms:t,initEnrollmentWithTotp:e,initEnrollmentWithPasskey:n,submitEnrollmentWithSms:r,submitEnrollmentWithTotp:i,submitEnrollmentWithPasskey:s,unenrollWithSms:()=>a("sms"),unenrollWithTotp:()=>a("totp"),unenrollWithPasskey:l=>a("passkey",l),showMfaEnrollmentModal:()=>o(!0),closeMfaEnrollmentModal:()=>o(!1)}}const Upt=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_aed)",children:[h.jsx("path",{d:"M0 0H512V170.7H0V0Z",fill:"#00732F"}),h.jsx("path",{d:"M0 170.7H512V341.3H0V170.7Z",fill:"white"}),h.jsx("path",{d:"M0 341.3H512V512H0V341.3Z",fill:"#000001"}),h.jsx("path",{d:"M0 0H180V512H0V0Z",fill:"#FF0000"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_aed",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),Bpt=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_ars)",children:[h.jsx("path",{d:"M0 0H512V512H0V0Z",fill:"#74ACDF"}),h.jsx("path",{d:"M0 170.7H512V341.4H0V170.7Z",fill:"white"}),h.jsx("path",{d:"M256 284.4C271.685 284.4 284.4 271.684 284.4 256C284.4 240.315 271.685 227.6 256 227.6C240.315 227.6 227.6 240.315 227.6 256C227.6 271.684 240.315 284.4 256 284.4Z",fill:"#F6B40E"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_ars",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),Fpt=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_aud)",children:[h.jsx("path",{d:"M0 0H512V512H0V0Z",fill:"#00008B"}),h.jsx("path",{d:"M256 0V32L161 128L256 221.5V256H222.5L127 162L34 256H0V222L93 128.5L0 37V0H31L127 94L220 0H256Z",fill:"white"}),h.jsx("path",{d:"M0 104V152H256V104H0ZM104 0V256H152V0H104Z",fill:"#FF0000"}),h.jsx("path",{d:"M202 402.8L156.2 408.2L160.8 454.1L128 421.7L95.0001 453.9L99.9001 408L54.1001 402.2L93.0001 377.4L69.0001 338L112.6 353L128.4 309.6L143.9 353.1L187.6 338.4L163.3 377.6L202.1 402.7L202 402.8Z",fill:"white"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_aud",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),zpt=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_bdt)",children:[h.jsx("path",{d:"M0 0H512V512H0V0Z",fill:"#006A4E"}
1216),h.jsx("path",{d:"M230 426.7C324.275 426.7 400.7 350.275 400.7 256C400.7 161.725 324.275 85.2998 230 85.2998C135.725 85.2998 59.2998 161.725 59.2998 256C59.2998 350.275 135.725 426.7 230 426.7Z",fill:"#F42A41"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_bdt",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),Vpt=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_bgn)",children:[h.jsx("path",{d:"M0 0H512V170.7H0V0Z",fill:"white"}),h.jsx("path",{d:"M0 170.7H512V341.3H0V170.7Z",fill:"#00966E"}),h.jsx("path",{d:"M0 341.3H512V512H0V341.3Z",fill:"#D62612"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_bgn",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),Hpt=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_4989_138102)",children:[h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 0H512V512H0V0Z",fill:"#229E45"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M261.4 405.4L491.2 256.2L260 106.6L29.2998 256.6L261.4 405.4Z",fill:"#F8E509"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M361.5 256C361.904 269.02 359.687 28
12161.989 354.98 294.136C350.273 306.283 343.173 317.359 334.1 326.708C325.028 336.056 314.17 343.486 302.17 348.555C290.17 353.624 277.273 356.229 264.246 356.216C251.22 356.202 238.329 353.57 226.339 348.477C214.349 343.383 203.506 335.931 194.453 326.564C185.4 317.197 178.323 306.106 173.641 293.949C168.959 281.793 166.769 268.82 167.2 255.8C168.035 230.574 178.649 206.662 196.798 189.122C214.947 171.582 239.207 161.79 264.447 161.816C289.686 161.842 313.926 171.684 332.039 189.262C350.151 206.839 360.717 230.773 361.5 256Z",fill:"#2B49A3"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M232.3 314.2L229.3 312.4L226.2 314L226.9 310.5L224.5 308L227.9 307.6L229.5 304.4L231 307.7L234.4 308.3L231.8 310.7M297.5 330.7L294.5 328.9L291.3 330.5L292 327L289.6 324.5L293.1 324.1L294.7 320.9L296.1 324.2L299.5 324.8L297 327.2M269.4 304.3L266.8 302.8L264.1 304.1L264.7 301.1L262.7 298.9L265.6 298.6L267 295.9L268.2 298.7L271.2 299.2L269 301.2M335.2 294.8L332.6 293.3L330 294.6L330.6 291.7L328.6 289.6L331.5 289.2L332.8 286.6L334.1 289.3L337 289.8L334.8 291.8M268.2 275.1L265.2 273.3L262.1 274.9L262.8 271.4L260.4 268.9L263.8 268.5L265.4 265.4L266.9 268.6L270.3 269.2L267.7 271.6M188 245L185 243.2L182 244.8L182.6 241.3L180.2 238.8L183.7 238.4L185.3 235.2L186.7 238.5L190.1 239.1L187.6 241.5M197.7 285L194.7 283.3L191.6 284.8L192.3 281.4L189.9 278.8L193.3 278.4L194.9 275.4L196.4 278.5L199.8 279.2L197.2 281.5M297.8 230.2L295.2 228.7L292.4 230L293 227L291 224.7L294 224.4L295.4 221.6L296.7 224.5L299.7 225L297.4 227.1M292.4 256.3L290 255L287.9 256L288.3 253.6L286.7 251.9L289.1 251.6L290.2 249.4L291.2 251.7L293.6 252.1L291.8 253.7M183.4 292.2L181.4 291L179.3 292L179.7 289.7L178.1 288L180.5 287.8L181.5 285.8L182.5 287.8L184.8 288.3L183.1 289.9M335.7 301.4L334 300.6L332.3 301.3L332.7 299.6L331.4 298.3L333.3 298.1L334.2 296.6L334.9 298.2L336.8 298.5L335.4 299.7",fill:"#FFFFEF"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M183.5 292.3L181.5 291.1L179.4 292.1L179.9 289.8L178.2 288.1L180.5 287.9L181.6 285.9L182.6 287.9L184.9 288.4L183.2 290",fill:"#FFFFEF"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M183.5 292.3L181.5 291.1L179.4 292.1L179.9 289.8L178.2 288.1L180.5 287.9L181.6 285.9L182.6 287.9L184.9 288.4L183.2 290M215.4 292.3L213.4 291.1L211.4 292.1L211.8 289.8L210.2 288.1L212.5 287.9L213.5 285.8L214.5 287.9L216.8 288.4L215.1 290M211.4 303L209.4 301.8L207.4 302.8L207.8 300.5L206.2 298.8L208.5 298.5L209.5 296.5L210.5 298.5L212.8 299L211.1 300.6M277.8 283.6L275.8 282.4L273.7 283.4L274.1 281.1L272.5 279.4L274.8 279.2L275.9 277.1L276.9 279.2L279.1 279.6L277.4 281.2M258.3 283.6L256.3 282.4L254.2 283.4L254.7 281.1L253.1 279.4L255.4 279.2L256.4 277.1L257.4 279.2L259.7 279.6L258 281.2M205.5 276.8L204.3 276.1L203 276.7L203.2 275.2L202.2 274.2L203.7 274L204.4 272.7L204.9 274.1L206.4 274.3L205.4 275.3M333.2 310L331.2 308.9L329.1 309.9L329.6 307.6L328 305.9L330.3 305.6L331.3 303.6L332.3 305.6L334.6 306.1L332.9 307.7M316.9 312.1L315.3 311.1L313.6 312.1L314 310.1L312.6 308.7L314.6 308.5L315.4 306.8L316.2 308.5L318.2 308.9L316.7 310.2M324.7 312L323.1 311L321.5 311.9L321.8 310.1L320.6 308.8L322.4 308.6L323.2 307L323.9 308.6L325.7 308.9L324.4 310.2M346.6 292.8L345.1 291.9L343.5 292.7L343.9 291L342.7 289.7L344.4 289.5L345.2 288L345.9 289.6L347.6 289.9L346.3 291.1M317 322.9L315 321.8L313 322.8L313.5 320.6L311.9 319.1L314.1 318.8L315.2 316.9L316.2 318.9L318.3 319.3L316.7 320.7M317.1 331.6L315.3 330.6L313.5 331.5L313.9 329.3L312.5 327.8L314.5 327.5L315.5 325.6L316.3 327.6L318.3 328L316.8 329.4M302.3 312L300.8 311.1L299.2 311.9L299.6 310.1L298.4 308.9L300.1 308.7L300.9 307.1L301.6 308.7L303.3 309L302 310.2M288.5 312L287 311.1L285.4 311.9L285.8 310.1L284.6 308.9L286.3 308.7L287.1 307.1L287.8 308.7L289.5 309L288.3 310.2M265 291.4L263.5 290.5L261.9 291.3L262.3 289.6L261.1 288.3L262.8 288.1L263.6 286.6L264.3 288.2L266 288.5L264.7 289.6M267.6 333.1L266.3 332.4L265 333.1L265.3 331.6L264.3 330.6L265.7 330.3L266.4 329L267 330.4L268.5 330.6L267.4 331.6M232.2 265.6L229.2 263.9L226.1 265.4L226.8 262L224.4 259.4L227.8 259L229.4 255.9L230.9 259.1L234.3 259.7L231.7 262.1",fill:"#FFFFEF"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M355.1 291C356.981 286.097 358.453 281.046 359.5 275.9C307.9 230.5 250.3 207.2 177.5 212C174.892 217.096 172.75 222.418 171.1 227.9C204.497 224.527 238.23 228.41 269.987 239.284C301.745 250.157 330.778 267.765 355.1 290.9V291Z",fill:"white"}),h.jsx("path",{d:"M331.9 265.4L333.7 266.4C333.45 266.965 333.38 267.594 333.5 268.2C333.633 268.667 333.967 269.067 334.5 269.4C335.033 269.733 335.567 269.933 336.1 270C336.5 270 336.833 269.8 337.1 269.4C337.233 269.2 337.267 268.967 337.2 268.7L336.9 267.9L335.7 266.6C335.065 265.949 334.586 265.163 334.3 264.3C334.164 263.65 334.248 262.974 334.537 262.377C334.827 261.78 335.306 261.296 335.9 261C336.435 260.77 337.026 260.7 337.6 260.8C338.325 260.948 339.008 261.256 339.6 261.7C340.467 262.309 341.157 263.137 341.6 264.1C341.721 264.543 341.739 265.007 341.652 265.458C341.566 265.909 341.377 266.334 341.1 266.7L339.3 265.6C339.5 265.067 339.567 264.6 339.5 264.2C339.367 263.867 339.033 263.533 338.5 263.2C337.967 262.867 337.5 262.7 337.1 262.7L336.5 263L336.4 263.7C336.4 264.1 336.8 264.667 337.6 265.4L339.1 267.4C339.373 267.898 339.499 268.463 339.463 269.029C339.428 269.595 339.233 270.14 338.9 270.6C338.555 271.1 338.067 271.483 337.5 271.7C336.905 271.972 336.238 272.042 335.6 271.9C334.841 271.707 334.128 271.367 333.5 270.9C332.577 270.308 331.875 269.43 331.5 268.4C331.167 267.533 331.3 266.533 331.9 265.4ZM323.1 259.7L325.1 260.7C324.889 261.205 324.819 261.758 324.9 262.3C325.033 262.833 325.367 263.267 325.9 263.6C326.433 263.933 326.967 264.067 327.5 264C327.9 264 328.233 263.8 328.5 263.4L328.6 262.8C328.6 262.533 328.467 262.267 328.2 262L327 260.7C326.342 260.088 325.829 259.336 325.5 258.5C325.381 258.101 325.346 257.682 325.397 257.268C325.449 256.855 325.586 256.457 325.8 256.1C326.105 255.667 326.519 255.322 327 255.1C327.535 254.87 328.126 254.8 328.7 254.9C329.3 254.9 329.967 255.167 330.7 255.7C331.767 256.367 332.433 257.133 332.7 258C332.85 258.428 332.9 258.884 332.848 259.334C332.797 259.785 332.643 260.217 332.4 260.6L330.5 259.5C330.767 258.967 330.833 258.533 330.7 258.2C330.567 257.867 330.233 257.533 329.7 257.2C329.497 257.019 329.259 256.881 329.001 256.796C328.744 256.71 328.471 256.677 328.2 256.7L327.6 257.1V257.8C327.6 258.133 328 258.7 328.8 259.5C329.6 260.3 330.133 260.9 330.4 261.3C330.708 261.8 330.863 262.378 330.845 262.965C330.827 263.552 330.638 264.12 330.3 264.6C329.98 265.138 329.499 265.563 328.925 265.814C328.351 266.065 327.713 266.13 327.1 266C326.314 265.85 325.566 265.544 324.9 265.1C323.957 264.551 323.219 263.708 322.8 262.7C322.505 261.699 322.613 260.623 323.1 259.7ZM312.3 256.7L317.9 247.7L324.6 251.7L323.6 253.3L318.8 250.3L317.5 252.3L322.1 255.1L321.1 256.7L316.6 253.9L315.1 256.4L320.1 259.4L319.2 261L312.3 256.7ZM296.5 243.8L297.4 242.2L301.4 244.4L299.5 248.1C297.88 248.477 296.178 248.264 294.7 247.5C293.81 247.028 293.054 246.341 292.5 245.5C291.998 244.724 291.721 243.824 291.7 242.9C291.7 241.9 291.967 240.967 292.5 240.1C292.958 239.174 293.646 238.382 294.5 237.8C295.233 237.2 296.133 236.9 297.2 236.9C297.933 236.9 298.767 237.133 299.7 237.6C300.686 238.063 301.493 238.836 302 239.8C302.4 240.6 302.5 241.5 302.3 242.5L300.2 241.9C300.332 241.393 300.261 240.855 300 240.4C299.709 239.93 299.294 239.549 298.8 239.3C298.443 239.086 298.045 238.949 297.632 238.897C297.218 238.846 296.799 238.881 296.4 239C295.733 239.333 295.067 240 294.4 241C293.926 241.924 293.751 242.972 293.9 244C294.1 244.8 294.633 245.4 295.5 245.8L296.8 246.2H298.1L298.7 245L296.5 243.8ZM227.7 226.8L229.3 216.2L232.5 216.7L233.3 224.2L236.3 217.2L239.4 217.7L237.9 228.3L235.9 228L237.1 219.7L233.8 227.7L231.8 227.4L230.9 218.7L229.7 227.1L227.7 226.8ZM217 225.5L218 214.9L225.8 215.6L225.7 217.4L219.9 216.9L219.7 219.2L225 219.7L224.9 221.5L219.6 221L219.3 224L225.2 224.5L225 226.3L217 225.5Z",fill:"#309E3A"}),h.jsx("path",{d:"M181.4 218.8C181.4 217.733 181.567 216.833 181.9 216.1L182.9 214.7L184.4 213.7C185.14 213.451 185.921 213.349 186.7 213.4C187.394 213.395 188.082 213.535 188.719 213.811C189.356 214.086 189.928 214.491 190.4 215C191.333 216 191.767 217.333 191.7 219C191.7 220.8 191.2 222.133 190.2 223C189.699 223.48
12166 189.103 223.861 188.448 224.102C187.794 224.343 187.096 224.445 186.4 224.4C185.713 224.418 185.031 224.293 184.394 224.035C183.757 223.777 183.181 223.391 182.7 222.9C182.206 222.368 181.834 221.734 181.609 221.043C181.385 220.353 181.313 219.621 181.4 218.9V218.8Z",fill:"#309E3A"}),h.jsx("path",{d:"M183.6 218.8C183.6 220 183.867 220.933 184.4 221.6C184.933 222.267 185.6 222.6 186.4 222.6C186.809 222.608 187.215 222.532 187.593 222.377C187.971 222.222 188.314 221.992 188.6 221.7C189.133 221.1 189.433 220.2 189.5 219C189.5 217.667 189.233 216.733 188.7 216.2C188.187 215.621 187.471 215.263 186.7 215.2C185.7 215.2 184.967 215.5 184.5 216.1C183.9 216.7 183.567 217.6 183.5 218.8H183.6Z",fill:"#F7FFFF"}),h.jsx("path",{d:"M194 224.4L194.1 213.7H198.6C199.8 213.7 200.633 213.833 201.1 214.1C201.767 214.367 202.167 214.7 202.3 215.1C202.567 215.633 202.733 216.2 202.8 216.8C202.8 217.6 202.567 218.267 202.1 218.8C201.633 219.267 200.9 219.6 199.9 219.8C200.433 220 200.833 220.267 201.1 220.6L202.3 222.4L203.6 224.4H201L199.5 222.1L198.3 220.5L197.7 220.1L196.7 219.9H196.2V224.4H194Z",fill:"#309E3A"}),h.jsx("path",{d:"M196.2 218.2H199.8L200.3 217.7C200.5 217.5 200.6 217.233 200.6 216.9C200.6 216.567 200.5 216.267 200.3 216L199.5 215.6H196.3L196.2 218.2Z",fill:"white"}),h.jsx("path",{d:"M206.2 214.2L210.1 214.4L212.1 214.7C212.669 214.915 213.182 215.257 213.6 215.7C214.067 216.253 214.408 216.902 214.6 217.6C214.8 218.267 214.866 219.1 214.8 220.1C214.851 220.868 214.724 221.638 214.429 222.349C214.135 223.06 213.679 223.694 213.1 224.2C212.7 224.533 212.2 224.8 211.6 225H209.6L205.6 224.9L206.2 214.2Z",fill:"#309E3A"}),h.jsx("path",{d:"M208.199 216.1L207.899 223.1L209.499 223.3H210.799L211.699 222.8C211.966 222.6 212.166 222.267 212.299 221.8L212.599 219.8L212.499 218C212.366 217.533 212.166 217.2 211.899 217L210.899 216.4L209.199 216.2L208.199 216.1Z",fill:"white"}),h.jsx("path",{d:"M258.5 233.3L261 222.9L264.3 223.7C265.633 224.033 266.467 224.3 266.8 224.5C267.333 224.767 267.733 225.2 268 225.8C268.267 226.4 268.3 227.133 268.1 228C268.011 228.516 267.789 228.999 267.456 229.403C267.123 229.806 266.69 230.116 266.2 230.3L265.1 230.6L262.9 230.2L261.5 229.9L260.5 233.8L258.5 233.3Z",fill:"#309E3A"}),h.jsx("path",{d:"M262.6 225.2L261.9 228.2L263.1 228.4C263.9 228.6 264.467 228.667 264.8 228.6C265.077 228.572 265.339 228.461 265.553 228.283C265.767 228.105 265.922 227.867 266 227.6L265.9 226.5L265.1 225.8L263.6 225.4L262.6 225.2Z",fill:"white"}),h.jsx("path",{d:"M268.4 236.3L271.9 226.2L276.2 227.7L278.4 228.7C278.8 229.1 279.1 229.6 279.3 230.2C279.6 231.1 279.3 231.3 279.1 231.9C278.9 232.7 278.467 233.233 277.8 233.5C277.456 233.7 277.075 233.83 276.681 233.881C276.286 233.933 275.884 233.905 275.5 233.8L276.3 235L276.9 237L277.4 239.4L275 238.6L274.3 235.9L273.7 234L273.3 233.4L272.3 232.9L271.9 232.8L270.4 237L268.4 236.3Z",fill:"#309E3A"}),h.jsx("path",{d:"M272.4 231.2L273.9 231.7L275.8 232.2C276.067 232.2 276.3 232.133 276.5 232L277 231.3V230.3L276.4 229.7L274.9 229.2L273.3 228.6L272.4 231.2Z",fill:"white"}),h.jsx("path",{d:"M280.9 235.9C281.159 234.987 281.601 234.137 282.2 233.4C282.533 232.933 282.966 232.567 283.5 232.3L285.1 231.8C285.766 231.8 286.533 231.9 287.4 232.1C288.078 232.27 288.714 232.58 289.265 233.011C289.816 233.441 290.271 233.983 290.6 234.6C291.266 235.867 291.3 237.3 290.7 238.9C290.328 240.336 289.437 241.582 288.2 242.4C287.583 242.707 286.909 242.884 286.221 242.918C285.532 242.952 284.844 242.844 284.2 242.6C283.521 242.43 282.886 242.12 282.334 241.69C281.783 241.259 281.329 240.717 281 240.1C280.461 238.758 280.426 237.266 280.9 235.9Z",fill:"#309E3A"}),h.jsx("path",{d:"M283 236.5C282.667 237.567 282.667 238.5 283 239.3C283.333 240.1 283.933 240.633 284.8 240.9C285.6 241.1 286.333 241 287 240.6C287.667 240.2 288.233 239.4 288.7 238.2C288.967 237.067 288.967 236.1 288.7 235.3C288.516 234.942 288.262 234.625 287.952 234.367C287.643 234.109 287.285 233.917 286.9 233.8C286.516 233.695 286.115 233.667 285.72 233.719C285.325 233.77 284.944 233.9 284.6 234.1C283.933 234.5 283.4 235.3 283 236.5Z",fill:"white"}),h.jsx("path",{d:"M301.7 250.8L306.6 241.3L310.6 243.3C311.6 243.9 312.267 244.367 312.6 244.7C313 245.167 313.234 245.667 313.3 246.2C313.434 246.867 313.3 247.433 312.9 247.9C312.634 248.567 312.134 249.067 3
121611.4 249.4C310.734 249.6 309.967 249.567 309.1 249.3C309.367 249.7 309.567 250.133 309.7 250.6L310 252.7L310.2 255.2L307.9 254L307.6 251.2L307.3 249.2L306.9 248.6L306 248L305.6 247.8L303.6 251.8L301.7 250.8Z",fill:"#309E3A"}),h.jsx("path",{d:"M306.4 246.3L307.8 247L309.6 247.8C309.867 247.8 310.1 247.733 310.3 247.6C310.536 247.424 310.729 247.199 310.868 246.939C311.006 246.68 311.085 246.393 311.1 246.1L310.5 245.4L309.2 244.6L307.7 243.9L306.4 246.3Z",fill:"white"}),h.jsx("path",{d:"M341.2 270.3C341.733 269.367 342.4 268.7 343.2 268.3L344.8 267.6H346.4C347.133 267.667 347.867 268 348.6 268.6C349.191 268.961 349.7 269.44 350.096 270.008C350.492 270.577 350.766 271.221 350.9 271.9C351.045 273.355 350.654 274.813 349.8 276C349.001 277.275 347.751 278.203 346.3 278.6C345.623 278.727 344.927 278.712 344.256 278.557C343.585 278.402 342.953 278.111 342.4 277.7C341.809 277.339 341.299 276.86 340.903 276.291C340.507 275.723 340.234 275.079 340.1 274.4C339.926 272.957 340.281 271.5 341.1 270.3H341.2Z",fill:"#309E3A"}),h.jsx("path",{d:"M343 271.4C342.334 272.467 342.067 273.4 342.2 274.2C342.269 274.605 342.419 274.991 342.643 275.335C342.867 275.679 343.158 275.973 343.5 276.2C344.155 276.612 344.943 276.755 345.7 276.6C346.5 276.4 347.267 275.767 348 274.7C348.734 273.633 349 272.733 348.8 272C348.8 271.267 348.4 270.6 347.6 270C346.4 269.1 346.1 269.4 345.3 269.6C344.5 269.8 343.767 270.4 343.1 271.4H343Z",fill:"white"}),h.jsx("path",{d:"M246.4 229L248.1 221.4L253.7 222.7L253.4 224L249.4 223L249 224.7L252.7 225.6L252.4 226.9L248.7 225.9L248.2 228L252.4 229L252.1 230.3L246.4 229Z",fill:"#309E3A"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_4989_138102",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),Wpt=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_cad)",children:[h.jsx("path",{d:"M81.1001 0H443.4V512H81.1001V0Z",fill:"white"}),h.jsx("path",{d:"M-100 0H81.1V512H-100V0ZM443.4 0H624.5V512H443.4V0Z",fill:"#D52B1E"}),h.jsx("path",{d:"M135.3 247.4L121.3 252.2L186.7 309.7C191.7 324.5 185 328.8 180.7 336.6L251.7 327.6L249.9 399.1L264.7 398.6L261.4 327.7L332.6 336.1C328.2 326.8 324.3 321.9 328.3 307.1L393.7 252.6L382.3 248.5L257.4 101.4L135.3 247.5V247.4Z",fill:"#D52B1E"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_cad",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),qpt=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_chf)",children:[h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 0H512V512H0V0Z",fill:"#FF0000"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M96 208H416V304H96V208Z",fill:"white"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M208 96H304V416H208V96Z",fill:"white"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_chf",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),Zpt=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_clp)",children:[h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M255.805 0H767.486V255.805H255.805V0Z",fill:"white"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 0H255.805V255.805H0V0Z",fill:"#0039A6"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M167.721 191.547L128.011 161.872L88.6616 191.835L103.318 143.1L63.9692 112.993L112.632 112.56L127.794 63.9692L143.173 112.488H191.908L152.631 142.956L167.721 191.547Z",fill:"white"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 255.805H767.486V511.682H0V255.805Z",fill:"#D52B1E"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_clp",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),Kpt=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_cny)",children:[h.jsx("path",{d:"M0 0H512V512H0V0Z",fill:"#EE1C25"}),h.jsx("path",{d:"M204.8 104.96L74.2402 189.44L128 51.2002L174.08
1216189.44L51.2002 104.96H204.8Z",fill:"#FFFF00"}),h.jsx("path",{d:"M236.577 33.0493L283.098 55.8344L234.403 64.2012L265.969 27.3271L262.929 76.9066L236.577 33.0493Z",fill:"#FFFF00"}),h.jsx("path",{d:"M295.87 78.2082L329.881 117.326L281.736 106.078L325.192 84.3783L303.084 128.897L295.87 78.2082Z",fill:"#FFFF00"}),h.jsx("path",{d:"M306.574 152.531L321.655 202.153L282.279 172.21L330.834 170.145L292.454 201.774L306.574 152.531Z",fill:"#FFFF00"}),h.jsx("path",{d:"M266.01 205.632L260.775 257.178L236.032 214.4L281.575 231.219L234.01 245.568L266.01 205.632Z",fill:"#FFFF00"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_cny",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),Gpt=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_cop)",children:[h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 0H512V512H0V0Z",fill:"#FFE800"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 256H512V512H0V256Z",fill:"#00148E"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 384H512V512H0V384Z",fill:"#DA0010"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_cop",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),Ypt=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_czk)",children:[h.jsx("path",{d:"M0 0H512V256H0V0Z",fill:"white"}),h.jsx("path",{d:"M0 256H512V512H0V256Z",fill:"#D7141A"}),h.jsx("path",{d:"M300 256L0 56V456L300 256Z",fill:"#11457E"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_czk",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),Jpt=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_dkk)",children:[h.jsx("path",{d:"M0 0H512.1V512H0V0Z",fill:"#C8102E"}),h.jsx("path",{d:"M144 0H217.1V512H144V0Z",fill:"white"}),h.jsx("path",{d:"M0 219.4H512.1V292.6H0V219.4Z",fill:"white"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_dkk",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),Xpt=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_egp)",children:[h.jsx("path",{d:"M0 341.3H512V512H0V341.3Z",fill:"#000001"}),h.jsx("path",{d:"M0 170.7H512V341.3H0V170.7Z",fill:"white"}),h.jsx("path",{d:"M0 0H512V170.7H0V0Z",fill:"#CE1126"}),h.jsx("path",{d:"M256.681 258.047L315.134 312.319L310.953 213.759C310.355 198.826 297.385 202.239 287.913 207.615C278.441 213.759 267.433 213.759 255.998 209.749C244.478 213.759 233.555 213.759 224.084 207.615C214.697 202.239 201.641 198.826 201.044 213.759L196.862 312.319L256.681 258.047Z",fill:"white",stroke:"#C09300",strokeWidth:"1.10933",strokeLinejoin:"round"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_egp",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),Qpt=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_etb)",children:[h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-237.908 3.54639H799.515V501.338H-238.013L-237.908 3.54639Z",fill:"#FFC621"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-240 342.346H798.887V511.798H-240V342.346Z",fill:"#EF2118"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-237.908 -0.0102539H799.514V179.902H-237.908V-0.0102539Z",fill:"#298C08"}),h.jsx("path",{d:"M261.885 371.676C321.297 371.676 369.461 323.512 369.461 264.099C369.461 204.687 321.297 156.523 261.885 156.523C202.472 156.523 154.308 204.687 154.308 264.099C154.308 323.512 202.472 371.676 261.885 371.676Z",fill:"#006BC6"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_etb",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),e0t=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_4989_138368)",children:[h.jsx("path",{d:"M0 0H512V512H0V0Z",fill:"#003399"}
1216),h.jsx("path",{d:"M255.999 81.4124L248.414 106.696L261.056 109.225L255.999 81.4124Z",fill:"#FFCC00"}),h.jsx("path",{d:"M255.999 81.4124L263.584 106.696L250.942 109.225L255.999 81.4124Z",fill:"#FFCC00"}),h.jsx("path",{d:"M280.046 98.8831L253.656 99.4824L255.158 112.287L280.046 98.8831Z",fill:"#FFCC00"}),h.jsx("path",{d:"M280.046 98.8831L258.343 113.91L252.032 102.668L280.046 98.8831Z",fill:"#FFCC00"}),h.jsx("path",{d:"M270.861 127.151L262.136 102.238L250.422 107.623L270.861 127.151Z",fill:"#FFCC00"}),h.jsx("path",{d:"M270.86 127.151L249.862 111.155L258.604 101.678L270.86 127.151Z",fill:"#FFCC00"}),h.jsx("path",{d:"M231.953 98.8831L258.343 99.4824L256.841 112.287L231.953 98.8831Z",fill:"#FFCC00"}),h.jsx("path",{d:"M231.953 98.8831L253.655 113.91L259.967 102.668L231.953 98.8831Z",fill:"#FFCC00"}),h.jsx("path",{d:"M241.138 127.151L249.863 102.238L261.576 107.623L241.138 127.151Z",fill:"#FFCC00"}),h.jsx("path",{d:"M241.138 127.151L262.136 111.155L253.395 101.678L241.138 127.151Z",fill:"#FFCC00"}),h.jsx("path",{d:"M255.999 384.82L248.414 410.104L261.056 412.632L255.999 384.82Z",fill:"#FFCC00"}),h.jsx("path",{d:"M255.999 384.82L263.584 410.104L250.942 412.632L255.999 384.82Z",fill:"#FFCC00"}),h.jsx("path",{d:"M280.046 402.291L253.656 402.89L255.158 415.694L280.046 402.291Z",fill:"#FFCC00"}),h.jsx("path",{d:"M280.046 402.291L258.343 417.318L252.032 406.076L280.046 402.291Z",fill:"#FFCC00"}),h.jsx("path",{d:"M270.862 430.559L262.137 405.645L250.423 411.031L270.862 430.559Z",fill:"#FFCC00"}),h.jsx("path",{d:"M270.861 430.559L249.863 414.562L258.604 405.086L270.861 430.559Z",fill:"#FFCC00"}),h.jsx("path",{d:"M231.953 402.291L258.343 402.89L256.841 415.694L231.953 402.291Z",fill:"#FFCC00"}),h.jsx("path",{d:"M231.953 402.291L253.655 417.318L259.967 406.076L231.953 402.291Z",fill:"#FFCC00"}),h.jsx("path",{d:"M241.138 430.559L249.863 405.645L261.576 411.031L241.138 430.559Z",fill:"#FFCC00"}),h.jsx("path",{d:"M241.138 430.559L262.136 414.562L253.395 405.086L241.138 430.559Z",fill:"#FFCC00"}),h.jsx("path",{d:"M104.296 233.116L96.7109 258.4L109.353 260.928L104.296 233.116Z",fill:"#FFCC00"}),h.jsx("path",{d:"M104.296 233.116L111.881 258.4L99.2394 260.928L104.296 233.116Z",fill:"#FFCC00"}),h.jsx("path",{d:"M128.342 250.587L101.952 251.186L103.454 263.991L128.342 250.587Z",fill:"#FFCC00"}),h.jsx("path",{d:"M128.343 250.587L106.64 265.614L100.329 254.372L128.343 250.587Z",fill:"#FFCC00"}),h.jsx("path",{d:"M119.157 278.855L110.432 253.942L98.7187 259.327L119.157 278.855Z",fill:"#FFCC00"}),h.jsx("path",{d:"M119.158 278.855L98.1595 262.858L106.901 253.382L119.158 278.855Z",fill:"#FFCC00"}),h.jsx("path",{d:"M80.2498 250.587L106.64 251.186L105.138 263.991L80.2498 250.587Z",fill:"#FFCC00"}),h.jsx("path",{d:"M80.2497 250.587L101.952 265.614L108.263 254.372L80.2497 250.587Z",fill:"#FFCC00"}),h.jsx("path",{d:"M89.4349 278.855L98.1599 253.942L109.874 259.327L89.4349 278.855Z",fill:"#FFCC00"}),h.jsx("path",{d:"M89.4347 278.855L110.433 262.858L101.691 253.382L89.4347 278.855Z",fill:"#FFCC00"}),h.jsx("path",{d:"M167.148 148.621L188.146 132.625L179.404 123.149L167.148 148.621Z",fill:"#FFCC00"}),h.jsx("path",{d:"M167.148 148.622L175.873 123.708L187.586 129.093L167.148 148.622Z",fill:"#FFCC00"}),h.jsx("path",{d:"M157.963 120.353L179.665 135.38L185.976 124.138L157.963 120.353Z",fill:"#FFCC00"}),h.jsx("path",{d:"M157.963 120.353L184.353 120.952L182.851 133.757L157.963 120.353Z",fill:"#FFCC00"}),h.jsx("path",{d:"M182.009 102.882L174.424 128.166L187.066 130.695L182.009 102.882Z",fill:"#FFCC00"}),h.jsx("path",{d:"M182.009 102.882L189.594 128.166L176.952 130.695L182.009 102.882Z",fill:"#FFCC00"}),h.jsx("path",{d:"M196.871 148.621L175.873 132.625L184.614 123.149L196.871 148.621Z",fill:"#FFCC00"}),h.jsx("path",{d:"M196.871 148.622L188.146 123.708L176.432 129.093L196.871 148.622Z",fill:"#FFCC00"}),h.jsx("path",{d:"M206.056 120.353L184.353 135.38L178.042 124.138L206.056 120.353Z",fill:"#FFCC00"}),h.jsx("path",{d:"M206.056 120.353L179.665 120.952L181.167 133.757L206.056 120.353Z",fill:"#FFCC00"}),h.jsx("path",{d:"M140.628 204.864L131.903 179.951L120.189 185.336L140.628 204.864Z",fill:"#FFCC00"}),h.jsx("path",{d:"M140.628 204.864L119.63 188.868L128.371 179.391L140.628 204.864Z",fill:"#FFCC00"}),h.jsx("path",{d:"M110.904 204.864L131.903 188.868L123.161 179.391L110.904 204.864Z",fill:"#FFCC00"}),h.jsx("path",{d:"M110.905 204.864L119.63 179.951L131.343 185.336L110.905 204.864Z",fill:"#FFCC00"}),h.jsx("path",{d:"M101.719 176.596L123.422 191.623L129.733 180.381L101.719 176.596Z",fill:"#FFCC00"}),h.jsx("path",{d:"M101.72 176.596L128.11 177.195L126.608 190L101.72 176.596Z",fill:"#FFCC00"}),h.jsx("path",{d:"M149.813 176.596L128.11 191.623L121.799 180.381L149.813 176.596Z",fill:"#FFCC00"}),h.jsx("path",{d:"M149.813 176.596L123.422 177.195L124.924 190L149.813 176.596Z",fill:"#FFCC00"}),h.jsx("path",{d:"M125.766 159.125L133.352 184.409L120.71 186.938L125.766 159.125Z",fill:"#FFCC00"}),h.jsx("path",{d:"M125.766 159.125L118.181 184.409L130.823 186.938L125.766 159.125Z",fill:"#FFCC00"}),h.jsx("path",{d:"M149.841 328.664L123.45 329.263L124.952 342.067L149.841 328.664Z",fill:"#FFCC00"}),h.jsx("path",{d:"M149.841 328.664L128.138 343.691L121.827 332.449L149.841 328.664Z",fill:"#FFCC00"}),h.jsx("path",{d:"M140.656 356.932L131.931 332.018L120.217 337.403L140.656 356.932Z",fill:"#FFCC00"}),h.jsx("path",{d:"M140.656 356.932L119.658 340.935L128.399 331.459L140.656 356.932Z",fill:"#FFCC00"}),h.jsx("path",{d:"M110.933 356.932L131.931 340.935L123.189 331.459L110.933 356.932Z",fill:"#FFCC00"}),h.jsx("path",{d:"M110.933 356.932L119.658 332.018L131.372 337.404L110.933 356.932Z",fill:"#FFCC00"}),h.jsx("path",{d:"M125.794 311.193L133.379 336.477L120.737 339.005L125.794 311.193Z",fill:"#FFCC00"}),h.jsx("path",{d:"M125.794 311.193L118.209 336.477L130.851 339.005L125.794 311.193Z",fill:"#FFCC00"}),h.jsx("path",{d:"M101.748 328.664L128.138 329.263L126.636 342.067L101.748 328.664Z",fill:"#FFCC00"}),h.jsx("path",{d:"M101.748 328.664L123.45 343.691L129.762 332.449L101.748 328.664Z",fill:"#FFCC00"}),h.jsx("path",{d:"M204.716 379.555L178.325 380.154L179.827 392.958L204.716 379.555Z",fill:"#FFCC00"}),h.jsx("path",{d:"M204.716 379.554L183.013 394.582L176.702 383.34L204.716 379.554Z",fill:"#FFCC00"}),h.jsx("path",{d:"M195.531 407.823L186.806 382.909L175.092 388.294L195.531 407.823Z",fill:"#FFCC00"}),h.jsx("path",{d:"M195.531 407.823L174.533 391.826L183.274 382.35L195.531 407.823Z",fill:"#FFCC00"}),h.jsx("path",{d:"M165.808 407.823L186.806 391.826L178.064 382.35L165.808 407.823Z",fill:"#FFCC00"}),h.jsx("path",{d:"M165.808 407.823L174.533 382.909L186.247 388.294L165.808 407.823Z",fill:"#FFCC00"}),h.jsx("path",{d:"M180.669 362.084L188.254 387.368L175.612 389.896L180.669 362.084Z",fill:"#FFCC00"}),h.jsx("path",{d:"M180.669 362.084L173.084 387.368L185.726 389.896L180.669 362.084Z",fill:"#FFCC00"}),h.jsx("path",{d:"M156.623 379.555L183.013 380.154L181.511 392.958L156.623 379.555Z",fill:"#FFCC00"}),h.jsx("path",{d:"M156.623 379.554L178.325 394.582L184.637 383.34L156.623 379.554Z",fill:"#FFCC00"}),h.jsx("path",{d:"M407.703 233.116L415.288 258.4L402.646 260.928L407.703 233.116Z",fill:"#FFCC00"}),h.jsx("path",{d:"M407.703 233.116L400.118 258.4L412.76 260.928L407.703 233.116Z",fill:"#FFCC00"}),h.jsx("path",{d:"M383.656 250.587L410.046 251.186L408.545 263.991L383.656 250.587Z",fill:"#FFCC00"}),h.jsx("path",{d:"M383.656 250.587L405.359 265.614L411.67 254.372L383.656 250.587Z",fill:"#FFCC00"}),h.jsx("path",{d:"M392.841 278.855L401.566 253.941L413.279 259.327L392.841 278.855Z",fill:"#FFCC00"}),h.jsx("path",{d:"M392.841 278.855L413.839 262.858L405.098 253.382L392.841 278.855Z",fill:"#FFCC00"}),h.jsx("path",{d:"M431.749 250.587L405.359 251.186L406.861 263.991L431.749 250.587Z",fill:"#FFCC00"}),h.jsx("path",{d:"M431.749 250.587L410.046 265.614L403.735 254.372L431.749 250.587Z",fill:"#FFCC00"}),h.jsx("path",{d:"M422.565 278.855L413.84 253.941L402.126 259.327L422.565 278.855Z",fill:"#FFCC00"}),h.jsx("path",{d:"M422.564 278.855L401.566 262.858L410.308 253.382L422.564 278.855Z",fill:"#FFCC00"}),h.jsx("path",{d:"M344.852 148.621L323.854 132.625L332.596 123.149L344.852 148.621Z",fill:"#FFCC00"}),h.jsx("path",{d:"M344.852 148.622L336.127 123.708L324.413 129.093L344.852 148.622Z",fill:"#FFCC00"}),h.jsx("path",{d:"M354.037 120.353L332.334 135.38L326.023 124.138L354.037 120.353Z",fill:"#FFCC00"}),h.jsx("path",{d:"M354.036 120.353L327.646 120.952L329.148 133.757L354.036 120.353Z",fill:"#FFCC00"}),h.jsx("path",{d:"M329.99 102.882L337.575 128.166L324.933 130.695L329.99 102.882Z",fill:"#FFCC00"}),h.jsx("path",{d:"M329.99 102.882L322.405 128.166L335.047 130.695L329.99 102.882Z",fill:"#FFCC00"}),h.jsx("path",{d:"M315.129 148.621L336.127 132.625L327.386 123.148L315.129 148.621Z",fill:"#FFCC00"}),h.jsx("path",{d:"M315.13 148.621L323.855 123.708L335.568 129.093L315.13
1216148.621Z",fill:"#FFCC00"}),h.jsx("path",{d:"M305.945 120.353L327.647 135.38L333.958 124.138L305.945 120.353Z",fill:"#FFCC00"}),h.jsx("path",{d:"M305.945 120.353L332.336 120.952L330.834 133.757L305.945 120.353Z",fill:"#FFCC00"}),h.jsx("path",{d:"M371.372 204.864L380.097 179.951L391.811 185.336L371.372 204.864Z",fill:"#FFCC00"}),h.jsx("path",{d:"M371.372 204.864L392.37 188.868L383.629 179.391L371.372 204.864Z",fill:"#FFCC00"}),h.jsx("path",{d:"M401.096 204.864L380.097 188.867L388.839 179.391L401.096 204.864Z",fill:"#FFCC00"}),h.jsx("path",{d:"M401.095 204.864L392.37 179.951L380.656 185.336L401.095 204.864Z",fill:"#FFCC00"}),h.jsx("path",{d:"M410.28 176.596L388.578 191.623L382.266 180.381L410.28 176.596Z",fill:"#FFCC00"}),h.jsx("path",{d:"M410.279 176.596L383.889 177.195L385.391 190L410.279 176.596Z",fill:"#FFCC00"}),h.jsx("path",{d:"M362.187 176.596L383.889 191.623L390.2 180.381L362.187 176.596Z",fill:"#FFCC00"}),h.jsx("path",{d:"M362.187 176.596L388.578 177.195L387.076 190L362.187 176.596Z",fill:"#FFCC00"}),h.jsx("path",{d:"M386.234 159.125L378.648 184.409L391.29 186.938L386.234 159.125Z",fill:"#FFCC00"}),h.jsx("path",{d:"M386.233 159.125L393.818 184.409L381.176 186.938L386.233 159.125Z",fill:"#FFCC00"}),h.jsx("path",{d:"M362.159 328.664L388.549 329.263L387.047 342.067L362.159 328.664Z",fill:"#FFCC00"}),h.jsx("path",{d:"M362.159 328.664L383.862 343.691L390.173 332.449L362.159 328.664Z",fill:"#FFCC00"}),h.jsx("path",{d:"M371.344 356.932L380.069 332.018L391.782 337.404L371.344 356.932Z",fill:"#FFCC00"}),h.jsx("path",{d:"M371.344 356.932L392.342 340.935L383.601 331.459L371.344 356.932Z",fill:"#FFCC00"}),h.jsx("path",{d:"M401.066 356.932L380.068 340.935L388.81 331.459L401.066 356.932Z",fill:"#FFCC00"}),h.jsx("path",{d:"M401.066 356.932L392.341 332.018L380.627 337.403L401.066 356.932Z",fill:"#FFCC00"}),h.jsx("path",{d:"M386.205 311.193L378.62 336.477L391.262 339.005L386.205 311.193Z",fill:"#FFCC00"}),h.jsx("path",{d:"M386.205 311.193L393.79 336.477L381.148 339.005L386.205 311.193Z",fill:"#FFCC00"}),h.jsx("path",{d:"M410.252 328.664L383.862 329.263L385.364 342.068L410.252 328.664Z",fill:"#FFCC00"}),h.jsx("path",{d:"M410.252 328.664L388.549 343.691L382.238 332.449L410.252 328.664Z",fill:"#FFCC00"}),h.jsx("path",{d:"M307.284 379.555L333.674 380.154L332.172 392.958L307.284 379.555Z",fill:"#FFCC00"}),h.jsx("path",{d:"M307.284 379.554L328.987 394.582L335.298 383.34L307.284 379.554Z",fill:"#FFCC00"}),h.jsx("path",{d:"M316.469 407.823L325.194 382.909L336.907 388.294L316.469 407.823Z",fill:"#FFCC00"}),h.jsx("path",{d:"M316.469 407.823L337.467 391.826L328.726 382.35L316.469 407.823Z",fill:"#FFCC00"}),h.jsx("path",{d:"M346.191 407.823L325.193 391.826L333.935 382.35L346.191 407.823Z",fill:"#FFCC00"}),h.jsx("path",{d:"M346.191 407.823L337.466 382.909L325.752 388.294L346.191 407.823Z",fill:"#FFCC00"}),h.jsx("path",{d:"M331.33 362.084L323.745 387.368L336.387 389.896L331.33 362.084Z",fill:"#FFCC00"}),h.jsx("path",{d:"M331.33 362.084L338.915 387.368L326.273 389.896L331.33 362.084Z",fill:"#FFCC00"}),h.jsx("path",{d:"M355.377 379.555L328.987 380.154L330.489 392.958L355.377 379.555Z",fill:"#FFCC00"}),h.jsx("path",{d:"M355.377 379.554L333.674 394.582L327.363 383.34L355.377 379.554Z",fill:"#FFCC00"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_4989_138368",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),t0t=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_4989_138137)",children:[h.jsx("path",{d:"M0 0H512V512H0V0Z",fill:"#012169"}),h.jsx("path",{d:"M512 0V64L322 256L512 443V512H445L254 324L68 512H0V444L186 257L0 74V0H62L254 188L440 0H512Z",fill:"white"}),h.jsx("path",{d:"M184 324L195 358L42 512H0V509L184 324ZM308 312L362 320L512 467V512L308 312ZM512 0L320 196L316 152L466 0H512ZM0 1L193 190L134 182L0 49V1Z",fill:"#C8102E"}),h.jsx("path",{d:"M176 0V512H336V0H176ZM0 176V336H512V176H0Z",fill:"white"}),h.jsx("path",{d:"M0 208V304H512V208H0ZM208 0V512H304V0H208Z",fill:"#C8102E"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_4989_138137",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),n0t=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_hkd)",children:[h.jsx("path",{d:"M0 0H512V512H0",fill:"#EC1B2E"}),h.jsx("path",{d:"M282.3 119.2C203 114 166.6 218 241.6 256.4C215.6 234 221 201 231.5 184L233.4 185C219.6 208.6 222.2 237.8 244.4 256C231.8 243.8 235 217 256.6 207.2C278.2 197.4 280.2 167.9 273 158.1C263.2 141.033 266.3 128.033 282.3 119.1V119.2Z",fill:"white"}),h.jsx("path",{d:"M392.378 248.29C372.818 171.265 262.66 168.784 249.316 251.98C262.585 220.33 295.639 215.268 315.052 220.001L314.688 222.117C287.978 216.285 261.011 227.781 250.562 254.519C258.271 238.766 284.748 233.527 300.743 251.042C316.738 268.556 345.413 261.342 352.508 251.466C365.711 236.872 379.033 235.803 392.473 248.259L392.378 248.29Z",fill:"white"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_hkd",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),r0t=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_huf)",children:[h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M512 512H0V0H512V512Z",fill:"white"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M512 512H0V341.3H512V512Z",fill:"#388D00"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M512 170.8H0V0.100098H512V170.8Z",fill:"#D43516"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_huf",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),i0t=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_idr)",children:[h.jsx("path",{d:"M0 0H512V256H0V0Z",fill:"#E70011"}),h.jsx("path",{d:"M0 256H512V512H0V256Z",fill:"white"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_idr",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),s0t=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_ils)",children:[h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M619.4 512H-112V0H619.4V512Z",fill:"white"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M619.4 115.2H-112V48H619.4V115.2ZM619.4 465.7H-112V398.5H619.4V465.7ZM136.4 190.7L246.5 382.3L359 191.6L136.4 190.7Z",fill:"#0038B8"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M136 320.6L246.2 129L358.6 319.8L136 320.6Z",fill:"#0038B8"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_ils",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),a0t=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_inr)",children:[h.jsx("path",{d:"M0 0H512V170.7H0V0Z",fill:"#FF9933"}),h.jsx("path",{d:"M0 170.7H512V341.3H0V170.7Z",fill:"white"}),h.jsx("path",{d:"M0 341.3H512V512H0V341.3Z",fill:"#128807"}),h.jsx("path",{d:"M256 324.267C293.703 324.267 324.267 293.703 324.267 256C324.267 218.297 293.703 187.733 256 187.733C218.297 187.733 187.733 218.297 187.733 256C187.733 293.703 218.297 324.267 256 324.267Z",fill:"#000088"}),h.jsx("path",{d:"M255.999 267.947C262.597 267.947 267.946 262.598 267.946 256C267.946 249.402 262.597 244.053 255.999 244.053C249.401 244.053 244.053 249.402 244.053 256C244.053 262.598 249.401 267.947 255.999 267.947Z",fill:"#000088"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_inr",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),o0t=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_jpy)",children:[h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-128 0H640.007V512.029H-128V0Z",fill:"white"}),h.jsx("path",{d:"M256.009 415.199C343.904 415.199 415.156 343.947 415.156 256.052C415.156 168.157 343.904 96.9048 256.009 96.9048
1216C168.114 96.9048 96.8618 168.157 96.8618 256.052C96.8618 343.947 168.114 415.199 256.009 415.199Z",fill:"#BC002D"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_jpy",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),l0t=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_kes)",children:[h.jsx("path",{d:"M0 0H512V512H0V0Z",fill:"white"}),h.jsx("path",{d:"M0 0H512V153.6H0V0Z",fill:"#000001"}),h.jsx("path",{d:"M0 358.4H512V512H0V358.4Z",fill:"#006600"}),h.jsx("path",{d:"M255.8 102.4C236.6 102.4 204.6 153.6 195 179.2H0V332.8H195C204.7 358.4 236.7 409.6 255.9 409.6C275.1 409.6 307.1 358.4 316.7 332.8H512V179.2H316.6C307 153.6 275 102.4 255.8 102.4Z",fill:"#BB0000"}),h.jsx("path",{d:"M255.8 275.2C262.869 275.2 268.6 266.604 268.6 256C268.6 245.396 262.869 236.8 255.8 236.8C248.731 236.8 243 245.396 243 256C243 266.604 248.731 275.2 255.8 275.2Z",fill:"white"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_kes",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),c0t=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_krw)",children:[h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 0H512V512H0V0Z",fill:"white"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21.9756 167.546L84.3956 73.9515L99.9947 84.3549L37.5747 177.95L21.9756 167.546ZM45.3743 183.151L107.794 89.5565L123.393 99.9599L60.9734 193.555L45.3743 183.151ZM68.773 198.756L131.193 105.162L146.792 115.565L84.3721 209.16L68.773
1216198.756Z",fill:"#000001"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M365.156 396.42L427.576 302.825L443.175 313.228L380.755 406.823L365.156 396.42ZM388.555 412.025L450.975 318.43L466.574 328.833L404.154 422.428L388.555 412.025ZM411.954 427.63L474.374 334.035L489.973 344.438L427.553 438.033L411.954 427.63Z",fill:"#000001"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M388.567 344.42L466.563 396.437Z",fill:"black"}),h.jsx("path",{d:"M388.567 344.42L466.563 396.437",stroke:"white",strokeWidth:"9.375"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M162.38 193.572C178.935 168.749 204.672 151.52 233.931 145.673C263.189 139.827 293.572 145.843 318.395 162.397C343.218 178.952 360.447 204.69 366.294 233.948C372.14 263.207 366.124 293.589 349.57 318.412L162.38 193.572Z",fill:"#CD2E3A"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M162.38 193.572C145.825 218.395 139.809 248.778 145.656 278.036C151.502 307.295 168.732 333.032 193.555 349.587C218.378 366.142 248.76 372.158 278.019 366.311C307.277 360.465 333.015 343.235 349.57 318.412C357.847 306.001 360.855 290.809 357.932 276.18C355.009 261.551 346.394 248.682 333.982 240.405C321.571 232.127 306.379 229.119 291.75 232.043C277.121 234.966 264.252 243.581 255.975 255.992L162.38 193.572Z",fill:"#0047A0"}),h.jsx("path",{d:"M255.975 255.992C273.212 230.147 266.233 195.222 240.387 177.985C214.542 160.748 179.617 167.727 162.38 193.572C145.143 219.418 152.122 254.343 177.967 271.58C203.813 288.816 238.738 281.838 255.975 255.992Z",fill:"#CD2E3A"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M84.4473 438.033L22.0273 344.438L37.6264 334.035L100.046 427.63L84.4473 438.033ZM107.846 422.428L45.426 328.833L61.0251 318.43L123.445 412.025L107.846 422.428ZM131.245 406.823L68.8247 313.228L84.4238 302.825L146.844 396.42L131.245 406.823Z",fill:"#000001"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M427.628 209.16L365.208 115.565L380.807 105.162L443.227 198.757L427.628 209.16ZM451.027 193.555L388.607 99.9601L404.206 89.5567L466.626 183.152L451.027 193.555ZM474.425 177.95L412.005 84.3551L427.604 73.9517L490.024 167.547L474.425 177.95Z",fill:"#000001"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M72.7363 378.231L96.135 362.626ZM388.619 167.564L415.917 149.358ZM439.316 133.753L462.715 118.148Z",fill:"black"}),h.jsx("path",{d:"M72.7363 378.231L96.135 362.626M388.619 167.564L415.917 149.358M439.316 133.753L462.715 118.148",stroke:"white",strokeWidth:"9.375"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_krw",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),u0t=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_kwd)",children:[h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 170.606H1023.95V341.316H0V170.606Z",fill:"white"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 341.315H1023.95V512.025H0V341.315Z",fill:"#F31830"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 0H1023.95V170.709H0V0Z",fill:"#00D941"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 0V511.922L255.445 341.315L255.961 170.503L0 0Z",fill:"#000001"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_kwd",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),d0t=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_kzt)",children:[h.jsx("path",{d:"M0 0H512V512H0V0Z",fill:"#00ABC2"}),h.jsx("path",{d:"M276.699 283.915C314.76 283.915 345.615 253.061 345.615 215C345.615 176.939 314.76 146.085 276.699 146.085C238.639 146.085 207.784 176.939 207.784 215C207.784 253.061 238.639 283.915 276.699 283.915Z",fill:"#FFEC2D"}),h.jsx("path",{d:"M274.309 335.36C272.517 338.585 271.442 342.323 269.189 345.241C262.226 338.944 252.191 339.097 243.385 338.739C236.114 338.329 228.229 337.664 222.597 332.493C216.709 327.629 211.845 321.382 205.292 317.44C199.132 316.117 193.343 313.441 188.345 309.606C178.002 301.158 172.063 288.614 161.925 279.91C160.031 278.067 157.727 276.582 155.577 274.995Z",fill:"#FFEC2D"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_kzt",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),h0t=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_mad)",children:[h.jsx("path",{d:"M512 0H0V512H512V0Z",fill:"#C1272D"}),h.jsx("path",{d:"M256 191.4L218 308.2L317.4 236H194.6L293.9 308.2L256 191.4Z",stroke:"#006233",strokeWidth:"12.5"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_mad",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),f0t=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_4989_137735)",children:[h.jsx("path",{d:"M341.3 0H512V512H341.3V0Z",fill:"#CE1126"}),h.jsx("path",{d:"M170.7 0H341.3V512H170.7V0Z",fill:"white"}),h.jsx("path",{d:"M0 0H170.7V512H0V0Z",fill:"#006847"}),h.jsx("path",{d:"M284.6 295.6L284.8 299.1L286.2 298.2L285.2 295.2L284.6 295.6Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}
1216),h.jsx("path",{d:"M284.5 295.7C285.108 295.7 285.6 295.208 285.6 294.6C285.6 293.992 285.108 293.5 284.5 293.5C283.893 293.5 283.4 293.992 283.4 294.6C283.4 295.208 283.893 295.7 284.5 295.7Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),h.jsx("path",{d:"M289 301.1L286.3 298.6L285.1 299.6L288.7 301.6L289 301.1Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),h.jsx("path",{d:"M288.7 302.6C288.3 301.933 288.4 301.367 289 300.9C289.6 300.433 290.133 300.5 290.6 301.1C290.933 301.7 290.833 302.233 290.3 302.7C289.7 303.1 289.167 303.033 288.7 302.5V302.6ZM309 263.7L311.7 266.3L312.1 265L309.6 263.3L309 263.7Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),h.jsx("path",{d:"M308.7 264.1C309.307 264.1 309.8 263.608 309.8 263C309.8 262.393 309.307 261.9 308.7 261.9C308.092 261.9 307.6 262.393 307.6 263C307.6 263.608 308.092 264.1 308.7 264.1Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),h.jsx("path",{d:"M316.1 265.3L312.1 266.4L312.4 265.1L315.9 264.7L316.1 265.3Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),h.jsx("path",{d:"M316.8 265.8C317.408 265.8 317.9 265.307 317.9 264.7C317.9 264.092 317.408 263.6 316.8 263.6C316.193 263.6 315.7 264.092 315.7 264.7C315.7 265.307 316.193 265.8 316.8 265.8Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),h.jsx("path",{d:"M302.3 285.5L299.8 281.5L300.2 281.4L303.1 284.7L302.3 285.5Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),h.jsx("path",{d:"M299.6 281.9C300.263 281.9 300.8 281.363 300.8 280.7C300.8 280.037 300.263 279.5 299.6 279.5C298.938 279.5 298.4 280.037 298.4 280.7C298.4 281.363 298.938 281.9 299.6 281.9Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),h.jsx("path",{d:"M302.5 285.6L305.7 286.2L305.8 285.7L303.1 284.7L302.5 285.6Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),h.jsx("path",{d:"M306.6 287.3C307.208 287.3 307.7 286.807 307.7 286.2C307.7 285.592 307.208 285.1 306.6 285.1C305.992 285.1 305.5 285.592 305.5 286.2C305.5 286.807 305.992 287.3 306.6 287.3Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),h.jsx("path",{d:"M227.7 294.4C227.633 295.067 227.366 295.4 226.9 295.4C226.233 295.333 225.966 295 226.1 294.4C226.3 293.6 226.566 293.267 226.9 293.4C227.433 293.6 227.7 293.933 227.7 294.4ZM227.7 296.2L228.4 300.2L227.4 299.9L227.1 296.4L227.7 296.2Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),h.jsx("path",{d:"M228.6 294.9C229 295.5 228.3 296.4 227.4 296.6C226.6 296.9 225.5 296.5 225.5 295.7C225.5 294.9 226.8 295.3 227.1 295.2C227.6 295 228.1 294.2 228.6 294.9Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),h.jsx("path",{d:"M221.6 301.9C222.318 301.9 222.9 301.497 222.9 301C222.9 300.503 222.318 300.1 221.6 300.1C220.882 300.1 220.3 300.503 220.3 301C220.3 301.497 220.882 301.9 221.6 301.9Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),h.jsx("path",{d:"M223.7 300.8L227.6 300.6L226.9 299.8L223.7 300.2V300.8Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),h.jsx("path",{d:"M224 300.4C224.4 301.4 224.4 302.7 223.3 302.5C222.2 302.3 222.4 301.4 222.3 301C222.2 300.3 221.5 299.7 222.2 299C222.8 298.4 223.7 299.4 224 300.4Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),h.jsx("path",{d:"M211.5 280.5C211.942 280.5 212.3 280.008 212.3 279.4C212.3 278.793 211.942 278.3 211.5 278.3C211.058 278.3 210.7 278.793 210.7 279.4C210.7 280.008 211.058 280.5 211.5 280.5Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),h.jsx("path",{d:"M211.5 281.9L211.6 285.6L210.6 284.7L210.7 281.7L211.5 281.9Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),h.jsx("path",{d:"M213 280.8C213.2 281.6 211.9 282.1 211 281.9C210.067 281.767 209.633 281.3 209.7 280.5C209.7 279.8 210.9 279.9 211.2 280.1C211.6 280.4 212.7 279.5 213 280.8Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),h.jsx("path",{d:"M204.9 285.8C205.618 285.8 206.2 285.531 206.2 285.2C206.2 284.869 205.618 284.6 204.9 284.6C204.182 284.6 203.6 284.869 203.6 285.2C203.6 285.531 204.182 285.8 204.9 285.8Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),h.jsx("path",{d:"M207.3 285.2L210.2 285L211.4 286L207.2 285.8L207.3 285.2Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),h.jsx("path",{d:"M206.2 283.6C207 283.6 207.5 284.5 207.4 285.4C207.4 286.4 206.6 287.1 205.9 287C205.1 286.9 205.2 286.2 205.2 286L205.7 285.2C205.7 284.9 205.5 284.2 205.6 284C205.6 283.733 205.8 283.6 206.2 283.6ZM203.8 260.9C203.5 261.5 202.8 261.9 202.6 261.6C202.333 261.267 202.366 260.8 202.7 260.2C203.033 259.6 203.433 259.4 203.9 259.6C204.166 259.867 204.166 260.3 203.9 260.9H203.8ZM200.6 266.8L202.2 262.9L202 262.7L200.1 265.4L200.6 266.8Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),h.jsx("path",{d:"M202 263C201.2 262.333 200.933 261.7 201.2 261.1C201.5 260.6 202.1 260.9 202.1 260.9L202.8 261.6C203 261.7 203.5 261.5 203.8 262C204.066 262.6 204.066 262.933 203.8 263C203.508 263.158 203.181 263.24 202.85 263.24C202.518 263.24 202.192 263.158 201.9 263H202ZM195.1 262.4C195.766 262.867 196 263.3 195.8 263.7C195.6 264.1 195.133 264.1 194.4 263.7C193.4 263.1 193.5 262.9 193.7 262.5C194.033 262.1 194.5 262.1 195.1 262.5V262.4ZM196.8 264.1L199.8 265.9V267.4L196.5 264.6L196.8 264.1Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),h.jsx("path",{d:"M196.8 264.5C196.134 265.167 195.534 265.333 195 265C194.4 264.7 194.9 264.1 194.9 264.1L195.5 263.5C195.7 263.2 195.5 262.7 196.1 262.5C196.7 262.233 197.034 262.3 197.1 262.7C197.2 263 197.4 263.9 196.8 264.5Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}
1216),h.jsx("path",{d:"M285.3 295.8L284.9 296.2L284.7 296.9V295.8L285.1 295.5L285.3 295.8Z",fill:"#AA8C30"}),h.jsx("path",{d:"M285.4 295C285.4 295 285.2 295.5 284.5 295.5C283.833 295.5 283.5 295.267 283.5 294.8L283.6 293.9L283.3 294.3V295L283.8 295.6H284.2L284.6 295.7L285.1 295.5L285.4 295.3V295.1V295ZM288.8 301H288.2L285.5 299.6L288.5 301.6L288.8 301ZM290.7 301.8C290.7 301.8 290.7 302.4 290.1 302.6C289.5 302.867 289.1 302.867 288.9 302.6C288.763 302.477 288.662 302.319 288.609 302.142C288.556 301.966 288.553 301.778 288.6 301.6L288.5 302.1L288.8 302.7L289.4 303H289.9L290.2 302.8L290.6 302.4L290.8 302L290.7 301.8ZM310.1 263.8V264.6L309.4 263.9L309.7 263.5L310.1 263.8ZM309.8 262.8C309.8 263.3 309 264.1 308.5 263.8C307.833 263.533 307.6 263.067 307.8 262.4L307.6 262.7L307.7 263.5L308.3 264H308.9L309.5 263.8L309.8 263.2V262.8ZM317.8 264.2C317.8 264.7 317.3 265.6 316.7 265.5C316.033 265.367 315.733 265 315.8 264.4V265.2L316.1 265.5L316.6 265.8H317.1L317.7 265.4L317.9 264.9V264.6L317.8 264.2Z",fill:"#AA8C30"}),h.jsx("path",{d:"M315 264.9C315 264.9 315 265.1 314.7 265.3L313.7 265.9L315.9 265.3L315.7 264.7L315 264.9ZM301.4 282.8L301.2 283.2V283.8L300 281.8L300.4 281.6L301.4 282.8ZM300.7 280.8C300.4 281.4 299.5 281.8 299.1 281.5C298.7 281.2 298.3 280.3 298.8 279.9L298.5 280.1L298.4 280.7L298.6 281.2L299 281.7L299.4 281.9L300.1 281.7L300.6 281.4C300.6 281.4 300.9 280.4 300.6 280.9L300.7 280.8ZM305.1 285.5C305.1 285.5 305.1 285.7 304.7 285.7H303.5L305.5 286.1L305.7 285.7L305.1 285.5Z",fill:"#AA8C30"}),h.jsx("path",{d:"M307.7 286C307.9 286.7 307.3 287.4 306.5 287.1C305.7 286.8 305.5 286.1 305.7 285.6L305.5 286.2L305.7 286.8L306.2 287.2L306.7 287.4L307.2 287.2L307.7 286.7L307.8 286.1V286H307.7ZM228.5 294.9C228.7 295.1 228.4 296.1 227.5 296.4C226.6 296.7 226.1 296.4 225.9 296.1L225.7 295.5L225.5 295.7L225.7 296.1L226.1 296.5L226.9 296.7L227.5 296.6L228.1 296.3L228.4 296L228.7 295.6V295.1L228.6 294.9H228.5Z",fill:"#AA8C30"}),h.jsx("path",{d:"M227.7 296.9L227.4 297.2L227.2 297.8V296.8L227.6 296.5L227.7 296.9ZM224.7 300.1C224.7 300.1 224.6 300.3 224.8 300.5L225.6 300.7H224.2L224 300.2L224.7 300.1ZM224.2 301.1L224.1 301.6C223.966 302.067 223.7 302.3 223.3 302.3C223.087 302.257 222.893 302.146 222.749 301.984C222.605 301.822 222.517 301.617 222.5 301.4L222.3 300.9V301.4L222.6 302.2L223.2 302.5H223.6L224 302.3L224.2 301.8V301V301.1ZM220.4 300.9C220.4 300.9 220.6 301.6 221.4 301.6L222.4 301.4V301.7L222.1 301.8L221.5 301.9L220.9 301.8L220.6 301.6L220.4 301.2V300.9ZM212.9 280.6V280.9C212.8 281.2 212.3 281.8 211.4 281.8C210.6 281.8 210.133 281.6 210 281.2C209.733 280.8 209.633 280.567 209.7 280.5V281L210 281.5L210.9 281.9H211.7L212.5 281.7L212.9 281.3V280.6ZM211.5 282.4L211 282.6L210.7 282.9V281.9H211.5V282.5V282.4ZM207.7 285.2L208.1 285.5C208.5 285.7 210.6 285.9 210.6 285.9L207.3 285.8L207.5 285.2H207.7ZM207.4 285.2L207.2 285.7C207 286 206.6 286.9 205.9 286.8C205.2 286.7 205.3 286.2 205.3 286.1V285.9L205.2 286.4L205.4 286.7L205.6 286.9H206.2L206.6 286.8L207 286.4L207.2 286L207.4 285.5V285.2ZM205.6 285.3C205.6 285.3 205.6 285.5 205 285.5L203.7 285.3L204 285.6L204.4 285.7H205.4L205.6 285.3ZM203.9 262.3C203.9 262.3 204 262.6 203.7 262.8C203.3 263.067 202.833 263.1 202.3 262.9C201.9 262.7 201.1 261.9 201.1 261.9L201.5 262.5L202 263L202.8 263.2H203.6L203.9 262.8L204 262.6L203.9 262.3Z",fill:"#AA8C30"}),h.jsx("path",{d:"M201.6 263.3V263.7L201.5 264.7L202.1 263.1L201.9 262.9L201.6 263.3ZM197.3 264.5L197.4 264.8C197.6 265.3 199.4 266.9 199.4 266.9L196.6 264.7L196.9 264.2L197.3 264.5ZM196.4 264.7L195.7 265C195.5 265 194.9 265 194.9 264.6V264.1L194.7 264.6L194.8 264.9L195.2 265.1H195.8L196.3 264.9L196.4 264.8V264.7ZM195.4 263.6H194.8C194.3 263.6 193.8 263 193.8 263L194.1 263.6L195 264L195.4 263.6Z",fill:"#AA8C30"}),h.jsx("path",{d:"M319.9 256.1C319.6 259.1 316.6 260.8 315 261.9C314.072 262.609 313.291 263.492 312.7 264.5L312.1 266.3L311.9 267.4V267.8L312.1 269.5L312 272.9L314.1 271.4L315.7 270.8H316.1C316.1 270.8 314.4 272.4 313.8 274.2C313.1 276.1 311.8 280 309.5 281.2C307.2 282.4 305.7 282 304.9 282.7L304.1 283.6L303.1 284.9L302.3 285.9L301.6 286.5L301.1 286.8L300.9 288.2L300.4 290.1L301.4 289.7H302.5L301.9 290.7C301.8 291.2 302 294.4 299 296.3C296 298.2 288.3 297.9 288.3 297.9L286.9 298.5L285.5 299.5L284.3 300.9L284.2 301.2C284.2 301.2 283.2 302.4 282.5 302.8L280.3 304.3L282.1 304.4L284.9 305.6C284.9 305.6 283.1 305.6 281.9 306C280.7 306.4 275.4 309.5 272.9 309.4C270.2 309.4 266.5 305.6 266.5 305.6L264.9 304.4L262.1 303.8L258.6 303.6V303.2L258.7 302.6L261.7 302.7C263.4 302.9 263.9 303.5 265.3 303.7C266.244 303.824 267.204 303.721 268.1 303.4L272.8 299.6L277.5 298L279.3 298.2L280.1 298.4L280.8 298.6L280 299.6L278.8 300.3L279.4 300.8L282.4 300.3L283.4 300.6L283.6 300.7L284 299.7C284.4 299.2 286 297.9 286.8 297.4C287.467 297 287.8 296.733 287.8 296.6C288.1 296.4 289.1 293.9 289.1 293.9L289.2 292.6L292.5 289.5L294.7 287.1L295.7 284.4L295.6 283.9C295.6 283.9 296.3 284.7 296.2 28
12166.4C296 288 295.833 288.733 295.7 288.6C295.5 288.4 297.9 287.1 299.1 286.6C300.1 286.2 300.767 286.067 301.1 286.2C301.738 285.825 302.284 285.312 302.7 284.7C303.4 283.7 303.5 283.5 303.5 283.1L303.6 280.9L303.4 275.2L305.4 271L308.2 268.5L308.7 268.2L308.4 269.2V270.2C308.4 270.2 309.8 268.4 310.5 268L311 267.8L311.6 266.2C311.8 265.2 311.8 263.7 311.8 263.7V261.4L311.4 259.6L310.1 256.1V251.5L309.1 250.2C309.1 250.2 310 250.1 311.1 251.7C311.857 252.922 312.366 254.281 312.6 255.7L315.3 247.6C315.3 247.6 316 248.6 316.5 250.1L317.2 252.8L318.2 250.6L318.3 251.4C318.5 252.1 320.1 253.1 319.9 256.1ZM266.1 308.1C266.1 308.1 265.5 306.9 263 305.6C261.569 304.914 260.057 304.41 258.5 304.1V305.1L262.5 306.8L264.5 308.4L266.1 308.1Z",fill:"#9CA168"}),h.jsx("path",{d:"M284.3 300.5C285.352 299.432 286.527 298.492 287.8 297.7C288.621 297.321 289.5 297.085 290.4 297C291.9 296.7 292.1 297 295.6 295C299.1 293 299.9 290.9 300.6 290.3C301.3 289.8 302.5 289.6 302.5 289.6L299.8 292.8C298.5 294.2 297.1 295.1 295.1 296.4C293.1 297.7 289.1 297.8 289.1 297.8C287.848 298.004 286.693 298.599 285.8 299.5C284.8 300.3 284.2 301.2 284.2 301.2C284.2 301.2 284 300.8 284.2 300.5H284.3ZM294 290.3C290.7 293.3 289.7 296.1 289.7 296.1L294 292.1C295.5 290.7 297.6 290.1 298.5 289.1C299.5 288.3 299.5 287.6 300.1 287.1L301.1 286.2C301.1 286.2 299.7 285.2 294 290.3ZM287.1 297.2C287.1 297.2 288.5 296.6 289.1 295.3C289.4 294.4 289.2 294.2 289.8 293.1C289.8 293.1 293.2 289.9 294.4 288.5C296.5 286 295.6 283.9 295.6 283.9C295.6 283.9 295.8 284.9 294.9 286.1C294 287.1 289.7 290.1 289.1 291.9C288.5 293.7 288.9 293.6 288.7 294.6C288.1 296.6 287.
12161 297.2 287.1 297.2ZM284.9 305.6C284.9 305.6 283.2 304.5 281.3 304.6C277.4 304.9 274.1 307.2 271.6 307.3C269 307.3 268 306.1 266 304.7C263.9 303.3 258.7 303.5 258.7 303.5V303.6L258.6 303.8C258.6 303.8 262.2 303.8 263.7 304.2C266.7 305.1 268.2 308.2 271.6 307.9C275.9 307.7 279.4 305 281.2 305C284.2 305 284.9 305.6 284.9 305.6ZM265.6 303.6C265.6 303.6 268.6 304.2 271 302.5C273.3 300.8 276.1 298.5 277.6 298.4C279.2 298.3 280.8 298.7 280.8 298.7C280.8 298.7 278.8 297.7 277.3 297.8C275.696 297.75 274.108 298.13 272.7 298.9C271.2 299.8 270.5 301.4 268.9 302.4C267.3 303.4 265.6 303.7 265.6 303.7V303.6ZM265.1 307.7L264.1 307.9C263.9 307.9 263.1 306.9 261.7 306.3C260.3 305.7 258.5 305.2 258.5 305.2C258.5 305.2 258.3 305.2 258.7 305.4L261.7 306.5C262.549 306.943 263.298 307.556 263.9 308.3C263.9 308.4 264.3 308.9 265.1 308.9C265.767 308.767 266.1 308.533 266.1 308.2C265.9 307.867 265.567 307.7 265.1 307.7ZM267.2 304.7C267.2 304.7 268.4 305.5 270.4 305.4C274.6 305.4 277.2 302.4 280 301.4C282.8 300.4 284.2 301.2 284.2 301.2V301C283.279 300.387 282.206 300.041 281.1 300C276.5 300.1 272.1 303 270.2 303.8C268.267 304.533 267.267 304.867 267.2 304.8V304.7ZM312 273C310.5 274.5 308.4 279.2 307.5 280.4C306.5 281.7 305.4 282.1 304.9 282.6L302.4 285.9C302 286.5 301.9 286.3 301.6 286.5C301.267 286.767 301.267 286.833 301.6 286.7C302.1 286.6 302.2 286.3 302.9 285.5C303.6 284.7 303.6 284.3 304.7 283.3C305.8 282.3 307.8 281.2 308.8 280C309.8 278.7 311.8 274 313 272.8C314.1 271.6 316.1 270.8 316.1 270.8C316.1 270.8 314.5 270.4 312 273ZM304.8 281.9C304.8 281.9 304.8 281 305.8 279.8C306.8 278.6 307.2 278.8 308 276.9L309.9 271.4C310.5 269.4 311.7 267.6 311.7 267.6C311.7 267.6 310.6 267.6 309.5 269.2C307.906 271.34 306.627 273.697 305.7 276.2C304.7 278.8 304.7 281.9 304.7 281.9H304.8ZM303.4 283.7C303.4 283.7 303.8 283.4 303.9 281.1C304 278.8 303.8 275.5 304.4 273.8C305.1 272.2 308.7 268.3 308.7 268.3C308.7 268.3 307.2 268.6 305.1 270.3C303.1 272.1 302.167 273.867 302.3 275.6C302.3 277.2 303.3 279 303.3 280.6L303.4 283.6V283.7ZM311.9 267.5L313.1 263.5C313.5 262.8 313.5 262.3 315.3 260.3C316.3 259.2 317.3 258.4 317.8 256.8C318.3 255.2 318.2 250.7 318.2 250.7C318.2 250.7 317.7 251.1 317.4 251.9C317.1 252.7 317.3 255.6 316.6 256.9C315.9 258.3 314.4 261.5 313.6 262.2C313.6 262.2 313.5 259.9 313.7 257.6C313.9 255.3 314.7 254.6 315.1 253.1C315.5 251.6 315.3 247.7 315.3 247.7C315.3 247.7 314 248.9 313.4 250.4C312.8 251.9 312.4 254.4 312.4 256.4C312.4 258.4 312.9 260 313 261.1C313.1 262.2 313.1 262.8 312.7 264L312.2 265.6L311.6 267.6L311.9 267.5ZM309.1 250.3C309.1 250.3 310.1 251.6 310 253.2C309.8 254.7 309.2 256.8 309.8 258.4C310.4 260 311.3 260.1 311.6 261.1C311.8 262 311.8 263.8 311.8 263.8C311.8 263.8 312.3 260.4 312 259.4C311.6 258.4 311.5 258.9 311 257.9C310.5 256.9 311 254.2 310.6 252.6C310.387 251.68 309.856 250.866 309.1 250.3Z",fill:"#717732"}),h.jsx("path",{d:"M245.4 307.9C245.4 307.9 245.7 306.9 247.9 305.9C250.1 304.9 253.3 303.4 253.6 303.6C254 303.8 253.5 304.9 253.5 304.9L251.4 305.6L249.7 306.6L247.7 307.9H245.4Z",fill:"#9CA168"}),h.jsx("path",{d:"M251 302.1C248.1 302.2 246.6 302.9 246 303.1H245.1C244.5 302.9 243.9 302 243.9 302L243.3 301.5L243.2 303.5L239.2 299.9L238.7 302.3L238.2 303.3L234.2 299.5L234.3 302.5H233.3L230.3 300.5L229.5 300.9L230.5 302.6L226.8 302.9L226 303.5L225.3 304.4V304.7H226.7C227 304.5 227.2 304 227.3 304.2C227.4 304.4 227.5 305.2 228 305.2C228.5 305 230.2 303.8 231.4 304.3C232.7 305 229.6 305.9 230 306.8C230.3 307.8 232.5 307.4 233 307.1C233.5 306.8 235.3 304.7 236 305.5C237 306.5 234 307.5 234.5 308.5C235.1 309.6 236.7 309.4 237.5 308.9C238.3 308.4 240.2 305.6 240.6 306.2C241.3 307.2 239 308.3 239.6 309.2C240.2 310.1 241.5 309.2 242.3 308.5C243.1 307.8 243.5 306.5 244.7 305.8C245.8 305.2 245.7 305.5 246.1 305.4C246.4 305.4 247.3 304.5 247.3 304.5L250 303.4H251.4L252.1 303.8L253.5 304L253.6 302.8C253.6 302.8 252 302.1 250.9 302.1H251ZM229 302.1L229.5 301.1L229.2 300.6C229.2 300.6 228.2 300.1 227.3 299.2L225.7 297.9L224 296.8L223.4 294.5L223 293.9L222 294.3L220.6 289.4L220.3 288.5H219.7L218.6 291.5L217.3 289.6L217 285.6L216.2 286.5L215.2 287.5L213.4 283.8C213.4 283.8 213.2 283.8 213.1 284.1C213 284.4 212.9 285.5 213.1 286.2L210.6 284.4C208.933 282.8 208.166 282 208.3 282L207.5 280L208.3 278.3L208.7 276.3L206.9 277L206.6 272.4L206.3 271L204.2 274L203.4 272.8V269.8L202.8 269.7L201.9 271.3C201.9 271.3 201.1 269.6 200.7 269.3C200.8 268.6 200.9 267 200.5 265.7C200 264.1 199.5 263.2 199.6 261.9C199.8 260.5 200.4 260.4 200.3 259.9C200.3 259.2 199.3 260.2 199.7 259.4C200 258.7 202.7 256.9 202.2 256C201.6 255 198.9 257.4 199.5 255.8C200.2 254.2 202.7 254.2 202.9 251.9C202.9 250.6 200.4 252.9 200.2 252.1C200 251.4 201.8 250 201.8 249.1C201.8 248.1 202.1 248.1 201.6 247.6C201.1 247.1 199.6 249.5 199.6 249.5L197.9 248.9L197.3 251.3L196.8 253.3L194.7 252.1L195.2 254.6L195.7 257L193.6 256.4L194.7 258.5L196.2 260L197.2 261.3L197.8 261.6L198.8 262.6L199 263.8L199.5 265.3L199.6 266.8V269.1L199.5 269.9C199.1 269.9 198.5 269.3 198.2 269.7C197.9 270.2 199.4 271.3 199.2 271.7C198.9 271.9 196.6 271.2 196.5 271.9C196.4 272.6 196.7 273.6 198 273.9C199.3 274.2 202.2 274.9 201.7 275.5C201.2 276.1 198 273.7 198.2 275.5C198.225 276.098 198.43 276.675 198.786 277.156C199.143 277.637 199.635 278.001 200.2 278.2C201.1 278.5 204.3 278.2 204.2 278.9C203.9 279.6 201.5 278.6 201.2 279.7C200.9 280.8 203 281 203.4 281C203.8 281 205.1 281 205.7 281.4L209.1 284.6C210.1 285.5 212.2 286.9 212.8 287.3C212.2 287.3 210.9 287.1 210.7 287.6C210.5 288.1 215.6 290 214.1 290.6C212.6 291.2 211.
12161 289 210.6 290.3C210.1 291.6 211.6 292.7 212.4 293.3C213.2 293.7 217.7 293.3 216.9 294.3C215.9 295.3 212.7 293.6 212.6 294.9C212.5 296.2 214.8 298 216 297.9C217.1 297.9 218.4 296.1 218.9 297.1C219.4 298.1 218 298.5 219.1 298.7C220.2 298.9 221 297.7 222.3 297.9C223.5 298.1 225.5 298.9 226.7 299.9L228.9 302.2L229 302.1Z",fill:"#9CA168"}),h.jsx("path",{d:"M246.7 307.3C247.366 307.433 247.7 307.567 247.7 307.7C247.7 307.7 249.1 306.6 250.4 305.9C251.6 305.2 253.4 304.9 253.4 304.9H253.6C253.6 304.9 251.3 305.6 250.3 306.3L247.8 308C247.733 308.267 247.266 308.433 246.4 308.5C245.733 308.433 245.4 308.233 245.4 307.9C245.4 307.567 245.833 307.367 246.7 307.3ZM253.5 303.9C253.5 303.9 252.8 303.9 252.5 303.6C251.869 303.209 251.142 303.001 250.4 303C249.199 303.067 248.063 303.564 247.2 304.4C247.2 304.4 247 304.9 246.1 305.4C246.433 305.4 246.933 305.133 247.6 304.6C248.482 303.969 249.519 303.589 250.6 303.5C251.4 303.5 251.966 303.7 252.3 304.1C252.7 304.4 253.5 304.3 253.5 304.3V303.9ZM213.1 287.4V286.8C213.1 286.8 212.5 286.6 211.4 285.8C210.1 285.1 207.3 282.9 207.3 282.9L209.6 285L212.8 287.3L213.1 287.4ZM241.6 307.6L242.8 305.8C243.666 304.667 244.166 304.1 244.3 304.1C244.3 303.9 244.133 303.5 243.8 302.9L243.6 301.9C243.6 301.9 243.9 302.7 244.4 303.1L245.4 303.8C245.4 303.8 246.4 303.7 246.4 303.5C246.4 303.3 246.333 303.133 246.2 303H245.3C244.3 302.5 243.9 301 243.3 301C242.7 300.9 243.1 302.6 242.8 302.6C241.8 302.6 241.2 299.1 238.8 299C237.3 298.9 237 299.2 236.9 299.6C236.8 300 238.9 302 238.2 302.3C237.5 302.6 235.4 299 233.8 299C232.2 299 232.1 299.5 232.2 299.9C232.3 300.2 234 300.5 233.6 301.6C233.2 302.7 231.6 299.9 230.2 300.1C228.8 300.3 228.6 300.4 228.5 300.8C228.4 301.2 229 301.8 228.8 301.9C228.6 302 227.8 302 227 302.5C226.3 303 225.3 304.4 225.3 304.4C225.3 304.4 226.2 303 227.5 302.9H231.9L231 302.2C230.5 301.8 230.1 300.9 230.1 300.9L231.5 302.2L233 303.2C233 303.2 234.4 303.2 234.5 303.4C234.633 303.6 234.433 303.967 233.9 304.5L232.5 305.8L234.1 304.6L235.3 303.6C235.3 303.6 236.3 303.8 236.4 303.7C236.533 303.767 236.333 303.333 235.8 302.4L234.5 300.4C234.5 300.4 235.3 301.1 236.1 302.2C237 303.2 236.8 303.8 237.1 303.8L238.3 304C238.633 304 238.533 304.433 238 305.3L237 307.3L238.3 305.7C238.9 305.1 239.3 304.3 239.5 304.3H240.7L240 303C239.6 302 239.5 300.8 239.5 300.8C239.5 300.8 239.9 302 240.5 302.8L241.6 304.4H242.9C242.966 304.667 242.8 305.133 242.4 305.8L241.6 307.6ZM224.4 297.6L225.7 297.9C225.7 297.9 224.4 297.1 224 295.9C223.7 294.9 224 292.5 223.4 292.5C222.8 292.5 222.5 294.3 222 293.9C221.4 293.6 222.2 290.4 221.5 289.1C220.9 287.7 219.5 286.8 219.1 287.3C218.7 287.8 218.9 290.7 218 290.1C217.1 289.5 218 286.9 217.8 285.8C217.6 284.7 216.8 283.8 216.3 284.1C215.8 284.4 216.5 286.5 215.7 286.6C214.8 286.6 215 285.1 214.7 284.9C214.4 284.7 214.1 285.2 214 284.9C213.8 284.6 213.9 283.6 213.4 283.7C213 283.7 213.1 284.7 213.2 285.1L213.8 286.5C213.9 286.8 214.6 287.2 214.5 287.5C214.433 287.767 214.166 287.9 213.7 287.9H212.3L213.7 288.2C214.1 288.2 214.9 288.1 215.1 288.4L216.2 290.1C216.2 290.1 216.5 289.4 216.6 288.2V286.1C216.6 286.1 216.9 287.4 216.9 288.2L216.6 290.6C216.6 290.6 217.5 291.3 217.2 291.6H214.9C213.9 291.6 212.3 291.3 212.3 291.3C212.3 291.3 213.7 291.9 214.7 292.1C215.7 292.3 217.7 292.3 217.7 292.3L219.1 293.9C219.1 293.9 219.8 292.8 219.9 291.6V289L220.3 291.2C220.287 292.22 220.118 293.231 219.8 294.2L218.3 295C217.3 295.3 215.4 295.5 215.4 295.5C215.4 295.5 217.2 295.8 218.4 295.5C219.7 295.2 219.8 294.8 220.2 295L220.9 295.6L221.9 296.4L221.1 296.9L219.9 297.5L221.7 296.9L222.6 296.6L223 296.8L222.9 295.8L222.6 294.4C222.6 294.4 223.1 295 223.2 295.7L223.3 296.9C223.3 296.9 223.4 297.1 224.3 297.5L224.4 297.6ZM199.5 269C199.5 269 199.8 267.6 199.8 266C199.8 264.5 198.8 262.1 198.5 261.9L198.3 261.4L199 260.4L198 261.1L197 260.7L196.4 260L197.4 260.5L197.9 260.6L197.6 259.1L196 258.3C195 257.7 194 256.8 194 256.8L196.2 258L197.5 258.3C197.5 258.3 198.4 258.1 198.8 257.8L200.1 256.9C200.1 256.9 199.3 257.4 198.7 257.5L197.5 257.7L197.2 255.8L196.3 254.9C195.6 253.9 195.1 252.7 195.1 252.7C195.1 252.7 195.8 253.6 196.4 254C197 254.4 197.5 255.2 197.5 255.2L198.8 254.4L201.1 252.8L198.9 253.8L197.6 254.4V253.2L198.2 251.9C198.1 251.5 197.8 251.7 197.7 251.4L198.1 249.3V250.3C198.1 250.7 198.233 250.933 198.5 251C198.9 251.1 201.1 248.9 201.3 248.5C201.6 248.1 202 247 200.9 247.5C199.8 248 200 248.8 199.1 248.8C198.8 248.8 198.5 247.6 198.1 247.8C197.8 248.1 197.1 248.8 196.9 249.8C196.7 250.6 197.1 251.8 196.6 252.2C196.1 252.6 195.6 250.8 194.8 251C193.8 251.3 193.6 252.6 193.8 253C193.9 253.6 195.9 256 195.3 256.2C194.7 256.4 193.1 254.2 192.3 255.8C191.3 257.3 194.9 258.9 195.3 259.3C195.8 259.7 195.3 259.8 196 260.6C196.7 261.4 197.5 261.6 197.9 262.1C198.3 262.6 199.6 265.1 199.6 266.7V269H199.5ZM208.9 282.6C208.9 282.6 208 281.6 208.3 280C208.6 278.4 209.8 275.4 209.3 275C209 274.6 207.7 276.8 207.4 276.3C207.1 275.8 208.1 272.9 207.6 271.7C207.1 270.5 207 269.7 206 269.8C205 269.9 204.5 273.3 204 272.8C203.5 272.1 204.3 270.6 204 269.8C203.733 269 203.4 268.667 203 268.8C202.4 268.9 202.2 270.5 201.8 270.5C201.4 270.5 200.8 268.5 200.1 268.9C199.4 269.1 201.9 272.4 201.9 272.4C201.9 272.4 202.4 272 202.6 271.4L203.1 270.3C203.1 270.3 203.3 271.3 203.1 271.8L202.8 273.2C202.733 273.267 202.166 273.267 201.1 273.2C200.1 273.1 199.2 272.7 199.2 272.7C199.2 272.7 199.9 273.1 201 273.4L203.2 274L203.9 275L204.8 276.1L205.4 274.5L206.4 271.7C206.4 271.7 206.2 273.7 205.9 274.7L205.4 277.2C205.4 277.2 204.4 277.2 203.3 276.9L200.3 276.3L203.3 277.3L205.6 277.9L206.6 279.3L207.4 278.2C207.9 277.5 208.2 276.7 208.2 276.7C208.2 276.7 208 277.8 207.7 278.5L207.1 279.6L205.7 279.8H203.7C204.869 280.17 206.077 280.405 207.3 280.5C207.3 280.5 207.3 280.9 207.8 281.6L208.9 282.6Z",fill:"#717732"}
1216),h.jsx("path",{d:"M251.6 312.7C251.6 312.7 251.1 312.1 250.4 311.7L249.4 311.5H249.1L249.8 309.9L254.2 305.6L254.9 301.3H257.6V307.2L258.4 307.5L263.4 310.5V311.8L262.6 312.1L262 312.4L260.2 312.6L256.9 310.2L255.5 308.8L253.1 311.9L251.5 312.7H251.6Z",fill:"white"}),h.jsx("path",{d:"M255 301.3V302.3C255 302.9 255 306.3 254.8 306.8C254.7 307.3 252.3 308.2 250.8 309.4C249.5 310.6 249.5 311.5 249.5 311.5L248.2 311.9C247.334 312.3 246.9 312.567 246.9 312.7C246.9 312.9 247.4 310.5 249.7 308.6C251.9 306.6 253 306.4 253.2 306.1C253.4 305.8 253.2 302 253.2 301.7C253.334 301.433 253.534 301.333 253.8 301.4H255.1L255 301.3ZM260.7 313.9L261.3 313L262 312.4L261 311.8C259.7 311.3 259 311.4 258.2 310.8L256.5 309.1L255.3 310.1L256.7 311.8C257.3 312.4 258.8 312.6 259.5 313L260.7 314V313.9Z",fill:"#016848"}),h.jsx("path",{d:"M257.2 301.3L258.7 301.4L258.9 301.9C258.9 302 258.9 305.1 258.7 306.1C258.56 306.998 258.218 307.853 257.7 308.6C257.3 308.9 255.3 310.6 254.4 311.6C253.4 312.5 252.5 313.8 252.5 313.8L251.9 313L251.3 312.3C251.956 311.159 252.883 310.197 254 309.5C255.5 308.5 256.9 307.3 257.1 305.6C257.3 303.9 257.2 301.3 257.2 301.3Z",fill:"#CD202A"}),h.jsx("path",{d:"M266 312C266 312 265.7 311.7 264.6 311.6C263.4 311.6 263.4 311.8 263.4 311.8C263.4 311.8 262.7 311 261.8 310.4C260.8 309.7 260 309.8 259 309.1C258 308.4 257.4 307.4 257.4 307.4L258.2 305.8C258.2 305.8 259.1 307.1 260 307.8C260.9 308.5 263 309.1 263.7 309.8C264.4 310.3 266 312 266 312Z",fill:"#CD202A"}),h.jsx("path",{d:"M276 293C276 293 273 292 273.3 291C273.6 290 279.9 288.3 279.9 288.3L280 286.6C280 286.6 279 286.6 277.5 287.1C275.243 287.86 272.881 288.265 270.5 288.3C268.966 288.3 267.966 288.2 267.5 288L244.3 286.6H243.1C240.1 286.3 238.2 281.8 238.2 281.8L236.8 282C236.8 282 237.2 284.3 236.5 284.5C235 284.9 225.4 279.7 225.4 279.7L224.8 281.8C224.8 281.8 230.8 285 230.6 286.1C230.4 287.3 228.6 287.2 228.6 287.2L229.4 288.6C229.7 288.6 239.1 289.1 239.3 291.9C239.3 293.1 237 293.8 237 293.8L237.8 294.8V295.2C237.8 295.2 243 295.2 244.5 296.1C245.9 296.9 246.7 298.1 248.5 299.1C253.697 299.917 258.984 299.984 264.2 299.3C266.3 298.7 267.6 296.3 271.1 295.3C274.6 294.2 275.7 294.1 275.7 294.1L276 293Z",fill:"#30C2DC",stroke:"#0872A7",strokeWidth:"0.4"}),h.jsx("path",{d:"M227.6 290.3C228.539 290.3 229.3 289.539 229.3 288.6C229.3 287.661 228.539 286.9 227.6 286.9C226.662 286.9 225.9 287.661 225.9 288.6C225.9 289.539 226.662 290.3 227.6 290.3Z",fill:"white",stroke:"#0872A7",strokeWidth:"0.8"}),h.jsx("path",{d:"M237.2 282.5C238.139 282.5 238.9 281.739 238.9 280.8C238.9 279.861 238.139 279.1 237.2 279.1C236.261 279.1 235.5 279.861 235.5 280.8C235.5 281.739 236.261 282.5 237.2 282.5Z",fill:"white",stroke:"#0872A7",strokeWidth:"0.8"}),h.jsx("path",{d:"M277.2 294.9C278.139 294.9 278.9 294.139 278.9 293.2C278.9 292.261 278.139 291.5 277.2 291.5C276.261 291.5 275.5 292.261 275.5 293.2C275.5 294.139 276.261 294.9 277.2 294.9Z",fill:"white",stroke:"#0872A7",strokeWidth:"0.8"}),h.jsx("path",{d:"M220.1 278.3C219.6 279.5 221.7 281.9 223.2 282.2C224.733 282.4 225.6 282.1 225.8 281.3C226 280.5 225.9 279.833 225.5 279.3C224.5 278 220.7 277 220.1 278.3Z",fill:"#F8C83C"}),h.jsx("path",{d:"M224.8 280.2C224.8 279.4 223.5 278.7 222.8 278.7C222.1 278.7 221.1 278.7 221.3 279.1C221.5 279.5 223.5 280.1 223.5 280.3C223.5 280.5 222.9 280.8 223.2 281.1C223.6 281.3 223.967 281.267 224.3 281C224.7 280.8 224.867 280.533 224.8 280.2Z",fill:"white"}),h.jsx("path",{d:"M238.2 294.6C238.5 295.7 237.6 296.3 236.5 296.8C235.4 297.3 233.1 297 232.5 296.1C232.1 295.1 233.5 293.7 234.8 293.4C236.2 293.1 237.8 293.6 238.2 294.6Z",fill:"#F8C83C"}),h.jsx("path",{d:"M235.8 295.3C236.3 295.2 236.3 295.9 236.7 295.9C237.1 295.9 237.4 295.2 237.3 294.8C237.1 294.2 236.6 293.867 235.8 293.8C235.2 293.8 233.4 295.4 233.6 295.8C233.8 296.2 234.134 296.267 234.6 296C234.9 295.9 235.4 295.3 235.8 295.3Z",fill:"white"}),h.jsx("path",{d:"M279.4 288.8C280.4 290.2 282.2 288.9 282.7 288.4C283.2 287.9 284.7 287 284.1 286.2C283.5 285.2 282.4 285.3 281.7 285.4C281 285.5 279.7 286.4 279.4 286.9C279 287.433 279 288.1 279.4 288.9V288.8Z",fill:"#F8C83C"}),h.jsx("path",{d:"M279.7 288C279.7 288 279.8 286.5 281.2 286.4C281.9 286.4 282 286.6 282.6 287C283.2 287.4 283.4 286.5 283.4 286.5C283.4 286.5 283.4 287.5 282.4 287.6C281.5 287.6 281.9 287.2 280.9 287C280.1 287 279.7 288 279.7 288Z",fill:"white"}),h.jsx("path",{d:"M257.5 285.1L256.8 284.7H251.8L254.5 292.7L257.8 297.3L259 297.7L261.5 297.6L262 296.3L261 288.7L257.5 285.1Z",fill:"#F9AA51",stroke:"#953220",strokeWidth:"0.4",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M248.5 285.6L248.6 284.7L250.1 284.6L251.8 284.7C251.9 284.7 253.8 287 254.3 288.5C254.9 289.9 255.7 292.3 256.5 293.8L259 297.8H255.8L254.3 297.3L249.7 290.1L248.5 285.6Z",fill:"#F9AA51",stroke:"#953220",strokeWidth:"0.4",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M246.6 284.6L248.6 284.7C248.8 284.8 250.9 286.7 251.7 288.9C252.5 291.1 252.1 291.5 253.2 293.9C254.2 296.2 255.8 297.9 255.8 297.9C255.8 297.9 252.6 297.9 250.8 297.7C249 297.5 248.5 297.4 248.1 296.9L246.7 295.9H244.9L245.4 293.4L244.9 287.9V285L246.6 284.6ZM265.3 286.1L262.3 284.9L256.8 284.6L257.2 287.4C257.4 288.8 258.4 292 259.2 293.6C260.2 295.2 261.1 297.1 261.6 297.6C262.1 298.1 265.2 296.7 265.2 296.7L267.3 296.4L267 294.1L266.7 293.4L267.2 287L266.8 286L265.3 286.1Z",fill:"#F9AA51",stroke:"#953220",strokeWidth:"0.4",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M245.7 286.1C245.7 286.8 246.4 286.9 246.7 286.8C246.8 286.8 247.5 286.5 247.5 285.6C247.5 284.7 246.9 283.9 245.7 283.8C244.6 283.8 243.7 285.2 243.7 286.2C243.7 287.2 244.7 287.7 244.7 288.1C244.7 288.1 243.7 289 243.7 290.6C243.7 292.2 245.1 293.4 245.1 293.4C245.1 293.4 243.7 294.5 243.7 295.6C243.7 296.7 244.7 297.5 245.7 297.5C246.7 297.5 248 296.8 248 296C248 295.2 247.2 294.6 246.6 294.6C246 294.667 245.7 294.9 245.7 295.3M266.2 286.6C266.134 287.2 265.867 287.433 265.4 287.3C264.7 287.1 264.5 287.1 264.5 286.2C264.5 285.3 265.6 284.9 266.4 284.9C267.2 284.9 268.4 285.9 268.4 287.1C268.4 288.3 267.4 289.1 267.4 289.1C267.4 289.1 268 289.4 268 290.9C268 292.4 267 293.5 267 293.5C267 293.5 268.3 294 268.3 295.6C268.3 297.2 267.3 297.7 266.5 297.7C265.7 297.7 264.4 297.2 264.4 296.2C264.4 295.2 265.1 294.7 265.6 294.7C266.1 294.7 266.6 295.3 266.6 295.9",fill:"#F9AA51"}),h.jsx("path",{d:"M245.7 286.1C245.7 286.8 246.4 286.9 246.7 286.8C246.8 286.8 247.5 286.5 247.5 285.6C247.5 284.7 246.9 283.9 245.7 283.8C244.6 283.8 243.7 285.2 243.7 286.2C243.7 287.2 244.7 287.7 244.7 288.1C244.7 288.1 243.7 289 243.7 290.6C243.7 292.2 245.1 293.4 245.1 293.4C245.1 293.4 243.7 294.5 243.7 295.6C243.7 296.7 244.7 297.5 245.7 297.5C246.7 297.5 248 296.8 248 296C248 295.2 247.2 294.6 246.6 294.6C246 294.667 245.7 294.9 245.7 295.3M266.2 286.6C266.134 287.2 265.867 287.433 265.4 287.3C264.7 287.1 264.5 287.1 264.5 286.2C264.5 285.3 265.6 284.9 266.4 284.9C267.2 284.9 268.4 285.9 268.4 287.1C268.4 288.3 267.4 289.1 267.4 289.1C267.4 289.1 268 289.4 268 290.9C268 292.4 267 293.5 267 293.5C267 293.5 268.3 294 268.3 295.6C268.3 297.2 267.3 297.7 266.5 297.7C265.7 297.7 264.4 297.2 264.4 296.2C264.4 295.2 265.1 294.7 265.6 294.7C266.1 294.7 266.6 295.3 266.6 295.9",stroke:"#953220",strokeWidth:"0.4",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M247.6 295L247.9 295.4C248.033 295.8 248.233 296.133 248.5 296.4C249.2 297.1 254.3 297.3 255.9 297.3C257.5 297.3 262.1 297.5 263 297C264 296.4 264 295.6 264.5 295.2L265.2 294.8L264.6 295.4V296.4L264.9 297.1C264.9 297.1 264.9 297.4 264.3 297.7C263.833 298.033 263.233 298.233 262.5 298.3C261.7 298.3 251.9 298.3 250.3 298.1C248.7 297.9 248.8 297.8 248.3 297.5L247.6 296.8L247.9 296.1L247.6 295ZM263.6 285.5L264.4 285.9C264.4 285.9 263.7 286.1 263.1 287.7C262.5 289.2 263.1 289.7 262.6 289.9H258L257.3 288.1L263.6 285.5Z",fill:"#953220"}),h.jsx("path",{d:"M277.1 284.9C277.1 284.9 276.4 284.6 276.1 283.9C275.7 283.4 275.4 282.6 275.7 282.5C276.1 282.433 276.367 282.7 276.5 283.3C276.767 284.3 276.967 284.833 277.1 284.9ZM285.5 282.6L286.2 283.6L287.2 284.1C287.2 284.1 286 284.1 285.6 283.8L284.8 282.6H285.5
1216Z",fill:"#231F20"}),h.jsx("path",{d:"M288 283.3C288 283.3 287.3 283.7 286.7 283.5C286.033 283.233 285.733 282.967 285.8 282.7C286 282.433 286.233 282.5 286.5 282.9C286.9 283.2 288 283.3 288 283.3ZM292.2 279.7C292.2 279.7 291.6 280.3 291.2 280.3C290.8 280.3 290 280.1 290 279.9C290 279.7 291 279.6 291.2 279.6L292.2 279.7ZM285.9 271.4C285.9 271.4 284.9 271.6 284.6 272.1C284.333 272.7 284.4 273.033 284.8 273.1C285.4 273.2 285.3 272.5 285.3 272.4C285.3 272.2 285.9 271.4 285.9 271.4ZM281.7 273.7C281.7 273.7 281 274.1 280.8 274.5C280.6 274.9 280.5 275.7 280.8 275.8C281.3 275.8 281.4 275.1 281.5 274.8L281.7 273.7Z",fill:"#231F20"}),h.jsx("path",{d:"M274.2 278.7L271.9 281.1C271.9 281.1 277.2 284.1 281.3 283.9C285.3 283.9 289.9 280.6 290.3 279.9C290.5 279.3 290.3 276.5 289.8 275.6C289.3 274.7 286.4 272.6 285.4 272.6C284.4 272.7 282.4 274.2 280.7 275.8C279 277.4 279.1 279 276.7 278.8L274.2 278.7Z",fill:"#8CBEBF",stroke:"#04534E",strokeWidth:"0.4"}),h.jsx("path",{d:"M273.6 279.7C273.6 279.7 279.3 280.5 280.9 279.1C282.5 277.6 284.3 274.8 285.4 274.1C286.6 273.567 287.167 273.367 287.1 273.5L288.3 274.5L289.8 275.6L290.2 278.3V279.8L288.5 281.2L285.2 282.7L282.2 283.7L279.5 283.6L274.2 282L272.8 281.1L272.5 280.8L273.6 279.7Z",fill:"#0C8489"}),h.jsx("path",{d:"M282.2 276.4C282.267 276 282.533 275.867 283 276C283.7 276.2 283.9 276 283.9 276.5C283.9 277 283.4 277.7 282.9 277.7C282.6 277.7 282.2 276.9 282.2 276.4ZM284.5 277.8C284.5 277.4 284.767 277.2 285.3 277.2C285.9 277.2 286.3 277.8 286.3 278.2C286.3 278.6 285.9 279 285.4 279C284.9 279 284.5 278.3 284.5 277.8ZM283.7 281.2C283.7 280.733 284 280.533 284.6 280.6C285.5 280.7 285.4 280.8 285.4 281.3C285.4 281.8 285 282.3 284.4 282.3C284 282.233 283.767 281.9 283.7 281.3V281.2ZM280.7 280.2C280.7 279.6 281.3 279.4 281.7 279.4C282.233 279.467 282.533 279.8 282.6 280.4C282.533 281.067 282.267 281.433 281.8 281.5C281.2 281.367 280.867 280.933 280.8 280.2H280.7ZM276 280.8C276 280.495 276.121 280.202 276.337 279.987C276.552 279.771 276.845 279.65 277.15 279.65C277.455 279.65 277.747 279.771 277.963 279.987C278.179 280.202 278.3 280.495 278.3 280.8C278.3 281.105 278.179 281.397 277.963 281.613C277.747 281.829 277.455 281.95 277.15 281.95C276.845 281.95 276.552 281.829 276.337 281.613C276.121 281.397 276 281.105 276 280.8Z",fill:"#04534E"}),h.jsx("path",{d:"M284.5 277.8C284.633 277.4 284.9 277.2 285.3 277.2C285.7 277.2 285.9 277.433 285.9 277.9C285.9 278.367 285.733 278.6 285.4 278.6C284.933 278.533 284.633 278.267 284.5 277.8ZM283.7 281.1C283.767 280.633 284.1 280.4 284.7 280.4C285.167 280.4 285.433 280.633 285.5 281.1C285.5 281.767 285.2 282.033 284.6 281.9C283.7 281.7 283.7 281.5 283.7 281.1ZM280.7 280.1C280.7 279.6 281.6 279.4 281.9 279.4C282.167 279.4 282.267 279.667 282.2 280.2C282.067 280.867 281.867 281.167 281.6 281.1C281.133 281.033 280.867 280.7 280.8 280.1H280.7ZM282.2 276.4C282.2 276 282.4 275.833 282.8 275.9C283.4 276 283.3 276 283.3 276.5C283.3 276.967 283.133 277.233 282.8 277.3C282.333 277.3 282.133 276.967 282.2 276.3V276.4ZM276 280.4C276.067 279.8 276.433 279.467 277.1 279.4C277.9 279.4 278.367 279.633 278.5 280.1C278.5 280.7 277.7 281.6 277 281.6C276.3 281.6 276 280.9 276 280.4Z",fill:"#8CBEBF"}),h.jsx("path",{d:"M278.2 279.5C278.2 279.5 277.4 279.6 277 280C276.6 280.467 276.533 280.8 276.8 281C277.066 281 277.233 280.833 277.3 280.5L278.2 279.5ZM281.9 278.7C281.9 278.7 281.2 279.2 281.1 279.7C281.1 280.3 281.166 280.567 281.3 280.5C281.5 280.3 281.6 279.967 281.6 279.5C281.5 279.3 281.9 278.7 281.9 278.7Z",fill:"#231F20"}),h.jsx("path",{d:"M282.5 279.5C282.5 279.5 282.1 279.5 281.7 279.8C281.3 280.2 281.167 280.433 281.3 280.5C281.567 280.5 281.767 280.4 281.9 280.2C281.9 280 282.5 279.5 282.5 279.5ZM283.3 275.1L282.8 275.6C282.467 275.933 282.4 276.233 282.6 276.5C282.8 276.5 283 276.333 283.2 276C283.4 275.533 283.467 275.233 283.4 275.1H283.3ZM286.2 276.9C286.2 276.9 285.5 277 285.2 277.4C284.933 277.733 284.933 277.933 285.2 278C285.467 278.067 285.633 277.933 285.7 277.6C285.7 277.3 286.2 276.9 286.2 276.9ZM285.7 280.3C285.7 280.3 285.6 280.8 285.1 281C284.767 281.4 284.533 281.467 284.4 281.2C284.267 280.867 284.367 280.667 284.7 280.6L285.7 280.3Z",fill:"#231F20"}),h.jsx("path",{d:"M290.3 278C290.3 278 290.6 279.6 289.3 280.3C287.9 281.1 284.1 283.8 280.5 283.5C276.9 283.1 272.8 281.1 272.8 281.1L272.3 281.4L273.2 281.8L276 282.9L279.1 283.9H281.1L282.8 283.8L286 282.7L288.7 281.3L290.1 280.3L290.4 279.8V278.2L290.3 278Z",fill:"#04534E"}),h.jsx("path",{d:"M219.9 257.8C219.9 257.8 220.7 258.5 220.7 259.1C220.567 259.7 220.367 259.933 220.1 259.8C219.9 259.8 219.9 259.1 219.9 258.8V257.8ZM226.1 263.5C226.1 263.5 225.8 264.5 225.4 264.6C224.934 264.6 224.7 264.433 224.7 264.1C224.8 263.9 225.2 264.1 225.4 263.9L226.1 263.5ZM212.7 264.3C212.7 264.3 213 264.9 213.5 265C214.1 265 214.334 264.833 214.2 264.5H213.6L212.7 264.3ZM215.1 269C215.1 269 215.6 269.6 216.2 269.6C216.424 269.64 216.656 269.603 216.856 269.494C217.056 269.385 217.213 269.21 217.3 269C217.3 268.9 216.5 268.9 216.3 269.1C216 269.3 215.1 269 215.1 269ZM219.3 272.6C219.3 272.6 220.3 272.4 220.6 272.1C220.867 271.7 220.934 271.367 220.8 271.1C220.6 270.7 220.4 271.4 220.3 271.7L219.3 272.6Z",fill:"#231F20"}),h.jsx("path",{d:"M226.1 269.7C226.1 269.7 226.8 264.8 222.9 261.4C219 258 216.4 258.8 215 260.1C213.7 261.3 212.5 265.5 216.7 269.1C220.9 272.7 226 271.6 226 271.6L226.1 269.7Z",fill:"#8CBEBF",stroke:"#04534E",strokeWidth:"0.4"}),h.jsx("path",{d:"M214 264.6C214 264.6 214 261.9 215.3 261.1C215.948 260.756 216.659 260.545 217.389 260.479C218.12 260.414 218.857 260.496 219.556 260.719C220.255 260.943 220.902 261.304 221.459 261.782C222.016 262.259 222.472 262.843 222.8 263.5C224.8 267.5 224.8 269.5 224.3 271.5H222.1L218.7 270.1L215.9 268L214 264.6Z",fill:"#0C8489"}),h.jsx("path",{d:"M225.6 270.4C225.6 270.4 224.9 271.2 223.5 271.1C222 271.1 215.5 269.3 213.8 263.4V264.7L213.9 265.1L214.4 266.3L215.8 268.3L217.5 269.8L219.7 271L221.3 271.4L223.3 271.8H224.5L225.5 270.4H225.6Z",fill:"#04534E"}),h.jsx("path",{d:"M222.1 268.7C222.1 268.3 222.333 268.133 222.8 268.2C223.2 268.2 223.6 268 223.6 268.5C223.6 269 223.3 269.8 222.9 269.8C222.4 269.8 222.1 269.2 222.1 268.8V268.7ZM222.4 265.6C222.4 265.2 222.666 264.967 223.2 264.9C224 264.8 223.9 265.2 223.9 265.6C223.9 265.933 223.666 266.133 223.2 266.2C222.533 266.2 222.266 266 222.4 265.6ZM219.4 269C219.4 268.667 219.7 268.5 220.3 268.5C220.766 268.5 221.033 268.667 221.1 269C221.2 269.5 220.3 269.7 219.8 269.7C219.3 269.7 219.4 269.3 219.4 269ZM219.1 265.3C219.1 264.967 219.333 264.867 219.8 265C220.266 265 220.566 265.2 220.7 265.6C220.9 266.2 220.2 266.7 219.7 266.7C219.4 266.7 219.1 265.8 219.1 265.3ZM216.4 266C216.4 265.6 216.6 265 217.1 265C217.6 265 218.1 265.6 218.1 266C218.1 266.4 217.8 266.633 217.2 266.7C216.3 266.8 216.3 266.3 216.3 266H216.4ZM216.9 262.7C216.9 262.367 217.133 262.233 217.6 262.3C218.266 262.3 218.6 262.5 218.6 262.9C218.466 263.433 218.1 263.767 217.5 263.9C216.9 263.9 216.9 263.1 216.9 262.7ZM219.9 262.4C219.9 262.133 220.166 262.033 220.7 262.1C221.366 262.167 221.633 262.4 221.5 262.8C221.5 263.2 220.9 263.6 220.5 263.6C220.1 263.6 219.9 262.8 219.9 262.4Z",fill:"#04534E"}),h.jsx("path",{d:"M216.9 262.6C216.9 262.267 217.1 262.1 217.5 262.1C218.033 262.033 218.266 262.2 218.2 262.6C218.2 263 217.966 263.233 217.5 263.3C217.033 263.367 216.833 263.133 216.9 262.6ZM216.3 265.8C216.3 265.333 216.5 265.067 216.9 265C217.3 264.933 217.533 265.1 217.6 265.5C217.6 266.1 217.366 266.367 216.9 266.3C216.5 266.367 216.3 266.2 216.3 265.8ZM219.8 262.4C219.8 262.133 220.033 262.033 220.5 262.1C220.9 262.033 221.133 262.167 221.2 262.5C221.133 262.833 220.9 263 220.5 263C220.1 263 219.9 262.8 219.9 262.4H219.8ZM219.2 265.5C219.2 265.967 219.433 266.233 219.9 266.3C220.366 266.233 220.633 265.967 220.7 265.5C220.8 264.8 220.2 264.7 219.9 264.7C219.433 264.767 219.2 265.033 219.2 265.5ZM222.5 265C222.566 265.467 222.833 265.733 223.3 265.8C223.966 265.8 224.233 265.533 224.1 265C224.033 264.6 223.766 264.3
121667 223.3 264.3C222.6 264.2 222.5 264.7 222.5 265ZM219.3 269C219.3 268.6 219.533 268.367 220 268.3C220.466 268.233 220.7 268.433 220.7 268.9C220.566 269.3 220.233 269.567 219.7 269.7C219.433 269.633 219.3 269.4 219.3 269ZM222.2 268.5C222.2 268.167 222.433 268 222.9 268C223.5 267.933 223.733 268.1 223.6 268.5C223.466 269.1 223.2 269.367 222.8 269.3C222.4 269.233 222.166 268.967 222.1 268.5H222.2Z",fill:"#8CBEBF"}),h.jsx("path",{d:"M223 263.6C223 263.6 223.4 264.1 223.5 264.6L223.4 265.5C223.2 265.5 223.033 265.267 222.9 264.8V263.5L223 263.6ZM220.4 260.9C220.4 260.9 220.7 261.3 220.7 261.7C220.7 262.1 220.7 262.5 220.4 262.5C220.266 262.433 220.2 262.2 220.2 261.8L220.4 260.9ZM217.4 261.3C217.4 261.3 217.7 261.7 217.7 262.1C217.7 262.5 217.7 262.9 217.5 262.9C217.3 262.9 217.3 262.5 217.3 262.2L217.4 261.3Z",fill:"#231F20"}),h.jsx("path",{d:"M216.4 261.8L217.1 262.2C217.5 262.533 217.634 262.767 217.5 262.9C217.234 263.033 217.067 262.967 217 262.7L216.4 261.8ZM218.7 264.9C218.7 264.9 219.2 264.9 219.6 265.2C219.934 265.533 220.034 265.8 219.9 266C219.7 266.067 219.434 265.933 219.1 265.6L218.7 264.9ZM215.9 264.9L216.7 265.1C216.967 265.367 217.034 265.6 216.9 265.8C216.767 265.8 216.6 265.7 216.4 265.5L215.9 264.9ZM222.6 266.9L222.7 267.9C222.767 268.5 222.734 268.833 222.6 268.9C222.4 269 222.3 268.3 222.3 267.9L222.6 266.9Z",fill:"#231F20"}),h.jsx("path",{d:"M221.8 268L222.5 268.3C222.7 268.567 222.7 268.733 222.5 268.8L222.2 268.4L221.8 268ZM218.8 268.1L219.6 268.3C219.8 268.633 219.866 268.967 219.8 269.3C219.666 269.367 219.5 269.233 219.3 268.9L218.8 268.1Z",fill:"#231F20"}),h.jsx("path",{d:"M217.7 259C217.7 259 215.1 259.6 214.7 261.3C214.1 263 214.1 264.9 214.1 264.9L213.7 262.7L214.3 261.4L215 260.1L216.2 259.4L217.2 259H217.7ZM225.9 269C225.9 269 226.1 268.4 225.4 266.4C224.6 264.3 223 261.6 223 261.6L224.2 263L225.2 264.6L225.7 266L226.1 267.3V268.6L225.9 269Z",fill:"#04534E"}),h.jsx("path",{d:"M228.5 265.7C228.5 265.7 229.5 266.3 229.5 266.7V267.2C229.1 267.133 228.834 266.967 228.7 266.7L228.5 265.7ZM224.7 276C224.7 276 225.1 275.2 225.7 275C226.367 274.667 226.734 274.6 226.8 274.8C227 275 226.5 275.5 226.1 275.6L224.7 276ZM231.1 278.5C231.1 278.5 231.8 278.2 232.1 277.7C232.5 277.3 232.634 277 232.5 276.8C232.234 276.733 231.9 276.9 231.5 277.3L231.1 278.5ZM230.4 277.9C230.4 277.9 230.6 277.1 230.9 276.8C231.1 276.533 231.334 276.433 231.6 276.5C231.8 276.7 231.8 276.933 231.6 277.2L230.4 277.9Z",fill:"#231F20"}),h.jsx("path",{d:"M241.2 273C241.2 273 237.2 267.2 230.9 266.9C225.9 266.6 224.4 271.1 224.6 272.4C224.7 273.8 226.6 276.7 233.3 277.1C240 277.5 241 274.1 241.3 273.8C241.5 273.7 241.2 273 241.2 273Z",fill:"#8CBEBF",stroke:"#04534E",strokeWidth:"0.4"}),h.jsx("path",{d:"M236.5 269C236.5 269 238.1 270.3 238.8 271.3C239.5 272.3 239.7 273 239.3 273.1C238.9 273.2 235.3 269.9 232.3 269.2C229.3 268.5 226.8 269.2 226.2 270.6C225.6 272 225.8 274.1 227.2 275C228.6 275.9 234.9 277 234.9 277L237.9 276.5L239.7 275.5L240.1 274.5L240.5 273.1L240.7 272.6L239.2 270.9L236.5 269Z",fill:"#0C8489"}),h.jsx("path",{d:"M231.4 269.8C231.333 270.2 231.067 270.4 230.6 270.4C230 270.4 229.767 270.2 229.9 269.8C229.9 269.4 230.133 269.167 230.6 269.1C231.067 269.033 231.333 269.267 231.4 269.8ZM227.7 271.1C227.7 270.833 228 270.733 228.6 270.8C229.5 270.9 229.3 271.1 229.3 271.4C229.3 271.8 228.6 272.4 228.3 272.2C227.833 271.867 227.633 271.533 227.7 271.2V271.1ZM231.7 273.3C231.7 272.767 231.967 272.467 232.5 272.4C233.233 272.4 233.567 272.7 233.5 273.3C233.3 274.1 232.9 274.433 232.3 274.3C231.4 274.1 231.6 273.8 231.6 273.3H231.7Z",fill:"#04534E"}),h.jsx("path",{d:"M228.7 274.2C228.767 273.8 229.034 273.633 229.5 273.7C229.9 273.767 230.167 274.033 230.3 274.5C230.5 275.2 229.8 275.2 229.5 275.2C229.034 275.067 228.767 274.733 228.7 274.2Z",fill:"#8CBEBF"}),h.jsx("path",{d:"M234 275.6C234 275.267 234.167 275.067 234.5 275C234.967 275 235.233 275.167 235.3 275.5C235.3 275.967 235.067 276.2 234.6 276.2L234 275.6ZM236.4 273.8C236.4 273.467 236.6 273.333 237 273.4C237.533 273.4 237.833 273.633 237.9 274.1C237.833 274.5 237.5 274.7 236.9 274.7C236.5 274.633 236.333 274.3 236.4 273.7V273.8Z",fill:"#04534E"}),h.jsx("path",{d:"M231.1 269.5C231.1 269.833 230.967 270 230.7 270C230.234 270 229.967 269.833 229.9 269.5C229.9 269.167 230.067 269 230.4 269C230.867 269 231.1 269.167 231.1 269.5ZM229.2 271C229.134 271.4 228.834 271.6 228.3 271.6C227.5 271.6 227.8 271.4 227.8 271C227.8 270.733 228 270.6 228.4 270.6C228.8 270.533 229.067 270.667 229.2 271ZM230.1 274.1C230.1 274.433 229.934 274.633 229.6 274.7C229.067 274.7 228.767 274.5 228.7 274.1C228.6 273.5 228.9 273.6 229.2 273.6C229.734 273.6 230.034 273.767 230.1 274.1ZM233.2 273.1C233.067 273.5 232.734 273.733 232.2 273.8C231.4 273.9 231.7 273.2 231.7 272.8C231.7 272.467 231.934 272.267 232.4 272.2C232.8 272.267 233.067 272.567 233.2 273.1Z
1216M237.9 274.1C237.767 274.367 237.434 274.467 236.9 274.4C236.634 274.333 236.467 274.067 236.4 273.6C236.4 273.3 236.4 273 237.3 273.1C237.634 273.233 237.834 273.567 237.9 274.1ZM235.1 275.4C235.1 275.8 234.9 276.033 234.5 276.1L233.9 275.5C233.9 275.1 234.1 274.933 234.5 275C234.9 275.067 235.1 275.233 235.1 275.5V275.4Z",fill:"#8CBEBF"}),h.jsx("path",{d:"M235.6 273.5C235.6 273.5 236.2 273.3 236.6 273.4C237.066 273.4 237.266 273.5 237.2 273.7L236.6 273.9L235.6 273.5ZM232.9 275.8L233.8 275.4C234.266 275.4 234.466 275.5 234.4 275.7C234.4 275.967 234.233 276.067 233.9 276L232.9 275.8ZM231.1 271.8C231.1 271.8 232.2 272.3 232.5 272.8C232.766 273.133 232.766 273.333 232.5 273.4C232.3 273.533 232.1 273.433 231.9 273.1L231.1 271.8Z",fill:"#231F20"}),h.jsx("path",{d:"M230.8 273.3L232.1 273C232.5 273 232.666 273.067 232.6 273.2C232.533 273.333 232.4 273.433 232.2 273.5L230.8 273.2V273.3ZM228.1 273.3C228.1 273.3 229.1 273.4 229.3 273.7C229.5 273.9 229.533 274.1 229.4 274.3C229.2 274.367 228.966 274.333 228.7 274.2C228.3 274 228.1 273.3 228.1 273.3Z",fill:"#231F20"}),h.jsx("path",{d:"M228 274.6C228 274.6 228.3 274.1 228.7 274H229.5C229.5 274.333 229.3 274.533 228.9 274.6H228ZM227.3 270.6L228.2 270.8C228.534 271.067 228.634 271.267 228.5 271.4H227.8C227.4 271 227.2 270.733 227.2 270.6H227.3ZM229.3 268.2C229.3 268.2 230.3 268.5 230.5 268.9C230.767 269.3 230.834 269.567 230.7 269.7L229.9 269.3L229.3 268.2Z",fill:"#231F20"}),h.jsx("path",{d:"M240 275C240 275 238.1 276.6 233.8 276.5C229.5 276.4 225.5 274.5 224.6 272.5L225 273.5L226 274.7L229 276.3L232.4 277L235.1 277.2L237.6 276.8L239.6 275.8L239.9 275.3L240.1 275H240ZM240.6 273L238.9 271L233.9 267.6L237.1 269L239.2 270.8L240.7 272.4L240.6 273Z",fill:"#04534E"}),h.jsx("path",{d:"M240.8 269C240.8 269 241.9 269.5 242.1 269.8L242.5 270.3C242.5 270.3 242.2 271 242 270.7L241.4 270L240.8 269ZM244.1 267.3C244.1 267.3 245.1 267.8 245.4 268.3C245.733 268.833 245.8 269.167 245.6 269.3C245.4 269.3 244.7 268.7 244.6 268.5L244.1 267.3Z",fill:"#231F20"}),h.jsx("path",{d:"M245 267.1C245 267.1 246 267.8 246.2 268.1C246.534 268.5 246.6 268.833 246.4 269.1C246 268.967 245.667 268.7 245.4 268.3L245 267.1ZM250.6 268.4C250.6 268.4 251.3 268.7 251.4 269.4V270.4L250.8 269.8V269.3L250.6 268.4ZM252 268.9C252 268.9 252.6 269.5 252.7 269.9C252.767 270.3 252.7 270.533 252.5 270.6C252.167 270.6 252 270.4 252 270V269V268.9ZM242.2 280.9C242.2 280.9 242.7 281.1 243.1 280.9C243.634 280.7 243.867 280.433 243.8 280.1C243.8 279.767 243.6 279.733 243.2 280L242.8 280.6L242.2 280.9ZM247.6 282.4C247.6 282.4 248.3 282.3 248.8 281.7C249.334 281.167 249.467 280.833 249.2 280.7C248.8 280.567 248.5 280.7 248.3 281.1L247.6 282.4ZM252 282.5L253 281.8C253.467 281.467 253.6 281.133 253.4 280.8C253.134 280.667 252.9 280.7 252.7 280.9L252.6 281.5L252 282.5Z",fill:"#231F20"}),h.jsx("path",{d:"M253.4 282.5C253.4 282.5 254 281.8 254.1 281.4C254.234 280.867 254.234 280.6 254.1 280.6C253.767 280.667 253.534 280.867 253.4 281.2V282.5Z",fill:"#231F20"}),h.jsx("path",{d:"M239.9 275.3C239.9 273.3 242.7 268.8 245.9 268.9C247.2 268.9 249.9 269.6 251.9 270.6C253.7 271.4 254.3 272.2 255.4 272.6C256.6 272.8 258.4 272.6 258.4 272.6L262.4 272.1L259.2 276.7L258.2 277.7C258.2 277.7 257.2 279.7 254.2 280.7C251.5 281.8 246.7 281 244.5 280.5C242.3 280 239.8 277.9 239.9 275.3Z",fill:"#8CBEBF",stroke:"#04534E",strokeWidth:"0.4"}),h.jsx("path",{d:"M239.9 275.3H240.1C240.1 274.9 240.267 274.333 240.6 273.6C241.11 272.479 241.822 271.462 242.7 270.6C243.7 269.667 244.734 269.167 245.8 269.1C247.861 269.371 249.878 269.909 251.8 270.7L253.8 271.9C254.72 272.592 255.85 272.945 257 272.9L258.4 272.8L261.9 272.4L259.1 276.6L257.9 277.6C257.055 279.002 255.746 280.063 254.2 280.6C253.2 280.933 252.034 281.1 250.7 281.1C248.4 281.1 245.9 280.6 244.6 280.3C243.474 279.992 242.443 279.408 241.6 278.6C240.727 277.751 240.194 276.614 240.1 275.4V275.3H239.7C239.709 275.977 239.856 276.645 240.131 277.264C240.406 277.883 240.804 278.439 241.3 278.9C242.188 279.774 243.292 280.395 244.5 280.7C245.9 281 248.3 281.5 250.7 281.5C251.959 281.513 253.21 281.31 254.4 280.9C257.3 279.8 258.3 277.9 258.3 277.8L258.1 277.7L258.2 277.9L259.4 276.9L262.8 271.9L258.3 272.4H257L255.5 272.3C254.967 272.167 254.467 271.933 254 271.6C253.6 271.2 252.934 270.8 252 270.4L248.7 269.2C247.567 268.867 246.634 268.7 245.9 268.7C244.967 268.7 244.134 268.967 243.4 269.5C242.343 270.236 241.456 271.191 240.8 272.3C240.207 273.202 239.831 274.228 239.7 275.3H239.9Z",fill:"#04534E"}
1216),h.jsx("path",{d:"M259.2 275.9C258.867 276.167 258.5 276.267 258.1 276.2C257.6 276.2 248.8 270.8 246.1 271C243.3 271.2 240.7 272.4 240.6 275.2C240.5 278 241.2 278.1 241.8 278.9C242.4 279.7 247.8 280.9 247.8 280.9H251L253.7 280.5L256 279.2L257.3 278.2L258.2 277.2L259.2 275.9Z",fill:"#0C8489"}),h.jsx("path",{d:"M245.2 274.5C245.2 275.1 244.933 275.433 244.4 275.5C243.867 275.567 243.567 275.267 243.5 274.6C243.5 274.133 243.767 273.9 244.3 273.9C244.967 273.767 245.267 273.967 245.2 274.5ZM246.2 272C246.2 271.6 246.5 271.4 247.1 271.4C248 271.4 248 271.5 248 272C248 272.5 247.6 272.8 247 272.8C246.4 272.8 246.1 272.5 246.1 272H246.2ZM251.4 273.5C251.467 273.033 251.733 272.767 252.2 272.7C252.867 272.7 253.133 272.967 253 273.5C252.8 274.3 252.6 274.2 252.2 274.2C252.014 274.17 251.841 274.089 251.699 273.965C251.558 273.841 251.454 273.68 251.4 273.5ZM252.4 276.7C252.4 276.1 252.733 275.767 253.4 275.7C253.867 275.7 254.133 275.967 254.2 276.5C254.2 277.233 254 277.567 253.6 277.5C252.933 277.5 252.567 277.233 252.5 276.7H252.4ZM249.9 278.7C249.9 278.3 250.2 278.067 250.8 278C251.7 277.9 251.6 278.3 251.6 278.8C251.6 279.2 251.333 279.433 250.8 279.5C250.333 279.5 250.033 279.267 249.9 278.8V278.7ZM245 277.9C245.067 277.5 245.333 277.267 245.8 277.2C245.921 277.155 246.051 277.14 246.179 277.156C246.307 277.173 246.429 277.22 246.535 277.293C246.641 277.367 246.728 277.465 246.787 277.579C246.847 277.694 246.878 277.821 246.878 277.95C246.878 278.079 246.847 278.206 246.787 278.321C246.728 278.435 246.641 278.533 246.535 278.607C246.429 278.68 246.307 278.727 246.179 278.744C246.051 278.76 245.921 278.745 245.8 278.7C245.601 278.663 245.419 278.567 245.276 278.424C245.133 278.281 245.037 278.099 245 277.9Z",fill:"#04534E"}),h.jsx("path",{d:"M245.2 274.4C245.2 274.867 244.9 275.133 244.3 275.2C244.101 275.163 243.919 275.067 243.776 274.924C243.633 274.781 243.537 274.598 243.5 274.4C243.567 273.933 243.833 273.733 244.3 273.8C244.767 273.867 245.067 274.033 245.2 274.3V274.4ZM247.7 271.9C247.7 272.3 247.533 272.533 247.2 272.6C246.6 272.6 246.267 272.333 246.2 271.8C246.2 271.4 246.433 271.167 246.9 271.1C247.433 271.1 247.7 271.367 247.7 271.9ZM252.9 273.2C252.833 273.6 252.567 273.833 252.1 273.9C251.5 273.9 251.267 273.667 251.4 273.2C251.4 272.867 251.633 272.667 252.1 272.6C252.767 272.6 253.033 272.8 252.9 273.2Z",fill:"#8CBEBF"}),h.jsx("path",{d:"M250.1 275.4C250.1 276.067 249.867 276.4 249.4 276.4C248.734 276.4 248.4 276.1 248.4 275.5C248.4 275.033 248.7 274.8 249.3 274.8C250.2 274.8 250.1 274.8 250.1 275.4Z",fill:"#04534E"}),h.jsx("path",{d:"M246.4 277.8C246.4 278.2 246.133 278.433 245.6 278.5C245.414 278.47 245.241 278.389 245.099 278.265C244.958 278.141 244.854 277.98 244.8 277.8C244.866 277.333 245.2 277.1 245.8 277.1C246.2 277.1 246.4 277.3 246.4 277.7V277.8ZM250 275.3C249.963 275.499 249.867 275.681 249.724 275.824C249.581 275.967 249.398 276.063 249.2 276.1C249.001 276.063 248.819 275.967 248.676 275.824C248.533 275.681 248.437 275.499 248.4 275.3C248.437 275.101 248.533 274.919 248.676 274.776C248.819 274.633 249.001 274.537 249.2 274.5C249.398 274.537 249.581 274.633 249.724 274.776C249.867 274.919 249.963 275.101 250 275.3ZM254.2 276.3C254.2 276.967 253.933 277.3 253.4 277.3C253.135 277.3 252.88 277.195 252.693 277.007C252.505 276.82 252.4 276.565 252.4 276.3C252.4 275.9 252.633 275.7 253.1 275.7C253.766 275.7 254.1 275.933 254.1 276.4L254.2 276.3ZM251.5 278.6C251.5 279 251.233 279.233 250.7 279.3C250.033 279.3 249.733 279.067 249.8 278.6C249.866 278.133 250.166 277.9 250.7 277.9C251.166 277.9 251.433 278.133 251.5 278.6Z",fill:"#8CBEBF"}),h.jsx("path",{d:"M251.8 276C251.8 276 253.1 275.8 253.4 276C253.6 276.333 253.6 276.6 253.4 276.8L252.7 276.7L251.8 276ZM250.5 271.7C250.5 271.7 251.5 272 251.9 272.4C252.233 272.867 252.333 273.167 252.2 273.3C252.067 273.433 251.833 273.367 251.5 273.1L250.5 271.7ZM247.5 273.7C247.5 273.7 248.7 274.4 248.9 274.7C249.233 275.1 249.3 275.4 249.1 275.6C249.1 275.7 248.4 275.6 248.3 275.3L247.5 273.7Z",fill:"#231F20"}),h.jsx("path",{d:"M247 274.6C247 274.6 248.3 274.8 248.6 275.1C249 275.233 249.2 275.367 249.2 275.5C249.2 27
12165.633 249.067 275.767 248.8 275.9L247.8 275.5C247.8 275.3 247 274.7 247 274.7V274.6ZM245.4 270.8C245.4 270.8 246.8 271 247.1 271.2C247.433 271.533 247.433 271.867 247.1 272.2C246.767 272.267 246.5 272.133 246.3 271.8C246.3 271.5 245.4 270.8 245.4 270.8ZM242.5 272.8C242.5 272.8 243.8 273.4 244.2 274C244.533 274.333 244.533 274.533 244.2 274.6C243.8 274.8 243.4 274.1 243.4 274L242.5 272.8Z",fill:"#231F20"}),h.jsx("path",{d:"M242.3 274.4L243.4 274.3C243.933 274.167 244.266 274.2 244.4 274.4C244.266 274.667 244 274.767 243.6 274.7L242.3 274.4ZM249.1 278.9C249.1 278.9 250.1 278.3 250.4 278.4C250.866 278.4 251.066 278.5 251 278.7C250.8 278.9 250.6 278.967 250.4 278.9H249.2H249.1ZM244.3 278.2C244.3 278.2 244.7 277.7 245 277.6L245.6 277.7C245.533 277.967 245.366 278.133 245.1 278.2H244.3Z",fill:"#231F20"}),h.jsx("path",{d:"M258 277.3C258 277.3 256.8 278.9 255 279.7C253 280.5 251.7 280.7 249.1 280.6C247.139 280.565 245.216 280.05 243.5 279.1C242.2 278.477 241.068 277.551 240.2 276.4C239.9 275.8 240.5 277.4 240.5 277.4L242 279.4L244 280.2L246.7 280.9L249.3 281.2H251.3L253.7 280.8L255.3 280.3L256.3 279.6L257.1 279L258 277.3ZM255.6 272.6C255.6 272.6 254.9 272.8 253.3 271.9C251.7 270.9 249.8 269.6 246.3 269.6C242.7 269.6 241.5 272 241.3 272.2L242.9 270.1L244.5 269.1L245.8 269H247L248.6 269.5L250 269.9L251.7 270.5L253.2 271.3L254.9 272.2L255.6 272.6ZM260.4 273.6H257.7C257.234 273.667 257 273.8 257 274L256.8 274.4L256.1 273L259 272.6L260.6 273.2L260.4 273.7V273.6Z",fill:"#04534E"}),h.jsx("path",{d:"M256.6 288.3C256.733 288.767 257 289.033 257.4 289.1H258.8L261.6 288.9L262.6 287.8L263.2 285.2L264 284.2L266.6 282.7L268.9 282.1L270.4 281.9L272.4 281.2L273.9 280.5L274.5 279.5L275.2 278L274.5 276L272.9 274L270.3 272.9H268L265.5 273.8L261.2 274.8C261.2 274.8 258.7 275.8 257.7 277.8C256.7 279.6 256.7 280.1 256.6 282.6C256.5 285.1 256.6 288.3 256.6 288.3Z",fill:"#0C8489",stroke:"#04534E",strokeWidth:"0.4"}),h.jsx("path",{d:"M257.7 287.4C258.6 287.4 257.9 286 258.9 284.4C259.9 282.8 260.9 280.7 261.3 280.7C261.5 280.833 261.733 280.9 262 280.9C262.3 280.8 263 280.2 263 280.1C262.866 279.767 263.1 279.2 263.7 278.4C264.4 277.8 265.5 277 265.9 276.9C266.366 276.767 266.633 276.767 266.7 276.9C266.8 277.1 266.5 277.4 266.8 277.6C267.266 277.667 267.7 277.5 268.1 277.1L268.2 276.4C268.1 276.4 268.7 275.9 269.7 276.1C270.7 276.3 270.7 276.3 270.8 276.6C270.9 277 270.4 277 270.5 277.3V277.7C270.6 277.9 270.8 278.5 271.5 278.5C272.1 278.367 272.366 278.233 272.3 278.1L272.5 277.8C272.5 277.8 272.7 277.4 272.5 277.2C272.233 276.933 272.233 276.867 272.5 277C272.8 277 273.7 278.4 274.1 277.9C274.366 277.167 274.433 276.633 274.3 276.3L272.7 274.1L270.3 273.2L267.1 273.5L263.9 275.3L261 276.8C261 276.8 260.9 279.2 260.4 278.8C259.8 278.3 259.1 277.2 258.9 277.5L257.9 280.5C257.6 281.4 256.7 284 256.9 285C256.9 286 257.4 287.4 257.7 287.4Z",fill:"#8CBEBF"}),h.jsx("path",{d:"M260.6 283.6L260 283.9L259.8 284.7C259.9 285 260.4 285.3 260.4 285.3H260.8L261.5 285.1C261.5 285.1 261.8 284.8 261.8 284.4C261.8 284.067 261.7 283.9 261.5 283.9L260.6 283.6ZM265.6 279.5C265.133 279.433 264.9 279.5 264.9 279.7V280.2C264.9 280.2 264.9 280.8 265.2 280.9C265.5 281 266 281.2 266.2 281C266.4 280.867 266.533 280.633 266.6 280.3C266.6 279.9 266 279.7 266 279.7L265.6 279.5ZM269.6 280.5C269.533 280.3 269.3 280.2 268.9 280.2C268.5 280.2 268.333 280.5 268.4 281.1C268.6 281.567 268.933 281.7 269.4 281.5C269.8 281.5 269.7 280.9 269.7 280.8L269.6 280.4V280.5ZM258 281.2C258.067 281.6 258.4 281.833 259 281.9C259.234 281.905 259.462 281.827 259.645 281.681C259.828 281.535 259.953 281.329 260 281.1C260 280.8 259.7 281.4 259.3 281.5H258.4L258.1 281.2H258Z",fill:"#8CBEBF"}),h.jsx("path",{d:"M261.8 284.4C261.8 284.4 261.8 284.9 261.5 285.2L260.7 285.4C260.433 285.4 260.233 285.333 260.1 285.2L259.8 284.6C259.8 284.6 260.2 285.3 260.8 285.1C261.4 284.9 261.8 284.4 261.8 284.4ZM272.5 277.8C272.5 277.8 272.5 278.3 272.1 278.5C271.7 278.7 271.433 278.767 271.3 278.7C271.033 278.7 270.833 278.6 270.7 278.4C270.2 277.7 270.5 277.2 270.5 277.2C270.5 277.2 270.8 278.5 271.5 278.4C272.2 278.3 272.5 277.8 272.5 277.8ZM263 280C263 280 262.6 281 262 281C261.4 281 261.4 280.9 261.4 280.7H262C262.3 280.7 263 280.1 263 280.1V280ZM264.8 279.9C264.8 279.9 264.8 280.6 265 280.9C265.2 281.1 265.466 281.2 265.8 281.2C266.133 281.2 266.366 281.1 266.5 280.9V280.3L266.4 280.6L265.8 280.9C265.533 280.9 265.3 280.8 265.1 280.6L264.8 279.9ZM268.2 276.4C268.2 276.4 268.4 276.9 268 277.4C267.6 277.9 266.8 277.6 266.8 277.6C266.8 277.6 267.4 277.7 267.8 277.4C268.1 277 268.2 276.4 268.2 276.4Z",fill:"#04534E"}),h.jsx("path",{d:"M257.4 288.9C257.4 288.9 261.6 288.9 261.9 288.2C262.3 287.7 261.6 285.4 264.1 283.6C266.6 281.8 268.6 281.8 270 281.7C271.3 281.7 274.2 280.7 274.8 278.1C275.1 276.5 272.9 276.4 272.1 274.9C271.3 273.4 269.2 274 269.1 274C269.1 274 266.7 274 265.6 275C265 275.7 265.1 276.5 264.7 276.8C264.5 277.2 261.7 276.8 261.4 277.3C261.1 277.8 261.4 278.7 261.2 278.9C261 279.1 260.4 278.3 260.4 278.3L260.6 276L264.1 274L268.1 271.7H270.9L273.7 273.2L275.1 274.8C275.1 274.8 275.4 27
12165.4 275.5 276.6L275.4 278.2C275.002 279.329 274.275 280.314 273.313 281.027C272.351 281.74 271.197 282.148 270 282.2C267.6 282.3 265.4 283.4 264.4 284.2C263.3 285 262.7 288.5 262.7 288.9C262.7 289.3 257.5 289.1 257.5 289.1L257.4 288.9Z",fill:"#04534E"}),h.jsx("path",{d:"M259.1 280.7C258.834 280.9 258.634 280.867 258.5 280.6C258.3 279.9 258.8 278.9 258.8 278.9V280.1L259.2 280.4L259.1 280.7ZM261.8 280.1C261.6 280.1 261.6 279.4 261.8 279.1L263.1 278L262.6 279.2C262.5 279.5 262.1 280.2 261.8 280.2V280.1ZM260.8 284.4C260.6 284.4 260.5 284.133 260.5 283.6C260.5 282.8 261.3 282.3 261.3 282.3L261.1 283.3V284C261.1 284.267 261 284.4 260.8 284.4Z",fill:"#231F20"}),h.jsx("path",{d:"M262.7 283.2L261.9 283.9C261.434 284.233 261.067 284.4 260.8 284.4C260.5 284.4 260.9 283.8 261.1 283.7L262.7 283.2ZM266.3 278.1L265.6 279.1C265.334 279.7 265.334 280.033 265.6 280.1C265.8 280.3 266.1 279.5 266.1 279.3L266.3 278.1Z",fill:"#231F20"}),h.jsx("path",{d:"M267.6 279.9C267.6 279.9 267.3 279.6 266.7 279.4C266.1 279.333 265.767 279.4 265.7 279.6C265.7 279.8 265.3 280 265.5 280.2L266.2 279.9L266.9 279.8H267.7L267.6 279.9ZM266.9 276.4C267.1 276.4 267.367 276.233 267.7 275.9L268.2 274.9L267.4 275.4C267 275.733 266.834 276.067 266.9 276.4ZM272.4 276.2L271.4 276.9C271.134 277.233 271.034 277.5 271.1 277.7C271.367 277.767 271.6 277.633 271.8 277.3L272.4 276.3V276.2ZM270.8 279.9C270.8 279.9 270.6 280.4 270.1 280.7C269.6 281 269.1 281.1 269.1 281C268.967 28
12160.733 269.034 280.533 269.3 280.4L270 280.2L270.8 279.9Z",fill:"#231F20"}),h.jsx("path",{d:"M234.379 271.172C235.634 271.365 236.883 270.016 237.167 268.159C237.451 266.303 236.663 264.643 235.407 264.451C234.152 264.259 232.904 265.607 232.62 267.464C232.335 269.32 233.123 270.98 234.379 271.172Z",fill:"url(#paint0_radial_4989_137735)"}),h.jsx("path",{d:"M236.3 261.5L234.9 265L236 264.8L236.7 261.8L236.3 261.5Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),h.jsx("path",{d:"M237 260C236.334 260 236 260.333 236 261C235.934 261.467 236.167 261.8 236.7 262C237.3 262 237.634 261.7 237.7 261.1C237.767 260.5 237.5 260.167 236.9 260.1L237 260ZM295.8 268.6L292.4 271.8L293.8 272.1L296.1 269.1L295.8 268.6Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),h.jsx("path",{d:"M297.3 267.3C296.634 267.1 296.067 267.267 295.6 267.8C295.513 267.92 295.453 268.059 295.426 268.205C295.399 268.351 295.405 268.502 295.443 268.645C295.481 268.789 295.551 268.922 295.648 269.036C295.744 269.149 295.865 269.239 296 269.3C296.5 269.6 297.3 269.3 297.6 268.8C297.688 268.68 297.747 268.541 297.774 268.395C297.801 268.249 297.796 268.099 297.757 267.955C297.719 267.811 297.649 267.678 297.553 267.565C297.456 267.451 297.336 267.361 297.2 267.3H297.3ZM210.2 250.4L212 254.3L212.8 253.3L210.8 250.3L210.2 250.4Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),h.jsx("path",{d:"M209.5 248.7C209.387 248.787 209.294 248.896 209.227 249.022C209.16 249.147 209.12 249.285 209.111 249.427C209.101 249.569 209.122 249.712 209.172 249.845C209.222 249.978 209.3 250.099 209.4 250.2C209.867 250.733 210.367 250.8 210.9 250.4C211.013 250.313 211.106 250.204 211.174 250.078C211.241 249.953 211.281 249.815 211.29 249.673C211.299 249.531 211.279 249.388 211.229 249.255C211.179 249.122 211.101 249.001 211 248.9C210.922 248.78 210.818 248.678 210.696 248.602C210.575 248.525 210.438 248.476 210.296 248.457C210.154 248.438 210.009 248.45 209.872 248.492C209.734 248.534 209.608 248.605 209.5 248.7Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),h.jsx("path",{d:"M237.3 260.2C236.9 260.2 236.1 260.5 236.1 261.1C236.167 261.633 236.434 261.9 236.9 261.9H236.3L236.1 261.5L235.9 261.1L236 260.6L236.3 260.2L236.7 260.1H237L237.3 260.2Z",fill:"#AA8C30"}),h.jsx("path",{d:"M236.5 262.5C236.5 262.5 236.3 262.5 236.1 262.8L235.5 263.6L236.2 261.7L236.7 261.9L236.5 262.5ZM297.5 267.6C297.2 267.3 296.1 267.4 295.8 268C295.6 268.667 295.767 269.1 296.3 269.3C296.8 269.5 296.1 269.3 296.1 269.3L295.6 268.9L295.5 268.5V267.9L295.9 267.5L296.5 267.2H297L297.3 267.4L297.6 267.6H297.5Z",fill:"#AA8C30"}),h.jsx("path",{d:"M295.5 269.8H294.9L293.7 270.5L295.6 268.8L296 269.3L295.5 269.8ZM209.9 248.5C209.6 248.8 209.3 249.7 209.7 250.1C209.881 250.255 210.112 250.34 210.35 250.34C210.589 250.34 210.819 250.255 211 250.1C211.4 249.8 211 250.3 211 250.3L210.4 250.6H210L209.5 250.4L209.2 249.9V249.3L209.3 248.8L209.6 248.6L209.9 248.5Z",fill:"#AA8C30"}),h.jsx("path",{d:"M211.2 251C211.2 251 211 251.2 211.1 251.6L211.3 252.8L210.3 250.6L210.8 250.4L211.2 251Z",fill:"#AA8C30"}),h.jsx("path",{d:"M212.036 258.936C212.967 260.755 214.718 261.72 215.947 261.091C217.176 260.462 217.418 258.477 216.487 256.658C215.556 254.839 213.805 253.874 212.576 254.503C211.347 255.132 211.105 257.117 212.036 258.936Z",fill:"url(#paint1_radial_4989_137735)"}),h.jsx("path",{d:"M210 257C210 257 210.8 257.2 211.2 257C211.6 256.667 211.8 256.433 211.8 256.3L212 255.6L211.2 254.4H210.4C210.4 254.2 210.334 254.033 210.2 253.9C210 253.9 208.9 255.2 209.1 255.4C209.3 255.6 209.4 255.3 209.5 255.4V256.4L210 257Z",fill:"#E92736"}),h.jsx("path",{d:"M211.2 254.5C211.2 254.7 211.7 255.3 211.9 255.3H212.8C212.9 255.3 213.5 254.8 213.5 254.5L213.4 253.9C213.3 253.7 213.4 253.1 213.1 253C212.967 253 212.867 252.933 212.8 252.8L212.6 252.3C212.5 252 210.6 253.1 210.8 253.3L211.2 253.5V254.5Z",fill:"#E92736"}),h.jsx("path",{d:"M215.4 254L215.3 252.6C215.033 252.6 214.833 252.5 214.7 252.3C214.833 252.233 214.933 252.1 215 251.9C215.1 251.6 213 252 213 252.2C213.2 252.5 213.5 252.3 213.5 252.5L213.1 253L213.3 253.9L213.5 254.3L214 254.4H215.1L215.4 254ZM232.9 264.3C232.9 264.3 233.2 264.9 233.6 265H234.3C234.5 265 234.7 264.9 234.9 264.7L235.2 263.6L234.7 263L234.9 262.6C234.9 262.4 233.3 262.6 233.3 262.8C233.3 263 233.5 262.9 233.5 263.1L232.9 263.6V264.3Z",fill:"#E92736"}),h.jsx("path",{d:"M235 263.6V264.6L235.5 265.1H236.4L236.7 264.6L237.1 264L237 263.6C237.133 263.533 237.233 263.4 237.3 263.2C237.4 262.9 235.6 262.4 235.6 262.6L235.7 263C235.7 263 235.1 263.4 235.1 263.6H235Z",fill:"#E92736"}),h.jsx("path",{d:"M237.8 266C238 265.9 238.6 265.3 238.6 265L238.5 264.6L238.9 264.5C238.9 264.4 237.6 263.2 237.6 263.5C237.5 263.7 237.8 263.8 237.6 263.9H237.2L236.7 264.6L236.6 264.9L236.7 265.3L237.4 266H237.8ZM290.7 270.4C290.7 270.4 290.7 271 291 271.4L291.6 271.7H292.2C292.4 271.7 292.9 271 292.9 270.8V270.1L293.1 269.9C293.2 269.7 291.8 269 291.7 269.3V269.6L291 269.8L290.7 270.4Z",fill:"#E92736"}),h.jsx("path",{d:"M292.7 270.8L292.2 271.4V272.1L293.1 272.5L293.5 272.3C293.834 272.3 294.067 272.2 294.2 272V271.7L294.7 271.5C294.8 271.4 293.7 270.2 293.6 270.3V270.6L292.7 270.8Z",fill:"#E92736"}),h.jsx("path",{d:"M293.2 273.8H294.2L294.5 273.4L294.8 273.5C295 273.5 294.8 272 294.7 272.1C294.567 272.167 294.5 272.267 294.5 272.4C294.3 272.4 294.167 272.3 294.1 272.1L293.4 272.2C293.2 272.2 293.067 272.267 293 272.4L292.9 272.7V273.6L293.2 273.8Z",fill:"#E92736"}),h.jsx("path",{d:"M211.3 255.3C211.5 255.5 211.3 256.1 211.1 256.3C211 256.5 210.1 256.3 210.1 256.1V255.4C210.233 255.2 210.466 255.033 210.8 254.9C211.066 254.967 211.233 255.1 211.3 255.3ZM211.6 254.1C211.533 254.433 211.6 254.633 211.8 254.7C211.8 254.9 212.5 255 212.8 254.9C212.8 254.9 213.2 253.8 213 253.6C212.866 253.467 212.666 253.433 212.4 253.5L211.6 254.1ZM213.8 253.1V253.7C213.8 253.7 214.3 254.1 214.6 254.1C214.8 254.1 214.9 253.3 214.9 253.1C214.9 252.9 214.9 253 214.7 252.9L213.8 253.1ZM234.7 264.1C234.7 264.4 234.1 264.6 233.9 264.6C233.7 264.6 233.4 263.9 233.5 263.8C233.5 263.667 233.633 263.567 233.9 263.5H234.6L234.7 264.1ZM235.5 263.6C235.366 263.667 235.3 263.833 235.3 264.1C235.3 264.2 235.5 264.7 235.7 264.8C235.9 264.9 236.7 264.4 236.7 264.2L236.4 263.8L235.5 263.6Z
1216M237.5 264.4C237.3 264.467 237.166 264.6 237.1 264.8L237.3 265.5C237.633 265.5 237.9 265.4 238.1 265.2V264.9L237.5 264.4ZM292.3 271H291.5C291.3 271 291.3 270.1 291.5 270.1L291.9 270C292.1 270 292.266 270.133 292.4 270.4L292.3 271ZM293.1 271L292.6 271.2V272C292.7 272.1 293.6 272.2 293.6 272C293.8 272 293.7 271.6 293.7 271.6L293.1 271ZM294 272.6H293.5L293.2 273.2C293.2 273.4 293.7 273.5 293.8 273.5C293.933 273.5 294.033 273.433 294.1 273.3L294 272.6Z",fill:"#F7E204"}),h.jsx("path",{d:"M287.658 276.891C288.324 277.629 290.06 277.146 291.535 275.813C293.011 274.48 293.666 272.802 293 272.064C292.333 271.326 290.597 271.809 289.122 273.142C287.647 274.475 286.991 276.154 287.658 276.891Z",fill:"url(#paint2_radial_4989_137735)"}),h.jsx("path",{d:"M228.6 223.4C228.6 223.4 225.6 223.7 223.4 223.4C221.4 223 221.8 217.5 221.7 217.4C221.7 217.2 220.4 215.9 220.7 214.7C220.9 213.5 224.7 210.3 225.3 210.1C225.7 210 226.5 210.3 226.5 210.3C226.5 210.3 227.5 209.3 227.8 209.3C228.1 209.3 228.5 209.9 228.4 210.1C228.2 210.4 226.9 211.1 226.8 211.8C226.8 212.4 226.667 213 226.4 213.6C226 214.2 225.3 215 225.2 215.5C225 216.1 225 216.467 225.2 216.6C225.6 216.8 226.9 216.6 228 216.1L229.7 215.1C229.9 215.1 229.1 216.4 227.9 216.9C226.7 217.4 225.9 218 225.2 217.9C225.2 217.9 224.6 219.5 226.6 219.6C228.7 219.7 229.9 219.2 229.9 219.2L228.6 223.4ZM216.6 236.2C216.6 236.2 218.3 236.8 218.3 238.6C218.3 240.4 216.5 241.9 216.6 245.1C216.6 248.3 217.1 248.3 221.3 251.7C221.4 251.7 222.3 252.7 222.5 253.7C222.8 254.7 223.5 260.7 227.5 260.7C231.5 260.7 232.1 258.2 232.1 258.2L230.4 255.7C230.4 255.7 229 256.1 228.2 255.9C227.797 255.761 227.427 255.538 227.117 255.244C226.806 254.951 226.562 254.595 226.4 254.2C225.9 253.2 225.8 250.9 225.1 249.9C223.4 247.4 220.4 246.9 220.4 244.3C220.4 241.6 222.3 241.3 221.7 238.2C221.1 235.1 217.4 233.5 217.4 233.5L215.9 232.9L215.4 236L216.6 236.2Z",fill:"#A8AC71"}),h.jsx("path",{d:"M227.8 214.1C229.1 213.8 228.3 210.3 228.3 210.3L227.4 211C227.4 211 228 211.8 228 212.6C228 213.4 227.8 214.1 227.8 214.1Z",fill:"#F1A720"}),h.jsx("path",{d:"M230.2 249.2L229.5 248.6C229.1 248.3 226.9 246.6 227.3 241.6C227.7 235.8 236 232.8 236.5 230.5C237.2 227.9 239.1 226.8 232.4 221.6L230.8 223.5L233.6 225.5C233.6 225.5 234.2 225.2 234.2 226C234.2 226.7 233.5 227.4 233.2 228C233.2 228.5 229 231.4 228.7 231.7L226.3 233.7C226.3 233.7 225.2 234.7 224.2 236.9C223.2 239.1 223.7 241.9 223.7 241.9C223.7 241.9 223.7 248.1 230.2 249.2Z",fill:"#A8AC71"}),h.jsx("path",{d:"M226.2 252.4L226.6 254.6L225.3 255.1H224.7L224.3 255.2L223.3 256.2H223L222.8 255.5L222.7 254.4L223.9 254.9H224.4L224.7 254.8L225.2 253.6L226.2 252.4ZM222.2 252.8L221.7 252L220.9 251.3L221.9 250.8H222.9L222.7 252L222.2 252.8ZM224.5 249.3C224.5 249.3 225.1 249.6 225.3 250.1L225.8 251.1L224.2 251L223.1 250.6L223.8 249.6L224.5 249.3ZM223.9 258.9C223.9 258.9 223.6 258.7 223.4 258.2L223.1 256.9L224.1 256.7L225.3 257.2H225.6L225.3 257.8L224.2 258.8L223.9 258.9ZM227.9 255.6C227.9 255.6 227.1 255.3 226.9 254.9L226.7 254.5L226.4 255.7L226 256.9L226.1 257.1L227.1 256.8L227.7 256.1L227.9 255.6ZM224.2 259.4L225.2 260L226.2 260.4L226.8 259.9L227.2 258.9L227.3 258.8L224.8 259L224.2 259.4ZM227.7 258.4L229.8 257.2L229.9 256.1L229.5 255.8H228.3L228 257.2L227.7 258.5V258.4ZM226.2 260.4C226.2 260.4 227.7 261.1 230.2 260.2C231.267 259.6 231.734 259.267 231.6 259.2L230.6 258.8L229.6 259.6L226.2 260.4ZM224.2 244.2L223.9 243.2L223.8 242.2L224.5 242.6L225.6 243.4L224.9 244L224.2 244.2ZM226 247.2L225.3 246.4L224.8 245.4L225.6 245.6L226.5 246.1L226.1 247.2H226Z",fill:"#78732E"}),h.jsx("path",{d:"M221.3 213.7C221.1 214.2 220.9 215.1 221.6 215.3C222 215.3 223.6 215.3 225.3 213.3C226.1 212.3 226.1 211.3 226.1 211.3L226.5 210.3C226.5 210.3 225.8 209.8 224.7 210.5L221.3 213.7Z",fill:"#C6C7A6"}),h.jsx("path",{d:"M226 211.2C226.166 211.2 226.3 211.066 226.3 210.9C226.3 210.734 226.166 210.6 226 210.6C225.835 210.6 225.7 210.734 225.7 210.9C225.7 211.066 225.835 211.2 226 211.2Z",fill:"#1C242F"}),h.jsx("path",{d:"M223.8 211.2C223 211.8 222.4 212.5 222.4 212.5C222.4 212.5 223.5 212.2 224.4 211.4C225.026 210.918 225.817 210.703 226.6 210.8C226.734 210.733 226.734 210.6 226.6 210.4C226.3 210.2 225.5 210.1 225.3 210.2C225.3 210.2 224.5 210.6 223.8 211.2Z",fill:"#A8AC71"}),h.jsx("path",{d:"M227.3 243.6V241.8L226.6 242.4L225.9 243.4L226.9 243.7L227.3 243.6ZM223.7 241.6V239.7C223.7 238.8 224.1 237.2 224.1 237.2L224.5 238.3L225.8 240.3L226.2 240.6L225.2 241.3L224 241.7L223.7 241.6ZM227.3 241L227.5 240.2L227.9 239.2L226.8 240.2L226.3 240.6L226.9 241.1L227.3 241ZM224.3 236.3C224.3 236.3 224.5 235.7 225 235L226.1 233.5L226.6 235.5L226.9 237.1V237.4L226.4 237.6C226.3 237.6 225.1 237.6 224.9 237.3L224.3 236.3ZM228.1 238.5L228.8 237.8L229.6 237L227 237.5L227.4 238.3L228.1 238.5ZM226.6 233.2L227.5 232.4C228.2 231.7 228.5 231.8 228.5 231.8L228.8 234.6L227.5 234.2L226.6 233.2ZM229.8 237L231.4 235.4L228.8 234.6L229.3 236.4L229.8 237ZM230.9 232.8L231.1 230.1L229.9 230.9L228.9 231.7L229.2 232.1L230.2 232.7L230.9 232.8ZM233.2 230.2V228.2L232.3 229.1L231.7 229.7L232.4 230.1L233.2 230.2ZM234.2 233L235.4 232L236.6 230.7L233.3 230.4L233.4 231.8L234.2 233ZM226.4 222V223.5H229.1L228.4 222.5L227.6 222L226.8 221.2L226.4 222ZM231.8 235L233 234L234 233.2L231.3 232.9L231.4 234.7L231.8 235ZM236.8 230.2C236.8 230.2 237.1 229.2 237.
12161 228.2L236.9 226.7L234.9 228L235.2 229L236 229.9L236.8 230.2Z",fill:"#78732E"}),h.jsx("path",{d:"M233.4 227.8C233.4 227.8 234 227.1 234.1 226.7V226.4H235.7L236.6 226.5L236.7 226.6L236 227.4L235 228L233.8 228.1L233.4 227.8ZM236.6 226.3L235.6 224.6L235 223.8L234.2 226V226.3H236.6Z",fill:"#78732E"}),h.jsx("path",{d:"M217.3 241.8L217 242.4C217 242.4 218 241.8 218.9 241.9C219.8 242 220.6 242.9 220.6 242.9L220.8 242.2C220.8 242.2 219.7 241.2 219 241.1C218.3 241.1 217.3 241.8 217.3 241.8ZM217.8 237.1L218.1 237.4C218.1 237.5 218.1 236.7 219.2 236.2C220.2 235.8 220.9 236.2 220.9 236.2C220.9 236.2 220.7 235.5 220.2 235.4C219.666 235.267 219.166 235.4 218.7 235.8C218.1 236.2 217.8 237.1 217.8 237.1ZM221.4 240.6C221.4 240.6 220.9 239.6 220 239.3C219.2 239.1 218.1 239.8 218.1 239.8L217.9 240.3C217.9 240.3 219.1 239.7 219.9 240C220.8 240.4 221.2 241.4 221.2 241.4L221.4 240.6ZM217.4 236.6L217.7 236.9C217.7 236.9 217.5 235.9 218.1 235.2L219 234.4L218.5 234.2C218.5 234.2 217.8 234.7 217.5 235.2C217.3 235.8 217.266 236.233 217.4 236.5V236.6ZM216.9 234.6C217.2 234.1 217.9 233.9 217.9 233.9L217.6 233.7H217.3C217.3 233.7 216.9 233.9 216.6 234.5C216.3 235.1 216.3 236.1 216.3 236.1L216.8 236.3C216.8 236.3 216.7 235.3 216.9 234.7V234.6ZM223.2 219.4C223.933 219.133 224.333 219.033 224.4 219.1C224.5 219.2 223.4 220.1 223.9 221.4C223.3 222.4 223.1 223.3 223.1 223.3H223.7L224 221.8C224.363 222.474 224.876 223.056 225.5 223.5H226.3C226.3 223.5 226.3 222.5 226.8 221.5C227.223 222.029 227.773 222.442 228.4 222.7V222.4C228.4 222.4 227.5 221.9 227 221.2V221.1C227.6 220.1 228.4 219.8 228.4 219.8L229 220.2L229.1 220.1L228.7 219.5H228.2L226.8 220.9L226.2 219.6H225.8C225.8 219.6 225 219.6 224.2 220.9C224.1 219.9 225.2 218.9 225.2 218.9L225.1 218.6L223.1 219C222.4 219.3 221.9 220 221.9 220V220.6C221.9 220.6 222.6 219.8 223.2 219.4ZM224.4 221.1C224.9 220.4 225.9 219.9 225.9 219.9C225.9 219.9 225.9 220.5 226.6 221.2C226.2 222 226 223.1 226 223.1C226 223.1 225.1 222.5 224.4 221.5L224.3 221.2V221.1H224.4ZM218.4 238V238.6C218.4 238.6 219 237.9 219.9 237.9C220.8 237.9 221.7 238.6 221.7 238.6V237.7C221.5 237.7 220.7 237.2 220 237.2C219.2 237.2 218.3 238 218.3 238H218.4ZM235.4 229L235.1 228.2L235.5 228L236.9 226.7L236.6 226.3H235.3L234.2 226.2L234.6 224.8L235 223.7L234.6 223.3C234.6 223.3 234.7 223.7 233.9 223.8L231.7 223.1V223.5L233.7 224L234.7 223.8L234.2 224.8L234 225.6L234.2 225.7L234.1 226.4L235.2 226.5L236.6 226.6C236.6 226.6 235.9 227.4 235.2 227.7L234.9 227.8L234.1 226.6V227L234.6 228L233.4 227.8L233.1 228.1V230.1L231.7 229.7L231.4 229.9L231.1 230.1C231.1 230.1 230.8 231.3 230.8 232.7C229.6 232.4 228.9 231.7 228.9 231.7L228.6 231.9C228.6 231.9 228.4 233.1 228.7 234.5C227.948 234.263 227.263 233.852 226.7 233.3L226.3 233.7L226.7 237.2L226.8 237.5H226.2C225.2 237.5 224.4 236.4 224.4 236.4L224.1 237.2C224.1 237.2 224.5 239.4 225.7 240.4L226 240.6C225 241.4 223.7 241.6 223.7 241.6L223.8 242.2L225.5 243.5L224.2 244.2L224.4 244.6L225.8 243.6L227.3 244V243.6L226.1 243.4V243.3C226.6 242.9 227.3 241.8 227.3 241.8V241C227.3 241 226.9 241 226.4 240.6C227.9 239.6 227.9 239.1 227.9 239.1L228.2 238.6C228.2 238.6 227.7 238.4 227.3 237.6L229.7 237.1L229.9 236.9C229.9 236.9 229.3 236 229 234.9L231.4 235.4L231.8 235C231.8 235 231.5 234.1 231.4 233L233.9 233.3L234.2 233C234.2 233 233.4 231.5 233.4 230.7V230.6H236.6L236.8 230.2C236.8 230.2 235.8 229.5 235.4 229ZM227 241.4C227 241.4 226.7 242.2 226 243L225.7 243.2L225.3 243C224.566 242.4 224.233 242.067 224.3 242L226.3 240.7L227 241.4ZM227.7 238.9L226.2 240.4L225.9 240C225.2 239.1 224.3 238.4 224.4 237C224.4 237 224.9 238 226.1 237.9L226.9 237.7C227.3 238.5 227.566 238.9 227.7 238.9ZM229.3 236.9L227.3 237.4L227.1 237.1C226.7 235.8 226.7 233.9 226.7 233.9C226.7 233.9 227.6 234.5 228.7 234.8L229.3 236.9ZM229 234.5C228.8 233.4 229 232.2 229 232.2C229 232.2 229.7 232.8 230.9 233L231.1 234.7L229 234.5ZM233.6 232.7C233.6 232.7 232.9 233 231.4 232.8V230L233.2 230.5V230.6L233.6 232.7ZM233.6 230.2H233.4V228.1C233.4 228.1 234.2 228.3 234.8 228.2C234.8 228.467 234.933 228.8 235.2 229.2C235.5 229.8 236.1 230.2 236.1 230.2C236.1 230.2 234.2 230.4 233.5 230.2H233.6ZM227.6 245.2L227.4 244.7C227.4 244.7 226.7 245.2 226.4 245.8H226.2L224.6 245.1L224.8 245.4L226.3 246L226 247.2L226.2 247.5C226.2 247.5 226.2 246.7 226.6 246.1H227.6L227.4 246.8L227.1 248L227.4 248.2H229.1L228.8 247.9H227.3L227.6 246.9L227.8 246.3L227.6 245.7L226.7 245.8L227.5 245.1L227.6 245.2ZM218.5 244.1C219.161 244.129 219.793 244.375 220.3 244.8V244.3C220.3 244.3 219.5 243.3 218.6 243.3C217.6 243.3 216.6 244.2 216.6 244.2V245.2C216.6 245.2 217.5 244.1 218.5 244.1ZM229.1 259.6C228.1 260.1 226.9 260.1 226.9 260.1L227.6 258.8C229.6 258.3 230 256.9 230 256.9L229.9 256.4C229.9 256.4 229.4 257.7 227.7 258.4L228.3 255.8L227.8 255.6C227.8 255.6 227 256.6 226.2 256.9C226.539 256.212 226.742 255.465 226.8 254.7L226.6 254.3C226.6 254.3 226 254.8 225.2 254.9H224.7C225.2 254.3 226.1 252.4 226.1 252.4L226 252C226 252 225.3 253.7 224.6 254.5L224.3 254.8L222.6 254V254.3C222.6 254.3 223.3 254.8 224.1 255.1L223.1 256.1V256.9L225.5 257.2C225.083 257.866 224.539 258.444 223.9 258.9L224.2 259.4C224.2 259.4 225.3 259.4 227.2 258.9L226.2 260.4C226.1 260.4 228 260.5 229.2 259.9C230.4 259.3 230.8 258.7 230.8 258.7L230.4 258.3C230.4 258.3 230.2 259.2 229.1 259.6Z
1216M223.6 256.3L224.6 255.2C225.8 255.5 226.2 255.1 226.2 255.1C226.2 255.1 226.4 255.8 225.7 256.9L223.6 256.3ZM224.7 258.8L225.7 257.5L226 257.2C227.2 257.2 227.9 256.2 227.9 256.2C227.9 256.2 228 257.2 227.5 258.4C225.9 259 224.7 258.8 224.7 258.8ZM223.2 250.9C224.4 251 225.8 251.5 225.8 251.5L225.7 250.9L223.4 250.5C223.8 249.6 224.6 249.2 224.6 249.2L224.2 249C224.2 249 223.8 249 223.2 250.2L223 250.4H222.7C221.7 250.4 220.8 251 220.8 251L221 251.3C221 251.3 221.9 250.9 222.8 250.9L222.2 252.9L222.4 253.4L223.2 250.9ZM220.8 246L220.6 245.4C220.6 245.4 219.3 245 218.4 245.4C217.5 245.8 216.8 246.9 216.8 246.9L217.2 247.7C217.2 247.7 217.8 246.5 218.7 246.2C219.6 245.9 220.8 246 220.8 246ZM223.2 247.9L222.4 247.5C222.4 247.5 221.1 247.8 220.6 248.3C220.1 248.8 219.7 250 219.9 250.3C220.1 250.7 220.266 250.9 220.4 250.9C220.6 250.9 220.6 249.6 221.3 249C222 248.4 223.2 247.9 223.2 247.9ZM220.2 247.5C220.6 247 221.6 246.8 221.6 246.8L221.1 246.3C221.1 246.3 219.9 246.5 219.3 247L217.9 248.7L218.6 249.4L220.1 247.5H220.2ZM224.2 211.7C224.9 210.9 225.5 210.9 225.7 210.9H226.3L225.6 212.9C225.4 213.7 225.1 213.9 224.8 214.4C224.333 215.067 224 215.833 223.8 216.7C223.8 217.5 223.966 217.933 224.3 218C224.566 217.867 224.733 217.7 224.8 217.5C224.8 217.2 224.6 217.5 224.4 217.5C224.2 217.5 224.4 217.2 224.2 216.7C224.2 216.2 224.8 214.9 225 214.5C225.4 214.1 225.7 213.567 225.9 212.9C225.9 212.2 226.4 210.9 226.4 210.9C226.4 210.767 226.066 210.7 225.4 210.7C225.098 210.727 224.806 210.821 224.546 210.977C224.286 211.133 224.065 211.346 223.9 211.6C223.5 212.1 222.5 212.5 222.5 212.5C222.5 212.5 223.6 212.5 224.2 211.7Z",fill:"white"}),h.jsx("path",{d:"M228.2 219.6H226.2L226.7 221.1L228.2 219.6ZM225.8 219.6L225.4 219.2L225.1 218.9L224.4 219.4L224 220.9L224.2 221.1L225.8 219.5V219.6ZM225.5 223.6L224.1 221.4L223.3 223.1L223.7 223.3L224.7 223.4L225.5 223.5V223.6ZM231.5 259.3H231.4C230.276 260.06 228.956 260.477 227.6 260.5C226.733 260.5 225.833 260.267 224.9 259.8C224.346 259.445 223.925 258.918 223.7 258.3C223.3 257.367 223.033 256.333 222.9 255.2C222.746 254.149 222.408 253.133 221.9 252.2C221.233 251.267 220.233 250.4 218.9 249.6C218.267 249.086 217.746 248.449 217.368 247.727C216.989 247.004 216.762 246.213 216.7 245.4V244.8C216.747 243.551 217.053 242.324 217.6 241.2C218.133 240.133 218.433 239.2 218.5 238.4V238C218.233 237.4 217.833 236.9 217.3 236.5L216.3 235.9L215.5 235.6V235.9L216.2 236.1L217.2 236.8C217.733 237.2 218.067 237.633 218.2 238.1V238.4C218.2 239.067 217.9 239.967 217.3 241.1C216.74 242.255 216.433 243.517 216.4 244.8C216.368 245.765 216.57 246.724 216.988 247.594C217.405 248.464 218.027 249.221 218.8 249.8C220 250.8 221.2 251.4 221.8 252.4C222.267 253.467 222.6 254.8 222.8 256.4L223.4 258.4C223.667 259.067 224.133 259.6 224.8 260C225.653 260.493 226.615 260.767 227.6 260.8C229.9 260.8 231.6 259.5 231.6 259.5L231.5 259.3Z",fill:"#78732E"}),h.jsx("path",{d:"M229.7 255.4L228.7 255.6C228.172 255.593 227.669 255.377 227.3 255C226.767 254.467 226.467 253.867 226.4 253.2C226.333 252.533 226.1 251.633 225.7 250.5C225.033 249.433 224.067 248.467 222.8 247.6C221.8 246.7 220.7 245.8 220.5 244.9V244.4C220.5 243.6 220.7 242.733 221.1 241.8C221.5 240.867 221.767 239.8 221.9 238.6V238C221.7 236.4 220.4 235.2 219.3 234.4L217 233.3V233.5H217.1C217.5 233.7 218.6 234.2 219.6 235C220.667 235.667 221.333 236.667 221.6 238V238.6C221.6 239.8 221.367 240.833 220.9 241.7C220.433 242.567 220.2 243.467 220.2 244.4V244.9C220.667 245.967 221.5 246.933 222.7 247.8C223.8 248.7 225 249.6 225.4 250.6C225.8 251.733 226.033 252.6 226.1 253.2C226.236 253.948 226.583 254.642 227.1 255.2C227.7 255.667 228.233 255.9 228.7 255.9L229.9 255.6L229.7 255.4Z",fill:"#78732E"}),h.jsx("path",{d:"M237 249.3C237 249.3 238.5 249.6 238.4 250.7C238.4 251.9 237.8 253.4 237.8 253.4L235.8 251.7L236.9 250.7L237.3 250.2L237.1 249.2L237 249.3Z",fill:"#A8AC71"}),h.jsx("path",{d:"M213.1 235.6C213.1 235.6 211.7 236.1 211.4 235.5C211.267 234.9 211.233 234.5 211.3 234.3C211.3 234.2 210.4 234.1 210.5 233.3C210.6 232.5 211.5 232.6 211.8 232.6C212 232.6 212.1 231.4 212.8 231.4C213.5 231.4 213.8 232.3 213.8 232.3L213.1 235.6Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),h.jsx("path",{d:"M214.6 236C214.6 236 213.5 236.6 213.1 236C212.7 235.4 213.1 234.7 213 234.6C212.8 234.5 212.1 234.2 212.3 233.6C212.3 232.8 213.1 233.1 213.3 232.9C213.6 232.8 213.8 231.8 214.6 231.9C2
121615.3 232.1 215.4 232.7 215.4 232.7L214.6 236Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),h.jsx("path",{d:"M216.6 236.3C216.6 236.3 216.3 237 215.4 236.8C214.5 236.6 214.9 235.5 214.7 235.3C214.5 235.1 214 234.9 214.1 234.1C214.2 233.3 215 233.5 215.3 233.4C215.6 233.3 215.8 232.1 216.3 232.3C216.8 232.5 217.5 233.1 217.3 233.4C217.3 233.4 216.2 233.8 216 234.6C215.8 235.4 216.6 236.3 216.6 236.3Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),h.jsx("path",{d:"M235 249L233.2 246.9L231.4 244.7L229.6 243.8L228.4 241.9V239.7L228.8 238.4L229.5 237.4C229.5 237.4 225.8 238.8 227.7 245.9C228.5 248.9 230.5 249.3 230.5 249.3L233.9 249.1L234.9 249H235Z",fill:"#AF7029"}),h.jsx("path",{d:"M233.3 225.4C233.633 225.4 233.833 225.467 233.9 225.6L234 226.2V226.4L234.1 226.5C232.8 229.2 230.2 230.5 227.9 232.1C226.705 232.925 225.685 233.979 224.9 235.2C223.912 236.86 223.425 238.77 223.5 240.7C223.6 244.7 225.1 247 226.8 248.1C228.051 248.917 229.506 249.367 231 249.4H231.3L232.5 249.3L234.9 249.1L236.3 249.2C236.7 249.2 236.933 249.3 237 249.5L237.2 249.9C237.2 250.233 237.033 250.567 236.7 250.9L236 251.4V251.7L236.9 251.1C237.233 250.767 237.4 250.367 237.4 249.9L237.2 249.4C237 249.2 236.7 249.067 236.3 249L234.9 248.9L231.3 249.1H231.1C230.4 249.1 228.6 249.1 227 247.9C225.4 246.9 223.9 244.7 223.8 240.7V240.4C223.8 238.267 224.2 236.6 225 235.4C226.2 233.4 228 232.4 229.8 231.1C231.6 229.8 233.3 228.7 234.2 226.6C235.1 224.5 234.2 226.4 234.2 226.2L234.1 225.5C233.966 225.3 233.7 225.167 233.3 225.1V225.4Z",fill:"#816C2A"}),h.jsx("path",{d:"M238.3 250.1C238.3 250.1 237.3 251.7 237.1 251.8C236.9 251.9 237.9 252 238.1 252.4L237.9 252.8C237.9 252.8 236.9 252.1 236.4 252.1L236.3 251.5C236.3 251.5 236.8 251.3 237.2 250.9C237.5 250.6 237.9 249.8 237.9 249.6L238.3 250.1Z",fill:"white"}),h.jsx("path",{d:"M241.7 251.2L239.5 251.8L238.4 251.1C238.4 251.1 238.4 250.2 238 249.8C237.534 249.467 237.1 249.233 236.7 249.1C236.3 248.9 234.7 248.9 234.7 248.9L230.7 244.6L232.2 244.8L234.6 244.5L236.7 244.3L237.9 244.5L239.1 244.8L239.7 245.4L240.4 246L241.1 247L241.5 248.3L241.7 249.6V251.2Z",fill:"#FCCA3D"}),h.jsx("path",{d:"M241.8 251C241.8 251 241 251.3 240 251.3C239 251.3 238.4 251.1 238.4 251.1L238.2 251.8L237.8 252.8V255.4L239.9 255.8L241 255.4L241.6 252.6L241.7 251.1L241.8 251Z",fill:"#AF7029"}),h.jsx("path",{d:"M241.2 250V251H241.7V250.2L241.2 250ZM239.2 226L239 224.3L238.3 223.1L237.4 221.9L236.5 220.9L236 220.4L235.8 220.1L233.5 220.2L232.3 221.6C232.3 221.6 235.3 223.8 236.6 226.2C237.666 226.6 238.4 227.067 238.8 227.6L238.9 227.4L239.2 226Z",fill:"#FCCA3D"}),h.jsx("path",{d:"M237 228C237 229.667 236.8 230.667 236.4 231L237.8 229.4L238.8 227.6C238.179 226.978 237.428 226.5 236.6 226.2C236.867 226.8 237 227.4 237 228Z",fill:"#AF7029"}),h.jsx("path",{d:"M240.2 254.3L239.1 253L238.1 252.3L237.9 252.5H238L239 253.2L240 254.5L240.2 254.3Z",fill:"#816C2A"}),h.jsx("path",{d:"M241.6 252.4C241.6 252.4 241.4 253.2 240.6 253.9C239.8 254.6 238.8 255 238.8 255L241 255.9L242.5 254.5L241.5 252.4H241.6Z",fill:"#6F5B24"}),h.jsx("path",{d:"M241.9 254.3L241.7 254.5L241.3 254.9L241 255.3L241.6 252.9L242 253.6V254L241.9 254.3Z",fill:"#404118"}),h.jsx("path",{d:"M228.6 223.4C228.6 223.4 225.6 223.7 223.4 223.4C221.4 223 221.8 217.5 221.7 217.4C221.7 217.2 220.4 215.9 220.7 214.7C220.9 213.5 224.7 210.3 225.3 210.1C225.7 210 226.5 210.3 226.5 210.3C226.5 210.3 227.5 209.3 227.8 209.3C228.1 209.3 228.5 209.9 228.4 210.1C228.2 210.4 226.9 211.1 226.8 211.8C226.8 212.4 226.667 213 226.4 213.6C226 214.2 225.3 215 225.2 215.5C225 216.1 225 216.467 225.2 216.6C225.6 216.8 226.9 216.6 228 216.1L229.7 215.1C229.9 215.1 229.1 216.4 227.9 216.9C226.7 217.4 225.9 218 225.2 217.9C225.2 217.9 224.6 219.5 226.6 219.6C228.7 219.7 229.9 219.2 229.9 219.2L228.6 223.4Z",stroke:"#78732E",strokeWidth:"0.2"}),h.jsx("path",{d:"M255 200.5C255 200.5 249.3 199.5 249.4 204.1C249.4 205.433 249.9 206.2 250.9 206.4C252.1 206.7 254.5 206.9 256.5 208.7C258.5 210.5 258.7 211.8 258.7 212.9C258.7 213.9 258.2 214.9 258.2 214.9L259.5 221.1L260.7 225.7L264.5 223.5L266.8 216.7L263.9 204.5L255 200.5Z",fill:"#AB6D29",stroke:"#4D2A15",strokeWidth:"0.3"}),h.jsx("path",{d:"M260.5 224C260.5 224 262.5 223.2 263 221.6C263 221.2 261 219.3 261 219.3L262.5 220.3C263.1 220.833 263.434 221.033 263.5 220.9C263.8 220.9 264.7 218.8 264.3 218.3C263.9 217.8 263.4 216.8 262.6 216.3C261.8 215.8 260.7 215.8 260.7 215.8C260.7 215.8 262.2 215.3 263 215.8C263.7 216.1 263.8 216.6 263.9 216.4C263.905 215.379 263.736 214.364 263.4 213.4C2
121663.134 212.733 262.6 212.367 261.8 212.3C260.8 212.1 259.9 212.2 259.9 212.2C259.9 212.2 261.2 211.4 262.2 211.7C263.2 211.9 263.2 212.4 263.2 212.3L262.5 210C262.056 209.376 261.474 208.863 260.8 208.5L259.4 208.3H258.9C258.9 208.3 259.6 207.8 260.6 207.9C261.6 208 261.6 208.3 261.7 208.3C261.9 208.3 261.667 208.1 261 207.7L257.6 206.1H255.1C255.1 206.1 255.1 205.4 255.8 205.3C256.467 205.3 256.767 205.267 256.7 205.2C256.7 205 254.5 204.5 254.5 204.5H252.8L250.4 204.8L250.9 204.1C251.3 203.833 251.667 203.667 252 203.6C252.9 203.4 251.6 202.7 251.6 202.7L252.2 201.7L255.4 201.9L261.9 205.8L265 208.4L267 213.4L266.4 222L262 225.6L260 225.8L260.5 224Z",fill:"#4D2A15"}),h.jsx("path",{d:"M254.8 202.7C254.8 202.7 254.6 202.1 254.6 201.3V200.6C254.6 200.6 252.6 200.3 251.1 201.5C249.5 202.7 250.4 204.8 250.4 204.8C250.4 204.8 251.1 204.2 251.9 203.8C252.8 203.5 254.3 203.6 254.3 203.6C254.5 203.4 254 202.8 253.4 202.7L251.7 202.6C251.7 202.6 252.4 202.1 253.5 202.2C254.5 202.4 254.933 202.567 254.8 202.7Z",fill:"#D2A567"}),h.jsx("path",{d:"M261.3 224.7L259.9 225.2L260.8 231.2L266.5 240.9L269.5 240.4L270.5 238.6L271.2 238.9C271.6 239.3 272.7 241.2 273.6 241.6C274.6 241.9 275 241.8 275.9 242.5C276.8 243.2 279.8 247.7 279.9 247.8C280.1 248 279.7 245.9 279.7 245.9L278.8 243.2L277.7 241.3L277.5 240.8H279L280 241.4L281.5 242.7L282.3 243.6L282.7 244.6L282.9 245.4L283.3 246.7L284.1 248.4L285.1 250.1L285.4 249.5L284.9 247.5L283.4 242.6L282.4 241L284 242C284.4 242 285.5 243.8 285.5 243.8L286.2 245.5L286.7 247.1L287.1 248.5L287.6 250L288.5 249.5L288.3 248.4L287.5 245L287.2 241.4C287.2 241.4 287.6 241.4 288.2 242C288.8 242.6 289.2 243.9 289.2 243.9L289.5 247.1L290 250.1L291 253.1L292 255.1L292.7 256.1V254.6L291.5 241.8L291.6 241.3C291.6 241.3 291.8 241.2 292.2 241.8L293.1 243.3L293.4 245.3L293.6 246.7L293.9 249.3L294.2 252.1L295.5 255.1L296.2 256.8L296.6 254.8L296 241.2L296.3 240.8L297.3 241.8L297.9 242.6L298.4 245.6L298.7 254.3L299 256.5L301.6 233.9L303.1 233.6L303.3 233.1L302.2 232.3L299.6 228.3L297.9 224.4L294.9 218.8L289.6 212.4L285.5 209L284 208L284.2 207.1L285.1 205.7H284.3L282.5 206L280.7 205.4L277.2 203L273.5 201.2L271.3 200.4L266 199.1L260.7 198.4H258.4L256.2 198.7C256.2 198.7 255.2 199.2 254.8 199.9C254.466 200.367 254.366 201.067 254.5 202C254.5 202.867 255.233 203.567 256.7 204.1C258.2 204.7 261.7 207.1 261.7 207.1L263.3 208.7L263.9 209.5L264 210.1L265.2 219.1L262.9 223.9L261.3 224.7Z",fill:"#8F4620"}),h.jsx("path",{d:"M267 238.6C267 238.6 268 240.2 269.3 238.9C270.7 237.7 268.7 234.1 268.8 233.9C268.9 233.7 269.4 233.6 269.4 233.6L270.4 235.5C270.4 235.5 271 236.5 270.7 238C270.5 239.6 269 241 269 241L267.3 240.5L267 238.6Z",fill:"#AB6D29"}),h.jsx("path",{d:"M300.2 259.4L299 255.8L298.6 253L298.3 245.5C298.2 244.5 298.3 243.2 298.1 243L296.8 241.2L296.3 240.7L296.6 240.4C296.6 240.4 297.1 240.9 297.2 240.7C297.334 240.367 297.167 239.167 296.7 237.1C296 234 293.7 230.4 293.7 230.4L293.9 230.7L294.6 231.4L296.1 232.6L299.4 233.8L301.1 234.1L302.3 236.4C302.3 236.4 303.1 240.3 303 242.3C303 244.3 302.9 245.9 302.1 247.9C301.3 249.9 301.1 256.1 301.1 257.1L300.6 259.1L300.2 259.4Z",fill:"#4D2A15"}),h.jsx("path",{d:"M300.2 249C300.2 249 300.9 248.1 301.2 247C301.5 246 301.6 237.1 300.6 236C299.658 235.146 298.527 234.529 297.3 234.2L298.1 237.1L298.8 238.1L299.3 239.6C299.3 240.3 300 242.1 300.1 244.4L300.2 249Z",fill:"#8F4620"}),h.jsx("path",{d:"M295.4 254.4C295.4 254.4 295.9 250.3 295.7 247.3C295.5 244.3 295.2 243.9 294.9 243.3C294.062 241.707 293.392 240.031 292.9 238.3C292.234 235.633 291.7 233.967 291.3 233.3C290.8 232.8 289.9 231.7 289.7 232C289.5 232.3 289.5 232.9 289.5 232.9L288.2 232.6L287.9 231.8L288.3 230.5V229.9L288.1 229L289.7 230.3L293 232.5L294.7 239.5L296.2 243.7L296.4 250.9L296.3 257.3L295.4 254.4ZM297.4 234.7L298.7 235.7C299.2 236.1 300.2 236.7 300 236.7L298.4 236.1L297.4 235.4V234.7Z",fill:"#4D2A15"}),h.jsx("path",{d:"M291 252.8C291 252.8 291.6 251.4 291.5 249.5C291.4 247.6 290.5 243.2 290.2 242.7C289.9 242.2 288.6 241.3 287.5 238.7C286.3 236.3 286.4 235.7 285.6 234.9L284 232.9L284.3 230.2L287.1 231.7L288.4 232.3L289.8 239.3L291.1 241.3L291.7 244L292.4 250.5L292.7 255.7L292.5 256.2L291 252.8ZM287.6 249.8C287.6 249.8 287.6 247.8 287.2 246C286.733 244.067 286.233 242.8 285.7 242.2C284.479 240.972 283.374 239.633 282.4 238.2L279.3 234.2V231.5L281 232.7L282.8 233.7L283.6 236.7L284.6 238.8L286 240.8L287 241.6L287.5 244.8L287.8 246.6L288.6 249.2L288.3 250.5L287.6 249.8ZM285.2 249.8L284.4 249.1C284.4 249.1 284.9 248.6 284.7 247.6L283.7 244.6C283.1 243.1 283.1 243 282.8 242.7L279.3 239.5L276.3 236.9C275.433 236.433 274.967 236.233 274.9 236.3L274.5 233.1C274.5 233.1 275.5 234.5 276.2 234.7L277.8 235.3L280.1 239.3L280.9 240.3L282.9 242L283.8 243.7L284.4 245.7L285.2 248.4L285.4 250.1L285.2 249.8ZM280.8 249C280.8 249 279.5 247.5 279.2 246.5C279 245.5 279.4 245.5 279 244.4C278.313 242.943 277.283 241.674 276 240.7C274.9 239.7 273.3 238.4 273.4 237.7C273.467 237.033 273.567 236.767 273.7 236.9L274.4 237.5L277.9 241.3L279 243.3L279.9 245.8L280.4 246.9L280.9 248.4L280.8 249ZM293.6 230.4C293.6 230.4 296.1 233.4 296.7 230.6C297 229.4 295.9 227 295.9 227L292.9 222L288.2 216.2L285.4 214.9L286.4 216.5C286.4 216.5 288.4 218.5 291.1 223.2C293.8 227.8 293.2 230.2 293.2 230.2L293.6 230.4ZM279.4 212C279.4 212 284.3 216.2 287.4 220.7C290.5 225.2 291.8 228.2 291.1 228.7C290.4 229.4 288.4 228.4 287.6 227.2C286.8 225.9 286.1 223.7 283.2 220.3C280.3 216.9 278.8 216.4 278.8 216.4L276.6 213L279.4 212ZM276.8 222C276.8 222 279.8 224.4 281.5 226.3L284.3 229.7L285.4 230.8C285.4 230.8 284.8 229.6 285.2 229.2C285.6 228.8 286 229 286 229L276.8 219.3V222ZM276.2 222.2C276.2 222.2 277.2 224 278.7 225.5L281.9 228.6L282.6 231C282.6 231 278.4 227.8 278.4 228.6C278.581 229.455 278.92 230.269 279.4 231L278.1 230.3L276.3 227.8L275.3 225.5L274.1 222.5L276.2 222.2Z",fill:"#4D2A15"}),h.jsx("path",{d:"M263.6 232.2C263.6 232.2 265.8 234.2 267 232.2C268.2 230.3 267.2 228.2 267.2 228.2C267.2 228.2 270.3 232.7 271.2 228.4C271.3 227.6 269.3 224.7 269.3 224.7L270 224L271.
12166 226.6C271.6 226.6 273.1 226 273.1 224.2C273.1 222.4 271.5 220 271.5 220L273 221.6C273 221.6 275.8 221.6 275.9 219.9C275.9 218.2 273.5 216.4 273.5 216.4C273.5 216.4 275.5 216.5 275.5 215.4C275.4 214.2 272.8 213.4 272.7 212.7C272.6 212 273.5 210.8 274.7 211.5C275.9 212.2 277.5 212.7 278.2 211.4C278.9 210.1 278.2 209.8 278.2 209.8L276.5 209.4L273.7 208L271.6 207.2L269.4 206.9L270.2 208.6L270.8 213.1V215.2L271.2 219.8L270.2 223.6L269.5 224.3L269.1 224.8L268.1 226.8L266.9 228.3L265.2 230.5L263.6 232.2Z",fill:"#4D2A15"}),h.jsx("path",{d:"M279 240.7C279 240.7 278.5 239.4 277.3 238.4C276.1 237.4 274.3 237.4 274.3 237.4L277.5 240.8L279 240.7ZM283.5 241.5C283.5 241.5 282.5 239.5 281.3 238.2C280.1 236.9 279.3 235.2 278.9 235.2L278.4 235.3L278.7 237.9L280.9 240.1C280.9 240.1 282.9 241.6 283.5 241.5ZM287.2 241.3C287.2 241.3 286.7 238.9 285.5 236.6C284.3 234.3 282.9 233.3 282.9 233.3L283.2 235.8L284.2 238.2L285.9 240.6L287.2 241.3ZM290.2 240C290.2 240 291.1 235 290.3 233.7C289.793 232.888 289.013 232.285 288.1 232L287.6 232.7L288.1 236.3L289.2 239L290.2 240ZM293.2 231.7C293.2 231.7 293.9 232.1 294.8 233.7C295.7 235.3 296.9 240.4 296.9 240.7C296.9 241 296.4 240.8 296.3 240.7L293.3 236L292.7 231.7H293.2Z",fill:"#AB6D29"}),h.jsx("path",{d:"M272.3 237.5C272.3 237.5 273.9 237.1 273.9 236.5C273.9 235.9 271.9 234.9 272.1 234C272.2 233.6 273.7 234.1 273.8 233.8C274 233.5 272.3 230.8 272.8 230.2C273.3 229.6 274.8 233.1 274.8 233.1C274.8 233.1 275.6 234.7 275.3 235.6C274.3 238.6 272.3 237.5 272.3 237.5ZM276 233.9C276 233.7 278.5 234.2 278.5 234C278.6 233.5 276.3 231.7 276.3 231.7C276.3 231.7 275.8 230.7 276 230.6C276.1 230.4 277.6 230.7 277.7 230.6C277.7 230.3 276 228 276 227.6C276 227.2 276.5 227.6 276.5 227.6C276.5 227.6 277.8 229 278.5 230.1C279.3 231.3 280 232.2 279.7 234.1C279.5 236.1 275.7 234.5 276 233.9ZM287 230.3C287 230.3 286.5 228.6 286.8 228.4L287.6 228C287.6 228 286.3 227.2 285.7 227.2C285.167 227.067 284.9 227.067 284.9 227.2C284.7 227.5 285.9 229.2 285.9 229.2L287 230.3Z",fill:"#D2A567"}),h.jsx("path",{d:"M279.6 231.5C279.6 231.5 283.3 232.5 283.4 232.2C283.6 231.9 280.4 229 280.4 229V228.3C280.4 228.1 281.7 228.1 282.1 228.4C282.5 228.7 282.1 229.4 282.1 229.6C282.3 229.8 283.5 231.6 283.7 231.3C283.9 231 283.5 228.8 283.6 228.7C283.6 228.5 285 229.9 285.3 230.2C285.7 230.4 287.8 232 288 231.2C288.2 230.5 288.3 230.4 288.3 229.9C288.2 229.5 288.9 232 288 232.3C287 232.7 285.9 232 285.9 232L285 231.3L284.5 230.8C284.5 230.8 285.1 232.8 284.5 233C283.9 233.2 283 233.1 283 233.1L281.5 232.9L279.5 231.5H279.6ZM288.1 229C288.1 229 292.1 231.4 292.4 231C292.8 230.5 291.4 225 291.6 224.4C291.8 223.8 294.8 230.7 293.4 231.6C292.2 232.3 291.7 231.8 291.7 231.8L289.7 230.8L288.1 229ZM299.1 239L300 239.4L300.5 239.6L299.4 239.8L299.1 239ZM295.3 225.9L295.9 226.2L296.4 226.4L295.9 226.6L295.6 226.5L295.3 225.9ZM294.1 223.9C294.1 223.9 294.5 224.1 295.1 223.8C295.7 223.5 295.6 223.1 295.6 223L294.4 222.6L294.2 222.1H293L294.1 223.9ZM297.6 235.5L299.2 236.2C299.5 236.2 300.1 236.6 300 236.7C299.9 236.8 299 236.9 298.6 236.7L298 236.5L297.6 235.5ZM291.1 217.4H292.1C292.3 217.6 292.1 218.4 291.8 218.7L291 219.1L289.7 217.3L291.1 217.4ZM285.4 212.4L286.6 212.3C287.067 212.367 287.467 212.533 287.8 212.8C288.2 213 288.5 215.4 288.3 215.8C288.1 216.3 285.5 214.3 285.4 214.1C285.4 213.9 284.2 212.1 284.2 212.1L285.4 212.4ZM282.9 211.2C282.9 211.2 284.9 211.4 284.7 210.2C284.612 209.465 284.256 208.788 283.7 208.3L281.3 210L282.9 211.2ZM277.7 209C277.7 209 278.2 209.2 278.8 209C279.4 208.8 280.9 206.8 282 206.6C283 206.333 283.533 206.333 283.6 206.6C283.8 206.8 283.6 208 283.4 208.3C283.2 208.6 279.9 210 279.9 210L278.7 209.8L277.7 209.5V209ZM277.1 205.4C276.6 204.2 275.7 203.8 275.4 203.8C275.1 203.9 276.5 205.1 276.7 206.6L276.9 209.4H277.6V208.9L277.8 208.4V208L277.7 207.2L277.5 206.6L277.4 206.1L277.1 205.4ZM272.5 203.7C271.276 202.383 269.773 201.358 268.1 200.7C267.9 200.7 271.3 202.7 272.1 204.1C272.8 205.3 272.8 207.1 273.1 207.3C273.4 207.5 273.8 207.3 273.8 207.2C273.933 207.067 274 206.9 274 206.7L273.8 205.8L273.3 205L273 204.4L272.5 203.7ZM268.1 201.9C265.782 200.206 262.969 199.327 260.1 199.4C257.2 199.4 255.8 199.6 256.2 201.2C256.6 202.667 257.933 203.367 260.2 203.3C262.6 203.3 263.2 203.1 264.4 203.5C265.733 203.967 266.7 204.5 267.3 205.1C267.7 205.5 266.3 203.9 265.2 203.1L263.2 201.6C263.2 201.6 263 201.1 264.6 201.4C266.2 201.7 268.4 202.6 268.9 204C269.5 205.3 269.4 206 269.4 206.4C269.4 206.6 270 206.2 270 206.2L270.2 205.5C270.2 205.5 270.3 205 270 204.5C269.7 203.8 269.6 203.6 268.9 202.8L268.1 201.9ZM260.4 224.7C261.6 224.7 264.2 222.5 264.6 219.3C264.587 215.836 263.908 212.407 262.6 209.2C262.1 208.5 263.3 208.9 264 209.5C264.7 210.1 266 214.7 266 218C266 221.3 265.2 222.3 263.5 224C261.7 225.6 260.3 225.5 260.3 225.5L260.4 224.7ZM264.5 234C264.5 234 265.1 234.7 265.7 234.5C266.9 234 268.8 233.1 268.8 231.5C268.8 230.3 267.4 229.3 267.3 228.9V228.1L268.6 228.4L268.9 230.2C2
121668.9 230.2 269.4 230.7 269.9 230.5C270.4 230.3 271.9 229.2 271.8 228.1C271.7 227 270.1 225.8 270 225.3V224.3L271.2 224.5L271.6 226C271.6 226 271.9 226.6 272.6 226.4C273.3 226.2 274.6 225 274.3 224.4L273 222.3V221.6L273.5 221.9C273.5 221.9 273.9 222.1 274.9 221.8C275.9 221.5 276.7 220.8 276.7 220.2C276.7 219.6 276 219 275.9 218.6V218.1L276.5 218.2L277.3 219.2L277.5 220.2L277.2 221.2L276.1 222.5L274.9 222.9H274.6L275.3 224.1L275.1 225.7L274.1 226.7L272.7 227.4V228.9L271.9 230.5L270.2 231.5H269.7L269.5 232.5L268.5 234L266.5 235.3L265.2 235.5L264.4 234.4L264.5 234Z",fill:"#D2A567"}),h.jsx("path",{d:"M274.7 217.1C274.7 217.1 277.8 218.1 277.7 216.1C277.7 214.9 274.7 212.4 274.5 212C274.366 211.4 274.333 211.067 274.4 211L275.9 212.4C275.9 212.4 277.9 212.9 278.5 211.7C279 210.6 278.5 209.9 278.5 209.8H278.9L279.9 209.9L279.7 211.7L278.7 216.1C278.7 216.1 279 217.8 277.7 218C276.3 218 274.7 217.1 274.7 217.1ZM277.7 240.7C277.7 240.7 277.7 239.8 277 239.2C276.3 238.6 275 238 274.8 237.8L277 240.6L277.7 240.7ZM282.2 240.8L280.2 238.3C280 237.6 279.2 236.2 278.5 236.1C277.9 236.1 279.1 238.5 279.1 238.5L281.6 240.8H282.2ZM286.5 240.8L284.8 237.5C284.5 236.8 283.8 234.8 283 234.2C282.2 233.6 283 235.2 283 235.2L284 237.8L285.4 240.1L286.4 240.8H286.5ZM289.6 239C289.6 239 289.5 236.8 289.2 235.3C288.997 234.264 288.472 233.319 287.7 232.6L287.8 235.3L289.6 239ZM296.1 240.6L294.6 236.8L292.9 233.5L293.2 235.8L294.6 239.6L296.1 240.6ZM301.7 233.8C301.7 233.8 300.7 232.8 298.6 231.9C297.218 231.391 295.769 231.087 294.3 231L294.5 231.3L295.5 232.1L297.7 233.3L300.7 234L301.7 233.8Z",fill:"#D2A567"}),h.jsx("path",{d:"M278.6 235C278.6 235 278.6 237 279.6 238.1L283.3 241.8C283.7 242.2 284.1 244.5 284.8 246.4L285.9 250.4C286.2 251 286.8 251.9 286.4 251.8C285.866 251.733 285.466 251.3 285.2 250.5C284.9 249.8 285 249.8 285.1 248.8C285.1 247.8 283.6 242.9 282.9 242.4C282.2 241.9 279 239.2 277.8 237.4C276.6 235.5 276.8 235.1 276.8 235.1L278.6 235Z",fill:"#202020"}),h.jsx("path",{d:"M283.7 247.5C283.1 246.033 282.767 244.867 282.7 244C281.779 242.639 280.588 241.482 279.2 240.6C278.7 240.4 277.7 240.7 277.2 240.4L274.3 237.2C274.3 237.2 274 237.6 274.1 237.7C274.2 237.8 276.8 240.7 277.8 241.5C278.8 242.5 279.3 244.5 280 246.1C280.6 247.7 280.4 247.3 280.4 248.1C280.6 248.9 280.934 249.3 281.4 249.3C282.067 249.3 282.234 249.2 281.9 249C281.147 248.194 280.568 247.241 280.2 246.2C279.6 244.8 279 242.2 278.2 241.3L277.9 241.1L278.9 241C279.6 241 282.3 243.4 282.5 244.1C282.7 244.8 282.5 245.1 283.5 247.5C284.7 249.9 285.2 250.5 285.2 250.5H285.4L283.7 247.5ZM279.6 231.5L282 232.9L283 233.1C283 233.1 283.3 236.6 284.7 238.6C286.1 240.6 287.3 241.3 287.3 241.3C287.3 241.3 287.3 245.1 288.3 247.7C289.114 249.695 289.456 251.851 289.3 254C289.1 254.5 288.3 252.5 287.7 250.7L286.2 245.7C285.791 244.374 285.11 243.148 284.2 242.1C283.5 241.6 284 241.7 284.4 242.1C285.323 243.1 286.007 244.297 286.4 245.6C287 247.6 287.3 249.6 287.6 249.6C288 249.6 288.2 249.367 288.2 248.9L287.5 245.6C287.1 243.6 286.767 242.367 286.5 241.9C286.2 241.3 285.7 241.3 284.5 239.1C283.633 237.805 282.959 236.39 282.5 234.9V233.9C282.2 233.7 282.1 233.9 281.1 233.4C280.1 232.9 279.6 231.5 279.6 231.5Z",fill:"#202020"}),h.jsx("path",{d:"M284.5 230.8C284.5 230.8 285.7 231.8 286.4 232C287 232.3 288 232.3 288 232.3C288 232.3 287.7 235.7 289 237.8C290.3 240 291.7 241.2 291.7 241.2C291.7 241.2 291.9 242 292.3 246.7L292.9 253.3C292.9 255.1 293 261.7 292.8 261.5C291.8 260.7 292.6 257.2 292.1 255.7C291.6 254.2 290.8 254 289.8 249.7C288.8 245.7 289.5 244.7 288.8 243.1C288.1 241.5 287.2 241.4 287.2 241.4C287.2 241.4 288.5 241.6 289 243C289.5 244.3 289.6 247.8 290 249.5C291 253.5 292.4 255.5 292.4 255.5C292.4 255.5 292.1 250.5 291.7 247.7C291.3 244.9 291.4 242.6 290.8 241.5C290.3 240.5 289.2 239.5 288.5 238.2C287.8 236.7 287.6 233.9 287.3 233.2C287 232.5 286.8 232.7 286.3 232.5C284.8 231.9 284.5 230.8 284.5 230.8Z",fill:"#202020"}),h.jsx("path",{d:"M288 229C288 229 289.1 230.2 290.6 231C292 231.9 292.8 231.6 293 231.8C293.2 232 292.7 234.9 294.2 237.6C295.7 240.4 296.2 240.4 296.3 240.8L296.8 251.8C297 254.6 297.2 263.8 296.1 263.8C295 263.8 296 257 295.4 255.4L294.4 253C293.9 251.7 293.8 246.8 293 243.8C292.3 241.6 291.7 241.2 291.7 241.2C291.7 241.2 292.7 241.8 293.3 243.7C293.8 245.5 293.9 251.7 294.5 252.6C295.233 253.733 295.767 254.733 296.1 255.6C296.3 256.6 296.1 244.1 295.7 243.3C295.5 242.5 293 238 292.7 235.5C292.6 233 292.5 232.7 292.3 232.5C292.1 232.3 291.3 232.5 290.1 231.4C288.9 230.3 288.1 229 288.1 229H288Z",fill:"#202020"}),h.jsx("path",{d:"M293.8 230.4C293.8 230.2 294.6 231.8 296.8 232.7C299 233.6 301.3 233.4 301.6 233.7C302.788 236.231 303.37 239.005 303.3 241.8C303.3 246.3 302.5 245.9 301.8 249.8C301.1 253.7 301.1 261.6 300.7 262.8C300.5 263.3 300.2 263.5 300 264.3C299.7 265 300.2 266.5 299.5 266.5C298.8 266.5 298.7 265.4 298.7 264.8C298.7 264.2 299.4 262 299.4 259.8C299.4 257.6 299 257.4 298.6 254.8C298.3 252.3 298.3 244.1 298 243.3C297.7 242.5 296.3 240.8 296.3 240.8C296.3 240.8 297.8 241.8 298.2 242.8C298.6 244 298.6 253.1 299 254.9C299.4 256.8 299.3 254.5 299.4 253.4C299.6 252.4 300.1 247.9 300.1 245.5C300 243.1 299 237.9 298.1 237.1L299.1 238.7L299.7 239.2L300.5 239.6L299.7 239.4L299.2 239.1C299.897 241.16 300.236 243.325 300.2 245.5C300.3 249.5 299.7 258.5 300.3 258.7C301 258.7 300.8 253.7 301.5 249.7C302.2 245.7 303.1 245.1 302.8 241.7C302.5 238.5 301.6 234.9 300.9 234.4C300.2 233.9 298.3 234.1 296.5 233C294.7 231.9 293.7 230.7 293.8 230.4ZM265.2 235C265.2 235 265.8 235.3 266.6 235C267.3 234.6 269.3 233 269.3 232.3V231C269.3 231 269.3 23
12161.3 270 231.4C270.5 231.4 272.2 230.2 272.3 229.4V227C272 226.8 272.7 227.3 273.1 227C273.4 226.7 275 225.7 275 224.6C275 223.5 274 222.6 274 222.6H275.3C275.8 222.5 277.3 221.6 277.3 220.6C277.3 219.6 276.7 218.2 275.5 218.1C275.5 218.1 276.4 218.3 277.3 218.1C278.167 217.7 278.567 217.033 278.5 216.1C278.4 214.7 276.7 213.1 276.4 212.9C276.1 212.7 278.3 213.5 278.9 212.6C279.367 211.667 279.5 211 279.3 210.6C279.2 210.1 278.7 209.9 278.7 209.9C278.7 209.9 279.7 210.2 281 209.5C282.3 208.8 283.4 208 284 208C284.6 208 282.1 209.4 282 210.1C282 210.367 282.6 210.933 283.8 211.8L284 211.9C284.5 212.2 286.5 212.3 286.6 212.4C286.7 212.5 284.7 212.4 284.9 212.6C286.596 213.849 288.14 215.292 289.5 216.9C289.5 216.9 289.8 217.2 290.2 217.3L291.2 217.5H290L292.6 221.3C292.6 221.3 293 221.8 293.3 221.9L294.3 222.1C294.3 222.3 293.1 222.1 293.3 222.3L295.9 227.1C295.9 227.1 293.4 222.8 290.4 219.5C287.4 216.1 286.8 215.7 286.6 216C286.4 216.3 288.8 219.3 290.1 221.3C291.4 223.4 292.5 226 292.5 226C292.5 226 289.5 219.8 285.3 216C281.1 212.1 280.7 211.5 280.3 211.7C279.7 211.8 279.3 214.7 279.7 215.2C280 215.8 283 218.2 285.7 221.2C288.3 224.2 291.6 229.6 291.6 229.6C291.6 229.6 289.2 225.8 285.2 221.6C281.2 217.4 279.7 216.3 279.4 216.3C279.1 216.3 279 217.1 278.6 217.8C278.2 218.5 277.1 218.3 277.1 218.6C277.1 218.9 280.5 222 281.1 222.4C281.7 222.8 282.2 222.6 282.7 222.9L283.8 223.6L282.6 223.2C282 223 281.667 223 281.6 223.2C281.5 223.5 284.3 226.7 284.8 226.9L286.1 227.3C286.7 227.5 287.6 228.1 287.6 228.1L286 227.4C285.334 227.4 285 227.467 285 227.6C285 227.8 287.1 230.5 287 230.6C287 230.6 283.8 226.8 281.2 224.5C278.5 222.1 277.3 221.6 277.2 221.7C277.1 221.8 277.2 222.5 276.5 222.7C275.834 222.9 275.434 223.1 275.3 223.3C275.3 223.5 277.6 225.8 279.3 227.6L282.5 231.3L278.9 227.8C277.034 226.067 276.034 225.267 275.9 225.4C275.7 225.5 275.7 226.4 275.9 226.7C276 226.9 279.5 231 279.4 231.1C279.3 231.2 275.3 226.2 275 226.2C274.8 226.333 274.6 226.667 274.4 227.2C274.1 227.4 273 227.4 273 227.8C273 228.2 278.6 233.8 278.4 233.8C278.4 233.8 273.8 229.8 273.6 230.1C273.5 230.3 275.6 234.1 275.5 234.2C275.4 234.3 272.7 230.2 272.5 230.2C272.3 230.2 272.3 230.7 271.6 231.3C270.9 231.9 270.1 231.7 270.1 231.9C270.1 232.2 273.9 236.5 273.8 236.6C273.8 236.6 269.8 232.5 269.8 232.7C269.667 232.7 269.6 232.9 269.6 233.3C269.9 234.3 270.8 236.2 270.6 236.3C270.6 236.3 269.4 233.8 269.1 233.9C268.8 233.9 268.8 234.5 268.1 234.9C267.6 235.2 267.1 235.1 267.1 235.4C267.1 235.7 267.8 236.1 268.1 236.7C268.4 237.3 268.7 238.7 268.7 238.7C268.7 238.7 268.3 237.5 267.7 236.8C267.167 236.067 266.7 235.667 266.3 235.6C265.9 235.733 265.667 235.867 265.6 236L265.2 235Z",fill:"#202020"}),h.jsx("path",{d:"M301.6 233.7C301.6 233.7 302.8 233.6 303 233.3C303.2 233 302.5 233.3 301.4 232C300.2 230.8 297.4 222.3 294.1 218C288.9 211.1 284.1 208 284.1 208C284.1 208 289.8 211.3 294.3 217.9C298.9 224.5 300 229.8 301.3 231.1C302.6 232.5 303.8 232.7 303.7 233.1C303.7 233.5 303.467 233.767 303 233.9L301.3 234L301.5 233.7H301.6ZM263.2 231.8L263.4 231.9C263.7 231.9 265.3 230.4 265.2 229.9C265.067 229.9 264.634 229.633 263.9 229.1C263.3 228.5 263.2 227.6 263.2 227.6C263.2 227.6 263.7 228.6 264.2 228.9C264.734 229.233 265.2 229.333 265.6 229.2C265.8 228.9 268.1 227.2 268 226.6C267.867 226.667 267.4 226.5 266.6 226.1C265.4 225.5 265.8 224.5 265.8 224.5C265.8 224.5 266.2 225.4 266.9 225.7C267.7 225.967 268.234 225.967 268.5 225.7C268.7 225.4 270.2 223.3 270 222.7C269.867 222.767 269.4 222.633 268.6 222.3C267.9 221.8 267.5 220.6 267.5 220.6C267.5 220.6 268 221.6 268.9 221.8C269.834 221.867 270.4 221.533 270.6 220.8C270.8 220.2 271.3 217.8 270.6 217.2C270.6 217.2 269.4 217.6 268.6 217.2C267.8 216.8 267.5 215.7 267.5 215.7C267.5 215.7 268.1 216.7 269.1 216.7C270 216.9 270.4 216.4 270.5 216C270.7 215.7 270.7 214.3 270.5 213.6C270.3 212.9 269.6 212.9 269.5 211.8C269.567 211.933 269.067 212.067 268 212.2C266.4 212.4 266.2 210.9 266.2 210.9C266.2 210.9 267.2 211.8 268.1 211.7C269 211.6 269.3 210.9 269.4 210.3C269.267 209.7 269 209.1 268.6 208.5C268.4 207.9 268.3 207.2 268.2 207.3C268 207.3 267.8 207.9 266.6 207.7C265.4 207.5 265.1 206.7 265.1 206.7C265.1 206.7 266 207.3 266.6 207.3C267.334 207.3 267.734 207 267.8 206.4C267.8 206 267.5 205.1 266 203.8L263.2 201.6C263.2 201.6 265.2 202.7 266.5 203.8C267.8 204.8 268.5 205.9 268.5 205.9C268.5 205.9 269.9 206.4 270 205.9C270.267 205.5 270.167 204.833 269.7 203.9C269.3 203.2 268.1 201.9 268.1 201.9C268.1 201.9 269.3 202.9 269.9 204
1216C270.5 205.1 270.3 205.9 270.3 206.1C270.3 206.3 273 207.4 273.6 207.1C274.067 206.633 274 205.967 273.4 205.1L272.4 203.7C272.4 203.7 273.1 204.4 273.6 205.2C274.134 206 274.334 206.567 274.2 206.9L273.7 207.6L275.5 208.6C276.4 209.1 277.4 209.6 277.5 209.3C277.7 209.033 277.767 208.433 277.7 207.5C277.6 206.7 277.1 205.4 277.1 205.4C277.1 205.4 277.7 206.6 277.8 207.5V209.5C278.1 209.7 278.8 209.8 278.8 209.8C278.8 209.8 278.2 210.2 277.1 209.8C275.9 209.5 270.9 207 270.7 207.2C270.5 207.5 273 209 274.2 210.2C275.4 211.2 275.9 212.4 275.9 212.4C275.9 212.4 275 211.6 274.1 211.1C273.2 210.6 270.6 209.3 270.4 209.5C270.3 209.7 271.4 209.9 271.5 210.1C271.6 210.3 270.7 211.1 270.7 211.5C270.7 211.9 274.5 214.5 274.4 214.7C274.2 215 273.4 215.7 273.2 215.7C273 215.7 271.2 214.2 271.2 214.4C271.2 214.7 272.2 215.6 272.2 215.8C272.2 216 271.6 216.4 271.7 216.8C271.8 217.2 273.8 218.9 273.7 219.5C273.7 220 272.7 220.5 272.9 220.9L274.1 222.5L272.6 221.4C272.3 221 271.6 220.2 271.5 220.3L270.7 222.3C270.7 222.7 271.7 223.2 271.8 224.1C271.9 225 271.7 226.1 271.6 226.1C271.6 226.1 270.3 224.4 270.1 224.4C269.767 224.333 269.5 224.5 269.3 224.9C269.1 225.3 268.3 226.6 268.5 226.9C268.5 227 269.8 227.3 269.8 228.3C269.8 229.3 269 230.2 268.9 230.2L267.3 228.2C267.1 228.2 265.5 230.1 265.5 230.2C265.5 230.5 266.5 231.3 266.4 231.6C266.2 232 265.4 231.6 264.9 231.8L263.6 232.3C263.4 232.3 263.2 231.8 263.2 231.8Z",fill:"#202020"}),h.jsx("path",{d:"M284 208C284 208 284.1 207.5 284.4 207.2C284.6 207 285.6 205.9 285.2 205.6C284.9 205.4 283.6 205.8 282.8 205.8C282 205.7 281.5 205.8 279.1 203.9C279.1 203.9 271.7 198.8 260.2 198.1C256.6 197.9 255 199.1 254.8 199.9C254.8 200 255.8 198.4 259.4 198.4C266.18 198.641 272.787 200.603 278.6 204.1C278.9 204.4 280.9 206.3 282.7 206.1C284.6 205.8 285 205.6 284.9 205.9L284.2 207.1L284 208ZM264 209.5C263.421 208.514 262.676 207.634 261.8 206.9C259.812 205.512 257.663 204.371 255.4 203.5C255.2 203.5 260.2 205.8 261.6 207.2L264 209.5Z",fill:"#202020"}),h.jsx("path",{d:"M264 217.8C264 217.8 263.6 217.3 262.6 216.6L260.6 215.7L263 216.3C263.6 216.9 264 217.8 264 217.8ZM263.3 213.5C263.3 213.5 263 213 261.6 212.5C260.334 212.167 259.767 212.067 259.9 212.2C260.1 212.4 261.2 211.6 262.2 212.2C262.487 212.31 262.744 212.485 262.952 212.71C263.16 212.935 263.313 213.206 263.4 213.5H263.3ZM262.5 209.9C262.5 209.9 262.2 209.3 261 208.9C259.667 208.433 258.967 208.233 258.9 208.3C258.8 208.4 260.2 208 261.4 208.5C262.7 209 262.5 209.9 262.5 209.9ZM261 207.7C261 207.7 260.7 207.2 258.3 206.7L255.1 206.1C255.2 206.2 258.4 205.8 259.3 206.1C260.2 206.5 261 207.7 261 207.7ZM256.7 205.2C256.7 205.2 255.3 204.8 253.9 204.7L250.4 204.8C250.4 204.8 254.4 204.2 255.4 204.4C256.4 204.8 256.834 205.067 256.7 205.2Z",fill:"#D2A567"}),h.jsx("path",{d:"M243.6 254.7C243.6 254.7 244.3 256 245.6 256C247.1 256 248.2 258 248.2 258L246.7 259.6L243 259.8L241.8 257.8L243.6 254.8V254.7ZM243.6 253.5C243.8 253.2 242.6 250.8 241.7 250.5C240.9 250 242 251.2 241.8 251.7C241.6 252.233 241.533 252.633 241.6 252.9C241.6 252.9 242.3 253.9 241.9 254.4C241.5 254.9 243.7 253.4 243.7 253.4L243.6 253.5Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),h.jsx("path",{d:"M243 257.1C243 257.1 243.7 257.4 244.2 257.3C244.8 256.967 245.134 256.733 245.2 256.6M242.3 256.2C242.3 256.2 244.4 254.7 244.3 253.9C244.034 253.233 243.7 253 243.3 253.2L241.7 254.5L242.3 256.2Z",fill:"#F8C83C"}),h.jsx("path",{d:"M243 257.1C243 257.1 243.7 257.4 244.2 257.3C244.8 256.967 245.134 256.733 245.2 256.6M242.3 256.2C242.3 256.2 244.4 254.7 244.3 253.9C244.034 253.233 243.7 253 243.3 253.2L241.7 254.5L242.3 256.2Z",stroke:"#977C2E",strokeWidth:"0.2"}),h.jsx("path",{d:"M240.9 257.2C240.9 257.2 241.2 258.2 241.9 258.2C242.6 258.2 243.6 257.7 243.6 257.2C243.6 256.9 242.9 256.2 242.5 255.9C242 255.7 241 256.2 241 256.2L240.9 257.2Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),h.jsx("path",{d:"M242.8 255.8C242.6 256.1 241.3 256.8 240.9 256.8C240.5 256.8 239.6 255.8 239.9 255.6L241.1 255.3C241.4 255.1 241.5 254.6 241.7 254.6C241.967 254.6 242.267 254.767 242.6 255.1C243.1 255.6 242.9 255.5 242.8 255.8Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),h.jsx("path",{d:"M241.4 256.7C241.4 256.7 239.4 259.5 238.5 259.3C237.6 259.1 238.9 255.4 238.9 255.4L239.9 255.8C240.567 256 241.067 256.333 241.4 256.8V256.7Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),h.jsx("path",{d:"M237.8 254.8C237.8 254.8 240.4 255.2 240.5 255.6C240.6 256 239.3 256.6 238.5 256.6C237.8 256.6 237.8 254.7 237.8 254.7V254.8Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),h.jsx("path",{d:"M231.2 258.7C231.2 258.7 231.6 260 232.7 260.1C233.8 260.2 234.9 258.9 234.9 258.9L232.2 257.9L231.2 258.7Z",fill:"#202220"}),h.jsx("path",{d:"M231.2 258.7L231.5 259.4C231.767 259.8 232.167 260.033 232.7 260.1H232.8C233.9 260.1 235 258.9 235 258.9L232.2 257.7L231.2 258.7ZM231.2 258.7L232.2 257.9L234.9 258.9L234.7 259C234.4 259.4 233.6 260 232.8 260C232.2 260 231.8 259.767 231.6 259.3L231.4 258.9L231.3 258.8L231.2 258.7Z",fill:"#4B4139"}),h.jsx("path",{d:"M232 258.4C232 258.4 232.4 259.4 234 259.4C235.4 259.4 236.6 258.2 236.6 258.2L234.2 256.3L232 258.4Z",fill:"#202220"}),h.jsx("path",{d:"M232 258.4C232 258.4 232.4 259.4 234 259.4C234.985 259.334 235.912 258.907 236.6 258.2L234.2 256.2L231.9 258.4H232ZM232 258.4L234.2 256.4L236.6 258.2H236.5C235.822 258.849 234.937 259.238 234 259.3C233.713 259.337 233.422 259.312 233.145 259.226C232.869 259.139 232.615 258.994 232.4 258.8L232.1 258.5L232 258.4Z",fill:"#4B4139"}),h.jsx("path",{d:"M232.2 258.6C232.2 258.6 232.8 259.1 233.6 259.2
1216L235.4 259L234.4 259.3H233.2L232.7 259.1L232.3 258.8L232.2 258.6Z",fill:"#4B4139"}),h.jsx("path",{d:"M234 257.3C234 257.3 234.6 258.9 236 258.7C237.3 258.6 237.4 257.7 237.4 257.7L235.8 255.5L234 257.3Z",fill:"#202220"}),h.jsx("path",{d:"M234 257.3L234.4 258.1C234.734 258.5 235.234 258.733 235.9 258.8H236.1C236.767 258.667 237.167 258.467 237.3 258.2L237.5 257.8L235.9 255.4L233.9 257.3H234ZM234 257.3L236 255.6L237.4 257.8C237.4 257.9 237.3 258.5 236.1 258.7H235.9C235.367 258.633 234.9 258.4 234.5 258L234.2 257.5V257.3H234Z",fill:"#4B4139"}),h.jsx("path",{d:"M234.1 257.6C234.1 257.6 235 258.6 235.7 258.6C236.433 258.533 236.833 258.433 236.9 258.3V258.4L236.5 258.6L235.9 258.7H235.2L234.6 258.3L234.1 257.6ZM231.5 259.2C231.5 259.2 232.1 259.9 232.7 259.9C233.3 259.9 234.2 259.4 234.2 259.4H234.3L234.2 259.5L233.6 259.9L232.8 260.1L232.2 260L231.8 259.7L231.5 259.4V259.2Z",fill:"#4B4139"}),h.jsx("path",{d:"M237.6 254.6C238.2 254.6 239.6 256.3 239.6 257.2C239.6 258.1 239.2 259.4 238.6 259.3C237.9 259.3 236.4 258 236.1 257.3C235.633 256.633 235.5 256.167 235.7 25
12165.9C235.9 255.5 237.7 254.6 237.7 254.6H237.6ZM231.2 254.8C231.2 254.8 230.2 254 229.7 254.4C229.2 254.8 229.4 256.2 229.7 256.4C230 256.8 231.2 255.8 231.2 255.8V254.8Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),h.jsx("path",{d:"M231 255.8C231 255.8 229.6 255.8 229.6 256.5C229.6 257.2 230.3 257.8 230.4 258C230.5 258.2 231.8 257.4 231.8 257.4L231 255.8Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),h.jsx("path",{d:"M231.6 256.9C231.6 256.9 230.1 257.3 230.1 257.9C230.1 258.3 230.8 259.2 231.2 259.2C231.6 259.2 232 258.3 232.2 258.2C232.4 258 231.6 256.9 231.6 256.9ZM232.3 252.8C232.3 252.8 232 252.4 231.4 252.6C230.8 252.8 230.1 253.5 230.3 254.4C230.433 255.467 230.566 256 230.7 256L232.8 255.3L232.3 252.8Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),h.jsx("path",{d:"M232.4 254.4C232.4 254.4 230.6 255 230.5 255.7C230.5 256.567 230.833 257.1 231.5 257.3C231.9 257.4 233.5 255.9 233.5 255.9L232.4 254.4Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),h.jsx("path",{d:"M234 257.4C234 257.4 232.2 258.6 232 258.6C231.7 258.6 231 257.6 231.2 257C231.4 256.4 232.6 255.9 233.1 255.7C233.6 255.5 234.1 257.4 234.1 257.4H234ZM235.6 250.8C235.6 250.8 235 250.4 233.9 250.4C232.9 250.5 232 251.9 231.9 252.7C231.8 253.5 231.9 254.7 232.3 254.9C232.7 255.1 235 253.3 235 253.3L235.6 250.8Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),h.jsx("path",{d:"M233.4 256.2C232.6 256.2 232 255.1 232.1 254.4C232.2 253.7 233.7 252.6 234.5 252.8C235.3 252.8 235.1 254.8 235.1 254.8C235.1 254.8 234.1 256.3 233.4 256.2Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),h.jsx("path",{d:"M235.8 256C235.8 256 235.4 257 234.7 257.3C233.9 257.633 233.334 257.467 233 256.8C232.5 256.1 233.2 255.8 233.5 255.5C233.9 255.2 234.9 255 234.9 255L235.8 256Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),h.jsx("path",{d:"M234.6 253.8C234.6 253.8 233.7 254.4 234.2 255.2C234.667 255.867 235.167 256.267 235.7 256.4C236.233 256.533 236.733 256.3 237.2 255.7C237.9 254.8 238.4 254.8 238.3 254.1C238.3 253.367 238.033 252.867 237.5 252.6C237.1 252.4 235.8 252.6 234.5 253.7L234.6 253.8Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),h.jsx("path",{d:"M237 250.4C237 250.4 236.1 250 235.4 250.4C234.733 250.867 234.366 251.533 234.3 252.4L234.4 254.1C234.4 254.1 235.4 253.9 235.9 253.4C236.4 252.9 236.7 252.7 236.6 252.4C236.466 252.4 236.366 252.1 236.3 251.5C236.3 250.5 237 250.4 237 250.4Z",fill:"#202220"}),h.jsx("path",{d:"M237 250.4C237 250.4 236 250.2 235.5 250.5C234.966 250.833 234.6 251.333 234.4 252C234.333 252.667 234.333 252.933 234.4 252.8C234.5 252.6 234.2 252.3 234.4 251.7C234.666 251.033 235.066 250.567 235.6 250.3L237 250.4Z",fill:"#4B4139"}),h.jsx("path",{d:"M263 269.6L264.3 269L265.9 268L266.2 269.8L264.8 270.8H263.6L262.9 270.3L263.1 269.6H263Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),h.jsx("path",{d:"M261.1 269.7H262L263 269.6C263.2 269.6 263.5 270.6 263.5 270.6L263.1 271.1L261.9 271.8L260.9 271.2L260.8 269.8L261.1 269.7ZM270.8 269.2L270.1 268.3L268.4 266.8V270.8H270.2L271 269.5L270.8 269.2Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),h.jsx("path",{d:"M261.1 269.7C261.1 269.7 260.8 269.3 260.1 269.4C259.167 269.6 258.6 270.033 258.4 270.7C258.4 271.2 258.4 272.7 258.8 273C259.2 273.333 259.8 273.433 260.6 273.3C261.4 273 265.6 270.4 265.6 270.4L264.6 270.7L263.4 270.5C263.4 270.5 262.9 271.2 262.2 271.3C261.6 271.3 261.267 271.1 261.2 270.7L261.1 269.7Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),h.jsx("path",{d:"M264 271.1L263 271.5L262 272L262.3 273.3L264.1 273.7L265.2 272.7V271.5L264 271.1ZM272.3 270.2L271.7 269.6C271.3 269.2 271 269.067 270.8 269.2L269.8 270.3V271.2L270.8 271.7L271.5 271.8L272.5 271.2L272.3 270.2Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),h.jsx("path",{d:"M266.1 269.6L264.9 270.3L263.9 271.1L264.9 272.1L265.8 272.3L267.8 270.9L267.6 269.6H266.1ZM273.7 271.2L273.3 270.6C272.9 270.333 272.567 270.2 272.3 270.2C272.1 270.2 271.3 271.4 271.3 271.4L271.2 271.7L271.9 272.5L273.2 272.8L274.1 272L273.7 271.2Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),h.jsx("path",{d:"M270.4 272.6L271.4 272.8C271.4 272.8 271.3 273 271.6 273.2H271.9C271.9 273.1 271.9 274.2 272.9 274.9C272.9 274.9 274.1 275.3 274.6 274.9C275.2 274.6 275.1 275 275.1 275L276.7 273C276.7 273 276.7 272.6 276.3 272.6C276.3 272.6 276.6 271.4 275.6 271.1C274.6 270.8 273.7 271.2 273.7 271.2C273.7 271.2 272.9 272.7 272.5 272.5L271.9 272.1L271.3 271.4L270.6 271.2C270.2 271 269.9 270.3 269.9 270.3C269.9 270.3 269.3 270.3 269.1 270L268.6 269.4L267.1 270.4C267.1 270.4 267.1 270.9 266.2 271.5C265.334 272.1 264.867 272.333 264.8 272.2C264.7 272 264.6 273.5 263.6 273.2C262.6 273.1 262 272 262 272C262 272 261.3 271.9 260.9 272.5C260.5 273.1 260.2 273.3 260.2 273.9C260.267 274.567 260.5 275.133 260.9 275.6C261.2 275.9 262.2 276.6 263.3 276C264.5 275.4 264.1 274.5 264.1 274.5L264.7 274.1C265.434 273.433 266.1 272.967 266.7 272.7",fill:"#F8C83C"}),h.jsx("path",{d:"M270.4 272.6L271.4 272.8C271.4 272.8 271.3 273 271.6 273.2H271.9C271.9 273.1 271.9 274.2 272.9 274.9C272.9 274.9 274.1 275.3 274.6 274.9C275.2 274.6 275.1 275 275.1 275L276.7 273C276.7 273 276.7 272.6 276.3 272.6C276.3 272.6 276.6 271.4 275.6 271.1C274.6 270.8 273.7 271.2 273.7 271.2C273.7 271.2 272.9 272.7 272.5 272.5L271.9 272.1L271.3 271.4L270.6 271.2C270.2 271 269.9 270.3 269.9 270.3C269.9 270.3 269.3 270.3 269.1 270L268.6 269.4L267.1 270.4C267.1 270.4 267.1 270.9 266.2 271.5C265.334 272.1 264.867 272.333 264.8 272.2C264.7 272 264.6 273.5 263.6 273.2C262.6 273.1 262 272 262 272C262 272 261.3 271.9 260.9 272.5C260.5 273.1 260.2 273.3 260.2 273.9C260.267 274.567 260.5 275.133 260.9 275.6C261.2 275.9 262.2 276.6 263.3 276C264.5 275.4 264.1 274.5 264.1 274.5L264.7 274.1C265.434 273.433 266.1 272.967 266.7 272.7",stroke:"#977C2E",strokeWidth:"0.2",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M268.6 264.7V267.2C268.6 267.2 269 269.5 268.5 270.2C268 270.9 266.2 270.8 265.9 270.2C265.7 269.5 265.8 267.6 265.8 267.6L268.6 264.6V264.7Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),h.jsx("path",{d:"M266.6 272.4C266.6 272.4 266.2 273.1 267.4 273.2L268.1 272.9C268.367 272.567 268.467 272.367 268.4 272.3C268.3 272.2 268.3 273.2 269.4 273.3C270.5 273.4 270.4 272.2 270.4 272.2",fill:"#F8C83C"}),h.jsx("path",{d:"M266.6 272.4C266.6 272.4 266.2 273.1 267.4 273.2L268.1 272.9C268.367 272.567 268.467 272.367 268.4 272.3C268.3 272.2 268.3 273.2 269.4 273.3C270.5 273.4 270.4 272.2 270.4 272.2",stroke:"#977C2E",strokeWidth:"0.2",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M257 274.5C257 274.5 256.3 273.4 257 273C257.8 272.6 258.3 273 258.7 273C259.2 273 259 271.8 258.9 271.6C258.833 271.2 258.667 270.867 258.4 270.6C258.2 270.6 255.6 270.8 255.7 272.5C255.8 274.2 257 274.5 257 274.5ZM261 278.6C261 278.6 260.2 277.4 260.6 276.7C261 276 261.4 276.5 261.6 276.4C261.867 276.4 261.867 275.967 261.6 275.1C261.2 273.8 260.7 274 260.4 273.9C260.1 273.8 258.6 275 258.9 276.5C259.3 278.3 260.9 278.6 260.9 278.6H261ZM275.5 277.2C275.5 277.2 278.3 278.4 278.5 275.5C278.6 274 277.2 273 276.8 273C276.6 273 276.267 273.267 275.8 273.8C275.2 274.4 274.967 274.8 275.1 275C275.3 275.3 276.1 274.8 276.5 275.7C277.1 277.2 275.5 277.2 275.5 277.2Z",fill:"#202220"}),h.jsx("path",{d:"M261 278.6C261 278.6 258.8 278.1 258.8 276C258.8 274.6 260.4 274 260.4 274C260.4 274 259 274.7 258.9 276C258.9 278.1 260.9 278.6 260.9 278.6H261ZM257 274.5C257 274.5 255.7 274.2 255.6 272.4C255.4 270.6 258.4 270.7 258.4 270.7C258.4 270.7 255.6 270.7 255.7 272.5C255.9 274.3 257 274.5 257 274.5ZM275.5 277.2C275.5 277.2 276.1 277.5 276.7 277.4C277.5 277.467 278.067 277.067 278.4 276.2C278.7 275.1 278.5 274.6 277.8 273.7C277.2 273.1 276.867 272.867 276.8 273C276.7 273.2 277.4 273.1 277.8 273.7C278.2 274.3 278.7 275 278.3 276.2C277.9 277.4 276.8 277.4 276.3 277.4L275.5 277.2Z",fill:"#4B4139"}),h.jsx("path",{d:"M242.1 217.9L241.6 217.8L242 216.9L243.4 216.4L244.9 216.3H246.4L247.1 216.7L247.9 218.6L245 220.3L244.5 220.5L244.4 219.7L243.9 218.6L242.1 217.9Z",fill:"#904720"}
1216),h.jsx("path",{d:"M269.5 260.4L269.4 256L257.4 259.6L262.2 264L269.5 260.4Z",fill:"#202020"}),h.jsx("path",{d:"M247.6 252.7L246.6 251.9L245.5 251.3H244.5L244.4 251.5L244.5 251.9L245.6 253.2L247.4 254.2L248.1 254.7L248.5 254.9L247.6 252.7ZM247.3 254.6H248L248.6 255.5L249.1 256.3L249.6 257.3L249.8 258L248.5 257.7L244.6 256.5L245 255.6L245.6 255L246.2 254.8L247 254.6H247.3Z",fill:"#D2A567"}),h.jsx("path",{d:"M249.8 257.8L250.4 257.7L250.8 257.3L250.6 255.9L250.9 251.3L247.8 247.6L247.1 249.7L248.1 253.5L248.7 255.7L249.8 257.8Z",fill:"#D2A567"}),h.jsx("path",{d:"M247.5 249.3C247.5 249.3 247.3 249.7 247.6 250.9C247.9 252.1 248.3 254.9 249.4 256.7C250.4 258.5 248.4 255.2 248.4 255.2C248.4 255.2 246.7 251.5 246.9 248.7C247.2 245.8 247.5 249.3 247.5 249.3Z",fill:"#AB6D29"}),h.jsx("path",{d:"M249.8 251.7C249.8 251.7 249.1 252.5 249 253.2V254.9C249 254.9 249 254.1 249.7 253.9C250.4 253.7 250.3 255.8 250.3 256L250.7 252.2L249.8 251.7ZM250.2 259.4L246.7 258.6C244.834 257.8 243.9 257.133 243.9 256.6C243.9 256.2 247.1 256.8 247.6 256.9C248.1 257 249.5 257.7 249.5 257.7H250.3L251.8 257.1L252 258.7L250.2 259.4ZM244.2 258.7C244.2 258.7 245.2 259.3 244.7 259.6C244.2 259.9 243.2 259.9 242.9 259.8L246.3 260.6L246.9 260L244.3 258.7H244.2Z",fill:"#AB6D29"}),h.jsx("path",{d:"M243.4 257.8C243.4 257.6 243.6 258.3 244.8 258.4C246 258.6 246.6 258.2 246.6 258.2L247.1 258.6L247.7 258.7L247.2 259.6L244.9 258.9L243.7 258.3L243.4 257.8Z",fill:"#D2A567"}),h.jsx("path",{d:"M251.3 256.2L251.9 257.1L252.3 255.1V253.1L251 252.3L251.3 256.2Z",fill:"#AB6D29"}),h.jsx("path",{d:"M247.8 253L246.8 251.2L245.4 248.7L246.2 247.3L247.2 248.7C247.2 248.7 246.9 249.7 247.2 250.7C247.2 251.7 247.8 252.9 247.8 252.9V253Z",fill:"#4D2A15"}),h.jsx("path",{d:"M240.6 259.2C240.6 259.2 241.1 258.5 242.1 258.4L244.1 258.5L246.1 259.7L246.6 260.4L242.6 259.8L240.6 259.2Z",fill:"#D2A567"}),h.jsx("path",{d:"M251.2 252L251.3 255.3C251.4 256 251.9 256.8 251.8 257.1C251.8 257.367 251.533 257.567 251 257.7C250.5 257.9 249.5 257.7 249.5 257.7C249.5 257.7 250.5 257.6 250.5 257.4L250.2 255.4C250.2 254.6 250.2 253.7 250 253.7C249.666 253.767 249.433 253.9 249.3 254.1C249.3 254.2 249.6 251.1 249.9 250.8C250.3 250.4 251.2 252.1 251.2 252.1V252Z",fill:"#8F4620"}),h.jsx("path",{d:"M243.8 258.4C243.8 258.4 243.4 258.1 243.4 257.8C243.4 257.5 243.8 259.1 246.1 259C248.3 258.9 248.1 258.8 248.1 258.8H249.2C249.2 258.8 249 259.8 248.8 259.9C248.6 259.9 247.1 261 247 261.1L246.5 261.4V261.2L246.2 259.5L244.3 258.8L243.8 258.4Z",fill:"#AB6D29"}),h.jsx("path",{d:"M247.8 253C247.8 253 245.2 250.2 244.3 248.5C243.4 246.8 244 244.3 244 244.3L246.4 247.5C246.4 247.5 246.1 248.1 246.2 249.1C246.3 250.1 247.8 252.9 247.8 252.9V253Z",fill:"#8F4620"}),h.jsx("path",{d:"M246.1 262.6C246.1 262.4 245.9 261.8 246.4 261.2C247.945 259.729 249.786 258.603 251.8 257.9V260.3L246.8 262.7L246.1 262.6Z",fill:"#AB6D29"}),h.jsx("path",{d:"M246.4 260.8L247.5 259.8C247.5 259.533 246.933 259.333 245.8 259.2L243.8 258.4C243.8 258.4 245.1 259.5 245.7 259.7C246.1 259.9 246.233 260.1 246.1 260.3L246.4 260.8ZM253 261.4L252 259.7L251.8 257.9L251 258.5L249.5 259C249.5 259 251.1 259 251.1 259.5C251.1 260 248.7 260.3 248.7 260.4C248.7 260.5 250.6 260 250.5 260.4C250.3 260.9 249.5 260.9 248.5 261.4L246.1 262.6C246.1 262.6 246.5 262.9 247.3 262.8L249.6 262.4L252.6 261.2L253 261.4Z",fill:"#8F4620"}),h.jsx("path",{d:"M253 261.4C253 261.4 252.2 261.1 251.6 257.5C251 253.9 251.1 253 251.1 253L252.6 254L253.9 256.3L253 261.4Z",fill:"#AB6D29"}),h.jsx("path",{d:"M253.5 255.4C253.5 255.4 252.8 257.4 252.8 258.6C252.8 259.733 252.866 260.667 253 261.4L254.5 263.2L255 262.7L255.3 261.1V258.4L253.5 255.4Z",fill:"#8F4620"}),h.jsx("path",{d:"M255.5 258.2C255.5 258.2 255.9 263.2 254.5 263.3C254 263.4 253.1 261.4 253 261.3C253 261.3 254.1 263.3 254.6 263C255.4 262.7 255.1 257.8 255.1 257.8L255.5 258.2ZM253 261.4L252.5 260.7C252.1 260.1 252.5 261.2 249.7 262.2C246.9 263.2 246.1 262.6 246.1 262.6C246.1 262.6 247 263.3 249.7 262.5C252.4 261.7 252.2 261.5 252.5 261.5L253 261.4Z",fill:"#202020"}),h.jsx("path",{d:"M248 255C248 255 248.5 255.3 249 256.3L249.8 258L249.9 257.9L249.1 256.2L247.4 253.6L248 255Z",fill:"#AB6D29"}),h.jsx("path",{d:"M246.4 261.2C246.4 261.2 246.7 260.2 246.4 260.1L244 259.9L240.6 259.2C240.6 259.2 241.9 260 243.1 260.3L245.8 261H246.3L246.4 261.2Z",fill:"#8F4620"}),h.jsx("path",{d:"M246.4 261.2L246.2 260.8C246 260.6 245.7 260.8 243.4 260.3L240.6 259.3C240.6 259.3 241.4 259.9 243.4 260.4L246.4 261.2Z",fill:"#202020"}),h.jsx("path",{d:"M247.4 254.6C247.4 254.6 245.7 254.6 245.2 255.1L243.9 256.7L245 256.8C245 256.8 244.9 255.8 245.4 255.3C245.9 254.8 246.7 254.7 247.4 254.6Z",fill:"#AB6D29"}),h.jsx("path",{d:"M244.2 251.4C244.2 251.4 244.9 252.3 245.6 252.6C246.4 252.867 246.967 253.2 247.3 253.6C247.7 253.9 248 255 248 255C248 255 245.6 253.9 245.2 253.4C244.7 252.8 244.2 251.4 244.2 251.4Z",fill:"#8F4620"}),h.jsx("path",{d:"M246.6 252C246.6 252 246.3 251.6 245.6 251.3C245 251.033 244.566 251 244.3 251.2V251.4L245.1 252.7L245.6 252.6C245.6 252.6 244.3 251.8 244.6 251.6C245.2 251 246.6 251.9 246.6 251.9V252Z",fill:"#8F4620"}),h.jsx("path",{d:"M253 248.9L266.6 241.9L273 250.9L261.3 253.9L255.1 254.5L252.1 252.3L253 248.9Z",fill:"#202020"}),h.jsx("path",{d:"M271.2 252.7L288 267.3L286.2 268.6L282.2 267.5L274 259.4L271 256.3L271.2 252.7Z",fill:"#4D2A15"}),h.jsx("path",{d:"M292.8 264.4L283.1 257.1L271 248L271.3 252.3L285.2 265.1L289.8 267.3L292.1 266.6L293.3 265.4L292.8 264.4Z",fill:"#4D2A15"}),h.jsx("path",{d:"M271.1 254.1C271.1 254.1 276 259.6 279.7 262.4C283.4 265.2 286.9 268.2 287.7 267.8C288.5 267.4 288.1 266.9 288.1 266.9L271.1 253V254.1Z",fill:"#803F1D"}),h.jsx("path",{d:"M283 268.1L281.4 269.4L279.4 268.6L269 258L269.5 256L271 256.3L283 268.1Z",fill:"#4D2A15"}),h.jsx("path",{d:"M292.8 264.4C292.8 264.4 291.5 267.4 288.8 266.7C286.1 266 271.2 251.9 271.2 251.9V253.4C271.2 253.4 286.2 267.2 289.2 267.7C292.1 268.3 294.5 265.7 294.2 265.5L292.8 264.5V264.4Z",fill:"#202020"}),h.jsx("path",{d:"M269.5 256.3C269.5 256.3 274.3 262.5 276.8 264.7C279.4 267 281.6 268.8 282.6 268.6C283.6 268.4 282 267.2 282 267.2L274.7 260.1L271 256.3C271 256.3 269.5 255.7 269.5 256.3Z",fill:"#803F1D"}),h.jsx("path",{d:"M270.7 256.3C270.7 256.3 282.9 268.7 283.8 269C285.8 269.6 288.8 267.5 288.8 267.5L287.8 266.9L287.6 267.3C287.6 267.3 287.1 268.5 284.4 268C279.537 264.466 275.077 260.409 271.1 255.9L270.7 256.3Z",fill:"#202020"}),h.jsx("path",{d:"M275.3 268.2L270.8 263.1L269.8 261.4L269.6 259.2
1216L278.4 268.2L277.2 269L276.1 268.6L275.3 268.2Z",fill:"#4D2A15"}),h.jsx("path",{d:"M283.3 268.4C283.3 268.4 282.3 270 280.8 269.7C279.894 269.513 279.082 269.018 278.5 268.3L270 260L269.8 258.7C269.8 258.7 279.1 268.6 280.8 269C282 269.3 282.8 267.8 282.8 267.8L283.3 268.4Z",fill:"#202020"}),h.jsx("path",{d:"M278.6 268.1C278.6 268.1 278.2 269.3 276.9 269.1C275.6 268.9 275.3 268.5 275.3 268.5L270.1 262.3L270 260.7C270 260.7 275.4 268.1 276.6 268.6C277.9 269 278.2 267.7 278.2 267.7L278.6 268.1Z",fill:"#202020"}),h.jsx("path",{d:"M273 251.9C273 251.9 278 256.2 278.5 256.4C279 256.6 280.7 256.7 280.8 257C280.9 257.3 279.6 257 279.5 257.2C279.5 257.5 282.1 259.6 282.5 259.7C282.9 259.7 285 259.7 285 260C285 260.3 283.5 260 283.5 260.3C283.5 260.6 285.7 262.5 286.2 262.5C286.6 262.6 289.2 262.6 289.2 262.9C289.2 263.2 287.1 262.9 287.2 263.3C287.2 263.7 290.8 266 290.7 266.3C290.6 266.6 286.3 263.5 286.2 263.6L285.7 265C285.4 265.1 285.7 263.6 285.5 263C285.3 262.4 282.8 260.5 282.5 260.7C282.2 260.9 282.5 262.1 282.3 262.1C282.1 262.1 282.3 260.7 282.1 260.2C281.9 259.7 279.5 257.8 279.2 257.8C278.9 257.8 279.1 258.8 278.9 259C278.7 259.2 278.7 257.8 278.4 257.4C278.1 257 272.8 252.2 273 251.9Z",fill:"#B07229"}),h.jsx("path",{d:"M264.4 265.9C264.4 265.9 264.4 267.8 263.6 268.1C262.8 268.4 261.1 264.6 261.1 264.6L260.7 261L263.2 263.4L264.4 265.9ZM271.1 264.9V263.9L270.9 262.7L270.7 260.7L270.3 259.5L269.9 258.6H269.3L268 259.6L267.6 260.9L268.3 263.3L268.9 265.4L269.9 265.8L271.1 264.9Z",fill:"#4D2A15"}),h.jsx("path",{d:"M269.4 268.3C269.7 268.1 269.1 265.5 269.1 265.5L267.6 261.7L267.1 260.3L265.9 259.8L265.1 260.8L265.2 262.3L267.1 265.8C267.6 266.6 268.9 268.4 269.4 268.2V268.3Z",fill:"#4D2A15"}),h.jsx("path",{d:"M268 260C268.5 260.4 269 261.4 269.1 262.1C269.1 262.1 270.1 265 270 265.2C269.9 265.4 269.2 265.5 269.2 265.5C269.2 265.5 270.6 267 271 266.8C271.4 266.6 271.3 265.2 271.1 264.9C270.9 264.6 270.6 264.9 270.4 264.5C270.2 264.2 269.7 262.3 269.7 261.2V259C269.9 258.7 270.9 261.3 270.9 262.7L271.4 263.3L270.9 260.7L270.4 258.9L270.6 257.7V256.9L271.3 257.3C271.567 257.367 271.767 256.833 271.9 255.7C272.1 254 271.8 250.9 271.8 250.9L266.4 258L268 260Z",fill:"#202020"}),h.jsx("path",{d:"M268 259.4C268 259.4 267.8 261.4 268.5 263.4C269.2 265.3 269.4 265.4 269.5 265.6C269.7 265.9 269.7 268 269.5 268.2C269.5 268.2 268 264.7 267.5 263C267 261.3 267 260.6 266.7 260.4L266.1 260.3L268 259.4Z",fill:"#202020"}),h.jsx("path",{d:"M267.5 269.6C267.6 269.6 267.5 268.8 267.5 268.8L267.3 267L265.4 263L263.4 261.2L262.3 259.5L262.1 262.7C262.1 262.7 263.6 265.9 264.6 266.9C265.6 267.9 267.2 269.7 267.5 269.6Z",fill:"#4D2A15"}),h.jsx("path",{d:"M259.7 260.9C259.7 260.9 260.1 261.7 260.1 262.3V263.3L261.5 266.1C262.2 267.4 262.9 268.6 263.5 268.4C264 268.1 264.2 267.2 264.3 267.1C264.3 267 263.6 268.1 263.3 267.9C263 267.7 261.3 262.7 261.4 262.6L260.6 262L259.7 260.9ZM265.4 265.2L264 262.7C263.467 261.833 263.1 261.367 262.9 261.3C262.7 261.3 262.5 259.8 262.5 259.8C262.5 259.8 263 260.8 263.8 261.2C264.467 261.6 264.967 261.767 265.3 261.7L265.5 263.3L265.4 265.3V265.2Z",fill:"#202020"}),h.jsx("path",{d:"M262 262.6C262 262.6 262.3 263.7 263 264.8L264.9 267.1C264.9 267.1 263.6 265.9 262.9 264.9C262.2 263.9 261.8 262.6 261.8 262.6H261.9H262Z",fill:"#5C3A1D"}),h.jsx("path",{d:"M265.6 261.3C265.6 261.3 266 260.3 266.3 260.3L267.2 260.1C267.2 260.1 266.7 260 266.2 259.5L265.2 258.5L265.5 260L265.6 261.3ZM265.3 261.6L267.3 266C267.6 267.2 267.6 268.8 267.6 268.8L267 266.7C266.7 265.7 265.3 263 265.2 262.7C265.1 262.4 265.2 261.7 265.2 261.7L265.3 261.6Z",fill:"#202020"}),h.jsx("path",{d:"M267.4 259.5L267.8 254.7L267.4 252.9L265.2 248.1C265.2 248.1 265.1 248.8 264.5 248.8C263.572 248.542 262.738 248.021 262.1 247.3C261.664 248.555 261.595 249.907 261.9 251.2L266.2 259.1L267.4 259.5Z",fill:"#4D2A15"}),h.jsx("path",{d:"M259 262.7C259 262.7 259.7 263.5 260 263.4C260.3 263.3 260.3 261.8 259.8 260.9C259.3 260 254.2 253.2 253.4 252.8C252.7 252.4 259 262.7 259 262.7Z",fill:"#8B441F"}),h.jsx("path",{d:"M262.5 259.9C262.6 260.2 263 262.4 262.1 262.6C260.9 262.8 255.2 255.1 254.4 254C254.4 254 250.8 251.8 250.8 251.2C250.8 250.6 254.6 252 254.6 252L262.1 259.2
1216L262.5 259.9Z",fill:"#8B441F"}),h.jsx("path",{d:"M259 262.7C259 262.7 258.4 261.6 258.3 260.7C258.233 260.033 258.133 259.567 258 259.3L253.4 252.7L251.6 251.6L251.8 253.5C251.8 253.5 253.1 255.9 255 258.1L259 262.7Z",fill:"#202020"}),h.jsx("path",{d:"M265.3 261.6C265.8 261.3 265.6 259.4 265.3 258.8C265.2 258.2 261.8 251.2 261.8 251.2L260.8 251.6L258.9 250.1L257.9 249L258.2 251.5V252.8L260.8 257.4L265.3 261.6ZM269.1 257.4L269.9 256.4L269.4 252.9L267.2 245.3C267.2 245.3 266.7 245.5 266.2 245.1L265 244.1L265.5 248.6L267.8 255L268 256.9L269.1 257.4Z",fill:"#4D2A15"}),h.jsx("path",{d:"M262.1 259.2C262.1 259.2 259.9 256.8 259.1 255.6L257.8 253.2C257.8 253.2 257.2 253.5 256.4 253.2C255.7 252.8 254.6 251.7 254.6 251.7C254.6 251.7 254 252.9 257.2 256.2C260.9 259.9 262.2 259.2 262.2 259.2H262.1Z",fill:"#202020"}),h.jsx("path",{d:"M267.5 260C268.5 259.6 268.5 255.7 267.5 253C266.6 250.4 265.2 248 265.2 248C265.2 248 267 252.4 267.4 254C267.8 255.8 267.4 257 267.1 257C266.8 256.9 266.8 256 266.1 254.3C265.3 252.6 264.8 252.2 264.8 252.2C264.8 252.2 267.4 259.2 266.7 259.1C266 258.9 262.4 251.1 262.2 250.9C262.1 250.7 262 251.2 262 251.2C262 251.2 265.2 261 267.5 260Z",fill:"#8B441F"}),h.jsx("path",{d:"M269.6 241L271.2 244.4L271.7 247.9L271.8 250.9C271.8 250.9 271.9 256.9 271.2 256.9C270.5 257.1 270.1 256.4 270.1 256.2L268.7 249.6L267.3 242.8L267.8 242.4L268 241.4L269 241.3L269.6 241Z",fill:"#4D2A15"}),h.jsx("path",{d:"M265.3 261.6C265.9 261.6 265.3 260 265.3 260C265.3 260 264.8 260.7 264.3 260.2C263.8 259.7 263.3 257.7 263.3 257.7L262.9 256.5C262.9 256.5 262.4 257.8 261.9 257.8C261.2 257.8 258.2 252.7 258.2 252.7L257.8 253.2C257.8 253.2 262.1 262.1 265.3 261.6Z",fill:"#8B441F"}),h.jsx("path",{d:"M263.3 257.7C263.3 257.7 263.8 256.5 263.6 255.3C263.129 253.912 262.526 252.573 261.8 251.3L260.8 251.2L258.9 250.2C259.995 252.9 261.477 255.427 263.3 257.7ZM265.8 255.9C265.8 255.9 265.4 253.2 264.1 250.7C263.611 249.472 262.936 248.325 262.1 247.3V250.1C262.1 250.1 263.3 250.6 264.1 252.1L265.8 255.9ZM269.2 251.3C269.2 251.3 269 248.3 268.5 246.6L267.5 242.6L267.8 242.4H268.3C269 242.5 269.3 244.1 269.3 244.1L269.1 241.6L268.9 241.2H267.8C267.8 241.2 268 241.9 267.7 242.2C267.4 242.5 267.2 242.1 267.1 242L267 242.3L267.2 243.9V245.3C267.2 245.3 267.6 247 268.2 248.1L269.2 251.3ZM271.8 250.9C271.8 250.9 272.3 246.7 271.4 243.9C271.052 242.65 270.438 241.49 269.6 240.5L269.1 241.1C269.1 241.1 270.6 243.4 271.1 245.5C271.5 247.8 271.8 250.9 271.8 250.9ZM267.5 253.1C267.5 253.1 267.1 249.7 266.5 247.6L265.7 244.6L264.8 243.9C264.8 243.9 265.3 246.1 265.3 246.8L265.2 247.8C265.2 247.8 265.6 249 266.2 250C266.8 251 267.5 253 267.5 253V253.1Z",fill:"#202020"}),h.jsx("path",{d:"M269.8 258.3C270.6 258.3 269.8 253.5 269.5 252.3L267.2 245.3C267.2 245.3 269.6 253.5 269.4 253.9C269.1 254.5 268.2 251.4 268 251.5C267.8 251.5 269.8 257 269 257.1C268.4 257.1 268 255.9 268 255.9V257.1C268 257.1 268.5 258.3 269.8 258.3Z",fill:"#904720"}),h.jsx("path",{d:"M270.8 255.9C271.4 255.9 270.6 251.4 270.2 249.3L268.7 243.3C268.7 243.3 269.8 246.1 270.5 249.3C271.2 252.5 271.5 256.6 271 256.7C270.3 256.7 270 256.1 270 256.1V255.4C270 255.4 270.2 255.9 270.8 255.9Z",fill:"#904720"}),h.jsx("path",{d:"M263 261.2C263 261.5 263 263.1 262.2 263C261.4 262.9 259.9 261.5 259.6 260.5C259.6 260.5 261.4 262.5 262 262.5C262.6 262.5 262.6 260.5 262.5 259.9C262.5 259.4 263 261.2 263 261.2Z",fill:"#312317"}),h.jsx("path",{d:"M267.3 239.6C267.3 239.6 268.3 240.3 269.3 239.8C269.691 239.531 270.013 239.174 270.239 238.756C270.465 238.339 270.588 237.874 270.6 237.4C270.666 236.8 270.5 236.167 270.1 235.5C269.5 234.8 270.9 236.1 270.9 237.4C270.9 238.7 270.9 240.8 268.9 241.3C266.9 241.8 267.8 241.2 267.8 241.2L267.3 239.6Z",fill:"#D2A567"}),h.jsx("path",{d:"M265.7 235.8C265.7 235.8 267 237.8 267.5 239.8C267.967 241.533 267.967 242.4 267.5 242.4C267.234 242.4 267.1 242.167 267.1 241.7L265.7 235.8Z",fill:"#8F4620"}),h.jsx("path",{d:"M243.3 238.3L251.7 250.6L262.4 238.6L255.7 231.8L243.3 238.3Z",fill:"#1E2121"}),h.jsx("path",{d:"M254 230.8L253.5 232.8L254.5 236L256.3 237.8L258.3 239.2L258.8 237.7L259.3 235.9L259.8 235.7L261.1 236.2L262 234.9L2
121663.4 232.5L263.1 231.5L262.7 230.8L260.6 227.1L259.9 228.5L259.2 228.9L258 228.2L256.5 230.2L254.6 229.3L254 230.8Z",fill:"#4D2A15"}),h.jsx("path",{d:"M258.4 239.2C258.4 239.2 258.7 238.9 258.9 238C259 237 259.1 234 258.8 232.8C258.5 231.6 257.8 229.3 257.6 229.5C257.4 229.6 258.8 232 258.6 235C258.4 237.9 258.6 238.7 257.9 239C257.2 239.3 258.4 239.2 258.4 239.2Z",fill:"#5C3818"}),h.jsx("path",{d:"M258.8 234.3C258.8 234.3 260.2 236.3 260.9 235.5C261.6 234.8 261.2 232.3 260.9 231.3L259.9 228.8L260.3 228.4L261 231.1C261.3 232.2 262 235.3 261.1 235.9C260.2 236.5 258.9 234.7 258.9 234.7V234.3H258.8Z",fill:"#5C3818"}),h.jsx("path",{d:"M254.3 235.6C254.3 235.6 254.8 234.9 255.4 234.9C256.066 234.967 256.333 235.033 256.2 235.1L256.8 236.7L257.7 238.4L258.5 239.3L258.1 239.8H257.4L255.4 238.8L254.8 238L254.3 235.6Z",fill:"#8F4620"}),h.jsx("path",{d:"M257.6 253C257 253.4 255.5 252.7 254.6 251.9L249.2 246.5L248.6 244L250.4 244.4L253.4 243.1L254 242.1L257.7 240.1L259.7 239.1L264.2 238.9L265.2 236.8C265.2 236.8 266.8 239.4 267 240.4C267.2 241.4 267.2 244.7 266.8 244.9C266.4 245.1 265 243.9 264.8 243.9C264.5 243.9 265.8 248.5 264.8 248.7C263.7 248.8 261.8 246.9 261.8 246.9C261.8 246.9 262.6 251.1 261.8 251.1C260.8 251.1 258.6 250.1 257.7 249.1C257.7 249.1 258.7 252.5 257.7 253.1L257.6 253Z",fill:"#D2A567"}),h.jsx("path",{d:"M256.8 247.7L257.7 249.1C257.9 249.4 257.7 251.4 257.5 251.7C257.2 252.5 256.2 250.8 255.7 249.4L253.9 246.4C253.9 246 256.8 247.7 256.8 247.7ZM265.5 237.4C265.5 237.4 267 243.9 266.3 244.1C265.5 244.3 263.3 242.1 263.1 241.7L259.8 236.6L259.2 235.9L259.4 235.6L260.7 236.1L265.5 237.4Z",fill:"#8F4620"}),h.jsx("path",{d:"M254.3 249.8C254 250.1 253.3 249 253 248.8L250.6 246.1C249.466 245.033 248.866 244.367 248.8 244.1C248.8 243.8 248.1 243.1 248.1 243.1L248.7 242.5L249.4 242.4C249.4 242.4 253.7 245.8 254 246.4C254.3 246.9 254.5 249.7 254.3 249.9V249.8ZM260.8 249.9C260.6 250.1 257.8 248 256.5 246.3C255.2 244.6 254.1 243.1 253.8 242.3L253.3 240.8L254.1 241C254.1 241 261.1 249.6 260.8 249.9ZM261.8 246.9C261.6 247.1 260.4 246.2 259.6 245.2C258.9 244.2 259.3 242.9 259.3 242.9C259.3 242.9 261.9 246.7 261.8 246.9ZM263.4 246.5C263 246.7 261.4 244.7 260 242.5C259 240.9 258.7 240.6 258.5 240.5L257.5 240.2L257.3 240L258 239.8L258.6 239.1L259.4 238.1L262.8 244.9C262.8 244.9 263.6 246.4 263.4 246.5Z",fill:"#8F4620"}),h.jsx("path",{d:"M254.6 251.9C254.6 252.2 254.6 252.4 253.6 252.3C252.8 252.3 247.9 249.6 245.8 246.1L243.3 242.1L244.3 241L251.9 249.7L254.6 251.9Z",fill:"#AB6D29"}),h.jsx("path",{d:"M254.6 251.9C254.6 252.3 254.334 252.433 253.8 252.3C253.2 252.2 251.3 251.5 248.3 248.1C245.3 244.7 244 242.2 244 242.1L243.9 240.7L244.8 240.3L250 248.3L254.6 251.9Z",fill:"#8F4620"}),h.jsx("path",{d:"M259.7 248.5C259.7 248.5 258.1 247.3 257.1 246.1C256.1 244.9 254.1 242.1 254.1 241.5C254.1 240.9 255.1 241 255.1 241L255 239.5L255.2 239.1L256.7 239.7L258.6 242L259.3 243C259.3 243 260.5 245.8 260.3 246C260 246.4 258.3 244.5 258.1 244.7C257.9 244.9 260.1 248.2 259.7 248.5ZM256.7 247.7C256.7 247.7 257.3 248.5 257 249C256.7 249.5 256.6 249.9 255.8 248.7C255 247.5 254.1 246.2 254 246.3C254 246.4 254.1 248.1 253.7 248.1C253.3 248.1 252.1 246.7 251.3 245.5L249.3 242.5C249.3 242.5 249.5 242 249.4 240.7L249.3 238.7C249.3 238.7 249.3 239.1 249.5 239.4L249.9 240L252.7 243.3L253.5 242.8L255.2 246.1L256.7 247.7ZM245.9 242.7C245.9 242.7 248.1 246.7 250.2 248.8C251.452 250.108 252.947 251.161 254.6 251.9L248 244L246 242.8L245.9 242.7ZM262.9 245.1C262.8 245.1 261.4 243.7 260.5 242.4C259.722 241.197 259.242 239.826 259.1 238.4L259.3 235.6C259.3 235.6 261.6 238 262.1 239.1C262.5 240.1 263.4 241.7 263.2 241.9C263 242.1 261.5 240.9 261.3 241.1C261.1 241.4 263.1 244.9 262.9 245.1ZM265.5 242.6C265.2 242.7 264 241.4 263.7 240.6C263.4 239.6 263.3 238 263.3 238L262.3 235.6L262.4 233L263.4 232.8L264.9 234.9C264.9 234.9 265.5 236.2 265.5 237.9C265.5 239.8 265.8 242.4 265.5 242.6ZM247.5 249.1C245.5 246.6 244.2 244.1 244.2 244.1L243.5 241.9L243.9 242.2C243.9 242.2 244.5 244.8 247.6 247.9C250.8 251 251.5 251.3 251.5 251.3C251.5 251.3 252.1 253 251.8 253.6C251.8 253.6 249.5 251.6 247.5 249.1Z",fill:"#4D2A15"}),h.jsx("path",{d:"M250.9 252.7C250.9 252.7 248.2 250.3 246 247.7C243.9 244.9 242.5 242.3 242.5 242.3L243.5 241.4C243.5 241.4 245.3 245.6 246.5 247.3L250.9 252.7ZM254.6 251.9L250 247C249.03 245.937 248.19 244.762 247.5 243.5L248.8 244C248.8 244 249.3 245.4 250.5 246.8L254.6 251.9ZM254 246.3C254 246.3 252.3 244.3 251.5 242.9L249.8 239.9C249.8 239.9 252.1 242.6 252.8 242.7H253.5C253.3 242.6 253.2 243.7 253.5 244.5C253.6 245.3 254 246.3 254 246.3ZM254.7 237.9C254.7 237.9 255 239.3 254.8 240.2C254.6 241.1 254.1 241 254.1 241L255.6 242.8C256.1 243.4 257.4 244.3 257.4 244.3L255.9 242.1C255.5 241.4 254.9 240.5 255.2 239.8C255.4 239.1 256.8 240.3 257.2 240.6L259.2 242.9C259.2 242.9 258.7 240.9 257.8 240.2L254.8 237.9H254.7Z",fill:"#202020"}),h.jsx("path",{d:"M261.6 242.3L260.2 238.8L258.9 234.8V237C258.9 238 258.5 239.4 258.1 239.6C257.7 239.8 257.6 239.8 256.8 239.6C256.1 239.4 257.4 240 257.4 240C257.4 240 258.2 240 258.4 239.6C258.8 239.2 258.9 238.4 259.3 238.5C259.6 238.6 260 239.8 260.3 240.4L261.6 242.3Z",fill:"#202020"}),h.jsx("path",{d:"M259 234.7C259 234.7 260.6 236.6 261.3 235.7C262 234.8 261.6 232.6 261.6 232.6C261.6 232.6 262.6 232.9 262.9 232.6C263.2 232.3 263.1 231.6 263.1 231.6C263.1 231.6 264.9 234.1 265.7 235.8C266.6 237.4 267 240.4 267 240.4C267 240.4 265.5 238 264.8 235.8C264.1 233.6 263.1 232.8 262.9 233C262.7 233.2 262.5 234.6 262.7 235.4L263.9 238.1C264.4 239.2 264.9 240.9 264.9 240.9L263.5 238.9C262.967 238.233 262.5 237.8 262.1 237.6C261.8 237.3 261.3 236.6 260.8 236.5C260.3 236.4 259.3 235.8 259.3 236.2L259.1 235.4L259 234.7Z",fill:"#202020"}),h.jsx("path",{d:"M253.4 242.6L255 245.4L256.8 247.7C256.8 247.7 255.2 246.3 254.6 245.4C254 244.4 253.4 242.6 253.4 242.6Z",fill:"#171717"}),h.jsx("path",{d:"M264.1 243C263.9 243.2 263.1 242.9 263.1 243.2C263 243.5 263.5 244.5 264.1 245.1C264.566 245.633 264.866 245.8 265 245.6L264.8 244.5V243C264.7 242.8 264.1 243 264.1 243Z",fill:"#8F4620"}),h.jsx("path",{d:"M244.7 231.5L243.7 232.1L242.7 234.4L243 238.7L244.7 241.1C245.3 242.1 247.5 244.5 248 244.3C248.5 244.1 249.2 242.5 249.2 241.6L249.4 239C249.4 239 249.9 240 250.8 240.9C251.7 241.9 252.5 242.8 252.8 242.7C253.3 242.7 254.5 240.2 254.6 239.8C254.6 239.5 251.4 231.8 251.4 231.8L250 231.1L244.7 231.5Z",fill:"#D2A567"}),h.jsx("path",{d:"M251.8 238L252.7 240.9C253 241.9 252.7 242.7 252.9 242.7C253 242.7 254.7 240.5 254.7 239.5C254.7 238.5 254.7 237.5 254.3 234.5C253.8 231.4 254.4 230.5 254.4 230.5L253.4 229.7L251.9 233L251.8 238ZM246.3 236.2L246.8 240.2C247 241.2 247.6 242.8 247.9 242.7C248.2 242.7 249.2 240.1 249.3 239.2C249.3 239.2 248.6 237.9 248.6 234.8C248.6 231.7 248.3 231.3 248.3 231.3L246.3 236.2Z",fill:"#AB6D29"}),h.jsx("path",{d:"M242 230C242 230 239.5 233.6 239.6 235.6C239.6 237.6 239.9 237.2 240.6 239C241.1 240.8 241.4 243.4 241.4 243.6C241.533 243.8 241.7 243.7 241.9 243.3L242 230Z",fill:"#45392D"}),h.jsx("path",{d:"M242 230.5C242 230.5 239.8 233.8 240 235.7C240.1 237.6 240.4 237.5 241 239.2C241.6 240.9 241.7 243.6 241.7 243.6C241.7 243.6 242.4 243.4 243.2 242.8L244.7 241.1L243.9 239.4L243.3 237.9L242.7 236.9L242.9 233.8L243.5 231.4V230.6L242 230.5Z",fill:"#AB6D29"}),h.jsx("path",{d:"M253.8 236.3L252.2 235.8C251.8 235.5 251.6 234.8 251.6 234.8L251.9 234.2L253.8 236.3Z",fill:"#DBAD6C"}),h.jsx("path",{d:"M242.4 230.8C242.4 230.8 240.9 234.2 241 236.6C241.253 238.452 241.828 240.246 242.7 241.9V234.2L243.4 231.9V230.7L242.4 230.8Z",fill:"#D2A567"}),h.jsx("path",{d:"M246.3 231.6V233C246.2 233.5 245.3 234 245 234.6L244.2 236.9C244.2 236.9 244.5 235.9 245.1 235.4C245.6 234.9 245.8 234.4 245.9 234.8C246 235.1 246.2 236.4 246.1 236.7C245.9 236.833 245.634 237.367 245.3 238.3C245.094 238.917 245.094 239.583 245.3 240.2L245.7 238.4C245.9 237.933 246.067 237.7 246.2 237.7L247.2 239.5V238C247.4 237.3 248.2 236.4 248.3 236.4C248.6 236.4 248.9 236.2 248.1 235.8C247.8 235.6 248 232.4 248.1 232.2C248.4 232.1 249.6 232.1 249.5 231.6L248.2 229.9L246.2 231.6H246.3Z",fill:"#8F4620"}),h.jsx("path",{d:"M253.6 238.5L252.4 238.3L252 237.8V237.3L253 237.8L253.6 238.5Z",fill:"#DBAD6C"}),h.jsx("path",{d:"M243.6 238.9L243.1 240.1L242.8 241.3L242.5 238.7L242.2 236.8L241.7 237.3C241.7 237.3 241.7 236.1 241.9 235.5C242.234 234.767 242.3 234.233 242.1 233.9
1216C241.834 233.9 241.567 234.1 241.3 234.5L240.7 235.5L241.2 234C241.5 233.6 242.6 232.3 242.9 231.7L243.1 230.7L243.9 230.6C243.9 230.6 244.8 231.3 244.8 231.9C244.8 232.2 243.9 232.5 243.9 232.6C243.9 232.7 243.2 232.6 243.1 235.2C242.9 237.9 243.6 237.7 243.6 238.9ZM251 231.9C251 231.9 251.2 233.4 251 233.9C250.867 234.3 250.6 234.733 250.2 235.2C249.8 235.8 249.9 237.2 249.9 237.2L250.3 236.2L250.8 235.3C251 235.3 251.234 235.733 251.5 236.6L252.1 238.6C252.1 238.6 251.9 237.6 252.1 237.6C252.3 237.6 252.5 237.6 252.9 237.9L253.6 238.5C253.6 238.5 253.6 238.1 253.1 237.5C252.6 236.9 252.3 237.1 252.1 236.4C251.967 235.6 251.934 235.033 252 234.7C252.067 234.5 252.3 234.667 252.7 235.2L253.9 236.3L253.4 235.5V233.2C253.4 232.333 253.467 231.733 253.6 231.4C253.9 231.2 254 230.2 253.8 230C253.8 229.8 251 232 251 232V231.9Z",fill:"#8F4620"}),h.jsx("path",{d:"M259.7 228.9C259.7 228.9 259.7 230.5 260 231.5L260.9 234.5C260.9 234.5 260 233 259.6 231.7C259.2 230.3 258.9 228.9 258.6 228.7C258.2 228.7 257.8 229.4 257.8 230C257.865 231.171 258.136 232.322 258.6 233.4C259.1 234.1 257.9 232.4 257.6 231.5L257 229.8C257 229.8 256.7 230.5 256.8 231.4C257 232.3 257.7 233.5 257.7 233.5L256.9 232.7L256.4 232.2C256.4 232.2 256.4 233.4 256.7 233.9L257.7 235.2L256.7 234.3L256.3 233.8C256.3 233.8 256.4 235.5 256.8 236.4L258 238.7C258 238.7 257 238 256.4 236.5C255.795 234.388 255.525 232.195 255.6 230L256.6 228.5C257 227.8 257.6 224.7 257.6 224.7C257.6 224.7 258.2 227.6 258.7 228.2L259.7 228.9ZM252.8 228L253.4 229.1L253.9 229.9C253.9 229.9 253 230.9 252.1 231.6C251.2 232.3 249.9 233.1 249.6 232.7C249.333 232.233 249.233 231.967 249.3 231.9L251.2 230.4C251.751 229.934 252.194 229.354 252.5 228.7L252.8 228ZM244.1 230.9C244.1 230.9 244.2 232.7 245 232.6C245.8 232.6 248 230.3 248.1 230.2C248.3 230.2 248.4 229.6 248.4 229.4V228.8C248.4 228.8 245.9 231.2 245.1 231.3C244.912 231.336 244.719 231.317 244.541 231.246C244.364 231.175 244.211 231.055 244.1 230.9ZM244.1 228.5L243.9 230.1L244.1 230.8C244.2 230.9 242.4 231.4 242.1 230.8C241.8 230.2 242 229.6 242 229.6L243.2 229.5C243.6 229.4 244.2 228.5 244.2 228.5H244.1ZM260.4 226C260.4 226 261.1 227.8 261.6 228.6L262.7 230.8L261.2 229.2L260.2 228.4L260.4 227.5V226Z",fill:"#1E2121"}),h.jsx("path",{d:"M241.7 229.6H242.7L243.4 229.5L244 228.5C244 228.5 243.7 229.6 244 230.5C244.267 231.167 244.533 231.467 244.8 231.4C245.499 231.289 246.137 230.935 246.6 230.4L248.3 229C248.3 229 248.1 230 248.5 231C248.833 232 249.433 232.167 250.3 231.5C251.1 230.8 251.9 229.7 252.3 229.2L252.9 228.4L253.8 227.7L254.6 223.3L254.1 222.7L253.1 223.3L251.7 222.7L251.3 222.2L250.5 223.5L249.7 224H249.3L248.3 224.3L247.9 223.4L247.7 222.8L247.2 222.6L245.2 224.6L244.2 224.5L243.1 226.2L242.3 227.2L241.5 229.2L241.7 229.6Z",fill:"#DBAD6C"}),h.jsx("path",{d:"M251.1 225.2C251.1 225.2 251.3 226.2 250.7 228.1C250.1 230 249.4 231.1 249.4 231.1C249.4 231.1 251.4 230 252.3 227.9C253.3 225.7 253 223.3 253 223.3L251.1 225.2ZM253.5 223.2C253.5 223.2 253.7 223.5 253.5 225.2L252.9 228.4L253.4 229.3C253.6 229.8 254.3 230.7 254.8 230.6C255.334 230.467 255.9 229.867 256.5 228.8L257.5 226.5C257.767 226.367 257.9 226.433 257.9 226.7C257.9 226.7 258.1 227.7 258.6 228.1C259.1 228.5 259.6 229.1 260 228.9C260.334 228.633 260.5 228.3 260.5 227.9L259.5 224.7L258.2 221.5L257.4 220.3L255.1 220.5L253.5 223.2Z",fill:"#8F4620"}),h.jsx("path",{d:"M257.4 220.3C257.4 220.3 258 221.6 258.1 223.1C258.2 224.6 257.8 226.1 257.8 226.1V223.1C257.7 221.9 257.2 221.4 257.2 221.1L257.4 220.3Z",fill:"#AB6D29"}),h.jsx("path",{d:"M260.5 226V228C260.3 228.5 259.5 227.5 258.9 225.5C258.4 223.5 258.5 223.1 258.1 222.1L257.4 220.3L258.5 220.1L260.5 226ZM254.9 229.8C254.9 229.8 257.1 228.5 257.4 224.8C257.4 223.1 256.4 220.3 256.4 220.3C256.4 220.3 256.4 223.3 255.6 225.3L254.1 228.4L254.9 227.9L255.5 227V228.3L254.9 229.8ZM253 223.3C253 223.3 253 224.1 252 224.8C251.1 225.6 249.5 226.4 249.5 226.4C249.5 226.4 250.7 225.3 251.1 224.3C251.5 223.3 251.2 222.7 251.2 222.7C251.2 222.7 251.1 223.2 250.6 223.7C250.1 224.2 249.3 224.1 249.3 224.1C249.3 224.1 249.3 223.6 249.8 223.1L250 222.5C250.2 221.7 250.9 220.6 250.9 220.6C250.9 220.6 251.4 221.8 251.9 222.3L253 223.3Z",fill:"#4D2A15"}),h.jsx("path",{d:"M259.8 218.9C259.8 218.9 260.3 220.2 260.5 222.1C260.7 223.9 260.5 226.1 260.5 226.1L259.1 223.6L258.6 221.3L257.7 220.5L256.9 220.4C256.9 220.4 257.6 220.1 257.6 219.5V218.7C258.3 218.972 259.062 219.041 259.8 218.9ZM254.9 226.7C254.9 226.7 256.1 225.1 256.4 223C256.7 221 256.4 220.3 256.4 220.3C256.4 220.3 255.9 220.2 255.4 219.8C254.9 219.4 254.4 218.4 254.4 218.4C254.4 218.4 254.6 219.4 254.4 220.8C254.2 222.2 253 223.3 253 223.3C253 223.3 253.6 223.5 254.2 223.2C255.4 222.5 255.2 221.2 255.2 221.2C255.2 221.2 255.5 221.4 255.5 223C255.5 224.6 254.9 226.7 254.9 226.7Z",fill:"#1E2121"}),h.jsx("path",{d:"M241 229.5C240.7 229.5 241.7 227.9 242.4 226.8L244.1 224.1C244.1 224.1 244.3 224.3 244.7 224.3C245.105 224.232 245.491 224.081 245.835 223.857C246.179 223.634 246.473 223.342 246.7 223L247.4 221C247.4 220.7 247.4 222.4 248.2 223.3C249 224.3 248.9 224.2 249.2 224.1C249.2 224.1 249.2 225.3 248.9 226.3L248.3 229C248.3 229 248.4 227 248.1 226.4C247.8 225.8 247.6 226.4 247.3 227.2C247 227.9 246.4 228.4 246.4 228.4L247.2 226.6C247.5 225.
12166 247.3 225.6 247.2 225.6L246.7 225.9C246.3 226.3 246.067 226.467 246 226.4C245.9 226.3 246.4 226.1 246.6 225.6C246.6 225.1 247.1 224.4 247.3 224.2L247.7 223.4C247.7 223.133 247.633 222.933 247.5 222.8C247.367 222.667 247 223 246.4 223.8C245.6 224.5 245.4 224.5 245.4 224.8L244.7 226.8L243.8 229.1L243.4 229.5L244 227.5C244.4 226.5 245 225 244.8 224.8C244.667 224.6 244.5 224.6 244.3 224.8C244.2 225 243.3 225.9 242.6 227C241.9 228.1 241.9 229.5 241.7 229.6L241 229.5Z",fill:"#8F4620"}),h.jsx("path",{d:"M260.5 217.7C260.5 217.8 260.6 218.7 259.8 218.9C259.141 219.097 258.435 219.061 257.8 218.8V217.6L260.5 217.7Z",fill:"#874F20"}),h.jsx("path",{d:"M244.8 220.3L244.2 222C243.7 223 243 223.7 243.1 223.8C243.2 223.9 243.6 224.4 244.3 224.3C245 224.2 245.1 220.5 245.1 220.5V220.3H244.8Z",fill:"#B27129"}),h.jsx("path",{d:"M254.8 218.2C254.8 218.2 254.4 223.2 253 223.2C251.6 223.2 251 220.7 251 220.7C251 220.7 250.8 224.2 249 224.2C248.1 224.2 247.3 221.5 247.4 221C247.4 221 247.1 222.8 246.2 223.5C244.5 224.9 243.4 224.2 243.4 224C243.3 223.8 244.8 222.3 245 220.3C245 220.433 245.234 220.267 245.7 219.8C246.1 219.133 246.434 218.767 246.7 218.7C247.2 218.7 249.3 217.8 249.3 217.8L250.3 216.5C250.3 216.5 250.5 216.9 251.3 216.4C251.763 216.041 252.111 215.554 252.3 215L254.5 216.8L254.7 218.2H254.8Z",fill:"#DBAD6C"}),h.jsx("path",{d:"M249.1 213.3L251.3 216.3L251.8 215.9C252.066 216.3 252.166 216.633 252.1 216.9C251.8 217.6 251.1 218.7 251.6 219.9C251.533 219.833 251.6 219.333 251.8 218.4C252.066 217.6 252.3 217.267 252.5 217.4C252.7 217.4 253 222 253.3 222C253.6 222 254 219.9 254 218.4C254 216.9 254.3 218.1 254.5 218.4C254.6 218.7 255.9 220.8 257 220.4C258 220.2 258 218.2 257.9 217.8L257.1 214.8L252.2 211.8L251.8 213C251.5 213.8 249.1 213.3 249.1 213.3Z",fill:"#B27129"}),h.jsx("path",{d:"M256 212.8C256 212.8 256.3 213.1 256.8 214.3C257.3 215.5 257.3 219.4 256.8 219.4C256.1 219.4 254.8 218.7 254.6 218.1C254.4 217.6 254.7 215.7 254.3 215.1C253.841 214.43 253.503 213.686 253.3 212.9L253.4 211.4L254.5 211L256.1 212.8H256Z",fill:"#8F4620"}),h.jsx("path",{d:"M255.7 211.6L257.7 214.7L259.7 217.3L260.5 217.7C260.194 218.045 259.777 218.273 259.322 218.346C258.866 218.419 258.399 218.332 258 218.1C257.3 217.7 257.7 216.5 256.8 214.5C256.199 213.297 255.305 212.266 254.2 211.5L254.8 211L255.8 211.6H255.7Z",fill:"#4D2A15"}),h.jsx("path",{d:"M254.6 210C254.6 210 256.4 211.1 257.1 212.5L258.9 215.9C259.7 217.2 260.6 217.6 260.5 217.7C260.433 217.833 260.1 217.833 259.5 217.7L258.5 216.4L256.5 213C255.959 212.393 255.316 211.886 254.6 211.5L255.9 213.2C256.383 213.956 256.691 214.81 256.8 215.7L255.8 214.1C255.2 212.9 253.7 211.4 253.6 211.6L254.8 214L255.8 216.6L254.4 214.3C253.6 213 253.4 213.2 253.1 212.8L252 211.4C252 211.4 252.7 211.6 253.5 211.1C254.2 210.6 254.5 209.9 254.5 209.9L254.6 210Z",fill:"#1E2121"}),h.jsx("path",{d:"M249.8 213.3C249.8 213.3 251 213.6 251.7 213.5H252.6C252.6 213.5 253 214 253 214.6C253 215.2 252.5 216.3 252.4 216.4C252.2 216.4 252.2 215.4 251.9 215L249.9 213.3H249.8Z",fill:"#8F4620"}),h.jsx("path",{d:"M250.5 216.5C250.5 216.5 250.9 217.8 250.5 219.5C250.3 221.4 249.2 223.2 249 223.2C248.7 223.2 248.8 221.2 248.7 220.2V219.8L248.2 221C248.2 220.9 248.6 219.1 248.5 219V218.3L249.8 216.7L250.5 216.5Z",fill:"#B27129"}),h.jsx("path",{d:"M248.2 217.8C247.8 218.3 247.2 218.1 246.8 218.3C246.3 218.4 246.1 219.2 246.1 219.2C246.1 219.2 246.5 218.9 246.7 219C246.9 219.1 247.1 219 246.7 220C246.3 220.8 244.9 222.3 245 222.4C245 222.4 246.6 221.1 247 220.4C247.6 219.6 247.5 219.2 247.6 218.9C247.7 218.6 248.3 218.3 248.5 218.3C248.634 218.167 248.8 218.367 249 218.9L249.4 220.9L250.1 218.9L250.2 216.6L249.7 216.5L248.5 215.8C248.5 215.8 248.7 217.2 248.2 217.8Z",fill:"#8F4620"}),h.jsx("path",{d:"M254.6 208.6C254.6 208.6 255.1 209.9 254.1 210.7C253.833 210.967 253.467 211.133 253 211.2C252.4 211.2 251.6 210.7 251.6 210.7L248.5 209.4L246.8 208.9L246 208.7L246.1 207.8L248.6 207.9L251 208.9L252 209.2L253 209.3H253.6L254.2 209.2L254.5 208.9L254.6 208.6Z",fill:"#DBAD6C"}),h.jsx("path",{d:"M254.6 208.6C254.7 208.8 254.4 209.6 254.2 209.6C254 209.8 253.467 209.833 252.6 209.7C251.6 209.5 250.7 208.9 249.6 208.7C248.667 208.3 247.833 208.1 247.1 208.1C246 208.1 246.6 207.7 246.6 207.7C246.6 207.7 248.5 207.5 250.1 208.1C251.7 208.7 252.4 209.1 253.2 209.1C254.4 209.1 254.6 208.6 254.6 208.6Z",fill:"#AB6D29"}),h.jsx("path",{d:"M246.1 207.7H246.8L247.3 207.5L247.2 208H246.2L246.1 207.7Z",fill:"#4D2A15"}),h.jsx("path",{d:"M252.2 211.5C252.2 211.5 253.3 212.5 253 213.5L251 212.5L247.5 211.1L245.7 210.5L245.4 210.2L246 209.6V209L248.3 209.3L250.7 210L252.2 211.5Z",fill:"#DBAD6C"}
1216),h.jsx("path",{d:"M249.9 213C249.9 213 251.9 215.5 251.4 216.4L246.9 213.4L245.2 216.1L241.5 214.3C241.5 214.3 244.5 212 244.9 211.5L245.2 210.9L246.9 211.3L249.6 212.1L249.9 213Z",fill:"#DBAD6C"}),h.jsx("path",{d:"M248.8 209.3C248.8 209.3 250.4 209.7 251.5 210.3C252.5 210.7 253.9 210.9 253.9 210.9C253.9 210.9 253.3 211.5 252.2 211.5C251.733 211.367 251.2 211.033 250.6 210.5C249.7 209.7 248.6 209.7 248.6 209.7L248.8 209.3Z",fill:"#AB6D29"}),h.jsx("path",{d:"M246 208.4L247.9 209C248.6 209.3 248.6 209.2 248.9 209.2L249 209C249 209 249.2 209.7 248.6 209.7C248 209.7 247.9 209.5 247.2 209.2C246.5 208.9 246 209.2 246 209.2V208.4Z",fill:"#4D2A15"}),h.jsx("path",{d:"M252.3 212.9C252.3 212.9 253.2 213.4 253 213.5C252.867 213.633 252.434 213.733 251.7 213.8C251.1 213.8 250.6 213.733 250.2 213.6C249.6 213.4 249.4 212.5 248.2 212L245.9 211.2L244.9 211L245.7 210.7L248.3 211.2L250.5 211.9L251.8 212.5L252.3 212.9ZM248 214.4L248.5 216.4L248.2 217.7L247.5 218.1L246.9 217.9L246.7 217.5C246.7 217.5 247 217 246.7 216.6C246.4 216.2 245.1 215.6 245.1 215.6C245.1 215.6 245.6 214.6 246.1 214.4C246.8 214.2 246.5 213.4 246.5 213.4L248 214.4Z",fill:"#AB6D29"}),h.jsx("path",{d:"M245.4 210.2C245.4 210.2 245.8 210.6 246.7 210.7L248.4 211C248.6 211.1 249.2 210.8 249.3 210.8L248.8 211.1L250.8 211.8C251.7 212.2 252.4 212.8 252.4 212.8L250.8 212.1L248.4 211.4C246.8 211.1 245.3 211.2 244.9 211.1C244.5 211 245.1 211 245.2 210.8C245.4 210.533 245.466 210.333 245.4 210.2Z",fill:"#4D2A15"}),h.jsx("path",{d:"M251.2 215.8C251.2 215.8 251.7 216.4 251.2 216.6C250.7 216.8 249.2 216.7 248.6 216L248.2 215C247.9 214.7 246.9 214 246.2 213.7C245.7 213.3 246.5 213.2 246.5 213.2L249.4 214.5C250.2 214.9 251.2 215.8 251.2 215.8Z",fill:"#AB6D29"}),h.jsx("path",{d:"M251.3 215.9C251.3 215.9 250.3 214.5 247.3 213.3L248.2 213.1H246.7L246 212.8C244.4 212.4 244.3 212.4 244.2 212.2C244.134 212.067 244 212.167 243.8 212.5L243.2 213.3C243.848 213.098 244.536 213.063 245.2 213.2C246 213.4 246.267 213.7 246 214.1C246 214.4 244.9 215.7 245 215.7C245.1 215.7 245.7 214.5 246.5 214.7C247.234 214.967 247.567 215.167 247.5 215.3L247.4 214.6C247.2 214.4 246.4 213.6 246.6 213.6C246.8 213.6 247.8 213.9 249.2 214.6C250.6 215.3 250.8 215.5 251.2 215.9H251.3Z",fill:"#4D2A15"}),h.jsx("path",{d:"M246.5 213.6C246.5 213.6 248.7 214.3 248.6 216.6C248.6 219 246.8 218.6 246.6 217.7C246.4 216.8 246.9 218.1 247.5 218C248.167 217.867 248.433 217.3 248.3 216.3C248.3 215.5 248.033 214.9 247.5 214.5L246.5 213.6Z",fill:"#DBAD6C"}),h.jsx("path",{d:"M236.8 208C236.8 208 237.1 208 236.4 209.8C236.01 211.023 235.362 212.148 234.5 213.1C232.7 215.1 231.9 215.1 232.1 215.9C232.3 216.8 233 216.6 233.1 216.6C233.3 216.6 236.6 211.8 236.6 211.8L237.3 209L237.1 208.2L236.9 207.9L236.8 208Z",fill:"#6C3F18"}),h.jsx("path",{d:"M244.9 204.5C244.9 204.5 245.9 205.9 245.5 208.5C245.2 211.2 241.7 213.5 241.7 213.5L236.7 217.1L234.5 216.9H233.9L233.2 216.5C233 216.5 232.8 215.5 232.8 215.5L233.4 214.7L235.3 212.9L236.4 211.2C236.4 211.2 237 210.2 237 209.3L236.9 207.9L237.3 208.6L237.5 210L237.3 211.6L238.7 210.6L240.4 209.9C240.4 209.9 240.9 209.8 241.3 208.9C241.6 207.9 241.9 206.4 241.9 205.7V204.3H242.1C242.1 204.4 242.6 205.3 242.6 205.7L242.9 207.9L243.8 207.1L244.5 205.9L244.9 204.5Z",fill:"#DBAD6C"}),h.jsx("path",{d:"M245.5 217.8C245.5 217.8 245.8 218 245.7 219C245.6 220 244.7 220.5 244.4 220.5V219.2L243.3 218.2L242.1 217.9L242.3 217.7C242.4 217.5 243.7 217 243.7 217L245.5 217.8Z",fill:"#904720"}),h.jsx("path",{d:"M244.6 217.8C244.6 217.8 244.9 218.1 245.5 218C246.1 217.9 246.3 217 246 216.6C245.7 216.2 245.8 217.4 245.5 217.6C245.1 217.6 244.7 216.6 244.2 216.6C243.7 216.4 242.9 216.8 242.7 217.1C242.5 217.4 243.5 217.1 243.5 217.1L244.1 217.3L244.5 217.4L244.6 217.8Z",fill:"#AB6D29"}),h.jsx("path",{d:"M237.2 214.1C237.2 214.1 237.9 214.3 238.6 214.2C239.3 214.1 241.1 213.4 241.1 213.4L242.5 212.4C243.1 211.7 245 210.6 245.2 208.2C245.4 205.9 244.9 204.5 244.9 204.5C244.9 204.5 247.7 207.5 245.2 211C243.6 213.3 242.2 214 242.2 214C242.2 214 245 213.2 245.2 213.9C245.4 214.5 245.1 215.5 245 215.7C245 215.7 246.5 216 246.8 216.8C246.9 217.3 245 216.3 243.6 216.6C242.829 216.792 242.132 217.21 241.6 217.8C241.6 217.8 241.3 217.4 240.1 217.4C238.8 217.4 238.2 218 237.5 217.9C236.8 217.8 234.5 217.4 234.1 216.8L235.6 215.1C236.3 213.8 237.2 214.1 237.2 214.1Z",fill:"#904720"}),h.jsx("path",{d:"M243 207.8C243 207.8 244.1 206.8 244.5 205.9L244.9 204.5C244.9 204.5 245 205.3 244.4 206.3L243 207.8Z",fill:"#AB6D29"}),h.jsx("path",{d:"M242.7 205.4C242.7 205.4 243.7 208.8 242.7 210.3C241.7 211.7 237.6 213.5 237.6 213.5C237.6 213.5 240.7 211.8 241.6 209.9C242.6 207.9 242.6 206.3 242.6 206.3L242.7 205.4Z",fill:"#904720"}),h.jsx("path",{d:"M238.6 214.2C238.6 214.2 239.9 214.2 240.6 213.7C241.4 213.3 242.5 212.3 242.5 212.3C242.5 212.3 241.5 213.2 241.2 213.2C240.866 213.067 240.733 212.8 240.8 212.4C240.8 212.4 240.6 213.1 240 213.5L238.6 214.2ZM241.6 209.9C241.6 209.9 242.8 208.7 242.8 206.3C242.8 203.9 241.8 204.3 241.8 204.3C241.8 204.3 242.6 204.9 242.4 206.7C242.3 208.6 241.7 209.9 241.7 209.9H241.6ZM243 210.1C243 210.1 244.3 209.8 244.7 209.1C245.2 208.3 245.2 206.9 245.2 206.9C245.2 206.9 245 208.2 244.7 208.7C244.3 209.2 243 210.1 243 210.1ZM242.3 217.7C242.3 217.7 242.9 216.5 243.7 216.7C244.6 217.1 244.6 217.7 244.6 217.7C244.6 217.7 244.3 217.3 243.6 217.2L242.3 217.7ZM239.9 215.5L242.9 214.7L245.2 213.9C245.2 213.9 244.3 214.9 243 215.8C241.466 216.467 240.633 216.733 240.5 216.6C240.3 216.4 243 215.5 243.2 215C243.2 215 240.8 215.7 239.9 215.5Z",fill:"#1E2121"}),h.jsx("path",{d:"M237 212.7C237.464 213.018 237.782 213.508 237.886 214.061C237.989 214.614 237.868 215.186 237.55 215.65C237.231 216.114 236.742 216.433 236.189 216.536C235.635 216.639 235.064 216.518 234.6 216.2",fill:"white"}),h.jsx("path",{d:"M236.9 212.9C237.192 213.225 237.364 213.64 237.385 214.076C237.407 214.512 237.278 214.942 237.02 215.295C236.762 215.647 236.39 215.899 235.968 216.009C235.545 216.12 235.
1216098 216.081 234.7 215.9",fill:"#F16E16"}),h.jsx("path",{d:"M236 214C236.152 213.986 236.305 214.016 236.44 214.086C236.576 214.156 236.689 214.263 236.765 214.395C236.842 214.527 236.879 214.678 236.873 214.83C236.866 214.983 236.816 215.13 236.729 215.255C236.641 215.38 236.52 215.478 236.379 215.536C236.238 215.594 236.083 215.611 235.933 215.584C235.783 215.557 235.643 215.488 235.531 215.385C235.419 215.281 235.339 215.148 235.3 215",fill:"black"}),h.jsx("path",{d:"M236.2 214.9C236.187 214.966 236.148 215.025 236.092 215.062C236.035 215.1 235.967 215.113 235.9 215.1C235.834 215.087 235.776 215.048 235.738 214.991C235.701 214.935 235.687 214.866 235.7 214.8C235.695 214.763 235.7 214.725 235.716 214.69C235.731 214.656 235.756 214.627 235.787 214.606C235.819 214.585 235.855 214.573 235.893 214.572C235.931 214.571 235.968 214.581 236 214.6C236 214.6 236.2 214.7 236.2 214.9Z",fill:"#D5D3CA"}),h.jsx("path",{d:"M237.5 211.3C237.5 211.3 238.7 210.1 239 208.5V206L239.7 206.7L240 207.9L239.6 209.9L240.9 209.3C241.66 207.748 242.005 206.025 241.9 204.3C241.9 204.3 242.2 205 241.7 207.3C241.2 209.6 240.8 209.9 239.1 210.9C237.808 211.693 236.767 212.838 236.1 214.2L234.2 216.7C234.2 216.7 235.1 215.5 235.5 214.5C236.3 213.1 236.767 212.367 236.9 212.3L237.5 211.3Z",fill:"#AB6D29"}),h.jsx("path",{d:"M236.9 212.3C236.9 212.3 237.4 210.7 237.4 209.8C237.4 208.9 236.8 207.9 236.8 207.9C236.8 207.9 237.6 207.9 237.7 209.7C237.7 211.7 237.4 211.7 236.9 212.3Z",fill:"#904720"}),h.jsx("path",{d:"M239.3 210.3C239.3 210.3 239.9 208.8 239.9 207.9C239.9 206.9 239.1 206 239.1 206C239.1 206 240.1 206.2 240.1 208C240.1 209.7 239.9 209.7 239.3 210.3Z",fill:"#4D2A15"}),h.jsx("path",{d:"M233.7 216.8C233.7 216.8 233.2 216.2 233.3 215.8C233.4 215.4 233.3 215.2 234.4 214C235.21 213.293 235.888 212.446 236.4 211.5C236.7 210.9 237.6 209.2 236.9 207.9C236.9 207.9 237.4 209.9 236.3 211.3C235.561 212.434 234.65 213.447 233.6 214.3C232.6 215 232.6 215.3 232.6 215.7C232.6 216.1 232.7 216.367 232.9 216.5L233.7 216.8Z",fill:"#AB6D29"}),h.jsx("path",{d:"M244.4 220.5C244.4 220.5 244.6 220.5 244.8 220.2C244.933 219.933 244.833 219.533 244.5 219C244.168 218.552 243.717 218.206 243.2 218L241.6 217.8C241.6 217.8 241.9 218.4 242.6 218.8C243 219 243.6 218.8 244 219.1C244.3 219.5 244.4 220.5 244.4 220.5Z",fill:"#6C4119"}),h.jsx("path",{d:"M244.4 220.5C244.4 220.5 245.6 220.1 245.7 218.9L245.6 217.9C245.6 217.9 245.8 218.3 246.3 218.5L246.7 218.3C246.7 218.3 246 220.6 244.4 220.5Z",fill:"#6C4119"}),h.jsx("path",{d:"M235.8 220.3L236.5 220.9L237.2 221.6L240.2 220.8L241.2 219.9L240.3 218.6H238.2L235.8 220.3Z",fill:"#BF802D"}),h.jsx("path",{d:"M243 219.3L242.5 218.5C242.5 218.5 242.3 218.2 241.9 218C241.5 217.8 239.7 217.8 239.7 217.8L238.4 218C238.4 218 238 218.4 237.4 218.2L235.2 217.5L233.8 216.8C233.8 216.8 232.7 216.4 232.4 216.5C232.2 216.5 231.4 217.5 231.4 217.5C231.4 217.5 231.1 218.1 231.5 218.1C231.8 218.1 231 218.3 231 218.3C231 218.3 228.7 219.5 228.4 221.7C228.1 223.9 232.1 227.2 233.6 225.5C233.6 225.5 231.4 223.9 231.8 222.5C232.2 221.167 233.266 220.4 235 220.2C236.7 220.2 236.8 219.9 237.6 219.4C238.3 218.8 239.7 218.5 240.8 219.6C241.8 220.7 236.8 221.7 236.8 221.7L237.4 222.5C237.4 222.5 243.5 220.4 243 219.3Z",fill:"#F9C83A",stroke:"#8F4620",strokeWidth:"0.3"}),h.jsx("path",{d:"M231.5 224.5C231.5 224.5 229 223.9 229.2 221.6C229.31 220.869 229.621 220.183 230.098 219.619C230.574 219.054 231.198 218.632 231.9 218.4C232.3 218.3 232.2 217.1 232.6 217C233 216.9 233.8 217 234.2 217.3C234.5 217.7 235.3 218 235.3 218C235.3 218 230.9 220 230.8 222.5C230.8 224.2 231.5 224.5 231.5 224.5Z",fill:"#FCF3D8"}),h.jsx("path",{d:"M243 219C243 219 242.7 219.2 242.6 219C242.2 218.2 241.1 218 240.2 218C239.1 218 238.3 218.4 237.5 218.4L236.1 218.2C235.1 218.2 233.3 216.8 232.8 216.9C232.4 217.167 232.233 217.5 232.3 217.9C232.3 218.1 231.5 218.2 231.3 217.9C231.1 217.6 232 216.5 232.8 216.5C234.9 216.5 236.5 217.9 237.5 217.9C238.5 217.9 238.8 217.4 240.2 217.4C241.6 217.4 243 218 243 219Z",fill:"#FDEAAF"}),h.jsx("path",{d:"M236.2 220.7L237.9 220.1L239.7 219.5L238.1 220.5L236.4 220.9L236.2 220.7Z",fill:"#513625"}),h.jsx("path",{d:"M232.6 225.8C232.466 226 231.666 225.7 230.2 224.9C228 223.7 228.4 222.4 228.4 222.4C228.4 222.4 228.1 220.9 229.6 219.4C231 217.8 231.2 218.3 231.3 218.4V218.5L230 219.5L229.3 220.6L228.8 221.6V222.6L229.5 223.8L231.5 225.1L232.6 225.8Z",fill:"#F9C83A"}),h.jsx("path",{d:"M231.9 217.2V217L231.7 217.1L231.9 217.2ZM231.9 217.2H231.7V217.3L231.9 217.2ZM231.9 217.2H231.7L231.3 217.7L231.1 218.2C231.1 218.4 231.2 218.567 231.4 218.7H232.6V218.4L232.4 218.3H231.6V218L231.9 217.6V217.2ZM231.9 217.2V217L231.8 216.8C231.762 216.795 231.724 216.8 231.69 216.816C231.655 216.831 231.626 216.856 231.605 216.887C231.584 216.919 231.573 216.955 231.572 216.993C231.571 217.03 231.58 217.068 231.6 217.1L231.9 217.2Z",fill:"#8B5122"}),h.jsx("path",{d:"M236.1 219.3L233.1 220.2C232.8 220.4 234 220.2 234.9 220.2H236.7C237.9 219.7 240.3 218.8 240.5 219.8C240.7 220.8 237.2 221.5 237.2 221.5V221.8L240 221.1L241.4 220.4L241.9 219.6L240.5 218.6H238.5L237.5 218.9L236.1 219.3Z",fill:"#F9C83A"}),h.jsx("path",{d:"M231.8 223.6C232 224.2 232.5 225.1 233 225.4C233 225.667 232.567 225.733 231.7 225.
12166C230.7 225.3 229.3 224.9 228.4 222.3V222.8L228.9 223.8L229.9 224.8L231.3 225.8L232.3 226L233.2 225.8L233.6 225.5L232.7 224.7L231.7 222.9V223.6H231.8Z",fill:"#8F4620"}),h.jsx("path",{d:"M241.7 250.1V251.1H241.1L241.2 249.8L241.7 250.1ZM237.9 222.6L236.9 221.5H236.3L237.3 222.9L237.9 222.6Z",fill:"#FCCA3D"}),h.jsx("path",{d:"M241.6 252.4L240.3 251.6L238.3 251.1V251.4H238.5L240.2 251.9L241.5 252.6L241.6 252.4ZM241.6 249.9H239.4C238.6 250.167 238.2 250.367 238.2 250.5L238.3 250.7C238.899 250.243 239.649 250.029 240.4 250.1H241.5L241.6 249.9ZM241.3 247.8L239.3 248.8L237.9 249.8L238.1 250L238.5 249.7L239.4 249.1L241.4 248.1L241.3 247.8ZM239.9 245.6L239.7 246.6L239.2 247.2L237.9 248.6L237.2 249.3L237.3 249.5L238.5 248.3L239.4 247.3L239.9 246.7C240.166 246.1 240.266 245.767 240.2 245.7H239.9V245.6ZM238.2 244.6C238.352 245.196 238.317 245.824 238.1 246.4L237.3 248.1L236.9 248.9L236.8 249.2H237C237 249.2 238 247.5 238.3 246.5L238.5 245.3V244.6H238.2ZM236.5 244.4V245.4L236.4 246.7L235.9 248.2L235.6 249H235.8L236.6 246.8C236.8 246.333 236.866 245.833 236.8 245.3V244.4H236.5ZM235.2 244.4V245.4L235.1 246.9L234.7 248.9H234.9L235 248.3L235.3 247C235.5 246.1 235.5 244.4 235.5 244.4H235.2ZM233.9 244.7V246.9C233.6 247.7 233.5 248.9 233.5 248.9H233.8L234.1 247V244.6L233.9 244.7ZM232.8 244.7V244.9L232.5 246.7L232.1 248.2L231.9 249L232.1 249.1L232.8 246.8L233 244.9V244.8H232.8V244.7ZM231.5 244.8V245.3C231.5 245.833 231.4 246.4 231.2 247C230.933 247.533 230.6 247.933 230.2 248.2L229.5 248.7H229.4L229.5 248.9C229.5 248.9 230.9 248.1 231.5 247.1C231.779 246.367 231.881 245.58 231.8 244.8H231.5ZM230.8 244.6V244.7L230 246.2L229 247.2L228.5 247.4L228.3 247.5L228.4 247.8C228.4 247.8 229.6 247.1 230.2 246.4C230.7 245.7 231 244.6 231 244.6H230.8ZM229.6 244V244.1L229.2 244.6C229.2 244.8 229.1 244.967 228.9 245.1L228.1 245.6L227.6 245.9L227.7 246.1L228.2 245.8L229 245.3L229.6 244.6L229.8 244.1L229.6 244ZM229 243.2L228.8 243.5L228.1 244.2L227.7 244.6L227.4 244.8V245L228 244.7L229.2 243.4L229 243.2ZM228.8 242.7L228.6 242.9L227.9 243.3L227.2 243.6V243.9C227.4 243.9 227.566 243.833 227.7 243.7L228.9 242.9L228.8 242.7ZM228.5 242.2L227.9 242.5L227.5 242.7L227.1 242.9V243.1L227.6 243L228.6 242.4L228.5 242.2ZM228.3 241.1L227.8 241.5L227.1 241.8V242C227.5 242 227.833 241.867 228.1 241.6L228.5 241.3L228.3 241.1ZM228.3 239.3L227.9 239.7L227.3 240.5L227.2 240.6V240.9L227.4 240.8L227.5 240.6C227.5 240.4 227.7 240.167 228.1 239.9L228.4 239.7L228.5 239.5L228.3 239.3ZM236.9 229.1H238.2V229L238.1 229.1V229H238V228.9H238.1H236.9V229.1ZM236.9 228.3L237.5 228.2L238.3 227.7L238.6 227.4H238.9V227.1L238.4 227.3L237.6 227.8L236.9 228.1V228.3ZM236.9 227.1L237.4 226.9L238.4 226.3L239.1 226V225.7L238.6 225.9L237.6 226.5L236.8 226.9V227.1H236.9ZM236.4 226.1L237.6 225.1L238.9 224.2L238.8 224L237.5 225L236.3 225.8L236.4 226.1ZM235.6 224.8L238.2 222.9L238 222.7L235.4 224.6L235.6 224.8ZM234.4 223.5L235.9 222.5L237.1 221.7L237 221.5L235.8 222.3L234.3 223.3L234.4 223.5ZM233.6 222.8L235.7 221.3L236.3 220.9V220.7L235.6 221L233.4 222.6L233.6 222.8Z",fill:"#816C2A"}),h.jsx("path",{d:"M235.6 220.3L237.6 222.3C238.467 223.367 238.933 224.467 239 225.6V226C238.727 227.496 238.033 228.884 237 230C235.5 231.9 233.2 233.5 231.4 235.1C230.5 235.831 229.693 236.67 229 237.6C228.39 238.41 228.042 239.387 228 240.4V240.5C228 241.567 228.333 242.467 229 243.2C229.597 244.034 230.492 244.607 231.5 244.8H232.1C233.5 244.8 235.1 244.3 236.6 244.3C237.8 244.233 238.967 244.733 240.1 245.8C241.1 246.9 241.4 248.7 241.4 250.4L241.1 253.7L240.8 255.2H241C241 255.2 241.7 252.9 241.7 250.4C241.7 248.7 241.3 246.8 240.3 245.6C239.819 245.109 239.243 244.723 238.606 244.465C237.97 244.207 237.287 244.082 236.6 244.1C235 244.1 233.5 244.5 232.1 244.5H231.5C231.034 244.462 230.583 244.316 230.184 244.073C229.785 243.829 229.448 243.496 229.2 243.1C228.663 242.335 228.351 241.434 228.3 240.5V240.4C228.3 239.133 228.833 237.967 229.9 236.9C231.3 235.3 233.5 233.7 235.4 231.9C237.4 230.3 239 228.4 239.3 225.9V225.6C239.3 224.2 238.3 222.8 237.4 221.7L235.6 220V220.3Z",fill:"#78732E"}),h.jsx("path",{d:"M233.7 222.8L233.4 222.5L233.1 222.6L233.6 223L233.7 222.8ZM234.5 223.5L234.3 223.3H234.1L234.3 223.6L234.5 223.5Z",fill:"#A8AC71"}),h.jsx("path",{d:"M235.6 224.8L235.4 224.5L235.3 224.7L235.6 224.8ZM236.4 226V225.8H236.1L236.4 226.1V226ZM236.9 227.2V226.9H236.8L236.9 227.2ZM227.2 241L227.3 240.4C227.4 240.1 227.1 240.5 227.1 240.5V240.9H227.2V241Z",fill:"#78732E"}),h.jsx("path",{d:"M227.1 241.7V242.1H227.2L227.1 241.7Z",fill:"white"}),h.jsx("path",{d:"M227.2 243.1V242.8H227V243.3L227.2 243.1Z",fill:"#78732E"}),h.jsx("path",{d:"M227.3 243.9V243.6H227.1V243.9H227.3ZM227.8 246.2L227.6 245.8V246.2H227.8Z",fill:"white"}),h.jsx("path",{d:"M228.5 247.8L228.4 247.5H228.2L228.5 247.8ZM229.7 248.9L229.3 248.6C229.1 248.4 229.2 248.8 229.2 248.8L229.5 249L229.7 248.9ZM237.5 249.5L237.2 249.3L237.4 249.6V249.5H237.5Z",fill:"#A8AC71"}),h.jsx("path",{d:"M238.2 250L237.9 249.8V250H238.1H238.2Z",fill:"white"}),h.jsx("path",{d:"M238.3 250.3L238.1 250.5L238.4 250.7L238.3 250.3Z",fill:"#A8AC71"}),h.jsx("path",{d:"M238 252.6V252.3L237.8 252.6H238ZM226 210.9C226 210.9 226.5 210.8 226.1 211.3L226.4 210.9L226.2 210.8L226 210.9Z",fill:"white"}),h.jsx("path",{d:"M235.7 220L236 220.3L235.6 220.2L235.7 220Z",fill:"#F9C83A"}),h.jsx("path",{d:"M236 220.3H235.4L235.6 220.2L236 220.3Z",fill:"#8F4620"}),h.jsx("path",{d:"M240.7 255.3C240.7 255.3 241.1 255.3 241.2 255C241.4 254.8 241.2 255.3 241.2 255.3L240.9 255.4L240.7 255.3Z",fill:"#977C2E"})]}),h.jsxs("defs",{children:[h.jsxs("radialGradient",{id:"paint0_radial_4989_137735",cx:"0",cy:"0",r:"1",gradientTransform:"matrix(2.78573 1.17983 -1.15213 2.79993 234.885 267.814)",gradientUnits:"userSpaceOnUse",children:[h.jsx("stop",{stopColor:"white"}),h.jsx("stop",{offset:"1",stopColor:"#F15770"})]}),h.jsxs("radialGradient",{id:"paint1_radial_4989_137735",cx:"0",cy:"0",r:"1",gradientTransform:"matrix(-0.27566 -2.98743 2.7721 -0.263226 214.229 257.819)",gradientUnits:"userSpaceOnUse",children:[h.jsx("stop",{stopColor:"white"}),h.jsx("stop",{offset:"1",stopColor:"#F15770"})]}),h.jsxs("radialGradient",{id:"paint2_radial_4989_137735",cx:"0",cy:"0",r:"1",gradientTransform:"matrix(1.00364 1.19767 -2.32347 2.00377 290.391 274.461)",gradientUnits:"userSpaceOnUse",children:[h.jsx("stop",{stopColor:"white"}),h.jsx("stop",{offset:"1",stopColor:"#F15770"})]}),h.jsx("clipPath",{id:"clip0_4989_137735",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})]})]}),p0t=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_myr)",children:[h.jsx("path",{d:"M0 0H512V36.6H0V0Z",fill:"#CC0000"}),h.jsx("path",{d:"M0 36.6001H512V73.0001H0V36.6001Z",fill:"white"}),h.jsx("path",{d:"M0 73.1001H512V109.7H0V73.1001Z",fill:"#CC0000"}),h.jsx("path",{d:"M0 109.7H512V146.3H0V109.7Z",fill:"white"}
1216),h.jsx("path",{d:"M0 146.3H512V182.9H0V146.3Z",fill:"#CC0000"}),h.jsx("path",{d:"M0 182.9H512V219.4H0V182.9Z",fill:"white"}),h.jsx("path",{d:"M0 219.4H512V256H0V219.4Z",fill:"#CC0000"}),h.jsx("path",{d:"M0 256H512V292.6H0V256Z",fill:"white"}),h.jsx("path",{d:"M0 292.6H512V329H0V292.6Z",fill:"#CC0000"}),h.jsx("path",{d:"M0 329.1H512V365.7H0V329.1Z",fill:"white"}),h.jsx("path",{d:"M0 365.7H512V402.3H0V365.7Z",fill:"#CC0000"}),h.jsx("path",{d:"M0 402.3H512V438.9H0V402.3Z",fill:"white"}),h.jsx("path",{d:"M0 438.9H512V475.4H0V438.9Z",fill:"#CC0000"}),h.jsx("path",{d:"M0 475.4H512V512H0V475.4Z",fill:"white"}),h.jsx("path",{d:"M0 0H256V292.6H0V0Z",fill:"#000066"}),h.jsx("path",{d:"M166 93.0001L170.8 125.5L189.2 98.3001L179.2 129.6L207.7 113L185.2 137L218 134.4L187.3 146.3L218 158L185.2 155.5L207.7 179.5L179.3 162.8L189.1 194.3L170.7 167L165.9 199.5L161.2 167L142.8 194.2L152.7 162.8L124.3 179.5L146.7 155.5L113.9 158L144.6 146.2L114 134.3L146.8 136.9L124.3 112.9L152.7 129.5L142.7 98.1001L161.2 125.4L166 92.8001V93.0001Z",fill:"#FFCC00"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_myr",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),m0t=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_ngn)",children:[h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 0H512V512H0V0Z",fill:"white"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M341.3 0H512V512H341.3V0ZM0 0H170.7V512H0V0Z",fill:"#008753"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_ngn",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),y0t=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_nok)",children:[h.jsx("path",{d:"M0 0H512V512H0V0Z",fill:"#ED2939"}),h.jsx("path",{d:"M128 0H256V512H128V0Z",fill:"white"}),h.jsx("path",{d:"M0 192H512V320H0V192Z",fill:"white"}),h.jsx("path",{d:"M160 0H224V512H160V0Z",fill:"#002664"}),h.jsx("path",{d:"M0 224H512V288H0V224Z",fill:"#002664"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_nok",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),g0t=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_npr)",children:[h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.5 505.5H385.3L137.4 254.1L394.7 254.4L6.6 6.5V505.5H6.5Z",fill:"#CE0000",stroke:"#000063",strokeWidth:"13"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M180.7 371.8L153.7 380.8L174.9 400.6L146.4 398.8L158.1 425L132.6 412.7L133.1 441.3L114.3 420.4L103.6 447L94.4 420.7L74.1 441.3L75.9 413.6L49 425L61.6 400L32.3 400.6L53.8 382.3L26.5 371.8L53.5 362.8L32.2 343L60.6 344.8L49 318.6L74.6 330.9L74.1 302.3L92.9 323.2L103.6 296.6L112.7 322.9L133.1 302.3L131.2 330L158.2 318.6L145.5 343.6L174.9 343L153.4 361.3L180.7 371.8Z",fill:"white"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_npr",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),b0t=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_nzd)",children:[h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 0H512V512H0V0Z",fill:"#00247D"}),h.jsx("path",{d:"M396.394 157.728V166.813L414.564 157.728H396.394Z",fill:"#CC142B"}),h.jsx("path",{d:"M468.428 221.214L468.428 228.785L483.569 221.214L468.428 221.214Z",fill:"#CC142B"}),h.jsx("path",{d:"M312.462 242.252L312.462 251.337L330.632 242.252L312.462 242.252Z",fill:"#CC142B"}),h.jsx("path",{d:"M396.394 374.857V385.456L417.592 374.857H396.394Z",fill:"#CC142B"}),h.jsx("path",{d:"M0 0H256V256H0V0Z",fill:"#012169"}),h.jsx("path",{d:"M256 0V32L161 128L256 221.5V256H222.5L127 162L34 256H0V222L93 128.5L0 37V0H31L127 94L220 0H256Z",fill:"white"}),h.jsx("path",{d:"M0 104V152H256V104H0ZM104 0V256H152V0H104Z",fill:"#C8102E"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_nzd",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),w0t=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_php)",children:[h.jsx("path",{d:"M0 0H512V256H0V0Z",fill:"#0038A8"}),h.jsx("path",{d:"M0 256H512V512H0V256Z",fill:"#CE1126"}),h.jsx("path",{d:"M443.4 256L0 512V0",fill:"white"}),h.jsx("path",{d:"M158.9 148L152.3 154.6L155.5 204.9L152.2 205.2L146.2 159.3L140.7 164.7L148.9 205.7C142.32 207.03 136.067 209.647 130.5 213.4L107.2
1216178.6H99.5L127.7 215.4L125.2 217.5L91.9 179.5H82.5V189L120.5 222.3L118.3 224.8L81.5 196.6V204.3L116.3 227.6C112.583 233.174 110 239.427 108.7 246L67.7 237.8L62.2 243.3L108.2 249.3L107.8 252.7L57.5 249.4L50.8 256L57.5 262.6L107.8 259.4L108.1 262.7L62.2 268.7L67.6 274.2L108.6 266C109.931 272.58 112.547 278.833 116.3 284.4L81.5 307.7V315.4L118.3 287.2L120.4 289.7L82.4 323V332.4H92L125.3 294.4L127.8 296.6L99.6 333.4H107.3L130.6 298.6C136.175 302.317 142.427 304.9 149 306.2L140.8 347.2L146.3 352.7L152.3 306.7L155.6 307.1L152.4 357.4L159 364.1L165.6 357.4L162.4 307.1L165.7 306.8L171.7 352.7L177.2 347.3L169 306.3C175.58 304.969 181.833 302.353 187.4 298.6L210.7 333.4H218.4L190 296.6L192.5 294.5L225.8 332.5H235.2V323L197.2 289.7L199.4 287.2L236.2 315.4V307.7L201.4 284.4C205.117 278.825 207.7 272.573 209 266L250 274.2L255.5 268.7L209.5 262.7L209.9 259.4L260.2 262.6L266.9 256L260.2 249.4L209.9 252.7C209.9 251.5 209.8 250.367 209.6 249.3L255.5 243.3L250.1 237.8L209.1 246C207.769 239.42 205.153 233.167 201.4 227.6L236.2 204.3V196.6L199.4 224.8L197.3 222.3L235.3 189V179.6H225.8L192.5 217.6L190 215.4L218.2 178.6H210.5L187.2 213.4C181.625 209.682 175.373 207.1 168.8 205.8L177 164.8L171.5 159.3L165.5 205.3L162.2 204.9L165.4 154.6L158.9 148Z",fill:"#FCD116"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_php",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),v0t=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_pkr)",children:[h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-95 0H673V512H-95V0Z",fill:"#0C590B"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-95 0H97.5V512H-95V0Z",fill:"white"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M403.7 225.4L372.5 218.8L356.1 246.1L352.7 214.5L321.7 207.3L350.7 194.3L348 162.6L369.4 186.2L398.7 173.8L382.8 201.4L403.8 225.4H403.7Z",fill:"white"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M415.4 306C408.766 320.54 399.318 333.622 387.6 344.49C375.882 355.358 362.128 363.797 347.131 369.32C332.133 374.842 316.191 377.339 300.223 376.667C284.256 375.994 268.579 372.165 254.1 365.4C239.541 358.674 226.45 349.142 215.578 337.352C204.706 325.561 196.265 311.743 190.739 296.687C185.213 281.631 182.709 265.634 183.372 249.609C184.034 233.585 187.85 217.848 194.6 203.3C201.378 188.208 211.228 174.695 223.522 163.623C235.815 152.552 250.283 144.166 266 139C261.882 142.428 257.943 146.066 254.2 149.9C234.69 171.507 224.333 199.846 225.313 228.941C226.293 258.036 238.533 285.614 259.453 305.859C280.372 326.104 308.336 337.435 337.448 337.461C366.56 337.487 394.544 326.207 415.5 306H415.4Z",fill:"white"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_pkr",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),_0t=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_pln)",children:[h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M512 512H0V0H512V512Z",fill:"white"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M512 512H0V256H512V512Z",fill:"#DC143C"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_pln",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),x0t=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_qar)",children:[h.jsx("path",{d:"M0 0H512V512H0V0Z",fill:"#8D1B3D"}),h.jsx("path",{d:"M0 0V512H113L217.2 483.6L113 455L217.2 426.6L113 398.2L217.2 369.8L113 341.3L217.2 313L113 284.4L217.2 256L113 227.6L217.2 199L113 170.7L217.2 142.2L113 113.8L217.2 85.3L113 57L217.2 28.6L113 0H0Z",fill:"white"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_qar",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),C0t=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_ron)",children:[h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 0H170.7V512H0V0Z",fill:"#00319C"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M170.7 0H341.3V512H170.7V0Z",fill:"#FFDE00"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M341.3 0H512V512H341.3V0Z",fill:"#DE2110"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_ron",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),E0t=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_sar)",children:[h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-128 0H639.882V511.922H-128V0Z",fill:"#165D31"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M65.519 145.113C64.6933 157.086 63.558 178.14 73.7758 180.308C86.0578 181.443 79.2459 159.459 83.684 155.537C84.6129 153.473 86.161 153.473 86.2642 156.053V174.631C86.161 180.824 90.083 182.475 93.1793 183.817C96.482 183.507 98.5462 183.611 99.8879 186.707L101.333 219.012C101.333 219.012 108.867 221.076 109.177 200.847C109.59 188.977 106.803 178.966 108.454 176.695C108.454 174.425 111.344 174.322 113.408 175.354C116.608 177.624 118.053 180.514 123.007 179.276C130.645 177.212 135.186 173.496 135.392 167.716",fill:"white"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M354.197 362.577C363.383 362.886 369.369 362.99 377.522 363.919L387.018 362.886C397.648 361.854 398.164 378.058 398.164 378.058C398.061 387.554 394.346 387.966 389.701 388.999C387.018 389.411 385.573 387.45 384.231 385.386C382.511 386.074 380.137 386.212 377.11 385.799L365.756 385.283C361.628 384.973 359.461 385.799 355.435 385.386C354.507 386.728 353.371 388.482 350.997 387.966C348.933 387.76 346.456 381.877 347.179 377.542C348.624 374.343 348.211 375.375 348.107 373.93Z",fill:"white"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_sar",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),S0t=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_sek)",children:[h.jsx("path",{d:"M0 0H512V512H0V0Z",fill:"#005293"}),h.jsx("path",{d:"M134 0V204.8H0V307.2H134V512H236.4V307.2H512V204.8H236.4V0H134Z",fill:"#FECB00"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_sek",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),A0t=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_sgd)",children:[h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-20 0H748.007V512.029H-20V0Z",fill:"white"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-20 0H748.007V255.978H-20V0Z",fill:"#DF0000"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M157.155 42.916C136.944 47.2463 118.839 58.3997 105.881 74.5026C92.9228 90.6056 85.9005 110.677 85.9937 131.346C86.087 152.015 93.29 172.023 106.393 188.008C119.496 203.994 137.701 214.983 157.949 219.131C144.316 223.121 129.941 223.888 115.96 221.373C101.979 218.857 88.7741 213.126 77.3866 204.634C65.9991 196.141 56.7408 185.119 50.342 172.436C43.9433 159.753 40.5792 145.757 40.5151 131.551C40.451 117.346 43.6888 103.32 49.9728 90.58C56.2569 77.8399 65.4155 66.7344 76.7259 58.1394C88.0364 49.5445 101.189 43.6954 115.147 41.0535C129.105 38.4116 143.486 39.0492 157.155 42.916Z",fill:"white"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M125.943 117.332L112.288 107.362L129.267 107.218L134.469 91.106L139.887 107.218H156.793L143.211 117.332L148.413 133.444L134.613 123.546L120.886 133.516L125.943 117.332Z",fill:"white"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_sgd",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),k0t=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_thb)",children:[h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 0H512V512H0V0Z",fill:"#F4F5F8"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 173.4H512V344H0V173.4Z",fill:"#2D2A4A"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 0H512V88H0V0ZM0 426.7H512V512H0V426.7Z",fill:"#A51931"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_thb",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),T0t=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_try)",children:[h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 0H512V512H0V0Z",fill:"#E30A17"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M348.8 264C348.8 334.6 290.5 391.9 218.7 391.9C146.9 391.9 88.6001 334.6 88.6001 263.9C88.6001 193.2 146.8 136.1 218.6 136.1C290.4 136.1 348.9 193.3 348.9 264H348.8Z",fill:"white"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M355.3 264C355.3 320.5 308.7 366.3 251.2 366.3C193.7 366.3 147.2 320.5 147.2 264C147.2 207.5 193.7 161.7 251.2 161.7C308.7 161.7 355.2 207.5 355.2 264H355.3Z",fill:"#E30A17"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M374.1 204.2L373.1 251.5L328.9 263.5L372.4 279L371.4 322.3L399.7 288.5L442.6 303.3L417.8 267L448 230.9L401.6 243.7L374.1 204.2Z",fill:"white"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_try",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),L0t=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_twd)",children:[h.jsx("path",{d:"M0 0H768V512H0V0Z",fill:"#FF0000"}),h.jsx("path",{d:"M0 0H384V256H0V0Z",fill:"#000095"}),h.jsx("path",{d:"M214.3 115.1L204.9 105.7L192 102.3L179.1 105.7L169.7 115.1L166.3 128L169.7 140.9L179.1 150.3L192 153.7L204.9 150.3L214.3 140.9L217.7 128L214.3 115.1Z",fill:"white"}),h.jsx("path",{d:"M192 182.4C222.044 182.4 246.4 158.044 246.4 128C246.4 97.9557 222.044 73.6 192 73.6C161.956 73.6 137.6 97.9557 137.6 128C137.6 158.044 161.956 182.4 192 182.4Z",fill:"#000095"}),h.jsx("path",{d:"M192 176C218.51 176 240 154.51 240 128C240 101.49 218.51 80 192 80C165.49 80 144 101.49 144 128C144 154.51 165.49 176 192 176Z",fill:"white"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_twd",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),$0t=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_uah)",children:[h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 0H512V512H0V0Z",fill:"#FFD700"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 0H512V256H0V0Z",fill:"#0057B8"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_uah",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),I0t=t=>h.jsxs("svg",{width:"256",height:"256",viewBox:"0 0 256 256",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsx("g",{clipPath:"url(#clip0_4989_137730)",children:h.jsxs("g",{clipPath:"url(#clip1_4989_137730)",children:[h.jsx("path",{d:"M-65.3379 -3.625H434.837V259.625H-65.3379",fill:"#B31942"}),h.jsx("path",{d:"M-65.3379 26.75H434.837ZM434.837 67.25H-65.3379ZM-65.3379 107.75H434.837ZM434.837 148.25H-65.3379ZM-65.3379 188.75H434.837ZM434.837 229.25H-65.3379Z",fill:"black"}),h.jsx("path",{d:"M-65.3379 26.75H434.837M434.837 67.25H-65.3379M-65.3379 107.75H434.837M434.837 148.25H-65.3379M-65.3379 188.75H434.837M434.837 229.25H-65.3379",stroke:"white",strokeWidth:"20.25"}),h.jsx("path",{d:"M-65.3379 -3.625H134.732V138.125H-65.3379",fill:"#0A3161"}),h.jsx("path",{d:"M1.352 16.625L6.11306 31.278L-6.35156 22.2219H9.05555L-3.40906 31.278L1.352 16.625Z",fill:"white"}),h.jsx("path",{d:"M1.352 44.975L6.11306 59.628L-6.35156 50.5719H9.05555L-3.40906 59.628L1.352 44.975Z",fill:"white"}),h.jsx("path",{d:"M1.352 73.325L6.11306 87.978L-6.35156 78.9219H9.05555L-3.40906 87.978L1.352 73.325Z",fill:"white"}),h.jsx("path",{d:"M1.352 101.675L6.11306 116.328L-6.35156 107.272H9.05555L-3.40906 116.328L1.352 101.675Z",fill:"white"}),h.jsx("path",{d:"M18.0248 2.44998L22.7859 17.103L10.3213 8.04694H25.7284L13.2638 17.103L18.0248 2.44998Z",fill:"white"}),h.jsx("path",{d:"M18.0248 30.8L22.7859 45.453L10.3213 36.3969H25.7284L13.2638 45.453L18.0248 30.8Z",fill:"white"}),h.jsx("path",{d:"M18.0248 59.15L22.7859 73.803L10.3213 64.7469H25.7284L13.2638 73.803L18.0248 59.15Z",fill:"white"}),h.jsx("path",{d:"M18.0248 87.5L22.7859 102.153L10.3213 93.0969H25.7284L13.2638 102.153L18.0248 87.5Z",fill:"white"}),h.jsx("path",{d:"M18.0248 115.85L22.7859 130.503L10.3213 121.447H25.7284L13.2638 130.503L18.0248 115.85Z",fill:"white"}),h.jsx("path",{d:"M34.6977 16.625L39.4588 31.278L26.9941 22.2219H42.4013L29.9366 31.278L34.6977 16.625Z",fill:"white"}),h.jsx("path",{d:"M34.6977 44.975L39.4588 59.628L26.9941 50.5719H42.4013L29.9366 59.628L34.6977 44.975Z",fill:"white"}),h.jsx("path",{d:"M34.6977 73.325L39.4588 87.978L26.9941 78.9219H42.4013L29.9366 87.978L34.6977 73.325Z",fill:"white"}),h.jsx("path",{d:"M34.6977 101.675L39.4588 116.328L26.9941 107.272H42.4013L29.9366 116.328L34.6977 101.675Z",fill:"white"}
1216),h.jsx("path",{d:"M51.3696 2.44992L56.1306 17.103L43.666 8.04688H59.0731L46.6085 17.103L51.3696 2.44992Z",fill:"white"}),h.jsx("path",{d:"M51.3696 30.7999L56.1306 45.453L43.666 36.3969H59.0731L46.6085 45.453L51.3696 30.7999Z",fill:"white"}),h.jsx("path",{d:"M51.3696 59.1499L56.1306 73.803L43.666 64.7469H59.0731L46.6085 73.803L51.3696 59.1499Z",fill:"white"}),h.jsx("path",{d:"M51.3696 87.4999L56.1306 102.153L43.666 93.0969H59.0731L46.6085 102.153L51.3696 87.4999Z",fill:"white"}),h.jsx("path",{d:"M51.3696 115.85L56.1306 130.503L43.666 121.447H59.0731L46.6085 130.503L51.3696 115.85Z",fill:"white"}),h.jsx("path",{d:"M68.0424 16.625L72.8035 31.278L60.3389 22.2219H75.746L63.2814 31.278L68.0424 16.625Z",fill:"white"}),h.jsx("path",{d:"M68.0424 44.9749L72.8035 59.628L60.3389 50.5719H75.746L63.2814 59.628L68.0424 44.9749Z",fill:"white"}),h.jsx("path",{d:"M68.0424 73.325L72.8035 87.978L60.3389 78.9219H75.746L63.2814 87.978L68.0424 73.325Z",fill:"white"}),h.jsx("path",{d:"M68.0424 101.675L72.8035 116.328L60.3389 107.272H75.746L63.2814 116.328L68.0424 101.675Z",fill:"white"}),h.jsx("path",{d:"M84.7143 2.44998L89.4754 17.103L77.0107 8.04694H92.4179L79.9532 17.103L84.7143 2.44998Z",fill:"white"}),h.jsx("path",{d:"M84.7143 30.8L89.4754 45.453L77.0107 36.3969H92.4179L79.9532 45.453L84.7143 30.8Z",fill:"white"}),h.jsx("path",{d:"M84.7143 59.15L89.4754 73.803L77.0107 64.7469H92.4179L79.9532 73.803L84.7143 59.15Z",fill:"white"}),h.jsx("path",{d:"M84.7143 87.5L89.4754 102.153L77.0107 93.0969H92.4179L79.9532 102.153L84.7143 87.5Z",fill:"white"}),h.jsx("path",{d:"M84.7143 115.85L89.4754 130.503L77.0107 121.447H92.4179L79.9532 130.503L84.7143 115.85Z",fill:"white"}),h.jsx("path",{d:"M101.387 16.625L106.148 31.278L93.6836 22.2219H109.091L96.6261 31.278L101.387 16.625Z",fill:"white"}),h.jsx("path",{d:"M101.387 44.975L106.148 59.628L93.6836 50.5719H109.091L96.6261 59.628L101.387 44.975Z",fill:"white"}),h.jsx("path",{d:"M101.387 73.325L106.148 87.978L93.6836 78.9219H109.091L96.6261 87.978L101.387 73.325Z",fill:"white"}),h.jsx("path",{d:"M101.387 101.675L106.148 116.328L93.6836 107.272H109.091L96.6261 116.328L101.387 101.675Z",fill:"white"}),h.jsx("path",{d:"M118.06 2.44995L122.821 17.103L110.356 8.04691H125.764L113.299 17.103L118.06 2.44995Z",fill:"white"}),h.jsx("path",{d:"M118.06 30.8L122.821 45.453L110.356 36.3969H125.764L113.299 45.453L118.06 30.8Z",fill:"white"}),h.jsx("path",{d:"M118.06 59.15L122.821 73.803L110.356 64.7469H125.764L113.299 73.803L118.06 59.15Z",fill:"white"}),h.jsx("path",{d:"M118.06 87.4999L122.821 102.153L110.356 93.0969H125.764L113.299 102.153L118.06 87.4999Z",fill:"white"}),h.jsx("path",{d:"M118.06 115.85L122.821 130.503L110.356 121.447H125.764L113.299 130.503L118.06 115.85Z",fill:"white"})]})}),h.jsxs("defs",{children:[h.jsx("clipPath",{id:"clip0_4989_137730",children:h.jsx("rect",{width:"256",height:"256",rx:"128",fill:"white"})}),h.jsx("clipPath",{id:"clip1_4989_137730",children:h.jsx("rect",{width:"500.175",height:"263.25",fill:"white",transform:"translate(-65.3379 -3.625)"})})]})]}),N0t=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_vnd)",children:[h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-128 0H640.007V512.029H-128V0Z",fill:"#DA251D"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M349.566 381.113L259.977 314.211L170.894 381.764L204.056 271.945L115.045 204.176L225.153 203.236L259.254 93.7792L294.151 203.02L404.258 203.164L315.753 271.584L349.566 381.113Z",fill:"#FFFF00"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_vnd",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),O0t=t=>h.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[h.jsxs("g",{clipPath:"url(#clip0_zar)",children:[h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M82.23 512.093L335.766 341.463H696.085V512.093H82.23Z",fill:"#000C8A"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M65.9358 0H696.188V170.732H335.663C335.663 170.732 69.3176 -1.63968 65.9358 0Z",fill:"#E1392D"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-71.8999 64.05V104.325L1
121653.966 255.995L-71.8999 407.665V448.043L212.585 255.995L-71.8999 64.05Z",fill:"#FFB915"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-71.8999 64.05V0H22.9966L324.288 203.935H696.085V308.157H324.288L22.9966 511.99H-71.8999V448.043L212.585 255.995L-71.8999 64.05Z",fill:"#007847"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M22.9966 0H82.23L335.766 170.732H696.085V203.935H324.288L22.9966 0ZM22.9966 512.093H82.23L335.766 341.463H696.085V308.26H324.288L22.9966 512.093Z",fill:"white"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-71.8999 407.768V104.427L153.966 255.995L-71.8999 407.768Z",fill:"#000001"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"clip0_zar",children:h.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),P0t={US:"usd",MX:"mxn",BR:"brl",GB:"gbp",AT:"eur",BE:"eur",HR:"eur",CY:"eur",EE:"eur",FI:"eur",FR:"eur",DE:"eur",GR:"eur",IE:"eur",IT:"eur",LV:"eur",LT:"eur",LU:"eur",MT:"eur",NL:"eur",PT:"eur",SK:"eur",SI:"eur",ES:"eur",AD:"eur",MC:"eur",SM:"eur",VA:"eur",XK:"eur",ME:"eur",CN:"cny",JP:"jpy",IN:"inr",CA:"cad",KR:"krw",AU:"aud",ID:"idr",SA:"sar",TR:"try",CH:"chf",TW:"twd",SE:"sek",NG:"ngn",PL:"pln",AR:"ars",AE:"aed",TH:"thb",ZA:"zar",DK:"dkk",EG:"egp",MY:"myr",SG:"sgd",CO:"cop",PH:"php",CL:"clp",BD:"bdt",VN:"vnd",CZ:"czk",IL:"ils",HK:"hkd",NZ:"nzd",PK:"pkr",RO:"ron",KZ:"kzt",NO:"nok",HU:"huf",UA:"uah",KW:"kwd",QA:"qar",ET:"etb",MA:"mad",BG:"bgn",KE:"kes",NP:"npr"},R0t={usd:{symbol:"$",name:"US Dollar",icon:h.jsx(I0t,{})},eur:{symbol:"â¬",name:"Euro",icon:h.jsx(e0t,{})},gbp:{symbol:"£",name:"British Pound",icon:h.jsx(t0t,{})},mxn:{symbol:"$",name:"Mexican Peso",icon:h.jsx(f0t,{})},brl:{symbol:"R$",name:"Brazilian Real",icon:h.jsx(Hpt,{})},cny:{symbol:"Â¥",name:"Chinese Yuan",icon:h.jsx(Kpt,{})},jpy:{symbol:"Â¥",name:"Japanese Yen",icon:h.jsx(o0t,{})},inr:{symbol:"â¹",name:"Indian Rupee",icon:h.jsx(a0t,{})}
1216,cad:{symbol:"$",name:"Canadian Dollar",icon:h.jsx(Wpt,{})},krw:{symbol:"â©",name:"South Korean Won",icon:h.jsx(c0t,{})},aud:{symbol:"$",name:"Australian Dollar",icon:h.jsx(Fpt,{})},idr:{symbol:"Rp",name:"Indonesian Rupiah",icon:h.jsx(i0t,{})},sar:{symbol:"ï·¼",name:"Saudi Riyal",icon:h.jsx(E0t,{})},try:{symbol:"âº",name:"Turkish Lira",icon:h.jsx(T0t,{})},chf:{symbol:"CHF",name:"Swiss Franc",icon:h.jsx(qpt,{})},twd:{symbol:"NT$",name:"New Taiwan Dollar",icon:h.jsx(L0t,{})},sek:{symbol:"kr",name:"Swedish Krona",icon:h.jsx(S0t,{})},ngn:{symbol:"â¦",name:"Nigerian Naira",icon:h.jsx(m0t,{})},pln:{symbol:"zÅ",name:"Polish Zloty",icon:h.jsx(_0t,{})},ars:{symbol:"$",name:"Argentine Peso",icon:h.jsx(Bpt,{})},aed:{symbol:"د.Ø¥",name:"UAE Dirham",icon:h.jsx(Upt,{})},thb:{symbol:"฿",name:"Thai Baht",icon:h.jsx(k0t,{})},zar:{symbol:"R",name:"South African Rand",icon:h.jsx(O0t,{})},dkk:{symbol:"kr",name:"Danish Krone",icon:h.jsx(Jpt,{})},egp:{symbol:"E£",name:"Egyptian Pound",icon:h.jsx(Xpt,{})},myr:{symbol:"RM",name:"Malaysian Ringgit",icon:h.jsx(p0t,{})},sgd:{symbol:"$",name:"Singapore Dollar",icon:h.jsx(A0t,{})},cop:{symbol:"$",name:"Colombian Peso",icon:h.jsx(Gpt,{})},php:{symbol:"â±",name:"Philippine Peso",icon:h.jsx(w0t,{})},clp:{symbol:"$",name:"Chilean Peso",icon:h.jsx(Zpt,{})},bdt:{symbol:"à§³",name:"Bangladeshi Taka",icon:h.jsx(zpt,{})},vnd:{symbol:"â«",name:"Vietnamese Dong",icon:h.jsx(N0t,{})},czk:{symbol:"KÄ",name:"Czech Koruna",icon:h.jsx(Ypt,{})},ils:{symbol:"âª",name:"Israeli Shekel",icon:h.jsx(s0t,{})},hkd:{symbol:"$",name:"Hong Kong Dollar",icon:h.jsx(n0t,{})},nzd:{symbol:"$",name:"New Zealand Dollar",icon:h.jsx(b0t,{})},pkr:{symbol:"â¨",name:"Pakistani Rupee",icon:h.jsx(v0t,{})},ron:{symbol:"lei",name:"Romanian Leu",icon:h.jsx(C0t,{})},kzt:{symbol:"â¸",name:"Kazakhstani Tenge",icon:h.jsx(d0t,{})},nok:{symbol:"kr",name:"Norwegian Krone",icon:h.jsx(y0t,{})},huf:{symbol:"Ft",name:"Hungarian Forint",icon:h.jsx(r0t,{})},uah:{symbol:"â´",name:"Ukrainian Hryvnia",icon:h.jsx($0t,{})},kwd:{symbol:"د.Ù",name:"Kuwaiti Dinar",icon:h.jsx(u0t,{})},qar:{symbol:"ï·¼",name:"Qatari Riyal",icon:h.jsx(x0t,{})},etb:{symbol:"Br",name:"Ethiopian Birr",icon:h.jsx(Qpt,{})},mad:{symbol:"د.Ù
.",name:"Moroccan Dirham",icon:h.jsx(h0t,{})},bgn:{symbol:"лв",name:"Bulgarian Lev",icon:h.jsx(Vpt,{})},kes:{symbol:"KSh",name:"Kenyan Shilling",icon:h.jsx(l0t,{})},npr:{symbol:"â¨",name:"Nepalese Rupee",icon:h.jsx(g0t,{})}},R4t={usd:[["asset","Currency"],["bank_beneficiary_name","Beneficiary name"],["bank_beneficiary_address","Beneficiary address"],["bank_account_number","Account number"],["bank_routing_number","Routing number"],["bank_name","Bank name"],["bank_address","Bank address"]],eur:[["asset","Currency"],["account_holder_name","Account holder"],["iban","IBAN"],["bic","BIC / SWIFT"],["bank_name","Bank name"],["bank_address","Bank address"]],mxn:[["asset","Currency"],["account_holder_name","Account holder"],["clabe","CLABE"],["bank_name","Bank name"],["bank_address","Bank address"]],brl:[["asset","Currency"],["account_holder_name","Account holder"],["br_code","PIX code"],["bank_name","Bank name"],["bank_address","Bank address"]],gbp:[["asset","Currency"],["account_holder_name","Account holder"],["account_number","Account number"],["sort_code","Sort code"],["bank_name","Bank name"],["bank_address","Bank address"]]},j0t=t=>{let[,e]=navigator.language.toUpperCase().split("-");if(!e)return;let n=P0t[e];return t.find((r=>r===n))},Lue=(t,e)=>t.length>0?null:3>parseFloat(e)?"amount_too_low":"provider_errors",Gl=Bo((()=>null)),Kg=t=>{Gl.getState()!==null?Gl.setState(t):console.warn("[FiatOnramp] setState skipped â no active flow")},H9=()=>{let t=Gl.getState();if(!t)throw Error("Unexpected call to getFiatOnrampFlowState");return t},j4t=()=>{let t=H9();return t.localQuotes??t.initialQuotes},M0t=t=>t.localSelectedQuote??(t.localQuotes===null?t.initialSelectedQuote:null),M4t=()=>M0t(H9()),[D4t,D0t]=((t,e=750)=>{let n;return[(...r)=>{n&&clearTimeout(n),n=setTimeout((()=>{t(...r)}),e)},()=>{n&&clearTimeout(n)}]})((async(t,e)=>{var i,s;let{getQuotes:n,flowId:r}=H9();Kg({isLoading:!0});try{let a=await n({source:{asset:e.source.selectedAsset.toUpperCase(),amount:t},destination:{asset:e.destination.asset,chain:e.destination.chain,address:e.destination.address},environment:e.environment});if(((i=Gl.getState())==null?void 0:i.flowId)!==r)return;let o=a.quotes??[],l=a.provider_errors,u=Lue(o,t);Kg({localQuotes:o,localSelectedQuote:o[0]??null,isLoading:!1,quotesWarning:u,quotesErrors:l??null,destinationCurrencySymbol:a.destination_currency_symbol??null,destinationCurrencyIconUrl:a.destination_currency_icon_url??null,destinationNetworkIconUrl:a.destination_network_icon_url??null})}catch{if(((s=Gl.getState())==null?void 0:s.flowId)!==r)return;Kg({localQuotes:[],localSelectedQuote:null,quotesWarning:"provider_errors",quotesErrors:null})}})),U0t=()=>{var n;let{stripeSession:t,controller:e}=H9();
1216t&&((n=e.current)==null||n.abort(),t.onramp.destroy(),Kg({stripeSession:null}))},U4t=()=>{let{openModal:t,closePrivyModal:e,privy:n}=Br(),{navigate:r}=R2(),{user:i}=Uo(),s=N.useRef(null);return N.useMemo((()=>({fund:async a=>{var A,I,$;let{reject:o,resolve:l,promise:u}=hce(),f=a.source.assets??Object.keys(R0t);if(f.length<1)return o(Error("Invalid input: expected non-empty source.assets")),await u;if(Gl.getState())return o(Error("Existing fiat onramp flow in progress")),await u;let p=a.source.defaultAsset??j0t(f)??f[0],y={...a,environment:a.environment??"production",source:{...a.source,assets:f,selectedAsset:p}},g=async O=>await n.fetchPrivyRoute(W5e,{body:O}),b=async()=>{var O;(O=s.current)==null||O.abort(),t(null),await e({shouldCallAuthOnSuccess:!1,isSuccess:!0}),setTimeout((()=>{Gl.setState(null)}),0)},v=a.showBackButton?()=>(function({controller:O,reject:P}){var j;D0t(),U0t(),(j=O.current)==null||j.abort(),Gl.setState(null),P(new Xot)})({controller:s,reject:o}):void 0,_=Symbol("fiat-onramp-flow");Gl.setState({onSuccess:async O=>{await b(),l(O)},onFailure:async O=>{await b(),o(O)},onBack:v,getQuotes:g,getProviderUrl:async O=>await n.fetchPrivyRoute(q5e,{body:O}),getStatus:async O=>await n.fetchPrivyRoute(Z5e,{query:{...O}}),controller:s,flowId:_,opts:y,amount:y.defaultAmount??"0",state:{status:"select-amount"},error:null,isLoading:!0,quotesWarning:null,quotesErrors:null,initialQuotes:null,initialSelectedQuote:null,localQuotes:null,localSelectedQuote:null,destinationCurrencyIconUrl:null,destinationCurrencySymbol:null,destinationNetworkIconUrl:null,stripeElement:null,stripeSession:null,stripeConfirmCheckoutDetails:null,email:((A=i==null?void 0:i.email)==null?void 0:A.address)??null,phone:(I=i==null?void 0:i.phone)!=null&&I.number?dIe(i.phone.number):null,privy:n}),a.showBackButton?r("FiatOnrampScreen"):t("FiatOnrampScreen");let C=await g({source:{asset:y.source.selectedAsset.toUpperCase(),amount:y.defaultAmount??"0"},destination:{asset:y.destination.asset,chain:y.destination.chain,address:y.destination.address},environment:y.environment}).catch((()=>({quotes:[]})));if((($=Gl.getState())==null?void 0:$.flowId)!==_)return await u;let S=C.quotes,x=C.provider_errors;return Kg({initialQuotes:S,initialSelectedQuote:S[0]??null,quotesWarning:Lue(S,y.defaultAmount??"0"),quotesErrors:x??null,isLoading:!1,destinationCurrencySymbol:C.destination_currency_symbol??null,destinationCurrencyIconUrl:C.destination_currency_icon_url??null,destinationNetworkIconUrl:C.destination_network_icon_url??null}),await u}})),[t,e,n,r,i])},B0t=Bo((()=>null)),B4t=()=>B0t.setState(null);function F4t(t){let{signMessage:e}=N.useContext(Ku);return Z2("signMessage",t),{signMessage:e}}function z4t(t){let{signTypedData:e}=N.useContext(Ku);return Z2("signTypedData",t),{signTypedData:e}}const $ue="privy_wallet_address",F0t="tritonix:privy-wallet-bound",z0t=/^0x[a-fA-F0-9]{40}$/;function V0t(){return!0}function Gg(t){return z0t.test(t)}function Yg(t){return t.toLowerCase()}function V4t(t,e){return!t||!e?!1:t.toLowerCase()===e.toLowerCase()}function H4t(t,e){const n=(e==null?void 0:e.head)??6,r=(e==null?void 0:e.tail)??4;return t.length<=n+r?t:`${t.slice(0,n)}â¦${t.slice(-r)}`}function W4t(t,e=[]){var s,a;const n=(s=t==null?void 0:t.linkedAccounts)==null?void 0:s.find(o=>o.type==="wallet"&&o.walletClientType==="privy"&&o.address&&Gg(o.address));if(n!=null&&n.address)return Yg(n.address);const r=e.find(o=>o.walletClientType==="privy"&&o.address&&Gg(o.address));if(r!=null&&r.address)return Yg(r.address);const i=(a=t==null?void 0:t.wallet)==null?void 0:a.address;return i&&Gg(i)?Yg(i):null}async function q4t(){const t=await u3(`/api/user-preferences?key=${encodeURIComponent($ue)}`),e=await t.json().catch(()=>null);if(!t.ok)return null;const n=e==null?void 0:e.value;return typeof n=="string"&&Gg(n)?Yg(n):null}async function Z4t(t){if(!Gg(t))throw new Error("Invalid wallet address");const e=Yg(t),n=await u3("/api/user-preferences",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:$ue,value:e})}),r=await n.json().catch(()=>null);if(!n.ok)throw new Error((r==null?void 0:r.error)||"Failed to save wallet address");return typeof window<"u"&&window.dispatchEvent(new CustomEvent(F0t,{detail:{address:e}})),e}const H0t="cmtv7eo4z04k90cl5vkc0m24n";function W0t({children:t}){return V0t()?h.jsx(Dpt,{appId:H0t,config:{loginMethods:["google","email"],appearance:{theme:"light",accentColor:"#6366f1",logo:"https://tritonix.ai/favicon.png"},defaultChain:tT,supportedChains:[tT,UN,RCe],embeddedWallets:{ethereum:{createOnLogin:"users-without-wallets"}}},children:t}):h.jsx(h.Fragment,{children:t})}const q0t=300*1e3,NG="google-identity-services",Z0t="https://accounts.google.com/gsi/client",K0t=3e3,G0t=100;async function Y0t(){var i,s;if(!((i=globalThis.crypto)!=null&&i.getRandomValues)||!((s=globalThis.crypto)!=null&&s.subtle))throw new Error("Secure Web Crypto is required for Google One Tap.");const t=new Uint8Array(32);globalThis.crypto.getRandomValues(t);const e=Array.from(t,a=>a.toString(16).padStart(2,"0")).join(""),n=await globalThis.crypto.subtle.digest("SHA-256",
1216new TextEncoder().encode(e)),r=Array.from(new Uint8Array(n),a=>a.toString(16).padStart(2,"0")).join("");return{raw:e,hashed:r}}function J0t(){return new Promise((t,e)=>{var i,s;if((s=(i=window.google)==null?void 0:i.accounts)!=null&&s.id){t();return}const n=document.getElementById(NG);if(n){n.addEventListener("load",()=>t(),{once:!0}),n.addEventListener("error",()=>e(new Error("Failed to load Google Identity Services.")),{once:!0});return}const r=document.createElement("script");r.id=NG,r.src=Z0t,r.async=!0,r.defer=!0,r.onload=()=>t(),r.onerror=()=>e(new Error("Failed to load Google Identity Services.")),document.head.appendChild(r)})}async function X0t(t=K0t){const e=Date.now()+t;for(;Date.now()<e;){const{data:{session:n}}=await Mn.auth.getSession();if(n)return n;await new Promise(r=>window.setTimeout(r,G0t))}return null}const Q0t=({enabled:t})=>{const e=Vf(),n=N.useRef(e);return N.useEffect(()=>{n.current=e},[e]),N.useEffect(()=>{var a,o;if(typeof window>"u")return;const r="940201500482-20qn20tf97g0vol47m0n41rglhk4a4ej.apps.googleusercontent.com";let i=!1;if(!t||!r){(o=(a=window.google)==null?void 0:a.accounts)==null||o.id.cancel();return}return(async()=>{var l,u;try{if(await J0t(),i||!((u=(l=window.google)==null?void 0:l.accounts)!=null&&u.id))return;const f=await Y0t();if(i)return;window.google.accounts.id.initialize({client_id:r,auto_select:!1,cancel_on_tap_outside:!1,context:"signin",itp_support:!0,use_fedcm_for_prompt:!0,nonce:f.hashed,callback:async p=>{var S,x,A,I;if(!p.credential)return;const{data:y,error:g}=await Mn.auth.signInWithIdToken({provider:"google",token:p.credential,nonce:f.raw});if(g){console.error("Google One Tap sign-in failed:",g.message);return}const b=y.session??await X0t();if(!b){console.error("Google One Tap sign-in succeeded but no session was established in time.");return}const v=(S=b.user)!=null&&S.created_at?new Date(b.user.created_at).getTime():0,_=v>0&&Date.now()-v<q0t;await d3(((x=b.user)==null?void 0:x.id)??null,((A=b.user)==null?void 0:A.email)??null),_?(await dI("google_one_tap",(I=b.user)==null?void 0:I.id),bX(c7())):hI("google_one_tap");const C=`${n.current}/studio`||"/studio";window.location.assign(wX(C))}}),window.google.accounts.id.prompt()}catch{}})(),()=>{var l,u;i=!0,(u=(l=window.google)==null?void 0:l.accounts)==null||u.id.cancel()}},[t]),null},e1t=['iframe[src*="accounts.google.com/gsi"]','div[id^="credential_picker_container"]','div[id^="credential_picker_iframe"]'].join(",");function t1t(){if(typeof window>"u")return 0;let t=0;return document.querySelectorAll(e1t).forEach(e=>{const n=e.getBoundingClientRect(),r=n.bottom>=window.innerHeight-8;n.height>0&&n.width>0&&r&&(t=Math.max(t,n.height))}),t}const n1t=()=>{const{t}=sr("common"),[e,n]=N.useState(!1),[r,i]=N.useState(!1),[s,a]=N.useState(()=>ec()),[o,l]=N.useState(0);N.useEffect(()=>{KJ(ec())},[]),N.useEffect(()=>{const b=()=>{a(ec()),i(!0),n(!0)};return window.addEventListener(uk,b),()=>window.removeEventListener(uk,b)},[]),N.useEffect(()=>{if(!e)return;const b=()=>l(t1t());b();const v=window.setInterval(b,400),_=new MutationObserver(b);return _.observe(document.body,{childList:!0,subtree:!0}),window.addEventListener("resize",b),()=>{window.clearInterval(v),_.disconnect(),window.removeEventListener("resize",b)}},[e]);const u=()=>{n(!1),i(!1)},f=()=>{kC({analytics:!0,ads:!0}),u()},p=()=>{kC({analytics:!1,ads:!1}),u()},y=()=>{kC(s),u()};if(!e)return null;const g={background:"rgba(9,9,14,0.96)",border:"1px solid rgba(255,255,255,0.14)",boxShadow:"0 8px 32px rgba(0,0,0,0.55)",backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)"};return h.jsx("div",{className:"fixed inset-x-0 z-[45] px-3 pb-3 md:px-6 md:pb-4 pointer-events-none transition-[bottom] duration-200",style:{bottom:o},role:"dialog","aria-live":"polite","aria-label":t("cookieConsent.shortTitle"),children:h.jsx("div",{className:"pointer-events-auto mx-auto w-full max-w-3xl rounded-xl animate-cookie-in",style:g,children:r?h.jsxs("div",{className:"px-5 py-4",children:[h.jsx("p",{className:"text-sm font-semibold text-white mb-1.5",children:t("cookieConsent.shortTitle")}),h.jsxs("p",{className:"text-xs leading-relaxed text-[#9A9CB0]",children:[t("cookieConsent.description")," ",h.jsx(na,{to:"/privacy",className:"text-white/90 underline underline-offset-2 hover:text-white transition-colors",children:t("cookieConsent.privacyLink")})]}),h.jsxs("div",{className:"mt-4 border-t border-white/10 pt-4 space-y-3",children:[h.jsx(IA,{title:t("cookieConsent.category.necessary.title"),desc:t("cookieConsent.category.necessary.desc"),checked:!0,disabled:!0}),h.jsx(IA,{title:t("cookieConsent.category.analytics.title"),desc:t("cookieConsent.category.analytics.desc"),checked:s.analytics,onChange:b=>a(v=>({...v,analytics:b}))}),h.jsx(IA,{title:t("cookieConsent.category.ads.title"),desc:t("cookieConsent.category.ads.desc"),checked:s.ads,onChange:b=>a(v=>({...v,ads:b}))})]}),h.jsxs("div",{className:"mt-4 flex items-center justify-end gap-2.5",children:[h.jsx("button",{onClick:p,className:"px-4 py-2 text-sm font-medium rounded-full text-white/90 border border-white/20 hover:border-white/45 hover:text-white transition-all duration-200",children:t("cookieConsent.necessaryOnly")}),h.jsx("button",{onClick:y,className:"px-5 py-2 text-sm font-semibold rounded-full bg-white text-black hover:bg-white/90 transition-all duration-200",children:t("cookieConsent.save")})]})]}):h.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-3 px-4 py-3",children:[h.jsxs("div",{className:"min-w-0 flex-1 basis-full sm:basis-auto",children:[h.jsx("p",{className:"text-sm font-semibold text-white",children:t("cookieConsent.shortTitle")}),h.jsxs("p",{className:"text-xs leading-relaxed text-[#9A9CB0]",children:[t("cookieConsent.shortDe
1216sc")," ",h.jsx(na,{to:"/privacy",className:"text-white/90 underline underline-offset-2 hover:text-white transition-colors",children:t("cookieConsent.privacyLink")})]})]}),h.jsxs("div",{className:"flex shrink-0 items-center gap-2.5 ml-auto",children:[h.jsx("button",{onClick:()=>i(!0),className:"px-4 py-2 text-sm font-medium rounded-full text-white/90 border border-white/20 hover:border-white/45 hover:text-white transition-all duration-200 whitespace-nowrap",children:t("cookieConsent.manage")}),h.jsx("button",{onClick:f,className:"px-5 py-2 text-sm font-semibold rounded-full bg-white text-black hover:bg-white/90 transition-all duration-200 whitespace-nowrap",children:t("cookieConsent.acceptAll")})]})]})})})},IA=({title:t,desc:e,checked:n,disabled:r,onChange:i})=>h.jsxs("div",{className:"flex items-start justify-between gap-4",children:[h.jsxs("div",{className:"min-w-0",children:[h.jsx("p",{className:"text-sm font-medium text-white",children:t}),h.jsx("p",{className:"text-xs leading-relaxed text-[#8A8CA6] mt-0.5",children:e})]}),h.jsx("button",{type:"button",role:"switch","aria-checked":n,"aria-label":t,disabled:r,onClick:()=>i==null?void 0:i(!n),className:`relative mt-0.5 inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors duration-200 ${n?"bg-blue-600":"bg-white/20"} ${r?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:h.jsx("span",{className:`inline-block h-5 w-5 rounded-full bg-white shadow transition-transform duration-200 ${n?"translate-x-5":"translate-x-0.5"}`})})]}),r1t=()=>{const{pathname:t}=Zi(),e=gJ(t),{i18n:n}=sr(),r=!!e,[i,s]=N.useState(null),a=!!e&&(n.resolvedLanguage===e||n.language===e);return N.useEffect(()=>{if(!e||a)return;let o=!1;return s(l=>l===null?l:null),localStorage.setItem("tritonix_lang",e),n.changeLanguage(e).catch(l=>{console.error(`Failed to load locale "${e}":`,l),o||s(e)}),()=>{o=!0}},[e,r,a]),r?!a&&i!==e?h.jsx("div",{className:"min-h-full flex-1 bg-white dark:bg-black",role:"status","aria-label":"Loading language","aria-busy":"true"}):h.jsx(Qhe,{}):h.jsx(xs,{to:"/",replace:!0})};var Gv={},i1t=()=>{window.si||(window.si=function(...e){window.siq=window.siq||[],window.siq.push(e)})},s1t="@vercel/speed-insights",a1t="2.0.0";function o1t(){return typeof window<"u"}function l1t(){try{const t="production"}catch{}return"production"}function Iue(){return l1t()==="development"}function c1t(t){return t.scriptSrc?Yv(t.scriptSrc):Iue()?"https://va.vercel-scripts.com/v1/speed-insights/script.debug.js":t.dsn?"https://va.vercel-scripts.com/v1/speed-insights/script.js":t.basePath?Yv(`${t.basePath}/speed-insights/script.js`):"/_vercel/speed-insights/script.js"}function u1t(t,e){var n;let r=t;if(e)try{r={...(n=JSON.parse(e))==null?void 0:n.speedInsights,...t}}catch{}const i={sdkn:s1t+(r.framework?`/${r.framework}`:""),sdkv:a1t};
1216return r.sampleRate&&(i.sampleRate=r.sampleRate.toString()),r.route&&(i.route=r.route),Iue()&&r.debug===!1&&(i.debug="false"),r.dsn&&(i.dsn=r.dsn),r.endpoint?i.endpoint=Yv(r.endpoint):r.basePath&&(i.endpoint=Yv(`${r.basePath}/speed-insights/vitals`)),{src:c1t(r),beforeSend:r.beforeSend,dataset:i}}function Yv(t){return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("/")?t:`/${t}`}function d1t(t={},e){var n;if(!o1t()||t.route===null)return null;i1t();const{beforeSend:r,src:i,dataset:s}=u1t(t,e);if(document.head.querySelector(`script[src*="${i}"]`))return null;r&&((n=window.si)==null||n.call(window,"beforeSend",r));const a=document.createElement("script");a.src=i,a.defer=!0;for(const[o,l]of Object.entries(s))a.dataset[o]=l;return a.onerror=()=>{console.log(`[Vercel Speed Insights] Failed to load script from ${i}. Please check if any content blockers are enabled and try again.`)},document.head.appendChild(a),{setRoute:o=>{a.dataset.route=o??void 0}}}function h1t(){if(!(typeof process>"u"||typeof Gv>"u"))return Gv.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}function f1t(){if(!(typeof process>"u"||typeof Gv>"u"))return Gv.REACT_APP_VERCEL_OBSERVABILITY_CLIENT_CONFIG}function p1t(t){N.useEffect(()=>{var n;t.beforeSend&&((n=window.si)==null||n.call(window,"beforeSend",t.beforeSend))},[t.beforeSend]);const e=N.useRef(null);return N.useEffect(()=>{if(!e.current){const n=d1t({framework:t.framework??"react",basePath:t.basePath??h1t(),...t},t.configString??f1t());n&&(e.current=n.setRoute)}},[t]),N.useEffect(()=>{e.current&&t.route&&e.current(t.route)},[t.route]),null}function m1t(t){return t.startsWith("/news/")}function y1t(t){return t.startsWith("/whales-institution")}function QP(t){return t==="/"||t.startsWith("/blog")||t.startsWith("/press")||t==="/news"||m1t(t)||t.startsWith("/ideas")||t.startsWith("/stock/")||t.startsWith("/dr/")||t.startsWith("/pricing")||t.startsWith("/credit-guide")||t.startsWith("/terms")||t.startsWith("/privacy")||t.startsWith("/cybersecurity-policy")||t.startsWith("/help")||t.startsWith("/compare")||t.startsWith("/models")||t==="/ai-investment-agent"||t==="/ai-consensus-pick"||t==="/institution-smart-money"||t==="/ai-social-agent"||t==="/ai-technical-analysis"||t==="/copy-trade"||t==="/swing-trade-bot"||t==="/day-trade-bot"||t==="/market-data"||t==="/for-business"||t.startsWith("/share/")||t==="/about"}function g1t(t,e,n){return!e&&!n&&(QP(t)||y1t(t))}function b1t(t){return!t.isAppRoute&&!(t.userPresent&&t.isConsensusRoute)&&!(t.userPresent&&t.isWhalesRoute)&&!(t.userPresent&&t.isDiscoverRoute)}function w1t(t,e){return t&&!QP(e)}function OG(t){return t==="pro"||t==="max"||t==="elite"?t:"free"}function v1t(){const{user:t}=fc(),[e,n]=N.useState(null),[r,i]=N.useState(null),[s,a]=N.useState(null),[o,l]=N.useState(!0),u=async()=>{var f,p;if(!t){n(null),i(null),a(null),l(!1);return}try{const y=new Date().toISOString(),[{data:g,error:b},{data:v,error:_}]=await Promise.all([Mn.from("user_credit_buckets").select("credit_type, amount, expires_at, billing_period_end").eq("user_id",t.id).gt("amount",0).or(`expires_at.is.null,expires_at.gt.${y}`),Mn.from("profiles").select("credits_balance, subscription_tier").eq("id",t.id).single()]);if(!b&&g&&g.length>=0){const C=g.filter(U=>U.credit_type==="permanent").reduce((U,z)=>U+z.amount,0),S=g.filter(U=>U.credit_type==="monthly").reduce((U,z)=>U+z.amount,0),x=g.filter(U=>U.credit_type==="promo").reduce((U,z)=>U+z.amount,0),I=((f=g.filter(U=>U.credit_type==="monthly"&&U.billing_period_end).sort((U,z)=>new Date(U.billing_period_end).getTime()-new Date(z.billing_period_end).getTime())[0])==null?void 0:f.billing_period_end)??null,O=((p=g.filter(U=>U.credit_type==="promo"&&U.expires_at).sort((U,z)=>new Date(U.expires_at).getTime()-new Date(z.expires_at).getTime())[0])==null?void 0:p.expires_at)??null,P=C+S+x,j=v==null?void 0:v.credits_balance;n(typeof j=="number"?j:P),i({total:P,permanent:C,monthly:S,promo:x,monthlyResetAt:I,promoNextExpiry:O}),a(OG(v==null?void 0:v.subscription_tier))}else _?(n(null),a(null)):(n((v==null?void 0:v.credits_balance)??null),a(OG(v==null?void 0:v.subscription_tier))),i(null)}catch{n(null),i(null),a(null)}finally{l(!1)}};return N.useEffect(()=>{l(!0),u()},[t==null?void 0:t.id]),N.useEffect(()=>{if(!t)return;const f=Mn.channel(`credits-${t.id}`).on("postgres_changes",{event:"UPDATE",schema:"public",table:"profiles",filter:`id=eq.${t.id}`},()=>{u()}).on("postgres_changes",{event:"*",schema:"public",table:"user_credit_buckets",filter:`user_id=eq.${t.id}`},()=>{u()}).subscribe();return()=>{Mn.removeChannel(f)}},[t==null?void 0:t.id]),{balance:e,breakdown:r,subscriptionTier:s,loading:o,refresh:u}}const dw={free:["signupCreditsBonus","aiResearchStudio","marketsAcrossAssets","quoteDataAndIndicators","optionDataAndStrategies","financialDataAndNews","aiScreenAssets","memoryOnYourInterests","earningsCalendar"],pro:["proMonthlyCredits","tritonixTimingSignal","copyTradeTrackers","aiPremarketPick","institutionalSmartMoney","fullFinancialDataAndNews","aiTechnicalAnalysis","scheduledAgentTasks","connectAndPostOnSocialMedia"],max:["maxMonthlyCredits","everythingInPro","swingTradeBots","tritonixAiConsensusPortfolio","dayTradeTerraBot","predictionMarketData","fomcWarRoom","defiOnChainAndDerivativesData","cryptoExpertDeepAnalysis"],elite:["eliteMonthlyCredits","everythingInMax","dayTradeSolBot","tritonixSp500TimingSignal","customizedAgentSkills","higherRateLimits","dedicatedAccountSupport","macroAiPicks","quantAiAlphaPickComingSoon"]},_1t={signupCreditsBonus:{id:"signupCreditsBonus",planIds:["free"],labelKey:"featureCatalog.signupCreditsBonus.label",defaultLabel:"300 credits on signup"},aiResearchStudio:{id:"aiResearchStudio",planIds:["free"],labelKey:"featureCatalog.aiResearchStudio.label",defaultLabel:"AI Research Studio"},marketsAcrossAssets:{id:"marketsAcrossAssets",planIds:["free"],labelKey:"featureCatalog.marketsAcrossAssets.label",defaultLabel:"50+ markets across assets"},quoteDataAndIndicators:{id:"quoteDataAndIndicators",planIds:["free"],labelKey:"featureCatalog.quoteDataAndIndicators.label",defaultLabel:"Quote data & indicators"},optionDataAndStrategies:{id:"optionDataAndStrategies",planIds:["free"],labelKey:"featureCatalog.o
1216ptionDataAndStrategies.label",defaultLabel:"Option data & strategies"},financialDataAndNews:{id:"financialDataAndNews",planIds:["free"],labelKey:"featureCatalog.financialDataAndNews.label",defaultLabel:"Financial data & news"},aiScreenAssets:{id:"aiScreenAssets",planIds:["free"],labelKey:"featureCatalog.aiScreenAssets.label",defaultLabel:"AI screener",tooltipTitleKey:"featureCatalog.aiScreenAssets.tooltipTitle",tooltipBodyKey:"featureCatalog.aiScreenAssets.tooltipBody",defaultTooltipTitle:"AI screener",defaultTooltipBody:["Describe a screening idea in plain English or launch starter screens to surface matched names and filters instantly."],imageSrc:"/images/paywall-ai-screener.png"},memoryOnYourInterests:{id:"memoryOnYourInterests",planIds:["free"],labelKey:"featureCatalog.memoryOnYourInterests.label",defaultLabel:"Memory on your interests"},earningsCalendar:{id:"earningsCalendar",planIds:["free"],labelKey:"featureCatalog.earningsCalendar.label",defaultLabel:"Earnings calendar"},proMonthlyCredits:{id:"proMonthlyCredits",planIds:["pro"],labelKey:"featureCatalog.proMonthlyCredits.label",defaultLabel:"1,700 credits / month",tooltipTitleKey:"featureCatalog.proMonthlyCredits.tooltipTitle",tooltipBodyKey:"featureCatalog.proMonthlyCredits.tooltipBody",defaultTooltipTitle:"Credits / month",defaultTooltipBody:["Credits are Tritonix platform-wide currency used for agent Q&A, scheduled tasks, copy trade workflows, swing trade bots, and other credit-based actions."],imageSrc:"/images/paywall-monthly-credits.png"},copyTradeTrackers:{id:"copyTradeTrackers",planIds:["pro"],labelKey:"featureCatalog.copyTradeTrackers.label",defaultLabel:"Copy Trade Strategies",tooltipTitleKey:"featureCatalog.copyTradeTrackers.tooltipTitle",tooltipBodyKey:"featureCatalog.copyTradeTrackers.tooltipBody",defaultTooltipTitle:"Copy Trade Strategies",defaultTooltipBody:["Follow top-performing managers with transparent return, Sharpe, drawdown, and deployable copy-trade workflows."],imageSrc:"/images/paywall-copy-trade-strategies.png"},aiPremarketPick:{id:"aiPremarketPick",planIds:["pro","max","elite"],labelKey:"featureCatalog.aiPremarketPick.label",defaultLabel:"AI Premarket Pick",tooltipTitleKey:"featureCatalog.aiPremarketPick.tooltipTitle",tooltipBodyKey:"featureCatalog.aiPremarketPick.tooltipBody",defaultTooltipTitle:"AI Premarket Pick",defaultTooltipBody:["Daily AI-selected premarket setups with entry prices, live holdings, and trade history."],imageSrc:"/images/paywall-premarket-picks.png"},institutionalSmartMoney:{id:"institutionalSmartMoney",planIds:["pro","max","elite"],labelKey:"featureCatalog.institutionalSmartMoney.label",defaultLabel:"Institutional smart money",tooltipTitleKey:"featureCatalog.institutionalSmartMoney.tooltipTitle",tooltipBodyKey:"featureCatalog.institutionalSmartMoney.tooltipBody",defaultTooltipTitle:"Institutional smart money",defaultTooltipBody:["Track institutional holdings, position changes, and high-conviction moves in one place."],imageSrc:"/images/paywall-smart-money.png",highlightOnPlan:"pro"},tritonixTimingSignal:{id:"tritonixTimingSignal",planIds:["pro","max","elite"],labelKey:"featureCatalog.tritonixTimingSignal.label",defaultLabel:"20+ Tritonix Advanced Indicators",tooltipTitleKey:"featureCatalog.tritonixTimingSignal.tooltipTitle",tooltipBodyKey:"featureCatalog.tritonixTimingSignal.tooltipBody",defaultTooltipTitle:"20+ Tritonix Advanced Indicators",defaultTooltipBody:["Proprietary Tritonix studies. 20+ algorithms mark high-conviction BUY and SELL points on the chart."],imageSrc:"/images/paywall-timing-signal.png"},fullFinancialDataAndNews:{id:"fullFinancialDataAndNews",planIds:["pro"],labelKey:"featureCatalog.fullFinancialDataAndNews.label",defaultLabel:"Full financial data & news"},aiTechnicalAnalysis:{id:"aiTechnicalAnalysis",planIds:["pro"],labelKey:"featureCatalog.aiTechnicalAnalysis.label",defaultLabel:"AI technical analysis",tooltipTitleKey:"featureCatalog.aiTechnicalAnalysis.tooltipTitle",tooltipBodyKey:"featureCatalog.aiTechnicalAnalysis.tooltipBody",defaultTooltipTitle:"AI technical analysis",defaultTooltipBody:["Get AI chart breakdowns with support and resistance, trend structure, and actionable trade levels in one view."],imageSrc:"/images/paywall-ai-technical-analysis.png"},scheduledAgentTasks:{id:"scheduledAgentTasks",planIds:["pro"],labelKey:"featureCatalog.scheduledAgentTasks.label",defaultLabel:"Unlimited scheduled agent tasks"}
1216,connectAndPostOnSocialMedia:{id:"connectAndPostOnSocialMedia",planIds:["pro"],labelKey:"featureCatalog.connectAndPostOnSocialMedia.label",defaultLabel:"Connect & post on social media"},maxMonthlyCredits:{id:"maxMonthlyCredits",planIds:["max"],labelKey:"featureCatalog.maxMonthlyCredits.label",defaultLabel:"4,600 credits / month",tooltipTitleKey:"featureCatalog.maxMonthlyCredits.tooltipTitle",tooltipBodyKey:"featureCatalog.maxMonthlyCredits.tooltipBody",defaultTooltipTitle:"Credits / month",defaultTooltipBody:["Credits are Tritonix platform-wide currency used for agent Q&A, scheduled tasks, copy trade workflows, swing trade bots, and other credit-based actions."],imageSrc:"/images/paywall-monthly-credits.png"},everythingInPro:{id:"everythingInPro",planIds:["max"],labelKey:"featureCatalog.everythingInPro.label",defaultLabel:"Everything in Pro"},swingTradeBots:{id:"swingTradeBots",planIds:["max","elite"],labelKey:"featureCatalog.swingTradeBots.label",defaultLabel:"Swing Trade Bots",tooltipTitleKey:"featureCatalog.swingTradeBots.tooltipTitle",tooltipBodyKey:"featureCatalog.swingTradeBots.tooltipBody",defaultTooltipTitle:"Swing Trade Bots",defaultTooltipBody:["Confidence-ranked swing trade bots with fee-adjusted backtests that you can deploy to your broker."],imageSrc:"/images/paywall-swing-trade-bot.png"},tritonixAiConsensusPortfolio:{id:"tritonixAiConsensusPortfolio",planIds:["max","elite"],labelKey:"featureCatalog.tritonixAiConsensusPortfolio.label",defaultLabel:"Tritonix AI Consensus Portfolio",tooltipTitleKey:"featureCatalog.tritonixAiConsensusPortfolio.tooltipTitle",tooltipBodyKey:"featureCatalog.tritonixAiConsensusPortfolio.tooltipBody",defaultTooltipTitle:"Tritonix AI Consensus Portfolio",defaultTooltipBody:["Follow a multi-model consensus portfolio with live holdings, cost basis, and rebalance signals."],imageSrc:"/images/paywall-consensus.png",highlightOnPlan:"max"},dayTradeTerraBot:{id:"dayTradeTerraBot",planIds:["max","elite"],labelKey:"featureCatalog.dayTradeTerraBot.label",defaultLabel:"Day Trade Terra Bot",tooltipTitleKey:"featureCatalog.dayTradeTerraBot.tooltipTitle",tooltipBodyKey:"featureCatalog.dayTradeTerraBot.tooltipBody",defaultTooltipTitle:"Day Trade Terra Bot",defaultTooltipBody:["A short-term holding book you can deploy to your broker, with live trades and a full entry-exit history."],imageSrc:"/images/paywall-day-trade-terra-bot.png"},predictionMarketData:{id:"predictionMarketData",planIds:["max"],labelKey:"featureCatalog.predictionMarketData.label",defaultLabel:"Prediction market data",tooltipTitleKey:"featureCatalog.predictionMarketData.tooltipTitle",tooltipBodyKey:"featureCatalog.predictionMarketData.tooltipBody",defaultTooltipTitle:"Prediction market data",defaultTooltipBody:["Track live market-implied probabilities across macro, crypto, rates, and event-driven scenarios in one place."],imageSrc:"/images/paywall-prediction-market-data.png"},fomcWarRoom:{id:"fomcWarRoom",planIds:["max","elite"],labelKey:"featureCatalog.fomcWarRoom.label",defaultLabel:"FOMC War Room",tooltipTitleKey:"featureCatalog.fomcWarRoom.tooltipTitle",tooltipBodyKey:"featureCatalog.fomcWarRoom.tooltipBody",defaultTooltipTitle:"FOMC War Room",defaultTooltipBody:["Hawk-dove score, statement redline, post-meeting brief, analog playbook, and official net liquidity on decision day."],imageSrc:"/images/paywall-fomc-war-room.png"},macroData:{id:"macroData",planIds:["max"],labelKey:"featureCatalog.macroData.label",defaultLabel:"Macro data"},defiOnChainAndDerivativesData:{id:"defiOnChainAndDerivativesData",planIds:["max"],labelKey:"featureCatalog.defiOnChainAndDerivativesData.label",defaultLabel:"DeFi, on-chain & derivatives data"},cryptoExpertDeepAnalysis:{id:"cryptoExpertDeepAnalysis",planIds:["max"],labelKey:"featureCatalog.cryptoExpertDeepAnalysis.label",defaultLabel:"Crypto Expert deep analysis"},eliteMonthlyCredits:{id:"eliteMonthlyCredits",planIds:["elite"],labelKey:"featureCatalog.eliteMonthlyCredits.label",defaultLabel:"21,000 credits / month",tooltipTitleKey:"featureCatalog.eliteMonthlyCredits.tooltipTitle",tooltipBodyKey:"featureCatalog.eliteMonthlyCredits.tooltipBody",defaultTooltipTitle:"Credits / month",defaultTooltipBody:["Credits are Tritonix platform-wide currency used for agent Q&A, scheduled tasks, copy trade workflows, swing trade bots, and other credit-based actions."],imageSrc:"/images/paywall-monthly-credits.png"},everythingInMax:{id:"everythingInMax",planIds:["elite"],labelKey:"featureCatalog.everythingInMax.label",defaultLabel:"Everything in Max"},tritonixSp500TimingSignal:{id:"tritonixSp500TimingSignal",planIds:["elite"],labelKey:"featureCatalog.tritonixSp500TimingSignal.label",defaultLabel:"Tritonix S&P 500 timing signal",tooltipTitleKey:"featureCatalog.tritonixSp500TimingSignal.tooltipTitle",tooltipBodyKey:"featureCatalog.tritonixSp500TimingSignal.tooltipBody",defaultTooltipTitle:"Tritonix S&P 500 timing signal",defaultTooltipBody:["Proprietary index-level timing that flags major market tops and bottom-buying zones."],imageSrc:"/images/paywall-sp500-timing-signal.png"},customizedAgentSkills:{id:"customizedAgentSkills",planIds:["elite"],labelKey:"featureCatalog.customizedAgentSkills.label",defaultLabel:"Customized agent skills",tooltipTitleKey:"featureCatalog.customizedAgentSkills.tooltipTitle",tooltipBodyKey:"featureCatalog.customizedAgentSkills.tooltipBody",defaultTooltipTitle:"Customized agent skills",defaultTooltipBody:["Create tailored agent workflows for your own research process, data preferences, and repeatable playbooks."],imageSrc:"/images/paywall-agent-skills.png"},higherRateLimits:{id:"higherRateLimits",planIds:["elite"],labelKey:"featureCatalog.higherRateLimits.label",defaultLabel:"Higher rate limits",tooltipTitleKey:"featureCatalog.higherRateLimits.tooltipTitle",tooltipBodyKey:"featureCatalog.higherRateLimits.tooltipBody",defaultTooltipTitle:"Higher rate limits",defaultTooltipBody:["Run heavier research sessions, more monitoring tasks, and deeper workflows with fewer throughput limits."]},dedicatedAccountSupport:{id:"dedicatedAccountSupport",planIds:["elite"],labelKey:"featureCatalog.dedicatedAccountSupport.label",defaultLabel:"Dedicated account support",tooltipTitleKey:"featureCatalog.dedicatedAccountSupport.tooltipTitle",tooltipBodyKey:"featureCatalog.dedicatedAccountSupport.tooltipBody",defaultTooltipTitle:"Dedicated account support",defaultTooltipBody:["Get first-priority support for onboarding, feature setup, and advanced workflow questions."]},macroAiPicks:{id:"macroAiPicks",planIds:["elite"],labelKey:"featureCatalog.macroAiPicks.label",defaultLabel:"Macro AI Picks",tooltipTitleKey:"featureCatalog.macroAiPicks.tooltipTitle",tooltipBodyKey:"featureCatalog.macroAiPicks.tooltipBody",defaultTooltipTitle:"Macro AI Picks",defaultTooltipBody:["Each week, AI combines macro data and algorithmic signals to select 10 US equities.","The portfolio rebalances toward a 10% target weight per stock, with weekly email alerts for Elite members."]},dayTradeSolBot:{id:"dayTradeSolBot",planIds:["elite"],labelKey:"featureCatalog.dayTradeSolBot.label",defaultLabel:"Day Trade Sol Bot",tooltipTitleKey:"featureCatalog.dayTradeSolBot.tooltipTitle",tooltipBodyKey:"featureCatalog.dayTradeSolBot.tooltipBody",defaultTooltipTitle:"Day Trade Sol Bot",defaultTooltipBody:["Intraday high-frequency auto-trading bot with an advanced strategy algorithm. Exclusive to Elite."],imageSrc:"/images/paywall-day-trade-sol-bot.png"},quantAiAlphaPickComingSoon:{id:"quantAiAlphaPickComingSoon",planIds:["elite"],labelKey:"featureCatalog.quantAiAlphaPickComingSoon.label",defaultLabel:"Quant AI Alpha Pick (coming soon)"}};function Nue(t){return _1t[t]}const W$=[{id:"free",name:"Free",icon:"zap",monthlyPrice:0,yearlyPrice:0,yearlyTotal:0,credits:300,tri
1216alCredits:0,creditsNote:"on signup · 30-day bonus",description:"Try AI-powered investing for free.",accentClass:"text-gray-600 dark:text-gray-400",borderClass:"border-gray-200 dark:border-white/[0.08]",glowClass:"",highlight:!1,badge:null,cta:"Get Started Free",featureIds:dw.free,features:["300 credits on signup","AI Research Studio","50+ markets across assets","Quote data & indicators","Option data & strategies","Financial data & news","AI screener","Memory on your interests","Earnings calendar"],missing:[]},{id:"pro",name:"Pro",icon:"star",monthlyPrice:19,yearlyPrice:15,yearlyTotal:180,credits:1700,trialCredits:500,creditsNote:"per month",description:"For individual investors.",accentClass:"text-sky-500 dark:text-sky-400",borderClass:"border-gray-200 dark:border-white/[0.08]",glowClass:"",highlight:!1,badge:null,cta:"Get Pro",featureIds:dw.pro,features:["1,700 credits / month","20+ Tritonix Advanced Indicators","Copy Trade Strategies","AI Premarket Pick","Institutional smart money","Full financial data & news","AI technical analysis","Unlimited scheduled agent tasks","Connect & post on social media"],missing:[]},{id:"max",name:"Max",icon:"crown",monthlyPrice:49,yearlyPrice:39,yearlyTotal:468,credits:4600,trialCredits:1500,creditsNote:"per month",description:"For power users.",accentClass:"text-violet-500 dark:text-violet-400",borderClass:"border-violet-500/50",glowClass:"shadow-[0_0_40px_rgba(139,92,246,0.12)]",highlight:!0,badge:"Most Popular",cta:"Get Max",featureIds:dw.max,features:["4,600 credits / month","Everything in Pro","Swing Trade Bots","Tritonix AI Consensus Portfolio","Day Trade Terra Bot","Prediction market data","FOMC War Room","DeFi, on-chain & derivatives data","Crypto Expert deep analysis"],missing:[]},{id:"elite",name:"Elite",icon:"gem",monthlyPrice:199,yearlyPrice:159,yearlyTotal:1908,credits:21e3,trialCredits:5e3,creditsNote:"per month",description:"For professional fund managers.",accentClass:"text-amber-500 dark:text-amber-400",borderClass:"border-gray-200 dark:border-white/[0.08]",glowClass:"",highlight:!1,badge:null,cta:"Get Elite",featureIds:dw.elite,features:["21,000 credits / month","Everything in Max","Day Trade Sol Bot","Tritonix S&P 500 timing signal","Customized agent skills","Higher rate limits","Dedicated account support","Macro AI Picks","Quant AI Alpha Pick (coming soon)"],missing:[]}],hw={free:0,pro:1,max:2,elite:3};function x1t(t,e){const n=W$.find(r=>r.id===t);return n?e?n.yearlyTotal:n.monthlyPrice:0}function C1t(t){return t==="pro"||t==="max"||t==="elite"?t:"free"}const PG={free:0,pro:1,max:2,elite:3};function K4t(t,e){return(PG[t??"free"]??0)>=PG[e]}function E1t(t,e){return e?!1:!t||t.status==="reserved"}async function S1t(t){const[{data:e},{data:n},{data:r}]=await Promise.all([Mn.from("profiles").select("subscription_tier").eq("id",t).maybeSingle(),Mn.from("user_subscriptions").select("billing_cycle, status, trial_end_at, source").eq("user_id",t).in("source",["stripe","airwallex"]).order("created_at",{ascending:!1}).limit(1).maybeSingle(),Mn.from("subscription_trials").select("status, reserved_until, trial_end_at").eq("user_id",t).maybeSingle()]);return{tier:C1t(e==null?void 0:e.subscription_tier),billingCycle:typeof(n==null?void 0:n.billing_cycle)=="str
1216ing"?n.billing_cycle:null,status:typeof(n==null?void 0:n.status)=="string"?n.status:null,trialEndAt:typeof(n==null?void 0:n.trial_end_at)=="string"?n.trial_end_at:typeof(r==null?void 0:r.trial_end_at)=="string"?r.trial_end_at:null,trialEligible:E1t(r,!!n),source:(n==null?void 0:n.source)==="airwallex"||(n==null?void 0:n.source)==="stripe"||(n==null?void 0:n.source)==="promo"?n.source:null}}var A1t={};function m0(t){return t.charAt(0).toUpperCase()+t.slice(1)}function k1t({userId:t=null,enabled:e=!0,isAnnual:n,onOpenAuth:r,onFreeSelect:i,onCheckoutStarted:s,entryPoint:a="pricing",sourceSurface:o="pricing_grid",onboardingVariant:l}){const u=!!t,{t:f}=sr("pricing"),[p,y]=N.useState(null),[g,b]=N.useState(null),[v,_]=N.useState(null),[C,S]=N.useState(null),[x,A]=N.useState(null),[I,$]=N.useState(null),[O,P]=N.useState(null),[j,U]=N.useState(!0),[z,D]=N.useState(null),[R,W]=N.useState(null),[T,L]=N.useState(null),[M,Z]=N.useState(null),[H,V]=N.useState(!1);N.useEffect(()=>{if(!e||!t){t||(_(null),S(null),A(null),$(null),P(null),U(!0));return}let te=!1;return S1t(t).then(ie=>{te||(_(ie.tier==="free"?null:ie.tier),S(ie.billingCycle),A(ie.status),$(ie.source),P(ie.trialEndAt),U(ie.trialEligible))}).catch(()=>{te||(_(null),S(null),A(null),$(null),P(null),U(!0))}),()=>{te=!0}},[e,t]);const F=N.useCallback(te=>{if(!u)return{label:f(te==="free"?"getStartedFree":"startTrial"),disabled:!1,icon:null};if(te==="free")return{label:f("getStartedFree"),disabled:!1,icon:null};if(!v||v==="free")return{label:f(j?"startTrial":`plans.${te}.cta`),disabled:!1,icon:null};if(v===te)return{label:f("currentPlan"),disabled:!0,icon:null};if(x==="trialing")return{label:f("manageTrial"),disabled:!1,icon:null};const ie=(hw[te]??0)>(hw[v]??0);return{label:ie?f("upgradeTo",{plan:m0(te)}):f("downgradeTo",{plan:m0(te)}),disabled:!1,icon:ie?"up":"down"}},[v,x,f,j,u]),q=!!(u&&j&&(!v||v==="free")&&x!=="trialing"),G=N.useCallback(async(te,ie)=>{b(null),D(null);const se=(ie==null?void 0:ie.skipTrial)===!0,pe=se||!j,Ce=n?"yearly":"monthly",xe=se?"skip_trial":j?"trial":"ineligible";if(te==="free"){if(!u){r==null||r("signup");return}i&&await i();return}if(se&&!q){b("This account cannot skip a trial from the current plan state.");return}const Te={plan:te,billingCycle:Ce,value:x1t(te,n),trialMode:xe,trialDays:xe==="trial"?7:void 0,entry_point:a,source_surface:o,onboarding_variant:l};if(R3e(Te),!u){r==null||r("signup");return}const Et=await gf();if(!Et){mh(Te,"authentication"),b("Session expired. Please sign in again.");return}if(v&&v!=="free"&&x==="trialing"&&I!=="airwallex"){y(te);try{const Ke=await fetch("/api/stripe-portal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accessToken:Et})}),Ge=await Ke.json();if(!Ke.ok)throw new Error(Ge.error||"Could not open trial management");Ge.url?(V3e({plan:v,billingCycle:C==="yearly"?"yearly":"monthly",trialMode:"trial",entry_point:a,source_surface:o,onboarding_variant:l}),window.location.href=Ge.url):mh(Te,"portal")}catch(Ke){mh(Te,"portal"),b(Ke.message||"Could not open trial management.")}finally{y(null)}return}if(v&&v!=="free"){const Ke=(hw[te]??0)>(hw[v]??0)?"upgrade":"downgrade";H3e({direction:Ke,currentPlan:v,targetPlan:te,billingCycle:Ce,trialMode:xe,entry_point:a,source_surface:o,onboarding_variant:l}),L(te),Z(null);try{const nn=await fetch(I==="airwallex"?"/api/airwallex-upgrade-preview":"/api/stripe-upgrade-preview",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plan:te,billingCycle:Ce,accessToken:Et})}),yr=await nn.json();if(!nn.ok)throw new Error(yr.error||"Failed to load plan details");W(yr)}
1216catch(Ge){mh(Te,"plan_change"),b(Ge.message||"Could not load plan change details.")}finally{L(null)}return}y(te);try{const Ke=await fetch("/api/stripe-checkout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"subscription",plan:te,billingCycle:Ce,accessToken:Et,...pe?{skipTrial:!0}:{}})}),Ge=await Ke.json();if(!Ke.ok)throw new Error(Ge.error||"Checkout failed");if(Ge.url){M3e(Te);try{sessionStorage.setItem("tx_pending_subscription",JSON.stringify(Te))}catch{}await(s==null?void 0:s(te)),window.location.href=Ge.url}else mh(Te,"redirect")}catch(Ke){mh(Te,"session_creation"),b(Ke.message||"Something went wrong. Please try again.")}finally{y(null)}},[C,v,q,a,n,s,i,r,I,u,o,x,j]),Y=N.useCallback(async()=>{if(R){V(!0),Z(null);try{const te=await gf();if(!te)throw new Error("Session expired. Please sign in again.");const se=await fetch(I==="airwallex"?"/api/airwallex-upgrade":"/api/stripe-upgrade",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plan:R.targetPlan,billingCycle:R.targetBillingCycle,accessToken:te,prorationDate:R.prorationDate})}),pe=await se.json();if(I!=="airwallex"&&se.status===402&&pe.error==="payment_action_required"&&pe.clientSecret){Z("Your bank requires additional verification. You will be redirected to complete payment.");const{loadStripe:Ce}=await Le(async()=>{const{loadStripe:Te}=await import("./index-BGiJ-87v.js");return{loadStripe:Te}},[]),xe=await Ce(A1t.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY);if(xe){const{error:Te}=await xe.confirmCardPayment(pe.clientSecret);if(Te)throw new Error(Te.message??"3D Secure verification failed")}}else if(!se.ok)throw new Error(pe.error||"Plan change failed");_(R.targetPlan),S(R.targetBillingCycle),D(R.isUpgrade?`Successfully upgraded to ${m0(R.targetPlan)}! Credits will be updated shortly.`:R.cycleChanging?`Successfully switched to ${m0(R.targetPlan)} ${m0(R.targetBillingCycle)}. Any account credit will be applied to your next invoice.`:`Successfully downgraded to ${m0(R.targetPlan)}. Your current plan remains active until ${R.currentPeriodEnd?new Date(R.currentPeriodEnd).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):"the end of the billing period"}.`),W(null)}catch(te){mh({plan:R.targetPlan,billingCycle:R.targetBillingCycle==="yearly"?"yearly":"monthly",value:R.amountDueNow/100,entry_point:a,source_surface:o},"plan_change"),Z(te.message||"Something went wrong. Please try again.")}finally{V(!1)}}},[a,I,R,o]),X=N.useCallback(()=>{W(null),Z(null)},[]);return{activePlan:v,activeBillingCycle:C,subscriptionStatus:x,trialEndAt:O,trialEligible:j,canSkipTrial:q,loadingPlan:p,checkoutError:g,setCheckoutError:b,upgradeSuccess:z,setUpgradeSuccess:D,preview:R,previewLoading:T,previewError:M,confirming:H,getPlanButtonState:F,handleSubscribe:G,handleConfirmUpgrade:Y,closePreview:X}}const Yr={1e3:{credits:1e3,amountCents:1200,label:"1,000 Credits"},2500:{credits:2500,amountCents:2800,label:"2,500 Credits"},6e3:{credits:6e3,amountCents:6e3,label:"6,000 Credits"},12e3:{credits:12e3,amountCents:10900,label:"12,000 Credits"},25e3:{credits:25e3,amountCents:2e4,label:"25,000 Credits"}};function T1t(t={}){const{successPath:e="/studio?topup=success",cancelPath:n="/studio?topup=cancelled",entryPoint:r="settings",sourceSurface:i="topup_grid"}=t,[s,a]=N.useState(null),[o,l]=N.useState(null),u=N.useCallback(async f=>{a(f),l(null);const p=Yr[f],y=(p==null?void 0:p.credits)??0,g=((p==null?void 0:p.amountCents)??0)/100,b={packageId:f,credits:y,value:g,entry_point:r,source_surface:i};j3e(b);try{const v=await gf();if(!v)throw TC(b,"authentication"),new Error("Session expired. Please sign in again.");const _=await fetch("/api/stripe-checkout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"topup",packageId:f,accessToken:v,successPath:e,cancelPath:n})}),C=await _.json();if(!_.ok)throw new Error(C.error||"Checkout failed");if(C.url){B3e(b);try{sessionStorage.setItem("tx_pending_topup",JSON.stringify(b))}catch{}window.location.href=C.url}else TC(b,"redirect")}catch(v){(v==null?void 0:v.message)!=="Session expired. Please sign in again."&&TC(b,"session_creation"),l({type:"error",text:(v==null?void 0:v.message)||"Something went wrong. Please try again."})}finally{a(null)}},[n,r,i,e]);return{checkoutLoading:s,topupMessage:o,setTopupMessage:l,handleTopup:u}}function L1t({title:t,body:e,imageSrc:n,triggerClassName:r="",children:i}){const[s,a]=N.useState(!1),[o,l]=N.useState({}),[u,f]=N.useState(!1),p=N.useRef(null),y=N.useRef(null),g=N.useRef(null),b=N.useRef(null),v=N.useRef("click"),_=N.useCallback(()=>typeof window>"u"?360:Math.min(360,window.innerWidth-24),[]),C=N.useCallback(()=>{g.current!==null&&(window.clearTimeout(g.current),g.current=null)},[]),S=N.useCallback(()=>{v.current==="hover"&&(C(),g.current=window.setTimeout(()=>{a(!1)},120))},[C]),x=N.useCallback(()=>
1216{if(!s||!p.current)return;const P=_(),j=b.current,U=p.current.closest("[data-pricing-plan-card]"),z=U instanceof HTMLElement?U.getBoundingClientRect():p.current.getBoundingClientRect(),D=p.current.getBoundingClientRect(),R=(j==null?void 0:j.y)||D.bottom,W=12,T=Math.min(Math.max(12,z.left),window.innerWidth-P-12),L=R>window.innerHeight/2;l({left:T,top:R,transform:L?`translateY(calc(-100% - ${W}px))`:`translateY(${W}px)`,width:P,maxHeight:"min(560px, calc(100vh - 24px))"}),f(!0)},[_,s]);N.useEffect(()=>{if(!s)return;const P=window.requestAnimationFrame(x),j=()=>x(),U=D=>{var W,T;const R=D.target;R&&((W=p.current)!=null&&W.contains(R)||(T=y.current)!=null&&T.contains(R)||a(!1))},z=D=>{D.key==="Escape"&&a(!1)};return window.addEventListener("resize",j),window.addEventListener("scroll",j,!0),document.addEventListener("pointerdown",U),document.addEventListener("keydown",z),()=>{window.cancelAnimationFrame(P),window.removeEventListener("resize",j),window.removeEventListener("scroll",j,!0),document.removeEventListener("pointerdown",U),document.removeEventListener("keydown",z)}},[s,x]),N.useEffect(()=>()=>C(),[C]);const A=P=>{v.current==="hover"&&P.detail>0||(v.current="click",b.current=P.clientX||P.clientY?{x:P.clientX,y:P.clientY}:null,C(),f(!1),a(j=>!j))},I=N.useCallback(P=>{P.pointerType==="mouse"&&(v.current="hover",b.current={x:P.clientX,y:P.clientY},C(),f(!1),a(!0))},[C]),$=N.useCallback(P=>{P.pointerType!=="mouse"||!s||(b.current={x:P.clientX,y:P.clientY},x())},[s,x]),O=N.useCallback(P=>{P.pointerType==="mouse"&&S()},[S]);return h.jsxs("span",{ref:p,className:"inline-flex",onPointerEnter:I,onPointerMove:$,onPointerLeave:O,children:[h.jsx("button",{type:"button",onClick:A,"aria-expanded":s,"aria-label":t,className:`inline text-left underline decoration-dotted underline-offset-4 transition-colors cursor-help ${r}`,children:i}),s&&typeof document<"u"?yu.createPortal(h.jsxs("div",{ref:y,style:{...o,width:_(),visibility:u?"visible":"hidden"},className:`fixed z-[999] overflow-hidden rounded-2xl border border-gray-200 bg-white text-left shadow-2xl dark:border-white/10 dark:bg-[#10111f] ${v.current==="hover"?"pointer-events-none":""}`,children:[n?h.jsx("div",{className:"h-44 w-full overflow-hidden border-b border-gray-100 dark:border-white/10",children:h.jsx("img",{src:n,alt:t,className:"h-full w-full object-cover"})}):null,h.jsxs("div",{className:"p-4",children:[h.jsx("div",{className:"text-sm font-black text-gray-950 dark:text-white",children:t}),h.jsx("div",{className:"mt-2 space-y-2",children:e.map(P=>h.jsx("p",{className:"text-xs leading-relaxed text-gray-600 dark:text-gray-300",children:P},P))})]})]}),document.body):null]})}function Bd(t){return`$${(t/100).toFixed(2)}`}function NA(t){if(!t)return"â";const e=new Date(t);return Number.isNaN(e.getTime())?"â":e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}function Ta(t){return t.charAt(0).toUpperCase()+t.slice(1)}function $1t(t,e){var r;const n=e?(r=Nue(e))==null?void 0:r.highlightOnPlan:void 0;return n!==t?"":n==="pro"?"text-sky-600 dark:text-sky-300":n==="max"?"text-violet-600 dark:text-violet-300":n==="elite"?"text-amber-600 dark:text-amber-300":""}function I1t({planId:t,featureId:e,label:n}){var u;const{t:r}=sr("pricing"),i=e?Nue(e):void 0,a=`text-gray-700 dark:text-gray-300 ${$1t(t,e)}`;if(!(i!=null&&i.tooltipBodyKey)||!((u=i.defaultTooltipBody)!=null&&u.length))return h.jsx("span",{className:a,children:n});const o=r(i.tooltipTitleKey,{defaultValue:i.defaultTooltipTitle??n}),l=r(i.tooltipBodyKey,{returnObjects:!0,defaultValue:[...i.defaultTooltipBody]});return h.jsx(L1t,{title:o,body:l,imageSrc:i.imageSrc,triggerClassName:`${a} decoration-gray-400/90 dark:decoration-white/30 hover:text-gray-900 dark:hover:text-white`,children:n})}function N1t(t){switch(t.icon){case"star":return l8;case"crown":return xJ;case"gem":return EJ;case"zap":default:return bu}}function O1t({isAnnual:t,setIsAnnual:e}){const{t:n}=sr("pricing");return h.jsx("div",{className:"flex justify-center mb-7",children:h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs("div",{className:"relative flex bg-gray-100 dark:bg-white/[0.05] border border-gray-200 dark:border-white/[0.08] rounded-full p-1",children:[h.jsx("div",{className:`absolute top-1 bottom-1 w-[calc(50%-4px)] rounded-full bg-gray-900 dark:bg-white transition-transform duration-300 ease-out ${t?"translate-x-[calc(100%+2px)]":"translate-x-[2px]"}`}),h.jsx("button",{onClick:()=>e(!1),className:`relative z-10 w-28 py-2 text-sm font-semibold rounded-full transition-colors ${t?"text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white":"text-white dark:text-black"}`,children:n("toggle.monthly")}),h.jsx("button",{onClick:()=>e(!0),className:`relative z-10 w-28 py-2 text-sm font-semibold rounded-full transition-colors ${t?"text-white dark:text-black":"text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white"}`,children:n("toggle.yearly")})]}),h.jsx("div",{className:`transition-all duration-300 ${t?"opacity-100 translate-x-0":"opacity-0 -translate-x-2 pointer-events-none"}`,children:h.jsx("span",{className:"text-xs font-bold text-emerald-600 dark:text-emerald-400 bg-emerald-500/10 border border-emerald-500/20 px-2.5 py-1 rounded-full",children:n("saveBadge")})})]})})}
1216function P1t({plan:t,isAnnual:e,isLoading:n,isPreviewLoading:r,isCurrent:i,showSkipTrial:s,buttonState:a,onSubscribe:o,onSkipTrial:l}){const{t:u}=sr("pricing"),f=N1t(t),p=t.id==="free",y=e?t.yearlyPrice:t.monthlyPrice,g=Math.max(t.monthlyPrice*12-t.yearlyTotal,0),b=!p&&e&&g>0,v=u("yearSave",{amount:"__AMOUNT__"}),[_,C=""]=v.split("__AMOUNT__"),S=u(`features.${t.id}`,{returnObjects:!0,defaultValue:[...t.features]});return h.jsxs("div",{"data-pricing-plan-card":!0,className:`relative flex w-[82vw] max-w-[320px] shrink-0 snap-center flex-col rounded-2xl border p-6 transition-colors sm:w-auto sm:max-w-none sm:min-w-0 sm:shrink ${t.borderClass} ${t.glowClass} ${i?"ring-2 ring-violet-500/40":""} ${t.highlight?"bg-violet-50/60 dark:bg-[#0f0b1a]":"bg-white hover:bg-gray-50 dark:bg-[#0d0d0d] dark:hover:bg-[#111]"}`,children:[i?h.jsx("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2",children:h.jsx("span",{className:"text-[10px] font-bold uppercase tracking-widest bg-emerald-500 text-white px-3 py-1 rounded-full whitespace-nowrap",children:u("active")})}):t.badge?h.jsx("div",{className:"absolute -top-3 left-6",children:h.jsx("span",{className:"text-[10px] font-bold uppercase tracking-widest bg-violet-500 text-white px-3 py-1 rounded-full whitespace-nowrap",children:u(`plans.${t.id}.badge`,{defaultValue:t.badge})})}):null,b?h.jsx("div",{className:"absolute right-0 top-0",children:h.jsxs("span",{className:"inline-flex items-center rounded-bl-xl rounded-tr-2xl border-b border-l border-black/10 bg-white/95 px-2.5 py-1 text-[11px] font-semibold tracking-wide whitespace-nowrap text-gray-700 dark:border-white/10 dark:bg-[#121212]/95 dark:text-gray-200",children:[h.jsx("span",{className:"bg-gradient-to-r from-blue-500 via-sky-400 to-blue-400 bg-clip-text text-transparent",children:_}),h.jsxs("span",{className:"mx-0.5 text-[17px] font-bold leading-none bg-gradient-to-r from-blue-500 via-sky-400 to-blue-400 bg-clip-text text-transparent",children:["$",g]}),h.jsx("span",{children:C})]})}):null,h.jsxs("div",{className:"mb-5 flex items-start gap-3",children:[h.jsx("div",{className:`w-9 h-9 rounded-xl flex items-center justify-center shrink-0 ${t.highlight?"bg-violet-500/15":"bg-gray-100 dark:bg-white/[0.05]"}`,children:h.jsx(f,{className:`w-5 h-5 ${t.accentClass}`})}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("h3",{className:`mb-0.5 text-base font-bold ${t.accentClass} ${b?"pr-14":""}`,children:u(`plans.${t.id}.name`)}),h.jsx("p",{className:"whitespace-nowrap text-xs text-gray-500 leading-snug",children:u(`plans.${t.id}.description`)})]})]}),h.jsx("div",{className:"mb-5",children:p?h.jsxs("div",{className:"flex items-baseline gap-1",children:[h.jsx("span",{className:"text-4xl font-bold text-gray-900 dark:text-white",children:"$0"}),h.jsx("span",{className:"text-sm text-gray-500",children:u("perMonth")})]}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"flex items-end gap-3",children:h.jsxs("div",{className:"flex items-baseline gap-1",children:[e&&h.jsxs("span",{className:"text-lg text-gray-400 dark:text-gray-600 line-through mr-1",children:["$",t.monthlyPrice]}),h.jsxs("span",{className:"text-4xl font-bold text-gray-900 dark:text-white",children:["$",y]}),h.jsx("span",{className:"text-sm text-gray-500",children:u("perMonth")})]})}),e&&t.yearlyTotal>0?h.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:u("billedAnnuallyFull",{total:t.yearlyTotal})}):h.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:u("billedMonthly")})]})}),h.jsx("button",{onClick:()=>void o(t.id),disabled:n||r||a.disabled,className:`w-full flex items-center justify-center gap-2 py-2.5 rounded-xl text-sm font-bold transition-colors disabled:opacity-50 ${s?"mb-2":"mb-6"} ${a.disabled?"bg-gray-100 text-gray-500 border border-gray-200 dark:bg-white/[0.05] dark:text-gray-500 dark:border-white/[0.08] cursor-not-allowed":t.highlight?"bg-violet-500 text-white hover:bg-violet-400":p?"bg-gray-100 text-gray-700 hover:bg-gray-200 border border-gray-200 dark:bg-white/[0.07] dark:text-white dark:hover:bg-white/[0.12] dark:border-white/[0.08]":"bg-gray-900 text-white hover:bg-gray-700 dark:bg-white dark:text-black dark:hover:bg-gray-100"}`,children:n||r?h.jsx(sI,{className:"w-4 h-4 animate-spin"}):h.jsxs(h.Fragment,{children:[a.icon==="up"?h.jsx(_J,{className:"w-3.5 h-3.5"}):null,a.icon==="down"?h.jsx(vJ,{className:"w-3.5 h-3.5"}):null,a.label]})}),s?h.jsx("button",{type:"button",onClick:()=>void l(t.id),disabled:n||r,className:"mb-5 w-full text-center text-xs font-medium text-sky-600 transition-colors hover:text-sky-500 hover:underline disabled:cursor-not-allowed disabled:opacity-50 dark:text-sky-400 dark:hover:text-sky-300",children:u("skipTrialPayNow")}):null,h.jsxs("ul",{className:"space-y-2.5 flex-1",children:[S.map((x,A)=>h.jsxs("li",{className:"flex items-start gap-2.5 text-sm",children:[h.jsx(t7,{className:`w-4 h-4 mt-0.5 shrink-0 ${t.highlight?"text-violet-400":"text-gray-500 dark:text-gray-400"}`}
1216),h.jsx(I1t,{planId:t.id,featureId:t.featureIds[A],label:x})]},A)),t.missing.map((x,A)=>h.jsxs("li",{className:"flex items-start gap-2.5 text-sm",children:[h.jsx(ml,{className:"w-4 h-4 mt-0.5 shrink-0 text-gray-300 dark:text-white/[0.12]"}),h.jsx("span",{className:"text-gray-400 dark:text-gray-600",children:x})]},`x-${A}`))]})]})}function R1t({preview:t,previewError:e,confirming:n,onClose:r,onConfirm:i}){return t?h.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/60 backdrop-blur-sm",children:h.jsxs("div",{className:"w-full max-w-md bg-white dark:bg-[#111] rounded-2xl border border-gray-200 dark:border-white/[0.1] shadow-2xl overflow-hidden",children:[h.jsxs("div",{className:`px-6 pt-6 pb-4 border-b border-gray-100 dark:border-white/[0.06] ${t.isUpgrade?"bg-violet-50/60 dark:bg-violet-500/5":"bg-amber-50/60 dark:bg-amber-500/5"}`,children:[h.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[t.isUpgrade?h.jsx(_J,{className:"w-5 h-5 text-violet-500"}):h.jsx(vJ,{className:"w-5 h-5 text-amber-500"}),h.jsx("h2",{className:"text-base font-bold text-gray-900 dark:text-white",children:t.isUpgrade?"Confirm Upgrade":"Confirm Downgrade"})]}),h.jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:[Ta(t.currentPlan)," â ",Ta(t.targetPlan)," ",h.jsxs("span",{className:"text-xs",children:["(",t.targetBillingCycle==="yearly"?"Annual":"Monthly",")"]})]})]}),h.jsxs("div",{className:"px-6 py-5 space-y-3",children:[h.jsxs("div",{className:"flex items-center justify-between rounded-xl bg-gray-50 dark:bg-white/[0.04] border border-gray-200 dark:border-white/[0.06] px-4 py-3",children:[h.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Current plan"}),h.jsxs("div",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:[Ta(t.currentPlan)," â $",t.currentMonthlyPrice,"/mo",t.currentBillingCycle==="yearly"?h.jsx("span",{className:"ml-1 text-xs font-normal text-gray-400",children:"(annual)"}):null]})]}),h.jsxs("div",{className:"flex items-start justify-between rounded-xl bg-gray-50 dark:bg-white/[0.04] border border-gray-200 dark:border-white/[0.06] px-4 py-3 gap-3",children:[h.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400 shrink-0",children:"New plan"}),h.jsxs("div",{className:`text-sm font-semibold text-right ${t.isUpgrade?"text-violet-500":"text-amber-500"}`,children:[Ta(t.targetPlan)," â $",t.targetMonthlyPrice,"/mo",t.targetBillingCycle==="yearly"?h.jsxs("span",{className:"block text-xs font-normal text-gray-400 mt-0.5",children:["Billed annually · ",Bd(t.targetAnnualTotal??t.nextBillingAmount),"/yr"]}):h.jsx("span",{className:"block text-xs font-normal text-gray-400 mt-0.5",children:"Billed monthly"})]})]}),h.jsx("div",{className:"border-t border-gray-100 dark:border-white/[0.06] pt-3 space-y-2.5",children:t.isUpgrade?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"flex items-start justify-between gap-3",children:[h.jsxs("span",{className:"text-sm text-gray-600 dark:text-gray-400 leading-snug",children:["Charged today",h.jsx("span",{className:"block text-xs text-gray-400 dark:text-gray-600",children:t.amountDueNow===0&&t.creditBalance>0?`No charge â unused ${t.currentBillingCycle==="yearly"?"annual":"monthly"} credit exceeds new plan cost`:t.cycleChanging?`Full ${t.targetBillingCycle==="yearly"?"annual":"monthly"} period, minus unused ${t.currentBillingCycle==="yearly"?"annual":"monthly"} credit`:"Prorated for the remainder of this billing period"})]}),h.jsx("span",{className:"text-sm font-bold text-gray-900 dark:text-white whitespace-nowrap",children:t.amountDueNow>0?Bd(t.amountDueNow):"$0.00"})]}),t.creditBalance>0?h.jsxs("div",{className:"flex items-start gap-2.5 p-3 rounded-xl bg-violet-500/8 border border-violet-500/20",children:[h.jsx(e4,{className:"w-4 h-4 text-violet-400 shrink-0 mt-0.5"}),h.jsxs("p",{className:"text-xs text-violet-700 dark:text-violet-300 leading-relaxed",children:[h.jsxs("span",{className:"font-semibold",children:[Bd(t.creditBalance)," credit"]})," will be added to your account balance and automatically applied to future invoices."]})]}):null,h.jsxs("div",{className:"flex items-start justify-between gap-3",children:[h.jsxs("span",{className:"text-sm text-gray-600 dark:text-gray-400 leading-snug",children:["Next billing date",h.jsxs("span",{className:"block text-xs text-gray-400 dark:text-gray-600",children:[NA(t.nextBillingDate),t.cycleChanging?h.jsxs("span",{className:"ml-1",children:["(",t.targetBillingCycle==="yearly"?"1 year from today":"1 month from today",")"]}):null]})]}),h.jsx("span",{className:"text-sm font-semibold text-gray-900 dark:text-white whitespace-nowrap",children:Bd(t.nextBillingAmount)})]})]}):t.cycleChanging?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"flex items-start gap-2.5 p-3 rounded-xl bg-amber-500/8 border border-amber-500/20",children:[h.jsx(e4,{className:"w-4 h-4 text-amber-500 shrink-0 mt-0.5"}),h.jsxs("p",{className:"text-xs text-amber-700 dark:text-amber-400 leading-relaxed",children:["Your plan switches ",h.jsx("span",{className:"font-semibold",children:"immediately"})," to ",Ta(t.targetPlan)," ",Ta(t.targetBillingCycle),".",t.creditBalance>0?h.jsxs(h.Fragment,{children:[" A credit of ",h.jsx("span",{className:"font-semibold",children:Bd(t.creditBalance)}
1216)," for your unused ",Ta(t.currentBillingCycle)," plan will be added to your account and automatically applied to future invoices."]}):null]})]}),h.jsxs("div",{className:"flex items-start justify-between gap-3",children:[h.jsxs("span",{className:"text-sm text-gray-600 dark:text-gray-400 leading-snug",children:["Charged today",t.amountDueNow>0?h.jsxs("span",{className:"block text-xs text-gray-400 dark:text-gray-600",children:[Ta(t.targetPlan)," ",Ta(t.targetBillingCycle)," minus unused ",Ta(t.currentBillingCycle)," credit"]}):null]}),h.jsx("span",{className:"text-sm font-bold text-gray-900 dark:text-white whitespace-nowrap",children:t.amountDueNow>0?Bd(t.amountDueNow):"$0.00"})]}),h.jsxs("div",{className:"flex items-start justify-between gap-3",children:[h.jsxs("span",{className:"text-sm text-gray-600 dark:text-gray-400 leading-snug",children:["Next billing date",h.jsxs("span",{className:"block text-xs text-gray-400 dark:text-gray-600",children:[NA(t.nextBillingDate),h.jsxs("span",{className:"ml-1",children:["(",t.targetBillingCycle==="yearly"?"1 year from today":"1 month from today",")"]})]})]}),h.jsx("span",{className:"text-sm font-semibold text-gray-900 dark:text-white whitespace-nowrap",children:Bd(t.nextBillingAmount)})]})]}):h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"flex items-start gap-2.5 p-3 rounded-xl bg-amber-500/8 border border-amber-500/20",children:[h.jsx(e4,{className:"w-4 h-4 text-amber-500 shrink-0 mt-0.5"}),h.jsxs("p",{className:"text-xs text-amber-700 dark:text-amber-400 leading-relaxed",children:["Your ",Ta(t.currentPlan)," plan remains active until ",h.jsx("span",{className:"font-semibold",children:NA(t.currentPeriodEnd)}),". After that, you'll be billed"," ",t.targetBillingCycle==="yearly"?h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:"font-semibold",children:[Bd(t.nextBillingAmount),"/yr"]})," (",Ta(t.targetPlan)," Annual)"]}):h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:"font-semibold",children:["$",t.targetMonthlyPrice,"/mo"]})," (",Ta(t.targetPlan)," Monthly)"]}),"."]})]}),h.jsxs("div",{className:"flex items-start justify-between gap-3",children:[h.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Charged today"}),h.jsx("span",{className:"text-sm font-bold text-gray-900 dark:text-white",children:"$0.00"})]})]})}),e?h.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-red-500/10 border border-red-500/20 text-red-500 dark:text-red-400 text-xs",children:[h.jsx(e4,{className:"w-3.5 h-3.5 shrink-0"}),e]}):null]}),h.jsxs("div",{className:"px-6 pb-6 flex gap-3",children:[h.jsx("button",{onClick:r,disabled:n,className:"flex-1 py-2.5 rounded-xl text-sm font-semibold border border-gray-200 dark:border-white/[0.1] text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-white/[0.05] transition-colors disabled:opacity-50",children:"Cancel"}),h.jsx("button",{onClick:()=>void i(),disabled:n,className:`flex-1 py-2.5 rounded-xl text-sm font-bold text-white transition-colors disabled:opacity-50 flex items-center justify-center gap-2 ${t.isUpgrade?"bg-violet-500 hover:bg-violet-400":"bg-amber-500 hover:bg-amber-400"}`,children:n?h.jsxs(h.Fragment,{children:[h.jsx(nme,{className:"w-4 h-4 animate-spin"}),"Processingâ¦"]}):t.isUpgrade?"Confirm Upgrade":"Confirm Downgrade"})]})]})}):null}function j1t({isAnnual:t,setIsAnnual:e,loadingPlan:n,previewLoading:r,activePlan:i,canSkipTrial:s,getPlanButtonState:a,onSubscribe:o,onSkipTrial:l,showFreePlan:u=!0}){const f=N.useRef(null),p=N.useRef(null),y=u?W$:W$.filter(g=>g.id!=="free");return N.useEffect(()=>{const g=f.current,b=p.current;if(!g||!b||g.scrollWidth<=g.clientWidth)return;const v=b.offsetLeft,_=b.offsetWidth,C=g.clientWidth;g.scrollLeft=v-(C-_)/2},[]),h.jsxs(h.Fragment,{children:[h.jsx(O1t,{isAnnual:t,setIsAnnual:e}),h.jsx("div",{ref:f,className:`mb-4 -mx-4 flex gap-4 overflow-x-auto px-4 pt-1 pb-3 no-scrollbar snap-x snap-mandatory sm:mx-0 sm:grid sm:grid-cols-2 sm:overflow-x-visible sm:px-0 sm:pt-1 sm:pb-0 ${u?"xl:grid-cols-4":"xl:grid-cols-3"}`,children:y.map(g=>h.jsx("div",{ref:g.id==="max"?p:void 0,children:h.jsx(P1t,{plan:g,isAnnual
1216:t,isLoading:n===g.id,isPreviewLoading:r===g.id,isCurrent:i===g.id,showSkipTrial:s&&g.id!=="free",buttonState:a(g.id),onSubscribe:o,onSkipTrial:l})},g.id))})]})}function M1t({isAnnual:t,setIsAnnual:e,loadingPlan:n,previewLoading:r,activePlan:i,canSkipTrial:s,checkoutError:a,upgradeSuccess:o,preview:l,previewError:u,confirming:f,getPlanButtonState:p,onSubscribe:y,onSkipTrial:g,onConfirmUpgrade:b,onClosePreview:v,showTrustLine:_=!0,showFreePlan:C=!0}){const{t:S}=sr("pricing");return h.jsxs(h.Fragment,{children:[h.jsx(j1t,{isAnnual:t,setIsAnnual:e,loadingPlan:n,previewLoading:r,activePlan:i,canSkipTrial:s,getPlanButtonState:p,onSubscribe:y,onSkipTrial:g,showFreePlan:C}),h.jsx(R1t,{preview:l,previewError:u,confirming:f,onClose:v,onConfirm:b}),o?h.jsx("div",{className:"max-w-xl mx-auto mb-8 px-4 py-3 rounded-xl bg-emerald-500/10 border border-emerald-500/20 text-emerald-600 dark:text-emerald-400 text-sm text-center",children:o}):null,a?h.jsx("div",{className:"max-w-md mx-auto mb-8 px-4 py-3 rounded-xl bg-red-500/10 border border-red-500/20 text-red-500 dark:text-red-400 text-sm text-center",children:a}):null,_?h.jsx("p",{className:"text-center text-xs text-gray-400 dark:text-gray-600 mb-20",children:S("trustLine")}):null]})}function fw(t){return`$${(t/100).toFixed(0)}`}function pw(t,e){return`$${(t/100/e).toFixed(3)} / credit`}const D1t=[{id:"1000",credits:Yr[1e3].credits,amountCents:Yr[1e3].amountCents,price:fw(Yr[1e3].amountCents),priceNote:pw(Yr[1e3].amountCents,Yr[1e3].credits),icon:"zap"},{id:"2500",credits:Yr[2500].credits,amountCents:Yr[2500].amountCents,price:fw(Yr[2500].amountCents),priceNote:pw(Yr[2500].amountCents,Yr[2500].credits),icon:"star",highlight:!0,badgeKey:"mostPopular"},{id:"6000",credits:Yr[6e3].credits,amountCents:Yr[6e3].amountCents,price:fw(Yr[6e3].amountCents),priceNote:pw(Yr[6e3].amountCents,Yr[6e3].credits),icon:"crown"},{id:"12000",credits:Yr[12e3].credits,amountCents:Yr[12e3].amountCents,price:fw(Yr[12e3].amountCents),priceNote:pw(Yr[12e3].amountCents,Yr[12e3].credits),icon:"gem",discountLabel:"10% OFF"}],U1t={zap:bu,star:l8,crown:xJ,gem:EJ};function B1t({title:t,description:e,message:n,translateMessage:r,checkoutLoading:i,onTopup:s,className:a="",packages:o=D1t}){const{t:l}=sr("settings");return h.jsxs("div",{className:a,children:[t?h.jsx("h3",{className:"text-sm font-semibold text-gray-700 dark:text-gray-300 mb-2",children:t}):null,e?h.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mb-4 leading-relaxed",children:e}):null,n?h.jsxs("div",{className:`mb-4 flex items-center gap-2 rounded-lg border p-3 text-sm ${n.type==="success"?"bg-emerald-50 text-emerald-700 border-emerald-200 dark:bg-emerald-500/10 dark:text-emerald-400 dark:border-emerald-500/20":"bg-red-50 text-red-600 border-red-200 dark:bg-red-500/10 dark:text-red-400 dark:border-red-500/20"}`,children:[n.type==="success"?h.jsx(iI,{className:"w-4 h-4 shrink-0"}):h.jsx(ml,{className:"w-4 h-4 shrink-0"}),r?r(n.text):n.text]}):null,h.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:o.map(u=>{const f=U1t[u.icon],p=i===u.id;return h.jsxs("div",{className:`relative rounded-xl border p-4 flex flex-col gap-3 transition-colors bg-white dark:bg-[#111] ${u.highlight?"border-gray-800 bg-gray-50 dark:border-white/25 dark:bg-white/[0.04]":"border-gray-200 hover:border-gray-300 dark:border-white/[0.06] dark:hover:border-white/[0.14]"}`,children:[u.badgeKey?h.jsx("span",{className:"absolute -top-2.5 left-1/2 -translate-x-1/2 whitespace-nowrap rounded-full bg-gray-900 px-2.5 py-0.5 text-[9px] font-bold uppercase tracking-wider text-white dark:bg-white dark:text-gray-900",children:l(`plan.${u.badgeKey}`)}):null,h.jsx("div",{className:"w-8 h-8 rounded-lg bg-gray-100 dark:bg-white/[0.07] flex items-center justify-center",children:h.jsx(f,{className:"w-4 h-4 text-gray-600 dark:text-gray-300"})}),h.jsxs("div",{children:[h.jsx("div",{className:"text-lg font-bold text-gray-900 dark:text-white",children:u.price}),h.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 text-sm text-gray-700 dark:text-gray-300",children:[u.credits.toLocaleStr
1216ing()," ",l("plan.credits"),u.discountLabel?h.jsx("span",{className:"rounded border border-emerald-200 bg-emerald-50 px-1.5 py-0.5 text-[10px] font-semibold text-emerald-600 dark:border-emerald-500/20 dark:bg-emerald-500/10 dark:text-emerald-400",children:u.discountLabel}):null]}),h.jsx("div",{className:"text-xs text-gray-400 mt-0.5",children:u.priceNote})]}),h.jsx("button",{onClick:()=>void s(u.id),disabled:!!i,className:`mt-auto flex w-full items-center justify-center gap-1.5 rounded-lg py-2 text-sm font-semibold transition-colors disabled:opacity-50 ${u.highlight?"bg-gray-900 text-white hover:bg-gray-700 dark:bg-white dark:text-gray-900 dark:hover:bg-gray-100":"bg-gray-100 text-gray-700 hover:bg-gray-200 dark:bg-white/[0.07] dark:text-gray-200 dark:hover:bg-white/[0.14]"}`,children:p?h.jsx(sI,{className:"w-4 h-4 animate-spin"}):h.jsxs(h.Fragment,{children:[h.jsx(CJ,{className:"w-3.5 h-3.5"}),l("plan.buyNow")]})})]},u.id)})}),h.jsx("p",{className:"mt-3 text-center text-xs text-gray-400",children:l("plan.securePayment")})]})}function F1t({isOpen:t,onClose:e,variant:n="credits"}){const{t:r}=sr("pricing"),{t:i}=sr("settings"),{user:s}=fc(),[a,o]=N.useState(!1),{activePlan:l,canSkipTrial:u,loadingPlan:f,checkoutError:p,upgradeSuccess:y,preview:g,previewLoading:b,previewError:v,confirming:_,getPlanButtonState:C,handleSubscribe:S,handleConfirmUpgrade:x,closePreview:A}=k1t({userId:(s==null?void 0:s.id)??null,enabled:t,isAnnual:a,entryPoint:"studio_paywall",sourceSurface:"modal"}),{checkoutLoading:I,topupMessage:$,setTopupMessage:O,handleTopup:P}=T1t({successPath:"/studio?topup=success",cancelPath:"/studio?paywall=1&topup=cancelled",entryPoint:"studio_paywall",sourceSurface:"topup_grid"});return N.useEffect(()=>{if(!t)return;if(z3e({requiredPlan:"paid",objectType:n==="upgrade"?"feature":"credits",objectId:n==="upgrade"?"user_menu_upgrade":"studio_credits",entry_point:"studio_paywall",source_surface:"modal"}),new URLSearchParams(window.location.search).get("topup")==="cancelled"){O({type:"error",text:"__topupCancelled"});try{const U=JSON.parse(sessionStorage.getItem("tx_pending_topup")||"null");U&&F3e(U),sessionStorage.removeItem("tx_pending_topup")}catch{}return}O(null)},[t,O,n]),t?h.jsx("div",{className:"fixed inset-0 z-[200] flex items-stretch justify-stretch bg-black/60 backdrop-blur-sm sm:items-center sm:justify-center sm:p-4",children:h.jsxs("div",{className:"relative flex h-full w-full flex-col overflow-hidden bg-white px-5 pt-[max(24px,env(safe-area-inset-top))] pb-[max(20px,env(safe-area-inset-bottom))] dark:bg-zinc-950 sm:h-auto sm:max-w-6xl sm:max-h-[calc(100vh-32px)] sm:rounded-2xl sm:border sm:border-gray-200 sm:px-6 sm:py-8 sm:shadow-2xl dark:sm:border-white/10 md:px-8",children:[h.jsx("button",{onClick:e,className:"absolute right-4 top-[max(16px,env(safe-area-inset-top))] rounded-lg p-1.5 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-white/10 dark:hover:text-white sm:top-4",children:h.jsx(ml,{className:"w-4 h-4"})}),h.jsxs("div",{className:"flex min-h-0 flex-1 flex-col sm:max-h-[calc(100vh-32px-64px)]",children:[h.jsxs("div",{className:"shrink-0",children:[h.jsxs("div",{className:"flex items-center justify-center gap-3 mb-2",children:[n==="credits"&&h.jsx("div",{className:"w-10 h-10 rounded-full bg-amber-500/10 flex items-center justify-center shrink-0",children:h.jsx("svg",{className:"w-5 h-5 text-amber-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"})})}),h.jsx("h2",{className:"text-xl md:text-2xl font-bold text-gray-900 dark:text-white text-center",children:r(n==="upgrade"?"paywall.upgradeTitle":"paywall.creditsTitle")})]}),h.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mb-8 leading-relaxed text-center max-w-xl mx-auto",children:r(n==="upgrade"?"paywall.upgradeSubtitle":"paywall.creditsSubtitle")})]}),h.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto scrollbar-subtle pr-1",children:[h.jsx(M1t,{isAnnual
1216:a,setIsAnnual:o,loadingPlan:f,previewLoading:b,activePlan:l,canSkipTrial:u,checkoutError:p,upgradeSuccess:y,preview:g,previewError:v,confirming:_,getPlanButtonState:C,onSubscribe:S,onSkipTrial:j=>S(j,{skipTrial:!0}),onConfirmUpgrade:x,onClosePreview:A,showTrustLine:!1}),h.jsx("div",{className:"mt-10 border-t border-gray-200 dark:border-white/10 pt-8",children:h.jsx(B1t,{title:r("topup.title"),message:$,translateMessage:j=>({__topupCancelled:i("plan.topupCancelled")})[j]??j,checkoutLoading:I,onTopup:P})}),h.jsx("button",{onClick:e,className:"mt-6 w-full py-1 text-sm text-gray-500 transition-colors hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:r("paywall.maybeLater")})]})]})]})}):null}const z1t={free:"bg-gray-100 text-gray-600 dark:bg-white/10 dark:text-gray-300",pro:"bg-sky-500/10 text-sky-600 border border-sky-500/20 dark:text-sky-400",max:"bg-violet-500/10 text-violet-600 border border-violet-500/20 dark:text-violet-400",elite:"bg-amber-500/10 text-amber-600 border border-amber-500/20 dark:text-amber-400"},V1t=[{tab:"profile",icon:TJ},{tab:"plan",icon:k1e},{tab:"usage",icon:u1e},{tab:"apiKeys",icon:H1e},{tab:"feedback",icon:SJ},{tab:"settings",icon:kJ}],H1t=({className:t="w-4 h-4"})=>h.jsx("svg",{viewBox:"0 0 24 24",className:t,fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-4.714-6.231-5.401 6.231H2.748l7.73-8.835L1.254 2.25H8.08l4.253 5.622 5.911-5.622zm-1.161 17.52h1.833L7.084 4.126H5.117z"})}),W1t=({className:t="w-4 h-4"})=>h.jsx("svg",{viewBox:"0 0 24 24",className:t,fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057c.002.022.015.043.03.056a19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028 14.09 14.09 0 0 0 1.226-1.994.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z"})}),q1t=({className:t="w-4 h-4"})=>h.jsx("svg",{viewBox:"0 0 24 24",className:t,fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a.59.59 0 0 1 .213.665l-.39 1.48c-.019.07-.048.141-.048.213 0 .163.13.295.29.295a.326.326 0 0 0 .167-.054l1.903-1.114a.803.803 0 0 1 .533-.117c.11.016.22.025.332.025.348 0 .686-.04 1.014-.113a8.9 8.9 0 0 1-.29-2.205c0-3.87 3.63-7.007 8.107-7.007.29 0 .576.016.856.044C14.86 3.98 12.04 2.188 8.691 2.188zm-2.32 4.695c.615 0 1.114.499 1.114 1.114 0 .615-.5 1.114-1.114 1.114-.615 0-1.114-.5-1.114-1.114 0-.615.499-1.114 1.114-1.114zm4.64 0c.615 0 1.114.499 1.114 1.114 0 .615-.5 1.114-1.114 1.114-.615 0-1.114-.5-1.114-1.114 0-.615.499-1.114 1.114-1.114zM22.5 14.105c0-3.305-3.206-5.988-7.16-5.988-3.955 0-7.16 2.683-7.16 5.988s3.205 5.988 7.16 5.988c.638 0 1.256-.07 1.843-.2a.69.69 0 0 1 .458.1l1.636.957a.28.28 0 0 0 .144.047.254.254 0 0 0 .25-.254c0-.062-.025-.123-.041-.183l-.335-1.272a.507.507 0 0 1 .183-.57c1.575-1.157 2.582-2.87 2.582-4.613zm-9.54-1.14c-.528 0-.956-.428-.956-.956s.428-.956.956-.956.956.428.956.956-.428.956-.956.956zm4.76 0c-.528 0-.956-.428-.956-.956s.428-.956.956-.956.956.428.956.956-.428.956-.956.956z"})}),Z1t=({onNavigate:t})=>{var q;const{user:e,signOut:n}=fc(),{profile:r}=gX(),i=Bu(),s=Vf(),{balance:a,subscriptionTier:o}=v1t(),{t:l}=sr(["settings","common","pricing"]),[u,f]=N.useState(!1),[p,y]=N.useState(!1),[g,b]=N.useState(!1),[v,_]=N.useState(!1),[C,S]=N.useState({left:0,bottom:0}),x=N.useRef(null),A=N.useRef(null),I=()=>{y(!0),setTimeout(()=>{y(!1),f(!1)},250)};if(N.useEffect(()=>{const G=Y=>{var te,ie;
1216const X=Y.target;(te=x.current)!=null&&te.contains(X)||(ie=A.current)!=null&&ie.contains(X)||u&&I()};return document.addEventListener("mousedown",G),()=>document.removeEventListener("mousedown",G)},[u]),N.useEffect(()=>{if(!u)return;const G=()=>{var X;const Y=(X=x.current)==null?void 0:X.getBoundingClientRect();Y&&S({left:Y.right+8,bottom:window.innerHeight-Y.bottom})};return G(),window.addEventListener("resize",G),()=>window.removeEventListener("resize",G)},[u]),N.useEffect(()=>{if(!v)return;const G=Y=>{Y.key==="Escape"&&_(!1)};return document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G)},[v]),!e)return null;const $=G=>G.split(" ").map(Y=>Y[0]).join("").toUpperCase().slice(0,2),O=cX(r,(q=e.email)==null?void 0:q.split("@")[0])||l("userMenu.fallbackUser",{ns:"settings",defaultValue:"User"}),P=uX(r),j=G=>{I(),i(`${s}/settings?tab=${G}`)},U=async()=>{I(),await n(),t("home")},z=G=>{I(),window.open(G,"_blank","noopener,noreferrer")},D=()=>{y(!1),f(!1),b(!0)},R=()=>{y(!1),f(!1),_(!0)},W=o?h.jsx("span",{className:`inline-flex items-center text-[10px] font-bold uppercase tracking-widest px-1.5 py-0.5 rounded-full whitespace-nowrap ${z1t[o]}`,children:l(`plans.${o}.name`,{ns:"pricing"})}):null,T=o!=="elite"?h.jsx("button",{type:"button",onClick:D,className:"shrink-0 self-stretch px-2.5 bg-gray-900 dark:bg-white text-white dark:text-gray-900 text-xs font-semibold rounded-lg hover:bg-gray-700 dark:hover:bg-gray-100 transition-colors",children:l("userMenu.upgrade",{ns:"settings"})}):null,L=a!==null&&a>0&&a<50,M=a!==null&&a<=0,Z=G=>{const Y=Math.abs(G);return Y>=1e4?`${G<0?"-":""}${Math.floor(Y/1e3)}k`:G.toString()},H=({size:G=8})=>h.jsx("div",{className:`w-${G} h-${G} rounded-full bg-neutral-200 dark:bg-neutral-700 flex items-center justify-center text-gray-700 dark:text-gray-200 font-semibold text-sm overflow-hidden`,children:P?h.jsx("img",{src:P,alt:O,className:"w-full h-full object-cover"}):h.jsx("span",{className:G>=10?"text-base":"text-xs",children:$(O)})}),V=[{key:"youtube",label:"YouTube",icon:LJ,onClick:()=>z("https://www.youtube.com/@AITritonix")},{key:"x",label:"X",icon:H1t,onClick:()=>z("https://x.com/tritonix_ai")},{key:"discord",label:"Discord",icon:W1t,onClick:()=>z("https://discord.gg/Fq7c7G38Tq")},{key:"wechat",label:l("userMenu.wechat",{ns:"settings",defaultValue:"WeChat"}),icon:q1t,onClick:R}],F=h.jsxs(h.Fragment,{children:[V1t.map(({tab:G,icon:Y})=>h.jsxs("button",{onClick:()=>j(G),className:"w-full text-left px-4 py-3 md:py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-white/[0.05] hover:text-gray-900 dark:hover:text-white flex items-center gap-3 transition-colors",children:[h.jsx(Y,{className:"w-4 h-4 shrink-0"}),h.jsx("span",{children:l(`userMenu.${G}`,{ns:"settings"})}),G==="feedback"&&h.jsx("span",{className:"ml-auto shrink-0 rounded-md bg-emerald-500/15 px-1.5 py-0.5 text-[10px] font-semibold leading-none text-emerald-600 dark:bg-emerald-400/20 dark:text-emerald-300",children:l("userMenu.feedbackBadge",{ns:"settings",defaultValue:"Feature request"})})]},G)),a!==null&&h.jsxs("button",{onClick:()=>{I(),i(`${s}/settings?tab=plan`)},className:`w-full text-left px-4 py-3 md:py-2 text-sm flex items-center gap-3 transition-colors ${M?"text-red-500 hover:bg-red-50 dark:hover:bg-red-500/10":L?"text-amber-500 hover:bg-amber-50 dark:hover:bg-amber-500/10":"text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-white/[0.05] hover:text-gray-900 dark:hover:text-white"}`,children:[h.jsx(E1e,{className:"w-4 h-4 shrink-0"}),h.jsx("span",{children:l("userMenu.credits",{ns:"settings"})}),h.jsx("span",{className:`ml-auto text-xs font-bold tabular-nums px-1.5 py-0.5 rounded-md ${M?"bg-red-100 dark:bg-red-500/20 text-red-500":L?"bg-amber-100 dark:bg-amber-500/20 text-amber-500":"bg-gray-100 dark:bg-white/10 text-gray-600 dark:text-gray-300"}`,children:Z(a)})]}),h.jsxs("div",{className:"border-t border-gray-100 dark:border-white/[0.05] my-1 pt-1",children:[h.jsx("div",{className:"px-4 pt-1.5 pb-1",children:h.jsx("div",{className:"grid grid-cols-4 gap-2",children:V.map(({key:G,label:Y,icon:X,onClick:te})=>h.jsxs("button",{onClick:te,className:"group relative flex items-center justify-center rounded-lg p-1 text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-white/[0.05] hover:text-gray-900 dark:hover:text-white transition-colors","aria-label":Y,title:Y,children:[h.jsx("span",{className:"pointer-events-none absolute bottom-full left-1/2 mb-2 -translate-x-1/2 whitespace-nowrap rounded-lg bg-gray-900 px-2 py-1 text-[11px] font-medium text-white opacity-0 shadow-lg transition-all duration-150 group-hover:-translate-y-0.5 group-hover:opacity-100 group-focus-visible:-translate-y-0.5 group-focus-visible:opacity-100 dark:bg-white dark:text-gray-900",children:Y}),h.jsx("span",{className:"flex h-10 w-10 min-h-10 min-w-10 shrink-0 items-center justify-center rounded-full border border-gray-200 bg-white text-gray-700 transition-colors group-hover:border-gray-300 group-hover:text-gray-900 dark:border-white/[0.08] dark:bg-white/[0.04] dark:text-gray-200 dark:group-hover:border-white/[0.16] dark:group-hover:text-white",children:h.jsx(X,{className:"w-4 h-4 shrink-0"})})]},G))})}),h.jsxs("button",{onClick:U,className:"w-full text-left px-4 py-3 md:py-2 text-sm text-red-500 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-500/10 flex items-center gap-3 transition-colors",children:[h.jsx(AJ,{className:"w-4 h-4 shrink-0"}),l("userMenu.signOut",{ns:"settings"})]})]})]});return h.jsxs("div",{className:"relative flex items-center justify-center w-full",ref:x,children:[h.jsx("button",{onClick:()=>u?I():f(!0),className:"flex items-center gap-2 hover:opacity-80 transition-opacity focus:outline-none","aria-label":l("userMenu.ariaLabel",{ns:"settings",defaultValue:"User menu"}),children:h.jsx(H,{size:8})}),u&&yu.createPortal(h.jsxs("div",{ref:A,className:"hidden md:block fixed w-72 bg-white dark:bg-[#111] border border-gray-200 dark:border-white/[0.08] rounded-xl shadow-xl py-1.5 z-[300] animate-fade-in-up origin-bottom-left",style:{left:C.left,bottom:C.bottom},children:[h.jsxs("div",{className:"flex items-stretch gap-2.5 px-4 py-3 border-b border-gray-100 dark:border-white/[0.05] mb-1",children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[h.jsx("p",{className:"text-sm font-semibold text-gray-900 dark:text-white truncate",children:O}),W]}),h.jsx("p",{className:"text-xs text-gray-400 truncate mt-0.5",children:e.email})]}),T]}),F]}),document.body),u&&yu.createPortal(h.jsxs("div",{className:"md:hidden fixed inset-0 z-[200] flex flex-col justify-end",children:[h.jsx("div",{className:`absolute inset-0 bg-black/60 backdrop-blur-sm transition-opacity duration-250 ${p?"opacity-0":"opacity-100"}`,onClick:I}),h.jsxs("div",{className:`relative w-full bg-white dark:bg-[#111] rounded-t-2xl pb-safe pt-1 shadow-2xl transition-transform duration-250 ease-out ${p?"translate-y-full":"translate-y-0"}`,children:[h.jsx("div",{className:"flex justify-center pt-2 pb-1",children:h.jsx("div",{className:"w-10 h-1 rounded-full bg-gray-200 dark:bg-white/20"})}),h.jsxs("div",{className:"flex items-stretch gap-3 px-5 py-4 border-b border-gray-100 dark:border-white/[0.05]",children:[h.jsx("div",{className:"w-10 h-10 rounded-full bg-neutral-200 dark:bg-neutral-700 flex items-center justify-center text-gray-700 dark:text-gray-200 font-semibold overflow-hidden shrink-0",children:P?h.jsx("img",{src:P,alt:O,className:"w-full h-full object-cover"}):h.jsx("span",{className:"text-sm",children:$(O)})}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[h.jsx("p",{className:"text-sm font-semibold text-gray-900 dark:text-white truncate",children:O}),W]}),h.jsx("p",{className:"text-xs text-gray-400 truncate mt-0.5",children:e.email})]}),T]}),h.jsx("div",{className:"py-2",children:F})]})]}),document.body),v&&yu.createPortal(h.jsxs("div",{className:"fixed inset-0 z-[400] flex items-end justify-center p-0 md:items-center md:p-4",children:[h.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:()=>_(!1)}),h.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"wechat-cs-title",className:"relative w-full max-w-sm rounded-t-2xl bg-white px-5 pb-6 pt-4 shadow-2xl md:rounded-2xl dark:bg-[#111] dark:border dark:border-white/[0.08]",children:[h.jsxs("div",{className:"mb-3 flex items-start justify-between gap-3",children:[h.jsxs("div",{children:[h.jsx("h2",{id:"wechat-cs-title",className:"text-sm font-semibold text-gray-900 dark:text-white",children:l("userMenu.wechatTitle",{ns:"settings",defaultValue:"Customer service assistant"})}),h.jsx("p",{className:"mt-1 text-xs leading-5 text-gray-500 dark:text-gray-400",children:l("userMenu.wechatHint",{ns:"settings",defaultValue:"Scan the QR code to add the assistant and join the group."})})]}),h.jsx("button",{type:"button",onClick:()=>_(!1),className:"shrink-0 rounded-lg p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-700 dark:hover:bg-white/[0.06] dark:hover:text-white","aria-label":l("featureSpotlight.close",{ns:"common",defaultValue:"Close"}),children:h.jsx(ml,{className:"h-4 w-4"})})]}),h.jsx("img",{src:"/images/wechat-cs-assistant.png",alt:l("userMenu.wechatTitle",{ns:"settings",defaultValue:"Customer service assistant"}),className:"w-full rounded-xl border border-gray-100 bg-white dark:border-white/[0.06]"})]})]}),document.body),g&&yu.createPortal(h.jsx(F1t,{isOpen:g,onClose:()=>b(!1),variant:"upgrade"}),document.body)]})},K1t=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];function G1t(){const t=[];for(let e=6;e>=0;e--){const n=new Date(Date.now()-e*24*60*60*1e3);t.push(K1t[n.getDay()===0?6:n.getDay()-1])}return t}const Y1t=({last7Days:t,todayChecked:e})=>{const n=G1t(),r=t.length===7?t:[!1,!1,!1,!1,!1,!1,!1];return h.jsx("div",{className:"grid grid-cols-7 gap-1.5",children:r.map((i,s)=>{const a=s===6,o=a?i||e:i,l=a&&e;return h.jsxs("div",{className:`rounded-[18px] border px-1 py-1.5 text-center transition-all duration-300 ${l?"border-emerald-400/45 bg-emerald-400/12":o?"border-violet-400/30 bg-violet-400/10":a?"border-sky-400/30 bg-sky-4
121600/8":"border-white/8 bg-white/[0.03]"}`,children:[h.jsx("div",{className:`text-[10px] font-semibold uppercase tracking-[0.18em] ${a?"text-sky-300":"text-slate-500"}`,children:n[s]}),h.jsx("div",{className:`mx-auto mt-1.5 flex h-8 w-8 items-center justify-center rounded-[14px] border transition-all duration-300 ${l?"border-emerald-300/70 bg-emerald-400 text-white":o?"border-violet-300/40 bg-violet-400/80 text-white":a?"border-sky-300/30 bg-sky-400/10 text-sky-300":"border-white/8 bg-white/[0.03] text-slate-600"}`,children:o?h.jsx(t7,{className:"h-4 w-4",strokeWidth:2.5}):a?h.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current"}):null})]},s)})})},J1t=({isOpen:t,onClose:e,creditsToEarn:n,isSubscribed:r,isLoading:i,authExpired:s,onCheckIn:a,checkedInJustNow:o,checkedIn:l,streakCount:u,last7Days:f})=>{const p=Bu(),y=Vf(),{t:g}=sr("settings"),[b,v]=N.useState(!1);if(N.useEffect(()=>{if(!t){const j=setTimeout(()=>v(!1),300);return()=>clearTimeout(j)}if(l||o){const j=setTimeout(()=>v(!0),o?300:0);return()=>clearTimeout(j)}else v(!1)},[t,l,o]),!t)return null;const _=()=>{e(),p(`${y}/pricing`)},C=()=>{e(),p(`${y}/`)},S=u,x=`+${n}`,A=g(b?"nav.checkedIn":"nav.dailyCheckIn"),I=b?"Checked in.":"Claim today's credits",$=b?"Credits are ready to use.":s?"Your session expired. Please sign in again.":"One check-in per UTC day.",O=S>0?`${S}-day streak`:"Start your streak today",P=h.jsxs("div",{className:"fixed inset-0 z-[200] flex items-center justify-center p-4",role:"dialog","aria-modal":"true",children:[h.jsx("div",{className:"absolute inset-0 bg-black/75 backdrop-blur-sm",onClick:e}),h.jsxs("div",{className:"relative w-full max-w-[396px] overflow-hidden rounded-[24px] border border-white/10 bg-[#0b1220]/96 shadow-[0_24px_72px_rgba(0,0,0,0.42)]",children:[h.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_top_left,rgba(99,102,241,0.16),transparent_30%),radial-gradient(circle_at_bottom_right,rgba(16,185,129,0.10),transparent_28%)]"}),h.jsx("div",{className:"absolute inset-0 opacity-[0.08] bg-[linear-gradient(to_right,#ffffff08_1px,transparent_1px),linear-gradient(to_bottom,#ffffff08_1px,transparent_1px)] bg-[size:28px_28px]"}),h.jsxs("div",{className:"relative z-10 px-4 pb-4 pt-4 sm:px-5 sm:pb-5",children:[h.jsx("button",{onClick:e,className:"absolute right-4 top-4 roun
1216ded-full border border-white/10 bg-white/[0.03] p-2 text-slate-400 transition-colors hover:text-white","aria-label":"Close",children:h.jsx(ml,{className:"h-4 w-4"})}),h.jsxs("div",{className:"pr-12",children:[h.jsxs("div",{className:`inline-flex items-center gap-2 rounded-full border px-3 py-1 text-[10px] font-semibold uppercase tracking-[0.2em] ${b?"border-emerald-400/25 bg-emerald-400/10 text-emerald-300":"border-violet-400/25 bg-violet-400/10 text-violet-200"}`,children:[b?h.jsx(n3,{className:"h-3.5 w-3.5"}):h.jsx(bu,{className:"h-3.5 w-3.5"}),A]}),h.jsxs("div",{className:"mt-4 grid grid-cols-[minmax(0,1fr)_auto] items-start gap-x-3 gap-y-2 sm:gap-x-4",children:[h.jsxs("div",{className:"min-w-0",children:[h.jsx("p",{className:"text-[10px] uppercase tracking-[0.2em] text-slate-500",children:"Daily reward"}),h.jsx("h2",{className:"mt-2 max-w-[180px] text-[22px] font-semibold leading-[1.06] text-white sm:max-w-[220px] sm:text-[30px]",children:I}),h.jsx("p",{className:"mt-2 max-w-[200px] text-[13px] leading-5 text-slate-400 sm:max-w-[240px] sm:leading-6",children:$})]}),h.jsxs("div",{className:"w-[92px] shrink-0 text-right sm:w-[110px]",children:[h.jsx("div",{className:`text-[40px] font-black leading-none tracking-[-0.06em] sm:text-[52px] ${b?"bg-gradient-to-br from-emerald-300 via-teal-300 to-cyan-300":"bg-gradient-to-br from-violet-200 via-fuchsia-200 to-sky-200"} bg-clip-text text-transparent`,children:x}),h.jsx("div",{className:"mt-1.5 text-[10px] font-semibold uppercase tracking-[0.2em] text-slate-500",children:"credits"})]})]})]}),h.jsxs("div",{className:"mt-5 rounded-[20px] border border-white/8 bg-white/[0.03] p-3.5",children:[h.jsxs("div",{className:"flex items-center justify-between gap-3",children:[h.jsxs("div",{children:[h.jsx("p",{className:"text-[10px] uppercase tracking-[0.2em] text-slate-500",children:"Week"}),h.jsx("p",{className:"mt-1 text-[13px] text-slate-300",children:"7-day check-in"})]}),S>0?h.jsxs("div",{className:"inline-flex items-center gap-1.5 rounded-full border border-orange-400/20 bg-orange-400/10 px-3 py-1 text-[12px] font-semibold text-orange-300",children:[h.jsx(j1e,{className:"h-3.5 w-3.5"}),O]}):null]}),h.jsx("div",{className:"mt-3",children:h.jsx(Y1t,{last7Days:f,todayChecked:b})})]}),r?null:h.jsxs("div",{className:"mt-3.5 rounded-[20px] border border-white/8 bg-white/[0.03] p-3.5",children:[h.jsx("p",{className:"text-[10px] uppercase tracking-[0.2em] text-slate-500",children:"Pro / Max"}),h.jsxs("div",{className:"mt-2 flex items-center justify-between gap-3",children:[h.jsxs("div",{children:[h.jsx("p",{className:"text-[15px] font-semibold text-white",children:"15 credits per day"}),h.jsx("p",{className:"mt-1 text-[13px] text-slate-400",children:"Upgrade for more daily reward."})]}),h.jsx("div",{className:"rounded-full bg-violet-400/10 px-3 py-1 text-[12px] font-semibold text-violet-200",children:"15/day"})]})]}),h.jsx("div",{className:"mt-4 space-y-2.5",children:b?h.jsxs(h.Fragment,{children:[r?null:h.jsxs("button",{onClick:_,className:"group flex w-full items-center justify-center gap-2 rounded-xl bg-white px-4 py-3 text-sm font-semibold text-slate-950 transition-all hover:bg-slate-100 active:scale-[0.99]",children:[g("plan.upgradePlan"),h.jsx(yf,{className:"h-4 w-4 transition-transform group-hover:translate-x-0.5"})]}),h.jsx("button",{onClick:e,className:`w-full rounded-xl border px-4 py-3 text-sm font-medium transition-colors ${!r&&b?"border-white/10 text-slate-300 hover:border-white/20 hover:text-white":"border-white/14 text-slate-200 hover:border-white/25 hover:text-white"}`,children:b?"Done":"Close"})]}):h.jsxs(h.Fragment,{children:[h.jsx("button",{onClick:s?C:a,disabled:i,className:"group flex w-full items-center justify-center gap-2 rounded-xl bg-white px-4 py-3 text-sm font-semibold text-slate-950 transition-all hover:bg-slate-100 active:scale-[0.99] disabled:cursor-not-allowed disabled:opacity-50",children:i?h.jsxs(h.Fragment,{children:[h.jsx(sI,{className:"h-4 w-4 animate-spin"}),"Claiming"]}):s?"Sign in again":h.jsxs(h.Fragment,{children:["Claim",h.jsx(yf,{className:"h-4 w-4 transition-transform group-hover:translate-x-0.5"})]})}),r?null:h.jsx("button",{onClick:_,className:"w-full rounded-xl border border-white/10 px-4 py-3 text-sm font-medium text-slate-300 transition-colors hover:border-white/20 hover:text-white",children:g("plan.upgradePlan")})]})})]})]})]});return yu.createPortal(P,document.body)};function X1t(t={}){const{user:e}=fc(),{onCheckInSuccess:n}=t,[r,i]=N.useState(!1),[s,a]=N.useState(10),[o,l]=N.useState(0),[u,f]=N.useState(!1),[p,y]=N.useState(!0),[g,b]=N.useState(!1),[v,_]=N.useState(!1),[C,S]=N.useState(0),[x,A]=N.useState([!1,!1,!1,!1,!1,!1,!1]),I=N.useCallback(U=>{i(U.checkedIn??!1),a(U.creditsToEarn??10),l(U.creditsAwarded??0),f(U.isSubscribed??!1),S(U.streakCount??0),A(U.last7Days??[!1,!1,!1,!1,!1,!1,!1])},[]),$=N.useCallback(async()=>
1216{if(!e){y(!1),b(!1);return}y(!0),b(!1);try{const U=await u3("/api/checkin");if(U.status===401){b(!0);return}if(!U.ok)return;const z=await U.json();I(z)}catch{}finally{y(!1)}},[e,I]);N.useEffect(()=>{e&&$()},[e,$]),N.useEffect(()=>{if(!e)return;const U=()=>{$()},z=()=>{document.visibilityState==="visible"&&$()};return window.addEventListener("focus",U),document.addEventListener("visibilitychange",z),()=>{window.removeEventListener("focus",U),document.removeEventListener("visibilitychange",z)}},[e,$]);const O=N.useCallback(()=>_(!0),[]),P=N.useCallback(()=>_(!1),[]),j=N.useCallback(async()=>{if(!e||r||p)return!1;y(!0),b(!1);try{const U=await u3("/api/checkin",{method:"POST"});if(U.status===401)return b(!0),!1;const z=await U.json();if(U.status===409||z.error==="already_checked_in")return await $(),!1;if(!U.ok)throw new Error(z.error??"server_error");const D=z.creditsAwarded??s,R=z.streakCount??0,W=z.last7Days??[!1,!1,!1,!1,!1,!1,!1];return I({checkedIn:!0,creditsToEarn:s,creditsAwarded:D,isSubscribed:u,streakCount:R,last7Days:W}),await(n==null?void 0:n()),Y3e({featureName:"daily_check_in",action:"completed",sourceSurface:"check_in",objectType:"check_in",objectId:"DAILY",outcome:"success"}),!0}finally{y(!1)}},[e,r,p,s,u,$,I,n]);return{checkedIn:r,creditsToEarn:s,creditsAwarded:o,isSubscribed:u,isLoading:p,authExpired:g,modalOpen:v,streakCount:C,last7Days:x,openModal:O,closeModal:P,performCheckIn:j}}const Q1t=({unreadCount:t,onClick:e})=>{const{t:n}=sr("common"),r=t>99?"99+":String(t);return h.jsxs("button",{onClick:e,className:"flex flex-col items-center gap-0.5 py-1 text-slate-500 hover:text-slate-800 dark:text-gray-400 dark:hover:text-gray-200 transition-colors group",title:n("notifications.openCenter",{defaultValue:"Open notifications"}),"aria-label":n("notifications.openCenter",{defaultValue:"Open notifications"}),type:"button",children:[h.jsxs("div",{className:"relative rounded-lg p-1.5 transition-colors group-hover:bg-gray-100 dark:group-hover:bg-white/[0.07]",children:[h.jsx(l2,{className:"w-5 h-5"}),t>0&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"absolute top-0.5 right-0.5 w-2 h-2 rounded-full bg-red-500 ring-1 ring-gray-50 dark:ring-[#0a0a0a]"}),h.jsx("span",{className:"absolute -top-1.5 -right-2 min-w-[18px] h-[18px] px-1 rounded-full bg-red-500 text-[10px] font-bold text-white flex items-center justify-center shadow-sm",children:r})]})]}),h.jsx("span",{className:"text-[10px] font-medium",children:n("notifications.bell",{defaultValue:"Alerts"})})]})},emt=encodeURI("/Generated Image December 11, 2025 - 4_56PM (2).jpeg"),tmt=({isOpen:t,setIsOpen:e,width:n,collapsedWidth:r,studioHasUnread:i,notificationUnreadCount:s=0,onOpenNotifications:a})=>{const{t:o}=sr("common"),{user:l}=fc(),u=Bu(),f=Zi(),p=Vf(),y=f.pathname.split("/").filter(Boolean),b=y.length>0&&Va.includes(y[0])?"/"+y.slice(1).join("/"):f.pathname,[v,_]=N.useState(typeof window<"u"&&window.matchMedia("(min-width: 768px)").matches),{checkedIn:C,creditsToEarn:S,creditsAwarded:x,isSubscribed:A,isLoading:I,authExpired:$,modalOpen:O,streakCount:P,last7Days:j,openModal:U,closeModal:z,performCheckIn:D}=X1t(),[R,W]=N.useState(!1),T=async()=>{await D()&&W(!0)},L=()=>{z(),setTimeout(()=>W(!1),400)};N.useEffect(()=>{const ie=window.matchMedia("(min-width: 768px)"),se=()=>_(ie.matches);return ie.addEventListener("change",se),()=>ie.removeEventListener("change",se)},[]);const M=b.startsWith("/studio"),Z=b.startsWith("/connector"),H=b.startsWith("/watch"),V=b==="/discover"||b.startsWith("/discover/"),F=b.startsWith("/account"),q=b.startsWith("/community")||b.startsWith("/u/"),G=[{id:"studio",icon:UU,label:o("sidebar.nav.agent",{defaultValue:"Home"})},{id:"watch",icon:n1,label:o("sidebar.nav.watch",{defaultValue:"Market"})},{id:"discover",icon:t3,label:o("sidebar.nav.automation",{defaultValue:"AI Trade"})},{id:"community",icon:BU,label:o("sidebar.nav.community",{defaultValue:"Community"})},{id:"account",icon:HU,label:o("sidebar.nav.account",{defaultValue:"Account"})},{id:"connector",icon:vme,label:o("sidebar.nav.connector",{defaultValue:"Connector"})}],Y=[{id:"studio",icon:UU,label:o("sidebar.nav.agent",{defaultValue:"Home"})},{id:"watch",icon:n1,label:o("sidebar.nav.watch",{defaultValue:"Market"})},{id:"discover",icon:t3,label:o("sidebar.nav.automation",{defaultValue:"AI Trade"})},{id:"community",icon:BU,label:o("sidebar.nav.community",{defaultValue:"Community"})},{id:"account",icon:HU,label:o("sidebar.nav.account",{defaultValue:"Account"})}],X=v?G:Y,te=ie=>{tX(ie,"sidebar"),ie==="studio"?u(`${p}/studio`):ie==="connector"?u(`${p}
1216/connector`):ie==="account"?u(`${p}/account`):ie==="watch"?u(v?`${p}/watch/crypto`:`${p}/watch/watchlist`):ie==="discover"?u(`${p}/discover/bot`):ie==="community"&&u(`${p}/community`),e(!1)};return l?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"fixed bottom-0 left-0 w-full h-[60px] md:top-0 md:left-0 md:h-full bg-gray-50 dark:bg-[#0a0a0a] border-t md:border-t-0 md:border-r border-gray-200 dark:border-white/10 z-[60] flex flex-row md:flex-col responsive-sidebar",style:{"--md-width":`${r}px`},children:[h.jsx("style",{children:` 1217 @media (min-width: 768px) { 1218 .responsive-sidebar { width: var(--md-width); } 1219 } 1220 `}),h.jsx("div",{className:"hidden md:flex items-center justify-center p-3 border-b border-gray-200 dark:border-white/10 h-[60px] shrink-0",children:h.jsx("button",{type:"button",onClick:()=>u(p||"/"),"aria-label":"Go to Tritonix home",title:"Tritonix",className:"group inline-flex rounded-[14px] focus:outline-none focus-visible:ring-2 focus-visible:ring-sky-400/70 focus-visible:ring-offset-2 focus-visible:ring-offset-gray-50 dark:focus-visible:ring-offset-[#0a0a0a]",children:h.jsxs("div",{className:"relative h-10 w-10 overflow-hidden rounded-[10px] border border-gray-200/80 bg-black shadow-[0_10px_24px_rgba(15,23,42,0.12)] transition-transform duration-200 group-hover:-translate-y-0.5 dark:border-white/10 dark:shadow-[0_12px_28px_rgba(0,0,0,0.38)]",children:[h.jsx("img",{src:emt,alt:"Tritonix",className:"h-full w-full scale-[1.32] object-cover",loading:"eager"}),h.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-[10px] ring-1 ring-inset ring-white/8"})]})})}),h.jsx("div",{className:"flex flex-row md:flex-col items-center justify-around md:justify-start md:pt-2 w-full h-full md:h-0 overflow-x-hidden md:overflow-y-auto custom-scrollbar md:flex-1",children:X.map(ie=>{const se=ie.id==="studio"&&M,pe=ie.id==="connector"&&Z,Ce=ie.id==="watch"&&H,xe=ie.id==="discover"&&V,Te=ie.id==="account"&&F,Et=ie.id==="community"&&q,Ke=se||pe||Ce||xe||Te||Et;return h.jsxs("div",{className:`flex-1 md:flex-none md:w-full flex flex-col items-center justify-center md:py-1.5 cursor-pointer group relative shrink-0 ${Ke?"text-gray-950 dark:text-white":"text-gray-500 dark:text-gray-500 hover:text-gray-900 dark:hover:text-gray-200"}`,onClick:()=>te(ie.id),"data-lc":ie.id==="discover"?"nav.ai-trade":void 0,children:[h.jsxs("div",{className:`relative p-1.5 md:p-2 rounded-lg transition-colors group-hover:bg-gray-100 dark:group-hover:bg-white/[0.07] ${Ke?"bg-gray-200/80 dark:bg-white/[0.12]":""}`,children:[h.jsx(ie.icon,{className:"w-5 h-5 md:w-5 md:h-5"}),ie.id==="studio"&&i&&h.jsx("span",{className:"absolute top-0.5 right-0.5 w-2 h-2 rounded-full bg-red-500 ring-1 ring-gray-50 dark:ring-[#0a0a0a]"})]}),h.jsx("span",{className:"text-[10px] font-medium mt-0.5 md:mt-1",children:ie.label}),Ke&&h.jsx("div",{className:"hidden md:block absolute left-0 top-1/2 -translate-y-1/2 w-0.5 h-8 bg-gray-950 dark:bg-white rounded-r-full"}),Ke&&h.jsx("div",{className:"md:hidden absolute top-0 left-1/2 -translate-x-1/2 w-8 h-0.5 bg-gray-950 dark:bg-white rounded-b-full"})]},ie.id)})}),h.jsxs("div",{className:"mt-auto hidden flex-col items-center border-t border-gray-200 px-2 pb-4 pt-1.5 dark:border-white/10 md:flex",children:[h.jsxs("div",{className:"flex w-full flex-col items-center gap-1",children:[l&&h.jsxs("button",{onClick:()=>u(`${p}/settings?tab=invite`),className:"flex flex-col items-center gap-0.5 py-1 text-gray-600 transition-colors hover:text-gray-950 dark:text-gray-400 dark:hover:text-white group",title:o("sidebar.inviteFriends",{defaultValue:"Invite friends"}),children:[h.jsxs("div",{className:"relative rounded-lg p-1.5 transition-colors group-hover:bg-gray-200/80 dark:group-hover:bg-white/[0.08]",children:[h.jsx(U1e,{className:"h-5 w-5"}),h.jsx("span",{className:"absolute right-0.5 top-0.5 h-2 w-2 rounded-full bg-gray-500 ring-1 ring-gray-50 dark:bg-gray-300 dark:ring-[#0a0a0a]"})]}),h.jsx("span",{className:"text-[10px] font-medium",children:"+550"})]}),l&&($?h.jsxs("button",{onClick:U,className:"relative flex flex-col items-center gap-0.5 py-1 text-red-400 transition-colors hover:text-red-500 group",title:"Session expired",children:[h.jsx("div",{className:"relative rounded-lg p-1.5 transition-colors group-hover:bg-red-500/10",children:h.jsx(PU,{className:"h-5 w-5"})}),h.jsx("span",{className:"text-[10px] font-medium",children:"Session"})]}):C?h.jsxs("button",{onClick:U,className:"flex flex-col items-center gap-0.5 py-1 text-green-500 transition-colors hover:text-green-400 group",title:o("sidebar.viewTodaysCheckIn",{defaultValue:"View today's check-in"}),children:[h.jsx("div",{className:"rounded-lg p-1.5 transition-colors group-hover:bg-green-500/10",children:h.jsx(iI,{className:"h-5 w-5"})}),h.jsxs("span",{className:"text-[10px] font-medium",children:["+",x||S]})]}):h.jsxs("button",{onClick:U,className:"relative flex flex-col items-center gap-0.5 py-1 text-orange-400 transition-colors hover:text-orange-500 group",title:o("sidebar.dailyCheckIn",{defaultValue:"Daily check-in"}),children:[h.jsxs("div",{className:"relative rounded-lg p-1.5 transition-colors group-hover:bg-orange-500/10",children:[h.jsx(PU,{className:"h-5 w-5"}),h.jsx("span",{className:"absolute right-0.5 top-0.5 h-2 w-2 rounded-full bg-orange-400 ring-1 ring-gray-50 dark:ring-[#0a0a0a]"})]}),h.jsx("span",{className:"text-[10px] font-medium",children:o("sidebar.checkIn",{defaultValue:"Check In"})})]})),l&&a&&h.jsx(Q1t,{unreadCount:s,onClick:a})]}),l&&h.jsx("div",{className:"flex w-full justify-center pt-2",children:h.jsx(Z1t,{onNavigate:ie=>{typeof ie=="object"&&ie.page==="settings"?u(`${p}/settings`):ie==="home"&&u(p||"/")}})})]})]}),h.jsx(J1t,{isOpen:O,onClose:L,creditsToEarn:S,isSubscribed:A,isLoading:I,authExpired:$,onCheckIn:T,checkedInJustNow:R,checkedIn:C,streakCount:P,last7Days:j})]}):null},Oue=["all","order","system","campaign","signal","task"],RG={all:0,order:1,system:2,campaign:3,signal:4,task:5};function jG(t){return!!t&&typeof t=="object"&&!Array.isArray(t)}function Lt(t){if(typeof t=="string"){const e=t.trim();return e||null}return typeof t=="number"||typeof t=="boolean"?String(t):null}function MG(t){return Array.isArray(t)?t.map(e=>Lt(e)).filter(e=>!!e):[]}function nmt(t){return t==="order"||t==="system"||t==="campaign"||t==="signal"||t==="task"?t:"system"}function DG(t){if(!jG(t))return null;const e=Lt(t.id),n=Lt(t.user_id),r=Lt(t.type),i=Lt(t.created_at),s=Lt(t.updated_at)??i;if(!e||!n||!r||!i||!s)return null;const a=jG(t.payload)?t.payload:{},o={...a,strategy:Lt(a.strategy)??void 0,runDate:Lt(a.runDate)??void 0,weekEnding:Lt(a.weekEnding)??void 0,count:typeof a.count=="number"?a.count:Number.isFinite(Number(a.count))?Number(a.count):void 0,codes:MG(a.codes),symbols:MG(a.symbols)};return{id:e,userId:n,category:nmt(t.category),type:r,actionUrl:Lt(t.action_url)??"/",payload:o,titleFallback:Lt(t.title_fallback),bodyFallback:Lt(t.body_fallback),dedupeKey:Lt(t.dedupe_key),readAt:Lt(t.read_at),dismissedAt:Lt(t.dismissed_at),createdAt:i,updatedAt:s}}function UG(t,e){return t.length===0?"":e.startsWith("zh")||e.startsWith("ja")||e.startsWith("ko")?t.join("ã"):t.join(", ")}function rmt(t){return t.startsWith("zh")?"AI Premarket Pick å·²åå¸":"AI Premarket Pick Is
1220Live"}function imt(t,e,n){return n.startsWith("zh")?`仿¥çåæåä¹°å
¥ ${t} åªè¡ç¥¨ï¼${e}ãç¹å»æ¥ççç¥è¯¦æ
ã`:`Today's premarket portfolio bought ${t} ${t===1?"stock":"stocks"}: ${e}. Click to view details.`}function smt(t){return t.startsWith("zh")?"Macro AI Pick å·²åå¸":"Macro AI Pick Is Live"}function amt(t,e,n){return n.startsWith("zh")?`æ¬å¨å®è§çç¥å·²è°ä» ${t} åªè¡ç¥¨ï¼${e}ãç¹å»æ¥ççç¥è¯¦æ
ã`:`This week's macro portfolio rebalanced ${t} ${t===1?"stock":"stocks"}: ${e}. Click to view details.`}function wo(t){const e=Number(t);return Number.isFinite(e)?e:null}function Nh(t,e){const n=wo(t);return n==null?"":new Intl.NumberFormat(e,{style:"currency",currency:"USD",maximumFractionDigits:2}).format(n)}function BG(t,e){const n=Lt(t),r=e.startsWith("zh");return n==="initial_build"?r?"åå§å»ºä»":"initial build":n==="weekly_rebalance"?r?"æ¯å¨è°ä»":"weekly rebalance":n==="add_funds"?r?"å ä»å平衡":"add-funds rebalance":n==="withdraw"?r?"åä»å平衡":"withdrawal rebalance":n==="exit"?r?"éåºæ¸
ä»":"exit":r?"æ§è¡ä»»å¡":"execution"}function Ag(t,e,n){var r,i;if(t.type==="premarket_pick_ready"){const s=t.payload.count??((r=t.payload.codes)==null?void 0:r.length)??0,a=t.payload.codes??[],o=UG(a,n);return{title:e("notifications.types.premarketPickReady.title",{ns:"common",defaultValue:t.titleFallback??rmt(n)}),body:e("notifications.types.premarketPickReady.body",{ns:"common",count:s,codes:o,defaultValue:t.bodyFallback??imt(s,o,n)})}}if(t.type==="macro_ai_pick_ready"){const s=t.payload.count??((i=t.payload.codes)==null?void 0:i.length)??0,a=t.payload.codes??[],o=UG(a,n);return{title:e("notifications.types.macroAiPickReady.title",{ns:"common",defaultValue:t.titleFallback??smt(n)}),body:e("notifications.types.macroAiPickReady.body",{ns:"common",count:s,codes:o,defaultValue:t.bodyFallback??amt(s,o,n)})}}if(t.type==="copy_trade_tracker_created"){const s=Lt(t.payload.strategyName)??"Strategy",a=Nh(t.payload.amount,n);return{title:e("notifications.types.copyTradeTrackerCreated.title",{ns:"common",defaultValue:t.titleFallback??(n.startsWith("zh")?"Copy Trade è·åå¨å·²å建":"Copy Trade Tracker Created")}),body:e("notifications.types.copyTradeTrackerCreated.body",{ns:"common",strategyName:s,amount:a,defaultValue:t.bodyFallback??(n.startsWith("zh")?`${s} è·åå¨å·²å建ï¼è·åéé¢ ${a}ã`:`${s} tracker was created with ${a}.`)})}}if(t.type==="copy_trade_funding_updated"){const s=Lt(t.payload.strategyName)??"Your tracker",a=Nh(t.payload.amount,n),o=t.payload.fundingType==="add_funds";return{title:e(`notifications.types.copyTradeFundingUpdated.${o?"addTitle":"withdrawTitle"}`,{ns:"common",defaultValue:n.startsWith("zh")?o?"Copy Trade å·²å ä»":"Copy Trade å·²åä»":o?"Copy Trade Funds Added":"Copy Trade Withdrawal Recorded"}),body:e(`notifications.types.copyTradeFundingUpdated.${o?"addBody":"withdrawBody"}`,{ns:"common",strategyName:s,amount:a,defaultValue:t.bodyFallback??(n.startsWith("zh")?`${s} å·²${o?"å¢å ":"åå°"} ${a}ã`:`${s} was ${o?"increased":"reduced"} by ${a}.`)})}}if(t.type==="copy_trade_tracker_paused"||t.type==="copy_trade_tracker_resumed"){const s=Lt(t.payload.strategyName)??(n.startsWith("zh")?"è·åå¨":"Your tracker"),a=t.type==="copy_trade_tracker_paused";return{title:e(`notifications.types.copyTradeTrackerStatus.${a?"pausedTitle":"resumedTitle"}`,{ns:"common",defaultValue:n.startsWith("zh")?a?"Copy Trade å·²æå":"Copy Trade å·²æ¢å¤":a?"Copy Trade Tracker Paused":"Copy Trade Tracker Resumed"}),body:e(`notifications.types.copyTradeTrackerStatus.${a?"pausedBody":"resumedBody"}`,{ns:"common",strategyName:s,defaultValue:t.bodyFallback})}}if(t.type==="copy_trade_exit_requested"){const s=Lt(t.payload.strategyName)??(n.startsWith("zh")?"è·åå¨":"Your tracker");return{title:e("notifications.types.copyTradeExitRequested.title",{ns:"common",defaultValue:n.startsWith("zh")?"Copy Trade éåºå·²è¯·æ±":"Copy Trade Exit Requested"}),body:e("notifications.types.copyTradeExitRequested.body",{ns:"common",strategyName:s,defaultValue:t.bodyFallback})}}if(t.type==="copy_trade_execution_completed"){const s=Lt(t.payload.strategyName)??"Your tracker",a=BG(t.payload.runType,n),o=wo(t.payload.grossTradeValue)??0,l=wo(t.payload.submittedOrderCount)??0,u=wo(t.payload.failedOrderCount)??0,f=u>0?n.startsWith("zh")?`${l} ç¬è®¢åå·²æäº¤ï¼${u} ç¬å¤±è´¥`:`${l} orders submitted; ${u} failed`:o>0?n.startsWith("zh")?`é¢ä¼°æäº¤éé¢ ${Nh(o,n)}`:`estimated submitted value ${Nh(o,n)}`:n.startsWith("zh")?"æ éæäº¤è®¢å":"no orders were needed";return{title:e("notifications.types.copyTradeExecutionCompleted.title",{ns:"common",defaultValue:t.titleFallback??(n.startsWith("zh")?"Copy Trade æ§è¡å®æ":"Copy Trade Execution Completed")}),body:e("notifications.types.copyTradeExecutionCompleted.body",{ns:"common",strategyName:s,runLabel:a,result:f,defaultValue:t.bodyFallback??(n.startsWith("zh")?`${s} ç${a}已宿ï¼${f}ã`:`${s} ${a} completed: ${f}.`)})}}if(t.type==="copy_trade_execution_failed"){const s=Lt(t.payload.strategyName)??"Your tracker",a=BG(t.payload.runType,n);return{title:e("notifications.types.copyTradeExecutionFailed.title",{ns:"common",defaultValue:t.titleFallback??(n.startsWith("zh")?"Copy Trade æ§è¡å¤±è´¥":"Copy Trade Execution Failed")}),body:e("notifications.types.copyTradeExecutionFailed.body",{ns:"common",strategyName:s,runLabel:a,defaultValue:t.bodyFallback??(n.startsWith("zh")?`${s} ç${a}失败ã请æå¼è·å卿¥ç详æ
ã`:`${s} ${a} failed. Open the tracker to review details.`)})}}if(t.type==="day_trade_bot_deployed"){const s=Lt(t.payload.portfolioName)??"Day Trade Bot",a=Nh(t.payload.amount,n);return{title:e("notifications.types.dayTradeBotDeployed.title",{ns:"common",defaultValue:t.titleFallback??(n.startsWith("zh")?"Day Trade Bot å·²é¨ç½²":"Day Trade Bot Deployed")}),body:e("notifications.types.dayTradeBotDeployed.body",{ns:"common",portfolioName:s,amount:a,defaultValue:t.bodyFallback??(n.startsWith("zh")?`${s} å·²é¨ç½²ï¼æ¬é ${a}ã`:`${s} was deployed with ${a}.`)})}}if(t.type==="day_trade_bot_paused"||t.type==="day_trade_bot_resumed"){const s=Lt(t.payload.portfolioName)??(n.startsWith("zh"),"Day Trade Bot"),a=t.type==="day_trade_bot_paused";return{title:e(`notifications.types.dayTradeBotStatus.${a?"pausedT
1220itle":"resumedTitle"}`,{ns:"common",defaultValue:n.startsWith("zh")?a?"Day Trade Bot å·²æå":"Day Trade Bot å·²æ¢å¤":a?"Day Trade Bot Paused":"Day Trade Bot Resumed"}),body:e(`notifications.types.dayTradeBotStatus.${a?"pausedBody":"resumedBody"}`,{ns:"common",portfolioName:s,defaultValue:t.bodyFallback??(n.startsWith("zh")?a?`${s} å·²æåï¼æ¢å¤åä¸ä¼å¼æ°ä»ã`:`${s} å·²æ¢å¤ï¼å°æä¸ä¸æ ¹å·²æ¶ç K 线继ç»ã`:a?`${s} is paused and will not open new positions.`:`${s} is active again and will continue on the next closed bar.`)})}}if(t.type==="day_trade_bot_stop_requested"||t.type==="day_trade_bot_exit_requested"){const s=Lt(t.payload.portfolioName)??"Day Trade Bot",a=t.type==="day_trade_bot_stop_requested";return{title:e(`notifications.types.dayTradeBotExit.${a?"stopTitle":"exitTitle"}`,{ns:"common",defaultValue:n.startsWith("zh")?a?"Day Trade Bot 已请æ±åæ¢":"Day Trade Bot 已请æ±å
¨é¨å¹³ä»":a?"Day Trade Bot Stop Requested":"Day Trade Exit Requested"}),body:e(`notifications.types.dayTradeBotExit.${a?"stopBody":"exitBody"}`,{ns:"common",portfolioName:s,defaultValue:t.bodyFallback??(n.startsWith("zh")?`${s} æ£å¨åæ¢ï¼ææä»æ¶ä¼å
å¹³ä»ã`:`${s} is stopping. Open positions will be closed first.`)})}}if(t.type==="day_trade_fill_completed"){const s=Lt(t.payload.portfolioName)??"Day Trade Bot",a=Lt(t.payload.code)??Lt(t.payload.tvSymbol)??"symbol",o=String(t.payload.side??"").toLowerCase()==="sell"?n.startsWith("zh")?"ååº":"Sold":n.startsWith("zh")?"ä¹°å
¥":"Bought",l=wo(t.payload.qty),u=Nh(t.payload.price,n);return{title:e("notifications.types.dayTradeFillCompleted.title",{ns:"common",defaultValue:t.titleFallback??(n.startsWith("zh")?`${s} å·²æäº¤`:`${s} fill`)}),body:e("notifications.types.dayTradeFillCompleted.body",{ns:"common",portfolioName:s,side:o,qty:l??0,symbol:a,price:u,defaultValue:t.bodyFallback??(n.startsWith("zh")?`${s} ${o} ${l??0} ${a}ï¼åä»· ${u}ã`:`${s} ${o} ${l??0} ${a} at ${u}.`)})}}if(t.type==="day_trade_bot_degraded"||t.type==="day_trade_bot_runtime_error"){const s=Lt(t.payload.portfolioName)??"Day Trade Bot",a=t.type==="day_trade_bot_degraded";return{title:e(`notifications.types.dayTradeBotIssue.${a?"degradedTitle":"runtimeTitle"}`,{ns:"common",defaultValue:n.startsWith("zh")?a?"Day Trade Bot éè¦å¤ç":"Day Trade Bot è¿è¡å¼å¸¸":a?"Day Trade Bot Needs Attention":"Day Trade Runtime Issue"}),body:e(`notifications.types.dayTradeBotIssue.${a?"degradedBody":"runtimeBody"}`,{ns:"common",portfolioName:s,defaultValue:t.bodyFallback??(n.startsWith("zh")?a?`${s} æªè½å®æå¼ä»åæ¥ï¼å¨éæ°é¨ç½²åä¸ä¼å¼æ°ä»ã`:`${s} è¿ç»åºç°è¿è¡é®é¢ï¼è¯·æå¼ Discover æ¥çã`:a?`${s} could not finish its opening trades and will not open new positions.`:`${s} reported repeated problems. Open Discover to review it.`)})}}if(t.type==="day_trade_insufficient_credits"){const s=Lt(t.payload.portfolioName)??"Day Trade Bot";return{title:e("notifications.types.dayTradeInsufficientCredits.title",{ns:"common",defaultValue:n.startsWith("zh")?"Day Trade Credits ä¸è¶³":"Day Trade Needs Credits"}),body:e("notifications.types.dayTradeInsufficientCredits.body",{ns:"common",portfolioName:s,defaultValue:t.bodyFallback??(n.startsWith("zh")?`${s} å credits ä¸è¶³å·²æåã请å¼å¯ Auto Reloadã`:`${s} is blocked because your credits are empty. Enable Auto Reload to keep it running.`)})}}if(t.type==="copy_trade_insufficient_credits"){const s=Lt(t.payload.strategyName)??"Your tracker";return{title:e("notifications.types.copyTradeInsufficientCredits.title",{ns:"common",defaultValue:n.startsWith("zh")?"Copy Trade Credits ä¸è¶³":"Copy Trade Needs Credits"}),body:e("notifications.types.copyTradeInsufficientCredits.body",{ns:"common",strategyName:s,defaultValue:t.bodyFallback??(n.startsWith("zh")?`${s} å credits ä¸è¶³æªæ§è¡ã请å¼å¯ Auto Reloadï¼é¿å
åç»ä»»å¡ä¸æã`:`${s} did not run because your credits are empty. Enable Auto Reload to keep future runs active.`)})}}if(t.type==="scheduled_task_completed"){const s=Lt(t.payload.chatTitle)??(n.startsWith("zh")?"宿¶ç ç©¶ä»»å¡":"Scheduled research");return{title:e("notifications.types.scheduledTaskCompleted.title",{ns:"common",defaultValue:t.titleFallback??(n.startsWith("zh")?"宿¶ä»»å¡å·²å®æ":"Scheduled task completed")}),body:e("notifications.types.scheduledTaskCompleted.body",{ns:"common",chatTitle:s,defaultValue:t.bodyFallback??(n.startsWith("zh")?`${s} å·²æ§è¡å®æï¼ç¹å»æ¥çç»æã`:`${s} has finished. Tap to view the result.`)})}}if(t.type==="community_agent_reply")return{title:e("notifications.types.communityAgentReply.title",{ns:"common",defaultValue:t.titleFallback??(n.startsWith("zh")?"Tritonix Agent å·²åå¤":"Tritonix Agent replied")}),body:e("notifications.types.communityAgentReply.body",{ns:"common",defaultValue:t.bodyFallback??(n.startsWith("zh")?"Tritonix Agent åå¤äºä½ çæåã":"Tritonix Agent replied to your mention.")})};if(t.type==="automation_fomo_ready"){const s=Lt(t.payload.earnedLabel)??(wo(t.payload.earnedUsd)!=null?new Intl.NumberFormat(n,{maximumFractionDigits:0}).format(Number(t.payload.earnedUsd)):"0"),a=Lt(t.payload.bestBotName)??"Automation",o=Lt(t.payload.bestReturnPct)??"n/a";return{title:e("notifications.types.automationFomoReady.title",{ns:"common",earned:s,defaultValue:t.titleFallback??(n.startsWith("zh")?`ä¸å¨ç¨ Automation æ¬å¯å¤èµ $${s}`:`You could have earned $${s} with Automation last week`)}),body:e("notifications.types.automationFomoReady.body",{ns:"common",bestBotName:a,bestReturnPct:o,defaultValue:t.bodyFallback??(n.startsWith("zh")?`${a} è¿ 7 æ¥é¢å
ï¼åæ¥ ${o}ï¼æ $20,000 æ¬éï¼ãç¹å»æ¥ç Automation botsã`:`${a} led at ${o} on a $20,000 book. Tap to browse Automation bots.`)})}}if(t.type==="credits_granted"){const s=wo(t.payload.amount),a=s!=null?new Intl.NumberFormat(n,{maximumFractionDigits:0}).format(s):"0",o=Lt(t.payload.description),l=n.startsWith("zh"),u=e("notifications.types.creditsGranted.title",{ns:"common",defaultValue:t.titleFallback??(l?"Credits å·²å°è´¦":"Credits added")});return o?{title:u,body:e("notifications.types.creditsGranted.body",{ns:"common",amount:a,description:o,defaultValue:t.bodyFallback??(l?`å·²åä½ çè´¦æ·åæ¾ ${a} creditsï¼${o}ï¼ã`:`${a} credits have been added to your account (${o}).`)})}:{title:u,body:e("notifications.types.creditsGranted.bodyNoDescription",{ns:"common",amount:a,defaultValue:t.bodyFallback??(l?`å·²åä½ çè´¦æ·åæ¾ ${a} creditsã`:`${a} credits have been added to your account.`)})}}if(t.type==="fomc_meeting_ready"){const s=Lt(t.payload.label)??"FOMC",a=Lt(t.payload.decision)??"--",o=wo(t.payload.hawkDoveScore),l=wo(t.payload.hawkDoveDelta),u=o==null?"--":o.toFixed(2),f=l==null?"--":`${l>0?"+":""}${l.toFixed(2)}`;return{title:e("notifications.types.fomcMeetingReady.title",{ns:"common",defaultValue:t.titleFallback??(n.startsWith("zh")?"FOMC ä¼è®®æ¥å":"FOMC meeting report")}),body:e("notifications.types.fomcMeetingReady.body",{ns:"common",label:s,decision:a,score:u,delta:f,defaultValue:t.bodyFallback??(n.startsWith("zh")?`${s}: ${a}ã鹰鸽 ${u}ï¼è¾ä¸åº ${f}ï¼ãæå¼ææ
室æ¥ç宿´æ¥åã`:`${s}: ${a}. Hawk-dove ${u} (vs last ${f}). Open the war room for the full report.`)})}}if(t.type==="fomc_liquidity_alert"){const s=Lt(t.payload.alertId)??"net_4w",a=wo(t.payload.value),o=Lt(t.payload.asOf)??"",l=a==null?"--":`${a>0?"+":""}${a.toFixed(1)}`;return{title:e(`notifications.types.fomcLiquidityAlert.${s}Title`,{ns:"common",defaultValue:t.titleFallback??(n.startsWith("zh")?"FOMC æµå¨æ§æé":"FOMC liquidity alert")}),body:e(`notifications.types.fomcLiquidityAlert.${s}Body`,{ns:"common",value:l,asOf:o,defaultValue:t.bodyFallback??(n.startsWith("zh")?`æµå¨æ§éå¼å·²è§¦åï¼${l} $Bï¼æªè³ ${o||"--"}ï¼ã`:`A liquidity threshold was crossed (${l} $B as of ${o||"--"}).`)})}}if(t.type==="ai_alert_triggered"){const s=Lt(t.payload.tvSymbol)??"Alert",a=Lt(t.payload.conditionText)??Lt(t.payload.message)??"",o=Lt(t.payload.actualText);return{title:e("notifications.types.aiAlertTriggered.title",{ns:"common",defaultValue:t.titleFallback??(n.startsWith("zh")?"AI Alert 已触å":"AI Alert triggered")}),body:e("notifications.types.aiAlertTriggered.body",{ns:"common",tvSymbol:s,condition:a,actual:o??"",defaultValue:t.bodyFallback??(n.startsWith("zh")?`${s} ${a}${o?`ï¼å½å ${o}`:""}`:`${s} ${a}${o?` (now ${o})`:""}`)})}}return t.type==="order_submitted"||t.type==="order_submit_failed"||t.type==="order_canceled"||t.type==="order_cancel_failed"||t.type==="order_position_closed"||t.type==="order_position_close_failed"?lmt(t,e,n):{title:t.titleFallback??e("notifications.types.fallback.title",{ns:"common",defaultValue:"Notification"}),body:t.bodyFallback??e("notifications.types.fallback.body",{ns:"common",defaultValue:"Open to view details."})}}function omt(t,e){const n=wo(t.qty);if(n!=null)return e.startsWith("zh")?`${n} è¡`:`${n} shares`;const r=wo(t.notional);return r!=null?Nh(r,e):""}function lmt(t,e,n){const r=n.startsWith("zh"),i=Lt(t.payload.broker)??"broker",s=Lt(t.payload.symbol)??(r?"æ ç":"asset"),a=(Lt(t.payload.side)??"").toUpperCase(),o=omt(t.payload,n),l=Lt(t.payload.orderType)??"",u=Lt(t.payload.orderId),f=Lt(t.payload.error),p=a||(r?"订å":"Order");if(t.type==="order_submitted"){const y=[p,s,o||null,l||null,r?`éè¿ ${i}`:`via ${i}
1220`].filter(Boolean).join(" · ");return{title:e("notifications.types.orderSubmitted.title",{ns:"common",defaultValue:t.titleFallback??(r?"订åå·²æäº¤":"Order submitted")}),body:e("notifications.types.orderSubmitted.body",{ns:"common",detail:y,orderId:u??"",defaultValue:t.bodyFallback??(u?r?`${y}ï¼#${u}ï¼`:`${y} (#${u})`:y)})}}return t.type==="order_submit_failed"?{title:e("notifications.types.orderSubmitFailed.title",{ns:"common",defaultValue:t.titleFallback??(r?"订åæäº¤å¤±è´¥":"Order submission failed")}),body:e("notifications.types.orderSubmitFailed.body",{ns:"common",symbol:s,broker:i,error:f??"",defaultValue:t.bodyFallback??(r?`${p} ${s} éè¿ ${i} æäº¤å¤±è´¥${f?`ï¼${f}`:"ã"}`:`${p} ${s} via ${i} failed${f?`: ${f}`:"."}`)})}:t.type==="order_canceled"?{title:e("notifications.types.orderCanceled.title",{ns:"common",defaultValue:t.titleFallback??(r?"订åå·²æ¤é":"Order canceled")}),body:e("notifications.types.orderCanceled.body",{ns:"common",symbol:s,broker:i,orderId:u??"",defaultValue:t.bodyFallback??(r?`å·²æ¤é ${s} 订åï¼${i}${u?` · #${u}`:""}ï¼`:`Canceled ${s} order via ${i}${u?` (#${u})`:""}`)})}:t.type==="order_cancel_failed"?{title:e("notifications.types.orderCancelFailed.title",{ns:"common",defaultValue:t.titleFallback??(r?"æ¤å失败":"Order cancel failed")}),body:e("notifications.types.orderCancelFailed.body",{ns:"common",symbol:s,broker:i,error:f??"",defaultValue:t.bodyFallback??(r?`æ æ³æ¤é ${s} 订åï¼${i}ï¼${f?`ï¼${f}`:"ã"}`:`Could not cancel ${s} order via ${i}${f?`: ${f}`:"."}`)})}:t.type==="order_position_closed"?{title:e("notifications.types.orderPositionClosed.title",{ns:"common",defaultValue:t.titleFallback??(r?"æä»å·²å¹³ä»":"Position closed")}),body:e("notifications.types.orderPositionClosed.body",{ns:"common",broker:i,orderId:u??"",defaultValue:t.bodyFallback??(r?`å·²éè¿ ${i} å¹³ä»${u?`ï¼#${u}ï¼`:"ã"}`:`Closed position via ${i}${u?` (#${u})`:"."}`)})}:{title:e("notifications.types.orderPositionCloseFailed.title",{ns:"common",defaultValue:t.titleFallback??(r?"å¹³ä»å¤±è´¥":"Position close failed")}),body:e("notifications.types.orderPositionCloseFailed.body",{ns:"common",broker:i,error:f??"",defaultValue:t.bodyFallback??(r?`æ æ³éè¿ ${i} å¹³ä»${f?`ï¼${f}`:"ã"}`:`Could not close position via ${i}${f?`: ${f}`:"."}`)})}}function kg(t,e){const n=Date.parse(t);if(!Number.isFinite(n))return"";const r=new Date(n),i=new Date,s=r.getFullYear()===i.getFullYear();return s&&r.getMonth()===i.getMonth()&&r.getDate()===i.getDate()?new Intl.DateTimeFormat(e,{hour:"2-digit",minute:"2-digit",hour12:!1}).format(r):s?new Intl.DateTimeFormat(e,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).format(r):new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).format(r)}function Pue(t){const e={};return Oue.forEach(n=>{e[n]=t.find(r=>n==="all"||r.category===n)??null}),e}function cmt(t){const e=Pue(t);return["all",...Oue.filter(r=>r!=="all").slice().sort((r,i)=>{const s=e[r],a=e[i],o=s?Date.parse(s.createdAt):0,l=a?Date.parse(a.createdAt):0;return o!==l?l-o:RG[r]-RG[i]})]}const FG={all:l2,order:cme,system:l2,campaign:XA,signal:dme,task:x1e},umt=({isOpen:t,notifications:e,activeCategory:n,loading:r=!1,onClose:i,onSelectCategory:s,onNotificationClick:a,onMarkAllRead:o})=>{const{t:l,i18n:u}=sr("common"),[f,p]=N.useState(null);N.useEffect(()=>{if(!t){p(null);return}const S=x=>{x.key==="Escape"&&i()};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[t,i]);const y=N.useMemo(()=>e.filter(S=>n==="all"||S.category===n),[n,e]),g=N.useMemo(()=>{const S=Object.fromEntries(["all","order","system","campaign","signal","task"].map(x=>[x,0]));return e.forEach(x=>{x.readAt||(S.all+=1,S[x.category]+=1)}),S},[e]),b=N.useMemo(()=>{const S=Object.fromEntries(["all","order","system","campaign","signal","task"].map(x=>[x,0]));return e.forEach(x=>{S.all+=1,S[x.category]+=1}),S},[e]),v=N.useMemo(()=>Pue(e),[e]),_=N.useMemo(()=>cmt(e),[e]),C=N.useMemo(()=>f?e.filter(S=>f==="all"||S.category===f):[],[e,f]);return t?yu.createPortal(h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"fixed inset-0 z-[180] hidden items-center justify-center p-4 md:flex md:p-8",role:"dialog","aria-modal":"true",children:[h.jsx("div",{className:"absolute inset-0 bg-slate-950/40 backdrop-blur-sm dark:bg-black/70",onClick:i}),h.jsxs("div",{className:"relative z-10 flex h-[min(760px,calc(100dvh-48px))] w-full max-w-[980px] overflow-hidden rounded-[20px] border border-slate-200/80 bg-white/95 shadow-[0_36px_120px_rgba(15,23,42,0.18)] dark:border-white/10 dark:bg-[#081019]/95 dark:shadow-[0_36px_120px_rgba(0,0,0,0.52)]",children:[h.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_top_left,rgba(59,130,246,0.10),transparent_30%),radial-gradient(circle_at_bottom_right,rgba(14,165,233,0.08),transparent_34%)] dark:bg-[radial-gradient(circle_at_top_left,rgba(99,102,241,0.12),transparent_30%),radial-gradient(circle_at_bottom_right,rgba(14,165,233,0.10),transparent_34%)]"}),h.jsxs("aside",{className:"relative z-10 w-[300px] shrink-0 border-r border-slate-200/80 bg-slate-50/85 dark:border-white/10 dark:bg-white/[0.02]",children:[h.jsxs("div",{className:"flex items-center justify-between gap-3 px-5 pb-4 pt-5",children:[h.jsx("div",{children:h.jsx("h2",{className:"text-xl font-semibold text-slate-900 dark:text-white",children:l("notifications.modal.title",{defaultValue:"Notifications"})})}),h.jsx("button",{type:"button",onClick:i,className:"rounded-full border border-slate-200 bg-white/80 p-2 text-slate-500 transition-colors hover:text-slate-900 dark:border-white/10 dark:bg-white/[0.03] dark:text-slate-400 dark:hover:text-white","aria-label":l("notifications.modal.close",{defaultValue:"Close"}),children:h.jsx(ml,{className:"h-4 w-4"})})]}),h.jsx("div",{className:"border-t border-slate-200/80 dark:border-white/10",children:_.map(S=>
1220{const x=FG[S],A=n===S,I=g[S],$=b[S],O=v[S]??null,P=O?Ag(O,l,u.language):null,j=(P==null?void 0:P.body)??l("notifications.modal.noItems",{defaultValue:"No notifications yet"}),U=O?kg(O.createdAt,u.language):"";return h.jsxs("button",{type:"button",onClick:()=>s(S),className:`flex w-full items-start gap-3 border-b border-slate-200/80 px-5 py-4 text-left transition-colors dark:border-white/10 ${A?"bg-sky-50/90 text-slate-900 dark:bg-white/[0.06] dark:text-white":"text-slate-500 hover:bg-white/70 hover:text-slate-900 dark:text-slate-400 dark:hover:bg-white/[0.03] dark:hover:text-slate-200"}`,children:[h.jsx("div",{className:`mt-0.5 flex h-10 w-10 shrink-0 items-center justify-center rounded-full border ${A?"border-sky-200 bg-sky-100 text-sky-700 dark:border-sky-400/25 dark:bg-sky-500/12 dark:text-sky-300":"border-slate-200 bg-white text-slate-500 dark:border-white/10 dark:bg-white/[0.04] dark:text-slate-400"}`,children:h.jsx(x,{className:"h-[18px] w-[18px]"})}),h.jsx("div",{className:"min-w-0 flex-1",children:h.jsxs("div",{className:"min-w-0",children:[h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"truncate text-sm font-medium",children:l(`notifications.categories.${S}`,{defaultValue:S})}),I>0&&h.jsx("span",{className:"h-2 w-2 rounded-full bg-red-500"})]}),h.jsx("p",{className:"shrink-0 text-xs text-slate-400 dark:text-slate-500",children:U||l("notifications.modal.count",{count:$,defaultValue:"{{count}} items"})})]}),h.jsx("p",{className:"mt-1 truncate pr-0 text-xs text-slate-400 dark:text-slate-500",children:j})]})})]},S)})})]}),h.jsxs("section",{className:"relative z-10 flex min-w-0 flex-1 flex-col",children:[h.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-slate-200/80 px-6 py-5 dark:border-white/10",children:[h.jsx("div",{className:"min-w-0",children:h.jsx("h3",{className:"truncate text-lg font-semibold text-slate-900 dark:text-white",children:l(`notifications.categories.${n}`,{defaultValue:n})})}),h.jsxs("button",{type:"button",disabled:g[n]===0,onClick:()=>o(n),className:"inline-flex items-center gap-2 rounded-full border border-slate-200 bg-white px-4 py-2 text-sm font-medium text-slate-700 transition-colors hover:bg-slate-50 disabled:cursor-not-allowed disabled:opacity-45 dark:border-white/10 dark:bg-white/[0.04] dark:text-slate-200 dark:hover:bg-white/[0.08]",children:[h.jsx(h1e,{className:"h-4 w-4"}),l("notifications.modal.markAllRead",{defaultValue:"Mark all as read"})]})]}),h.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 py-4 md:px-5",children:r?h.jsx("div",{className:"space-y-3",children:Array.from({length:6}).map((S,x)=>h.jsx("div",{className:"h-24 animate-pulse rounded-3xl border border-slate-200 bg-slate-100/80 dark:border-white/8 dark:bg-white/[0.03]"},x))}):y.length===0?h.jsxs("div",{className:"flex h-full min-h-[280px] flex-col items-center justify-center rounded-[28px] border border-dashed border-slate-200 bg-slate-50/70 px-6 text-center dark:border-white/10 dark:bg-white/[0.02]",children:[h.jsx(l2,{className:"h-10 w-10 text-slate-400 dark:text-slate-500"}),h.jsx("h4",{className:"mt-4 text-lg font-semibold text-slate-900 dark:text-white",children:l("notifications.modal.emptyTitle",{defaultValue:"No notifications yet"})}),h.jsx("p",{className:"mt-2 max-w-md text-sm leading-6 text-slate-500 dark:text-slate-400",children:l("notifications.modal.emptyBody",{defaultValue:"New notifications will appear here once orders, system events, tasks, or strategy signals are generated."})})]}):h.jsx("div",{className:"space-y-3",children:y.map(S=>{const x=Ag(S,l,u.language),A=kg(S.createdAt,u.language);return h.jsx("button",{type:"button",onClick:()=>a(S),className:`group w-full rounded-[18px] border px-5 py-4 text-left transition-colors ${S.readAt?"border-slate-200 bg-white hover:bg-slate-50 dark:border-white/8 dark:bg-white/[0.02] dark:hover:bg-white/[0.05]":"border-sky-200 bg-sky-50/80 hover:bg-sky-100/80 dark:border-sky-400/18 dark:bg-sky-500/[0.07] dark:hover:bg-sky-500/[0.11]"}`,children:h.jsxs("div",{className:"flex items-start gap-4",children:[h.jsx("div",{className:`mt-1 h-11 w-11 shrink-0 rounded-2xl border flex items-center justify-center ${S.readAt?"border-slate-200 bg-slate-50 text-slate-500 dark:border-white/8 dark:bg-white/[0.04] dark:text-slate-400":"border-sky-200 bg-sky-100 text-sky-700 dark:border-sky-400/20 dark:bg-sky-500/12 dark:text-sky-300"}`,children:h.jsx(l2,{className:"h-[18px] w-[18px]"})}),h.jsx("div",{className:"min-w-0 flex-1",children:h.jsxs("div",{className:"flex items-start justify-between gap-3",children:[h.jsxs("div",{className:"min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("h4",{className:"truncate text-[15px] font-semibold text-slate-900 dark:text-white",children:x.title}),!S.readAt&&h.jsx("span",{className:"h-2 w-2 shrink-0 rounded-full bg-red-500"})]}),h.jsx("p",{className:"mt-1 text-sm leading-5 text-slate-600 dar
1220k:text-slate-300",children:x.body})]}),h.jsxs("div",{className:"flex shrink-0 items-center gap-3 pl-3",children:[h.jsx("span",{className:"text-xs text-slate-400 dark:text-slate-500",children:A}),h.jsx(RU,{className:"h-4 w-4 text-slate-400 transition-transform group-hover:translate-x-0.5 group-hover:text-slate-600 dark:text-slate-500 dark:group-hover:text-slate-300"})]})]})})]})},S.id)})})})]})]})]}),h.jsx("div",{className:"fixed inset-0 z-[220] md:hidden",role:"dialog","aria-modal":"true",children:h.jsx("div",{className:"absolute inset-0 bg-white text-slate-900 dark:bg-[#05060C] dark:text-white",children:f===null?h.jsxs("div",{className:"flex h-full flex-col",children:[h.jsxs("div",{className:"relative flex h-14 shrink-0 items-center justify-center border-b border-slate-200 bg-white px-4 dark:border-white/10 dark:bg-[#05060C]",children:[h.jsx("h2",{className:"text-base font-semibold",children:l("notifications.modal.title",{defaultValue:"Notifications"})}),h.jsx("button",{type:"button",onClick:i,className:"absolute right-4 rounded-full p-2 text-slate-500 dark:text-slate-400","aria-label":l("notifications.modal.close",{defaultValue:"Close"}),children:h.jsx(ml,{className:"h-5 w-5"})})]}),h.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:_.map(S=>{const x=FG[S],A=v[S]??null,I=A?Ag(A,l,u.language):null,$=(I==null?void 0:I.body)??l("notifications.modal.noItems",{defaultValue:"No notifications yet"}),O=A?kg(A.createdAt,u.language):"",P=g[S];return h.jsxs("button",{type:"button",onClick:()=>p(S),className:"flex w-full items-start gap-3 border-b border-slate-200 px-4 py-4 text-left dark:border-white/10",children:[h.jsx("div",{className:`mt-0.5 flex h-11 w-11 shrink-0 items-center justify-center rounded-full border ${P>0?"border-sky-200 bg-sky-100 text-sky-700 dark:border-sky-400/25 dark:bg-sky-500/12 dark:text-sky-300":"border-slate-200 bg-white text-slate-500 dark:border-white/10 dark:bg-white/[0.04] dark:text-slate-400"}`,children:h.jsx(x,{className:"h-[18px] w-[18px]"})}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"truncate text-sm font-medium text-slate-800 dark:text-white",children:l(`notifications.categories.${S}`,{defaultValue:S})}),P>0&&h.jsx("span",{className:"h-2 w-2 rounded-full bg-red-500"})]}),h.jsx("span",{className:"shrink-0 text-xs text-slate-400 dark:text-slate-500",children:O})]}),h.jsx("p",{className:"mt-1 truncate text-xs text-slate-400 dark:text-slate-500",children:$})]}),h.jsx(RU,{className:"mt-1 h-4 w-4 shrink-0 text-slate-400 dark:text-slate-500"})]},S)})})]}):h.jsxs("div",{className:"flex h-full flex-col",children:[h.jsxs("div",{className:"relative flex h-14 shrink-0 items-center justify-center border-b border-slate-200 bg-white px-4 dark:border-white/10 dark:bg-[#05060C]",children:[h.jsxs("button",{type:"button",onClick:()=>p(null),className:"absolute left-4 inline-flex items-center gap-1 text-sm text-slate-600 dark:text-slate-300","aria-label":l("notifications.mobile.back",{defaultValue:"Back"}),children:[h.jsx(YA,{className:"h-4 w-4"}),h.jsx("span",{children:l("notifications.mobile.back",{defaultValue:"Back"})})]}),h.jsx("h2",{className:"text-base font-semibold",children:l(`notifications.categories.${f}`,{defaultValue:f})}),h.jsx("button",{type:"button",onClick:i,className:"absolute right-4 rounded-full p-2 text-slate-500 dark:text-slate-400","aria-label":l("notifications.modal.close",{defaultValue:"Close"}),children:h.jsx(ml,{className:"h-5 w-5"})})]}),h.jsx("div",{className:"flex items-center justify-end border-b border-slate-200 px-4 py-3 dark:border-white/10",children:h.jsx("button",{type:"button",disabled:g[f]===0,onClick:()=>o(f),className:"text-sm font-medium text-slate-500 disabled:opacity-40 dark:text-slate-400",children:l("notifications.modal.markAllRead",{defaultValue:"Mark all as read"})})}),h.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:r?h.jsx("div",{className:"space-y-3",children:Array.from({length:6}).map((S,x)=>h.jsx("div",{className:"h-24 animate-pulse rounded-3xl border border-slate-200 bg-slate-100/80 dark:border-white/8 dark:bg-white/[0.03]"},x))}):C.length===0?h.jsxs("div",{className:"flex min-h-[220px] flex-col items-center justify-center rounded-[24px] border border-dashed border-slate-200 bg-slate-50/70 px-6 text-center dark:border-white/10 dark:bg-white/[0.02]",children:[h.jsx(l2,{className:"h-10 w-10 text-slate-400 dark:text-slate-500"}),h.jsx("h4",{className:"mt-4 text-lg font-semibold text-slate-900 dark:text-white",children:l("notifications.modal.emptyTitle",{defaultValue:"No notifications yet"})}),h.jsx("p",{className:"mt-2 text-sm leading-6 text-slate-500 dark:text-slate-400",children:l("notifications.modal.emptyBody",{defaultValue:"New notifications will appear here once orders, system events, tasks, or strategy signals are generated."})})]}):h.jsx("div",{className:"space-y-3",children:C.map(S=>{const x=Ag(S,l,u.language),A=kg(S.createdAt,u.language);return h.jsx("button",{type:"button",onClick:()=>a(S),className:`w-full rounded-[16px] border px-4 py-4 text-left ${S.readAt?"border-slate-200 bg-white dark:border-white/8 dark:bg-white/[0.02]":"border-sky-200 bg-sky-50/80 dark:border-sky-400/18 dark:bg-sky-500/[0.07]"}`,children:h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsx("div",{className:`mt-0.5 flex h-10 w-10 shrink-0 items-center justify-center rounded-2xl border ${S.readAt?"border-slate-200 bg-slate-50 text-slate-500 dark:border-white/8 dark:bg-white/[0.04] dark:text-slate-400":"border-sky-200 bg-sky-100 text-sky-700 dark:border-sky-400/20 dark:bg-sky-500/12 dark:text-sky-300"}`,children:h.jsx(l2,{className:"h-[18px] w-[18px]"})}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsxs("div",{className:"flex items-start justify-between gap-3",children:[h.jsx("h4",{className:"min-w-0 truncate text-[15px] font-semibold text-slate-900 dark:text-white",children:x.title}),h.jsx("span",{className:"shrink-0 text-xs text-slate-400 dark:text-slate-500",children:A})]}),h.jsx("p",{className:"mt-1 text-sm leading-5 text-slate-600 dar
1220k:text-slate-300",children:x.body})]})]})},S.id)})})})]})})})]}),document.body):null},dmt=({toasts:t,onDismiss:e,onClick:n})=>{const{t:r,i18n:i}=sr("common");return t.length===0?null:yu.createPortal(h.jsx("div",{className:"pointer-events-none fixed bottom-5 left-5 z-[170] flex w-[min(92vw,420px)] flex-col gap-3",children:t.map(s=>{const a=Ag(s,r,i.language),o=kg(s.createdAt,i.language);return h.jsx("div",{className:"pointer-events-auto rounded-[22px] border border-slate-200 bg-white/95 p-4 shadow-[0_24px_60px_rgba(15,23,42,0.18)] backdrop-blur dark:border-sky-400/18 dark:bg-[#0b1220]/96 dark:shadow-[0_24px_60px_rgba(0,0,0,0.45)]",children:h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsx("div",{className:"mt-0.5 flex h-10 w-10 shrink-0 items-center justify-center rounded-2xl border border-sky-200 bg-sky-100 text-sky-700 dark:border-sky-400/20 dark:bg-sky-500/12 dark:text-sky-300",children:h.jsx(l2,{className:"h-[18px] w-[18px]"})}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsxs("div",{className:"flex items-start justify-between gap-3",children:[h.jsxs("div",{className:"min-w-0",children:[h.jsx("p",{className:"truncate text-sm font-semibold text-slate-900 dark:text-white",children:a.title}),h.jsx("p",{className:"mt-1.5 text-sm leading-6 text-slate-600 dark:text-slate-300",children:a.body})]}),h.jsx("button",{type:"button",onClick:()=>e(s.id),className:"rounded-full border border-slate-200 bg-slate-50 p-1.5 text-slate-500 transition-colors hover:text-slate-900 dark:border-white/10 dark:bg-white/[0.03] dark:text-slate-400 dark:hover:text-white","aria-label":r("notifications.toast.dismiss",{defaultValue:"Dismiss"}),children:h.jsx(ml,{className:"h-3.5 w-3.5"})})]}),h.jsxs("div",{className:"mt-3 flex items-center justify-between gap-3",children:[h.jsx("span",{className:"text-xs text-slate-400 dark:text-slate-500",children:o}),h.jsx("button",{type:"button",onClick:()=>n(s),className:"rounded-full bg-slate-900 px-3 py-1.5 text-xs font-semibold text-white transition-colors hover:bg-slate-700 dark:bg-white dark:text-slate-950 dark:hover:bg-slate-100",children:r("notifications.toast.view",{defaultValue:"View"})})]})]})]})},s.id)})}),document.body)},Rue="tritonix_notification_sound_enabled";let OA=null,q$=!1;function hmt(){return typeof window>"u"?null:window.AudioContext||window.webkitAudioContext||null}function jue(){const t=hmt();return t?(OA||(OA=new t),OA):null}function fmt(){try{const t=localStorage.getItem(Rue);return t===null?!0:t!=="false"}catch{return!0}}function G4t(t){try{localStorage.setItem(Rue,t?"true":"false")}catch{}}async function pmt(){const t=jue();if(t)try{t.state==="suspended"&&await t.resume(),q$=t.state==="running"}catch{q$=!1}}function zG(t,e,n,r,i){const s=t.createOscillator(),a=t.createGain();s.type="sine",s.frequency.setValueAtTime(e,n),a.gain.setValueAtTime(1e-4,n),a.gain.exponentialRampToValueAtTime(i,n+.015),a.gain.exponentialRampToValueAtTime(1e-4,n+r),s.connect(a),a.connect(t.destination),s.start(n),s.stop(n+r+.02)}async function mmt(){if(!fmt()||typeof document<"u"&&document.hidden)return;const t=jue();if(t)try{if(t.state==="suspended"&&await t.resume(),t.state!=="running")return;q$=!0;const e=t.currentTime;zG(t,880,e,.12,.08),zG(t,1175,e+.1,.16,.06)}catch{}}const ymt=80,gmt=3;function bmt(t,e){const n=t.filter(r=>r.id!==e.id);return n.unshift(e),n.sort((r,i)=>Date.parse(i.createdAt)-Date.parse(r.createdAt)),n}function wmt(t){const[e,n]=N.useState([]),[r,i]=N.useState([]),[s,a]=N.useState("all"),[o,l]=N.useState(!1),u=N.useRef(!1);N.useEffect(()=>{if(!t){n([]),i([]),a("all"),u.current=!1;return}let b=!1;return l(!0),u.current=!1,(async()=>{const{data:v,error:_}=await Mn.from("user_notifications").select("*").eq("user_id",t).order("created_at",{ascending:!1}).limit(ymt);b||(_?(console.error("[notifications] failed to load notifications:",_),n([])):n((v??[]).map(C=>DG(C)).filter(C=>!!C)),u.current=!0,l(!1))})(),()=>{b=!0}},[t]),N.useEffect(()=>{if(!t)return;const b=Mn.channel(`user-notifications:${t}`).on("postgres_changes",{event:"*",schema:"public",table:"user_notifications",filter:`user_id=eq.${t}`},v=>{var C;if(v.eventType==="DELETE"){const S=(C=v.old)==null?void 0:C.id;if(!S)return;n(x=>x.filter(A=>A.id!==S)),i(x=>x.filter(A=>A.id!==S));return}const _=DG(v.new);if(_){if(n(S=>bmt(S,_)),v.eventType==="UPDATE"&&_.readAt){i(S=>S.filter(x=>x.id!==_.id));return}v.eventType==="INSERT"&&!_.readAt&&u.current&&(i(S=>{const x=S.filter(A=>A.id!==_.id);return[_,...x].slice(0,gmt)}),mmt())}}).subscribe();return()=>{Mn.removeChannel(b)}},[t]);const f=N.useMemo(()=>e.filter(b=>!b.readAt).length,[e]),p=N.useCallback(async b=>{const v=new Date().toISOString();n(C=>C.map(S=>S.id===b?{...S,readAt:v}:S)),i(C=>C.filter(S=>S.id!==b));const{error:_}=await Mn.from("user_notifications").update({read_at:v}).eq("id",b).is("read_at",null);
1220_&&console.error("[notifications] failed to mark as read:",_)},[]),y=N.useCallback(async b=>{const v=e.filter(S=>!S.readAt&&(b==="all"||S.category===b)).map(S=>S.id);if(v.length===0)return;const _=new Date().toISOString();n(S=>S.map(x=>v.includes(x.id)?{...x,readAt:_}:x)),i(S=>S.filter(x=>!v.includes(x.id)));const{error:C}=await Mn.from("user_notifications").update({read_at:_}).in("id",v).is("read_at",null);C&&console.error("[notifications] failed to mark all as read:",C)},[e]),g=N.useCallback(b=>{i(v=>v.filter(_=>_.id!==b))},[]);return{notifications:e,toasts:r,activeCategory:s,setActiveCategory:a,unreadCount:f,loading:o,markAsRead:p,markAllAsRead:y,dismissToast:g}}const Mue=N.createContext({unreadCount:0,openNotificationCenter:()=>{}});function vmt({value:t,children:e}){return h.jsx(Mue.Provider,{value:t,children:e})}function Y4t(){return N.useContext(Mue)}const dn=({children:t})=>{const{user:e,loading:n}=fc();return n?h.jsx(Due,{}):e?h.jsx(h.Fragment,{children:t}):h.jsx(xs,{to:"/",replace:!0})},_mt=()=>{const t=Zi(),e=t.pathname.replace(/^\/en/,"")||"/";return h.jsx(xs,{to:e+t.search+t.hash,replace:!0})},qt=t=>N.lazy(async()=>{try{return await t()}catch(e){const n="retry-lazy-refreshed";if(!sessionStorage.getItem(n))return sessionStorage.setItem(n,"true"),window.location.reload(),new Promise(()=>{});throw e}}),VG=qt(()=>Le(()=>import("./PricingPage-CnyQBD-v.js"),__vite__mapDeps([188,189]))),HG=qt(()=>Le(()=>import("./BlogPage-yoTZmgqn.js"),__vite__mapDeps([190,191,192,193]))),WG=qt(()=>Le(()=>import("./BlogPostPage-1TMEXpNz.js"),__vite__mapDeps([194,195,135,196,197,198,199,200,201,189,202,203,192,204]))),qG=qt(()=>Le(()=>import("./PressRoomPage-COQVhxrd.js"),__vite__mapDeps([205,206]))),ZG=qt(()=>Le(()=>import("./PressAnnouncementPage-i-n5CVr0.js"),__vite__mapDeps([207,206,203]))),KG=qt(()=>Le(()=>import("./NewsPage-DZqPEZWy.js"),__vite__mapDeps([208,1,2,3,4,5,6,209,210]))),GG=qt(()=>Le(()=>import("./NewsDetailPage-VtPzZl-B.js"),__vite__mapDeps([211,1,2,3,4,5,6,7,203]))),YG=qt(()=>Le(()=>import("./IdeasPage-DTp6Q_Hx.js"),__vite__mapDeps([212,213,214,215,1,2,3,4,5,6,216,217,218,191,209]))),JG=qt(()=>Le(()=>import("./IdeaDetailPage-yEenG40H.js"),__vite__mapDeps([219,202,213,214,215,1,2,3,4,5,6,216,217,218,220,221,222,223,224,192,204,203,225]))),XG=qt(()=>Le(()=>import("./PortfolioPage-DABUY73H.js"),__vite__mapDeps([226,201,189,221,227,5,228,229,230,231,216,232,233,214,234,235,192,236,237,238]))),QG=qt(()=>Le(()=>import("./AlphaWhalesPage-D1OJP8Qb.js"),__vite__mapDeps([239,201,189,221,240,218]))),eY=qt(()=>Le(()=>import("./WhaleDetailPage-lAcfMAiy.js"),__vite__mapDeps([241,201,189,221,227,5,228,229,230,231,216,232,233,214,3,4,235,236,237,238,240,192,204]))),tY=qt(()=>Le(()=>import("./ResearchStudioShell-Dz6vbLAR.js"),__vite__mapDeps([242,243]))),mw=qt(()=>Le(()=>import("./ResearchStudioPage-Dyc43hM3.js"),__vite__mapDeps([244,245,246,232,247,203,192,248,224,228,229,230,231,216,233,33,34,5,195,135,199,196,249,75,1,2,3,4,6,220,221,222,215,213,214,217,218,250,251,200,252,253,237,223,210,225,254,255,204,256,189,257,258,259,260,261,262,263,264,265,266,243,234,267,268,227,269,270,209,271,272,273,274,236,275]))),nY=qt(()=>Le(()=>import("./TvSnapshotRenderPage-DYqh6AKY.js"),__vite__mapDeps([276,222,2]))),rY=qt(()=>Le(()=>import("./SettingsPage-BiPt4i2J.js"),__vite__mapDeps([277,274,246,209,270,231,6,263,232,254,216,195,135,196,278,5,265,237]))),iY=qt(()=>Le(()=>import("./SettingsGuestGate-DxaMxdEq.js"),[])),sY=qt(()=>Le(()=>import("./TermsOfServicePage-BeW-Zx84.js"),[])),aY=qt(()=>Le(()=>import("./PrivacyPolicyPage-BDxLwo25.js"),[])),oY=qt(()=>Le(()=>import("./CybersecurityPolicyPage-DzrIigm_.js"),__vite__mapDeps([279,233]))),lY=qt(()=>Le(()=>import("./CreditGuidePage-BfCTuc94.js"),__vite__mapDeps([280,192,278,252]))),yw=qt(()=>Le(()=>import("./HelpCenterPage-BQjhT54Y.js"),__vite__mapDeps([281,203,217]))),cY=qt(()=>Le(()=>import("./ResetPasswordPage-CYRSe6N_.js"),[])),fo=qt(()=>Le(()=>import("./WatchPage-B5b5EE01.js"),__vite__mapDeps([282,221,248,224,228,229,230,231,216,232,233,33,34,5,195,135,199,196,249,75,1,2,3,4,6,220,222,215,213,214,217,218,250,251,200,252,253,237,223,210,225,203,254,246,240,283,273,238,284,285,286,7,256,255,204,189,197,198,258,257,265]))),Fd=qt(()=>Le(()=>import("./DiscoverPage-BEEXBAm4.js"),__vite__mapDeps([287,227,5,228,229,230,231,216,232,233,214,221,288,4,234,266,220,222,2,1,3,6,215,289,268,267,195,135,199,196,251,200,252,253,224,286,248,33,34,249,75,213,217,218,250,237,223,210,225,203,254,246,201,189,209,284,271,290,291]))),uY=qt(()=>Le(()=>import("./AgentFeaturePage-DeJTO-ym.js"),__vite__mapDeps([292,230,233,195,135,199,262,263,260,6,258,259,256,5,253,237,204,240,192,236,231,290,254,191,4]))),dY=qt(()=>Le(()=>import("./AiConsensusPickPage-BLo5HDdg.js"),__vite__mapDeps([293,253,237,233,240]))),hY=qt(()=>Le(()=>import("./InstitutionSmartMoneyPage-Du9MUZTx.js"),__vite__mapDeps([294,261,295,238,237,233]))),fY=qt(()=>Le(()=>import("./SocialAgentPage--WaHRdlE.js"),__vite__mapDeps([296,192,254,272,246]))),pY=qt(()=>Le(()=>import("./AiTechnicalAnalysisPage-DHbgmDS3.js"),__vite__mapDeps([297,220,221,222,2,1,3,4,5,6,215,223,224,217,237,254,240,192]))),mY=qt(()=>Le(()=>import("./CopyTradeFeaturePage-F1M-Jbky.js"),__vite__mapDeps([298,295,253,288,237,266,254]))),yY=qt(()=>Le(()=>import("./SwingTradeBotFeaturePage-CziSwjRU.js"),__vite__mapDeps([299,268,253,264,237]))),gY=qt(()=>Le(()=>import("./DayTradeBotFeaturePage-CtkqxGgE.js"),__vite__mapDeps([300,268,253,264,237]))),bY=qt(()=>Le(()=>import("./MarketDataPage-dHvbRcha.js"),__vite__mapDeps([301,253,283,233]))),wY=qt(()=>Le(()=>import("./ForBusinessPage-CdAOKScr.js"),__vite__mapDeps([302,233]))),vY=qt(()=>Le(()=>import("./ComparePage-CMf9wJWG.js"),__vite__mapDeps([303,201,189,240,261,237]))),_Y=qt(()=>Le(()=>import("./AboutPage-CtI3_T1h.js"),__vite__mapDeps([304,272,250,246,192,253,240,261]))),xmt=qt(()=>Le(()=>import("./ModelLandingPage-BeeUJHa2.js"),__vite__mapDeps([305,201,189,306,254,290]))),xY=qt(()=>Le(()=>import("./ConnectorPage-C0vo96xC.js"),__vite__mapDeps([307,284,269,214,265,259,229,230,231,216,232,233]))),gw=qt(()=>Le(()=>import("./AccountPage-wYiiTCMC.js"),__vite__mapDeps([308,228,229,230,231,216,232,233,248,224,33,34,5,195,135,199,196,249,75,1,2,3,4,6,220,221,222,215,213,214,217,218,250,251,200,252,253,237,223,210,225,203,254,246,271,309,285,286,7,0,257,272,291,306]))),zd=qt(()=>Le(()=>import("./CommunityPage-DcrupVOU.js"),__vite__mapDeps([309,248,224,228,229,230,231,216,232,233,33,34,5,195,135,199,196,249,75,1,2,3,4,6,220,221,222,215,213,214,217,218,250,251,200,252,253,237,223,210,225,203,254,246,271,285,286,7,0,257,272,291,306]))),CY=qt(()=>Le(()=>import("./SharedChatPage-zMTGkKB6.js"),__vite__mapDeps([310,247,203,232,192,223,273,274,216,236,258,237,210,262]))),$r=qt(()=>Le(()=>import("./SymbolSeoPage-CQY5Ihlm.js"),__vite__mapDeps([311,220,221,222,2,1,3,4,5,6,215,251,195,135,196,200,199,252,253,210,237,213,214,216,217,218,7,289,262]))),Due=()=>h.jsx("div",{className:"flex min-h-[100dvh] w-full shrink-0 items-center justify-center bg-white text-black dark:bg-black dark:text-white",role:"status","aria-label":"Loading page","aria-busy":"true",children:h.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-t-2 border-brand-500"})}),PA="tritonix_pending_referral_code",RA="tritonix_pending_referral_captured_at",Uue=t=>
1220{const e=t.split("/").filter(Boolean);return e.length>0&&Va.includes(e[0])?e[0]:null},Cmt=t=>{const e=Uue(t);return e?t.slice(`/${e}`.length)||"/":t},Emt=Va.map(t=>`/${t}`),Smt=()=>{const t=Bu(),e=Zi(),{i18n:n}=sr();N.useEffect(()=>{H0e(e.pathname)},[e.pathname]);const[r,i]=N.useState(!1),[s,a]=N.useState("signup"),{user:o}=fc(),[l,u]=N.useState(!1),[f,p]=N.useState(!1),[y,g]=N.useState(!1),b=360,v=72,_=N.useRef(null),{notifications:C,toasts:S,activeCategory:x,setActiveCategory:A,unreadCount:I,loading:$,markAsRead:O,markAllAsRead:P,dismissToast:j}=wmt(o==null?void 0:o.id);N.useEffect(()=>{const ve=()=>{pmt(),window.removeEventListener("pointerdown",ve),window.removeEventListener("keydown",ve)};return window.addEventListener("pointerdown",ve),window.addEventListener("keydown",ve),()=>{window.removeEventListener("pointerdown",ve),window.removeEventListener("keydown",ve)}},[]);const U=Uue(e.pathname)??(Va.includes(n.language)?n.language:null),z=U?`/${U}`:"",D=Cmt(e.pathname),R=D.startsWith("/studio"),W=D.startsWith("/connector"),T=D.startsWith("/account"),L=D.startsWith("/u/"),M=D.startsWith("/community"),Z=D.startsWith("/settings"),H=D.startsWith("/watch"),V=D.startsWith("/whales-institution"),F=D==="/discover"||D.startsWith("/discover/"),q=D.startsWith("/consensus"),G=D.startsWith("/help"),Y=D.startsWith("/stock/")||D.startsWith("/dr/"),X=QP(D),te=R||H||Z&&!!o||W||T||L||F||M,ie=!te&&!M&&!(o&&V)&&!(o&&F)&&!(o&&q)&&!G,se=b1t({userPresent:!!o,isAppRoute:te,isConsensusRoute:q,isWhalesRoute:V,isDiscoverRoute:F}),pe=w1t(!!o,D),xe=o&&!X?l?b:v:0,Te=D==="/";N.useEffect(()=>{const ve="G-PQMDLQXSDE",et=ec();(et.analytics||et.ads)&&bB(ve);const rn=br=>{const $n=br.detail;!($n!=null&&$n.analytics)&&!($n!=null&&$n.ads)||bB(ve)&&$n.analytics&&wB(!0)};return window.addEventListener(rg,rn),sessionStorage.removeItem("retry-lazy-refreshed"),()=>window.removeEventListener(rg,rn)},[]),N.useEffect(()=>{const ve=()=>{d3((o==null?void 0:o.id)??null,(o==null?void 0:o.email)??null)};return ve(),window.addEventListener(rg,ve),()=>window.removeEventListener(rg,ve)},[o==null?void 0:o.id,o==null?void 0:o.email]),N.useEffect(()=>{wB()},[e]),N.useEffect(()=>{o!=null&&o.id&&K3e(e.pathname)},[e.pathname,o==null?void 0:o.id]),N.useEffect(()=>{if(!o)return;let ve=null;try{ve=sessionStorage.getItem("tx_pending_oauth")}catch{ve=null}if(!ve)return;try{sessionStorage.removeItem("tx_pending_oauth")}catch{}const et=o.created_at?new Date(o.created_at).getTime():0,rn=et>0&&Date.now()-et<300*1e3,br=$6e();rn&&bX(br??c7());let $n=!1;return d3(o.id,o.email).then(()=>{$n||(rn?dI("google",o.id):hI("google"))}),()=>{$n=!0}},[o]),N.useEffect(()=>{if(o)return;const et=(new URLSearchParams(e.search).get("ref")??"").trim().toUpperCase();et&&(localStorage.setItem(PA,et),localStorage.setItem(RA,Date.now().toString()))},[e.search,o]),N.useEffect(()=>{if(!(o!=null&&o.id))return;const ve=(localStorage.getItem(PA)??"").trim().toUpperCase(),et=Number(localStorage.getItem(RA)??"0");if(!ve||_.current===o.id)return;_.current=o.id;let rn=!1;const br=()=>{localStorage.removeItem(PA),localStorage.removeItem(RA)},$n=jr=>new Promise(ar=>setTimeout(ar,jr));return(async()=>{let jr=!1;try{const{data:{session:ar}}=await Mn.auth.getSession();if(!(ar!=null&&ar.access_token)){jr=!0;return}for(let Mr=0;Mr<3;Mr++){const In=await fetch("/api/referral-bind",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${ar.access_token}`},body:JSON.stringify({ref:ve,capturedAt:et})}),Tr=await In.json().catch(()=>({})),ln=Tr.status??Tr.error??"server_error";if(In.status===409&&ln==="profile_not_ready"){if(Mr<2){await $n(1200*(Mr+1));continue}jr=!0;return}if(!In.ok){jr=!0;return}["bound","already_bound","invalid_referral_code","self_referral","not_new_signup"].includes(ln)?br():jr=!0;return}}catch{jr=!0}finally{!rn&&jr&&(_.current=null)}})(),()=>{rn=!0}},[o==null?void 0:o.id]),N.useEffect(()=>{const ve=document.getElementById("main-scroll");ve?ve.scrollTop=0:window.scrollTo(0,0)},[e.pathname]);const Et=()=>{const ve=D;return ve==="/"?"home":ve.startsWith("/pricing")?"pricing":ve.startsWith("/blog")?"blog":ve.startsWith("/press")?"press":ve.startsWith("/news")?"news":ve.startsWith("/ideas")?"ideas":ve.startsWith("/consensus")?"portfolio":ve.startsWith("/whales-institution")?"whales":ve==="/discover"?"discover":ve.startsWith("/earnings")?"earnings-calendar":ve.startsWith("/studio")?"research-studio":ve.startsWith("/settings")?"settings":ve.startsWith("/terms")?"terms":ve.startsWith("/privacy")?"privacy":ve.startsWith("/cybersecurity-policy")?"cybersecurity-policy":ve.startsWith("/help")?"help":ve.startsWith("/market-data")?"market-data":ve.startsWith("/for-business")?"for-business":ve.startsWith("/about")?"about":"home"},Ke=(ve="signup")=>{a(ve),i(!0)};N.useEffect(()=>{const ve=et=>{var rn;p(((rn=et.detail)==null?void 0:rn.hasUnread)??!1)};return window.addEventListener("studioUnreadChange",ve),()=>window.removeEventListener("studioUnreadChange",ve)},[]),N.useEffect(()=>{const ve=et=>{var rn;Ke(((rn=et.detail)==null?void 0:rn.view)||"signup")};return window.addEventListener("open-auth-modal",ve),()=>{window.removeEventListener("open-auth-modal",ve)}},[]);const Ge=ve=>{typeof ve=="object"&&ve.page==="settings"?t(`${z}/settings?tab=${ve.tab}`):t(ve==="home"?`${z}/`:ve==="portfolio"?`${z}/consensus`:ve==="news"?`${z}/news`:ve==="press"?`${z}/press`:ve==="whales"?`${z}/whales-institution`:ve==="earnings-calendar"?`${z}/earnings`:ve==="research-studio"?`${z}/studio`:ve==="whale-detail"?`${z}/whales-institution`:ve==="transcript-detail"?`${z}/earnings/transcript`:ve==="blog-post"?`${z}/blog/post`:ve==="terms"?`${z}/terms`:ve==="privacy"?`${z}/privacy`:ve==="cybersecurity-policy"?`${z}/cybersecurity-policy`:ve==="help"?`${z}/help`:ve==="market-data"?`${z}/market-data`:ve==="about"?`${z}/about`:`${z}/${ve}`)},nn=ve=>ve?/^https?:\/\//i.test(ve)?ve:ve.startsWith("/")?Emt.some(rn=>ve===rn||ve.startsWith(`${rn}/`))||!z?ve:ve==="/"?`${z}/`:`${z}${ve}`:ve:z?`${z}/watch`:"/watch",yr=()=>{g(!0)},gr=async ve=>{ve.readAt||await O(ve.id),j(ve.id),g(!1);const et=nn(ve.actionUrl);if(/^https?:\/\//i.test(et)){window.location.href=et;return}t(et)};return h.jsx(vmt,{value:{unreadCount:I,openNotificationCenter:yr},children:h.jsxs("div",{className:"relative flex h-[100dvh] w-full flex-col overflow-hidden bg-white text-black selection:bg-brand-500 selection:text-white dark:bg-black dark:text-white",children:[h.jsx(Q0t,{enabled:g1t(D,!!o,r)}),h.jsx(n1t,{}),h.jsx(p1t,{route:uI(e.pathname)}),!te&&h.jsx(u6e,{}),se&&h.jsx(E6e,{currentPage:Et(),onNavigate:Ge,onOpenAuth:Ke,leftOffset:xe,heroIsDark:Te||D==="/market-data"||D.startsWith("/models")}),h.jsxs("div",{id:"main-scroll",className:`flex-1 ${te?"overflow-hidden":"overflow-y-auto"} ${q?"scrollbar-subtle":""} ${Y?"symbol-seo-scroll":""} md:ml-[var(--sidebar-width)] ml-0 ${o&&!te?"pb-[60px] md:pb-0":""} transition-none flex flex-col relative`,style:{"--sidebar-width":`${xe}px`},children:[h.jsx("main",{className:`flex-1 flex flex-col relative ${te?"min-h-0 overflow-hidden":""}`,children:h.jsx(N.Suspense,{fallback:h.jsx(Due,{}),children:h.jsxs(tfe,{children:[h.jsx(we,{path:"/",element:h.jsx(IB,{onOpenAuth:Ke,onViewTranscript:()=>t("/earnings/transcript")})}),h.jsx(we,{path:"/pricing",element:h.jsxs(h.Fragment,{children:[h.jsx(Ir,{title:"Our Pricing - 20% Off Subscription Plans - Tritonix AIâ¢",description:"Register free and get 300 credits to explore Tritonix AI investing plans for stock research, alerts, agent workflows, and institutional market intelligence.",canonical:"/pricing"}),h.jsx(VG,{onOpenAuth:Ke})]})}),h.jsx(we,{path:"/blog",element:h.jsxs(h.Fragment,{children:[h.jsx(Ir,{title:"Master the Markets - Financial Insights - Tritonix AIâ¢",description:"Master the markets by learning our financial insights on the stock market, industry trends, and how AI can help you become a better investor.",canonical:"/blog"}),h.jsx(HG,{onReadPost:ve=>t(`/blog/${ve.slug}`)})]})}),h.jsx(we,{path:"/blog/:slug",element:h.jsx(h.Fragment,{children:h.jsx(WG,{onBack:()=>t("/blog")})})}),h.jsx(we,{path:"/press",element:h.jsxs(h.Fragment,{children:[h.jsx(Ir,{title:"Press Room - Tritonix.ai",description:"Official announcements, partnerships, and product milestones from Tritonix.ai.",canonical:"/press"}),h.jsx(qG,{})]})}),h.jsx(we,{path:"/press/:slug",element:h.jsx(ZG,{})}),h.jsx(we,{path:"/news",element:h.jsxs(h.Fragment,{children:[h.jsx(Ir,{title:"Global Briefing - Tritonix.ai",description:"A rich newsroom-style global market news hub with region tabs, live wire updates, sector coverage and macro calendar context.",canonical:"/news",noindex:!0}),h.jsx(KG,{})]})}),h.jsx(we,{path:"/news/:slug",element:h.jsx(GG,{})}),h.jsx(we,{path:"/ideas",element:h.jsxs(h.Fragment,{children:[h.jsx(Ir,{title:"Trading Ideas Marketplace - Tritonix.ai",description:"Browse public TradingView-native trade ideas across stocks, crypto, forex, and macro markets. Filter by direction, timeframe, and asset type, then open each setup in Tritonix.",canonical:"/ideas"}),h.jsx(YG,{onOpenAuth:Ke})]})}),h.jsx(we,{path:"/ideas/:slug",element:h.jsx(JG,{onOpenAuth:Ke})}),h.jsx(we,{path:"/stock/:symbolSlug",element:h.jsx($r,{assetType:"stock"})}),h.jsx(we,{path:"/stock/:symbolSlug/news",element:h.jsx($r,{assetType:"stock",pageMode:"news"})}),h.jsx(we,{path:"/stock/:symbolSlug/technical",element:h.jsx($r,{assetType:"stock",pageMode:"technical"})}),h.jsx(we,{path:"/stock/:symbolSlug/options",element:h.jsx($r,{assetType:"stock",pageMode:"options"})}),h.jsx(we,{path:"/stock/:symbolSlug/earnings",element:h.jsx($r,{assetType:"stock",pageMode:"earnings"})}),h.jsx(we,{path:"/stock/:symbolSlug/financials",element:h.jsx($r,{assetType:"stock",pageMode:"financials"})}),h.jsx(we,{path:"/dr/:symbolSlug",element:h.jsx($r,{assetType:"dr"})}),h.jsx(we,{path:"/dr/:symbolSlug/news",element:h.jsx($r,{assetType:"dr",pageMode:"news"})}),h.jsx(we,{path:"/dr/:symbolSlug/technical",element:h.jsx($r,{assetType:"dr",pageMode:"technical"})}),h.jsx(we,{path:"/dr/:symbolSlug/options",element:h.jsx($r,{assetType:"dr",pageMode:"options"})}),h.jsx(we,{path:"/dr/:symbolSlug/earnings",element:h.jsx($r,{assetType:"dr",pageMode:"earnings"})}),h.jsx(we,{path:"/dr/:symbolSlug/financials",element:h.jsx($r,{assetType:"dr",pageMode:"financials"})}),h.jsx(we,{path:"/consensus",element:h.jsxs(h.Fragment,{children:[h.jsx(Ir,{title:"Tritonix AI Consensus Portfolio",description:"A high-conviction portfolio derived from analyzing 3,000+ institutional filings. See the stocks where the 'Smart Money' overlaps.",canonical:"/consensus"}),h.jsx(XG,{})]})}),h.jsx(we,{path:"/whales-institution",element:h.jsxs(h.Fragment,{children:[h.jsx(Ir,{title:"Hedge Fund Leaderboard & 13F Tracker - Tritonix.ai",description:"Track and clone the portfolios of top institutional investors like Bill Ackman and David Tepper. Real-time simulation of 13F filings.",canonical:"/whales-institution",noindex:!0}),h.jsx(QG,{onViewFund:ve=>t(`/whales-institution/${ve}`)})]})}),h.jsx(we,{path:"/whales-institution/detail",element:h.jsx(xs,{to:"/whales-institution",replace:!0})}),h.jsx(we,{path:"/whales-institution/:slug",element:h.jsx(eY,{onBack:()=>t("/whales-institution")})}),h.jsxs(we,{path:"/studio",element:h.jsx(dn,{children:h.jsx(tY,{})}),children:[h.jsx(we,{index:!0,element:h.jsx(mw,{})}),h.jsx(we,{path:":sessionId",element:h.jsx(mw,{})})]}),h.jsx(we,{path:"/share/:shareToken",element:h.jsx(CY,{})}),h.jsx(we,{path:"/connector",element:h.jsx(dn,{children:h.jsx(xY,{})})}),h.jsx(we,{path:"/account",element:h.jsx(dn,{children:h.jsx(gw,{})})}),h.jsx(we,{path:"/u/:username",element:h.jsx(dn,{children:h.jsx(gw,{})})}),h.jsx(we,{path:"/community",element:h.jsx(dn,{children:h.jsx(zd,{})})}),h.jsx(we,{path:"/community/connect",element:h.jsx(dn,{children:h.jsx(zd,{})})}),h.jsx(we,{path:"/community/hashtag/:tag",element:h.jsx(dn,{children:h.jsx(zd,{})})}),h.jsx(we,{path:"/community/:postId",element:h.jsx(dn,{children:h.jsx(zd,{})})}
1220),h.jsx(we,{path:"/tv-snapshot-render",element:h.jsx(nY,{})}),h.jsx(we,{path:"/settings",element:h.jsx(h.Fragment,{children:o?h.jsxs(h.Fragment,{children:[h.jsx(Ir,{title:"Account Settings - Tritonix.ai",description:"Manage your Tritonix account, subscription, and notification preferences.",canonical:"/settings"}),h.jsx(rY,{})]}):h.jsx(iY,{onOpenAuth:Ke})})}),h.jsx(we,{path:"/terms",element:h.jsxs(h.Fragment,{children:[h.jsx(Ir,{title:"Terms of Service - Tritonix.ai",description:"Read our Terms of Service to understand the rules, regulations, and policies governing your use of the Tritonix.ai financial intelligence platform.",canonical:"/terms"}),h.jsx(sY,{onBack:()=>t("/")})]})}),h.jsx(we,{path:"/credit-guide",element:h.jsxs(h.Fragment,{children:[h.jsx(Ir,{title:"Credit Guide - Tritonix.ai",description:"Learn how credits work on Tritonix.ai, including types, acquisition, and usage rules.",canonical:"/credit-guide"}),h.jsx(lY,{onBack:()=>t("/")})]})}),h.jsx(we,{path:"/privacy",element:h.jsxs(h.Fragment,{children:[h.jsx(Ir,{title:"Privacy Policy - Tritonix.ai",description:"Learn how Tritonix.ai collects, uses, and protects your personal and financial data. We are committed to your privacy and security.",canonical:"/privacy"}),h.jsx(aY,{onBack:()=>t("/")})]})}),h.jsx(we,{path:"/cybersecurity-policy",element:h.jsxs(h.Fragment,{children:[h.jsx(Ir,{title:"Cybersecurity Policy - Tritonix.ai",description:"Review Tritonix.ai's cybersecurity policy, including data handling, access control, encryption, vulnerability management, incident response, physical security, and vendor risk management.",canonical:"/cybersecurity-policy"}),h.jsx(oY,{onBack:()=>t("/")})]})}),h.jsx(we,{path:"/help",element:h.jsx(yw,{})}),h.jsx(we,{path:"/help/:slug",element:h.jsx(yw,{})}),h.jsx(we,{path:"/reset-password",element:h.jsxs(h.Fragment,{children:[h.jsx(Ir,{title:"Reset Password - Tritonix.ai",description:"Reset your account password.",canonical:"/reset-password"}),h.jsx(cY,{})]})}),h.jsx(we,{path:"/discover",element:h.jsx(dn,{children:h.jsx(Fd,{})})}),h.jsx(we,{path:"/discover/bot",element:h.jsx(dn,{children:h.jsx(Fd,{})})}),h.jsx(we,{path:"/discover/dashboard",element:h.jsx(dn,{children:h.jsx(Fd,{})})}),h.jsx(we,{path:"/discover/my-automation",element:h.jsx(xs,{to:"/discover/dashboard",replace:!0})}),h.jsx(we,{path:"/discover/create",element:h.jsx(xs,{to:"/discover/bot",replace:!0})}),h.jsx(we,{path:"/discover/day-trade/:slug",element:h.jsx(dn,{children:h.jsx(Fd,{})})}),h.jsx(we,{path:"/watch",element:h.jsx(xs,{to:"/watch/crypto",replace:!0})}),h.jsx(we,{path:"/watch/watchlist",element:h.jsx(dn,{children:h.jsx(fo,{})})}),h.jsx(we,{path:"/watch/opportunities/ai-premarket-pick",element:h.jsx(dn,{children:h.jsx(fo,{})})}),h.jsx(we,{path:"/watch/opportunities/macro-ai-pick",element:h.jsx(dn,{children:h.jsx(fo,{})})}),h.jsx(we,{path:"/watch/opportunities/crypto-daytrading",element:h.jsx(xs,{to:"/watch/opportunities/ai-premarket-pick",replace:!0})}),h.jsx(we,{path:"/watch/daily-brief",element:h.jsx(xs,{to:"/watch/opportunities/ai-premarket-pick",replace:!0})}),h.jsx(we,{path:"/watch/crypto",element:h.jsx(dn,{children:h.jsx(fo,{})})}),h.jsx(we,{path:"/watch/macro",element:h.jsx(dn,{children:h.jsx(fo,{})})}),h.jsx(we,{path:"/watch/prediction",element:h.jsx(dn,{children:h.jsx(fo,{})})}),h.jsx(we,{path:"/ai-investment-agent",element:h.jsxs(h.Fragment,{children:[h.jsx(Ir,{title:"AI Investment Agent â Tritonix.ai",description:"Your always-on investment companion. Monitors markets, schedules reports, and thinks ahead â so you don't have to.",canonical:"/ai-investment-agent"}),h.jsx(uY,{onOpenAuth:ve=>{a(ve),i(!0)}})]})}),h.jsx(we,{path:"/ai-consensus-pick",element:h.jsx(dY,{onOpenAuth:ve=>{a(ve),i(!0)}})}),h.jsx(we,{path:"/institution-smart-money",element:h.jsx(hY,{onOpenAuth:ve=>{a(ve),i(!0)}})}),h.jsx(we,{path:"/ai-social-agent",element:h.jsx(fY,{onOpenAuth:ve=>{a(ve),i(!0)}})}),h.jsx(we,{path:"/ai-technical-analysis",element:h.jsx(pY,{onOpenAuth:ve=>{a(ve),i(!0)}})}),h.jsx(we,{path:"/copy-trade",element:h.jsx(mY,{onOpenAuth:ve=>{a(ve),i(!0)}})}),h.jsx(we,{path:"/swing-trade-bot",element:h.jsx(yY,{onOpenAuth:ve=>{a(ve),i(!0)}})}),h.jsx(we,{path:"/day-trade-bot",element:h.jsx(gY,{onOpenAuth:ve=>{a(ve),i(!0)}})}),h.jsx(we,{path:"/market-data",element:h.jsx(bY,{onOpenAuth:ve=>{a(ve),i(!0)}})}),h.jsx(we,{path:"/for-business",element:h.jsx(wY,{onOpenAuth:ve=>{a(ve),i(!0)}})}),h.jsx(we,{path:"/compare/:slug",element:h.jsx(h.Fragment,{children:h.jsx(vY,{onOpenAuth:ve=>{a(ve),i(!0)}})})}),h.jsx(we,{path:"/about",element:h.jsxs(h.Fragment,{children:[h.jsx(Ir,{title:"About Us â Tritonix.ai",description:"Tritonix.ai helps individual investors make smarter, faster decisions through AI-powered research, proven investment strategies, and institutional smart money tracking.",canonical:"/about"}),h.jsx(_Y,{})]})}),h.jsx(we,{path:"/models/:model",element:h.jsx(xmt,{onOpenAuth:Ke})}),Va.map(ve=>h.jsxs(we,{path:`/${ve}`,element:h.jsx(r1t,{}),children:[h.jsx(we,{index:!0,element:h.jsx(IB,{onOpenAuth:Ke,onViewTranscript:()=>t("/earnings/transcript")})}),h.jsx(we,{path:"pricing",element:h.jsxs(h.Fragment,{children:[h.jsx(Ir,{title:"Our Pricing - 20% Off Subscription Plans - Tritonix AIâ¢",description:"Register free and get 300 credits to explore Tritonix AI investing plans for stock research, alerts, agent workflows, and institutional market intelligence.",canonical:"/pricing"}),h.jsx(VG,{onOpenAuth:Ke})]})}),h.jsx(we,{path:"blog",element:h.jsxs(h.Fragment,{children:[h.jsx(Ir,{title:"Master the Markets - Financial Insights - Tritonix AIâ¢",description:"Master the markets by learning our financial insights on the stock market, industry trends, and how AI can help you become a better investor.",canonical:"/blog"}),h.jsx(HG,{onReadPost:et=>t(`${z}/blog/${et.slug}`)})]})}),h.jsx(we,{path:"blog/:slug",element:h.jsx(WG,{onBack:()=>t(`${z}/blog`)})}),h.jsx(we,{path:"press",element:h.jsxs(h.Fragment,{children:[h.jsx(Ir,{title:"Press Room - Tritonix.ai",description:"Official announcements, partnerships, and product milestones from Tritonix.ai.",canonical:"/press"}),h.jsx(qG,{})]})}),h.jsx(we,{path:"press/:slug",element:h.jsx(ZG,{})}),h.jsx(we,{path:"news",element:h.jsxs(h.Fragment,{children:[h.jsx(Ir,{title:"Global Briefing - Tritonix.ai",description:"A rich newsroom-style global market news hub with region tabs, live wire updates, sector coverage and macro calendar context.",canonical:"/news",noindex:!0}),h.jsx(KG,{})]})}),h.jsx(we,{path:"news/:slug",element:h.jsx(GG,{})}),h.jsx(we,{path:"ideas",element:h.jsxs(h.Fragment,{children:[h.jsx(Ir,{title:"Trading Ideas Marketplace - Tritonix.ai",description:"Browse public TradingView-native trade ideas across stocks, crypto, forex, and macro markets.",canonical:"/ideas"}),h.jsx(YG,{onOpenAuth:Ke})]})}),h.jsx(we,{path:"ideas/:slug",element:h.jsx(JG,{onOpenAuth:Ke})}),h.jsx(we,{path:"stock/:symbolSlug",element:h.jsx($r,{assetType:"stock"})}),h.jsx(we,{path:"stock/:symbolSlug/news",element:h.jsx($r,{assetType:"stock",pageMode:"news"})}),h.jsx(we,{path:"stock/:symbolSlug/technical",element:h.jsx($r,{assetType:"stock",pageMode:"technical"})}),h.jsx(we,{path:"stock/:symbolSlug/options",element:h.jsx($r,{assetType:"stock",pageMode:"options"})}),h.jsx(we,{path:"stock/:symbolSlug/earnings",element:h.jsx($r,{assetType:"stock",pageMode:"earnings"})}),h.jsx(we,{path:"stock/:symbolSlug/financials",element:h.jsx($r,{assetType:"stock",pageMode:"financials"})}),h.jsx(we,{path:"dr/:symbolSlug",element:h.jsx($r,{assetType:"dr"})}),h.jsx(we,{path:"dr/:symbolSlug/news",element:h.jsx($r,{assetType:"dr",pageMode:"news"})}),h.jsx(we,{path:"dr/:symbolSlug/technical",element:h.jsx($r,{assetType:"dr",pageMode:"technical"})}),h.jsx(we,{path:"dr/:symbolSlug/options",element:h.jsx($r,{assetType:"dr",pageMode:"options"})}),h.jsx(we,{path:"dr/:symbolSlug/earnings",element:h.jsx($r,{assetType:"dr",pageMode:"earnings"})}),h.jsx(we,{path:"dr/:symbolSlug/financials",element:h.jsx($r,{assetType:"dr",pageMode:"financials"})}),h.jsx(we,{path:"consensus",element:h.jsxs(h.Fragment,{children:[h.jsx(Ir,{title:"Tritonix AI Consensus Portfolio",description:"A high-conviction portfolio derived from analyzing 3,000+ institutional filings.",canonical:"/consensus"}),h.jsx(XG,{})]})}),h.jsx(we,{path:"whales-institution",element:h.jsxs(h.Fragment,{children:[h.jsx(Ir,{title:"Hedge Fund Leaderboard & 13F Tracker - Tritonix.ai",description:"Track and clone the portfolios of top institutional investors.",canonical:"/whales-institution",noindex:!0}),h.jsx(QG,{onViewFund:et=>t(`${z}/whales-institution/${et}`)})]})}),h.jsx(we,{path:"whales-institution/detail",element:h.jsx(xs,{to:`${z}/whales-institution`,replace:!0})}),h.jsx(we,{path:"whales-institution/:slug",element:h.jsx(eY,{onBack:()=>t(`${z}/whales-institution`)})}),h.jsxs(we,{path:"studio",element:h.jsx(dn,{children:h.jsx(tY,{})}),children:[h.jsx(we,{index:!0,element:h.jsx(mw,{})}),h.jsx(we,{path:":sessionId",element:h.jsx(mw,{})})]}),h.jsx(we,{path:"share/:shareToken",element:h.jsx(CY,{})}),h.jsx(we,{path:"connector",element:h.jsx(dn,{children:h.jsx(xY,{})})}),h.jsx(we,{path:"account",element:h.jsx(dn,{children:h.jsx(gw,{})})}),h.jsx(we,{path:"u/:username",element:h.jsx(dn,{children:h.jsx(gw,{})})}),h.jsx(we,{path:"community",element:h.jsx(dn,{children:h.jsx(zd,{})})}),h.jsx(we,{path:"community/connect",element:h.jsx(dn,{children:h.jsx(zd,{})})}),h.jsx(we,{path:"community/hashtag/:tag",element:h.jsx(dn,{children:h.jsx(zd,{})})}),h.jsx(we,{path:"community/:postId",element:h.jsx(dn,{children:h.jsx(zd,{})})}
1220),h.jsx(we,{path:"tv-snapshot-render",element:h.jsx(nY,{})}),h.jsx(we,{path:"settings",element:o?h.jsx(rY,{}):h.jsx(iY,{onOpenAuth:Ke})}),h.jsx(we,{path:"terms",element:h.jsx(sY,{onBack:()=>t(`${z}/`)})}),h.jsx(we,{path:"credit-guide",element:h.jsx(lY,{onBack:()=>t(`${z}/`)})}),h.jsx(we,{path:"privacy",element:h.jsx(aY,{onBack:()=>t(`${z}/`)})}),h.jsx(we,{path:"cybersecurity-policy",element:h.jsx(oY,{onBack:()=>t(`${z}/`)})}),h.jsx(we,{path:"help",element:h.jsx(yw,{})}),h.jsx(we,{path:"help/:slug",element:h.jsx(yw,{})}),h.jsx(we,{path:"reset-password",element:h.jsx(cY,{})}),h.jsx(we,{path:"discover",element:h.jsx(dn,{children:h.jsx(Fd,{})})}),h.jsx(we,{path:"discover/bot",element:h.jsx(dn,{children:h.jsx(Fd,{})})}),h.jsx(we,{path:"discover/dashboard",element:h.jsx(dn,{children:h.jsx(Fd,{})})}),h.jsx(we,{path:"discover/my-automation",element:h.jsx(xs,{to:"../dashboard",replace:!0})}),h.jsx(we,{path:"discover/create",element:h.jsx(xs,{to:"../bot",replace:!0})}),h.jsx(we,{path:"discover/day-trade/:slug",element:h.jsx(dn,{children:h.jsx(Fd,{})})}),h.jsx(we,{path:"watch",element:h.jsx(xs,{to:`${z}/watch/crypto`,replace:!0})}),h.jsx(we,{path:"watch/watchlist",element:h.jsx(dn,{children:h.jsx(fo,{})})}),h.jsx(we,{path:"watch/opportunities/ai-premarket-pick",element:h.jsx(dn,{children:h.jsx(fo,{})})}),h.jsx(we,{path:"watch/opportunities/macro-ai-pick",element:h.jsx(dn,{children:h.jsx(fo,{})})}),h.jsx(we,{path:"watch/opportunities/crypto-daytrading",element:h.jsx(xs,{to:`${z}/watch/opportunities/ai-premarket-pick`,replace:!0})}),h.jsx(we,{path:"watch/daily-brief",element:h.jsx(xs,{to:`${z}/watch/opportunities/ai-premarket-pick`,replace:!0})}),h.jsx(we,{path:"watch/crypto",element:h.jsx(dn,{children:h.jsx(fo,{})})}),h.jsx(we,{path:"watch/macro",element:h.jsx(dn,{children:h.jsx(fo,{})})}),h.jsx(we,{path:"watch/prediction",element:h.jsx(dn,{children:h.jsx(fo,{})})}),h.jsx(we,{path:"ai-investment-agent",element:h.jsxs(h.Fragment,{children:[h.jsx(Ir,{title:"AI Investment Agent â Tritonix.ai",description:"Your always-on investment companion.",canonical:"/ai-investment-agent"}),h.jsx(uY,{onOpenAuth:et=>{a(et),i(!0)}})]})}),h.jsx(we,{path:"ai-consensus-pick",element:h.jsx(dY,{onOpenAuth:et=>{a(et),i(!0)}})}),h.jsx(we,{path:"institution-smart-money",element:h.jsx(hY,{onOpenAuth:et=>{a(et),i(!0)}})}),h.jsx(we,{path:"ai-social-agent",element:h.jsx(fY,{onOpenAuth:et=>{a(et),i(!0)}})}),h.jsx(we,{path:"ai-technical-analysis",element:h.jsx(pY,{onOpenAuth:et=>{a(et),i(!0)}})}),h.jsx(we,{path:"copy-trade",element:h.jsx(mY,{onOpenAuth:et=>{a(et),i(!0)}})}),h.jsx(we,{path:"swing-trade-bot",element:h.jsx(yY,{onOpenAuth:et=>{a(et),i(!0)}})}),h.jsx(we,{path:"day-trade-bot",element:h.jsx(gY,{onOpenAuth:et=>{a(et),i(!0)}})}),h.jsx(we,{path:"market-data",element:h.jsx(bY,{onOpenAuth:et=>{a(et),i(!0)}})}),h.jsx(we,{path:"for-business",element:h.jsx(wY,{onOpenAuth:et=>{a(et),i(!0)}})}),h.jsx(we,{path:"compare/:slug",element:h.jsx(vY,{onOpenAuth:et=>{a(et),i(!0)}})}),h.jsx(we,{path:"about",element:h.jsx(_Y,{})})]},ve)),h.jsx(we,{path:"/en",element:h.jsx(xs,{to:"/",replace:!0})}),h.jsx(we,{path:"/en/*",element:h.jsx(_mt,{})})]})})}),ie&&h.jsx(S6e,{onNavigate:Ge,onOpenAuth:Ke,lightSurface:!Te&&D!=="/market-data"&&!D.startsWith("/models")})]}),pe&&h.jsx(tmt,{isOpen:l,setIsOpen:u,width:b,collapsedWidth:v,studioHasUnread:f,notificationUnreadCount:I,onOpenNotifications:yr}),o&&h.jsxs(h.Fragment,{children:[h.jsx(umt,{isOpen:y,notifications:C,activeCategory:x,loading:$,onClose:()=>g(!1),onSelectCategory:A,onNotificationClick:gr,onMarkAllRead:P}),h.jsx(dmt,{toasts:S,onDismiss:j,onClick:gr})]}),h.jsx(M6e,{isOpen:r,onClose:()=>i(!1),initialView:s})]})})},Amt=()=>h.jsx(a3e,{children:h.jsx(W0t,{children:h.jsx(Smt,{})})});class Bue extends N.Component{constructor(){super(...arguments),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,n){console.error("Uncaught error:",e,n)}render(){return this.state.hasError?this.props.fallback||h.jsx("div",{className:"min-h-screen bg-black text-white p-8",children:h.jsxs("div",{className:"max-w-3xl mx-auto bg-red-900/20 border border-red-500/50 rounded-lg p-6",children:[h.jsx("h2",{className:"text-xl font-bold text-red-500 mb-4",children:"Application
1220Error"}),h.jsx("p",{className:"text-gray-300 mb-4",children:"Something went wrong while rendering this component."}),this.state.error&&h.jsxs("pre",{className:"bg-black/50 p-4 rounded text-sm text-red-300 overflow-auto border border-red-500/20",children:[this.state.error.toString(),` 1221 1222`,this.state.error.stack]}),h.jsx("button",{onClick:()=>window.location.reload(),className:"mt-6 px-4 py-2 bg-red-600 hover:bg-red-700 text-white rounded transition-colors",children:"Reload Page"})]})}):this.props.children}}function J4t({children:t}){return h.jsx(Bue,{fallback:h.jsx("div",{className:"flex h-full min-h-[160px] items-center justify-center px-4 text-center text-xs text-gray-400 dark:text-zinc-500",children:"Chart failed to render"}),children:t})}const Fue=document.getElementById("root");if(!Fue)throw new Error("Could not find root element to mount to");const kmt=the.createRoot(Fue);kmt.render(h.jsx(Qe.StrictMode,{children:h.jsx(JY,{children:h.jsx(Bue,{children:h.jsx(lpe,{children:h.jsx(Afe,{children:h.jsx(N.Suspense,{fallback:null,children:h.jsx(Amt,{})})})})})})}));export{$k as $,BX as A,Se as B,DI as C,k3 as D,Dk as E,Sve as F,Ave as G,t4e as H,aee as I,yQ as J,m3 as K,a8e as L,o8e as M,p8 as N,LI as O,$3 as P,FI as Q,Cy as R,Xve as S,hN as T,p8e as U,qh as V,xf as W,Ak as X,pQ as Y,L4e as Z,Ng as _,f8 as a,H6 as a$,$I as a0,vf as a1,Ik as a2,Nk as a3,k4e as a4,A4e as a5,Hbe as a6,Zbe as a7,Xbe as a8,vi as a9,Lk as aA,kk as aB,Tk as aC,y3 as aD,A3 as aE,pa as aF,b7 as aG,v3 as aH,_3 as aI,Sw as aJ,fa as aK,UI as aL,qX as aM,O4e as aN,WX as aO,Gbe as aP,Xwe as aQ,T3 as aR,sF as aS,R3 as aT,r8e as aU,jI as aV,mQ as aW,x3 as aX,Ok as aY,E3 as aZ,I3 as a_,HX as aa,I4e as ab,G6 as ac,T4e as ad,G7e as ae,Jbe as af,N4e as ag,T2 as ah,e8e as ai,Ybe as aj,Kbe as ak,w3 as al,n4e as am,Y7e as an,g3 as ao,t8e as ap,K1 as aq,n8e as ar,e4e as as,J7e as at,X7e as au,C3 as av,l1 as aw,v8e as ax,b3 as ay,Wh as az,FX as b,M7 as b$,c8e as b0,Qbe as b1,Wbe as b2,L3 as b3,c1 as b4,Hyt as b5,S3 as b6,Jxe as b7,z0 as b8,zve as b9,m8 as bA,Vve as bB,B2 as bC,EQ as bD,VI as bE,cN as bF,_Q as bG,see as bH,Cve as bI,U2 as bJ,k7 as bK,xF as bL,F6 as bM,cs as bN,Hve as bO,ko as bP,wF as bQ,Eve as bR,Jk as bS,B7e as bT,x7 as bU,g7 as bV,la as bW,vl as bX,X1 as bY,J6 as bZ,yc as b_,i8e as ba,Y6 as bb,gc as bc,pN as bd,k7e as be,T7e as bf,qI as bg,ZI as bh,D4e as bi,ZX as bj,jwe as bk,Mwe as bl,_i as bm,Cu as bn,Dwe as bo,U6 as bp,P8e as bq,IQ as br,ac as bs,_we as bt,Wi as bu,gee as bv,Yxe as bw,Gxe as bx,z6 as by,qwe as bz,B3 as c,za as c$,Zf as c0,Vi as c1,nm as c2,_f as c3,p7 as c4,wwe as c5,B6 as c6,YI as c7,See as c8,t9e as c9,P_e as cA,Iwe as cB,Z7e as cC,S8 as cD,Sk as cE,d8e as cF,y8e as cG,N7 as cH,dte as cI,U3 as cJ,Q7e as cK,$Q as cL,Ar as cM,A2 as cN,sQ as cO,vk as cP,of as cQ,h3 as cR,ii as cS,jQ as cT,D8e as cU,xu as cV,nQ as cW,Dt as cX,K7e as cY,Nu as cZ,CQ as c_,mN as ca,kee as cb,Aee as cc,Rn as cd,P4e as ce,Os as cf,da as cg,Yyt as ch,Yn as ci,oc as cj,Ss as ck,Ni as cl,Kve as cm,w8e as cn,d1 as co,Ef as cp,Fk as cq,U4e as cr,ze as cs,D2 as ct,$4e as cu,g2 as cv,MX as cw,FB as cx,zB as cy,wc as cz,xi as d,iI as d$,Eee as d0,Kxe as d1,Dve as d2,b8 as d3,F7e as d4,Xk as d5,SF as d6,sr as d7,N as d8,h as d9,q1e as dA,t7 as dB,Le as dC,zU as dD,lt as dE,Qhe as dF,F1t as dG,H1e as dH,k1e as dI,bu as dJ,Omt as dK,g1e as dL,bC as dM,MU as dN,DU as dO,v1e as dP,n3 as dQ,a8 as dR,o8 as dS,Qe as dT,nme as dU,VU as dV,vyt as dW,f6e as dX,l2 as dY,e1e as dZ,FU as d_,XA as da,na as db,yf as dc,Lmt as dd,Bu as de,YA as df,Ir as dg,RU as dh,Mn as di,j1e as dj,Zi as dk,fc as dl,gJ as dm,JA as dn,gC as dp,Sh as dq,bJ as dr,CJ as ds,l8 as dt,TJ as du,Vf as dv,wyt as dw,UU as dx,sI as dy,QA as dz,D6 as e,D6t as e$,jU as e0,ome as e1,n1 as e2,HU as e3,A0 as e4,u1e as e5,k1t as e6,z3e as e7,EJ as e8,xJ as e9,bm as eA,q6t as eB,N4t as eC,igt as eD,qIe as eE,R0 as eF,oit as eG,GOe as eH,W6t as eI,_ue as eJ,H$ as eK,M9 as eL,Got as eM,Lbt as eN,v6t as eO,Rrt as eP,El as eQ,X6t as eR,Uo as eS,lit as eT,xG as eU,nv as eV,u$ as eW,F6t as eX,Fl as eY,qOe as eZ,qw as e_,yu as ea,ml as eb,Q$ as ec,t3 as ed,mr as ee,f4t as ef,gpt as eg,wpt as eh,R2 as ei,Ts as ej,Br as ek,tp as el,V2 as em,Oe as en,H6t as eo,Z6t as ep,Est as eq,n5t as er,upt as es,Fyt as et,ue as eu,zOe as ev,bre as ew,x6t as ex,C6t as ey,zbt as ez,g4e as f,O4t as f$,Xbt as f0,V6t as f1,Gbt as f2,t6t as f3,i6t as f4,a6t as f5,Ine as f6,o6t as f7,n6t as f8,s6t as f9,aPe as fA,y6t as fB,m6t as fC,Tpt as fD,E4t as fE,lO as fF,x0 as fG,A4t as fH,dP as fI,Woe as fJ,qoe as fK,kbt as fL,Abt as fM,vn as fN,Tbt as fO,u$e as fP,tv as fQ,ZOe as fR,_0 as fS,KZ as fT,S4t as fU,$rt as fV,Irt as fW,$st as fX,iPe as fY,a5t as fZ,IG as f_,Kbt as fa,Hbt as fb,Qbt as fc,fl as fd,ev as fe,Kv as ff,apt as fg,_6t as fh,v2 as fi,G8 as fj,Jot as fk,xrt as fl,_pt as fm,xpt as fn,spt as fo,P6t as fp,u6t as fq,l6 as fr,j6t as fs,a2 as ft,R0t as fu,BOe as fv,S6t as fw,E6t as fx,k6t as fy,A6t as fz,b4e as g,fpt as g$,tT as g0,Lrt as g1,fte as g2,gf as g3,OU as g4,e4 as g5,u3 as g6,F0t as g7,V0t as g8,H4t as g9,m2t as gA,Dut as gB,Fut as gC,fce as gD,Gne as gE,R4t as gF,L4t as gG,T4t as gH,k4t as gI,ipt as gJ,RNe as gK,$0 as gL,MI as gM,I7 as gN,Wve as gO,rm as gP,k2 as gQ,Y1 as gR,W$ as gS,Kmt as gT,M1t as gU,E1e as gV,Imt as gW,BU as gX,ql as gY,Wa as gZ,PD as g_,J4t as ga,xs as gb,$mt as gc,eyt as gd,tyt as ge,Y3e as gf,P1e as gg,wC as gh,Lyt as gi,Tyt as gj,$yt as gk,N6e as gl,B0t as gm,B4t as gn,Cbe as go,mc as gp,Wf as gq,pc as gr,ybe as gs,EI as gt,Hu as gu,Vu as gv,zu as gw,dlt as gx,p4t as gy,Ur as gz,y1 as h,vlt as h$,Cre as h0,z6t as h1,Zbt as h2,Wbt as h3,qbt as h4,l
12226t as h5,XT as h6,Ybt as h7,Jbt as h8,Ile as h9,M6e as hA,Ov as hB,tlt as hC,m4t as hD,g6t as hE,A5e as hF,A4 as hG,aQ as hH,xwe as hI,egt as hJ,G1 as hK,vgt as hL,lm as hM,Va as hN,yyt as hO,B1 as hP,s0e as hQ,kJ as hR,xyt as hS,_yt as hT,Cyt as hU,Ayt as hV,kyt as hW,v1t as hX,gX as hY,IT as hZ,Qmt as h_,olt as ha,H3t as hb,h6t as hc,f6t as hd,d6t as he,W3t as hf,Z1 as hg,P4t as hh,$4t as hi,I4t as hj,r6t as hk,ht as hl,g4t as hm,y4t as hn,But as ho,sre as hp,rp as hq,Udt as hr,Uut as hs,p2t as ht,w4t as hu,_dt as hv,b4t as hw,oyt as hx,ayt as hy,myt as hz,w4e as i,zmt as i$,W4t as i0,V4t as i1,q4t as i2,Z4t as i3,Ue as i4,Sr as i5,Zd as i6,Ist as i7,e4t as i8,Sre as i9,p6t as iA,t2t as iB,v4t as iC,C4t as iD,Bue as iE,byt as iF,gyt as iG,Eyt as iH,Syt as iI,cX as iJ,X1t as iK,Ymt as iL,T1t as iM,F3e as iN,fmt as iO,U1e as iP,SJ as iQ,PU as iR,AJ as iS,B1t as iT,J1t as iU,V3e as iV,G4t as iW,pmt as iX,mmt as iY,Y4t as iZ,pyt as i_,rPe as ia,t5t as ib,nPe as ic,sPe as id,JOe as ie,iNe as ig,Da as ih,Vbt as ii,kte as ij,qf as ik,w6t as il,xo as im,W0 as io,Kut as ip,wm as iq,K2 as ir,adt as is,ldt as it,wi as iu,bdt as iv,cue as iw,_4t as ix,x4t as iy,Gdt as iz,v4e as j,Ru as j$,Vmt as j0,Hmt as j1,vJ as j2,_J as j3,$9 as j4,rr as j5,T5 as j6,i4t as j7,s4t as j8,ya as j9,_at as jA,Mat as jB,vat as jC,Ust as jD,Fat as jE,sot as jF,eat as jG,$at as jH,Zat as jI,$v as jJ,Mle as jK,d4t as jL,mu as jM,u4t as jN,qle as jO,Wle as jP,c6t as jQ,K4t as jR,P3 as jS,Uk as jT,wVe as jU,ju as jV,Jf as jW,Vje as jX,Eo as jY,ca as jZ,qe as j_,Fst as ja,vc as jb,ua as jc,a4t as jd,r4t as je,Xst as jf,L5 as jg,Fo as jh,Al as ji,cw as jj,Gst as jk,_u as jl,dc as jm,uat as jn,c4t as jo,zle as jp,fat as jq,Du as jr,Tat as js,Yle as jt,Vle as ju,n4t as jv,kP as jw,N9 as jx,zat as jy,pl as jz,VB as k,Jft as k$,pVe as k0,oje as k1,Ug as k2,EL as k3,p5 as k4,SUe as k5,yUe as k6,aCe as k7,bVe as k8,Za as k9,Ye as kA,D3 as kB,ir as kC,V6 as kD,Mo as kE,C8e as kF,bte as kG,hn as kH,bc as kI,BI as kJ,lc as kK,im as kL,Fae as kM,kKe as kN,TKe as kO,Lq as kP,mee as kQ,a0e as kR,Gl as kS,M0t as kT,H9 as kU,D0t as kV,U0t as kW,Kg as kX,j4t as kY,D4t as kZ,M4t as k_,fKe as ka,zKe as kb,ul as kc,Xf as kd,sP as ke,XGe as kf,iP as kg,w9 as kh,_6 as ki,SO as kj,gW as kk,Ase as kl,gze as km,Lf as kn,f2 as ko,b9 as kp,Wl as kq,_o as kr,Hl as ks,moe as kt,kr as ku,aL as kv,Gn as kw,lH as kx,pRe as ky,d5t as kz,zX as l,Oyt as l0,Pyt as l1,dIe as l2,Ryt as l3,Myt as l4,Dyt as l5,jyt as l6,Iyt as l7,Nyt as l8,AY as l9,Yg as lA,U4t as lB,RCe as lC,z4t as lD,h4t as lE,F4t as lF,Pmt as lG,d3 as la,Gmt as lb,Jmt as lc,Xmt as ld,Mmt as le,Dmt as lf,Wmt as lg,Zmt as lh,qmt as li,r0e as lj,fyt as lk,lyt as ll,cyt as lm,hyt as ln,uyt as lo,dyt as lp,Rmt as lq,jmt as lr,Bmt as ls,Umt as lt,Fmt as lu,iyt as lv,syt as lw,ryt as lx,nyt as ly,Gg as lz,HB as m,_4e as n,x4e as o,s1 as p,VX as q,C4e as r,Jwe as s,O3 as t,u1 as u,xQ as v,zI as w,Fve as x,N3 as y,S4e as z};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.