From 44a64516e125c218916f8d1274e40e5b55937713 Mon Sep 17 00:00:00 2001 From: ChrisSchinnerl Date: Thu, 9 May 2024 13:31:32 +0000 Subject: [PATCH] chore: export walletd/v0.20.0 --- walletd/assets/404.html | 2 +- .../static/Jgnu6nA6Tm0UUuiGo122l/_buildManifest.js | 1 + .../_ssgManifest.js | 0 .../static/PLCPh5ehlUt8y1clXJCfO/_buildManifest.js | 1 - ...5f0f7d26707a81f.js => _app-2806109c362dbec8.js} | 14 +++++++------- .../static/chunks/pages/index-3f3e01d5d7955420.js | 1 + .../static/chunks/pages/index-a1101570d9810b3b.js | 1 - ...0702ca4ad6a00d.js => login-de1c3625fe32b965.js} | 2 +- ...168ca2af706ab6a.js => node-c34aedfcc14fe81b.js} | 2 +- .../chunks/pages/wallets/[id]-4c35a8b08a913258.js | 1 - .../chunks/pages/wallets/[id]-ba3508391c7cad07.js | 1 + .../wallets/[id]/addresses-852076f377ff4d51.js | 1 - .../wallets/[id]/addresses-bb6f6707d5f05d01.js | 1 + .../assets/_next/static/css/7db1422e08ec4e0b.css | 3 --- .../assets/_next/static/css/c58a68ab686640bb.css | 3 +++ walletd/assets/index.html | 2 +- walletd/assets/login.html | 2 +- walletd/assets/node.html | 2 +- walletd/assets/wallets/[id].html | 2 +- walletd/assets/wallets/[id]/addresses.html | 2 +- 20 files changed, 22 insertions(+), 22 deletions(-) create mode 100644 walletd/assets/_next/static/Jgnu6nA6Tm0UUuiGo122l/_buildManifest.js rename walletd/assets/_next/static/{PLCPh5ehlUt8y1clXJCfO => Jgnu6nA6Tm0UUuiGo122l}/_ssgManifest.js (100%) delete mode 100644 walletd/assets/_next/static/PLCPh5ehlUt8y1clXJCfO/_buildManifest.js rename walletd/assets/_next/static/chunks/pages/{_app-b5f0f7d26707a81f.js => _app-2806109c362dbec8.js} (92%) create mode 100644 walletd/assets/_next/static/chunks/pages/index-3f3e01d5d7955420.js delete mode 100644 walletd/assets/_next/static/chunks/pages/index-a1101570d9810b3b.js rename walletd/assets/_next/static/chunks/pages/{login-680702ca4ad6a00d.js => login-de1c3625fe32b965.js} (88%) rename walletd/assets/_next/static/chunks/pages/{node-3168ca2af706ab6a.js => node-c34aedfcc14fe81b.js} (60%) delete mode 100644 walletd/assets/_next/static/chunks/pages/wallets/[id]-4c35a8b08a913258.js create mode 100644 walletd/assets/_next/static/chunks/pages/wallets/[id]-ba3508391c7cad07.js delete mode 100644 walletd/assets/_next/static/chunks/pages/wallets/[id]/addresses-852076f377ff4d51.js create mode 100644 walletd/assets/_next/static/chunks/pages/wallets/[id]/addresses-bb6f6707d5f05d01.js delete mode 100644 walletd/assets/_next/static/css/7db1422e08ec4e0b.css create mode 100644 walletd/assets/_next/static/css/c58a68ab686640bb.css diff --git a/walletd/assets/404.html b/walletd/assets/404.html index f920aaad7..38ab8041a 100644 --- a/walletd/assets/404.html +++ b/walletd/assets/404.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/walletd/assets/_next/static/Jgnu6nA6Tm0UUuiGo122l/_buildManifest.js b/walletd/assets/_next/static/Jgnu6nA6Tm0UUuiGo122l/_buildManifest.js new file mode 100644 index 000000000..cb12f2beb --- /dev/null +++ b/walletd/assets/_next/static/Jgnu6nA6Tm0UUuiGo122l/_buildManifest.js @@ -0,0 +1 @@ +self.__BUILD_MANIFEST={__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/":["static/chunks/pages/index-3f3e01d5d7955420.js"],"/_error":["static/chunks/pages/_error-4dfdedf844297a3b.js"],"/login":["static/chunks/pages/login-de1c3625fe32b965.js"],"/node":["static/chunks/pages/node-c34aedfcc14fe81b.js"],"/wallets/[id]":["static/chunks/pages/wallets/[id]-ba3508391c7cad07.js"],"/wallets/[id]/addresses":["static/chunks/pages/wallets/[id]/addresses-bb6f6707d5f05d01.js"],sortedPages:["/","/_app","/_error","/login","/node","/wallets/[id]","/wallets/[id]/addresses"]},self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file diff --git a/walletd/assets/_next/static/PLCPh5ehlUt8y1clXJCfO/_ssgManifest.js b/walletd/assets/_next/static/Jgnu6nA6Tm0UUuiGo122l/_ssgManifest.js similarity index 100% rename from walletd/assets/_next/static/PLCPh5ehlUt8y1clXJCfO/_ssgManifest.js rename to walletd/assets/_next/static/Jgnu6nA6Tm0UUuiGo122l/_ssgManifest.js diff --git a/walletd/assets/_next/static/PLCPh5ehlUt8y1clXJCfO/_buildManifest.js b/walletd/assets/_next/static/PLCPh5ehlUt8y1clXJCfO/_buildManifest.js deleted file mode 100644 index 411840489..000000000 --- a/walletd/assets/_next/static/PLCPh5ehlUt8y1clXJCfO/_buildManifest.js +++ /dev/null @@ -1 +0,0 @@ -self.__BUILD_MANIFEST={__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/":["static/chunks/pages/index-a1101570d9810b3b.js"],"/_error":["static/chunks/pages/_error-4dfdedf844297a3b.js"],"/login":["static/chunks/pages/login-680702ca4ad6a00d.js"],"/node":["static/chunks/pages/node-3168ca2af706ab6a.js"],"/wallets/[id]":["static/chunks/pages/wallets/[id]-4c35a8b08a913258.js"],"/wallets/[id]/addresses":["static/chunks/pages/wallets/[id]/addresses-852076f377ff4d51.js"],sortedPages:["/","/_app","/_error","/login","/node","/wallets/[id]","/wallets/[id]/addresses"]},self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file diff --git a/walletd/assets/_next/static/chunks/pages/_app-b5f0f7d26707a81f.js b/walletd/assets/_next/static/chunks/pages/_app-2806109c362dbec8.js similarity index 92% rename from walletd/assets/_next/static/chunks/pages/_app-b5f0f7d26707a81f.js rename to walletd/assets/_next/static/chunks/pages/_app-2806109c362dbec8.js index 04737a8f8..48ec9de67 100644 --- a/walletd/assets/_next/static/chunks/pages/_app-b5f0f7d26707a81f.js +++ b/walletd/assets/_next/static/chunks/pages/_app-2806109c362dbec8.js @@ -1,4 +1,4 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[888],{36662:function(A,Q,B){"use strict";function C(A,Q){var B=Object.keys(A);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(A);Q&&(C=C.filter(function(Q){return Object.getOwnPropertyDescriptor(A,Q).enumerable})),B.push.apply(B,C)}return B}function I(A){for(var Q=1;Q=0||(I[B]=A[B]);return I}(A,Q);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(A);for(C=0;C=0)&&Object.prototype.propertyIsEnumerable.call(A,B)&&(I[B]=A[B])}return I}B.d(Q,{I:function(){return L},_:function(){return n},a:function(){return k}});var g=["width","height","viewBox"],w=["tabindex"],D={focusable:"false",preserveAspectRatio:"xMidYMid meet"},M=B(13980),c=B.n(M),s=B(2784);function y(A,Q){var B=Object.keys(A);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(A);Q&&(C=C.filter(function(Q){return Object.getOwnPropertyDescriptor(A,Q).enumerable})),B.push.apply(B,C)}return B}function h(A){for(var Q=1;Q=0||(I[B]=A[B]);return I}(A,Q);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(A);for(C=0;C=0)&&Object.prototype.propertyIsEnumerable.call(A,B)&&(I[B]=A[B])}return I}var t=["className","children","tabIndex"],K=["tabindex"],L=s.forwardRef(function(A,Q){var B=A.className,C=A.children,M=A.tabIndex,c=function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},Q=A.width,B=A.height,C=A.viewBox,M=void 0===C?"0 0 ".concat(Q," ").concat(B):C,c=E(A,g),s=c.tabindex,y=E(c,w),h=I(I(I({},D),y),{},{width:Q,height:B,viewBox:M});return h["aria-label"]||h["aria-labelledby"]||h.title?(h.role="img",null!=s&&(h.focusable="true",h.tabindex=s)):h["aria-hidden"]=!0,h}(h(h({},n(A,t)),{},{tabindex:M})),y=c.tabindex,k=n(c,K);return B&&(k.className=B),null!=y&&(k.tabIndex=y),Q&&(k.ref=Q),s.createElement("svg",k,C)});L.displayName="Icon",L.propTypes={"aria-hidden":c().string,"aria-label":c().string,"aria-labelledby":c().string,children:c().node,className:c().string,height:c().oneOfType([c().number,c().string]),preserveAspectRatio:c().string,tabIndex:c().string,viewBox:c().string,width:c().oneOfType([c().number,c().string]),xmlns:c().string},L.defaultProps={xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid meet"}},63131:function(A,Q,B){"use strict";B.d(Q,{I$H:function(){return U},pHg:function(){return L},qdM:function(){return i},xVB:function(){return K}});var C,I,E,g,w,D,M,c,s=B(36662),y=B(2784),h=["children"],k=["children"],n=["children"],t=["children"],K=y.forwardRef(function(A,Q){var B=A.children,E=(0,s._)(A,h);return y.createElement(s.I,(0,s.a)({width:16,height:16,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",ref:Q},E),C||(C=y.createElement("path",{d:"M15.5,7.8C14.3,4.7,11.3,2.6,8,2.5C4.7,2.6,1.7,4.7,0.5,7.8c0,0.1,0,0.2,0,0.3c1.2,3.1,4.1,5.2,7.5,5.3 c3.3-0.1,6.3-2.2,7.5-5.3C15.5,8.1,15.5,7.9,15.5,7.8z M8,12.5c-2.7,0-5.4-2-6.5-4.5c1-2.5,3.8-4.5,6.5-4.5s5.4,2,6.5,4.5 C13.4,10.5,10.6,12.5,8,12.5z"})),I||(I=y.createElement("path",{d:"M8,5C6.3,5,5,6.3,5,8s1.3,3,3,3s3-1.3,3-3S9.7,5,8,5z M8,10c-1.1,0-2-0.9-2-2s0.9-2,2-2s2,0.9,2,2S9.1,10,8,10z"})),B)}),L=y.forwardRef(function(A,Q){var B=A.children,C=(0,s._)(A,k);return y.createElement(s.I,(0,s.a)({width:16,height:16,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",ref:Q},C),E||(E=y.createElement("path",{d:"M2.6,11.3l0.7-0.7C2.6,9.8,1.9,9,1.5,8c1-2.5,3.8-4.5,6.5-4.5c0.7,0,1.4,0.1,2,0.4l0.8-0.8C9.9,2.7,9,2.5,8,2.5 C4.7,2.6,1.7,4.7,0.5,7.8c0,0.1,0,0.2,0,0.3C1,9.3,1.7,10.4,2.6,11.3z"})),g||(g=y.createElement("path",{d:"M6 7.9c.1-1 .9-1.8 1.8-1.8l.9-.9C7.2 4.7 5.5 5.6 5.1 7.2 5 7.7 5 8.3 5.1 8.8L6 7.9zM15.5 7.8c-.6-1.5-1.6-2.8-2.9-3.7L15 1.7 14.3 1 1 14.3 1.7 15l2.6-2.6c1.1.7 2.4 1 3.7 1.1 3.3-.1 6.3-2.2 7.5-5.3C15.5 8.1 15.5 7.9 15.5 7.8zM10 8c0 1.1-.9 2-2 2-.3 0-.7-.1-1-.3L9.7 7C9.9 7.3 10 7.6 10 8zM8 12.5c-1 0-2.1-.3-3-.8l1.3-1.3c1.4.9 3.2.6 4.2-.8.7-1 .7-2.4 0-3.4l1.4-1.4c1.1.8 2 1.9 2.6 3.2C13.4 10.5 10.6 12.5 8 12.5z"})),B)}),U=y.forwardRef(function(A,Q){var B=A.children,C=(0,s._)(A,n);return y.createElement(s.I,(0,s.a)({width:24,height:24,viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",ref:Q},C),w||(w=y.createElement("path",{d:"M22 17H24V19H22z"})),D||(D=y.createElement("path",{d:"M28,8H4V5H26V3H4A2,2,0,0,0,2,5V26a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10A2,2,0,0,0,28,8ZM4,26V10H28v3H20a2,2,0,0,0-2,2v6a2,2,0,0,0,2,2h8v3ZM28,15v6H20V15Z"})),B)}),i=y.forwardRef(function(A,Q){var B=A.children,C=(0,s._)(A,t);return y.createElement(s.I,(0,s.a)({width:16,height:16,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",ref:Q},C),M||(M=y.createElement("path",{d:"M8,1C4.1,1,1,4.1,1,8s3.1,7,7,7s7-3.1,7-7S11.9,1,8,1z M8,14c-3.3,0-6-2.7-6-6s2.7-6,6-6s6,2.7,6,6S11.3,14,8,14z"})),c||(c=y.createElement("path",{d:"M7.5 4H8.5V9H7.5zM8 10.2c-.4 0-.8.3-.8.8s.3.8.8.8c.4 0 .8-.3.8-.8S8.4 10.2 8 10.2z"})),B)})},75102:function(A,Q,B){"use strict";B.d(Q,{An:function(){return M},Ht:function(){return c},R7:function(){return k},RH:function(){return h}});var C,I,E=B(97699),g=B.n(E);(C=I||(I={})).blue="blue",C.nanoS="nanoS",C.nanoSP="nanoSP",C.nanoX="nanoX",C.stax="stax";let w={[I.blue]:{id:I.blue,productName:"Ledger\xa0Blue",productIdMM:0,legacyUsbProductId:0,usbOnly:!0,memorySize:491520,masks:[822083584,822149120],getBlockSize:A=>4096},[I.nanoS]:{id:I.nanoS,productName:"Ledger\xa0Nano\xa0S",productIdMM:16,legacyUsbProductId:1,usbOnly:!0,memorySize:327680,masks:[823132160],getBlockSize:A=>{var Q;return g().lt(null!==(Q=g().coerce(A))&&void 0!==Q?Q:"","2.0.0")?4096:2048}},[I.nanoSP]:{id:I.nanoSP,productName:"Ledger Nano S Plus",productIdMM:80,legacyUsbProductId:5,usbOnly:!0,memorySize:1572864,masks:[856686592],getBlockSize:A=>32},[I.nanoX]:{id:I.nanoX,productName:"Ledger\xa0Nano\xa0X",productIdMM:64,legacyUsbProductId:4,usbOnly:!1,memorySize:2097152,masks:[855638016],getBlockSize:A=>4096,bluetoothSpec:[{serviceUuid:"13d63400-2c97-0004-0000-4c6564676572",notifyUuid:"13d63400-2c97-0004-0001-4c6564676572",writeUuid:"13d63400-2c97-0004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-0004-0003-4c6564676572"}]},[I.stax]:{id:I.stax,productName:"Ledger\xa0Stax",productIdMM:96,legacyUsbProductId:6,usbOnly:!1,memorySize:1572864,masks:[857735168],getBlockSize:A=>32,bluetoothSpec:[{serviceUuid:"13d63400-2c97-6004-0000-4c6564676572",notifyUuid:"13d63400-2c97-6004-0001-4c6564676572",writeUuid:"13d63400-2c97-6004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-6004-0003-4c6564676572"}]}};I.blue,I.nanoS,I.nanoSP,I.nanoX,I.stax;let D=Object.values(w),M=11415,c=A=>{let Q=D.find(Q=>Q.legacyUsbProductId===A);if(Q)return Q;let B=A>>8;return D.find(A=>A.productIdMM===B)},s=[],y={};for(let A in w){let Q=w[A],{bluetoothSpec:B}=Q;if(B)for(let A=0;As,k=A=>y[A.toLowerCase()]},9341:function(A,Q,B){"use strict";var C,I;B.d(Q,{qX:function(){return c},vs:function(){return s},WC:function(){return n},PS:function(){return k},FB:function(){return y},wp:function(){return h},rZ:function(){return t}});let E={},g={},w=(A,Q)=>{g[A]=Q},D=A=>{class Q extends Error{constructor(B,C,I){if(super(B||A,I),Object.setPrototypeOf(this,Q.prototype),this.name=A,C)for(let A in C)this[A]=C[A];if(I&&"object"==typeof I&&"cause"in I&&!("cause"in this)){let A=I.cause;this.cause=A,"stack"in A&&(this.stack=this.stack+"\nCAUSE: "+A.stack)}}}return E[A]=Q,Q};D("AccountNameRequired"),D("AccountNotSupported"),D("AmountRequired"),D("BluetoothRequired"),D("BtcUnmatchedApp"),D("CantOpenDevice"),D("CashAddrNotSupported"),D("ClaimRewardsFeesWarning"),D("CurrencyNotSupported"),D("DeviceAppVerifyNotSupported"),D("DeviceGenuineSocketEarlyClose"),D("DeviceNotGenuine"),D("DeviceOnDashboardExpected"),D("DeviceOnDashboardUnexpected"),D("DeviceInOSUExpected"),D("DeviceHalted"),D("DeviceNameInvalid"),D("DeviceSocketFail"),D("DeviceSocketNoBulkStatus");let M=D("LockedDeviceError");D("UnresponsiveDeviceError");let c=D("DisconnectedDevice"),s=D("DisconnectedDeviceDuringOperation");D("DeviceExtractOnboardingStateError"),D("DeviceOnboardingStatePollingError"),D("EnpointConfig"),D("EthAppPleaseEnableContractData"),D("FeeEstimationFailed"),D("FirmwareNotRecognized"),D("HardResetFail"),D("InvalidXRPTag"),D("InvalidAddress"),D("InvalidNonce"),D("InvalidAddressBecauseDestinationIsAlsoSource"),D("LatestMCUInstalledError"),D("UnknownMCU"),D("LedgerAPIError"),D("LedgerAPIErrorWithMessage"),D("LedgerAPINotAvailable"),D("ManagerAppAlreadyInstalled"),D("ManagerAppRelyOnBTC"),D("ManagerAppDepInstallRequired"),D("ManagerAppDepUninstallRequired"),D("ManagerDeviceLocked"),D("ManagerFirmwareNotEnoughSpace"),D("ManagerNotEnoughSpace"),D("ManagerUninstallBTCDep"),D("NetworkDown"),D("NoAddressesFound"),D("NotEnoughBalance"),D("NotEnoughBalanceToDelegate"),D("NotEnoughBalanceInParentAccount"),D("NotEnoughSpendableBalance"),D("NotEnoughBalanceBecauseDestinationNotCreated"),D("NoAccessToCamera"),D("NotEnoughGas"),D("NotEnoughGasSwap"),D("NotSupportedLegacyAddress"),D("GasLessThanEstimate"),D("PriorityFeeTooLow"),D("PriorityFeeTooHigh"),D("PriorityFeeHigherThanMaxFee"),D("MaxFeeTooLow"),D("PasswordsDontMatch"),D("PasswordIncorrect"),D("RecommendSubAccountsToEmpty"),D("RecommendUndelegation"),D("TimeoutTagged"),D("UnexpectedBootloader"),D("MCUNotGenuineToDashboard"),D("RecipientRequired"),D("UnavailableTezosOriginatedAccountReceive"),D("UnavailableTezosOriginatedAccountSend"),D("UpdateFetchFileFail"),D("UpdateIncorrectHash"),D("UpdateIncorrectSig"),D("UpdateYourApp"),D("UserRefusedDeviceNameChange"),D("UserRefusedAddress"),D("UserRefusedFirmwareUpdate"),D("UserRefusedAllowManager"),D("UserRefusedOnDevice");let y=D("TransportOpenUserCancelled");D("TransportInterfaceNotAvailable");let h=D("TransportRaceCondition");D("TransportWebUSBGestureRequired"),D("TransactionHasBeenValidatedError"),D("DeviceShouldStayInApp"),D("WebsocketConnectionError"),D("WebsocketConnectionFailed"),D("WrongDeviceForAccount"),D("WrongAppForCurrency"),D("ETHAddressNonEIP"),D("CantScanQRCode"),D("FeeNotLoaded"),D("FeeRequired"),D("FeeTooHigh"),D("PendingOperation"),D("SyncError"),D("PairingFailed"),D("PeerRemovedPairing"),D("GenuineCheckFailed"),D("LedgerAPI4xx"),D("LedgerAPI5xx"),D("FirmwareOrAppUpdateRequired"),D("OpReturnSizeLimit"),D("DustLimit"),D("LanguageNotFound"),D("NoDBPathGiven"),D("DBWrongPassword"),D("DBNotReset"),(I=C||(C={})).Unknown="Unknown",I.LocationServicesDisabled="LocationServicesDisabled",I.LocationServicesUnauthorized="LocationServicesUnauthorized",I.BluetoothScanStartFailed="BluetoothScanStartFailed";class k extends Error{constructor(A,Q){let B="TransportError";super(A||B),this.name=B,this.message=A,this.stack=Error(A).stack,this.id=Q}}w("TransportError",A=>new k(A.message,A.id));let n={ACCESS_CONDITION_NOT_FULFILLED:38916,ALGORITHM_NOT_SUPPORTED:38020,CLA_NOT_SUPPORTED:28160,CODE_BLOCKED:38976,CODE_NOT_INITIALIZED:38914,COMMAND_INCOMPATIBLE_FILE_STRUCTURE:27009,CONDITIONS_OF_USE_NOT_SATISFIED:27013,CONTRADICTION_INVALIDATION:38928,CONTRADICTION_SECRET_CODE_STATUS:38920,CUSTOM_IMAGE_BOOTLOADER:26159,CUSTOM_IMAGE_EMPTY:26158,FILE_ALREADY_EXISTS:27273,FILE_NOT_FOUND:37892,GP_AUTH_FAILED:25344,HALTED:28586,INCONSISTENT_FILE:37896,INCORRECT_DATA:27264,INCORRECT_LENGTH:26368,INCORRECT_P1_P2:27392,INS_NOT_SUPPORTED:27904,DEVICE_NOT_ONBOARDED:27911,DEVICE_NOT_ONBOARDED_2:26129,INVALID_KCV:38021,INVALID_OFFSET:37890,LICENSING:28482,LOCKED_DEVICE:21781,MAX_VALUE_REACHED:38992,MEMORY_PROBLEM:37440,MISSING_CRITICAL_PARAMETER:26624,NO_EF_SELECTED:37888,NOT_ENOUGH_MEMORY_SPACE:27268,OK:36864,PIN_REMAINING_ATTEMPTS:25536,REFERENCED_DATA_NOT_FOUND:27272,SECURITY_STATUS_NOT_SATISFIED:27010,TECHNICAL_PROBLEM:28416,UNKNOWN_APDU:27906,USER_REFUSED_ON_DEVICE:21761,NOT_ENOUGH_SPACE:20738};function t(A){let Q=Object.keys(n).find(Q=>n[Q]===A)||"UNKNOWN_ERROR",B=function(A){switch(A){case 26368:return"Incorrect length";case 26624:return"Missing critical parameter";case 27010:return"Security not satisfied (dongle locked or have invalid access rights)";case 27013:return"Condition of use not satisfied (denied by the user?)";case 27264:return"Invalid data received";case 27392:return"Invalid parameter received";case 21781:return"Locked device"}if(28416<=A&&A<=28671)return"Internal error, please report"}(A)||Q,C=A.toString(16),I=`Ledger device: ${B} (0x${C})`;if(A===n.LOCKED_DEVICE)throw new M(I);this.name="TransportStatusError",this.message=I,this.stack=Error(I).stack,this.statusCode=A,this.statusText=Q}t.prototype=Error(),w("TransportStatusError",A=>new t(A.statusCode))},73866:function(A,Q,B){"use strict";B.d(Q,{Z:function(){return AS}});var C,I=B(97790),E=B(9341),g=B(75102),w=function(A,Q){return(w=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(A,Q){A.__proto__=Q}||function(A,Q){for(var B in Q)Q.hasOwnProperty(B)&&(A[B]=Q[B])})(A,Q)};function D(A,Q){function B(){this.constructor=A}w(A,Q),A.prototype=null===Q?Object.create(Q):(B.prototype=Q.prototype,new B)}function M(A){return"function"==typeof A}var c=!1,s={Promise:void 0,set useDeprecatedSynchronousErrorHandling(value){value&&Error().stack,c=value},get useDeprecatedSynchronousErrorHandling(){return c}};function y(A){setTimeout(function(){throw A},0)}var h={closed:!0,next:function(A){},error:function(A){if(s.useDeprecatedSynchronousErrorHandling)throw A;y(A)},complete:function(){}},k=Array.isArray||function(A){return A&&"number"==typeof A.length};function n(A){return null!==A&&"object"==typeof A}var t=function(){function A(A){return Error.call(this),this.message=A?A.length+" errors occurred during unsubscription:\n"+A.map(function(A,Q){return Q+1+") "+A.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=A,this}return A.prototype=Object.create(Error.prototype),A}(),K=function(){var A;function Q(A){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,A&&(this._ctorUnsubscribe=!0,this._unsubscribe=A)}return Q.prototype.unsubscribe=function(){if(!this.closed){var A,B=this._parentOrParents,C=this._ctorUnsubscribe,I=this._unsubscribe,E=this._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,B instanceof Q)B.remove(this);else if(null!==B)for(var g=0;g{let C=(function(A,Q){let B=[];for(let C=0,I=Q(0);CB-(0===A?5:3)).map((A,B)=>{let C=e.alloc(0===B?5:3);return C.writeUInt8(5,0),C.writeUInt16BE(B,1),0===B&&C.writeUInt16BE(Q.length,3),e.concat([C,A])});return new a(Q=>{let B=!1;return(function(){var Q,I,E,g;return Q=this,I=void 0,E=void 0,g=function*(){for(let Q of C){if(B)return;yield A(Q)}},new(E||(E=Promise))(function(A,B){function C(A){try{D(g.next(A))}catch(A){B(A)}}function w(A){try{D(g.throw(A))}catch(A){B(A)}}function D(Q){var B;Q.done?A(Q.value):((B=Q.value)instanceof E?B:new E(function(A){A(B)})).then(C,w)}D((g=g.apply(Q,I||[])).next())})})().then(()=>{B=!0,Q.complete()},A=>{B=!0,(0,o.c)("ble-error","sendAPDU failure "+String(A)),Q.error(A)}),()=>{B||((0,o.c)("ble-verbose","sendAPDU interruption"),B=!0)}})};var F=B(48834).lW;let S=A=>a.create(Q=>{let B=0,C=0,I=F.alloc(0),g=A.subscribe({complete:()=>{Q.error(new E.qX),g.unsubscribe()},error:A=>{(0,o.c)("ble-error","in receiveAPDU "+String(A)),Q.error(A),g.unsubscribe()},next:A=>{let w=A.readUInt8(0),D=A.readUInt16BE(1),M=A.slice(3);if(5!==w){Q.error(new E.PS("Invalid tag "+w.toString(16),"InvalidTag"));return}if(B!==D){Q.error(new E.PS("BLE: Invalid sequence number. discontinued chunk. Received "+D+" but expected "+B,"InvalidSequence"));return}if(0===D&&(C=M.readUInt16BE(0),M=M.slice(2)),B++,(I=F.concat([I,M])).length>C){Q.error(new E.PS("BLE: received too much data. discontinued chunk. Received "+I.length+" but expected "+C,"BLETooMuchData"));return}I.length===C&&(Q.next(I),Q.complete(),g.unsubscribe())}});return()=>{g.unsubscribe()}});function l(A,Q){return function(B){if("function"!=typeof A)throw TypeError("argument is not a function. Are you looking for `mapTo()`?");return B.lift(new H(A,Q))}}var H=function(){function A(A,Q){this.project=A,this.thisArg=Q}return A.prototype.call=function(A,Q){return Q.subscribe(new Y(A,this.project,this.thisArg))},A}(),Y=function(A){function Q(Q,B,C){var I=A.call(this,Q)||this;return I.project=B,I.count=0,I.thisArg=C||I,I}return D(Q,A),Q.prototype._next=function(A){var Q;try{Q=this.project.call(this.thisArg,A,this.count++)}catch(A){this.destination.error(A);return}this.destination.next(Q)},Q}(i),f=function(A){return function(Q){for(var B=0,C=A.length;B0?this._next(A.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},Q}(Z);function x(){for(var A,Q,B=[],C=0;C1&&"number"==typeof B[B.length-1]&&(I=B.pop())):"number"==typeof g&&(I=B.pop()),null===E&&1===B.length&&B[0]instanceof a)?B[0]:(void 0===(A=I)&&(A=Number.POSITIVE_INFINITY),function A(Q,B,C){return(void 0===C&&(C=Number.POSITIVE_INFINITY),"function"==typeof B)?function(I){return I.pipe(A(function(A,C){return m(Q(A,C)).pipe(l(function(Q,I){return B(A,Q,C,I)}))},C))}:("number"==typeof B&&(C=B),function(A){return A.lift(new O(Q,C))})}(p,A))((Q=E)?b(B,Q):new a(f(B)))}var V=new a(function(A){return A.complete()});function z(){}var W=function(){function A(A,Q,B){this.nextOrObserver=A,this.error=Q,this.complete=B}return A.prototype.call=function(A,Q){return Q.subscribe(new P(A,this.nextOrObserver,this.error,this.complete))},A}(),P=function(A){function Q(Q,B,C,I){var E=A.call(this,Q)||this;return E._tapNext=z,E._tapError=z,E._tapComplete=z,E._tapError=C||z,E._tapComplete=I||z,M(B)?(E._context=E,E._tapNext=B):B&&(E._context=B,E._tapNext=B.next||z,E._tapError=B.error||z,E._tapComplete=B.complete||z),E}return D(Q,A),Q.prototype._next=function(A){try{this._tapNext.call(this._context,A)}catch(A){this.destination.error(A);return}this.destination.next(A)},Q.prototype._error=function(A){try{this._tapError.call(this._context,A)}catch(A){this.destination.error(A);return}this.destination.error(A)},Q.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(A){this.destination.error(A);return}return this.destination.complete()},Q}(i),q=function(){function A(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return A.prototype=Object.create(Error.prototype),A}(),X=function(A){function Q(Q,B){var C=A.call(this)||this;return C.subject=Q,C.subscriber=B,C.closed=!1,C}return D(Q,A),Q.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var A=this.subject,Q=A.observers;if(this.subject=null,Q&&0!==Q.length&&!A.isStopped&&!A.closed){var B=Q.indexOf(this.subscriber);-1!==B&&Q.splice(B,1)}}},Q}(K),_=function(A){function Q(Q){var B=A.call(this,Q)||this;return B.destination=Q,B}return D(Q,A),Q}(i),$=function(A){function Q(){var Q=A.call(this)||this;return Q.observers=[],Q.closed=!1,Q.isStopped=!1,Q.hasError=!1,Q.thrownError=null,Q}return D(Q,A),Q.prototype[U]=function(){return new _(this)},Q.prototype.lift=function(A){var Q=new AA(this,this);return Q.operator=A,Q},Q.prototype.next=function(A){if(this.closed)throw new q;if(!this.isStopped)for(var Q=this.observers,B=Q.length,C=Q.slice(),I=0;I1)){this.connection=null;return}var B=this.connection,C=A._connection;this.connection=null,C&&(!B||C===B)&&C.unsubscribe()},Q}(i),AI={operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:(C=function(A){function Q(Q,B){var C=A.call(this)||this;return C.source=Q,C.subjectFactory=B,C._refCount=0,C._isComplete=!1,C}return D(Q,A),Q.prototype._subscribe=function(A){return this.getSubject().subscribe(A)},Q.prototype.getSubject=function(){var A=this._subject;return(!A||A.isStopped)&&(this._subject=this.subjectFactory()),this._subject},Q.prototype.connect=function(){var A=this._connection;return!A&&(this._isComplete=!1,(A=this._connection=new K).add(this.source.subscribe(new AE(this.getSubject(),this))),A.closed&&(this._connection=null,A=K.EMPTY)),A},Q.prototype.refCount=function(){return AQ()(this)},Q}(a).prototype)._subscribe},_isComplete:{value:C._isComplete,writable:!0},getSubject:{value:C.getSubject},connect:{value:C.connect},refCount:{value:C.refCount}},AE=function(A){function Q(Q,B){var C=A.call(this,Q)||this;return C.connectable=B,C}return D(Q,A),Q.prototype._error=function(Q){this._unsubscribe(),A.prototype._error.call(this,Q)},Q.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),A.prototype._complete.call(this)},Q.prototype._unsubscribe=function(){var A=this.connectable;if(A){this.connectable=null;var Q=A._connection;A._refCount=0,A._subject=null,A._connection=null,Q&&Q.unsubscribe()}},Q}(_),Ag=function(){function A(A,Q){this.subjectFactory=A,this.selector=Q}return A.prototype.call=function(A,Q){var B=this.selector,C=this.subjectFactory(),I=B(C).subscribe(A);return I.add(Q.subscribe(C)),I},A}();function Aw(){return new $}var AD=function(){function A(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return A.prototype=Object.create(Error.prototype),A}(),AM=function(){function A(A,Q){this.predicate=A,this.thisArg=Q}return A.prototype.call=function(A,Q){return Q.subscribe(new Ac(A,this.predicate,this.thisArg))},A}(),Ac=function(A){function Q(Q,B,C){var I=A.call(this,Q)||this;return I.predicate=B,I.thisArg=C,I.count=0,I}return D(Q,A),Q.prototype._next=function(A){var Q;try{Q=this.predicate.call(this.thisArg,A,this.count++)}catch(A){this.destination.error(A);return}Q&&this.destination.next(A)},Q}(i),As=function(){function A(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return A.prototype=Object.create(Error.prototype),A}(),Ay=function(){function A(A){if(this.total=A,this.total<0)throw new As}return A.prototype.call=function(A,Q){return Q.subscribe(new Ah(A,this.total))},A}(),Ah=function(A){function Q(Q,B){var C=A.call(this,Q)||this;return C.total=B,C.count=0,C}return D(Q,A),Q.prototype._next=function(A){var Q=this.total,B=++this.count;B<=Q&&(this.destination.next(A),B===Q&&(this.destination.complete(),this.unsubscribe()))},Q}(i),Ak=function(){function A(A){this.defaultValue=A}return A.prototype.call=function(A,Q){return Q.subscribe(new An(A,this.defaultValue))},A}(),An=function(A){function Q(Q,B){var C=A.call(this,Q)||this;return C.defaultValue=B,C.isEmpty=!0,C}return D(Q,A),Q.prototype._next=function(A){this.isEmpty=!1,this.destination.next(A)},Q.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},Q}(i),At=function(){function A(A){this.errorFactory=A}return A.prototype.call=function(A,Q){return Q.subscribe(new AK(A,this.errorFactory))},A}(),AK=function(A){function Q(Q,B){var C=A.call(this,Q)||this;return C.errorFactory=B,C.hasValue=!1,C}return D(Q,A),Q.prototype._next=function(A){this.hasValue=!0,this.destination.next(A)},Q.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var A=void 0;try{A=this.errorFactory()}catch(Q){A=Q}this.destination.error(A)},Q}(i),AL=function(){function A(){}return A.prototype.call=function(A,Q){return Q.subscribe(new AU(A))},A}(),AU=function(A){function Q(){return null!==A&&A.apply(this,arguments)||this}return D(Q,A),Q.prototype._next=function(A){},Q}(i),Ai=B(48834).lW;let AG=A=>a.create(Q=>{function B(A){let B=A.target;B.value&&Q.next(Ai.from(B.value.buffer))}return(0,o.c)("ble-verbose","start monitor "+A.uuid),A.startNotifications().then(()=>{A.addEventListener("characteristicvaluechanged",B)}),()=>{(0,o.c)("ble-verbose","end monitor "+A.uuid),A.stopNotifications()}});var Ar=B(48834).lW,Ap=function(A,Q,B,C){return new(B||(B=Promise))(function(I,E){function g(A){try{D(C.next(A))}catch(A){E(A)}}function w(A){try{D(C.throw(A))}catch(A){E(A)}}function D(A){var Q;A.done?I(A.value):((Q=A.value)instanceof B?Q:new B(function(A){A(Q)})).then(g,w)}D((C=C.apply(A,Q||[])).next())})};let Aa=()=>{let{bluetooth:A}=navigator;if(void 0===A)throw Error("web bluetooth not supported");return A},AN=()=>a.create(A=>{let Q=Aa(),B=Q=>{A.next(Q.value)};Q.addEventListener("availabilitychanged",B);let C=!1;return Q.getAvailability().then(Q=>{C||A.next(Q)}),()=>{C=!0,Q.removeEventListener("availabilitychanged",B)}}),Ao={},Ae=()=>({filters:(0,g.RH)().map(A=>({services:[A]}))}),AJ=A=>Ap(void 0,void 0,void 0,function*(){if(!A.gatt)throw Error("bluetooth gatt not found");let[Q]=yield A.gatt.getPrimaryServices();if(!Q)throw Error("bluetooth service not found");let B=(0,g.R7)(Q.uuid);if(!B)throw Error("bluetooth service infos not found");return[Q,B]});class AF extends I.ZP{static listen(A){let Q;return(0,o.c)("ble-verbose","listen..."),Aa().requestDevice(Ae()).then(B=>{Q||(A.next({type:"add",descriptor:B}),A.complete())},Q=>{A.error(new E.FB(Q.message))}),{unsubscribe:function(){Q=!0}}}static open(A){return Ap(this,void 0,void 0,function*(){return function A(Q,B){return Ap(this,void 0,void 0,function*(){var C;let I;if("string"==typeof Q){if(Ao[Q])return(0,o.c)("ble-verbose","Transport in cache, using that."),Ao[Q];let A=Aa();I=yield A.requestDevice(Ae())}else I=Q;I.gatt.connected||((0,o.c)("ble-verbose","not connected. connecting..."),yield I.gatt.connect());let[g,w]=yield AJ(I),{deviceModel:D,writeUuid:M,notifyUuid:c}=w,[s,y]=yield Promise.all([g.getCharacteristic(M),g.getCharacteristic(c)]),h=AG(y).pipe((C=A=>{(0,o.c)("ble-frame","<= "+A.toString("hex"))},function(A){return A.lift(new W(C,void 0,void 0))}),function(A){var Q;return AQ()(function(A){if("function"==typeof Q)return A.lift(new Ag(Aw,Q));var B=Object.create(A,AI);return B.source=A,B.subjectFactory=Aw,B}(A))}),k=h.subscribe(),n=new AF(I,s,h,D);if(!I.gatt.connected)throw new E.qX;Ao[n.id]=n;let t=A=>{console.log("onDisconnect!",A),delete Ao[n.id],n.notYetDisconnected=!1,k.unsubscribe(),I.removeEventListener("gattserverdisconnected",t),(0,o.c)("ble-verbose",`BleTransport(${n.id}) disconnected`),n.emit("disconnect",A)};I.addEventListener("gattserverdisconnected",t);let K=Date.now();try{yield n.inferMTU()}finally{Date.now()-K<1e3&&(B=!1),B&&(yield I.gatt.disconnect(),yield new Promise(A=>setTimeout(A,4e3)))}return B?A(I,!1):n})}(A,!0)})}constructor(A,Q,B,C){super(),this.mtuSize=20,this.notYetDisconnected=!0,this.write=A=>Ap(this,void 0,void 0,function*(){(0,o.c)("ble-frame","=> "+A.toString("hex")),yield this.writeCharacteristic.writeValue(A)}),this.id=A.id,this.device=A,this.writeCharacteristic=Q,this.notifyObservable=B,this.deviceModel=C,(0,o.c)("ble-verbose",`BleTransport(${String(this.id)}) new instance`)}inferMTU(){return Ap(this,void 0,void 0,function*(){let A=23;if(yield this.exchangeAtomicImpl(()=>Ap(this,void 0,void 0,function*(){try{var Q;A=(yield x(this.notifyObservable.pipe(function(A,Q){var B=arguments.length>=2;return function(Q){var C,I,E;return Q.pipe(A?(C=function(B,C){return A(B,C,Q)},function(A){return A.lift(new AM(C,void 0))}):p,function(A){return A.lift(new Ay(1))},B?(I=void 0,I=null,function(A){return A.lift(new Ak(I))}):(E=function(){return new AD},function(A){return A.lift(new At(E))}))}}(A=>8===A.readUInt8(0)),l(A=>A.readUInt8(5))),(Q=()=>m(this.write(Ar.from([8,0,0,0,0]))),new a(function(A){var B,C,I;try{C=Q()}catch(Q){A.error(Q);return}return(C?m(C):B?(I=B,new a(function(A){return I.schedule(function(){return A.complete()})})):V).subscribe(A)})).pipe(function(A){return A.lift(new AL)})).toPromise())+3}catch(A){throw(0,o.c)("ble-error","inferMTU got "+String(A)),this.device.gatt.disconnect(),A}})),A>23){let Q=A-3;(0,o.c)("ble-verbose",`BleTransport(${String(this.id)}) mtu set to ${String(Q)}`),this.mtuSize=Q}return this.mtuSize})}exchange(A){return Ap(this,void 0,void 0,function*(){return yield this.exchangeAtomicImpl(()=>Ap(this,void 0,void 0,function*(){try{let Q=A.toString("hex");(0,o.c)("apdu",`=> ${Q}`);let B=yield x(this.notifyObservable.pipe(S),J(this.write,A,this.mtuSize)).toPromise(),C=B.toString("hex");return(0,o.c)("apdu",`<= ${C}`),B}catch(A){throw(0,o.c)("ble-error","exchange got "+String(A)),this.notYetDisconnected&&this.device.gatt.disconnect(),A}}))})}setScrambleKey(){}close(){return Ap(this,void 0,void 0,function*(){this.exchangeBusyPromise&&(yield this.exchangeBusyPromise)})}}AF.isSupported=()=>Promise.resolve().then(Aa).then(()=>!0,()=>!1),AF.observeAvailability=A=>AN().subscribe(A),AF.list=()=>Promise.resolve([]),AF.disconnect=A=>Ap(void 0,void 0,void 0,function*(){(0,o.c)("ble-verbose",`user disconnect(${A})`);let Q=Ao[A];Q&&Q.device.gatt.disconnect()});var AS=AF},27748:function(A,Q,B){"use strict";B.d(Q,{Z:function(){return K}});var C=B(97790),I=B(9341),E=B(48834).lW;let g={data:E.alloc(0),dataLength:0,sequence:0};var w=(A,Q)=>({makeBlocks(B){let C=E.concat([function(A){let Q=E.alloc(2);return Q.writeUInt16BE(A,0),Q}(B.length),B]),I=Q-5,g=Math.ceil(C.length/I);C=E.concat([C,E.alloc(g*I-C.length+1).fill(0)]);let w=[];for(let Q=0;Qw&&(C=C.slice(0,w)),{data:C,dataLength:w,sequence:D}},getReducedResult(A){if(A&&A.dataLength===A.data.length)return A.data}}),D=B(75102),M=B(91288),c=B(48834).lW,s=function(A,Q,B,C){return new(B||(B=Promise))(function(I,E){function g(A){try{D(C.next(A))}catch(A){E(A)}}function w(A){try{D(C.throw(A))}catch(A){E(A)}}function D(A){var Q;A.done?I(A.value):((Q=A.value)instanceof B?Q:new B(function(A){A(Q)})).then(g,w)}D((C=C.apply(A,Q||[])).next())})};let y=[{vendorId:D.An}],h=()=>{let{hid:A}=navigator;if(!A)throw new I.PS("navigator.hid is not supported","HIDNotSupported");return A};function k(){return s(this,void 0,void 0,function*(){let A=yield h().requestDevice({filters:y});return Array.isArray(A)?A:[A]})}function n(){return s(this,void 0,void 0,function*(){return(yield h().getDevices()).filter(A=>A.vendorId===D.An)})}class t extends C.ZP{constructor(A){super(),this.channel=Math.floor(65535*Math.random()),this.packetSize=64,this.inputs=[],this.read=()=>this.inputs.length?Promise.resolve(this.inputs.shift()):new Promise(A=>{this.inputCallback=A}),this.onInputReport=A=>{let Q=c.from(A.data.buffer);this.inputCallback?(this.inputCallback(Q),this.inputCallback=null):this.inputs.push(Q)},this._disconnectEmitted=!1,this._emitDisconnect=A=>{this._disconnectEmitted||(this._disconnectEmitted=!0,this.emit("disconnect",A))},this.exchange=A=>s(this,void 0,void 0,function*(){return yield this.exchangeAtomicImpl(()=>s(this,void 0,void 0,function*(){let Q,B;let{channel:C,packetSize:I}=this;(0,M.c)("apdu","=> "+A.toString("hex"));let E=w(C,I),g=E.makeBlocks(A);for(let A=0;A{if(A&&A.message&&A.message.includes("write"))throw this._emitDisconnect(A),new I.vs(A.message);throw A})}),this.device=A,this.deviceModel="number"==typeof A.productId?(0,D.Ht)(A.productId):void 0,A.addEventListener("inputreport",this.onInputReport)}static request(){return s(this,void 0,void 0,function*(){let[A]=yield k();return t.open(A)})}static openConnected(){return s(this,void 0,void 0,function*(){let A=yield n();return 0===A.length?null:t.open(A[0])})}static open(A){return s(this,void 0,void 0,function*(){yield A.open();let Q=new t(A),B=C=>{A===C.device&&(h().removeEventListener("disconnect",B),Q._emitDisconnect(new I.qX))};return h().addEventListener("disconnect",B),Q})}close(){return s(this,void 0,void 0,function*(){yield this.exchangeBusyPromise,this.device.removeEventListener("inputreport",this.onInputReport),yield this.device.close()})}setScrambleKey(){}}t.isSupported=()=>Promise.resolve(!!(window.navigator&&window.navigator.hid)),t.list=n,t.listen=A=>{let Q=!1;return(function(){return s(this,void 0,void 0,function*(){let A=yield n();return A.length>0?A[0]:(yield k())[0]})})().then(B=>{if(B){if(!Q){let Q="number"==typeof B.productId?(0,D.Ht)(B.productId):void 0;A.next({type:"add",descriptor:B,deviceModel:Q}),A.complete()}}else A.error(new I.FB("Access denied to use Ledger device"))},Q=>{A.error(new I.FB(Q.message))}),{unsubscribe:function(){Q=!0}}};var K=t},97790:function(A,Q,B){"use strict";var C=B(22699),I=B.n(C),E=B(9341),g=B(48834).lW,w=function(A,Q,B,C){return new(B||(B=Promise))(function(I,E){function g(A){try{D(C.next(A))}catch(A){E(A)}}function w(A){try{D(C.throw(A))}catch(A){E(A)}}function D(A){var Q;A.done?I(A.value):((Q=A.value)instanceof B?Q:new B(function(A){A(Q)})).then(g,w)}D((C=C.apply(A,Q||[])).next())})};class D{constructor(){this.exchangeTimeout=3e4,this.unresponsiveTimeout=15e3,this.deviceModel=null,this._events=new(I()),this.send=(A,Q,B,C,I=g.alloc(0),D=[E.WC.OK])=>w(this,void 0,void 0,function*(){if(I.length>=256)throw new E.PS("data.length exceed 256 bytes limit. Got: "+I.length,"DataLengthTooBig");let w=yield this.exchange(g.concat([g.from([A,Q,B,C]),g.from([I.length]),I])),M=w.readUInt16BE(w.length-2);if(!D.some(A=>A===M))throw new E.rZ(M);return w}),this.exchangeAtomicImpl=A=>w(this,void 0,void 0,function*(){let Q;if(this.exchangeBusyPromise)throw new E.wp("An action was already pending on the Ledger device. Please deny or reconnect.");let B=new Promise(A=>{Q=A});this.exchangeBusyPromise=B;let C=!1,I=setTimeout(()=>{C=!0,this.emit("unresponsive")},this.unresponsiveTimeout);try{let Q=yield A();return C&&this.emit("responsive"),Q}finally{clearTimeout(I),Q&&Q(),this.exchangeBusyPromise=null}}),this._appAPIlock=null}exchange(A){throw Error("exchange not implemented")}exchangeBulk(A,Q){let B=!1;return w(this,void 0,void 0,function*(){if(!B)for(let C of A){let A=yield this.exchange(C);if(B)return;let I=A.readUInt16BE(A.length-2);if(I!==E.WC.OK)throw new E.rZ(I);Q.next(A)}}).then(()=>!B&&Q.complete(),A=>!B&&Q.error(A)),{unsubscribe:()=>{B=!0}}}setScrambleKey(A){}close(){return Promise.resolve()}on(A,Q){this._events.on(A,Q)}off(A,Q){this._events.removeListener(A,Q)}emit(A,...Q){this._events.emit(A,...Q)}setDebugMode(){console.warn("setDebugMode is deprecated. use @ledgerhq/logs instead. No logs are emitted in this anymore.")}setExchangeTimeout(A){this.exchangeTimeout=A}setExchangeUnresponsiveTimeout(A){this.unresponsiveTimeout=A}static create(A=3e3,Q){return new Promise((B,C)=>{let I=!1,g=this.listen({next:Q=>{I=!0,g&&g.unsubscribe(),w&&clearTimeout(w),this.open(Q.descriptor,A).then(B,C)},error:A=>{w&&clearTimeout(w),C(A)},complete:()=>{w&&clearTimeout(w),I||C(new E.PS(this.ErrorMessage_NoDeviceFound,"NoDeviceFound"))}}),w=Q?setTimeout(()=>{g.unsubscribe(),C(new E.PS(this.ErrorMessage_ListenTimeout,"ListenTimeout"))},Q):null})}decorateAppAPIMethods(A,Q,B){for(let C of Q)A[C]=this.decorateAppAPIMethod(C,A[C],A,B)}decorateAppAPIMethod(A,Q,B,C){return(...I)=>w(this,void 0,void 0,function*(){let{_appAPIlock:g}=this;if(g)return Promise.reject(new E.PS("Ledger Device is busy (lock "+g+")","TransportLocked"));try{return this._appAPIlock=A,this.setScrambleKey(C),yield Q.apply(B,I)}finally{this._appAPIlock=null}})}}D.ErrorMessage_ListenTimeout="No Ledger device found (timeout)",D.ErrorMessage_NoDeviceFound="No Ledger device found",Q.ZP=D},91288:function(A,Q,B){"use strict";B.d(Q,{c:function(){return E}});var C=0,I=[],E=function(A,Q,B){var E={type:A,id:String(++C),date:new Date};Q&&(E.message=Q),B&&(E.data=B),function(A){for(var Q=0;Q0&&I[I.length-1])&&(6===E[0]||2===E[0])){g=0;continue}if(3===E[0]&&(!I||E[1]>I[0]&&E[1]4096},[I.nanoS]:{id:I.nanoS,productName:"Ledger\xa0Nano\xa0S",productIdMM:16,legacyUsbProductId:1,usbOnly:!0,memorySize:327680,masks:[823132160],getBlockSize:A=>{var Q;return g().lt(null!==(Q=g().coerce(A))&&void 0!==Q?Q:"","2.0.0")?4096:2048}},[I.nanoSP]:{id:I.nanoSP,productName:"Ledger Nano S Plus",productIdMM:80,legacyUsbProductId:5,usbOnly:!0,memorySize:1572864,masks:[856686592],getBlockSize:A=>32},[I.nanoX]:{id:I.nanoX,productName:"Ledger\xa0Nano\xa0X",productIdMM:64,legacyUsbProductId:4,usbOnly:!1,memorySize:2097152,masks:[855638016],getBlockSize:A=>4096,bluetoothSpec:[{serviceUuid:"13d63400-2c97-0004-0000-4c6564676572",notifyUuid:"13d63400-2c97-0004-0001-4c6564676572",writeUuid:"13d63400-2c97-0004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-0004-0003-4c6564676572"}]},[I.stax]:{id:I.stax,productName:"Ledger\xa0Stax",productIdMM:96,legacyUsbProductId:6,usbOnly:!1,memorySize:1572864,masks:[857735168],getBlockSize:A=>32,bluetoothSpec:[{serviceUuid:"13d63400-2c97-6004-0000-4c6564676572",notifyUuid:"13d63400-2c97-6004-0001-4c6564676572",writeUuid:"13d63400-2c97-6004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-6004-0003-4c6564676572"}]}};I.blue,I.nanoS,I.nanoSP,I.nanoX,I.stax;let D=Object.values(w),M=11415,c=A=>{let Q=D.find(Q=>Q.legacyUsbProductId===A);if(Q)return Q;let B=A>>8;return D.find(A=>A.productIdMM===B)},s=[],y={};for(let A in w){let Q=w[A],{bluetoothSpec:B}=Q;if(B)for(let A=0;As,k=A=>y[A.toLowerCase()]},9341:function(A,Q,B){"use strict";var C,I;B.d(Q,{qX:function(){return c},vs:function(){return s},WC:function(){return n},PS:function(){return k},FB:function(){return y},wp:function(){return h},rZ:function(){return t}});let E={},g={},w=(A,Q)=>{g[A]=Q},D=A=>{class Q extends Error{constructor(B,C,I){if(super(B||A,I),Object.setPrototypeOf(this,Q.prototype),this.name=A,C)for(let A in C)this[A]=C[A];if(I&&"object"==typeof I&&"cause"in I&&!("cause"in this)){let A=I.cause;this.cause=A,"stack"in A&&(this.stack=this.stack+"\nCAUSE: "+A.stack)}}}return E[A]=Q,Q};D("AccountNameRequired"),D("AccountNotSupported"),D("AmountRequired"),D("BluetoothRequired"),D("BtcUnmatchedApp"),D("CantOpenDevice"),D("CashAddrNotSupported"),D("ClaimRewardsFeesWarning"),D("CurrencyNotSupported"),D("DeviceAppVerifyNotSupported"),D("DeviceGenuineSocketEarlyClose"),D("DeviceNotGenuine"),D("DeviceOnDashboardExpected"),D("DeviceOnDashboardUnexpected"),D("DeviceInOSUExpected"),D("DeviceHalted"),D("DeviceNameInvalid"),D("DeviceSocketFail"),D("DeviceSocketNoBulkStatus");let M=D("LockedDeviceError");D("UnresponsiveDeviceError");let c=D("DisconnectedDevice"),s=D("DisconnectedDeviceDuringOperation");D("DeviceExtractOnboardingStateError"),D("DeviceOnboardingStatePollingError"),D("EnpointConfig"),D("EthAppPleaseEnableContractData"),D("FeeEstimationFailed"),D("FirmwareNotRecognized"),D("HardResetFail"),D("InvalidXRPTag"),D("InvalidAddress"),D("InvalidNonce"),D("InvalidAddressBecauseDestinationIsAlsoSource"),D("LatestMCUInstalledError"),D("UnknownMCU"),D("LedgerAPIError"),D("LedgerAPIErrorWithMessage"),D("LedgerAPINotAvailable"),D("ManagerAppAlreadyInstalled"),D("ManagerAppRelyOnBTC"),D("ManagerAppDepInstallRequired"),D("ManagerAppDepUninstallRequired"),D("ManagerDeviceLocked"),D("ManagerFirmwareNotEnoughSpace"),D("ManagerNotEnoughSpace"),D("ManagerUninstallBTCDep"),D("NetworkDown"),D("NoAddressesFound"),D("NotEnoughBalance"),D("NotEnoughBalanceToDelegate"),D("NotEnoughBalanceInParentAccount"),D("NotEnoughSpendableBalance"),D("NotEnoughBalanceBecauseDestinationNotCreated"),D("NoAccessToCamera"),D("NotEnoughGas"),D("NotEnoughGasSwap"),D("NotSupportedLegacyAddress"),D("GasLessThanEstimate"),D("PriorityFeeTooLow"),D("PriorityFeeTooHigh"),D("PriorityFeeHigherThanMaxFee"),D("MaxFeeTooLow"),D("PasswordsDontMatch"),D("PasswordIncorrect"),D("RecommendSubAccountsToEmpty"),D("RecommendUndelegation"),D("TimeoutTagged"),D("UnexpectedBootloader"),D("MCUNotGenuineToDashboard"),D("RecipientRequired"),D("UnavailableTezosOriginatedAccountReceive"),D("UnavailableTezosOriginatedAccountSend"),D("UpdateFetchFileFail"),D("UpdateIncorrectHash"),D("UpdateIncorrectSig"),D("UpdateYourApp"),D("UserRefusedDeviceNameChange"),D("UserRefusedAddress"),D("UserRefusedFirmwareUpdate"),D("UserRefusedAllowManager"),D("UserRefusedOnDevice");let y=D("TransportOpenUserCancelled");D("TransportInterfaceNotAvailable");let h=D("TransportRaceCondition");D("TransportWebUSBGestureRequired"),D("TransactionHasBeenValidatedError"),D("DeviceShouldStayInApp"),D("WebsocketConnectionError"),D("WebsocketConnectionFailed"),D("WrongDeviceForAccount"),D("WrongAppForCurrency"),D("ETHAddressNonEIP"),D("CantScanQRCode"),D("FeeNotLoaded"),D("FeeRequired"),D("FeeTooHigh"),D("PendingOperation"),D("SyncError"),D("PairingFailed"),D("PeerRemovedPairing"),D("GenuineCheckFailed"),D("LedgerAPI4xx"),D("LedgerAPI5xx"),D("FirmwareOrAppUpdateRequired"),D("OpReturnSizeLimit"),D("DustLimit"),D("LanguageNotFound"),D("NoDBPathGiven"),D("DBWrongPassword"),D("DBNotReset"),(I=C||(C={})).Unknown="Unknown",I.LocationServicesDisabled="LocationServicesDisabled",I.LocationServicesUnauthorized="LocationServicesUnauthorized",I.BluetoothScanStartFailed="BluetoothScanStartFailed";class k extends Error{constructor(A,Q){let B="TransportError";super(A||B),this.name=B,this.message=A,this.stack=Error(A).stack,this.id=Q}}w("TransportError",A=>new k(A.message,A.id));let n={ACCESS_CONDITION_NOT_FULFILLED:38916,ALGORITHM_NOT_SUPPORTED:38020,CLA_NOT_SUPPORTED:28160,CODE_BLOCKED:38976,CODE_NOT_INITIALIZED:38914,COMMAND_INCOMPATIBLE_FILE_STRUCTURE:27009,CONDITIONS_OF_USE_NOT_SATISFIED:27013,CONTRADICTION_INVALIDATION:38928,CONTRADICTION_SECRET_CODE_STATUS:38920,CUSTOM_IMAGE_BOOTLOADER:26159,CUSTOM_IMAGE_EMPTY:26158,FILE_ALREADY_EXISTS:27273,FILE_NOT_FOUND:37892,GP_AUTH_FAILED:25344,HALTED:28586,INCONSISTENT_FILE:37896,INCORRECT_DATA:27264,INCORRECT_LENGTH:26368,INCORRECT_P1_P2:27392,INS_NOT_SUPPORTED:27904,DEVICE_NOT_ONBOARDED:27911,DEVICE_NOT_ONBOARDED_2:26129,INVALID_KCV:38021,INVALID_OFFSET:37890,LICENSING:28482,LOCKED_DEVICE:21781,MAX_VALUE_REACHED:38992,MEMORY_PROBLEM:37440,MISSING_CRITICAL_PARAMETER:26624,NO_EF_SELECTED:37888,NOT_ENOUGH_MEMORY_SPACE:27268,OK:36864,PIN_REMAINING_ATTEMPTS:25536,REFERENCED_DATA_NOT_FOUND:27272,SECURITY_STATUS_NOT_SATISFIED:27010,TECHNICAL_PROBLEM:28416,UNKNOWN_APDU:27906,USER_REFUSED_ON_DEVICE:21761,NOT_ENOUGH_SPACE:20738};function t(A){let Q=Object.keys(n).find(Q=>n[Q]===A)||"UNKNOWN_ERROR",B=function(A){switch(A){case 26368:return"Incorrect length";case 26624:return"Missing critical parameter";case 27010:return"Security not satisfied (dongle locked or have invalid access rights)";case 27013:return"Condition of use not satisfied (denied by the user?)";case 27264:return"Invalid data received";case 27392:return"Invalid parameter received";case 21781:return"Locked device"}if(28416<=A&&A<=28671)return"Internal error, please report"}(A)||Q,C=A.toString(16),I=`Ledger device: ${B} (0x${C})`;if(A===n.LOCKED_DEVICE)throw new M(I);this.name="TransportStatusError",this.message=I,this.stack=Error(I).stack,this.statusCode=A,this.statusText=Q}t.prototype=Error(),w("TransportStatusError",A=>new t(A.statusCode))},73866:function(A,Q,B){"use strict";B.d(Q,{Z:function(){return AS}});var C,I=B(97790),E=B(9341),g=B(75102),w=function(A,Q){return(w=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(A,Q){A.__proto__=Q}||function(A,Q){for(var B in Q)Q.hasOwnProperty(B)&&(A[B]=Q[B])})(A,Q)};function D(A,Q){function B(){this.constructor=A}w(A,Q),A.prototype=null===Q?Object.create(Q):(B.prototype=Q.prototype,new B)}function M(A){return"function"==typeof A}var c=!1,s={Promise:void 0,set useDeprecatedSynchronousErrorHandling(value){value&&Error().stack,c=value},get useDeprecatedSynchronousErrorHandling(){return c}};function y(A){setTimeout(function(){throw A},0)}var h={closed:!0,next:function(A){},error:function(A){if(s.useDeprecatedSynchronousErrorHandling)throw A;y(A)},complete:function(){}},k=Array.isArray||function(A){return A&&"number"==typeof A.length};function n(A){return null!==A&&"object"==typeof A}var t=function(){function A(A){return Error.call(this),this.message=A?A.length+" errors occurred during unsubscription:\n"+A.map(function(A,Q){return Q+1+") "+A.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=A,this}return A.prototype=Object.create(Error.prototype),A}(),K=function(){var A;function Q(A){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,A&&(this._ctorUnsubscribe=!0,this._unsubscribe=A)}return Q.prototype.unsubscribe=function(){if(!this.closed){var A,B=this._parentOrParents,C=this._ctorUnsubscribe,I=this._unsubscribe,E=this._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,B instanceof Q)B.remove(this);else if(null!==B)for(var g=0;g{let C=(function(A,Q){let B=[];for(let C=0,I=Q(0);CB-(0===A?5:3)).map((A,B)=>{let C=e.alloc(0===B?5:3);return C.writeUInt8(5,0),C.writeUInt16BE(B,1),0===B&&C.writeUInt16BE(Q.length,3),e.concat([C,A])});return new a(Q=>{let B=!1;return(function(){var Q,I,E,g;return Q=this,I=void 0,E=void 0,g=function*(){for(let Q of C){if(B)return;yield A(Q)}},new(E||(E=Promise))(function(A,B){function C(A){try{D(g.next(A))}catch(A){B(A)}}function w(A){try{D(g.throw(A))}catch(A){B(A)}}function D(Q){var B;Q.done?A(Q.value):((B=Q.value)instanceof E?B:new E(function(A){A(B)})).then(C,w)}D((g=g.apply(Q,I||[])).next())})})().then(()=>{B=!0,Q.complete()},A=>{B=!0,(0,o.c)("ble-error","sendAPDU failure "+String(A)),Q.error(A)}),()=>{B||((0,o.c)("ble-verbose","sendAPDU interruption"),B=!0)}})};var F=B(48834).lW;let S=A=>a.create(Q=>{let B=0,C=0,I=F.alloc(0),g=A.subscribe({complete:()=>{Q.error(new E.qX),g.unsubscribe()},error:A=>{(0,o.c)("ble-error","in receiveAPDU "+String(A)),Q.error(A),g.unsubscribe()},next:A=>{let w=A.readUInt8(0),D=A.readUInt16BE(1),M=A.slice(3);if(5!==w){Q.error(new E.PS("Invalid tag "+w.toString(16),"InvalidTag"));return}if(B!==D){Q.error(new E.PS("BLE: Invalid sequence number. discontinued chunk. Received "+D+" but expected "+B,"InvalidSequence"));return}if(0===D&&(C=M.readUInt16BE(0),M=M.slice(2)),B++,(I=F.concat([I,M])).length>C){Q.error(new E.PS("BLE: received too much data. discontinued chunk. Received "+I.length+" but expected "+C,"BLETooMuchData"));return}I.length===C&&(Q.next(I),Q.complete(),g.unsubscribe())}});return()=>{g.unsubscribe()}});function l(A,Q){return function(B){if("function"!=typeof A)throw TypeError("argument is not a function. Are you looking for `mapTo()`?");return B.lift(new H(A,Q))}}var H=function(){function A(A,Q){this.project=A,this.thisArg=Q}return A.prototype.call=function(A,Q){return Q.subscribe(new Y(A,this.project,this.thisArg))},A}(),Y=function(A){function Q(Q,B,C){var I=A.call(this,Q)||this;return I.project=B,I.count=0,I.thisArg=C||I,I}return D(Q,A),Q.prototype._next=function(A){var Q;try{Q=this.project.call(this.thisArg,A,this.count++)}catch(A){this.destination.error(A);return}this.destination.next(Q)},Q}(i),f=function(A){return function(Q){for(var B=0,C=A.length;B0?this._next(A.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},Q}(Z);function v(){for(var A,Q,B=[],C=0;C1&&"number"==typeof B[B.length-1]&&(I=B.pop())):"number"==typeof g&&(I=B.pop()),null===E&&1===B.length&&B[0]instanceof a)?B[0]:(void 0===(A=I)&&(A=Number.POSITIVE_INFINITY),function A(Q,B,C){return(void 0===C&&(C=Number.POSITIVE_INFINITY),"function"==typeof B)?function(I){return I.pipe(A(function(A,C){return m(Q(A,C)).pipe(l(function(Q,I){return B(A,Q,C,I)}))},C))}:("number"==typeof B&&(C=B),function(A){return A.lift(new O(Q,C))})}(p,A))((Q=E)?b(B,Q):new a(f(B)))}var V=new a(function(A){return A.complete()});function z(){}var W=function(){function A(A,Q,B){this.nextOrObserver=A,this.error=Q,this.complete=B}return A.prototype.call=function(A,Q){return Q.subscribe(new P(A,this.nextOrObserver,this.error,this.complete))},A}(),P=function(A){function Q(Q,B,C,I){var E=A.call(this,Q)||this;return E._tapNext=z,E._tapError=z,E._tapComplete=z,E._tapError=C||z,E._tapComplete=I||z,M(B)?(E._context=E,E._tapNext=B):B&&(E._context=B,E._tapNext=B.next||z,E._tapError=B.error||z,E._tapComplete=B.complete||z),E}return D(Q,A),Q.prototype._next=function(A){try{this._tapNext.call(this._context,A)}catch(A){this.destination.error(A);return}this.destination.next(A)},Q.prototype._error=function(A){try{this._tapError.call(this._context,A)}catch(A){this.destination.error(A);return}this.destination.error(A)},Q.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(A){this.destination.error(A);return}return this.destination.complete()},Q}(i),q=function(){function A(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return A.prototype=Object.create(Error.prototype),A}(),X=function(A){function Q(Q,B){var C=A.call(this)||this;return C.subject=Q,C.subscriber=B,C.closed=!1,C}return D(Q,A),Q.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var A=this.subject,Q=A.observers;if(this.subject=null,Q&&0!==Q.length&&!A.isStopped&&!A.closed){var B=Q.indexOf(this.subscriber);-1!==B&&Q.splice(B,1)}}},Q}(K),_=function(A){function Q(Q){var B=A.call(this,Q)||this;return B.destination=Q,B}return D(Q,A),Q}(i),$=function(A){function Q(){var Q=A.call(this)||this;return Q.observers=[],Q.closed=!1,Q.isStopped=!1,Q.hasError=!1,Q.thrownError=null,Q}return D(Q,A),Q.prototype[U]=function(){return new _(this)},Q.prototype.lift=function(A){var Q=new AA(this,this);return Q.operator=A,Q},Q.prototype.next=function(A){if(this.closed)throw new q;if(!this.isStopped)for(var Q=this.observers,B=Q.length,C=Q.slice(),I=0;I1)){this.connection=null;return}var B=this.connection,C=A._connection;this.connection=null,C&&(!B||C===B)&&C.unsubscribe()},Q}(i),AI={operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:(C=function(A){function Q(Q,B){var C=A.call(this)||this;return C.source=Q,C.subjectFactory=B,C._refCount=0,C._isComplete=!1,C}return D(Q,A),Q.prototype._subscribe=function(A){return this.getSubject().subscribe(A)},Q.prototype.getSubject=function(){var A=this._subject;return(!A||A.isStopped)&&(this._subject=this.subjectFactory()),this._subject},Q.prototype.connect=function(){var A=this._connection;return!A&&(this._isComplete=!1,(A=this._connection=new K).add(this.source.subscribe(new AE(this.getSubject(),this))),A.closed&&(this._connection=null,A=K.EMPTY)),A},Q.prototype.refCount=function(){return AQ()(this)},Q}(a).prototype)._subscribe},_isComplete:{value:C._isComplete,writable:!0},getSubject:{value:C.getSubject},connect:{value:C.connect},refCount:{value:C.refCount}},AE=function(A){function Q(Q,B){var C=A.call(this,Q)||this;return C.connectable=B,C}return D(Q,A),Q.prototype._error=function(Q){this._unsubscribe(),A.prototype._error.call(this,Q)},Q.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),A.prototype._complete.call(this)},Q.prototype._unsubscribe=function(){var A=this.connectable;if(A){this.connectable=null;var Q=A._connection;A._refCount=0,A._subject=null,A._connection=null,Q&&Q.unsubscribe()}},Q}(_),Ag=function(){function A(A,Q){this.subjectFactory=A,this.selector=Q}return A.prototype.call=function(A,Q){var B=this.selector,C=this.subjectFactory(),I=B(C).subscribe(A);return I.add(Q.subscribe(C)),I},A}();function Aw(){return new $}var AD=function(){function A(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return A.prototype=Object.create(Error.prototype),A}(),AM=function(){function A(A,Q){this.predicate=A,this.thisArg=Q}return A.prototype.call=function(A,Q){return Q.subscribe(new Ac(A,this.predicate,this.thisArg))},A}(),Ac=function(A){function Q(Q,B,C){var I=A.call(this,Q)||this;return I.predicate=B,I.thisArg=C,I.count=0,I}return D(Q,A),Q.prototype._next=function(A){var Q;try{Q=this.predicate.call(this.thisArg,A,this.count++)}catch(A){this.destination.error(A);return}Q&&this.destination.next(A)},Q}(i),As=function(){function A(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return A.prototype=Object.create(Error.prototype),A}(),Ay=function(){function A(A){if(this.total=A,this.total<0)throw new As}return A.prototype.call=function(A,Q){return Q.subscribe(new Ah(A,this.total))},A}(),Ah=function(A){function Q(Q,B){var C=A.call(this,Q)||this;return C.total=B,C.count=0,C}return D(Q,A),Q.prototype._next=function(A){var Q=this.total,B=++this.count;B<=Q&&(this.destination.next(A),B===Q&&(this.destination.complete(),this.unsubscribe()))},Q}(i),Ak=function(){function A(A){this.defaultValue=A}return A.prototype.call=function(A,Q){return Q.subscribe(new An(A,this.defaultValue))},A}(),An=function(A){function Q(Q,B){var C=A.call(this,Q)||this;return C.defaultValue=B,C.isEmpty=!0,C}return D(Q,A),Q.prototype._next=function(A){this.isEmpty=!1,this.destination.next(A)},Q.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},Q}(i),At=function(){function A(A){this.errorFactory=A}return A.prototype.call=function(A,Q){return Q.subscribe(new AK(A,this.errorFactory))},A}(),AK=function(A){function Q(Q,B){var C=A.call(this,Q)||this;return C.errorFactory=B,C.hasValue=!1,C}return D(Q,A),Q.prototype._next=function(A){this.hasValue=!0,this.destination.next(A)},Q.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var A=void 0;try{A=this.errorFactory()}catch(Q){A=Q}this.destination.error(A)},Q}(i),AL=function(){function A(){}return A.prototype.call=function(A,Q){return Q.subscribe(new AU(A))},A}(),AU=function(A){function Q(){return null!==A&&A.apply(this,arguments)||this}return D(Q,A),Q.prototype._next=function(A){},Q}(i),Ai=B(48834).lW;let AG=A=>a.create(Q=>{function B(A){let B=A.target;B.value&&Q.next(Ai.from(B.value.buffer))}return(0,o.c)("ble-verbose","start monitor "+A.uuid),A.startNotifications().then(()=>{A.addEventListener("characteristicvaluechanged",B)}),()=>{(0,o.c)("ble-verbose","end monitor "+A.uuid),A.stopNotifications()}});var Ar=B(48834).lW,Ap=function(A,Q,B,C){return new(B||(B=Promise))(function(I,E){function g(A){try{D(C.next(A))}catch(A){E(A)}}function w(A){try{D(C.throw(A))}catch(A){E(A)}}function D(A){var Q;A.done?I(A.value):((Q=A.value)instanceof B?Q:new B(function(A){A(Q)})).then(g,w)}D((C=C.apply(A,Q||[])).next())})};let Aa=()=>{let{bluetooth:A}=navigator;if(void 0===A)throw Error("web bluetooth not supported");return A},AN=()=>a.create(A=>{let Q=Aa(),B=Q=>{A.next(Q.value)};Q.addEventListener("availabilitychanged",B);let C=!1;return Q.getAvailability().then(Q=>{C||A.next(Q)}),()=>{C=!0,Q.removeEventListener("availabilitychanged",B)}}),Ao={},Ae=()=>({filters:(0,g.RH)().map(A=>({services:[A]}))}),AJ=A=>Ap(void 0,void 0,void 0,function*(){if(!A.gatt)throw Error("bluetooth gatt not found");let[Q]=yield A.gatt.getPrimaryServices();if(!Q)throw Error("bluetooth service not found");let B=(0,g.R7)(Q.uuid);if(!B)throw Error("bluetooth service infos not found");return[Q,B]});class AF extends I.ZP{static listen(A){let Q;return(0,o.c)("ble-verbose","listen..."),Aa().requestDevice(Ae()).then(B=>{Q||(A.next({type:"add",descriptor:B}),A.complete())},Q=>{A.error(new E.FB(Q.message))}),{unsubscribe:function(){Q=!0}}}static open(A){return Ap(this,void 0,void 0,function*(){return function A(Q,B){return Ap(this,void 0,void 0,function*(){var C;let I;if("string"==typeof Q){if(Ao[Q])return(0,o.c)("ble-verbose","Transport in cache, using that."),Ao[Q];let A=Aa();I=yield A.requestDevice(Ae())}else I=Q;I.gatt.connected||((0,o.c)("ble-verbose","not connected. connecting..."),yield I.gatt.connect());let[g,w]=yield AJ(I),{deviceModel:D,writeUuid:M,notifyUuid:c}=w,[s,y]=yield Promise.all([g.getCharacteristic(M),g.getCharacteristic(c)]),h=AG(y).pipe((C=A=>{(0,o.c)("ble-frame","<= "+A.toString("hex"))},function(A){return A.lift(new W(C,void 0,void 0))}),function(A){var Q;return AQ()(function(A){if("function"==typeof Q)return A.lift(new Ag(Aw,Q));var B=Object.create(A,AI);return B.source=A,B.subjectFactory=Aw,B}(A))}),k=h.subscribe(),n=new AF(I,s,h,D);if(!I.gatt.connected)throw new E.qX;Ao[n.id]=n;let t=A=>{console.log("onDisconnect!",A),delete Ao[n.id],n.notYetDisconnected=!1,k.unsubscribe(),I.removeEventListener("gattserverdisconnected",t),(0,o.c)("ble-verbose",`BleTransport(${n.id}) disconnected`),n.emit("disconnect",A)};I.addEventListener("gattserverdisconnected",t);let K=Date.now();try{yield n.inferMTU()}finally{Date.now()-K<1e3&&(B=!1),B&&(yield I.gatt.disconnect(),yield new Promise(A=>setTimeout(A,4e3)))}return B?A(I,!1):n})}(A,!0)})}constructor(A,Q,B,C){super(),this.mtuSize=20,this.notYetDisconnected=!0,this.write=A=>Ap(this,void 0,void 0,function*(){(0,o.c)("ble-frame","=> "+A.toString("hex")),yield this.writeCharacteristic.writeValue(A)}),this.id=A.id,this.device=A,this.writeCharacteristic=Q,this.notifyObservable=B,this.deviceModel=C,(0,o.c)("ble-verbose",`BleTransport(${String(this.id)}) new instance`)}inferMTU(){return Ap(this,void 0,void 0,function*(){let A=23;if(yield this.exchangeAtomicImpl(()=>Ap(this,void 0,void 0,function*(){try{var Q;A=(yield v(this.notifyObservable.pipe(function(A,Q){var B=arguments.length>=2;return function(Q){var C,I,E;return Q.pipe(A?(C=function(B,C){return A(B,C,Q)},function(A){return A.lift(new AM(C,void 0))}):p,function(A){return A.lift(new Ay(1))},B?(I=void 0,I=null,function(A){return A.lift(new Ak(I))}):(E=function(){return new AD},function(A){return A.lift(new At(E))}))}}(A=>8===A.readUInt8(0)),l(A=>A.readUInt8(5))),(Q=()=>m(this.write(Ar.from([8,0,0,0,0]))),new a(function(A){var B,C,I;try{C=Q()}catch(Q){A.error(Q);return}return(C?m(C):B?(I=B,new a(function(A){return I.schedule(function(){return A.complete()})})):V).subscribe(A)})).pipe(function(A){return A.lift(new AL)})).toPromise())+3}catch(A){throw(0,o.c)("ble-error","inferMTU got "+String(A)),this.device.gatt.disconnect(),A}})),A>23){let Q=A-3;(0,o.c)("ble-verbose",`BleTransport(${String(this.id)}) mtu set to ${String(Q)}`),this.mtuSize=Q}return this.mtuSize})}exchange(A){return Ap(this,void 0,void 0,function*(){return yield this.exchangeAtomicImpl(()=>Ap(this,void 0,void 0,function*(){try{let Q=A.toString("hex");(0,o.c)("apdu",`=> ${Q}`);let B=yield v(this.notifyObservable.pipe(S),J(this.write,A,this.mtuSize)).toPromise(),C=B.toString("hex");return(0,o.c)("apdu",`<= ${C}`),B}catch(A){throw(0,o.c)("ble-error","exchange got "+String(A)),this.notYetDisconnected&&this.device.gatt.disconnect(),A}}))})}setScrambleKey(){}close(){return Ap(this,void 0,void 0,function*(){this.exchangeBusyPromise&&(yield this.exchangeBusyPromise)})}}AF.isSupported=()=>Promise.resolve().then(Aa).then(()=>!0,()=>!1),AF.observeAvailability=A=>AN().subscribe(A),AF.list=()=>Promise.resolve([]),AF.disconnect=A=>Ap(void 0,void 0,void 0,function*(){(0,o.c)("ble-verbose",`user disconnect(${A})`);let Q=Ao[A];Q&&Q.device.gatt.disconnect()});var AS=AF},27748:function(A,Q,B){"use strict";B.d(Q,{Z:function(){return K}});var C=B(97790),I=B(9341),E=B(48834).lW;let g={data:E.alloc(0),dataLength:0,sequence:0};var w=(A,Q)=>({makeBlocks(B){let C=E.concat([function(A){let Q=E.alloc(2);return Q.writeUInt16BE(A,0),Q}(B.length),B]),I=Q-5,g=Math.ceil(C.length/I);C=E.concat([C,E.alloc(g*I-C.length+1).fill(0)]);let w=[];for(let Q=0;Qw&&(C=C.slice(0,w)),{data:C,dataLength:w,sequence:D}},getReducedResult(A){if(A&&A.dataLength===A.data.length)return A.data}}),D=B(75102),M=B(91288),c=B(48834).lW,s=function(A,Q,B,C){return new(B||(B=Promise))(function(I,E){function g(A){try{D(C.next(A))}catch(A){E(A)}}function w(A){try{D(C.throw(A))}catch(A){E(A)}}function D(A){var Q;A.done?I(A.value):((Q=A.value)instanceof B?Q:new B(function(A){A(Q)})).then(g,w)}D((C=C.apply(A,Q||[])).next())})};let y=[{vendorId:D.An}],h=()=>{let{hid:A}=navigator;if(!A)throw new I.PS("navigator.hid is not supported","HIDNotSupported");return A};function k(){return s(this,void 0,void 0,function*(){let A=yield h().requestDevice({filters:y});return Array.isArray(A)?A:[A]})}function n(){return s(this,void 0,void 0,function*(){return(yield h().getDevices()).filter(A=>A.vendorId===D.An)})}class t extends C.ZP{constructor(A){super(),this.channel=Math.floor(65535*Math.random()),this.packetSize=64,this.inputs=[],this.read=()=>this.inputs.length?Promise.resolve(this.inputs.shift()):new Promise(A=>{this.inputCallback=A}),this.onInputReport=A=>{let Q=c.from(A.data.buffer);this.inputCallback?(this.inputCallback(Q),this.inputCallback=null):this.inputs.push(Q)},this._disconnectEmitted=!1,this._emitDisconnect=A=>{this._disconnectEmitted||(this._disconnectEmitted=!0,this.emit("disconnect",A))},this.exchange=A=>s(this,void 0,void 0,function*(){return yield this.exchangeAtomicImpl(()=>s(this,void 0,void 0,function*(){let Q,B;let{channel:C,packetSize:I}=this;(0,M.c)("apdu","=> "+A.toString("hex"));let E=w(C,I),g=E.makeBlocks(A);for(let A=0;A{if(A&&A.message&&A.message.includes("write"))throw this._emitDisconnect(A),new I.vs(A.message);throw A})}),this.device=A,this.deviceModel="number"==typeof A.productId?(0,D.Ht)(A.productId):void 0,A.addEventListener("inputreport",this.onInputReport)}static request(){return s(this,void 0,void 0,function*(){let[A]=yield k();return t.open(A)})}static openConnected(){return s(this,void 0,void 0,function*(){let A=yield n();return 0===A.length?null:t.open(A[0])})}static open(A){return s(this,void 0,void 0,function*(){yield A.open();let Q=new t(A),B=C=>{A===C.device&&(h().removeEventListener("disconnect",B),Q._emitDisconnect(new I.qX))};return h().addEventListener("disconnect",B),Q})}close(){return s(this,void 0,void 0,function*(){yield this.exchangeBusyPromise,this.device.removeEventListener("inputreport",this.onInputReport),yield this.device.close()})}setScrambleKey(){}}t.isSupported=()=>Promise.resolve(!!(window.navigator&&window.navigator.hid)),t.list=n,t.listen=A=>{let Q=!1;return(function(){return s(this,void 0,void 0,function*(){let A=yield n();return A.length>0?A[0]:(yield k())[0]})})().then(B=>{if(B){if(!Q){let Q="number"==typeof B.productId?(0,D.Ht)(B.productId):void 0;A.next({type:"add",descriptor:B,deviceModel:Q}),A.complete()}}else A.error(new I.FB("Access denied to use Ledger device"))},Q=>{A.error(new I.FB(Q.message))}),{unsubscribe:function(){Q=!0}}};var K=t},97790:function(A,Q,B){"use strict";var C=B(22699),I=B.n(C),E=B(9341),g=B(48834).lW,w=function(A,Q,B,C){return new(B||(B=Promise))(function(I,E){function g(A){try{D(C.next(A))}catch(A){E(A)}}function w(A){try{D(C.throw(A))}catch(A){E(A)}}function D(A){var Q;A.done?I(A.value):((Q=A.value)instanceof B?Q:new B(function(A){A(Q)})).then(g,w)}D((C=C.apply(A,Q||[])).next())})};class D{constructor(){this.exchangeTimeout=3e4,this.unresponsiveTimeout=15e3,this.deviceModel=null,this._events=new(I()),this.send=(A,Q,B,C,I=g.alloc(0),D=[E.WC.OK])=>w(this,void 0,void 0,function*(){if(I.length>=256)throw new E.PS("data.length exceed 256 bytes limit. Got: "+I.length,"DataLengthTooBig");let w=yield this.exchange(g.concat([g.from([A,Q,B,C]),g.from([I.length]),I])),M=w.readUInt16BE(w.length-2);if(!D.some(A=>A===M))throw new E.rZ(M);return w}),this.exchangeAtomicImpl=A=>w(this,void 0,void 0,function*(){let Q;if(this.exchangeBusyPromise)throw new E.wp("An action was already pending on the Ledger device. Please deny or reconnect.");let B=new Promise(A=>{Q=A});this.exchangeBusyPromise=B;let C=!1,I=setTimeout(()=>{C=!0,this.emit("unresponsive")},this.unresponsiveTimeout);try{let Q=yield A();return C&&this.emit("responsive"),Q}finally{clearTimeout(I),Q&&Q(),this.exchangeBusyPromise=null}}),this._appAPIlock=null}exchange(A){throw Error("exchange not implemented")}exchangeBulk(A,Q){let B=!1;return w(this,void 0,void 0,function*(){if(!B)for(let C of A){let A=yield this.exchange(C);if(B)return;let I=A.readUInt16BE(A.length-2);if(I!==E.WC.OK)throw new E.rZ(I);Q.next(A)}}).then(()=>!B&&Q.complete(),A=>!B&&Q.error(A)),{unsubscribe:()=>{B=!0}}}setScrambleKey(A){}close(){return Promise.resolve()}on(A,Q){this._events.on(A,Q)}off(A,Q){this._events.removeListener(A,Q)}emit(A,...Q){this._events.emit(A,...Q)}setDebugMode(){console.warn("setDebugMode is deprecated. use @ledgerhq/logs instead. No logs are emitted in this anymore.")}setExchangeTimeout(A){this.exchangeTimeout=A}setExchangeUnresponsiveTimeout(A){this.unresponsiveTimeout=A}static create(A=3e3,Q){return new Promise((B,C)=>{let I=!1,g=this.listen({next:Q=>{I=!0,g&&g.unsubscribe(),w&&clearTimeout(w),this.open(Q.descriptor,A).then(B,C)},error:A=>{w&&clearTimeout(w),C(A)},complete:()=>{w&&clearTimeout(w),I||C(new E.PS(this.ErrorMessage_NoDeviceFound,"NoDeviceFound"))}}),w=Q?setTimeout(()=>{g.unsubscribe(),C(new E.PS(this.ErrorMessage_ListenTimeout,"ListenTimeout"))},Q):null})}decorateAppAPIMethods(A,Q,B){for(let C of Q)A[C]=this.decorateAppAPIMethod(C,A[C],A,B)}decorateAppAPIMethod(A,Q,B,C){return(...I)=>w(this,void 0,void 0,function*(){let{_appAPIlock:g}=this;if(g)return Promise.reject(new E.PS("Ledger Device is busy (lock "+g+")","TransportLocked"));try{return this._appAPIlock=A,this.setScrambleKey(C),yield Q.apply(B,I)}finally{this._appAPIlock=null}})}}D.ErrorMessage_ListenTimeout="No Ledger device found (timeout)",D.ErrorMessage_NoDeviceFound="No Ledger device found",Q.ZP=D},91288:function(A,Q,B){"use strict";B.d(Q,{c:function(){return E}});var C=0,I=[],E=function(A,Q,B){var E={type:A,id:String(++C),date:new Date};Q&&(E.message=Q),B&&(E.data=B),function(A){for(var Q=0;Q0&&I[I.length-1])&&(6===E[0]||2===E[0])){g=0;continue}if(3===E[0]&&(!I||E[1]>I[0]&&E[1] @@ -19,7 +19,7 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var B="function"==typeof Symbol&&Symbol.for,C=B?Symbol.for("react.element"):60103,I=B?Symbol.for("react.portal"):60106,E=B?Symbol.for("react.fragment"):60107,g=B?Symbol.for("react.strict_mode"):60108,w=B?Symbol.for("react.profiler"):60114,D=B?Symbol.for("react.provider"):60109,M=B?Symbol.for("react.context"):60110,c=B?Symbol.for("react.async_mode"):60111,s=B?Symbol.for("react.concurrent_mode"):60111,y=B?Symbol.for("react.forward_ref"):60112,h=B?Symbol.for("react.suspense"):60113,k=B?Symbol.for("react.suspense_list"):60120,n=B?Symbol.for("react.memo"):60115,t=B?Symbol.for("react.lazy"):60116,K=B?Symbol.for("react.block"):60121,L=B?Symbol.for("react.fundamental"):60117,U=B?Symbol.for("react.responder"):60118,i=B?Symbol.for("react.scope"):60119;function G(A){if("object"==typeof A&&null!==A){var Q=A.$$typeof;switch(Q){case C:switch(A=A.type){case c:case s:case E:case w:case g:case h:return A;default:switch(A=A&&A.$$typeof){case M:case y:case t:case n:case D:return A;default:return Q}}case I:return Q}}}function r(A){return G(A)===s}Q.AsyncMode=c,Q.ConcurrentMode=s,Q.ContextConsumer=M,Q.ContextProvider=D,Q.Element=C,Q.ForwardRef=y,Q.Fragment=E,Q.Lazy=t,Q.Memo=n,Q.Portal=I,Q.Profiler=w,Q.StrictMode=g,Q.Suspense=h,Q.isAsyncMode=function(A){return r(A)||G(A)===c},Q.isConcurrentMode=r,Q.isContextConsumer=function(A){return G(A)===M},Q.isContextProvider=function(A){return G(A)===D},Q.isElement=function(A){return"object"==typeof A&&null!==A&&A.$$typeof===C},Q.isForwardRef=function(A){return G(A)===y},Q.isFragment=function(A){return G(A)===E},Q.isLazy=function(A){return G(A)===t},Q.isMemo=function(A){return G(A)===n},Q.isPortal=function(A){return G(A)===I},Q.isProfiler=function(A){return G(A)===w},Q.isStrictMode=function(A){return G(A)===g},Q.isSuspense=function(A){return G(A)===h},Q.isValidElementType=function(A){return"string"==typeof A||"function"==typeof A||A===E||A===s||A===w||A===g||A===h||A===k||"object"==typeof A&&null!==A&&(A.$$typeof===t||A.$$typeof===n||A.$$typeof===D||A.$$typeof===M||A.$$typeof===y||A.$$typeof===L||A.$$typeof===U||A.$$typeof===i||A.$$typeof===K)},Q.typeOf=G},73887:function(A,Q,B){"use strict";A.exports=B(43459)},62333:function(A,Q){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */Q.read=function(A,Q,B,C,I){var E,g,w=8*I-C-1,D=(1<>1,c=-7,s=B?I-1:0,y=B?-1:1,h=A[Q+s];for(s+=y,E=h&(1<<-c)-1,h>>=-c,c+=w;c>0;E=256*E+A[Q+s],s+=y,c-=8);for(g=E&(1<<-c)-1,E>>=-c,c+=C;c>0;g=256*g+A[Q+s],s+=y,c-=8);if(0===E)E=1-M;else{if(E===D)return g?NaN:1/0*(h?-1:1);g+=Math.pow(2,C),E-=M}return(h?-1:1)*g*Math.pow(2,E-C)},Q.write=function(A,Q,B,C,I,E){var g,w,D,M=8*E-I-1,c=(1<>1,y=23===I?5960464477539062e-23:0,h=C?0:E-1,k=C?1:-1,n=Q<0||0===Q&&1/Q<0?1:0;for(isNaN(Q=Math.abs(Q))||Q===1/0?(w=isNaN(Q)?1:0,g=c):(g=Math.floor(Math.log(Q)/Math.LN2),Q*(D=Math.pow(2,-g))<1&&(g--,D*=2),g+s>=1?Q+=y/D:Q+=y*Math.pow(2,1-s),Q*D>=2&&(g++,D/=2),g+s>=c?(w=0,g=c):g+s>=1?(w=(Q*D-1)*Math.pow(2,I),g+=s):(w=Q*Math.pow(2,s-1)*Math.pow(2,I),g=0));I>=8;A[B+h]=255&w,h+=k,w/=256,I-=8);for(g=g<0;A[B+h]=255&g,h+=k,g/=256,M-=8);A[B+h-k]|=128*n}},39515:function(A,Q,B){var C=B(38761)(B(37772),"DataView");A.exports=C},89612:function(A,Q,B){var C=B(52118),I=B(96909),E=B(98138),g=B(4174),w=B(7942);function D(A){var Q=-1,B=null==A?0:A.length;for(this.clear();++QI?0:I+Q),(B=B>I?I:B)<0&&(B+=I),I=Q>B?0:B-Q>>>0,Q>>>=0;for(var E=Array(I);++C=I?A:C(A,Q,B)}},24019:function(A,Q,B){var C=B(37772)["__core-js_shared__"];A.exports=C},55463:function(A){A.exports=function(A){return function(Q,B,C){for(var I=-1,E=Object(Q),g=C(Q),w=g.length;w--;){var D=g[A?w:++I];if(!1===B(E[D],D,E))break}return Q}}},83126:function(A,Q,B){var C=B(23895),I=B(33880),E=B(8435),g=B(66188);A.exports=function(A){return function(Q){var B=I(Q=g(Q))?E(Q):void 0,w=B?B[0]:Q.charAt(0),D=B?C(B,1).join(""):Q.slice(1);return w[A]()+D}}},34311:function(A,Q,B){var C=B(81207),I=B(97329),E=B(11618),g=RegExp("['’]","g");A.exports=function(A){return function(Q){return C(E(I(Q).replace(g,"")),A,"")}}},61655:function(A,Q,B){var C=B(6435)({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"});A.exports=C},83043:function(A,Q,B){var C=B(38761),I=function(){try{var A=C(Object,"defineProperty");return A({},"",{}),A}catch(A){}}();A.exports=I},74871:function(A,Q,B){var C=B(45386),I=B(87064),E=B(59950);A.exports=function(A,Q,B,g,w,D){var M=1&B,c=A.length,s=Q.length;if(c!=s&&!(M&&s>c))return!1;var y=D.get(A),h=D.get(Q);if(y&&h)return y==Q&&h==A;var k=-1,n=!0,t=2&B?new C:void 0;for(D.set(A,Q),D.set(Q,A);++k-1&&A%1==0&&A-1}},94769:function(A,Q,B){var C=B(22218);A.exports=function(A,Q){var B=this.__data__,I=C(B,A);return I<0?(++this.size,B.push([A,Q])):B[I][1]=Q,this}},92411:function(A,Q,B){var C=B(89612),I=B(80235),E=B(10326);A.exports=function(){this.size=0,this.__data__={hash:new C,map:new(E||I),string:new C}}},36417:function(A,Q,B){var C=B(27937);A.exports=function(A){var Q=C(this,A).delete(A);return this.size-=Q?1:0,Q}},86928:function(A,Q,B){var C=B(27937);A.exports=function(A){return C(this,A).get(A)}},79493:function(A,Q,B){var C=B(27937);A.exports=function(A){return C(this,A).has(A)}},24150:function(A,Q,B){var C=B(27937);A.exports=function(A,Q){var B=C(this,A),I=B.size;return B.set(A,Q),this.size+=B.size==I?0:1,this}},75179:function(A){A.exports=function(A){var Q=-1,B=Array(A.size);return A.forEach(function(A,C){B[++Q]=[C,A]}),B}},73477:function(A){A.exports=function(A,Q){return function(B){return null!=B&&B[A]===Q&&(void 0!==Q||A in Object(B))}}},77777:function(A,Q,B){var C=B(30733);A.exports=function(A){var Q=C(A,function(A){return 500===B.size&&B.clear(),A}),B=Q.cache;return Q}},99191:function(A,Q,B){var C=B(38761)(Object,"create");A.exports=C},54248:function(A,Q,B){var C=B(60241)(Object.keys,Object);A.exports=C},4146:function(A,Q,B){A=B.nmd(A);var C=B(51242),I=Q&&!Q.nodeType&&Q,E=I&&A&&!A.nodeType&&A,g=E&&E.exports===I&&C.process,w=function(){try{var A=E&&E.require&&E.require("util").types;if(A)return A;return g&&g.binding&&g.binding("util")}catch(A){}}();A.exports=w},37157:function(A){var Q=Object.prototype.toString;A.exports=function(A){return Q.call(A)}},60241:function(A){A.exports=function(A,Q){return function(B){return A(Q(B))}}},37772:function(A,Q,B){var C=B(51242),I="object"==typeof self&&self&&self.Object===Object&&self,E=C||I||Function("return this")();A.exports=E},52842:function(A){A.exports=function(A){return this.__data__.set(A,"__lodash_hash_undefined__"),this}},52482:function(A){A.exports=function(A){return this.__data__.has(A)}},16909:function(A){A.exports=function(A){var Q=-1,B=Array(A.size);return A.forEach(function(A){B[++Q]=A}),B}},15243:function(A,Q,B){var C=B(80235);A.exports=function(){this.__data__=new C,this.size=0}},72858:function(A){A.exports=function(A){var Q=this.__data__,B=Q.delete(A);return this.size=Q.size,B}},4417:function(A){A.exports=function(A){return this.__data__.get(A)}},8605:function(A){A.exports=function(A){return this.__data__.has(A)}},71418:function(A,Q,B){var C=B(80235),I=B(10326),E=B(96738);A.exports=function(A,Q){var B=this.__data__;if(B instanceof C){var g=B.__data__;if(!I||g.length<199)return g.push([A,Q]),this.size=++B.size,this;B=this.__data__=new E(g)}return B.set(A,Q),this.size=B.size,this}},8435:function(A,Q,B){var C=B(50217),I=B(33880),E=B(63344);A.exports=function(A){return I(A)?E(A):C(A)}},54452:function(A,Q,B){var C=B(77777),I=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,E=/\\(\\)?/g,g=C(function(A){var Q=[];return 46===A.charCodeAt(0)&&Q.push(""),A.replace(I,function(A,B,C,I){Q.push(C?I.replace(E,"$1"):B||A)}),Q});A.exports=g},33812:function(A,Q,B){var C=B(4795),I=1/0;A.exports=function(A){if("string"==typeof A||C(A))return A;var Q=A+"";return"0"==Q&&1/A==-I?"-0":Q}},87035:function(A){var Q=Function.prototype.toString;A.exports=function(A){if(null!=A){try{return Q.call(A)}catch(A){}try{return A+""}catch(A){}}return""}},63344:function(A){var Q="\ud800-\udfff",B="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",C="\ud83c[\udffb-\udfff]",I="[^"+Q+"]",E="(?:\ud83c[\udde6-\uddff]){2}",g="[\ud800-\udbff][\udc00-\udfff]",w="(?:"+B+"|"+C+")?",D="[\\ufe0e\\ufe0f]?",M="(?:\\u200d(?:"+[I,E,g].join("|")+")"+D+w+")*",c=RegExp(C+"(?="+C+")|(?:"+[I+B+"?",B,E,g,"["+Q+"]"].join("|")+")"+(D+w+M),"g");A.exports=function(A){return A.match(c)||[]}},75304:function(A){var Q="\ud800-\udfff",B="\\u2700-\\u27bf",C="a-z\\xdf-\\xf6\\xf8-\\xff",I="A-Z\\xc0-\\xd6\\xd8-\\xde",E="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",g="['’]",w="["+E+"]",D="["+C+"]",M="[^"+Q+E+"\\d+"+B+C+I+"]",c="(?:\ud83c[\udde6-\uddff]){2}",s="[\ud800-\udbff][\udc00-\udfff]",y="["+I+"]",h="(?:"+D+"|"+M+")",k="(?:"+g+"(?:d|ll|m|re|s|t|ve))?",n="(?:"+g+"(?:D|LL|M|RE|S|T|VE))?",t="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\ud83c[\udffb-\udfff])?",K="[\\ufe0e\\ufe0f]?",L="(?:\\u200d(?:"+["[^"+Q+"]",c,s].join("|")+")"+K+t+")*",U="(?:"+["["+B+"]",c,s].join("|")+")"+(K+t+L),i=RegExp([y+"?"+D+"+"+k+"(?="+[w,y,"$"].join("|")+")","(?:"+y+"|"+M+")+"+n+"(?="+[w,y+h,"$"].join("|")+")",y+"?"+h+"+"+k,y+"+"+n,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])","\\d+",U].join("|"),"g");A.exports=function(A){return A.match(i)||[]}},96009:function(A,Q,B){var C=B(82108),I=B(34311)(function(A,Q,B){return Q=Q.toLowerCase(),A+(B?C(Q):Q)});A.exports=I},82108:function(A,Q,B){var C=B(66188),I=B(23779);A.exports=function(A){return I(C(A).toLowerCase())}},97329:function(A,Q,B){var C=B(61655),I=B(66188),E=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,g=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");A.exports=function(A){return(A=I(A))&&A.replace(E,C).replace(g,"")}},41225:function(A){A.exports=function(A,Q){return A===Q||A!=A&&Q!=Q}},72579:function(A,Q,B){var C=B(13324);A.exports=function(A,Q,B){var I=null==A?void 0:C(A,Q);return void 0===I?B:I}},93352:function(A,Q,B){var C=B(32726),I=B(1369);A.exports=function(A,Q){return null!=A&&I(A,Q,C)}},95041:function(A,Q,B){var C=B(20187),I=B(1369);A.exports=function(A,Q){return null!=A&&I(A,Q,C)}},23059:function(A){A.exports=function(A){return A}},79631:function(A,Q,B){var C=B(15183),I=B(15125),E=Object.prototype,g=E.hasOwnProperty,w=E.propertyIsEnumerable,D=C(function(){return arguments}())?C:function(A){return I(A)&&g.call(A,"callee")&&!w.call(A,"callee")};A.exports=D},86152:function(A){var Q=Array.isArray;A.exports=Q},67878:function(A,Q,B){var C=B(61049),I=B(61158);A.exports=function(A){return null!=A&&I(A.length)&&!C(A)}},73226:function(A,Q,B){A=B.nmd(A);var C=B(37772),I=B(36330),E=Q&&!Q.nodeType&&Q,g=E&&A&&!A.nodeType&&A,w=g&&g.exports===E?C.Buffer:void 0,D=w?w.isBuffer:void 0;A.exports=D||I},61049:function(A,Q,B){var C=B(53366),I=B(29259);A.exports=function(A){if(!I(A))return!1;var Q=C(A);return"[object Function]"==Q||"[object GeneratorFunction]"==Q||"[object AsyncFunction]"==Q||"[object Proxy]"==Q}},61158:function(A){A.exports=function(A){return"number"==typeof A&&A>-1&&A%1==0&&A<=9007199254740991}},29259:function(A){A.exports=function(A){var Q=typeof A;return null!=A&&("object"==Q||"function"==Q)}},15125:function(A){A.exports=function(A){return null!=A&&"object"==typeof A}},4795:function(A,Q,B){var C=B(53366),I=B(15125);A.exports=function(A){return"symbol"==typeof A||I(A)&&"[object Symbol]"==C(A)}},77598:function(A,Q,B){var C=B(35522),I=B(47826),E=B(4146),g=E&&E.isTypedArray,w=g?I(g):C;A.exports=w},90249:function(A,Q,B){var C=B(1634),I=B(86411),E=B(67878);A.exports=function(A){return E(A)?C(A):I(A)}},19950:function(A,Q,B){var C=B(13940),I=B(26548),E=B(68286);A.exports=function(A,Q){var B={};return Q=E(Q,3),I(A,function(A,I,E){C(B,Q(A,I,E),A)}),B}},34519:function(A,Q,B){var C=B(13940),I=B(26548),E=B(68286);A.exports=function(A,Q){var B={};return Q=E(Q,3),I(A,function(A,I,E){C(B,I,Q(A,I,E))}),B}},30733:function(A,Q,B){var C=B(96738);function I(A,Q){if("function"!=typeof A||null!=Q&&"function"!=typeof Q)throw TypeError("Expected a function");var B=function(){var C=arguments,I=Q?Q.apply(this,C):C[0],E=B.cache;if(E.has(I))return E.get(I);var g=A.apply(this,C);return B.cache=E.set(I,g)||E,g};return B.cache=new(I.Cache||C),B}I.Cache=C,A.exports=I},65798:function(A,Q,B){var C=B(20256),I=B(82952),E=B(21401),g=B(33812);A.exports=function(A){return E(A)?C(g(A)):I(A)}},57370:function(A,Q,B){var C=B(34311)(function(A,Q,B){return A+(B?"_":"")+Q.toLowerCase()});A.exports=C},30981:function(A){A.exports=function(){return[]}},36330:function(A){A.exports=function(){return!1}},66188:function(A,Q,B){var C=B(1054);A.exports=function(A){return null==A?"":C(A)}},23779:function(A,Q,B){var C=B(83126)("toUpperCase");A.exports=C},11618:function(A,Q,B){var C=B(45981),I=B(83559),E=B(66188),g=B(75304);A.exports=function(A,Q,B){return(A=E(A),void 0===(Q=B?void 0:Q))?I(A)?g(A):C(A):A.match(Q)||[]}},77105:function(A,Q,B){"use strict";let C=B(8006),I=Symbol("max"),E=Symbol("length"),g=Symbol("lengthCalculator"),w=Symbol("allowStale"),D=Symbol("maxAge"),M=Symbol("dispose"),c=Symbol("noDisposeOnSet"),s=Symbol("lruList"),y=Symbol("cache"),h=Symbol("updateAgeOnGet"),k=()=>1;class n{constructor(A){if("number"==typeof A&&(A={max:A}),A||(A={}),A.max&&("number"!=typeof A.max||A.max<0))throw TypeError("max must be a non-negative number");this[I]=A.max||1/0;let Q=A.length||k;if(this[g]="function"!=typeof Q?k:Q,this[w]=A.stale||!1,A.maxAge&&"number"!=typeof A.maxAge)throw TypeError("maxAge must be a number");this[D]=A.maxAge||0,this[M]=A.dispose,this[c]=A.noDisposeOnSet||!1,this[h]=A.updateAgeOnGet||!1,this.reset()}set max(A){if("number"!=typeof A||A<0)throw TypeError("max must be a non-negative number");this[I]=A||1/0,L(this)}get max(){return this[I]}set allowStale(A){this[w]=!!A}get allowStale(){return this[w]}set maxAge(A){if("number"!=typeof A)throw TypeError("maxAge must be a non-negative number");this[D]=A,L(this)}get maxAge(){return this[D]}set lengthCalculator(A){"function"!=typeof A&&(A=k),A!==this[g]&&(this[g]=A,this[E]=0,this[s].forEach(A=>{A.length=this[g](A.value,A.key),this[E]+=A.length})),L(this)}get lengthCalculator(){return this[g]}get length(){return this[E]}get itemCount(){return this[s].length}rforEach(A,Q){Q=Q||this;for(let B=this[s].tail;null!==B;){let C=B.prev;G(this,A,B,Q),B=C}}forEach(A,Q){Q=Q||this;for(let B=this[s].head;null!==B;){let C=B.next;G(this,A,B,Q),B=C}}keys(){return this[s].toArray().map(A=>A.key)}values(){return this[s].toArray().map(A=>A.value)}reset(){this[M]&&this[s]&&this[s].length&&this[s].forEach(A=>this[M](A.key,A.value)),this[y]=new Map,this[s]=new C,this[E]=0}dump(){return this[s].map(A=>!K(this,A)&&{k:A.key,v:A.value,e:A.now+(A.maxAge||0)}).toArray().filter(A=>A)}dumpLru(){return this[s]}set(A,Q,B){if((B=B||this[D])&&"number"!=typeof B)throw TypeError("maxAge must be a number");let C=B?Date.now():0,w=this[g](Q,A);if(this[y].has(A)){if(w>this[I])return U(this,this[y].get(A)),!1;let g=this[y].get(A).value;return this[M]&&!this[c]&&this[M](A,g.value),g.now=C,g.maxAge=B,g.value=Q,this[E]+=w-g.length,g.length=w,this.get(A),L(this),!0}let h=new i(A,Q,w,C,B);return h.length>this[I]?(this[M]&&this[M](A,Q),!1):(this[E]+=h.length,this[s].unshift(h),this[y].set(A,this[s].head),L(this),!0)}has(A){return!!this[y].has(A)&&!K(this,this[y].get(A).value)}get(A){return t(this,A,!0)}peek(A){return t(this,A,!1)}pop(){let A=this[s].tail;return A?(U(this,A),A.value):null}del(A){U(this,this[y].get(A))}load(A){this.reset();let Q=Date.now();for(let B=A.length-1;B>=0;B--){let C=A[B],I=C.e||0;if(0===I)this.set(C.k,C.v);else{let A=I-Q;A>0&&this.set(C.k,C.v,A)}}}prune(){this[y].forEach((A,Q)=>t(this,Q,!1))}}let t=(A,Q,B)=>{let C=A[y].get(Q);if(C){let Q=C.value;if(K(A,Q)){if(U(A,C),!A[w])return}else B&&(A[h]&&(C.value.now=Date.now()),A[s].unshiftNode(C));return Q.value}},K=(A,Q)=>{if(!Q||!Q.maxAge&&!A[D])return!1;let B=Date.now()-Q.now;return Q.maxAge?B>Q.maxAge:A[D]&&B>A[D]},L=A=>{if(A[E]>A[I])for(let Q=A[s].tail;A[E]>A[I]&&null!==Q;){let B=Q.prev;U(A,Q),Q=B}},U=(A,Q)=>{if(Q){let B=Q.value;A[M]&&A[M](B.key,B.value),A[E]-=B.length,A[y].delete(B.key),A[s].removeNode(Q)}};class i{constructor(A,Q,B,C,I){this.key=A,this.value=Q,this.length=B,this.now=C,this.maxAge=I||0}}let G=(A,Q,B,C)=>{let I=B.value;K(A,I)&&(U(A,B),A[w]||(I=void 0)),I&&Q.call(C,I.value,I.key,A)};A.exports=n},53207:function(A,Q,B){var C=B(96570);C.prototype.formulaEval=function(){"use strict";for(var A,Q,B,C=[],I=this.value,E=0;E"+Q.value+""+I[E].show+""+A.value+"",type:10}):C.push({value:(1!=Q.type?"(":"")+Q.value+(1!=Q.type?")":"")+""+A.value+"",type:1})):2===I[E].type||9===I[E].type?(A=C.pop(),Q=C.pop(),C.push({value:(1!=Q.type?"(":"")+Q.value+(1!=Q.type?")":"")+I[E].show+(1!=A.type?"(":"")+A.value+(1!=A.type?")":""),type:I[E].type})):12===I[E].type&&(A=C.pop(),Q=C.pop(),B=C.pop(),C.push({value:I[E].show+"("+B.value+","+Q.value+","+A.value+")",type:12}));return C[0].value},A.exports=C},66655:function(A,Q,B){"use strict";var C=B(72346);function I(A,Q){for(var B=0;Bk.length-2?k.length-1:A.length-D;B>0;B--)if(void 0!==k[B])for(I=0;I0&&aB)w.push(A);else{for(;B>=I&&!c||c&&I1)throw new C.Exception("Uncaught Syntax error");return E[0].value>1e15?"Infinity":parseFloat(E[0].value.toFixed(15))},C.eval=function(A,Q,B){return void 0===Q?this.lex(A).toPostfix().postfixEval():void 0!==B?this.lex(A,Q).toPostfix().postfixEval(B):void 0!==Q.length?this.lex(A,Q).toPostfix().postfixEval():this.lex(A).toPostfix().postfixEval(Q)},A.exports=C},93542:function(A,Q,B){"use strict";var C,I;A.exports=(null==(C=B.g.process)?void 0:C.env)&&"object"==typeof(null==(I=B.g.process)?void 0:I.env)?B.g.process:B(42351)},86570:function(A,Q,B){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return B(6723)}])},3440:function(A,Q,B){"use strict";B.d(Q,{u:function(){return w}});var C=B(52322),I=B(27717),E=B(36350),g=B(5137);function w(){let{openDialog:A}=(0,g.Rh)();return(0,C.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,C.jsx)(D,{title:E.z.walletAddNew.title,description:E.z.walletAddNew.description,onSelect:()=>A("walletAddNew")}),(0,C.jsx)(D,{title:E.z.walletAddRecover.title,description:E.z.walletAddRecover.description,onSelect:()=>A("walletAddRecover")}),(0,C.jsx)(D,{title:E.z.walletAddWatch.title,description:E.z.walletAddWatch.description,onSelect:()=>A("walletAddWatch")}),(0,C.jsx)(D,{title:E.z.walletAddLedger.title,description:E.z.walletAddLedger.description,onSelect:()=>A("walletAddLedger")})]})}function D(A){let{title:Q,description:B,disabled:E,onSelect:g}=A;return(0,C.jsx)(I.Wh3,{onClick:g,disabled:E,children:(0,C.jsxs)("div",{className:"flex flex-col gap-2 text-start",children:[(0,C.jsx)(I.X6q,{size:"20",children:Q}),(0,C.jsx)(I.nvN,{size:"14",color:"subtle",children:B})]})})}},12172:function(A,Q,B){"use strict";B.d(Q,{g:function(){return w}});var C=B(52322),I=B(27717),E=B(3208),g=B(5137);function w(A){let{wallet:{id:Q,metadata:B,state:w,actions:D},...M}=A,{openDialog:c}=(0,g.Rh)();return(0,C.jsxs)(I.h_2,{...M,children:[(0,C.jsx)(I.Juw,{children:"Actions"}),"seed"===B.type?"unlocked"===w.status?(0,C.jsxs)(I.Xiv,{onClick:A=>A.stopPropagation(),onSelect:()=>D.lock(),children:[(0,C.jsx)(I.KpP,{children:(0,C.jsx)(E.Lur,{})}),"Lock wallet"]}):(0,C.jsxs)(I.Xiv,{onClick:A=>A.stopPropagation(),onSelect:()=>D.unlock(),children:[(0,C.jsx)(I.KpP,{children:(0,C.jsx)(E.VmF,{})}),"Unlock wallet"]}):null,(0,C.jsxs)(I.Xiv,{onClick:A=>A.stopPropagation(),onSelect:()=>c("walletUpdate",{walletId:Q}),children:[(0,C.jsx)(I.KpP,{children:(0,C.jsx)(E.dr6,{})}),"Edit wallet"]}),(0,C.jsxs)(I.Xiv,{onClick:A=>A.stopPropagation(),onSelect:()=>c("walletRemove",{walletId:Q}),children:[(0,C.jsx)(I.KpP,{children:(0,C.jsx)(E.Jrl,{})}),"Delete wallet"]}),(0,C.jsxs)(I.Xiv,{onClick:A=>A.stopPropagation(),onSelect:()=>c("walletsRescan"),children:[(0,C.jsx)(I.KpP,{children:(0,C.jsx)(E.vs4,{})}),"Rescan blockchain"]})]})}},98334:function(A,Q,B){"use strict";B.d(Q,{_:function(){return I},h:function(){return E}});var C=B(90670);let I={home:"/",wallet:{base:"/wallets/",view:"/wallets/[id]",addresses:"/wallets/[id]/addresses"},node:{index:"/node",txPool:"/node/txpool",peers:"/node/peers"},login:"/login"},E=C.HE},9338:function(A,Q,B){"use strict";B.d(Q,{h:function(){return C}});let C=(0,B(27717).XBW)(15)},36350:function(A,Q,B){"use strict";B.d(Q,{_:function(){return w},z:function(){return g}});var C=B(52322),I=B(27717),E=B(3208);let g={walletAddNew:{title:"Create a wallet",description:(0,C.jsxs)(C.Fragment,{children:["Generate a new wallet seed. The seed will never be sent to"," ",(0,C.jsx)(I.EKh,{children:"walletd"}),", transactions are signed in the browser."]})},walletAddRecover:{title:"Recover a wallet",description:(0,C.jsxs)(C.Fragment,{children:["Restore a wallet from seed. The seed will never be sent to"," ",(0,C.jsx)(I.EKh,{children:"walletd"}),", transactions are signed in the browser."]})},walletAddWatch:{title:"Add a watch-only wallet",description:(0,C.jsx)(C.Fragment,{children:"Create a watch-only wallet that tracks a set of addresses."})},walletAddLedger:{title:"Add a Ledger hardware wallet",description:(0,C.jsx)(C.Fragment,{children:"Add a Ledger hardware wallet. Transactions are signed with your hardware device."})}},w={seed:{title:"Seed-based wallet",icon:(0,C.jsx)(E.sZp,{})},watch:{title:"Watch-only wallet",icon:(0,C.jsx)(E.xVB,{})},ledger:{title:"Ledger hardware wallet",icon:(0,C.jsx)(E._Gh,{})}}},54590:function(A,Q,B){"use strict";B.d(Q,{p:function(){return g}});var C=B(27717),I=B(2784),E=B(5137);function g(A){let{walletId:Q,response:B,filters:g}=A,{openDialog:w}=(0,E.Rh)(),D=(0,I.useMemo)(()=>B.data?B.data.map(A=>{let{address:B,description:C,metadata:I,spendPolicy:E}=A;return{id:B,address:B,description:C,spendPolicy:E,metadata:I||{},walletId:Q,onClick:()=>w("addressUpdate",{walletId:Q,address:B}),raw:A}}):null,[B.data,w,Q]),M=(0,C.c2j)(D,B.isValidating,B.error,g),c=(D||[]).reduce((A,Q)=>{let{metadata:B}=Q;return B.index>A?B.index:A},-1);return{dataset:D,dataState:M,error:B.error,lastIndex:c,filters:g}}},58723:function(A,Q,B){"use strict";B.d(Q,{OZ:function(){return L},Jz:function(){return K}});var C=B(52322),I=B(27717),E=B(90670),g=B(2784),w=B(3654),D=B(3208),M=B(5137);function c(A){let{address:{walletId:Q,id:B,metadata:g},...w}=A,{openDialog:c}=(0,M.Rh)(),s=(0,E.XF)();return(0,C.jsxs)(I.h_2,{...w,children:[(0,C.jsx)(I.Juw,{children:"Actions"}),(0,C.jsxs)(I.Xiv,{onClick:A=>A.stopPropagation(),onSelect:()=>c("confirm",{title:void 0!==g.index?"Remove address ".concat(g.index):"Remove address",action:"Remove",variant:"red",body:(0,C.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,C.jsx)(I.nvN,{size:"14",children:"Are you sure you would like to remove the following address?"}),(0,C.jsxs)(I.nvN,{size:"14",font:"mono",children:[(0,I.I13)(B).slice(0,40),"..."]})]}),onConfirm:async()=>{let A=await s.delete({params:{id:Q,addr:B}});A.error?(0,I.OHV)({title:"Error deleting address",body:A.error}):(0,I.OPV)({title:void 0!==g.index?"Address ".concat(g.index," removed"):"Address removed"})}}),children:[(0,C.jsx)(I.KpP,{children:(0,C.jsx)(D.Jrl,{})}),"Remove address"]})]})}let s=[{id:"actions",label:"",fixed:!0,cellClassName:"w-[50px] !pl-2 !pr-4 [&+*]:!pl-0",render:A=>{let{data:Q}=A;return(0,C.jsx)(c,{trigger:(0,C.jsx)(I.zxk,{variant:"ghost",icon:"hover",children:(0,C.jsx)(D.EMN,{})}),contentProps:{align:"start"},address:Q})}},{id:"address",label:"address",category:"general",fixed:!0,render:A=>{let{data:{address:Q,description:B},context:E}=A;return(0,C.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,C.jsx)(I.XxW,{maxLength:40,value:Q,type:"address",siascanUrl:E.siascanUrl}),B&&(0,C.jsx)(I.ua7,{content:(0,C.jsx)("pre",{children:(0,C.jsx)(I.nvN,{size:"12",className:"w-full whitespace-pre-wrap",children:B})}),children:(0,C.jsx)(I.nvN,{size:"12",children:B.split("\n")[0]})})]})}},{id:"index",label:"index",category:"general",render:A=>{let{data:{metadata:Q}}=A;return void 0===Q.index?null:(0,C.jsx)("div",{className:"flex flex-col gap-2",children:(0,C.jsx)(I.xvT,{children:Q.index.toLocaleString()})})}}];var y=B(5632),h=B(74667),k=B(9338),n=B(54590);let t=(0,g.createContext)({}),K=()=>(0,g.useContext)(t);function L(A){let{children:Q}=A,B=function(){let A=(0,y.useRouter)().query.id,Q=(0,E.bd)({disabled:!A,params:{id:A},config:{swr:{refreshInterval:k.h}}}),{filters:B,setFilter:C,removeFilter:D,removeLastFilter:M,resetFilters:c}=(0,I.Wdu)(),{dataset:t,dataState:K,lastIndex:L}=(0,n.p)({walletId:A,response:Q,filters:B}),{configurableColumns:U,enabledColumns:i,sortableColumns:G,toggleColumnVisibility:r,setColumnsVisible:p,setColumnsHidden:a,toggleSort:N,setSortDirection:o,setSortField:e,sortField:J,sortDirection:F,resetDefaultColumnVisibility:S}=(0,I.oy6)("walletd/v0/addresses",{columns:s,columnsDefaultVisible:w.gd,sortOptions:w.Fo,defaultSortField:w.nw}),l=(0,I._4u)({dataset:t,filters:B,sortField:J,sortDirection:F}),H=(0,g.useMemo)(()=>s.filter(A=>A.fixed||i.includes(A.id)),[i]),Y=(0,h.B)(),f=(0,g.useMemo)(()=>({siascanUrl:Y}),[Y]);return{dataState:K,error:Q.error,datasetCount:(null==l?void 0:l.length)||0,columns:H,dataset:l,cellContext:f,lastIndex:L,configurableColumns:U,enabledColumns:i,sortableColumns:G,toggleColumnVisibility:r,setColumnsVisible:p,setColumnsHidden:a,toggleSort:N,setSortDirection:o,setSortField:e,sortField:J,filters:B,setFilter:C,removeFilter:D,removeLastFilter:M,resetFilters:c,sortDirection:F,resetDefaultColumnVisibility:S}}();return(0,C.jsx)(t.Provider,{value:B,children:Q})}},3654:function(A,Q,B){"use strict";B.d(Q,{Fo:function(){return E},gd:function(){return C},nw:function(){return I}});let C=["actions","address","index"],I="index",E=[{id:"address",label:"address",category:"general"},{id:"index",label:"index",category:"general"}]},5137:function(A,Q,B){"use strict";B.d(Q,{Tu:function(){return AO},xQ:function(){return Av},Rh:function(){return AZ}});var C=B(52322),I=B(2784),E=B(27717),g=B(90670),w=B(3440);function D(A){let{open:Q,trigger:B,onOpenChange:I}=A;return(0,C.jsx)(E.VqE,{title:"Add Wallet",trigger:B,open:Q,onOpenChange:I,contentVariants:{className:"max-w-[600px]"},children:(0,C.jsx)(w.u,{})})}var M=B(3208),c=B(63955),s=B(23312),y=B(36350),h=B(81395);function k(A){let{copySeed:Q,children:B,icon:I,description:g}=A;return(0,C.jsxs)("div",{className:"",children:[B,(0,C.jsx)(E.s_4,{className:"mt-2",children:(0,C.jsxs)("div",{className:"flex gap-6 items-center py-4 px-4",children:[(0,C.jsx)("div",{className:"flex",children:I}),(0,C.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,C.jsx)(E.nvN,{size:"14",children:g}),Q&&(0,C.jsx)(E.zxk,{onClick:Q,children:"Copy Seed to Clipboard"})]})]})})]})}var n=B(48869);let t={name:"",description:"",mnemonic:"",hasCopied:!1};function K(A){let{trigger:Q,open:B,onOpenChange:w}=A,{openDialog:D}=AZ(),K=(0,g.lT)(),L=(0,c.cI)({mode:"all",defaultValues:t}),U=L.watch("mnemonic"),i=(0,I.useCallback)(()=>{(0,E.vQq)(U,"seed"),L.setValue("hasCopied",!0,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),L.clearErrors(["mnemonic"])},[U,L]),G=(0,I.useCallback)(async()=>{let{phrase:A}=(0,n.K)().wallet.generateSeedPhrase();L.setValue("hasCopied",!1),L.setValue("mnemonic",A),L.clearErrors(["hasCopied","mnemonic"])},[L]);(0,I.useEffect)(()=>{B&&G()},[B]);let{dataset:r}=(0,s.r)(),p=function(A){let{walletNames:Q,copySeed:B}=A;return{name:{type:"text",title:"Name",placeholder:"name",validation:{validate:{unique:A=>!Q.includes(A)||"name is already in use"},required:"required",maxLength:30}},description:{type:"text",title:"Description",placeholder:"Optional description or notes about the wallet.",validation:{maxLength:200}},mnemonic:{type:"text",title:"Seed",onClick:A=>{A.currentTarget.select(),B()},readOnly:!0,placeholder:"",validation:{required:"required",validate:{valid:A=>{let{error:Q}=(0,n.K)().wallet.keyPairFromSeedPhrase(A,0);return!Q||"seed should be 12 word BIP39 mnemonic"},copied:(A,Q)=>Q.hasCopied||"Copy seed to continue"}}},hasCopied:{type:"boolean",title:"",validation:{}}}}({walletNames:(null==r?void 0:r.map(A=>A.name))||[],copySeed:i}),a=(0,I.useCallback)(async A=>{let Q=A.mnemonic.trim(),B=(0,h.blake2bHex)(Q),C=await K.post({payload:{name:A.name,description:A.description,metadata:{type:"seed",mnemonicHash:B}}});C.error?(0,E.OHV)({title:"Error creating wallet",body:C.error}):(D("walletAddressesGenerate",{walletId:C.data.id}),L.reset(t))},[L,D,K]);return(0,C.jsx)(E.VqE,{title:y.z.walletAddNew.title,trigger:Q,open:B,onOpenChange:w,contentVariants:{className:"w-[400px]"},onSubmit:L.handleSubmit(a),controls:(0,C.jsxs)("div",{className:"flex gap-2 px-1",children:[(0,C.jsx)(E.zxk,{size:"medium",onClick:()=>{D("walletAddType")},children:"back"}),(0,C.jsx)("div",{className:"flex-1"}),(0,C.jsx)(E.ZqQ,{size:"medium",form:L,children:"Add wallet"})]}),children:(0,C.jsxs)("div",{className:"flex flex-col gap-4 mb-2",children:[(0,C.jsx)(E.nvN,{size:"14",color:"subtle",children:y.z.walletAddNew.description}),(0,C.jsx)(E.yEL,{name:"name",form:L,fields:p}),(0,C.jsx)(E.Bau,{name:"description",form:L,fields:p}),(0,C.jsx)(k,{icon:(0,C.jsx)(M.fwm,{}),description:(0,C.jsx)(C.Fragment,{children:"This is the wallet's seed mnemonic. Make sure to save it somewhere secure."}),children:(0,C.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,C.jsx)(E.Bau,{form:L,fields:p,name:"mnemonic"}),(0,C.jsxs)("div",{className:"flex gap-2",children:[(0,C.jsxs)(E.zxk,{className:"flex-1",onClick:G,children:[(0,C.jsx)(M.nt4,{}),"Regenerate"]}),(0,C.jsxs)(E.zxk,{className:"flex-1",onClick:i,children:[(0,C.jsx)(M.olJ,{}),"Copy to clipboard"]})]})]})})]})})}var L=B(6391),U=B.n(L);function i(A){let{mnemonicHash:Q,mnemonicFieldType:B,setMnemonicFieldType:I}=A;return{type:B,title:"Seed",actions:(0,C.jsx)("div",{className:"flex gap-1",children:(0,C.jsx)(E.zxk,{tip:"password"===B?"Show seed":"Hide seed",tabIndex:-1,variant:"ghost",icon:"hover",onClick:()=>I("password"===B?"text":"password"),children:"password"===B?(0,C.jsx)(M.pHg,{}):(0,C.jsx)(M.xVB,{})})}),placeholder:"island submit vague scrub exhibit cherry front spoon crop debate filter virus",validation:{required:"required",validate:{valid:A=>{let{error:Q}=(0,n.K)().wallet.keyPairFromSeedPhrase(A,0);return!Q||"seed should be 12 word BIP39 mnemonic"},match:A=>(0,h.blake2bHex)(A)===Q||"seed phrase does not match"}}}}var G=B(3584);function r(A){let{walletId:Q,name:B,form:I,fields:g,actionText:w}=A,{dataset:D,walletAutoLockEnabled:c,walletAutoLockTimeout:y}=(0,s.r)(),h=null==D?void 0:D.find(A=>A.id===Q),n=null==h?void 0:h.state.mnemonic,t=(0,G.l)(y),K=w?" and ".concat(w):"";return n?(0,C.jsx)(k,{icon:(0,C.jsx)(M.R$y,{}),description:c?(0,C.jsxs)(C.Fragment,{children:["The wallet is currently unlocked. The wallet will stay unlocked until it is inactive for ",t.amount," ",t.units,", manually locked, or the app is closed."]}):(0,C.jsx)(C.Fragment,{children:"The wallet is currently unlocked. The wallet will stay unlocked until it is manually locked or the app is closed."})}):(0,C.jsx)(k,{icon:(0,C.jsx)(M.R$y,{}),description:c?(0,C.jsxs)(C.Fragment,{children:["Enter your seed mnemonic to unlock the wallet",K,". The wallet will stay unlocked until it is inactive for"," ",t.amount," ",t.units,", manually locked, or the app is closed."]}):(0,C.jsxs)(C.Fragment,{children:["Enter your seed mnemonic to unlock the wallet and",K,". The wallet will stay unlocked until it is manually locked or the app is closed."]}),children:(0,C.jsx)(E.yEL,{form:I,fields:g,name:B})})}var p=B(9338),a=B(54590);let N=[];function o(A){let{id:Q}=A,B=(0,g.bd)({disabled:!Q,params:{id:Q},config:{swr:{refreshInterval:p.h}}}),{dataset:C,dataState:I,lastIndex:E}=(0,a.p)({walletId:Q,response:B,filters:N});return{dataState:I,error:B.error,datasetCount:(null==C?void 0:C.length)||0,dataset:C,lastIndex:E}}var e=B(63131);function J(A){let{label:Q,description:B}=A;return(0,C.jsx)(E.bZj,{className:"!p-2",children:(0,C.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,C.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,C.jsx)(E.xvT,{children:(0,C.jsx)(e.qdM,{})}),(0,C.jsx)(E.xvT,{weight:"medium",children:Q})]}),(0,C.jsx)(E.xvT,{size:"14",color:"subtle",children:B})]})})}function F(){return{shouldRescan:{type:"boolean",title:"Enable",validation:{}},rescanStartHeight:{type:"number",decimalsLimit:0,title:"Start height",validation:{}}}}function S(){let{rescanStartHeight:A}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{shouldRescan:!1,rescanStartHeight:new(U())(A||0)}}function l(A){let{form:Q,fields:B}=A,I=Q.watch("shouldRescan");return(0,C.jsxs)("div",{className:"flex flex-col gap-1 pt-4",children:[(0,C.jsx)(E.Z0O,{className:"w-full my-2"}),(0,C.jsx)(E.__J,{color:"contrast",className:"pb-2",size:"16",children:"Advanced"}),(0,C.jsx)("div",{className:"flex flex-col gap-2",children:(0,C.jsx)(E.__J,{color:"contrast",children:"Rescan"})}),(0,C.jsxs)("div",{className:"flex justify-start gap-3",children:[(0,C.jsx)(E.QBj,{form:Q,fields:B,name:"shouldRescan"}),I&&(0,C.jsx)(E.jIp,{form:Q,fields:B,name:"rescanStartHeight"})]}),I&&(0,C.jsx)(E.xvT,{size:"14",color:"subtle",children:"Rescan the blockchain from the specified start height to find any missing transaction activity across all wallets."}),I&&(0,C.jsxs)("div",{className:"pt-2 flex flex-col gap-2",children:[(0,C.jsx)(H,{}),(0,C.jsx)(Y,{})]})]})}function H(){return(0,C.jsx)(J,{label:"Warning",description:(0,C.jsx)(C.Fragment,{children:"Only rescan the blockchain if you have added addresses with past transactions activity. Rescanning the blockchain is a very expensive operation and can take a long time."})})}function Y(){return(0,C.jsx)(J,{label:"Warning",description:(0,C.jsx)(C.Fragment,{children:"For start height, select the highest block height possible, but one that you are sure is before the first transaction activity for the addresses you have added."})})}function f(){let A=(0,g.Ap)();return async Q=>{if(Q.shouldRescan){let B=await A.post({payload:Q.rescanStartHeight?Q.rescanStartHeight.toNumber():0});B.error?(0,E.OHV)({title:"Error rescanning the blockchain",body:B.error}):(0,E.OPV)({title:"Rescanning the blockchain",body:"The blockchain is being rescanned for relevant wallet events."})}}}var d=B(38855);function u(A){let{params:Q,trigger:B,open:w,onOpenChange:D}=A,{walletId:M}=Q||{},{lastIndex:y}=o({id:M}),{dataset:h,cacheWalletMnemonic:k}=(0,s.r)(),t=null==h?void 0:h.find(A=>A.id===M),K=y+1,L=function(A){let{nextIndex:Q,currentHeight:B}=A;return{mnemonic:"",index:new(U())(Q),count:new(U())(1),...S({rescanStartHeight:B})}}({nextIndex:K,currentHeight:(0,d.n)().nodeBlockHeight}),[G,p]=(0,I.useState)("password"),a=(0,c.cI)({mode:"all",defaultValues:L});(0,I.useEffect)(()=>{a.formState.isSubmitting||a.setValue("index",new(U())(K))},[K]);let{handleOpenChange:N,closeAndReset:e}=(0,E.t0Y)({form:a,onOpenChange:D,defaultValues:L}),J=a.watch("mnemonic"),H=a.watch("index"),Y=a.watch("count"),u=a.watch("shouldRescan"),R=function(A){let{mnemonicHash:Q,mnemonicFieldType:B,setMnemonicFieldType:C}=A;return{mnemonic:i({mnemonicHash:Q,setMnemonicFieldType:C,mnemonicFieldType:B}),index:{type:"number",title:"Start index",decimalsLimit:0,placeholder:"0",validation:{required:"required"}},count:{type:"number",title:"Number of addresses",decimalsLimit:0,placeholder:"10",validation:{required:"required",max:1e3}},...F()}}({mnemonicHash:null==t?void 0:t.metadata.mnemonicHash,mnemonicFieldType:G,setMnemonicFieldType:p}),j=(0,g.yi)(),b=(0,I.useCallback)(async(A,Q,B)=>{function C(A,Q,B){(0,E.OHV)({title:"Error generating addresses",body:Q>0?"".concat(Q+1,"/").concat(A," addresses were generated and saved. Batch failed on with: ").concat(B):B})}for(let I=Q;I{await b(t.state.mnemonic||J,H.toNumber(),Y.toNumber()),m(A)},[b,J,H,Y,t,m]);return(0,C.jsxs)(E.VqE,{title:"Wallet ".concat(null==t?void 0:t.name,": generate addresses"),trigger:B,open:w,onOpenChange:N,contentVariants:{className:"w-[500px]"},onSubmit:a.handleSubmit(T),controls:(0,C.jsx)("div",{className:"flex justify-end",children:(0,C.jsxs)(E.ZqQ,{form:a,size:"medium",variant:u?"red":"accent",children:["Generate addresses",u?" and rescan":""]})}),children:[(0,C.jsx)(r,{walletId:M,name:"mnemonic",form:a,fields:R,actionText:"generate addresses"}),(0,C.jsxs)("div",{className:"flex gap-2 w-full pt-3",children:[(0,C.jsx)("div",{className:"flex-1",children:(0,C.jsx)(E.jIp,{form:a,fields:R,name:"index"})}),(0,C.jsx)("div",{className:"flex-1",children:(0,C.jsx)(E.jIp,{form:a,fields:R,name:"count"})})]}),(0,C.jsx)(l,{form:a,fields:R})]})}var R=B(5632),j=B(98334);let b={name:""};function m(A){let{params:Q,trigger:B,open:w,onOpenChange:D}=A,M=(0,R.useRouter)(),{walletId:y}=Q||{},{closeDialog:h}=AZ(),{dataset:k}=(0,s.r)(),n=null==k?void 0:k.find(A=>A.id===y),t=(0,g.OZ)(),K=(0,c.cI)({mode:"all",defaultValues:b}),L=(0,I.useCallback)(async()=>{let A=await t.delete({params:{id:y}});A.error?(0,E.OHV)({title:"Error removing wallet",body:A.error}):((0,E.OPV)({title:"Wallet permanently removed"}),K.reset(),h(),M.push(j._.home))},[K,y,t,h,M]),U=(0,I.useMemo)(()=>{var A;return{name:{type:"text",title:"Name",placeholder:A=null==n?void 0:n.name,validation:{required:"required",validate:{equals:Q=>Q===A||"name does not match"}}}}},[n]),i=(0,E.WsO)(U);return(0,C.jsx)(E.VqE,{title:"Remove wallet",trigger:B,open:w,onOpenChange:A=>{A||K.reset(b),D(A)},contentVariants:{className:"w-[400px]"},onSubmit:K.handleSubmit(L,i),children:(0,C.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,C.jsxs)(E.nvN,{size:"14",children:["Are you sure you would like to permanently remove the wallet"," ",(0,C.jsx)(E.EKh,{children:null==n?void 0:n.name}),"?"]}),(0,C.jsx)(E.nvN,{size:"14",children:"Enter the wallet name to confirm the removal."}),(0,C.jsx)(E.yEL,{name:"name",form:K,fields:U}),(0,C.jsx)(E.ZqQ,{variant:"red",form:K,children:"Remove"})]})})}function T(A){let{trigger:Q,open:B,onOpenChange:w,params:D}=A,{walletId:M,address:s}=D||{},{openDialog:y}=AZ(),{dataset:h,dataState:k}=o({id:M}),n=null==h?void 0:h.find(A=>A.id===s),t=(0,g.yi)(),K=function(A){let{description:Q}=A;return{description:Q||""}}({description:null==n?void 0:n.description}),L=(0,c.cI)({mode:"all",defaultValues:K}),{handleOpenChange:U,closeAndReset:i}=(0,E.t0Y)({form:L,onOpenChange:w,defaultValues:K,initKey:[D,void 0===k]}),G=(0,I.useCallback)(async A=>{let Q=await t.put({params:{id:M},payload:{...n.raw,address:s,description:A.description}});Q.error?(0,E.OHV)({title:"Error updating address",body:Q.error}):i()},[M,s,t,n,i]);return(0,C.jsx)(E.VqE,{title:(0,E.$Gg)(s,20),trigger:Q,open:B,onOpenChange:U,contentVariants:{className:"w-[400px]"},onSubmit:L.handleSubmit(G),controls:(0,C.jsxs)("div",{className:"flex gap-2 px-1",children:[(0,C.jsx)(E.zxk,{onClick:()=>y("addressRemove",{walletId:M,address:s}),children:"Remove address"}),(0,C.jsx)("div",{className:"flex-1"}),(0,C.jsx)(E.ZqQ,{size:"small",form:L,children:"Save changes"})]}),children:(0,C.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,C.jsx)(E.hKn,{address:(null==n?void 0:n.address)||""}),(0,C.jsx)(E.Bau,{name:"description",form:L,fields:{description:{type:"text",title:"Description",placeholder:"Optional description or notes about the wallet.",validation:{maxLength:200}}}})]})})}let Z={name:"",description:""};function O(A){let{params:Q,trigger:B,open:w,onOpenChange:D}=A,{walletId:M}=Q||{},{dataset:y}=(0,s.r)(),h=null==y?void 0:y.find(A=>A.id===M),k=(0,g.SK)(),n=h?{name:h.name,description:h.description}:Z,t=(0,c.cI)({mode:"all",defaultValues:n}),{handleOpenChange:K,closeAndReset:L}=(0,E.t0Y)({form:t,onOpenChange:D,defaultValues:n}),U=function(A){let{walletNames:Q}=A;return{name:{type:"text",title:"Name",placeholder:"name",validation:{validate:{unique:A=>!Q.includes(A)||"name is already in use"},required:"required",maxLength:30}},description:{type:"text",title:"Description",placeholder:"Optional description or notes about the wallet.",validation:{maxLength:200}}}}({walletNames:(0,I.useMemo)(()=>(null==y?void 0:y.reduce((A,Q)=>Q.name!==(null==h?void 0:h.name)?A.concat(Q.name):A,[]))||[],[y,h])}),i=(0,I.useCallback)(async A=>{let Q=await k.post({params:{id:M},payload:{...h.raw,name:A.name,description:A.description}});Q.error?(0,E.OHV)({title:"Error updating wallet",body:Q.error}):L()},[M,k,h,L]);return(0,C.jsx)(E.VqE,{title:"".concat(null==h?void 0:h.name),trigger:B,open:w,onOpenChange:K,contentVariants:{className:"w-[400px]"},onSubmit:t.handleSubmit(i),controls:(0,C.jsxs)("div",{className:"flex gap-2 px-1",children:[(0,C.jsx)("div",{className:"flex-1"}),(0,C.jsx)(E.ZqQ,{size:"medium",form:t,children:"Save changes"})]}),children:(0,C.jsxs)("div",{className:"flex flex-col gap-4 mb-2",children:[(0,C.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,C.jsx)(E.__J,{children:"Type"}),(0,C.jsx)("div",{children:(0,C.jsx)(E.Cts,{children:null==h?void 0:h.metadata.type})})]}),(0,C.jsx)(E.yEL,{name:"name",form:t,fields:U}),(0,C.jsx)(E.Bau,{name:"description",form:t,fields:U})]})})}var v=B(79381),x=B(16694),V=B(73866),z=B(27748);async function W(){return(await Promise.all([V.Z.isSupported().then(async A=>{let Q=await P();return A&&!Q?"Bluetooth":null}),z.Z.isSupported().then(A=>A?"HID":null)])).filter(A=>A)}async function P(){return navigator.brave&&await navigator.brave.isBrave()}function q(A){let{title:Q,details:B,actions:I,shouldVerify:g}=A,{device:w,disconnect:D}=(0,x.c)();return(0,C.jsx)(E.s_4,{className:"mt-1 pl-3 pr-2 py-2",children:(0,C.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,C.jsxs)("div",{className:"flex gap-1 justify-between items-center",children:[(0,C.jsxs)("div",{className:"flex items-center",children:[g?(0,C.jsxs)(C.Fragment,{children:[!(null==w?void 0:w.publicKey0)&&(0,C.jsxs)("div",{className:"relative w-2 h-2 mr-2",children:[(0,C.jsx)("div",{className:"absolute w-2 h-2 rounded-full bg-amber-400 animate-pingslow"}),(0,C.jsx)("div",{className:"absolute w-2 h-2 rounded-full bg-amber-500 border border-amber-400"})]}),!!(null==w?void 0:w.publicKey0)&&(0,C.jsxs)("div",{className:"relative w-2 h-2 mr-2",children:[(0,C.jsx)("div",{className:"absolute w-2 h-2 rounded-full bg-green-400 animate-pingslow"}),(0,C.jsx)("div",{className:"absolute w-2 h-2 rounded-full bg-green-500 border border-green-400"})]})]}):(0,C.jsxs)("div",{className:"relative w-2 h-2 mr-2",children:[(0,C.jsx)("div",{className:"absolute w-2 h-2 rounded-full bg-green-400 animate-pingslow"}),(0,C.jsx)("div",{className:"absolute w-2 h-2 rounded-full bg-green-500 border border-green-400"})]}),(null==w?void 0:w.type)==="Bluetooth"&&(0,C.jsx)(E.ua7,{content:"Bluetooth",children:(0,C.jsx)(E.xvT,{weight:"semibold",size:"16",children:(0,C.jsx)(M.Ya6,{})})}),(null==w?void 0:w.type)==="USB"&&(0,C.jsx)(E.ua7,{content:"USB",children:(0,C.jsx)(E.xvT,{weight:"semibold",size:"16",children:(0,C.jsx)(M.Fhn,{size:16})})}),(null==w?void 0:w.type)==="HID"&&(0,C.jsx)(E.ua7,{content:"HID",children:(0,C.jsx)(E.xvT,{weight:"semibold",size:"16",children:(0,C.jsx)(M.Pj_,{size:16})})}),(0,C.jsx)(E.xvT,{weight:"semibold",size:"16",className:"ml-1",children:Q})]}),(0,C.jsxs)("div",{className:"flex gap-1 justify-between items-center",children:[I,!!w&&(0,C.jsx)(E.zxk,{variant:"ghost",onClick:D,children:(0,C.jsx)(M.PcV,{})})]})]}),B]})})}let X={transportType:""};function _(A){var Q;let{shouldVerify:B}=A,{device:g,connect:w,verify:D,setError:s,waitingForUser:y}=(0,x.c)(),h=(0,c.cI)({mode:"all",defaultValues:X}),k=h.watch("transportType"),n=!!(null==g?void 0:g.publicKey0),t=(0,v.ZP)("deviceConnect/supportedTransports",()=>W(),{revalidateOnFocus:!1});(0,I.useEffect)(()=>{t.data&&(h.setValue("transportType",t.data[0]),0===t.data.length&&s(Error("This browser does not support connecting to Ledger devices, please use a different browser.")))},[t.data]);let K=function(A){let{supportedTransports:Q}=A;return{transportType:{type:"select",title:"Transport",placeholder:"Select a transport",options:Q.map(A=>({value:A,label:A})),validation:{required:!0}}}}({supportedTransports:t.data||[]}),L=(0,I.useCallback)(async()=>{k&&w(k)},[w,k]),U=(0,I.useCallback)(async()=>{k&&await D()},[D,k]);return(0,C.jsx)("div",{className:"flex flex-col gap-1",children:g?B?n?(0,C.jsx)(q,{shouldVerify:B,title:g.transport.deviceModel.productName,details:(0,C.jsx)("div",{className:"flex flex-col gap-1",children:(0,C.jsx)(E.XxW,{value:g.publicKey0,label:"public key 0",color:"subtle",maxLength:30})})}):(0,C.jsx)(q,{shouldVerify:B,title:g.transport.deviceModel.productName,actions:(0,C.jsx)(C.Fragment,{children:(0,C.jsxs)(E.zxk,{variant:"accent",onClick:U,children:[(0,C.jsx)(M.j7C,{}),"Verify"]})}),details:y?(0,C.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,C.jsx)(E.xvT,{children:"Please confirm on device..."}),(0,C.jsx)(E.nvN,{size:"14",color:"subtle",children:"To continue, approve public key verification on device."})]}):(0,C.jsx)("div",{className:"flex flex-col gap-1",children:(0,C.jsx)(E.nvN,{size:"14",children:"Unlock device, open the Sia app, and make sure Ledger Live is closed. Then start wallet verification to continue."})})}):(0,C.jsx)(q,{shouldVerify:B,title:g.transport.deviceModel.productName}):(0,C.jsx)(q,{shouldVerify:B,title:"Connect Ledger...",actions:(null===(Q=t.data)||void 0===Q?void 0:Q.length)?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(E.WyV,{name:"transportType",form:h,fields:K,group:!1}),(0,C.jsx)(E.zxk,{size:"small",onClick:L,children:"Connect"})]}):null,details:y?(0,C.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,C.jsx)(E.xvT,{children:"Please confirm in browser and on device..."}),(0,C.jsx)(E.nvN,{size:"14",color:"subtle",children:"Connect your Ledger device. Make sure you unlock your Ledger and open the Sia App before trying to connect."})]}):(0,C.jsx)(E.nvN,{size:"14",color:"subtle",children:"Connect your Ledger device. Make sure you unlock your Ledger and open the Sia App before trying to connect."})})})}let $={name:"",description:"",ledgerConnectedAndVerified:!1};function AA(A){let{trigger:Q,open:B,onOpenChange:w}=A,{openDialog:D}=AZ(),M=(0,g.lT)(),h=(0,c.cI)({mode:"all",defaultValues:$}),{device:k,disconnect:t,error:K}=(0,x.c)();(0,I.useEffect)(()=>{B&&t()},[B]),(0,I.useEffect)(()=>{k&&k.publicKey0?h.setValue("ledgerConnectedAndVerified",!0):h.setValue("ledgerConnectedAndVerified",!1)},[h,k]),(0,I.useEffect)(()=>{K?h.setError("ledgerConnectedAndVerified",{message:K.message}):h.clearErrors("ledgerConnectedAndVerified")},[h,K]);let{dataset:L}=(0,s.r)(),U=function(A){let{walletNames:Q}=A;return{name:{type:"text",title:"Name",placeholder:"name",validation:{validate:{unique:A=>!Q.includes(A)||"name is already in use"},required:"required",maxLength:30}},description:{type:"text",title:"Description",placeholder:"Optional description or notes about the wallet.",validation:{maxLength:200}},ledgerConnectedAndVerified:{type:"boolean",title:"",validation:{validate:{ledgerConnectedAndVerified:A=>A||"Ledger must be connected, unlocked, and verified"}}}}}({walletNames:(null==L?void 0:L.map(A=>A.name))||[]}),i=(0,g.yi)(),G=(0,I.useCallback)(async(A,Q)=>{let{unlockConditions:B,address:C}=Q;if((await i.put({params:{id:A},payload:{address:C,description:"",metadata:{index:0,unlockConditions:B}}})).error){(0,E.OHV)({title:"Error saving address"});return}},[i]),r=(0,I.useCallback)(async A=>{if(!A.ledgerConnectedAndVerified||!k.publicKey0||!k.address0)return;let Q={type:"ledger",publicKey0:k.publicKey0,address0:k.address0},B=await M.post({payload:{name:A.name,description:A.description,metadata:Q}});if(B.error)(0,E.OHV)({title:"Error saving wallet",body:B.error});else{let A=(0,n.K)().wallet.standardUnlockConditions(k.publicKey0);A.error||G(B.data.id,{unlockConditions:A.unlockConditions,address:k.address0}),D("walletLedgerAddressGenerate",{walletId:B.data.id,walletJustCreated:!0}),h.reset($)}},[h,D,M,k,G]);return h.register("ledgerConnectedAndVerified",U.ledgerConnectedAndVerified.validation),(0,C.jsx)(E.VqE,{title:y.z.walletAddLedger.title,trigger:Q,open:B,onOpenChange:w,contentVariants:{className:"w-[400px]"},onSubmit:h.handleSubmit(r),controls:(0,C.jsxs)("div",{className:"flex gap-2 pb-1",children:[(0,C.jsx)(E.zxk,{size:"medium",onClick:()=>{D("walletAddType")},children:"back"}),(0,C.jsx)("div",{className:"flex-1"}),(0,C.jsx)(E.ZqQ,{size:"medium",form:h,children:"Add wallet"})]}),children:(0,C.jsxs)("div",{className:"flex flex-col gap-4 mb-2",children:[(0,C.jsx)(E.nvN,{size:"14",color:"subtle",children:y.z.walletAddLedger.description}),(0,C.jsx)(E.yEL,{name:"name",form:h,fields:U}),(0,C.jsx)(E.Bau,{name:"description",form:h,fields:U}),(0,C.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,C.jsx)(E.Qyk,{title:"Device",name:"ledgerConnectedAndVerified"}),(0,C.jsx)(E.cp7,{name:"ledgerConnectedAndVerified",form:h}),(0,C.jsx)(_,{shouldVerify:!0})]})]})})}let AQ={name:"",description:"",mnemonic:""};function AB(A){let{trigger:Q,open:B,onOpenChange:w}=A,{openDialog:D}=AZ(),t=(0,c.cI)({mode:"all",defaultValues:AQ}),{dataset:K}=(0,s.r)(),L=function(A){let{walletNames:Q}=A;return{name:{type:"text",title:"Name",placeholder:"name",validation:{validate:{unique:A=>!Q.includes(A)||"name is already in use"},required:"required",maxLength:30}},description:{type:"text",title:"Description",placeholder:"Optional description or notes about the wallet.",validation:{maxLength:200}},mnemonic:{type:"text",title:"Seed",placeholder:"island submit vague scrub exhibit cherry front spoon crop debate filter virus",validation:{required:"required",validate:{valid:A=>{let{error:Q}=(0,n.K)().wallet.keyPairFromSeedPhrase(A,0);return!Q||"seed should be 12 word BIP39 mnemonic"}}}}}}({walletNames:(null==K?void 0:K.map(A=>A.name))||[]}),U=(0,g.lT)(),i=(0,I.useCallback)(async A=>{let Q=A.mnemonic.trim(),B=(0,h.blake2bHex)(Q),C=await U.post({payload:{name:A.name,description:A.description,metadata:{type:"seed",mnemonicHash:B}}});C.error?(0,E.OHV)({title:"Error adding wallet",body:C.error}):(D("walletAddressesGenerate",{walletId:C.data.id}),t.reset(AQ))},[t,D,U]);return(0,C.jsx)(E.VqE,{title:y.z.walletAddRecover.title,trigger:Q,open:B,onOpenChange:w,contentVariants:{className:"w-[400px]"},onSubmit:t.handleSubmit(i),controls:(0,C.jsxs)("div",{className:"flex gap-2 px-1",children:[(0,C.jsx)(E.zxk,{size:"medium",onClick:()=>{D("walletAddType")},children:"back"}),(0,C.jsx)("div",{className:"flex-1"}),(0,C.jsx)(E.ZqQ,{size:"medium",form:t,children:"Add wallet"})]}),children:(0,C.jsxs)("div",{className:"flex flex-col gap-4 mb-2",children:[(0,C.jsx)(E.nvN,{size:"14",color:"subtle",children:y.z.walletAddRecover.description}),(0,C.jsx)(E.yEL,{name:"name",form:t,fields:L}),(0,C.jsx)(E.Bau,{name:"description",form:t,fields:L}),(0,C.jsx)(k,{icon:(0,C.jsx)(M.fwm,{}),description:(0,C.jsx)(C.Fragment,{children:"Enter the seed mnemonic for the wallet you are recovering."}),children:(0,C.jsx)(E.Bau,{form:t,fields:L,name:"mnemonic"})})]})})}let AC={name:"",description:""};function AI(A){let{trigger:Q,open:B,onOpenChange:w}=A,{openDialog:D}=AZ(),M=(0,g.lT)(),h=(0,c.cI)({mode:"all",defaultValues:AC}),{dataset:k}=(0,s.r)(),n=function(A){let{walletNames:Q}=A;return{name:{type:"text",title:"Name",placeholder:"name",validation:{validate:{unique:A=>!Q.includes(A)||"name is already in use"},required:"required",maxLength:30}},description:{type:"text",title:"Description",placeholder:"Optional description or notes about the wallet.",validation:{maxLength:200}}}}({walletNames:(null==k?void 0:k.map(A=>A.name))||[]}),t=(0,I.useCallback)(async A=>{let Q=await M.post({payload:{name:A.name,description:A.description,metadata:{type:"watch"}}});Q.error?(0,E.OHV)({title:"Error adding wallet",body:Q.error}):(D("walletAddressesAdd",{walletId:Q.data.id}),h.reset(AC))},[h,D,M]);return(0,C.jsx)(E.VqE,{title:y.z.walletAddWatch.title,trigger:Q,open:B,onOpenChange:w,contentVariants:{className:"w-[400px]"},onSubmit:h.handleSubmit(t),controls:(0,C.jsxs)("div",{className:"flex gap-2 px-1",children:[(0,C.jsx)(E.zxk,{size:"medium",onClick:()=>{D("walletAddType")},children:"back"}),(0,C.jsx)("div",{className:"flex-1"}),(0,C.jsx)(E.ZqQ,{size:"medium",form:h,children:"Add wallet"})]}),children:(0,C.jsxs)("div",{className:"flex flex-col gap-4 mb-2",children:[(0,C.jsx)(E.nvN,{size:"14",color:"subtle",children:y.z.walletAddWatch.description}),(0,C.jsx)(E.yEL,{name:"name",form:h,fields:n}),(0,C.jsx)(E.Bau,{name:"description",form:h,fields:n})]})})}var AE=B(92581),Ag=B(28356);let Aw={addresses:"",...S()};function AD(A){return(0,Ag.Z)(A.trim().split(/[^0-9a-fA-F]+/).map(A=>A).filter(A=>!!A))}function AM(A){let{params:Q,trigger:B,open:w,onOpenChange:D}=A,{walletId:M}=Q||{},{dataset:y}=(0,s.r)(),h=null==y?void 0:y.find(A=>A.id===M),k=(0,c.cI)({mode:"all",defaultValues:Aw}),{handleOpenChange:n,closeAndReset:t}=(0,E.t0Y)({form:k,onOpenChange:D,defaultValues:Aw}),K={addresses:{type:"text",title:"Addresses",placeholder:"91acbc0feb9e20d538db1f8a509d508362d1b1f3d725d9b6639306531d770c1ef9eb637b4903\nb58849e347356878bb0098908191550ff3e46cc35ed166d0c571fe184d2f17b835747991c266\nb811a04859809fe081884c10d50ca069f1429112ba4a8dc9181c95de41f7eca01416923daa6d\n03442c5643c1deb15c60104ca6ad80fa9563c67c8334f0bbe968b01cb9b8f81c8103a7a202c0\n",validation:{required:"required",validate:{valid:A=>{let Q=AD(A||"");for(let A=0;A{let Q=AD(A),B=Q.length,C=0;for(let A=0;A{let Q=await U(A.addresses);if(Q.error){1===Q.total?(0,E.OHV)({title:"Error saving address",body:Q.error}):(0,E.OHV)({title:"Error saving addresses",body:Q.successful>0?"".concat(Q.successful," of ").concat(Q.total," addresses were saved."):""});return}1===Q.total?(0,E.OPV)({title:"Added 1 address"}):(0,E.OPV)({title:"Added ".concat(Q.successful," addresses")}),i(A),t()},[U,t,i]),r=k.watch("addresses"),p=k.watch("shouldRescan"),a=AD(r).length;return(0,C.jsx)(E.VqE,{title:"Wallet ".concat(null==h?void 0:h.name,": add addresses"),trigger:B,open:w,onOpenChange:n,contentVariants:{className:"w-[500px]"},onSubmit:k.handleSubmit(G),controls:(0,C.jsx)("div",{className:"flex justify-end",children:(0,C.jsxs)(E.ZqQ,{form:k,variant:p?"red":"accent",size:"medium",children:[0===a?"Add addresses":1===a?"Add 1 address":"Add ".concat(a.toLocaleString()," addresses"),p?" and rescan":""]})}),children:(0,C.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,C.jsx)(E.nvN,{size:"14",children:"Enter multiple addresses separated by spaces or commas."}),(0,C.jsx)(E.Bau,{form:k,fields:K,name:"addresses"}),(0,C.jsx)(l,{form:k,fields:K})]})})}let Ac={address:""};function As(A){let{params:Q,trigger:B,open:w,onOpenChange:D}=A,{walletId:M,address:s}=Q||{},{closeDialog:y}=AZ(),h=(0,g.XF)(),k=(0,c.cI)({defaultValues:Ac}),n=(0,I.useCallback)(async()=>{let A=await h.delete({params:{id:M,addr:s}});A.error?(0,E.OHV)({title:"Error removing address",body:A.error}):((0,E.OPV)({title:"Address permanently removed"}),k.reset(),y())},[k,M,s,h,y]),t=(0,I.useMemo)(()=>({address:{type:"text",title:"Address",placeholder:s,validation:{required:"required",validate:{equals:A=>(0,E.I13)(A)===(0,E.I13)(s)||"address does not match"}}}}),[s]),K=(0,E.WsO)(t);return(0,C.jsx)(E.VqE,{title:"Remove address",trigger:B,open:w,onOpenChange:A=>{A||k.reset(Ac),D(A)},contentVariants:{className:"w-[400px]"},onSubmit:k.handleSubmit(n,K),children:(0,C.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,C.jsxs)(E.nvN,{size:"14",children:["Are you sure you would like to permanently remove the address"," ",(0,C.jsxs)(E.EKh,{children:[(0,E.I13)(s).slice(0,12),"..."]}),"?"]}),(0,C.jsx)(E.nvN,{size:"14",children:"Enter the address name to confirm the removal."}),(0,C.jsx)(E.yEL,{name:"address",form:k,fields:t}),(0,C.jsx)(E.ZqQ,{variant:"red",form:k,children:"Remove"})]})})}let Ay="e3b1050aef388438668b52983cf78f40925af8f0aa8b9de80c18eadcefce8388d168a313e3f2",Ah=(0,AE.qN)(.00393),Ak={receiveAddress:"",changeAddress:"",claimAddress:"",customChangeAddress:!1,customClaimAddress:!1,mode:"siacoin",siacoin:void 0,siafund:void 0,includeFee:!1};function An(A){let{balanceSc:Q,balanceSf:B,onComplete:g,defaultChangeAddress:w,defaultClaimAddress:D}=A,s=(0,c.cI)({mode:"all",defaultValues:Ak}),y=function(A){let{balanceSc:Q,balanceSf:B,fee:I}=A;return{receiveAddress:{type:"text",title:"Recipient address",placeholder:Ay,validation:{validate:{required:A=>!!A||"required",valid:A=>(0,AE.At)(A)||"invalid address"}}},mode:{type:"select",title:"Action",options:[{value:"siacoin",label:"Send siacoins"},{value:"siafund",label:"Send siafunds"}],validation:{required:"required"}},siacoin:{type:"siacoin",title:"Siacoin",placeholder:"100",validation:{validate:{required:(A,Q)=>"siacoin"!==Q.mode||!!A||"required",gtz:(A,Q)=>"siacoin"!==Q.mode||!new(U())(A||0).isZero()||"must be greater than zero",balance:(A,B)=>"siacoin"!==B.mode||Q.gte((0,AE.qN)(A||0).plus(I))||"not enough funds in wallet"}}},siafund:{type:"number",title:"Siafunds",decimalsLimit:0,placeholder:"100",validation:{validate:{required:(A,Q)=>"siafund"!==Q.mode||!!A||"required",gtz:(A,Q)=>"siafund"!==Q.mode||(null==A?void 0:A.gt(0))||"must be greater than zero",balance:(A,C)=>"siafund"!==C.mode||(null==Q?void 0:Q.gte(I))&&(null==B?void 0:B.gte(A))||"not enough funds in wallet"}}},customChangeAddress:{type:"boolean",title:"Custom change adress",validation:{}},customClaimAddress:{type:"boolean",title:"Custom claim adress",validation:{}},changeAddress:{type:"text",title:"Change address",placeholder:Ay,actions:(0,C.jsx)(E.ua7,{content:(0,C.jsx)(C.Fragment,{children:"The address where any change from the transaction will be sent. If a custom change address is not specified it is automatically set to the wallet's address 0."}),children:(0,C.jsx)(E.xvT,{color:"subtle",className:"cursor-pointer",children:(0,C.jsx)(M.RdX,{className:"scale-75"})})}),validation:{validate:{required:(A,Q)=>!Q.customChangeAddress||!!A||"required",valid:(A,Q)=>!Q.customChangeAddress||(0,AE.At)(A)||"invalid address"}}},claimAddress:{type:"text",title:"Claim address",placeholder:Ay,actions:(0,C.jsx)(E.ua7,{content:(0,C.jsx)(C.Fragment,{children:"The address that will receive any unclaimed siacoin earnings from the siafund. If a custom claim address is not specified it is automatically set to the wallet's address 0."}),children:(0,C.jsx)(E.xvT,{color:"subtle",className:"cursor-pointer",children:(0,C.jsx)(M.RdX,{className:"scale-75"})})}),validation:{validate:{required:(A,Q)=>{let B="siafund"!==Q.mode,C=!Q.customChangeAddress;return B||C||!!A||"required"},valid:(A,Q)=>{let B="siafund"!==Q.mode,C=!Q.customChangeAddress;return B||C||(0,AE.At)(A)||"invalid address"}}}},includeFee:{type:"boolean",title:"",validation:{}}}}({balanceSc:Q,balanceSf:B,fee:Ah}),h=(0,I.useCallback)(async A=>{let Q=new(U())(A.siacoin||0),B=new(U())(A.siafund||0),C=A.includeFee?(0,AE.qN)(Q).minus(Ah):(0,AE.qN)(Q),I=B.toNumber();g({receiveAddress:A.receiveAddress,changeAddress:A.customChangeAddress?A.changeAddress:w,claimAddress:A.customClaimAddress?A.claimAddress:D,fee:Ah,mode:A.mode,siacoin:C,siafund:I})},[g,w,D]),k=(0,I.useMemo)(()=>s.handleSubmit(h),[s,h]),n=s.watch("siacoin"),t=s.watch("mode"),K=s.watch("customChangeAddress"),L=s.watch("customClaimAddress"),i=s.watch("includeFee"),G=(0,AE.qN)(n||0),r=(0,C.jsxs)("div",{className:"flex flex-col gap-4",children:[B.gt(0)&&(0,C.jsx)(E.WyV,{size:"medium",form:s,fields:y,name:"mode"}),(0,C.jsx)(E.yEL,{size:"medium",form:s,fields:y,name:"receiveAddress",autoComplete:"off"}),(0,C.jsxs)("div",{className:"flex gap-2",children:[(0,C.jsx)(E.QBj,{size:"small",form:s,fields:y,name:"customChangeAddress",group:!1,children:(0,C.jsxs)("div",{className:"flex items-center gap-px",children:[(0,C.jsx)(E.xvT,{color:"verySubtle",weight:"medium",size:"14",ellipsis:!0,children:"custom change address"}),y.changeAddress.actions]})}),"siafund"===t&&(0,C.jsx)(E.QBj,{size:"small",form:s,fields:y,name:"customClaimAddress",group:!1,children:(0,C.jsxs)("div",{className:"flex items-center gap-px",children:[(0,C.jsx)(E.xvT,{color:"verySubtle",weight:"medium",size:"14",ellipsis:!0,children:"custom claim address"}),y.claimAddress.actions]})})]}),K&&(0,C.jsx)(E.yEL,{size:"medium",form:s,fields:y,name:"changeAddress",autoComplete:"off"}),"siafund"===t&&L&&(0,C.jsx)(E.yEL,{size:"medium",form:s,fields:y,name:"claimAddress",autoComplete:"off"}),"siacoin"===t?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(E.qGu,{size:"medium",form:s,fields:y,name:"siacoin"}),(0,C.jsxs)("div",{className:"flex items-center",children:[(0,C.jsxs)(E.QBj,{size:"small",form:s,fields:y,name:"includeFee",children:[(0,C.jsx)(E.xvT,{children:"Include fee"}),(0,C.jsx)(E.Yqd,{children:"Include or exclude the network fee from the above transaction value."})]}),(0,C.jsx)("div",{className:"flex flex-1"})]})]}):(0,C.jsx)(E.jIp,{size:"medium",form:s,fields:y,name:"siafund"}),(0,C.jsxs)("div",{className:"flex flex-col gap-2 my-1",children:[(0,C.jsxs)("div",{className:"flex gap-2 justify-between items-center",children:[(0,C.jsx)(E.xvT,{color:"verySubtle",children:"Network fee"}),(0,C.jsx)("div",{className:"flex relative top-[-0.5px]",children:(0,C.jsx)(E.YKL,{size:"14",value:Ah,variant:"value",dynamicUnits:!1})})]}),"siacoin"===t&&(0,C.jsxs)("div",{className:"flex justify-between gap-2 items-center",children:[(0,C.jsx)(E.xvT,{color:"verySubtle",children:"Total"}),(0,C.jsx)("div",{className:"flex relative top-[-0.5px]",children:(0,C.jsx)(E.YKL,{size:"14",value:i?G:G.plus(Ah),variant:"value",dynamicUnits:!1})})]})]})]});return{form:s,el:r,handleSubmit:k,reset:()=>s.reset(Ak)}}function At(A){let{params:{receiveAddress:Q,changeAddress:B,claimAddress:I,mode:g,siacoin:w,siafund:D,fee:M},transactionId:c}=A,s=w.plus(M);return(0,C.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,C.jsxs)("div",{className:"flex gap-6 justify-between items-center",children:[(0,C.jsx)(E.xvT,{color:"verySubtle",noWrap:!0,children:"Recipient address"}),(0,C.jsx)(E.XxW,{value:Q,type:"address"})]}),(0,C.jsxs)("div",{className:"flex gap-6 justify-between items-center",children:[(0,C.jsx)(E.xvT,{color:"verySubtle",noWrap:!0,children:"Change address"}),(0,C.jsx)(E.XxW,{value:B,type:"address"})]}),"siafund"===g&&(0,C.jsxs)("div",{className:"flex gap-6 justify-between items-center",children:[(0,C.jsx)(E.xvT,{color:"verySubtle",noWrap:!0,children:"Claim address"}),(0,C.jsx)(E.XxW,{value:I,type:"address"})]}),(0,C.jsxs)("div",{className:"flex gap-2 justify-between items-center",children:[(0,C.jsx)(E.xvT,{color:"verySubtle",noWrap:!0,children:"Amount"}),(0,C.jsx)("div",{className:"flex relative top-[-0.5px]",children:"siacoin"===g?(0,C.jsx)(E.YKL,{size:"14",value:w,variant:"value",dynamicUnits:!1}):(0,C.jsx)(E.Sby,{size:"14",value:D,variant:"value"})})]}),(0,C.jsxs)("div",{className:"flex gap-2 justify-between items-center",children:[(0,C.jsx)(E.xvT,{color:"verySubtle",noWrap:!0,children:"Network fee"}),(0,C.jsx)("div",{className:"flex relative top-[-0.5px]",children:(0,C.jsx)(E.YKL,{size:"14",value:M,variant:"value",dynamicUnits:!1})})]}),"siacoin"===g&&(0,C.jsxs)("div",{className:"flex items-center gap-2 justify-between",children:[(0,C.jsx)(E.xvT,{color:"verySubtle",noWrap:!0,children:"Total"}),(0,C.jsx)("div",{className:"flex relative top-[-0.5px]",children:(0,C.jsx)(E.YKL,{size:"14",value:s,variant:"value",dynamicUnits:!1})})]}),c&&(0,C.jsxs)("div",{className:"flex gap-6 items-center justify-between",children:[(0,C.jsx)(E.xvT,{color:"verySubtle",noWrap:!0,children:"Transaction ID"}),(0,C.jsx)(E.XxW,{value:c,type:"transaction"})]})]})}function AK(A){let{transaction:Q,toSign:B,addresses:C,siacoinOutputs:I,siafundOutputs:g}=A;if(!C)return{error:"No addresses"};if(!I)return{error:"No outputs"};for(let A of B){let B=(0,E.I13)(A),{address:w,siacoinUtxo:D,siafundUtxo:M,siacoinInput:c,siafundInput:s,error:y}=AL({toSignId:B,addresses:C,siacoinOutputs:I,siafundOutputs:g,transaction:Q});if(y)return{error:y};D&&(c.unlockConditions=w.metadata.unlockConditions),M&&(s.unlockConditions=w.metadata.unlockConditions),Q.signatures||(Q.signatures=[]),Q.signatures.push({parentID:B,publicKeyIndex:0,timelock:0,coveredFields:{wholeTransaction:!0}})}return{}}function AL(A){var Q,B;let{toSignId:C,transaction:I,addresses:g,siacoinOutputs:w,siafundOutputs:D}=A,M=(0,E.I13)(C),c=function(A){let{id:Q,addresses:B,siacoinOutputs:C}=A,I=(0,E.I13)(Q),g=null==C?void 0:C.find(A=>(0,E.I13)(A.id)===I);if(!g)return{error:"Missing utxo"};let w=null==B?void 0:B.find(A=>(0,E.I13)(A.address)===(0,E.I13)(g.siacoinOutput.address));return w?w.metadata?void 0===w.metadata.index?{error:"Missing address index"}:w.metadata.unlockConditions.publicKeys[0]?{utxo:g,address:w}:{error:"Missing address public key"}:{error:"Missing address metadata"}:{error:"Missing address"}}({id:M,addresses:g,siacoinOutputs:w});if(!c.error){let A=null===(Q=I.siacoinInputs)||void 0===Q?void 0:Q.find(A=>(0,E.I13)(A.parentID)===(0,E.I13)(c.utxo.id));return A?{address:c.address,siacoinUtxo:c.utxo,siacoinInput:A}:{error:"Missing input"}}let s=function(A){let{id:Q,addresses:B,siafundOutputs:C}=A,I=(0,E.I13)(Q),g=null==C?void 0:C.find(A=>(0,E.I13)(A.id)===I);if(!g)return{error:"Missing utxo"};let w=null==B?void 0:B.find(A=>(0,E.I13)(A.address)===(0,E.I13)(g.siafundOutput.address));return w?w.metadata?void 0===w.metadata.index?{error:"Missing address index"}:w.metadata.unlockConditions.publicKeys[0]?{utxo:g,address:w}:{error:"Missing address public key"}:{error:"Missing address metadata"}:{error:"Missing address"}}({id:M,addresses:g,siafundOutputs:D});if(!s.error){let A=null===(B=I.siafundInputs)||void 0===B?void 0:B.find(A=>(0,E.I13)(A.parentID)===(0,E.I13)(s.utxo.id));return A?{address:s.address,siafundUtxo:s.utxo,siafundInput:A}:{error:"Missing input"}}return s.error&&"Missing utxo"!==s.error?{error:s.error}:{error:c.error}}function AU(A){let{cancel:Q}=A,B=(0,g.ys)();return(0,I.useCallback)(async A=>{let{signedTransaction:C}=A;if(!C)return{error:"No signed transaction"};let I=await B.post({payload:{transactions:[C],v2transactions:[]}});return I.error?(Q(C),{error:I.error}):{}},[Q,B])}function Ai(){let{wallet:A}=(0,s.r)(),Q=null==A?void 0:A.id,B=(0,g.zQ)();return(0,I.useCallback)(async A=>{var C,I;let g=(null===(C=A.siacoinInputs)||void 0===C?void 0:C.map(A=>A.parentID))||[],w=(null===(I=A.siafundInputs)||void 0===I?void 0:I.map(A=>A.parentID))||[],D=await B.post({params:{id:Q},payload:{siacoinOutputs:g,siafundOutputs:w}});D.error&&(0,E.OHV)({title:"Error canceling transaction",body:D.error})},[Q,B])}function AG(){let{wallet:A}=(0,s.r)(),Q=null==A?void 0:A.id,B=(0,g.sv)(),C=(0,g.bW)();return(0,I.useCallback)(async A=>{let{receiveAddress:I,changeAddress:E,claimAddress:g,mode:w,siacoin:D,siafund:M,fee:c}=A;if(!I||!E||!g)return{error:"No addresses"};if("siacoin"===w){let A=await B.post({params:{id:Q},payload:{amount:D.plus(c).toString(),changeAddress:E,transaction:{minerFees:[c.toString()],siacoinOutputs:[{value:D.toString(),address:I}]}}});return A.error?{error:A.error}:{fundedTransaction:A.data.transaction,toSign:A.data.toSign}}if("siafund"===w){let A=[],w=await C.post({params:{id:Q},payload:{amount:M,changeAddress:E,claimAddress:g,transaction:{minerFees:[c.toString()],siafundOutputs:[{value:M,address:I}]}}});return w.error?{error:w.error}:(A.push(...w.data.toSign),(w=await B.post({params:{id:Q},payload:{amount:c.toString(),changeAddress:E,transaction:w.data.transaction}})).error)?{error:w.error}:(A.push(...w.data.toSign),{fundedTransaction:w.data.transaction,toSign:A})}},[B,C,Q])}let Ar={mnemonic:""};function Ap(A){let{params:Q,transactionId:B}=A;return(0,C.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,C.jsx)(At,{params:Q,transactionId:B}),(0,C.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 my-4",children:[(0,C.jsx)(E.xvT,{children:(0,C.jsx)(M.Z$8,{})}),(0,C.jsx)(E.xvT,{children:"Transaction successfully broadcast."})]})]})}function Aa(A){let{trigger:Q,open:B,onOpenChange:I,sendParams:g,signedTxnId:w,step:D,send:M,compose:c,setStep:s,controls:y}=A;return(0,C.jsx)(E.VqE,{trigger:Q,open:B,onOpenChange:A=>{A||(c.reset(),M.reset(),s("compose")),I(A)},title:"Send",onSubmit:y?y.handleSubmit:void 0,controls:(null==y?void 0:y.form)&&(0,C.jsx)("div",{className:"flex flex-col gap-1",children:(0,C.jsx)(E.ZqQ,{form:y.form,children:y.submitLabel})}),contentVariants:{className:"w-[450px]"},children:(0,C.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,C.jsx)(E.tIK,{onChange:A=>{s(A)},activeStep:D,steps:[{id:"compose",label:"Compose"},{id:"send",label:"Sign & Send"},{id:"done",label:"Complete"}]}),(0,C.jsx)(E.Z0O,{className:"w-full mt-4"}),"compose"===D&&c.el,"send"===D&&M.el,"done"===D&&(0,C.jsx)(Ap,{params:g,transactionId:w})]})})}let AN={receiveAddress:"",changeAddress:"",claimAddress:"",mode:"siacoin",siacoin:new(U())(0),siafund:0,fee:new(U())(0)};function Ao(A){var Q,B;let{params:w,trigger:D,open:M,onOpenChange:y}=A,{walletId:h}=w||{},k=(0,g.tM)({disabled:!h,params:{id:h}}),{dataset:t}=o({id:h}),K=(0,I.useMemo)(()=>{var A;return new(U())((null===(A=k.data)||void 0===A?void 0:A.siacoins)||0)},[k.data]),L=(0,I.useMemo)(()=>{var A;return new(U())((null===(A=k.data)||void 0===A?void 0:A.siafunds)||0)},[k.data]),[G,p]=(0,I.useState)("compose"),[a,N]=(0,I.useState)(),[e,J]=(0,I.useState)(AN),F=An({balanceSc:K,balanceSf:L,defaultChangeAddress:null==t?void 0:null===(Q=t[0])||void 0===Q?void 0:Q.address,defaultClaimAddress:null==t?void 0:null===(B=t[0])||void 0===B?void 0:B.address,onComplete:A=>{J(Q=>({...Q,...A})),p("send")}}),S=function(A){let{walletId:Q,params:B,onConfirm:w}=A,D=function(){let{wallet:A,cacheWalletMnemonic:Q}=(0,s.r)(),B=null==A?void 0:A.id,C=(0,g.jL)({disabled:!B,params:{id:B}}),E=(0,g.cd)({disabled:!B,params:{id:B}}),{dataset:w}=o({id:B}),D=(0,g.ek)(),M=(0,g.gM)(),c=AG(),y=Ai(),h=AU({cancel:y});return(0,I.useCallback)(async A=>{let{mnemonic:I,params:g}=A;if(!w)return{error:"No addresses found"};let{fundedTransaction:s,toSign:k,error:t}=await c(g);if(t)return{fundedTransaction:s,error:t};let{signedTransaction:K,error:L}=function(A){let{mnemonic:Q,transaction:B,toSign:C,consensusState:I,consensusNetwork:E,addresses:g,siacoinOutputs:w,siafundOutputs:D}=A;if(!I)return{error:"No consensus state"};if(!g)return{error:"No addresses"};if(!w)return{error:"No outputs"};let{error:M}=AK({toSign:C,transaction:B,addresses:g,siacoinOutputs:w,siafundOutputs:D});if(M)return{error:M};for(let[A,M]of C.entries()){let{address:C,error:c}=AL({toSignId:M,transaction:B,addresses:g,siacoinOutputs:w,siafundOutputs:D});if(c)return{error:c};let s=(0,n.K)().wallet.keyPairFromSeedPhrase(Q,C.metadata.index);if(s.error)return{error:s.error};let{signature:y,error:h}=(0,n.K)().wallet.signTransactionV1(I,E,B,A,s.privateKey);if(h)return{error:h};B.signatures[A].signature=y}return{signedTransaction:B}}({mnemonic:I,transaction:s,toSign:k,consensusState:D.data,consensusNetwork:M.data,addresses:w,siacoinOutputs:C.data,siafundOutputs:E.data});return L?(y(s),{error:L}):(Q(B,I),h({signedTransaction:K}))},[y,w,c,B,D.data,M.data,C.data,E.data,Q,h])}(),{isSeedCached:M}=function(A){let{dataset:Q}=(0,s.r)(),B=null==Q?void 0:Q.find(Q=>Q.id===A),C=null==B?void 0:B.state.mnemonic;return{cachedMnemonic:C,isSeedCached:!!C}}(Q),{dataset:y}=(0,s.r)(),h=null==y?void 0:y.find(A=>A.id===Q),k=null==h?void 0:h.metadata.mnemonicHash,t=(0,c.cI)({mode:"all",defaultValues:Ar}),[K,L]=(0,I.useState)("password"),U=(0,I.useMemo)(()=>(function(A){let{mnemonicHash:Q,mnemonicFieldType:B,setMnemonicFieldType:C,isSeedCached:I}=A;return{mnemonic:I?{title:"Seed",type:"text",validation:{}}:i({mnemonicHash:Q,setMnemonicFieldType:C,mnemonicFieldType:B})}})({mnemonicFieldType:K,setMnemonicFieldType:L,mnemonicHash:k,isSeedCached:M}),[K,L,k,M]),G=(0,I.useCallback)(async A=>{let{error:Q}=await D({mnemonic:h.state.mnemonic||A.mnemonic,params:B});if(Q){(0,E.OHV)({title:Q});return}w({})},[D,B,w,h]),p=(0,E.WsO)(U),a=(0,I.useMemo)(()=>t.handleSubmit(G,p),[t,G,p]),N=(0,C.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,C.jsx)(r,{walletId:Q,name:"mnemonic",form:t,fields:U,actionText:"complete the transaction"}),(0,C.jsx)(At,{params:B})]});return{form:t,el:N,handleSubmit:a,reset:()=>t.reset(Ar)}}({walletId:h,params:e,onConfirm:A=>{let{transactionId:Q}=A;N(Q),p("done")}}),l=(0,I.useMemo)(()=>"compose"===G?{submitLabel:"Generate transaction",form:F.form,handleSubmit:F.handleSubmit,reset:F.reset}:"send"===G?{submitLabel:"Sign and broadcast transaction",form:S.form,handleSubmit:S.handleSubmit,reset:S.reset}:void 0,[G,F,S]);return(0,C.jsx)(Aa,{trigger:D,open:M,onOpenChange:A=>{A||(F.reset(),S.reset(),p("compose")),y(A)},controls:l,compose:F,send:S,sendParams:e,signedTxnId:a,step:G,setStep:p})}function Ae(A){let{title:Q,isSigned:B,isConnected:I,details:g,actions:w}=A;return(0,C.jsx)(E.s_4,{className:"mt-1 pl-3 pr-2 py-2",children:(0,C.jsxs)("div",{className:"flex flex-col",children:[(0,C.jsxs)("div",{className:"flex gap-1 justify-between items-center",children:[(0,C.jsxs)("div",{className:"flex items-center",children:[B?(0,C.jsxs)("div",{className:"relative w-2 h-2 mr-2",children:[(0,C.jsx)("div",{className:"absolute w-2 h-2 rounded-full bg-green-400 animate-pingslow"}),(0,C.jsx)("div",{className:"absolute w-2 h-2 rounded-full bg-green-500 border border-green-400"})]}):I?(0,C.jsxs)("div",{className:"relative w-2 h-2 mr-2",children:[(0,C.jsx)("div",{className:"absolute w-2 h-2 rounded-full bg-amber-400 animate-pingslow"}),(0,C.jsx)("div",{className:"absolute w-2 h-2 rounded-full bg-amber-500 border border-amber-400"})]}):(0,C.jsx)("div",{className:"relative w-2 h-2 mr-2",children:(0,C.jsx)("div",{className:"absolute w-2 h-2 rounded-full bg-gray-1000 border border-gray-900"})}),(0,C.jsx)(E.xvT,{weight:"semibold",size:"16",className:"ml-1",children:Q})]}),(0,C.jsx)("div",{className:"flex gap-1 justify-between items-center",children:w})]}),g]})})}function AJ(A){let{waitingForUser:Q,isConnected:B,isSigned:I,sign:g}=A;return(0,C.jsx)("div",{className:"flex flex-col gap-1",children:I?(0,C.jsx)(Ae,{isConnected:B,isSigned:I,title:"Transaction"}):B&&Q?(0,C.jsx)(Ae,{isConnected:B,isSigned:I,title:"Transaction",details:(0,C.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,C.jsx)(E.xvT,{children:"Please confirm on device..."}),(0,C.jsx)(E.nvN,{size:"14",color:"subtle",children:"To continue, approve signature on device."})]})}):B?(0,C.jsx)(Ae,{isConnected:B,isSigned:I,title:"Transaction",actions:(0,C.jsx)(C.Fragment,{children:(0,C.jsx)(E.zxk,{size:"small",onClick:g,children:"Sign"})})}):(0,C.jsx)(Ae,{isConnected:B,isSigned:I,title:"Transaction",details:(0,C.jsx)("div",{className:"flex flex-col gap-1",children:(0,C.jsx)(E.nvN,{size:"14",color:"subtle",children:"Connect device to start signing."})})})})}var AF=B(48834).lW;async function AS(A){let{device:Q,transaction:B,toSign:C,addresses:I,siacoinOutputs:E,siafundOutputs:g}=A;if(!I)return{error:"No addresses"};if(!E)return{error:"No outputs"};let{error:w}=AK({transaction:B,toSign:C,addresses:I,siacoinOutputs:E,siafundOutputs:g});if(w)return{error:w};for(let[A,w]of C.entries()){let C=AL({toSignId:w,addresses:I,siacoinOutputs:E,siafundOutputs:g,transaction:B});if(C.error)return{error:C.error};let D=await Al({device:Q,transaction:B,signatureIndex:A,keyIndex:C.address.metadata.index});if(D.error)return{error:D.error}}return{transaction:B}}async function Al(A){let Q,{device:B,transaction:C,signatureIndex:I,keyIndex:E}=A,{encodedTransaction:g,error:w}=(0,n.K)().wallet.encodeTransaction(C);if(w)return{error:w};let D=AF.from(g,"utf-8"),M=0>function(A,Q){let B=/[^0-9.]/gi,C=A.replace(B,"").split("."),I=Q.replace(B,"").split("."),E=Math.max(C.length,I.length);for(let A=0;AB)return 1}return 0}(await B.sia.getVersion(),"0.4.5");try{Q=M?await B.sia.signTransactionV044(D,I,E):await B.sia.signTransaction(D,I,E,0)}catch(A){return{error:A.message}}return C.signatures[I].signature=Q,{transaction:C}}let AH={isConnected:!1,isSigned:!1};function AY(A){var Q,B;let{params:w,trigger:D,open:M,onOpenChange:y}=A,{walletId:h}=w||{},[k,n]=(0,I.useState)("compose"),[t,K]=(0,I.useState)(),[L,i]=(0,I.useState)(AN),G=(0,g.tM)({disabled:!h,params:{id:h}}),{dataset:r}=o({id:h}),p=An({balanceSc:(0,I.useMemo)(()=>{var A;return new(U())((null===(A=G.data)||void 0===A?void 0:A.siacoins)||0)},[G.data]),balanceSf:(0,I.useMemo)(()=>{var A;return new(U())((null===(A=G.data)||void 0===A?void 0:A.siafunds)||0)},[G.data]),defaultChangeAddress:null==r?void 0:null===(Q=r[0])||void 0===Q?void 0:Q.address,defaultClaimAddress:null==r?void 0:null===(B=r[0])||void 0===B?void 0:B.address,onComplete:A=>{i(Q=>({...Q,...A})),n("send")}}),a=function(A){let{params:Q,step:B,onConfirm:w}=A,D=(0,c.cI)({mode:"all",defaultValues:AH}),M=D.watch("isConnected"),y=D.watch("isSigned"),{device:h,error:k}=(0,x.c)(),n=Ai(),t=function(A){let{cancel:Q}=A,{wallet:B}=(0,s.r)(),C=null==B?void 0:B.id,E=(0,g.jL)({disabled:!C,params:{id:C}}),w=(0,g.cd)({disabled:!C,params:{id:C}}),{dataset:D}=o({id:C}),{device:M}=(0,x.c)();return(0,I.useCallback)(async A=>{let{fundedTransaction:B,toSign:C}=A;if(!M||!B)return;let I=await AS({device:M,transaction:B,toSign:C,addresses:D,siacoinOutputs:E.data,siafundOutputs:w.data});return I.error?(Q(B),{error:I.error}):{signedTransaction:I.transaction}},[M,D,E.data,w.data,Q])}({cancel:n}),K=AU({cancel:n}),L=function(A){let{fund:Q,cancel:B,sign:C}=A;return(0,I.useCallback)(async A=>{let{fundedTransaction:I,toSign:E,error:g}=await Q(A);if(g)return{fundedTransaction:I,error:g};let{signedTransaction:w,error:D}=await C({fundedTransaction:I,toSign:E});return D?(B(I),{fundedTransaction:I,error:D}):{signedTransaction:w}},[Q,C,B])}({cancel:n,fund:AG(),sign:t}),[U,i]=(0,I.useState)(!1),[G,r]=(0,I.useState)();(0,I.useEffect)(()=>{"compose"===B&&r(void 0)},[B]),(0,I.useEffect)(()=>{h?D.setValue("isConnected",!0):(i(!1),D.setValue("isConnected",!1))},[D,h]),(0,I.useEffect)(()=>{k?D.setError("isConnected",{message:k.message}):D.clearErrors("isConnected")},[D,k]),(0,I.useEffect)(()=>{G||D.setValue("isSigned",!1)},[D,G]);let p=(0,I.useMemo)(()=>({isConnected:{type:"boolean",title:"",validation:{validate:{isConnected:A=>A||"Ledger must be connected"}}},isSigned:{type:"boolean",title:"",validation:{validate:{isSigned:A=>A||"Transaction must be signed"}}}}),[]),a=(0,I.useCallback)(async A=>{if(!A.isConnected)return;let{error:Q}=await K({signedTransaction:G});if(Q){(0,E.OHV)({title:Q});return}w({})},[K,G,w]),N=(0,E.WsO)(p),e=(0,I.useMemo)(()=>D.handleSubmit(a,N),[D,a,N]),J=(0,I.useCallback)(async()=>{i(!0);let{signedTransaction:A,error:B}=await L(Q);B?(0,E.OHV)({title:B}):(r(A),D.setValue("isSigned",!0)),i(!1)},[D,L,Q]),F=(0,C.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,C.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,C.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,C.jsx)(E.Qyk,{title:"Device",name:"isConnected"}),(0,C.jsx)(E.cp7,{name:"isConnected",form:D}),(0,C.jsx)(_,{})]}),(0,C.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,C.jsx)(E.Qyk,{title:"Signature",name:"isSigned"}),(0,C.jsx)(E.cp7,{name:"isSigned",form:D}),(0,C.jsx)(AJ,{waitingForUser:U,isConnected:M,isSigned:y,sign:J})]})]}),(0,C.jsx)(At,{params:Q})]});return{form:D,el:F,handleSubmit:e,cancel:()=>{G&&n(G)},reset:()=>D.reset(AH)}}({walletId:h,step:k,params:L,onConfirm:A=>{let{transactionId:Q}=A;K(Q),n("done")}}),N=(0,I.useMemo)(()=>"compose"===k?{submitLabel:"Generate transaction",form:p.form,handleSubmit:p.handleSubmit,reset:p.reset}:"send"===k?{submitLabel:"Sign and broadcast transaction",form:a.form,handleSubmit:a.handleSubmit,reset:a.reset}:void 0,[k,p,a]);return(0,C.jsx)(Aa,{trigger:D,open:M,onOpenChange:A=>{A||(p.reset(),a.reset(),n("compose")),y(A)},controls:N,compose:p,send:a,sendParams:L,signedTxnId:t,step:k,setStep:n})}function Af(A){let{params:Q,trigger:B,open:g,onOpenChange:w}=A,{walletId:D}=Q||{},{dataset:M,cacheWalletMnemonic:y}=(0,s.r)(),h=null==M?void 0:M.find(A=>A.id===D),k={mnemonic:""},[n,t]=(0,I.useState)("password"),K=(0,c.cI)({mode:"all",defaultValues:k}),{handleOpenChange:L,closeAndReset:U}=(0,E.t0Y)({form:K,onOpenChange:w,defaultValues:k}),G=function(A){let{mnemonicHash:Q,mnemonicFieldType:B,setMnemonicFieldType:C}=A;return{mnemonic:i({mnemonicHash:Q,setMnemonicFieldType:C,mnemonicFieldType:B})}}({mnemonicHash:null==h?void 0:h.metadata.mnemonicHash,mnemonicFieldType:n,setMnemonicFieldType:t}),p=(0,I.useCallback)(A=>{y(D,A.mnemonic),U()},[D,y,U]),a=(0,E.WsO)(G);return(0,C.jsx)(E.VqE,{title:"Unlock wallet: ".concat(null==h?void 0:h.name),trigger:B,open:g,onOpenChange:L,contentVariants:{className:"w-[500px]"},onSubmit:K.handleSubmit(p,a),controls:(0,C.jsx)("div",{className:"flex justify-end",children:(0,C.jsx)(E.ZqQ,{form:K,variant:"accent",size:"medium",children:"Continue"})}),children:(0,C.jsx)(r,{walletId:null==h?void 0:h.id,form:K,fields:G,name:"mnemonic"})})}function Ad(A){let{open:Q,onOpenChange:B}=A,{walletAutoLockTimeout:I,setWalletAutoLockTimeout:g,setWalletAutoLockEnabled:w,walletAutoLockEnabled:D}=(0,s.r)();return(0,C.jsx)(E.DLL,{open:Q,onOpenChange:B,securityEl:(0,C.jsx)(E.bZj,{children:(0,C.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,C.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,C.jsx)(E.xvT,{children:(0,C.jsx)(M.RdX,{})}),(0,C.jsx)(E.X6q,{size:"20",className:"flex-1",children:"Lock wallets"}),(0,C.jsx)(E.rsf,{size:"medium",checked:D,onCheckedChange:A=>w(A)}),(0,C.jsxs)(E.PhF,{disabled:!D,value:String(I),onChange:A=>{g(Number(A.currentTarget.value))},children:[(0,C.jsx)(E.Wxm,{value:(0,E.sWj)(5),children:"5 minutes"}),(0,C.jsx)(E.Wxm,{value:(0,E.sWj)(10),children:"10 minutes"}),(0,C.jsx)(E.Wxm,{value:(0,E.sWj)(20),children:"20 minutes"}),(0,C.jsx)(E.Wxm,{value:(0,E.sWj)(30),children:"30 minutes"}),(0,C.jsx)(E.Wxm,{value:(0,E.sWj)(60),children:"1 hour"})]})]}),(0,C.jsx)(E.nvN,{size:"14",children:"Automatically lock each wallet after a certain period of inactivity."})]})})})}function Au(A){let{title:Q,isNew:B,address:I,details:g,actions:w,remove:D}=A;return(0,C.jsx)(E.s_4,{className:"mt-1 pl-3 pr-2 py-2",children:(0,C.jsxs)("div",{className:"flex flex-col",children:[(0,C.jsxs)("div",{className:"flex gap-1 justify-between items-center",children:[(0,C.jsxs)("div",{className:"flex items-center",children:[I?B?(0,C.jsxs)("div",{className:"relative w-2 h-2 mr-2",children:[(0,C.jsx)("div",{className:"absolute w-2 h-2 rounded-full bg-green-400 animate-pingslow"}),(0,C.jsx)("div",{className:"absolute w-2 h-2 rounded-full bg-green-500 border border-green-400"})]}):(0,C.jsx)("div",{className:"relative w-2 h-2 mr-2",children:(0,C.jsx)("div",{className:"absolute w-2 h-2 rounded-full bg-gray-1000 border border-gray-900"})}):(0,C.jsxs)("div",{className:"relative w-2 h-2 mr-2",children:[(0,C.jsx)("div",{className:"absolute w-2 h-2 rounded-full bg-amber-400 animate-pingslow"}),(0,C.jsx)("div",{className:"absolute w-2 h-2 rounded-full bg-amber-500 border border-amber-400"})]}),(0,C.jsx)(E.xvT,{weight:"semibold",size:"16",className:"ml-1",children:Q})]}),(0,C.jsxs)("div",{className:"flex gap-1 justify-between items-center",children:[w,B&&(0,C.jsx)(E.zxk,{variant:"ghost",onClick:D,children:(0,C.jsx)(M.PcV,{})})]})]}),g]})})}function AR(A){let{index:Q,address:B,isNew:g,setAddress:w,remove:D}=A,{device:M,error:c,setError:s}=(0,x.c)(),[y,h]=(0,I.useState)(!1),k=(0,I.useCallback)(async()=>{if(M){if(c){(0,E.OHV)({title:"Error connecting to Ledger",body:c.message});return}try{h(!0);let A=await M.sia.verifyStandardAddress(Q);w({index:Q,address:A.address,publicKey:A.publicKey})}catch(A){s(A),console.log(A)}h(!1)}},[Q,M,c,s,w]);return(0,C.jsx)("div",{className:"flex flex-col gap-1",children:B?(0,C.jsx)(Au,{title:"Address ".concat(Q),isNew:g,remove:D,address:B,details:(0,C.jsx)("div",{className:"flex flex-col gap-1",children:(0,C.jsx)(E.XxW,{value:B,label:"public key 0",color:"subtle",maxLength:30})})}):y?(0,C.jsx)(Au,{title:"Address ".concat(Q),isNew:g,remove:D,details:(0,C.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,C.jsx)(E.xvT,{children:"Please confirm on device..."}),(0,C.jsx)(E.nvN,{size:"14",color:"subtle",children:"To continue, approve address generation on device."})]})}):(0,C.jsx)(Au,{title:"Address ".concat(Q),isNew:g,remove:D,actions:(0,C.jsx)(C.Fragment,{children:(0,C.jsx)(E.zxk,{size:"small",onClick:k,children:"Generate"})})})})}function Aj(A){return{isNew:!0,address:"",publicKey:"",index:A}}function Ab(A){let{params:Q,trigger:B,open:w,onOpenChange:D}=A,{walletId:M,walletJustCreated:y}=Q||{},{dataset:h,lastIndex:k,datasetCount:t}=o({id:M}),K=(0,d.n)(),{dataset:L}=(0,s.r)(),i=null==L?void 0:L.find(A=>A.id===M),G=k+1,r=function(A){let{nextIndex:Q,rescanStartHeight:B}=A;return{ledgerConnected:!1,index:new(U())(Q),count:new(U())(1),...S({rescanStartHeight:B})}}({nextIndex:G,rescanStartHeight:K.nodeBlockHeight}),p=(0,c.cI)({mode:"all",defaultValues:r}),{disconnect:a,error:N}=(0,x.c)();(0,I.useEffect)(()=>{!y&&w&&a()},[w]),(0,I.useEffect)(()=>{p.formState.isSubmitting||p.setValue("index",new(U())(G))},[G]);let e=p.watch("index"),J=p.watch("count"),H=p.watch("shouldRescan"),Y={ledgerConnected:{type:"boolean",title:"",validation:{validate:{ledgerConnected:A=>A||"Ledger must be connected"}}},index:{type:"number",title:"Start index",decimalsLimit:0,placeholder:"0",validation:{required:"required"}},count:{type:"number",title:"Number of addresses",decimalsLimit:0,placeholder:"1",validation:{required:"required",max:1e3}},...F()},u=(0,g.yi)();(0,I.useEffect)(()=>{N?p.setError("ledgerConnected",{message:N.message}):p.clearErrors("ledgerConnected")},[p,N]);let[R,j]=(0,I.useState)({});(0,I.useEffect)(()=>{w&&y&&j({0:Aj(0)})},[w]);let b=(0,I.useCallback)(()=>{if(!e||!J)return;let A={...R};for(let Q=e.toNumber();Q{j(Q=>{let B={...Q};return delete B[A],B})},[]),T=(0,I.useCallback)(A=>{let{index:Q,address:B,publicKey:C}=A;j(A=>{let I={...A};return I[Q]={...I[Q],address:B,publicKey:C},I})},[j]),Z=(0,I.useMemo)(()=>{let A={};for(let[Q,{address:B,publicKey:C}]of Object.entries(R)){let I=null==h?void 0:h.find(A=>A.metadata.index===Number(Q));A[Q]={isNew:!I,index:Number(Q),address:(null==I?void 0:I.address)||B,publicKey:(null==I?void 0:I.metadata.unlockConditions.publicKeys[0])||C}}return A},[h,R]),O=(0,I.useMemo)(()=>Object.entries(Z).filter(A=>{let[Q,B]=A;return B.isNew&&B.address}).map(A=>{let[Q,B]=A;return B}),[Z]),v=(0,I.useCallback)(async()=>{let A=O.length;function Q(A,Q,B){(0,E.OHV)({title:"Error generating addresses",body:Q>0?"".concat(Q+1,"/").concat(A," addresses were generated and saved. Batch failed on with: ").concat(B):B})}for(let[B,{address:C,publicKey:I,index:E}]of O.entries()){let g=(0,n.K)().wallet.standardUnlockConditions(I);if(g.error){Q(A,B,g.error);return}let w={index:E,unlockConditions:g.unlockConditions},D=await u.put({params:{id:M},payload:{address:C,description:"",metadata:w}});if(D.error){Q(A,B,D.error);return}}1===A?(0,E.OPV)({title:"Added 1 address"}):(0,E.OPV)({title:"Added ".concat(A," addresses")})},[u,M,O]),{handleOpenChange:V,closeAndReset:z}=(0,E.t0Y)({form:p,onOpenChange:A=>{j({}),D(A)},defaultValues:r}),W=f(),P=(0,I.useCallback)(async A=>{O.length>0&&await v(),await W(A),z()},[O,v,z,W]);return(0,C.jsx)(E.VqE,{title:"Wallet ".concat(null==i?void 0:i.name,": generate addresses"),trigger:B,open:w,onOpenChange:V,contentVariants:{className:"w-[500px]"},onSubmit:p.handleSubmit(P),controls:(0,C.jsxs)("div",{className:"flex gap-1 justify-end",children:[(0,C.jsx)(E.zxk,{size:"medium",variant:"gray",onClick:z,children:"Close"}),(O.length>0||H)&&(0,C.jsx)(E.ZqQ,{form:p,size:"medium",variant:H?"red":"accent",children:O.length>0?"Save ".concat(O.length," ").concat(1===O.length?"address":"addresses").concat(H?" and rescan":""):"Rescan"})]}),children:(0,C.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,C.jsxs)(E.xvT,{children:["Wallet currently has ",t," ",1===t?"address":"addresses"," with a highest index of"," ",k,". Select a start index and the number of sequential addresses you would like to generate."]}),(0,C.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,C.jsx)(E.Qyk,{title:"Device",name:"ledgerConnected"}),(0,C.jsx)(E.cp7,{name:"ledgerConnected",form:p}),(0,C.jsx)(_,{})]}),(0,C.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,C.jsxs)("div",{className:"flex gap-2 w-full pt-3 items-end",children:[(0,C.jsx)("div",{className:"flex-1",children:(0,C.jsx)(E.jIp,{form:p,fields:Y,name:"index"})}),(0,C.jsx)("div",{className:"flex-1",children:(0,C.jsx)(E.jIp,{form:p,fields:Y,name:"count"})}),(0,C.jsx)(E.zxk,{onClick:b,children:"Add"})]}),(0,C.jsx)("div",{className:"flex flex-col gap-1",children:Object.entries(Z).map(A=>{let[Q,{address:B,isNew:I}]=A;return(0,C.jsx)(AR,{isNew:I,address:B,setAddress:T,index:Number(Q),remove:()=>m(Number(Q))},Q)})})]}),(0,C.jsx)(l,{form:p,fields:Y})]})})}function Am(A){let{trigger:Q,open:B,onOpenChange:g}=A,w=function(A){let{rescanStartHeight:Q}=A;return{...S({rescanStartHeight:Q}),shouldRescan:!0}}({rescanStartHeight:(0,d.n)().nodeBlockHeight}),D=(0,c.cI)({mode:"all",defaultValues:w}),{handleOpenChange:M,closeAndReset:s}=(0,E.t0Y)({form:D,onOpenChange:g,defaultValues:w}),y={...F()},h=f(),k=(0,I.useCallback)(async A=>{h(A),s()},[s,h]);return(0,C.jsx)(E.VqE,{title:"Rescan the blockchain",trigger:Q,open:B,onOpenChange:M,contentVariants:{className:"w-[500px]"},onSubmit:D.handleSubmit(k),controls:(0,C.jsx)("div",{className:"flex justify-end",children:(0,C.jsx)(E.ZqQ,{form:D,variant:"red",size:"medium",children:"Rescan"})}),children:(0,C.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,C.jsx)(E.nvN,{size:"14",children:"Rescan the blockchain from the specified start height to find any missing transaction activity across all wallets."}),(0,C.jsx)("div",{className:"w-[100px]",children:(0,C.jsx)(E.jIp,{form:D,fields:y,name:"rescanStartHeight"})}),(0,C.jsxs)("div",{className:"pt-2 flex flex-col gap-2",children:[(0,C.jsx)(H,{}),(0,C.jsx)(Y,{})]})]})})}let AT=(0,I.createContext)({}),AZ=()=>(0,I.useContext)(AT);function AO(A){let{children:Q}=A,B=function(){let[A,Q]=(0,I.useState)(),[B,C]=(0,I.useState)({}),E=(0,I.useCallback)((A,B)=>{C(Q=>({...Q,[A]:B})),Q(A)},[C,Q]),g=(0,I.useCallback)(()=>{C(Q=>({...Q,[A]:void 0})),Q(void 0)},[Q,C,A]),w=(0,I.useCallback)(A=>{A||g()},[g]);return{dialog:A,params:B,openDialog:E,confirm,closeDialog:g,onOpenChange:w}}();return(0,C.jsx)(AT.Provider,{value:B,children:Q})}function Av(){let{openDialog:A,onOpenChange:Q,closeDialog:B,dialog:I,params:w}=AZ(),M=(0,g.Wl)();return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Ad,{open:"settings"===I,onOpenChange:Q}),(0,C.jsx)(D,{open:"walletAddType"===I,params:w.walletAddType,onOpenChange:Q=>Q?A(I,w.walletAddType):B()}),(0,C.jsx)(K,{open:"walletAddNew"===I,params:w.walletAddNew,onOpenChange:Q=>Q?A(I,w.walletAddNew):B()}),(0,C.jsx)(AB,{open:"walletAddRecover"===I,params:w.walletAddRecover,onOpenChange:Q=>Q?A(I,w.walletAddRecover):B()}),(0,C.jsx)(AA,{open:"walletAddLedger"===I,params:w.walletAddLedger,onOpenChange:Q=>Q?A(I,w.walletAddLedger):B()}),(0,C.jsx)(AI,{open:"walletAddWatch"===I,params:w.walletAddWatch,onOpenChange:Q=>Q?A(I,w.walletAddWatch):B()}),(0,C.jsx)(u,{open:"walletAddressesGenerate"===I,params:w.walletAddressesGenerate,onOpenChange:Q=>Q?A(I,w.walletAddressesGenerate):B()}),(0,C.jsx)(Ab,{open:"walletLedgerAddressGenerate"===I,params:w.walletLedgerAddressGenerate,onOpenChange:Q=>Q?A(I,w.walletLedgerAddressGenerate):B()}),(0,C.jsx)(AM,{open:"walletAddressesAdd"===I,params:w.walletAddressesAdd,onOpenChange:Q=>Q?A(I,w.walletAddressesAdd):B()}),(0,C.jsx)(m,{open:"walletRemove"===I,params:w.walletRemove,onOpenChange:Q=>Q?A(I,w.walletRemove):B()}),(0,C.jsx)(O,{open:"walletUpdate"===I,params:w.walletUpdate,onOpenChange:Q=>Q?A(I,w.walletUpdate):B()}),(0,C.jsx)(Af,{open:"walletUnlock"===I,params:w.walletUnlock,onOpenChange:Q=>Q?A(I,w.walletUnlock):B()}),(0,C.jsx)(Am,{open:"walletsRescan"===I,params:w.walletsRescan,onOpenChange:Q=>Q?A(I,w.walletsRescan):B()}),(0,C.jsx)(T,{open:"addressUpdate"===I,params:w.addressUpdate,onOpenChange:Q=>Q?A(I,w.addressUpdate):B()}),(0,C.jsx)(As,{open:"addressRemove"===I,params:w.addressRemove,onOpenChange:Q=>Q?A(I,w.addressRemove):B()}),(0,C.jsx)(E.D_D,{open:"connectPeer"===I,params:w.connectPeer,connect:A=>M.post({payload:A}),onOpenChange:Q=>Q?A(I,w.connectPeer):B()}),(0,C.jsx)(Ao,{open:"walletSendSeed"===I,params:w.walletSendSeed,onOpenChange:Q=>Q?A(I,w.walletSendSeed):B()}),(0,C.jsx)(AY,{open:"walletSendLedger"===I,params:w.walletSendLedger,onOpenChange:Q=>Q?A(I,w.walletSendLedger):B()}),(0,C.jsx)(E.QHy,{open:"confirm"===I,params:w.confirm,onOpenChange:Q=>Q?A(I,w.confirm):B()})]})}},8714:function(A,Q,B){"use strict";B.d(Q,{Yl:function(){return L},hI:function(){return K}});var C=B(52322),I=B(27717),E=B(90670),g=B(2784);let w=["transactionId","type","height","timestamp","amount","fee"],D=[];var M=B(92581);let c=[{id:"transactionId",label:"transaction ID",category:"general",render:A=>{let{data:{id:Q},context:B}=A;return Q?(0,C.jsx)(I.XxW,{size:"12",value:Q,label:"transaction ID",type:"transaction",siascanUrl:B.siascanUrl}):null}},{id:"type",label:"type",category:"general",fixed:!0,render:A=>{let{data:{type:Q}}=A;return(0,C.jsx)(I.xvT,{weight:"medium",ellipsis:!0,children:Q})}},{id:"height",label:"height",category:"general",render:A=>{let{data:{height:Q,pending:B}}=A;return B?(0,C.jsx)(I.xvT,{size:"12",ellipsis:!0,children:(0,C.jsx)(I.xgg,{})}):Q?(0,C.jsx)(I.xvT,{size:"12",ellipsis:!0,children:Q.toLocaleString()}):null}},{id:"timestamp",label:"timestamp",category:"general",render:A=>{let{data:{timestamp:Q,pending:B}}=A;return B?(0,C.jsx)(I.xvT,{size:"12",ellipsis:!0,children:(0,C.jsx)(I.xgg,{})}):(0,C.jsx)(I.xvT,{size:"12",ellipsis:!0,children:(0,M.rN)(Q,{timeStyle:"short"})})}},{id:"amount",label:"amount",category:"general",contentClassName:"w-[120px] justify-end",render:A=>{let{data:{amountSc:Q,amountSf:B}}=A;return Q?(0,C.jsxs)("div",{className:"flex flex-col gap-2 items-end",children:[!Q.isZero()&&(0,C.jsx)(I.ho9,{displayBoth:!0,size:"12",value:Q}),!!B&&(0,C.jsx)(I.Sby,{size:"12",value:B})]}):null}},{id:"fee",label:"fee",category:"general",contentClassName:"w-[120px] justify-end",render:A=>{let{data:{fee:Q}}=A;return Q?(0,C.jsx)(I.ho9,{displayBoth:!0,size:"12",variant:"value",value:Q}):null}},{id:"contractId",label:"contract ID",category:"general",render:A=>{let{data:{contractId:Q},context:B}=A;return Q?(0,C.jsx)(I.XxW,{size:"12",value:Q,label:"contract ID",siascanUrl:B.siascanUrl}):null}}];var s=B(5632),y=B(6391),h=B.n(y),k=B(74667),n=B(9338);let t=(0,g.createContext)({}),K=()=>(0,g.useContext)(t);function L(A){let{children:Q}=A,B=function(){let A=(0,s.useRouter)(),Q=A.query.id,B=Number(A.query.limit||100),C=Number(A.query.offset||0),{filters:M,setFilter:y,removeFilter:t,removeLastFilter:K,resetFilters:L}=(0,I.Uu5)(),U=(0,E.jy)({disabled:!Q,params:{id:Q},config:{swr:{refreshInterval:n.h}}}),i=(0,E.sG)({disabled:!Q,params:{limit:B,offset:C,id:Q},config:{swr:{refreshInterval:n.h}}}),G=(0,g.useMemo)(()=>{if(!i.data||!U.data)return null;let A=U.data.map(A=>({id:A.id,timestamp:0,pending:!0,type:A.type,amount:new(h())(A.received).minus(A.sent)})),Q=i.data.map((A,Q)=>{let B=new(h())(0),C=0;if("transaction"===A.type){var I,E,g,w,D,M,c,s;let Q=(null===(E=A.val)||void 0===E?void 0:null===(I=E.siacoinInputs)||void 0===I?void 0:I.reduce((Q,B)=>A.relevant.includes(B.siacoinOutput.address)?Q.plus(B.siacoinOutput.value):Q,new(h())(0)))||new(h())(0);B=((null===(w=A.val)||void 0===w?void 0:null===(g=w.siacoinOutputs)||void 0===g?void 0:g.reduce((Q,B)=>A.relevant.includes(B.siacoinOutput.address)?Q.plus(B.siacoinOutput.value):Q,new(h())(0)))||new(h())(0)).minus(Q);let y=(null===(M=A.val)||void 0===M?void 0:null===(D=M.siafundInputs)||void 0===D?void 0:D.reduce((Q,B)=>A.relevant.includes(B.siafundElement.siafundOutput.address)?Q+B.siafundElement.siafundOutput.value:Q,0))||0;C=((null===(s=A.val)||void 0===s?void 0:null===(c=s.siafundOutputs)||void 0===c?void 0:c.reduce((Q,B)=>A.relevant.includes(B.siafundOutput.address)?Q+B.siafundOutput.value:Q,0))||0)-y}"miner payout"===A.type&&(B=new(h())(A.val.siacoinOutput.siacoinOutput.value)),"foundation subsidy"===A.type&&(B=new(h())(A.val.siacoinOutput.siacoinOutput.value));let y={id:A.id,type:A.type,timestamp:new Date(A.timestamp).getTime(),height:A.index.height,pending:!1,amountSc:B,amountSf:C};return"transaction"===A.type&&(y.fee=new(h())(A.val.fee)),"contract payout"===A.type&&(y.contractId=A.val.fileContract.id),y});return[...A.reverse(),...Q]},[i.data,U.data]),{configurableColumns:r,enabledColumns:p,sortableColumns:a,toggleColumnVisibility:N,setColumnsVisible:o,setColumnsHidden:e,toggleSort:J,setSortDirection:F,setSortField:S,sortField:l,sortDirection:H,resetDefaultColumnVisibility:Y}=(0,I.oy6)("walletd/v0/events",{columns:c,columnsDefaultVisible:w,sortOptions:D,defaultSortField:"id"}),f=(0,g.useMemo)(()=>c.filter(A=>A.fixed||p.includes(A.id)),[p]),d=i.isValidating||U.isValidating,u=i.error||U.error,R=(0,I.c2j)(G,d,u,M),j=(0,k.B)(),b=(0,g.useMemo)(()=>({siascanUrl:j}),[j]);return{dataState:R,error:i.error,pageCount:(null==G?void 0:G.length)||0,columns:f,dataset:G,cellContext:b,configurableColumns:r,enabledColumns:p,sortableColumns:a,toggleColumnVisibility:N,setColumnsVisible:o,setColumnsHidden:e,toggleSort:J,setSortDirection:F,setSortField:S,sortField:l,sortDirection:H,resetDefaultColumnVisibility:Y,filters:M,setFilter:y,removeFilter:t,removeLastFilter:K,resetFilters:L,offset:C,limit:B}}();return(0,C.jsx)(t.Provider,{value:B,children:Q})}},16694:function(A,Q,B){"use strict";B.d(Q,{c:function(){return c},d:function(){return s}});var C=B(52322),I=B(73866),E=B(27748),g=B(35415),w=B.n(g),D=B(2784);let M=(0,D.createContext)({}),c=()=>(0,D.useContext)(M);function s(A){let{children:Q}=A,B=function(){let[A,Q]=(0,D.useState)(!1),[B,C]=(0,D.useState)(),[g,M]=(0,D.useState)(),c=(0,D.useCallback)(()=>{if(B){try{B.sia.close(),M(void 0)}catch(A){console.log(A)}C(void 0)}},[B]),s=(0,D.useCallback)(async A=>{let B=null;Q(!0);try{switch(A){case"HID":(B=await E.Z.openConnected())||(B=await E.Z.create());break;case"Bluetooth":B=await I.Z.create();break;default:throw Error("Unsupported transport method: ".concat(A))}if(B){M(void 0);let I=new(w())(B);C({type:A,sia:I,transport:B}),Q(!1)}}catch(A){M(A),Q(!1)}},[]),y=(0,D.useCallback)(async()=>{if(!B){M(Error("No device connected"));return}Q(!0);try{let A=await B.sia.verifyPublicKey(0);return M(void 0),C(Q=>({...Q,publicKey0:A.publicKey,address0:A.address})),Q(!1),A}catch(A){Q(!1),M(A)}},[B]);return(0,D.useEffect)(()=>{if(!(null==B?void 0:B.transport))return;let A=setInterval(async()=>{(null==B?void 0:B.transport._disconnectEmitted)&&C(void 0)},2e3);return()=>clearInterval(A)},[null==B?void 0:B.transport]),{connect:s,verify:y,disconnect:c,device:B,error:g,setError:M,waitingForUser:A}}();return(0,C.jsx)(M.Provider,{value:B,children:Q})}},23312:function(A,Q,B){"use strict";B.d(Q,{k:function(){return N},r:function(){return a}});var C=B(52322),I=B(27717),E=B(90670),g=B(2784),w=B(26249),D=B(3208),M=B(92581),c=B(3584),s=B(36350),y=B(6391),h=B.n(y),k=B(12172);let n=[{id:"actions",label:"",fixed:!0,cellClassName:"w-[50px] !pl-2 !pr-4 [&+*]:!pl-0",render:A=>{let{data:Q}=A;return(0,C.jsx)(k.g,{trigger:(0,C.jsx)(I.zxk,{variant:"ghost",icon:"hover",children:(0,C.jsx)(D.EMN,{})}),contentProps:{align:"start"},wallet:Q})}},{id:"details",label:"name",category:"general",fixed:!0,render:A=>{let{data:{id:Q,name:B,description:E}}=A;return(0,C.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,C.jsx)(I.xvT,{weight:"bold",ellipsis:!0,children:B||Q}),E&&(0,C.jsx)(I.ua7,{content:(0,C.jsx)("pre",{children:(0,C.jsx)(I.nvN,{size:"12",className:"w-full whitespace-pre-wrap",children:E})}),children:(0,C.jsx)(I.nvN,{size:"12",children:E.split("\n")[0]})})]})}},{id:"balance",label:"balance",category:"general",contentClassName:"justify-end",render:function(A){let{data:{id:Q}}=A,B=(0,E.tM)({params:{id:Q}});return B.data?(0,C.jsxs)("div",{className:"flex flex-col gap-2 items-end",children:[(0,C.jsx)(I.ho9,{displayBoth:!0,size:"12",variant:"value",value:new(h())(B.data.siacoins)}),!!B.data.siafunds&&(0,C.jsx)(I.Sby,{size:"12",variant:"value",value:B.data.siafunds})]}):null}},{id:"type",label:"type",category:"general",render:A=>{var Q,B;let{data:{metadata:{type:E}}}=A;return(0,C.jsx)(I.ua7,{content:null===(Q=s._[E])||void 0===Q?void 0:Q.title,children:(0,C.jsxs)(I.Cts,{interactive:!1,className:"flex gap-0.5 items-center",children:[(0,C.jsx)(I.xvT,{color:"subtle",className:"scale-75 relative top-px",children:null===(B=s._[E])||void 0===B?void 0:B.icon}),E]})})}},{id:"status",label:"status",category:"general",render:A=>{let{data:Q,context:{walletAutoLockEnabled:B,walletAutoLockTimeout:E}}=A,{type:g}=Q.metadata,{status:w,activityAt:M}=Q.state,{unlock:s,lock:y}=Q.actions;if("seed"===g){let A=new Date().getTime()-M,Q=(0,c.l)(Math.max(E-A,0)),g=B?"The wallet is currently unlocked. The wallet will stay unlocked until it is inactive for ".concat(Q.amount.toFixed(0)," more ").concat(Q.units,", manually locked, or the app is closed."):"The wallet is currently unlocked. The wallet will stay unlocked until it is manually locked or the app is closed.";return(0,C.jsx)(I.zxk,{tip:"unlocked"===w?g:"The wallet is currently locked.",color:"unlocked"===w?"contrast":"verySubtle",variant:"ghost",onClick:A=>{A.stopPropagation(),"unlocked"===w?y():s()},children:"unlocked"===w?(0,C.jsx)(D.VmF,{}):(0,C.jsx)(D.Lur,{})})}return null}},{id:"createdAt",label:"created on",category:"general",render:A=>{let{data:{createdAt:Q}}=A;return Q?(0,C.jsx)(I.xvT,{size:"12",children:(0,M.rN)(Q,{dateStyle:"medium"})}):null}}];var t=B(5632),K=B(98334),L=B(27429),U=B(92762),i=B(5137),G=B(67108),r=B(9338);let p=(0,g.createContext)({}),a=()=>(0,g.useContext)(p);function N(A){let{children:Q}=A,B=function(){let A=(0,E.rB)({config:{swr:{refreshInterval:r.h}}}),Q=(0,t.useRouter)(),{openDialog:B}=(0,i.Rh)(),{setOnLockCallback:C}=(0,G.Hv)(),{mnemonicCache:D,walletActivityAt:M,cacheWalletMnemonic:c,cachedMnemonicCount:s,lockAllWallets:y,walletAutoLockTimeout:h,setWalletAutoLockTimeout:k,setWalletAutoLockEnabled:p,walletAutoLockEnabled:a}=function(){let[A,Q]=(0,U.Z)("v0/wallets/walletAutoLockEnabled",{defaultValue:!0}),[B,C]=(0,U.Z)("v0/wallets/walletAutoLockTimeout",{defaultValue:(0,I.sWj)(5)}),[E,w]=(0,g.useState)({}),[D,M]=(0,g.useState)({}),c=(0,g.useMemo)(()=>Object.keys(D).length,[D]),s=(0,g.useCallback)(A=>{w(Q=>({...Q,[A]:new Date().getTime()}))},[w]),y=(0,g.useCallback)((A,Q)=>{M(B=>({...B,[A]:Q})),Q&&s(A)},[M,s]),h=(0,g.useCallback)(()=>{if(!A)return;let Q=new Date().getTime()-B;for(let[A,B]of Object.entries(D))B&&(E[A]||0){M({})},[M]),n=(0,t.useRouter)(),i=(0,g.useCallback)(()=>{n.pathname.startsWith(K._.wallet.base)&&s(n.query.id)},[n,s]);return(0,L.Yp)({onAction:i,throttle:5e3,eventsThrottle:5e3}),(0,g.useEffect)(()=>{if(!A)return;let Q=setInterval(()=>{h()},5e3);return()=>{clearInterval(Q)}},[A]),{walletActivityAt:E,updateWalletActivityAt:s,mnemonicCache:D,cacheWalletMnemonic:y,lockAllWallets:k,cachedMnemonicCount:c,walletAutoLockTimeout:B,setWalletAutoLockTimeout:C,setWalletAutoLockEnabled:Q,walletAutoLockEnabled:A}}();(0,g.useEffect)(()=>{C("wallets",()=>{y()})},[]);let N=(0,g.useMemo)(()=>A.data?A.data.map(A=>{let{id:C,name:I,description:E,dateCreated:g,lastUpdated:w,metadata:s}=A;return{id:C,name:I,description:E,createdAt:new Date(g).getTime()||0,updatedAt:new Date(w).getTime()||0,metadata:s||{},raw:A,state:{mnemonic:D[C],status:D[C]?"unlocked":"locked",activityAt:M[C]},actions:{unlock:()=>B("walletUnlock",{walletId:C}),lock:()=>c(C,void 0)},onClick:()=>Q.push({pathname:K._.wallet.view,query:{id:C}})}}):null,[Q,A.data,D,M,B,c]),o=null==N?void 0:N.find(A=>A.id===Q.query.id),{filters:e,setFilter:J,removeFilter:F,removeLastFilter:S,resetFilters:l}=(0,I.Wdu)(),{configurableColumns:H,enabledColumns:Y,sortableColumns:f,toggleColumnVisibility:d,setColumnsVisible:u,setColumnsHidden:R,toggleSort:j,setSortDirection:b,setSortField:m,sortField:T,sortDirection:Z,resetDefaultColumnVisibility:O}=(0,I.oy6)("walletd/v0/wallets",{columns:n,columnsDefaultVisible:w.gd,sortOptions:w.Fo,defaultSortField:w.nw}),v=(0,I._4u)({dataset:N,filters:e,sortField:T,sortDirection:Z}),x=(0,g.useMemo)(()=>n.filter(A=>A.fixed||Y.includes(A.id)),[Y]),V=(0,I.c2j)(N,A.isValidating,A.error,e),z=(0,g.useMemo)(()=>({walletAutoLockTimeout:h,walletAutoLockEnabled:a}),[a,h]);return{dataState:V,error:A.error,datasetCount:(null==v?void 0:v.length)||0,unlockedCount:s,columns:x,dataset:v,context:z,wallet:o,configurableColumns:H,enabledColumns:Y,sortableColumns:f,toggleColumnVisibility:d,setColumnsVisible:u,setColumnsHidden:R,toggleSort:j,setSortDirection:b,setSortField:m,sortField:T,filters:e,setFilter:J,removeFilter:F,removeLastFilter:S,resetFilters:l,sortDirection:Z,resetDefaultColumnVisibility:O,cacheWalletMnemonic:c,lockAllWallets:y,walletAutoLockTimeout:h,setWalletAutoLockTimeout:k,setWalletAutoLockEnabled:p,walletAutoLockEnabled:a}}();return(0,C.jsx)(p.Provider,{value:B,children:Q})}},26249:function(A,Q,B){"use strict";B.d(Q,{Fo:function(){return E},gd:function(){return C},nw:function(){return I}});let C=["actions","details","balance","type","status","createdAt"],I="name",E=[{id:"name",label:"name",category:"general"},{id:"type",label:"type",category:"general"},{id:"status",label:"status",category:"general"},{id:"createdAt",label:"created on",category:"general"}]},74667:function(A,Q,B){"use strict";B.d(Q,{B:function(){return E}});var C=B(27717),I=B(90670);function E(){var A;return(null===(A=(0,I.gM)().data)||void 0===A?void 0:A.name)==="zen"?C.nNd.explore.testnetZen:C.nNd.explore.mainnet}},38855:function(A,Q,B){"use strict";B.d(Q,{n:function(){return g}});var C=B(27717),I=B(67108),E=B(90670);function g(){var A;let{isUnlockedAndAuthedRoute:Q}=(0,I.Hv)(),B=(0,E.XC)({config:{swr:{refreshInterval:1e4}}}),C=(0,E.ek)({config:{swr:{refreshInterval:A=>w(A)?6e4:1e4}}}),g=(0,E.nH)(),D=B.data?null===(A=B.data)||void 0===A?void 0:A.height:0,M=Q&&D&&g?Number((100*Math.min(D/g,1)).toFixed(1)):0;return{isSynced:w(C.data),nodeBlockHeight:D,estimatedBlockHeight:g,syncPercent:M,moreThan100BlocksToSync:!!D&&!!g&&g-D>100,firstTimeSyncing:!!D&&!!g&&g-D>5e4}}function w(A){return!!A&&function(A){if(!A||!A.length)return!1;let Q=A[0],B=Date.now()-(0,C.ytg)(2);return new Date(Q).getTime()>B}(A.prevTimestamps)}},3584:function(A,Q,B){"use strict";function C(A){return!A||A<1e3?{amount:0,units:"seconds"}:(A/=1e3)<60?{amount:Math.floor(100*A)/100,units:"seconds"}:{amount:Math.floor(A/60*100)/100,units:"minutes"}}B.d(Q,{l:function(){return C}})},6723:function(A,Q,B){"use strict";B.r(Q),B.d(Q,{default:function(){return AA}});var C=B(52322);B(50521);var I=B(27717),E=B(5137),g=B(2784),w=B(23312),D=B(58723),M=B(8714),c=B(16694),s=B(48869);let y=(0,g.createContext)({});function h(A){let{children:Q}=A,B=((0,g.useEffect)(()=>{(async()=>{await (0,s.x)()})()},[]),{});return(0,C.jsx)(y.Provider,{value:B,children:Q})}var k=B(90670),n=B(38855),t=B(1645),K=B(66700),L=B(19785);function U(A){(0,L.Z)(1,arguments);var Q=(0,K.Z)(A);return Q.setHours(0,0,0,0),Q}var i=B(88811);function G(A){if(null===A||!0===A||!1===A)return NaN;var Q=Number(A);return isNaN(Q)?Q:Q<0?Math.ceil(Q):Math.floor(Q)}function r(A,Q){return(0,L.Z)(2,arguments),function(A,Q){return(0,L.Z)(2,arguments),new Date((0,K.Z)(A).getTime()+G(Q))}(A,-G(Q))}function p(A){(0,L.Z)(1,arguments);var Q=(0,K.Z)(A),B=Q.getUTCDay();return Q.setUTCDate(Q.getUTCDate()-((B<1?7:0)+B-1)),Q.setUTCHours(0,0,0,0),Q}function a(A){(0,L.Z)(1,arguments);var Q=(0,K.Z)(A),B=Q.getUTCFullYear(),C=new Date(0);C.setUTCFullYear(B+1,0,4),C.setUTCHours(0,0,0,0);var I=p(C),E=new Date(0);E.setUTCFullYear(B,0,4),E.setUTCHours(0,0,0,0);var g=p(E);return Q.getTime()>=I.getTime()?B+1:Q.getTime()>=g.getTime()?B:B-1}function N(A,Q){(0,L.Z)(1,arguments);var B=Q||{},C=B.locale,I=C&&C.options&&C.options.weekStartsOn,E=null==I?0:G(I),g=null==B.weekStartsOn?E:G(B.weekStartsOn);if(!(g>=0&&g<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");var w=(0,K.Z)(A),D=w.getUTCDay();return w.setUTCDate(w.getUTCDate()-((D=1&&D<=7))throw RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var M=new Date(0);M.setUTCFullYear(C+1,0,D),M.setUTCHours(0,0,0,0);var c=N(M,Q),s=new Date(0);s.setUTCFullYear(C,0,D),s.setUTCHours(0,0,0,0);var y=N(s,Q);return B.getTime()>=c.getTime()?C+1:B.getTime()>=y.getTime()?C:C-1}function e(A,Q){for(var B=Math.abs(A).toString();B.length0?B:1-B;return e("yy"===Q?C%100:C,Q.length)},M:function(A,Q){var B=A.getUTCMonth();return"M"===Q?String(B+1):e(B+1,2)},d:function(A,Q){return e(A.getUTCDate(),Q.length)},a:function(A,Q){var B=A.getUTCHours()/12>=1?"pm":"am";switch(Q){case"a":case"aa":return B.toUpperCase();case"aaa":return B;case"aaaaa":return B[0];default:return"am"===B?"a.m.":"p.m."}},h:function(A,Q){return e(A.getUTCHours()%12||12,Q.length)},H:function(A,Q){return e(A.getUTCHours(),Q.length)},m:function(A,Q){return e(A.getUTCMinutes(),Q.length)},s:function(A,Q){return e(A.getUTCSeconds(),Q.length)},S:function(A,Q){var B=Q.length;return e(Math.floor(A.getUTCMilliseconds()*Math.pow(10,B-3)),Q.length)}},F={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"};function S(A,Q){var B=A>0?"-":"+",C=Math.abs(A),I=Math.floor(C/60),E=C%60;return 0===E?B+String(I):B+String(I)+(Q||"")+e(E,2)}function l(A,Q){return A%60==0?(A>0?"-":"+")+e(Math.abs(A)/60,2):H(A,Q)}function H(A,Q){var B=Math.abs(A);return(A>0?"-":"+")+e(Math.floor(B/60),2)+(Q||"")+e(B%60,2)}var Y={G:function(A,Q,B){var C=A.getUTCFullYear()>0?1:0;switch(Q){case"G":case"GG":case"GGG":return B.era(C,{width:"abbreviated"});case"GGGGG":return B.era(C,{width:"narrow"});default:return B.era(C,{width:"wide"})}},y:function(A,Q,B){if("yo"===Q){var C=A.getUTCFullYear();return B.ordinalNumber(C>0?C:1-C,{unit:"year"})}return J.y(A,Q)},Y:function(A,Q,B,C){var I=o(A,C),E=I>0?I:1-I;return"YY"===Q?e(E%100,2):"Yo"===Q?B.ordinalNumber(E,{unit:"year"}):e(E,Q.length)},R:function(A,Q){return e(a(A),Q.length)},u:function(A,Q){return e(A.getUTCFullYear(),Q.length)},Q:function(A,Q,B){var C=Math.ceil((A.getUTCMonth()+1)/3);switch(Q){case"Q":return String(C);case"QQ":return e(C,2);case"Qo":return B.ordinalNumber(C,{unit:"quarter"});case"QQQ":return B.quarter(C,{width:"abbreviated",context:"formatting"});case"QQQQQ":return B.quarter(C,{width:"narrow",context:"formatting"});default:return B.quarter(C,{width:"wide",context:"formatting"})}},q:function(A,Q,B){var C=Math.ceil((A.getUTCMonth()+1)/3);switch(Q){case"q":return String(C);case"qq":return e(C,2);case"qo":return B.ordinalNumber(C,{unit:"quarter"});case"qqq":return B.quarter(C,{width:"abbreviated",context:"standalone"});case"qqqqq":return B.quarter(C,{width:"narrow",context:"standalone"});default:return B.quarter(C,{width:"wide",context:"standalone"})}},M:function(A,Q,B){var C=A.getUTCMonth();switch(Q){case"M":case"MM":return J.M(A,Q);case"Mo":return B.ordinalNumber(C+1,{unit:"month"});case"MMM":return B.month(C,{width:"abbreviated",context:"formatting"});case"MMMMM":return B.month(C,{width:"narrow",context:"formatting"});default:return B.month(C,{width:"wide",context:"formatting"})}},L:function(A,Q,B){var C=A.getUTCMonth();switch(Q){case"L":return String(C+1);case"LL":return e(C+1,2);case"Lo":return B.ordinalNumber(C+1,{unit:"month"});case"LLL":return B.month(C,{width:"abbreviated",context:"standalone"});case"LLLLL":return B.month(C,{width:"narrow",context:"standalone"});default:return B.month(C,{width:"wide",context:"standalone"})}},w:function(A,Q,B,C){var I=function(A,Q){(0,L.Z)(1,arguments);var B=(0,K.Z)(A);return Math.round((N(B,Q).getTime()-(function(A,Q){(0,L.Z)(1,arguments);var B=Q||{},C=B.locale,I=C&&C.options&&C.options.firstWeekContainsDate,E=null==I?1:G(I),g=null==B.firstWeekContainsDate?E:G(B.firstWeekContainsDate),w=o(A,Q),D=new Date(0);return D.setUTCFullYear(w,0,g),D.setUTCHours(0,0,0,0),N(D,Q)})(B,Q).getTime())/6048e5)+1}(A,C);return"wo"===Q?B.ordinalNumber(I,{unit:"week"}):e(I,Q.length)},I:function(A,Q,B){var C=function(A){(0,L.Z)(1,arguments);var Q=(0,K.Z)(A);return Math.round((p(Q).getTime()-(function(A){(0,L.Z)(1,arguments);var Q=a(A),B=new Date(0);return B.setUTCFullYear(Q,0,4),B.setUTCHours(0,0,0,0),p(B)})(Q).getTime())/6048e5)+1}(A);return"Io"===Q?B.ordinalNumber(C,{unit:"week"}):e(C,Q.length)},d:function(A,Q,B){return"do"===Q?B.ordinalNumber(A.getUTCDate(),{unit:"date"}):J.d(A,Q)},D:function(A,Q,B){var C=function(A){(0,L.Z)(1,arguments);var Q=(0,K.Z)(A),B=Q.getTime();return Q.setUTCMonth(0,1),Q.setUTCHours(0,0,0,0),Math.floor((B-Q.getTime())/864e5)+1}(A);return"Do"===Q?B.ordinalNumber(C,{unit:"dayOfYear"}):e(C,Q.length)},E:function(A,Q,B){var C=A.getUTCDay();switch(Q){case"E":case"EE":case"EEE":return B.day(C,{width:"abbreviated",context:"formatting"});case"EEEEE":return B.day(C,{width:"narrow",context:"formatting"});case"EEEEEE":return B.day(C,{width:"short",context:"formatting"});default:return B.day(C,{width:"wide",context:"formatting"})}},e:function(A,Q,B,C){var I=A.getUTCDay(),E=(I-C.weekStartsOn+8)%7||7;switch(Q){case"e":return String(E);case"ee":return e(E,2);case"eo":return B.ordinalNumber(E,{unit:"day"});case"eee":return B.day(I,{width:"abbreviated",context:"formatting"});case"eeeee":return B.day(I,{width:"narrow",context:"formatting"});case"eeeeee":return B.day(I,{width:"short",context:"formatting"});default:return B.day(I,{width:"wide",context:"formatting"})}},c:function(A,Q,B,C){var I=A.getUTCDay(),E=(I-C.weekStartsOn+8)%7||7;switch(Q){case"c":return String(E);case"cc":return e(E,Q.length);case"co":return B.ordinalNumber(E,{unit:"day"});case"ccc":return B.day(I,{width:"abbreviated",context:"standalone"});case"ccccc":return B.day(I,{width:"narrow",context:"standalone"});case"cccccc":return B.day(I,{width:"short",context:"standalone"});default:return B.day(I,{width:"wide",context:"standalone"})}},i:function(A,Q,B){var C=A.getUTCDay(),I=0===C?7:C;switch(Q){case"i":return String(I);case"ii":return e(I,Q.length);case"io":return B.ordinalNumber(I,{unit:"day"});case"iii":return B.day(C,{width:"abbreviated",context:"formatting"});case"iiiii":return B.day(C,{width:"narrow",context:"formatting"});case"iiiiii":return B.day(C,{width:"short",context:"formatting"});default:return B.day(C,{width:"wide",context:"formatting"})}},a:function(A,Q,B){var C=A.getUTCHours()/12>=1?"pm":"am";switch(Q){case"a":case"aa":return B.dayPeriod(C,{width:"abbreviated",context:"formatting"});case"aaa":return B.dayPeriod(C,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return B.dayPeriod(C,{width:"narrow",context:"formatting"});default:return B.dayPeriod(C,{width:"wide",context:"formatting"})}},b:function(A,Q,B){var C,I=A.getUTCHours();switch(C=12===I?F.noon:0===I?F.midnight:I/12>=1?"pm":"am",Q){case"b":case"bb":return B.dayPeriod(C,{width:"abbreviated",context:"formatting"});case"bbb":return B.dayPeriod(C,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return B.dayPeriod(C,{width:"narrow",context:"formatting"});default:return B.dayPeriod(C,{width:"wide",context:"formatting"})}},B:function(A,Q,B){var C,I=A.getUTCHours();switch(C=I>=17?F.evening:I>=12?F.afternoon:I>=4?F.morning:F.night,Q){case"B":case"BB":case"BBB":return B.dayPeriod(C,{width:"abbreviated",context:"formatting"});case"BBBBB":return B.dayPeriod(C,{width:"narrow",context:"formatting"});default:return B.dayPeriod(C,{width:"wide",context:"formatting"})}},h:function(A,Q,B){if("ho"===Q){var C=A.getUTCHours()%12;return 0===C&&(C=12),B.ordinalNumber(C,{unit:"hour"})}return J.h(A,Q)},H:function(A,Q,B){return"Ho"===Q?B.ordinalNumber(A.getUTCHours(),{unit:"hour"}):J.H(A,Q)},K:function(A,Q,B){var C=A.getUTCHours()%12;return"Ko"===Q?B.ordinalNumber(C,{unit:"hour"}):e(C,Q.length)},k:function(A,Q,B){var C=A.getUTCHours();return(0===C&&(C=24),"ko"===Q)?B.ordinalNumber(C,{unit:"hour"}):e(C,Q.length)},m:function(A,Q,B){return"mo"===Q?B.ordinalNumber(A.getUTCMinutes(),{unit:"minute"}):J.m(A,Q)},s:function(A,Q,B){return"so"===Q?B.ordinalNumber(A.getUTCSeconds(),{unit:"second"}):J.s(A,Q)},S:function(A,Q){return J.S(A,Q)},X:function(A,Q,B,C){var I=(C._originalDate||A).getTimezoneOffset();if(0===I)return"Z";switch(Q){case"X":return l(I);case"XXXX":case"XX":return H(I);default:return H(I,":")}},x:function(A,Q,B,C){var I=(C._originalDate||A).getTimezoneOffset();switch(Q){case"x":return l(I);case"xxxx":case"xx":return H(I);default:return H(I,":")}},O:function(A,Q,B,C){var I=(C._originalDate||A).getTimezoneOffset();switch(Q){case"O":case"OO":case"OOO":return"GMT"+S(I,":");default:return"GMT"+H(I,":")}},z:function(A,Q,B,C){var I=(C._originalDate||A).getTimezoneOffset();switch(Q){case"z":case"zz":case"zzz":return"GMT"+S(I,":");default:return"GMT"+H(I,":")}},t:function(A,Q,B,C){return e(Math.floor((C._originalDate||A).getTime()/1e3),Q.length)},T:function(A,Q,B,C){return e((C._originalDate||A).getTime(),Q.length)}};function f(A,Q){switch(A){case"P":return Q.date({width:"short"});case"PP":return Q.date({width:"medium"});case"PPP":return Q.date({width:"long"});default:return Q.date({width:"full"})}}function d(A,Q){switch(A){case"p":return Q.time({width:"short"});case"pp":return Q.time({width:"medium"});case"ppp":return Q.time({width:"long"});default:return Q.time({width:"full"})}}var u={p:d,P:function(A,Q){var B,C=A.match(/(P+)(p+)?/)||[],I=C[1],E=C[2];if(!E)return f(A,Q);switch(I){case"P":B=Q.dateTime({width:"short"});break;case"PP":B=Q.dateTime({width:"medium"});break;case"PPP":B=Q.dateTime({width:"long"});break;default:B=Q.dateTime({width:"full"})}return B.replace("{{date}}",f(I,Q)).replace("{{time}}",d(E,Q))}},R=["D","DD"],j=["YY","YYYY"];function b(A,Q,B){if("YYYY"===A)throw RangeError("Use `yyyy` instead of `YYYY` (in `".concat(Q,"`) for formatting years to the input `").concat(B,"`; see: https://git.io/fxCyr"));if("YY"===A)throw RangeError("Use `yy` instead of `YY` (in `".concat(Q,"`) for formatting years to the input `").concat(B,"`; see: https://git.io/fxCyr"));if("D"===A)throw RangeError("Use `d` instead of `D` (in `".concat(Q,"`) for formatting days of the month to the input `").concat(B,"`; see: https://git.io/fxCyr"));if("DD"===A)throw RangeError("Use `dd` instead of `DD` (in `".concat(Q,"`) for formatting days of the month to the input `").concat(B,"`; see: https://git.io/fxCyr"))}var m=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,T=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Z=/^'([^]*?)'?$/,O=/''/g,v=/[a-zA-Z]/,x=B(9338);function V(){let A=(0,n.n)(),Q=(0,k.R2)({config:{swr:{refreshInterval:x.h}}});if(!Q.data)return null;let B=Q.data.index.height=1&&D<=7))throw RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var M=E.options&&E.options.weekStartsOn,c=null==M?0:G(M),s=null==I.weekStartsOn?c:G(I.weekStartsOn);if(!(s>=0&&s<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!E.localize)throw RangeError("locale must contain localize property");if(!E.formatLong)throw RangeError("locale must contain formatLong property");var y=(0,K.Z)(A);if(!function(A){return(0,L.Z)(1,arguments),(!!function(A){return(0,L.Z)(1,arguments),A instanceof Date||"object"==typeof A&&"[object Date]"===Object.prototype.toString.call(A)}(A)||"number"==typeof A)&&!isNaN(Number((0,K.Z)(A)))}(y))throw RangeError("Invalid time value");var h=(0,t.Z)(y),k=r(y,h),n={firstWeekContainsDate:D,weekStartsOn:s,locale:E,_originalDate:y};return C.match(T).map(function(A){var Q=A[0];return"p"===Q||"P"===Q?(0,u[Q])(A,E.formatLong,n):A}).join("").match(m).map(function(B){if("''"===B)return"'";var C=B[0];if("'"===C)return B.match(Z)[1].replace(O,"'");var g=Y[C];if(g)return I.useAdditionalWeekYearTokens||-1===j.indexOf(B)||b(B,Q,A),I.useAdditionalDayOfYearTokens||-1===R.indexOf(B)||b(B,Q,A),g(k,B,E.localize,n);if(C.match(v))throw RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");return B}).join("")}(C,w.formatRelative(c<-6?"other":c<-1?"lastWeek":c<0?"yesterday":c<1?"today":c<2?"tomorrow":c<7?"nextWeek":"other",s,y,{locale:w,weekStartsOn:M}),{locale:w,weekStartsOn:M})}(new Date(Q.data.startTime),new Date)]})]}),Q.data.error&&(0,C.jsx)("div",{className:"flex flex-col gap-1 overflow-hidden pt-1",children:(0,C.jsx)(I.xvT,{color:"contrast",size:"12",children:Q.data.error})})]})}):null}function z(A){let{children:Q}=A;return(0,C.jsx)(h,{children:(0,C.jsx)(E.Tu,{children:(0,C.jsx)(c.d,{children:(0,C.jsx)(w.k,{children:(0,C.jsx)(D.OZ,{children:(0,C.jsxs)(M.Yl,{children:[(0,C.jsx)(E.xQ,{}),(0,C.jsx)(V,{}),Q]})})})})})})}var W=B(98334),P=B(46058),q=B.n(P),X=B(28863),_=B.n(X);let $=(0,B(82851).cx)(q().variable,_().variable);function AA(A){let{Component:Q,pageProps:B}=A;return(0,C.jsx)(I.PD$,{className:$,fallback:B.fallback,passwordProtectRequestHooks:!0,lockRoutes:W._,children:(0,C.jsx)(z,{children:(0,C.jsx)(Q,{...B})})})}},27717:function(A,Q,B){"use strict";let C,I,E,g,w;B.d(Q,{bZj:function(){return D8},tU3:function(){return e_},zXq:function(){return Jl},juT:function(){return ex},Cts:function(){return MI},WVB:function(){return yF},zxk:function(){return D_},EKh:function(){return Mg},QHy:function(){return lN},HfT:function(){return lJ},ncR:function(){return NO},VqE:function(){return sQ},h_2:function(){return yf},Xiv:function(){return yd},Juw:function(){return yu},KpP:function(){return yR},cp7:function(){return Nx},Qyk:function(){return Nv},jIp:function(){return ll},WyV:function(){return lf},qGu:function(){return lS},QBj:function(){return lY},yEL:function(){return JQ},Bau:function(){return lH},ZqQ:function(){return NW},X6q:function(){return yT},Yqd:function(){return kA},__J:function(){return yW},rUS:function(){return yX},Qjf:function(){return y_},xgg:function(){return pH},kFS:function(){return yS},FzK:function(){return la},Clw:function(){return yJ},PD$:function(){return lj},Wxm:function(){return kI},wFK:function(){return eb},s_4:function(){return BP},nvN:function(){return Bz},u5Q:function(){return lt},j4H:function(){return kQ},J2e:function(){return hy},kod:function(){return ho},tIK:function(){return lQ},PhF:function(){return kC},Wh3:function(){return nw},Z0O:function(){return yp},DLL:function(){return ln},KJW:function(){return eW},rsf:function(){return kU},D_D:function(){return lE},iA_:function(){return ej},t6k:function(){return lF},xvT:function(){return BV},ua7:function(){return Dq},XxW:function(){return NC},YKL:function(){return Ng},ho9:function(){return NM},Sby:function(){return NE},hKn:function(){return lw},vQq:function(){return a5},ytg:function(){return lc},sWj:function(){return lM},XBW:function(){return ls},I13:function(){return a6},OHV:function(){return a1},OPV:function(){return a3},$Gg:function(){return a9},_4u:function(){return lP},Wdu:function(){return lW},c2j:function(){return e$},t0Y:function(){return ld},WsO:function(){return JA},Uu5:function(){return lq},oy6:function(){return lV},nNd:function(){return lD}});var D,M,c,s,y,h,k,n,t,K,L,U,i,G,r,p,a,N,o,e,J,F,S,l,H,Y,f,d,u,R,j,b,m,T,Z,O,v,x,V,z,W,P,q,X,_,$,AA,AQ,AB,AC,AI,AE,Ag,Aw,AD,AM,Ac,As,Ay,Ah,Ak,An={};B.r(An),B.d(An,{useDropzone:function(){return KC}});var At=B(52322),AK=B(2784),AL=B.t(AK,2);function AU(){return(AU=Object.assign?Object.assign.bind():function(A){for(var Q=1;QC,Object.values(C));return(0,AK.createElement)(B.Provider,{value:I},Q)}return C.displayName=A+"Provider",[C,function(C){let I=(0,AK.useContext)(B);if(I)return I;if(void 0!==Q)return Q;throw Error(`\`${C}\` must be used within \`${A}\``)}]}function AG(A,Q=[]){let B=[],C=()=>{let Q=B.map(A=>(0,AK.createContext)(A));return function(B){let C=(null==B?void 0:B[A])||Q;return(0,AK.useMemo)(()=>({[`__scope${A}`]:{...B,[A]:C}}),[B,C])}};return C.scopeName=A,[function(Q,C){let I=(0,AK.createContext)(C),E=B.length;function g(Q){let{scope:B,children:C,...g}=Q,w=(null==B?void 0:B[A][E])||I,D=(0,AK.useMemo)(()=>g,Object.values(g));return(0,AK.createElement)(w.Provider,{value:D},C)}return B=[...B,C],g.displayName=Q+"Provider",[g,function(B,g){let w=(null==g?void 0:g[A][E])||I,D=(0,AK.useContext)(w);if(D)return D;if(void 0!==C)return C;throw Error(`\`${B}\` must be used within \`${Q}\``)}]},function(...A){let Q=A[0];if(1===A.length)return Q;let B=()=>{let B=A.map(A=>({useScope:A(),scopeName:A.scopeName}));return function(A){let C=B.reduce((Q,{useScope:B,scopeName:C})=>{let I=B(A)[`__scope${C}`];return{...Q,...I}},{});return(0,AK.useMemo)(()=>({[`__scope${Q.scopeName}`]:C}),[C])}};return B.scopeName=Q.scopeName,B}(C,...Q)]}function Ar(...A){return Q=>A.forEach(A=>{"function"==typeof A?A(Q):null!=A&&(A.current=Q)})}function Ap(...A){return(0,AK.useCallback)(Ar(...A),A)}let Aa=(0,AK.forwardRef)((A,Q)=>{let{children:B,...C}=A,I=AK.Children.toArray(B),E=I.find(Ae);if(E){let A=E.props.children,B=I.map(Q=>Q!==E?Q:AK.Children.count(A)>1?AK.Children.only(null):(0,AK.isValidElement)(A)?A.props.children:null);return(0,AK.createElement)(AN,AU({},C,{ref:Q}),(0,AK.isValidElement)(A)?(0,AK.cloneElement)(A,void 0,B):null)}return(0,AK.createElement)(AN,AU({},C,{ref:Q}),B)});Aa.displayName="Slot";let AN=(0,AK.forwardRef)((A,Q)=>{let{children:B,...C}=A;return(0,AK.isValidElement)(B)?(0,AK.cloneElement)(B,{...function(A,Q){let B={...Q};for(let C in Q){let I=A[C],E=Q[C];/^on[A-Z]/.test(C)?B[C]=(...A)=>{null==E||E(...A),null==I||I(...A)}:"style"===C?B[C]={...I,...E}:"className"===C&&(B[C]=[I,E].filter(Boolean).join(" "))}return{...A,...B}}(C,B.props),ref:Ar(Q,B.ref)}):AK.Children.count(B)>1?AK.Children.only(null):null});AN.displayName="SlotClone";let Ao=({children:A})=>(0,AK.createElement)(AK.Fragment,null,A);function Ae(A){return(0,AK.isValidElement)(A)&&A.type===Ao}function AJ(A){let Q=A+"CollectionProvider",[B,C]=AG(Q),[I,E]=B(Q,{collectionRef:{current:null},itemMap:new Map}),g=A+"CollectionSlot",w=AK.forwardRef((A,Q)=>{let{scope:B,children:C}=A,I=Ap(Q,E(g,B).collectionRef);return AK.createElement(Aa,{ref:I},C)}),D=A+"CollectionItemSlot",M="data-radix-collection-item";return[{Provider:A=>{let{scope:Q,children:B}=A,C=AK.useRef(null),E=AK.useRef(new Map).current;return AK.createElement(I,{scope:Q,itemMap:E,collectionRef:C},B)},Slot:w,ItemSlot:AK.forwardRef((A,Q)=>{let{scope:B,children:C,...I}=A,g=AK.useRef(null),w=Ap(Q,g),c=E(D,B);return AK.useEffect(()=>(c.itemMap.set(g,{ref:g,...I}),()=>void c.itemMap.delete(g))),AK.createElement(Aa,{[M]:"",ref:w},C)})},function(Q){let B=E(A+"CollectionConsumer",Q);return AK.useCallback(()=>{let A=B.collectionRef.current;if(!A)return[];let Q=Array.from(A.querySelectorAll(`[${M}]`));return Array.from(B.itemMap.values()).sort((A,B)=>Q.indexOf(A.ref.current)-Q.indexOf(B.ref.current))},[B.collectionRef,B.itemMap])},C]}function AF(A,Q,{checkForDefaultPrevented:B=!0}={}){return function(C){if(null==A||A(C),!1===B||!C.defaultPrevented)return null==Q?void 0:Q(C)}}function AS(A){let Q=(0,AK.useRef)(A);return(0,AK.useEffect)(()=>{Q.current=A}),(0,AK.useMemo)(()=>(...A)=>{var B;return null===(B=Q.current)||void 0===B?void 0:B.call(Q,...A)},[])}function Al({prop:A,defaultProp:Q,onChange:B=()=>{}}){let[C,I]=function({defaultProp:A,onChange:Q}){let B=(0,AK.useState)(A),[C]=B,I=(0,AK.useRef)(C),E=AS(Q);return(0,AK.useEffect)(()=>{I.current!==C&&(E(C),I.current=C)},[C,I,E]),B}({defaultProp:Q,onChange:B}),E=void 0!==A,g=E?A:C,w=AS(B);return[g,(0,AK.useCallback)(Q=>{if(E){let B="function"==typeof Q?Q(A):Q;B!==A&&w(B)}else I(Q)},[E,A,I,w])]}var AH=B(28316);let AY=["a","button","div","h2","h3","img","li","nav","ol","p","span","svg","ul"].reduce((A,Q)=>{let B=(0,AK.forwardRef)((A,B)=>{let{asChild:C,...I}=A,E=C?Aa:Q;return(0,AK.useEffect)(()=>{window[Symbol.for("radix-ui")]=!0},[]),(0,AK.createElement)(E,AU({},I,{ref:B}))});return B.displayName=`Primitive.${Q}`,{...A,[Q]:B}},{});function Af(A,Q){A&&(0,AH.flushSync)(()=>A.dispatchEvent(Q))}let Ad=(null==globalThis?void 0:globalThis.document)?AK.useLayoutEffect:()=>{},Au=A=>{let{present:Q,children:B}=A,C=function(A){var Q,B;let[C,I]=(0,AK.useState)(),E=(0,AK.useRef)({}),g=(0,AK.useRef)(A),w=(0,AK.useRef)("none"),[D,M]=(Q=A?"mounted":"unmounted",B={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},(0,AK.useReducer)((A,Q)=>{let C=B[A][Q];return null!=C?C:A},Q));return(0,AK.useEffect)(()=>{let A=AR(E.current);w.current="mounted"===D?A:"none"},[D]),Ad(()=>{let Q=E.current,B=g.current;if(B!==A){let C=w.current,I=AR(Q);A?M("MOUNT"):"none"===I||(null==Q?void 0:Q.display)==="none"?M("UNMOUNT"):B&&C!==I?M("ANIMATION_OUT"):M("UNMOUNT"),g.current=A}},[A,M]),Ad(()=>{if(C){let A=A=>{let Q=AR(E.current).includes(A.animationName);A.target===C&&Q&&(0,AH.flushSync)(()=>M("ANIMATION_END"))},Q=A=>{A.target===C&&(w.current=AR(E.current))};return C.addEventListener("animationstart",Q),C.addEventListener("animationcancel",A),C.addEventListener("animationend",A),()=>{C.removeEventListener("animationstart",Q),C.removeEventListener("animationcancel",A),C.removeEventListener("animationend",A)}}M("ANIMATION_END")},[C,M]),{isPresent:["mounted","unmountSuspended"].includes(D),ref:(0,AK.useCallback)(A=>{A&&(E.current=getComputedStyle(A)),I(A)},[])}}(Q),I="function"==typeof B?B({present:C.isPresent}):AK.Children.only(B),E=Ap(C.ref,I.ref);return"function"==typeof B||C.isPresent?(0,AK.cloneElement)(I,{ref:E}):null};function AR(A){return(null==A?void 0:A.animationName)||"none"}Au.displayName="Presence";let Aj=AL["useId".toString()]||(()=>void 0),Ab=0;function Am(A){let[Q,B]=AK.useState(Aj());return Ad(()=>{A||B(A=>null!=A?A:String(Ab++))},[A]),A||(Q?`radix-${Q}`:"")}let AT="Collapsible",[AZ,AO]=AG(AT),[Av,Ax]=AZ(AT),AV=((A,Q)=>{let{__scopeCollapsible:B,open:C,defaultOpen:I,disabled:E,onOpenChange:g,...w}=A,[D=!1,M]=Al({prop:C,defaultProp:I,onChange:g});return(0,AK.createElement)(Av,{scope:B,disabled:E,contentId:Am(),open:D,onOpenToggle:(0,AK.useCallback)(()=>M(A=>!A),[M])},(0,AK.createElement)(AY.div,AU({"data-state":AW(D),"data-disabled":E?"":void 0},w,{ref:Q})))},"CollapsibleContent"),Az=((A,Q)=>{let{forceMount:B,...C}=A,I=Ax(AV,A.__scopeCollapsible);return(0,AK.createElement)(Au,{present:B||I.open},({present:A})=>(0,AK.createElement)(Az,AU({},C,{ref:Q,present:A})))},(0,AK.forwardRef)((A,Q)=>{let{__scopeCollapsible:B,present:C,children:I,...E}=A,g=Ax(AV,B),[w,D]=(0,AK.useState)(C),M=(0,AK.useRef)(null),c=Ap(Q,M),s=(0,AK.useRef)(0),y=s.current,h=(0,AK.useRef)(0),k=h.current,n=g.open||w,t=(0,AK.useRef)(n),K=(0,AK.useRef)();return(0,AK.useEffect)(()=>{let A=requestAnimationFrame(()=>t.current=!1);return()=>cancelAnimationFrame(A)},[]),Ad(()=>{let A=M.current;if(A){K.current=K.current||{transitionDuration:A.style.transitionDuration,animationDuration:A.style.animationDuration,animationFillMode:A.style.animationFillMode},A.style.transitionDuration="0s",A.style.animationDuration="0s",A.style.animationFillMode="none";let Q=A.getBoundingClientRect();s.current=Q.height,h.current=Q.width,t.current||(A.style.transitionDuration=K.current.transitionDuration,A.style.animationDuration=K.current.animationDuration,A.style.animationFillMode=K.current.animationFillMode),D(C)}},[g.open,C]),(0,AK.createElement)(AY.div,AU({"data-state":AW(g.open),"data-disabled":g.disabled?"":void 0,id:g.contentId,hidden:!n},E,{ref:c,style:{"--radix-collapsible-content-height":y?`${y}px`:void 0,"--radix-collapsible-content-width":k?`${k}px`:void 0,...A.style}}),n&&I)}));function AW(A){return A?"open":"closed"}let AP="Accordion",Aq=["Home","End","ArrowDown","ArrowUp"],[AX,A_,A$]=AJ(AP),[A0,A8]=AG(AP,[A$,AO]);AO(),AK.forwardRef((A,Q)=>{let{type:B,...C}=A;return AK.createElement(AX.Provider,{scope:A.__scopeAccordion},"multiple"===B?AK.createElement(A9,AU({},C,{ref:Q})):AK.createElement(A5,AU({},C,{ref:Q})))}).propTypes={type(A){let Q=A.value||A.defaultValue;return A.type&&!["single","multiple"].includes(A.type)?Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`."):"multiple"===A.type&&"string"==typeof Q?Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`."):"single"===A.type&&Array.isArray(Q)?Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`."):null}};let[A3,A1]=A0(AP),[A4,A2]=A0(AP,{collapsible:!1}),A5=AK.forwardRef((A,Q)=>{let{value:B,defaultValue:C,onValueChange:I=()=>{},collapsible:E=!1,...g}=A,[w,D]=Al({prop:B,defaultProp:C,onChange:I});return AK.createElement(A3,{scope:A.__scopeAccordion,value:w?[w]:[],onItemOpen:D,onItemClose:AK.useCallback(()=>E&&D(""),[E,D])},AK.createElement(A4,{scope:A.__scopeAccordion,collapsible:E},AK.createElement(QA,AU({},g,{ref:Q}))))}),A9=AK.forwardRef((A,Q)=>{let{value:B,defaultValue:C,onValueChange:I=()=>{},...E}=A,[g=[],w]=Al({prop:B,defaultProp:C,onChange:I}),D=AK.useCallback(A=>w((Q=[])=>[...Q,A]),[w]),M=AK.useCallback(A=>w((Q=[])=>Q.filter(Q=>Q!==A)),[w]);return AK.createElement(A3,{scope:A.__scopeAccordion,value:g,onItemOpen:D,onItemClose:M},AK.createElement(A4,{scope:A.__scopeAccordion,collapsible:!0},AK.createElement(QA,AU({},E,{ref:Q}))))}),[A6,A7]=A0(AP),QA=AK.forwardRef((A,Q)=>{let{__scopeAccordion:B,disabled:C,...I}=A,E=Ap(AK.useRef(null),Q),g=A_(B),w=AF(A.onKeyDown,A=>{var Q;if(!Aq.includes(A.key))return;let B=A.target,C=g().filter(A=>{var Q;return!(null!==(Q=A.ref.current)&&void 0!==Q&&Q.disabled)}),I=C.findIndex(A=>A.ref.current===B),E=C.length;if(-1===I)return;A.preventDefault();let w=I;switch(A.key){case"Home":w=0;break;case"End":w=E-1;break;case"ArrowDown":w=I+1;break;case"ArrowUp":(w=I-1)<0&&(w=E-1)}null===(Q=C[w%E].ref.current)||void 0===Q||Q.focus()});return AK.createElement(A6,{scope:B,disabled:C},AK.createElement(AX.Slot,{scope:B},AK.createElement(AY.div,AU({},I,{ref:E,onKeyDown:C?void 0:w}))))}),[QQ,QB]=A0("AccordionItem");var QC=B(82851);let QI="dismissableLayer.update",QE=(0,AK.createContext)({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Qg=(0,AK.forwardRef)((A,Q)=>{let{disableOutsidePointerEvents:B=!1,onEscapeKeyDown:I,onPointerDownOutside:E,onFocusOutside:g,onInteractOutside:w,onDismiss:D,...M}=A,c=(0,AK.useContext)(QE),[s,y]=(0,AK.useState)(null),[,h]=(0,AK.useState)({}),k=Ap(Q,A=>y(A)),n=Array.from(c.layers),[t]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),K=n.indexOf(t),L=s?n.indexOf(s):-1,U=c.layersWithOutsidePointerEventsDisabled.size>0,i=L>=K,G=function(A){let Q=AS(A),B=(0,AK.useRef)(!1),C=(0,AK.useRef)(()=>{});return(0,AK.useEffect)(()=>{let A=A=>{if(A.target&&!B.current){let B={originalEvent:A};function I(){QD("dismissableLayer.pointerDownOutside",Q,B,{discrete:!0})}"touch"===A.pointerType?(document.removeEventListener("click",C.current),C.current=I,document.addEventListener("click",C.current,{once:!0})):I()}B.current=!1},I=window.setTimeout(()=>{document.addEventListener("pointerdown",A)},0);return()=>{window.clearTimeout(I),document.removeEventListener("pointerdown",A),document.removeEventListener("click",C.current)}},[Q]),{onPointerDownCapture:()=>B.current=!0}}(A=>{let Q=A.target,B=[...c.branches].some(A=>A.contains(Q));!i||B||(null==E||E(A),null==w||w(A),A.defaultPrevented||null==D||D())}),r=function(A){let Q=AS(A),B=(0,AK.useRef)(!1);return(0,AK.useEffect)(()=>{let A=A=>{A.target&&!B.current&&QD("dismissableLayer.focusOutside",Q,{originalEvent:A},{discrete:!1})};return document.addEventListener("focusin",A),()=>document.removeEventListener("focusin",A)},[Q]),{onFocusCapture:()=>B.current=!0,onBlurCapture:()=>B.current=!1}}(A=>{let Q=A.target;[...c.branches].some(A=>A.contains(Q))||(null==g||g(A),null==w||w(A),A.defaultPrevented||null==D||D())});return!function(A){let Q=AS(A);(0,AK.useEffect)(()=>{let A=A=>{"Escape"===A.key&&Q(A)};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[Q])}(A=>{L!==c.layers.size-1||(null==I||I(A),!A.defaultPrevented&&D&&(A.preventDefault(),D()))}),(0,AK.useEffect)(()=>{if(s)return B&&(0===c.layersWithOutsidePointerEventsDisabled.size&&(C=document.body.style.pointerEvents,document.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(s)),c.layers.add(s),Qw(),()=>{B&&1===c.layersWithOutsidePointerEventsDisabled.size&&(document.body.style.pointerEvents=C)}},[s,B,c]),(0,AK.useEffect)(()=>()=>{s&&(c.layers.delete(s),c.layersWithOutsidePointerEventsDisabled.delete(s),Qw())},[s,c]),(0,AK.useEffect)(()=>{let A=()=>h({});return document.addEventListener(QI,A),()=>document.removeEventListener(QI,A)},[]),(0,AK.createElement)(AY.div,AU({},M,{ref:k,style:{pointerEvents:U?i?"auto":"none":void 0,...A.style},onFocusCapture:AF(A.onFocusCapture,r.onFocusCapture),onBlurCapture:AF(A.onBlurCapture,r.onBlurCapture),onPointerDownCapture:AF(A.onPointerDownCapture,G.onPointerDownCapture)}))});function Qw(){let A=new CustomEvent(QI);document.dispatchEvent(A)}function QD(A,Q,B,{discrete:C}){let I=B.originalEvent.target,E=new CustomEvent(A,{bubbles:!1,cancelable:!0,detail:B});Q&&I.addEventListener(A,Q,{once:!0}),C?Af(I,E):I.dispatchEvent(E)}function QM(A){return A.split("-")[0]}function Qc(A){return A.split("-")[1]}function Qs(A){return["top","bottom"].includes(QM(A))?"x":"y"}function Qy(A){return"y"===A?"height":"width"}function Qh(A,Q,B){let C,{reference:I,floating:E}=A,g=I.x+I.width/2-E.width/2,w=I.y+I.height/2-E.height/2,D=Qs(Q),M=Qy(D),c=I[M]/2-E[M]/2,s="x"===D;switch(QM(Q)){case"top":C={x:g,y:I.y-E.height};break;case"bottom":C={x:g,y:I.y+I.height};break;case"right":C={x:I.x+I.width,y:w};break;case"left":C={x:I.x-E.width,y:w};break;default:C={x:I.x,y:I.y}}switch(Qc(Q)){case"start":C[D]-=c*(B&&s?-1:1);break;case"end":C[D]+=c*(B&&s?-1:1)}return C}let Qk=async(A,Q,B)=>{let{placement:C="bottom",strategy:I="absolute",middleware:E=[],platform:g}=B,w=await (null==g.isRTL?void 0:g.isRTL(Q)),D=await g.getElementRects({reference:A,floating:Q,strategy:I}),{x:M,y:c}=Qh(D,C,w),s=C,y={},h=0;for(let B=0;B({name:"arrow",options:A,async fn(Q){let{element:B,padding:C=0}=null!=A?A:{},{x:I,y:E,placement:g,rects:w,platform:D}=Q;if(null==B)return{};let M=Qn(C),c={x:I,y:E},s=Qs(g),y=Qc(g),h=Qy(s),k=await D.getDimensions(B),n="y"===s?"top":"left",t="y"===s?"bottom":"right",K=w.reference[h]+w.reference[s]-c[s]-w.floating[h],L=c[s]-w.reference[s],U=await (null==D.getOffsetParent?void 0:D.getOffsetParent(B)),i=U?"y"===s?U.clientHeight||0:U.clientWidth||0:0;0===i&&(i=w.floating[h]);let G=M[n],r=i-k[h]-M[t],p=i/2-k[h]/2+(K/2-L/2),a=QU(G,QL(p,r)),N=("start"===y?M[n]:M[t])>0&&p!==a&&w.reference[h]<=w.floating[h];return{[s]:c[s]-(N?pQG[A])}let Qp={start:"end",end:"start"};function Qa(A){return A.replace(/start|end/g,A=>Qp[A])}let QN=["top","right","bottom","left"];QN.reduce((A,Q)=>A.concat(Q,Q+"-start",Q+"-end"),[]);let Qo=function(A){return void 0===A&&(A={}),{name:"flip",options:A,async fn(Q){var B,C,I,E;let{placement:g,middlewareData:w,rects:D,initialPlacement:M,platform:c,elements:s}=Q,{mainAxis:y=!0,crossAxis:h=!0,fallbackPlacements:k,fallbackStrategy:n="bestFit",flipAlignment:t=!0,...K}=A,L=QM(g),U=k||(L!==M&&t?function(A){let Q=Qr(A);return[Qa(A),Q,Qa(Q)]}(M):[Qr(M)]),i=[M,...U],G=await QK(Q,K),r=[],p=(null==(B=w.flip)?void 0:B.overflows)||[];if(y&&r.push(G[L]),h){let{main:A,cross:Q}=function(A,Q,B){void 0===B&&(B=!1);let C=Qc(A),I=Qs(A),E=Qy(I),g="x"===I?C===(B?"end":"start")?"right":"left":"start"===C?"bottom":"top";return Q.reference[E]>Q.floating[E]&&(g=Qr(g)),{main:g,cross:Qr(g)}}(g,D,await (null==c.isRTL?void 0:c.isRTL(s.floating)));r.push(G[A],G[Q])}if(p=[...p,{placement:g,overflows:r}],!r.every(A=>A<=0)){let A=(null!=(C=null==(I=w.flip)?void 0:I.index)?C:0)+1,Q=i[A];if(Q)return{data:{index:A,overflows:p},reset:{placement:Q}};let B="bottom";switch(n){case"bestFit":{let A=null==(E=p.map(A=>[A,A.overflows.filter(A=>A>0).reduce((A,Q)=>A+Q,0)]).sort((A,Q)=>A[1]-Q[1])[0])?void 0:E[0].placement;A&&(B=A);break}case"initialPlacement":B=M}if(g!==B)return{reset:{placement:B}}}return{}}}};function Qe(A,Q){return{top:A.top-Q.height,right:A.right-Q.width,bottom:A.bottom-Q.height,left:A.left-Q.width}}function QJ(A){return QN.some(Q=>A[Q]>=0)}let QF=function(A){let{strategy:Q="referenceHidden",...B}=void 0===A?{}:A;return{name:"hide",async fn(A){let{rects:C}=A;switch(Q){case"referenceHidden":{let Q=Qe(await QK(A,{...B,elementContext:"reference"}),C.reference);return{data:{referenceHiddenOffsets:Q,referenceHidden:QJ(Q)}}}case"escaped":{let Q=Qe(await QK(A,{...B,altBoundary:!0}),C.floating);return{data:{escapedOffsets:Q,escaped:QJ(Q)}}}default:return{}}}}},QS=function(A){return void 0===A&&(A=0),{name:"offset",options:A,async fn(Q){let{x:B,y:C}=Q,I=await async function(A,Q){let{placement:B,platform:C,elements:I}=A,E=await (null==C.isRTL?void 0:C.isRTL(I.floating)),g=QM(B),w=Qc(B),D="x"===Qs(B),M=["left","top"].includes(g)?-1:1,c=E&&D?-1:1,s="function"==typeof Q?Q(A):Q,{mainAxis:y,crossAxis:h,alignmentAxis:k}="number"==typeof s?{mainAxis:s,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...s};return w&&"number"==typeof k&&(h="end"===w?-1*k:k),D?{x:h*c,y:y*M}:{x:y*M,y:h*c}}(Q,A);return{x:B+I.x,y:C+I.y,data:I}}}};function Ql(A){return"x"===A?"y":"x"}let QH=function(A){return void 0===A&&(A={}),{name:"shift",options:A,async fn(Q){let{x:B,y:C,placement:I}=Q,{mainAxis:E=!0,crossAxis:g=!1,limiter:w={fn:A=>{let{x:Q,y:B}=A;return{x:Q,y:B}}},...D}=A,M={x:B,y:C},c=await QK(Q,D),s=Qs(QM(I)),y=Ql(s),h=M[s],k=M[y];if(E){let A="y"===s?"bottom":"right";h=QU(h+c["y"===s?"top":"left"],QL(h,h-c[A]))}if(g){let A="y"===y?"bottom":"right";k=QU(k+c["y"===y?"top":"left"],QL(k,k-c[A]))}let n=w.fn({...Q,[s]:h,[y]:k});return{...n,data:{x:n.x-B,y:n.y-C}}}}},QY=function(A){return void 0===A&&(A={}),{options:A,fn(Q){let{x:B,y:C,placement:I,rects:E,middlewareData:g}=Q,{offset:w=0,mainAxis:D=!0,crossAxis:M=!0}=A,c={x:B,y:C},s=Qs(I),y=Ql(s),h=c[s],k=c[y],n="function"==typeof w?w({...E,placement:I}):w,t="number"==typeof n?{mainAxis:n,crossAxis:0}:{mainAxis:0,crossAxis:0,...n};if(D){let A="y"===s?"height":"width",Q=E.reference[s]-E.floating[A]+t.mainAxis,B=E.reference[s]+E.reference[A]-t.mainAxis;hB&&(h=B)}if(M){var K,L,U,i;let A="y"===s?"width":"height",Q=["top","left"].includes(QM(I)),B=E.reference[y]-E.floating[A]+(Q&&null!=(K=null==(L=g.offset)?void 0:L[y])?K:0)+(Q?0:t.crossAxis),C=E.reference[y]+E.reference[A]+(Q?0:null!=(U=null==(i=g.offset)?void 0:i[y])?U:0)-(Q?t.crossAxis:0);kC&&(k=C)}return{[s]:h,[y]:k}}}};function Qf(A){return A&&A.document&&A.location&&A.alert&&A.setInterval}function Qd(A){if(null==A)return window;if(!Qf(A)){let Q=A.ownerDocument;return Q&&Q.defaultView||window}return A}function Qu(A){return Qd(A).getComputedStyle(A)}function QR(A){return Qf(A)?"":A?(A.nodeName||"").toLowerCase():""}function Qj(){let A=navigator.userAgentData;return null!=A&&A.brands?A.brands.map(A=>A.brand+"/"+A.version).join(" "):navigator.userAgent}function Qb(A){return A instanceof Qd(A).HTMLElement}function Qm(A){return A instanceof Qd(A).Element}function QT(A){return"undefined"!=typeof ShadowRoot&&(A instanceof Qd(A).ShadowRoot||A instanceof ShadowRoot)}function QZ(A){let{overflow:Q,overflowX:B,overflowY:C}=Qu(A);return/auto|scroll|overlay|hidden/.test(Q+C+B)}function QO(A){let Q=/firefox/i.test(Qj()),B=Qu(A);return"none"!==B.transform||"none"!==B.perspective||"paint"===B.contain||["transform","perspective"].includes(B.willChange)||Q&&"filter"===B.willChange||Q&&!!B.filter&&"none"!==B.filter}function Qv(){return!/^((?!chrome|android).)*safari/i.test(Qj())}let Qx=Math.min,QV=Math.max,Qz=Math.round;function QW(A,Q,B){var C,I,E,g;void 0===Q&&(Q=!1),void 0===B&&(B=!1);let w=A.getBoundingClientRect(),D=1,M=1;Q&&Qb(A)&&(D=A.offsetWidth>0&&Qz(w.width)/A.offsetWidth||1,M=A.offsetHeight>0&&Qz(w.height)/A.offsetHeight||1);let c=Qm(A)?Qd(A):window,s=!Qv()&&B,y=(w.left+(s&&null!=(C=null==(I=c.visualViewport)?void 0:I.offsetLeft)?C:0))/D,h=(w.top+(s&&null!=(E=null==(g=c.visualViewport)?void 0:g.offsetTop)?E:0))/M,k=w.width/D,n=w.height/M;return{width:k,height:n,top:h,right:y+k,bottom:h+n,left:y,x:y,y:h}}function QP(A){return((A instanceof Qd(A).Node?A.ownerDocument:A.document)||window.document).documentElement}function Qq(A){return Qm(A)?{scrollLeft:A.scrollLeft,scrollTop:A.scrollTop}:{scrollLeft:A.pageXOffset,scrollTop:A.pageYOffset}}function QX(A){return QW(QP(A)).left+Qq(A).scrollLeft}function Q_(A){return"html"===QR(A)?A:A.assignedSlot||A.parentNode||(QT(A)?A.host:null)||QP(A)}function Q$(A){return Qb(A)&&"fixed"!==getComputedStyle(A).position?A.offsetParent:null}function Q0(A){let Q=Qd(A),B=Q$(A);for(;B&&["table","td","th"].includes(QR(B))&&"static"===getComputedStyle(B).position;)B=Q$(B);return B&&("html"===QR(B)||"body"===QR(B)&&"static"===getComputedStyle(B).position&&!QO(B))?Q:B||function(A){let Q=Q_(A);for(QT(Q)&&(Q=Q.host);Qb(Q)&&!["html","body"].includes(QR(Q));){if(QO(Q))return Q;Q=Q.parentNode}return null}(A)||Q}function Q8(A){if(Qb(A))return{width:A.offsetWidth,height:A.offsetHeight};let Q=QW(A);return{width:Q.width,height:Q.height}}function Q3(A,Q){var B;void 0===Q&&(Q=[]);let C=function A(Q){let B=Q_(Q);return["html","body","#document"].includes(QR(B))?Q.ownerDocument.body:Qb(B)&&QZ(B)?B:A(B)}(A),I=C===(null==(B=A.ownerDocument)?void 0:B.body),E=Qd(C),g=I?[E].concat(E.visualViewport||[],QZ(C)?C:[]):C,w=Q.concat(g);return I?w:w.concat(Q3(g))}function Q1(A,Q,B){return"viewport"===Q?Qt(function(A,Q){let B=Qd(A),C=QP(A),I=B.visualViewport,E=C.clientWidth,g=C.clientHeight,w=0,D=0;if(I){E=I.width,g=I.height;let A=Qv();(A||!A&&"fixed"===Q)&&(w=I.offsetLeft,D=I.offsetTop)}return{width:E,height:g,x:w,y:D}}(A,B)):Qm(Q)?function(A,Q){let B=QW(A,!1,"fixed"===Q),C=B.top+A.clientTop,I=B.left+A.clientLeft;return{top:C,left:I,x:I,y:C,right:I+A.clientWidth,bottom:C+A.clientHeight,width:A.clientWidth,height:A.clientHeight}}(Q,B):Qt(function(A){var Q;let B=QP(A),C=Qq(A),I=null==(Q=A.ownerDocument)?void 0:Q.body,E=QV(B.scrollWidth,B.clientWidth,I?I.scrollWidth:0,I?I.clientWidth:0),g=QV(B.scrollHeight,B.clientHeight,I?I.scrollHeight:0,I?I.clientHeight:0),w=-C.scrollLeft+QX(A),D=-C.scrollTop;return"rtl"===Qu(I||B).direction&&(w+=QV(B.clientWidth,I?I.clientWidth:0)-E),{width:E,height:g,x:w,y:D}}(QP(A)))}let Q4={getClippingRect:function(A){let{element:Q,boundary:B,rootBoundary:C,strategy:I}=A,E=[..."clippingAncestors"===B?function(A){let Q=Q3(A),B=["absolute","fixed"].includes(Qu(A).position)&&Qb(A)?Q0(A):A;return Qm(B)?Q.filter(A=>Qm(A)&&function(A,Q){let B=null==Q.getRootNode?void 0:Q.getRootNode();if(A.contains(Q))return!0;if(B&&QT(B)){let B=Q;do{if(B&&A===B)return!0;B=B.parentNode||B.host}while(B)}return!1}(A,B)&&"body"!==QR(A)):[]}(Q):[].concat(B),C],g=E[0],w=E.reduce((A,B)=>{let C=Q1(Q,B,I);return A.top=QV(C.top,A.top),A.right=Qx(C.right,A.right),A.bottom=Qx(C.bottom,A.bottom),A.left=QV(C.left,A.left),A},Q1(Q,g,I));return{width:w.right-w.left,height:w.bottom-w.top,x:w.left,y:w.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(A){let{rect:Q,offsetParent:B,strategy:C}=A,I=Qb(B),E=QP(B);if(B===E)return Q;let g={scrollLeft:0,scrollTop:0},w={x:0,y:0};if((I||!I&&"fixed"!==C)&&(("body"!==QR(B)||QZ(E))&&(g=Qq(B)),Qb(B))){let A=QW(B,!0);w.x=A.x+B.clientLeft,w.y=A.y+B.clientTop}return{...Q,x:Q.x-g.scrollLeft+w.x,y:Q.y-g.scrollTop+w.y}},isElement:Qm,getDimensions:Q8,getOffsetParent:Q0,getDocumentElement:QP,getElementRects:A=>{let{reference:Q,floating:B,strategy:C}=A;return{reference:function(A,Q,B){let C=Qb(Q),I=QP(Q),E=QW(A,C&&function(A){let Q=QW(A);return Qz(Q.width)!==A.offsetWidth||Qz(Q.height)!==A.offsetHeight}(Q),"fixed"===B),g={scrollLeft:0,scrollTop:0},w={x:0,y:0};if(C||!C&&"fixed"!==B){if(("body"!==QR(Q)||QZ(I))&&(g=Qq(Q)),Qb(Q)){let A=QW(Q,!0);w.x=A.x+Q.clientLeft,w.y=A.y+Q.clientTop}else I&&(w.x=QX(I))}return{x:E.left+g.scrollLeft-w.x,y:E.top+g.scrollTop-w.y,width:E.width,height:E.height}}(Q,Q0(B),C),floating:{...Q8(B),x:0,y:0}}},getClientRects:A=>Array.from(A.getClientRects()),isRTL:A=>"rtl"===Qu(A).direction};function Q2(A,Q,B,C){void 0===C&&(C={});let{ancestorScroll:I=!0,ancestorResize:E=!0,elementResize:g=!0,animationFrame:w=!1}=C,D=I&&!w,M=E&&!w,c=D||M?[...Qm(A)?Q3(A):[],...Q3(Q)]:[];c.forEach(A=>{D&&A.addEventListener("scroll",B,{passive:!0}),M&&A.addEventListener("resize",B)});let s,y=null;if(g){let C=!0;y=new ResizeObserver(()=>{C||B(),C=!1}),Qm(A)&&!w&&y.observe(A),y.observe(Q)}let h=w?QW(A):null;return w&&function Q(){let C=QW(A);h&&(C.x!==h.x||C.y!==h.y||C.width!==h.width||C.height!==h.height)&&B(),h=C,s=requestAnimationFrame(Q)}(),B(),()=>{var A;c.forEach(A=>{D&&A.removeEventListener("scroll",B),M&&A.removeEventListener("resize",B)}),null==(A=y)||A.disconnect(),y=null,w&&cancelAnimationFrame(s)}}let Q5=(A,Q,B)=>Qk(A,Q,{platform:Q4,...B});var Q9="undefined"!=typeof document?AK.useLayoutEffect:AK.useEffect;function Q6(A){let{middleware:Q,placement:B="bottom",strategy:C="absolute",whileElementsMounted:I}=void 0===A?{}:A,E=AK.useRef(null),g=AK.useRef(null),w=function(A){let Q=AK.useRef(A);return Q9(()=>{Q.current=A}),Q}(I),D=AK.useRef(null),[M,c]=AK.useState({x:null,y:null,strategy:C,placement:B,middlewareData:{}}),[s,y]=AK.useState(Q);!function A(Q,B){let C,I,E;if(Q===B)return!0;if(typeof Q!=typeof B)return!1;if("function"==typeof Q&&Q.toString()===B.toString())return!0;if(Q&&B&&"object"==typeof Q){if(Array.isArray(Q)){if((C=Q.length)!=B.length)return!1;for(I=C;0!=I--;)if(!A(Q[I],B[I]))return!1;return!0}if((C=(E=Object.keys(Q)).length)!==Object.keys(B).length)return!1;for(I=C;0!=I--;)if(!Object.prototype.hasOwnProperty.call(B,E[I]))return!1;for(I=C;0!=I--;){let C=E[I];if(("_owner"!==C||!Q.$$typeof)&&!A(Q[C],B[C]))return!1}return!0}return Q!=Q&&B!=B}(null==s?void 0:s.map(A=>{let{options:Q}=A;return Q}),null==Q?void 0:Q.map(A=>{let{options:Q}=A;return Q}))&&y(Q);let h=AK.useCallback(()=>{E.current&&g.current&&Q5(E.current,g.current,{middleware:s,placement:B,strategy:C}).then(A=>{k.current&&AH.flushSync(()=>{c(A)})})},[s,B,C]);Q9(()=>{k.current&&h()},[h]);let k=AK.useRef(!1);Q9(()=>(k.current=!0,()=>{k.current=!1}),[]);let n=AK.useCallback(()=>{if("function"==typeof D.current&&(D.current(),D.current=null),E.current&&g.current){if(w.current){let A=w.current(E.current,g.current,h);D.current=A}else h()}},[h,w]),t=AK.useCallback(A=>{E.current=A,n()},[n]),K=AK.useCallback(A=>{g.current=A,n()},[n]),L=AK.useMemo(()=>({reference:E,floating:g}),[]);return AK.useMemo(()=>({...M,update:h,refs:L,reference:t,floating:K}),[M,h,L,t,K])}let Q7=A=>{let{element:Q,padding:B}=A;return{name:"arrow",options:A,fn(A){if(Object.prototype.hasOwnProperty.call(Q,"current")){if(null!=Q.current)return Qi({element:Q.current,padding:B}).fn(A)}else if(Q)return Qi({element:Q,padding:B}).fn(A);return{}}}},BA=(0,AK.forwardRef)((A,Q)=>{let{children:B,width:C=10,height:I=5,...E}=A;return(0,AK.createElement)(AY.svg,AU({},E,{ref:Q,width:C,height:I,viewBox:"0 0 30 10",preserveAspectRatio:"none"}),A.asChild?B:(0,AK.createElement)("polygon",{points:"0,0 30,0 15,10"}))});function BQ(A){let[Q,B]=(0,AK.useState)(void 0);return Ad(()=>{if(A){B({width:A.offsetWidth,height:A.offsetHeight});let Q=new ResizeObserver(Q=>{let C,I;if(!Array.isArray(Q)||!Q.length)return;let E=Q[0];if("borderBoxSize"in E){let A=E.borderBoxSize,Q=Array.isArray(A)?A[0]:A;C=Q.inlineSize,I=Q.blockSize}else C=A.offsetWidth,I=A.offsetHeight;B({width:C,height:I})});return Q.observe(A,{box:"border-box"}),()=>Q.unobserve(A)}B(void 0)},[A]),Q}let BB="Popper",[BC,BI]=AG(BB),[BE,Bg]=BC(BB),Bw=(0,AK.forwardRef)((A,Q)=>{let{__scopePopper:B,virtualRef:C,...I}=A,E=Bg("PopperAnchor",B),g=(0,AK.useRef)(null),w=Ap(Q,g);return(0,AK.useEffect)(()=>{E.onAnchorChange((null==C?void 0:C.current)||g.current)}),C?null:(0,AK.createElement)(AY.div,AU({},I,{ref:w}))}),BD="PopperContent",[BM,Bc]=BC(BD),[Bs,By]=BC(BD,{hasParent:!1,positionUpdateFns:new Set}),Bh=(0,AK.forwardRef)((A,Q)=>{var B,C,I,E,g,w,D,M;let{__scopePopper:c,side:s="bottom",sideOffset:y=0,align:h="center",alignOffset:k=0,arrowPadding:n=0,collisionBoundary:t=[],collisionPadding:K=0,sticky:L="partial",hideWhenDetached:U=!1,avoidCollisions:i=!0,...G}=A,r=Bg(BD,c),[p,a]=(0,AK.useState)(null),N=Ap(Q,A=>a(A)),[o,e]=(0,AK.useState)(null),J=BQ(o),F=null!==(B=null==J?void 0:J.width)&&void 0!==B?B:0,S=null!==(C=null==J?void 0:J.height)&&void 0!==C?C:0,l="number"==typeof K?K:{top:0,right:0,bottom:0,left:0,...K},H=Array.isArray(t)?t:[t],Y=H.length>0,f={padding:l,boundary:H.filter(BK),altBoundary:Y},{reference:d,floating:u,strategy:R,x:j,y:b,placement:m,middlewareData:T,update:Z}=Q6({strategy:"fixed",placement:s+("center"!==h?"-"+h:""),whileElementsMounted:Q2,middleware:[QS({mainAxis:y+S,alignmentAxis:k}),i?QH({mainAxis:!0,crossAxis:!1,limiter:"partial"===L?QY():void 0,...f}):void 0,o?Q7({element:o,padding:n}):void 0,i?Qo({...f}):void 0,BL({arrowWidth:F,arrowHeight:S}),U?QF({strategy:"referenceHidden"}):void 0].filter(Bt)});Ad(()=>{d(r.anchor)},[d,r.anchor]);let O=null!==j&&null!==b,[v,x]=BU(m),V=null===(I=T.arrow)||void 0===I?void 0:I.x,z=null===(E=T.arrow)||void 0===E?void 0:E.y,W=(null===(g=T.arrow)||void 0===g?void 0:g.centerOffset)!==0,[P,q]=(0,AK.useState)();Ad(()=>{p&&q(window.getComputedStyle(p).zIndex)},[p]);let{hasParent:X,positionUpdateFns:_}=By(BD,c),$=!X;(0,AK.useLayoutEffect)(()=>{if(!$)return _.add(Z),()=>{_.delete(Z)}},[$,_,Z]),(0,AK.useLayoutEffect)(()=>{$&&O&&Array.from(_).reverse().forEach(A=>requestAnimationFrame(A))},[$,O,_]);let AA={"data-side":v,"data-align":x,...G,ref:N,style:{...G.style,animation:O?void 0:"none",opacity:null!==(w=T.hide)&&void 0!==w&&w.referenceHidden?0:void 0}};return(0,AK.createElement)("div",{ref:u,"data-radix-popper-content-wrapper":"",style:{position:R,left:0,top:0,transform:O?`translate3d(${Math.round(j)}px, ${Math.round(b)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:P,"--radix-popper-transform-origin":[null===(D=T.transformOrigin)||void 0===D?void 0:D.x,null===(M=T.transformOrigin)||void 0===M?void 0:M.y].join(" ")}},(0,AK.createElement)(BM,{scope:c,placedSide:v,onArrowChange:e,arrowX:V,arrowY:z,shouldHideArrow:W},$?(0,AK.createElement)(Bs,{scope:c,hasParent:!0,positionUpdateFns:_},(0,AK.createElement)(AY.div,AA)):(0,AK.createElement)(AY.div,AA)))}),Bk={top:"bottom",right:"left",bottom:"top",left:"right"},Bn=(0,AK.forwardRef)(function(A,Q){let{__scopePopper:B,...C}=A,I=Bc("PopperArrow",B),E=Bk[I.placedSide];return(0,AK.createElement)("span",{ref:I.onArrowChange,style:{position:"absolute",left:I.arrowX,top:I.arrowY,[E]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[I.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[I.placedSide],visibility:I.shouldHideArrow?"hidden":void 0}},(0,AK.createElement)(BA,AU({},C,{ref:Q,style:{...C.style,display:"block"}})))});function Bt(A){return void 0!==A}function BK(A){return null!==A}let BL=A=>({name:"transformOrigin",options:A,fn(Q){var B,C,I,E,g;let{placement:w,rects:D,middlewareData:M}=Q,c=(null===(B=M.arrow)||void 0===B?void 0:B.centerOffset)!==0,s=c?0:A.arrowWidth,y=c?0:A.arrowHeight,[h,k]=BU(w),n={start:"0%",center:"50%",end:"100%"}[k],t=(null!==(C=null===(I=M.arrow)||void 0===I?void 0:I.x)&&void 0!==C?C:0)+s/2,K=(null!==(E=null===(g=M.arrow)||void 0===g?void 0:g.y)&&void 0!==E?E:0)+y/2,L="",U="";return"bottom"===h?(L=c?n:`${t}px`,U=`${-y}px`):"top"===h?(L=c?n:`${t}px`,U=`${D.floating.height+y}px`):"right"===h?(L=`${-y}px`,U=c?n:`${K}px`):"left"===h&&(L=`${D.floating.width+y}px`,U=c?n:`${K}px`),{data:{x:L,y:U}}}});function BU(A){let[Q,B="center"]=A.split("-");return[Q,B]}let Bi=A=>{let{__scopePopper:Q,children:B}=A,[C,I]=(0,AK.useState)(null);return(0,AK.createElement)(BE,{scope:Q,anchor:C,onAnchorChange:I},B)},BG=(0,AK.forwardRef)((A,Q)=>{var B;let{container:C=null==globalThis?void 0:null===(B=globalThis.document)||void 0===B?void 0:B.body,...I}=A;return C?AH.createPortal((0,AK.createElement)(AY.div,AU({},I,{ref:Q})),C):null}),Br=(0,AK.forwardRef)((A,Q)=>(0,AK.createElement)(AY.span,AU({},A,{ref:Q,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...A.style}}))),[Bp,Ba]=AG("Tooltip",[BI]),BN=BI(),Bo="tooltip.open",[Be,BJ]=Bp("TooltipProvider"),BF="Tooltip",[BS,Bl]=Bp(BF),BH="TooltipTrigger",BY=(0,AK.forwardRef)((A,Q)=>{let{__scopeTooltip:B,...C}=A,I=Bl(BH,B),E=BJ(BH,B),g=BN(B),w=Ap(Q,(0,AK.useRef)(null),I.onTriggerChange),D=(0,AK.useRef)(!1),M=(0,AK.useRef)(!1),c=(0,AK.useCallback)(()=>D.current=!1,[]);return(0,AK.useEffect)(()=>()=>document.removeEventListener("pointerup",c),[c]),(0,AK.createElement)(Bw,AU({asChild:!0},g),(0,AK.createElement)(AY.button,AU({"aria-describedby":I.open?I.contentId:void 0,"data-state":I.stateAttribute},C,{ref:w,onPointerMove:AF(A.onPointerMove,A=>{"touch"===A.pointerType||M.current||E.isPointerInTransitRef.current||(I.onTriggerEnter(),M.current=!0)}),onPointerLeave:AF(A.onPointerLeave,()=>{I.onTriggerLeave(),M.current=!1}),onPointerDown:AF(A.onPointerDown,()=>{D.current=!0,document.addEventListener("pointerup",c,{once:!0})}),onFocus:AF(A.onFocus,()=>{D.current||I.onOpen()}),onBlur:AF(A.onBlur,I.onClose),onClick:AF(A.onClick,A=>{0===A.detail&&I.onClose()})})))}),Bf="TooltipPortal",[Bd,Bu]=Bp(Bf,{forceMount:void 0}),BR="TooltipContent",Bj=(0,AK.forwardRef)((A,Q)=>{let B=Bu(BR,A.__scopeTooltip),{forceMount:C=B.forceMount,side:I="top",...E}=A,g=Bl(BR,A.__scopeTooltip);return(0,AK.createElement)(Au,{present:C||g.open},g.disableHoverableContent?(0,AK.createElement)(BZ,AU({side:I},E,{ref:Q})):(0,AK.createElement)(Bb,AU({side:I},E,{ref:Q})))}),Bb=(0,AK.forwardRef)((A,Q)=>{let B=Bl(BR,A.__scopeTooltip),C=BJ(BR,A.__scopeTooltip),I=(0,AK.useRef)(null),E=Ap(Q,I),[g,w]=(0,AK.useState)(null),{trigger:D,onClose:M}=B,c=I.current,{onPointerInTransitChange:s}=C,y=(0,AK.useCallback)(()=>{w(null),s(!1)},[s]),h=(0,AK.useCallback)((A,Q)=>{let B=A.currentTarget,C=function(A,Q){let B=Math.abs(Q.top-A.y),C=Math.abs(Q.bottom-A.y),I=Math.abs(Q.right-A.x),E=Math.abs(Q.left-A.x);switch(Math.min(B,C,I,E)){case E:return"left";case I:return"right";case B:return"top";case C:return"bottom";default:return null}}({x:A.clientX,y:A.clientY},B.getBoundingClientRect()),I="right"===C||"bottom"===C?-5:5;w(function(A){let Q=A.slice();return Q.sort((A,Q)=>A.xQ.x?1:A.yQ.y?1:0),function(A){if(A.length<=1)return A.slice();let Q=[];for(let B=0;B=2;){let A=Q[Q.length-1],B=Q[Q.length-2];if((A.x-B.x)*(C.y-B.y)>=(A.y-B.y)*(C.x-B.x))Q.pop();else break}Q.push(C)}Q.pop();let B=[];for(let Q=A.length-1;Q>=0;Q--){let C=A[Q];for(;B.length>=2;){let A=B[B.length-1],Q=B[B.length-2];if((A.x-Q.x)*(C.y-Q.y)>=(A.y-Q.y)*(C.x-Q.x))B.pop();else break}B.push(C)}return(B.pop(),1===Q.length&&1===B.length&&Q[0].x===B[0].x&&Q[0].y===B[0].y)?Q:Q.concat(B)}(Q)}(["right"===C||"left"===C?{x:A.clientX+I,y:A.clientY}:{x:A.clientX,y:A.clientY+I},...function(A){let{top:Q,right:B,bottom:C,left:I}=A;return[{x:I,y:Q},{x:B,y:Q},{x:B,y:C},{x:I,y:C}]}(Q.getBoundingClientRect())])),s(!0)},[s]);return(0,AK.useEffect)(()=>()=>y(),[y]),(0,AK.useEffect)(()=>{if(D&&c){let A=A=>h(A,c),Q=A=>h(A,D);return D.addEventListener("pointerleave",A),c.addEventListener("pointerleave",Q),()=>{D.removeEventListener("pointerleave",A),c.removeEventListener("pointerleave",Q)}}},[D,c,h,y]),(0,AK.useEffect)(()=>{if(g){let A=A=>{let Q=A.target,B={x:A.clientX,y:A.clientY},C=(null==D?void 0:D.contains(Q))||(null==c?void 0:c.contains(Q)),I=!function(A,Q){let{x:B,y:C}=A,I=!1;for(let A=0,E=Q.length-1;AC!=M>C&&B<(D-g)*(C-w)/(M-w)+g&&(I=!I)}return I}(B,g);C?y():I&&(y(),M())};return document.addEventListener("pointermove",A),()=>document.removeEventListener("pointermove",A)}},[D,c,g,M,y]),(0,AK.createElement)(BZ,AU({},A,{ref:E}))}),[Bm,BT]=Bp(BF,{isInside:!1}),BZ=(0,AK.forwardRef)((A,Q)=>{let{__scopeTooltip:B,children:C,"aria-label":I,onEscapeKeyDown:E,onPointerDownOutside:g,...w}=A,D=Bl(BR,B),M=BN(B),{onClose:c}=D;return(0,AK.useEffect)(()=>(document.addEventListener(Bo,c),()=>document.removeEventListener(Bo,c)),[c]),(0,AK.useEffect)(()=>{if(D.trigger){let A=A=>{let Q=A.target;null!=Q&&Q.contains(D.trigger)&&c()};return window.addEventListener("scroll",A,{capture:!0}),()=>window.removeEventListener("scroll",A,{capture:!0})}},[D.trigger,c]),(0,AK.createElement)(Qg,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:E,onPointerDownOutside:g,onFocusOutside:A=>A.preventDefault(),onDismiss:c},(0,AK.createElement)(Bh,AU({"data-state":D.stateAttribute},M,w,{ref:Q,style:{...w.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)"}}),(0,AK.createElement)(Ao,null,C),(0,AK.createElement)(Bm,{scope:B,isInside:!0},(0,AK.createElement)(Br,{id:D.contentId,role:"tooltip"},I||C))))}),BO=A=>{let{__scopeTooltip:Q,children:B,open:C,defaultOpen:I=!1,onOpenChange:E,disableHoverableContent:g,delayDuration:w}=A,D=BJ(BF,A.__scopeTooltip),M=BN(Q),[c,s]=(0,AK.useState)(null),y=Am(),h=(0,AK.useRef)(0),k=null!=g?g:D.disableHoverableContent,n=null!=w?w:D.delayDuration,t=(0,AK.useRef)(!1),[K=!1,L]=Al({prop:C,defaultProp:I,onChange:A=>{A?(D.onOpen(),document.dispatchEvent(new CustomEvent(Bo))):D.onClose(),null==E||E(A)}}),U=(0,AK.useMemo)(()=>K?t.current?"delayed-open":"instant-open":"closed",[K]),i=(0,AK.useCallback)(()=>{window.clearTimeout(h.current),t.current=!1,L(!0)},[L]),G=(0,AK.useCallback)(()=>{window.clearTimeout(h.current),L(!1)},[L]),r=(0,AK.useCallback)(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{t.current=!0,L(!0)},n)},[n,L]);return(0,AK.useEffect)(()=>()=>window.clearTimeout(h.current),[]),(0,AK.createElement)(Bi,M,(0,AK.createElement)(BS,{scope:Q,contentId:y,open:K,stateAttribute:U,trigger:c,onTriggerChange:s,onTriggerEnter:(0,AK.useCallback)(()=>{D.isOpenDelayed?r():i()},[D.isOpenDelayed,r,i]),onTriggerLeave:(0,AK.useCallback)(()=>{k?G():window.clearTimeout(h.current)},[G,k]),onOpen:i,onClose:G,disableHoverableContent:k},B))},Bv=A=>{let{__scopeTooltip:Q,forceMount:B,children:C,container:I}=A,E=Bl(Bf,Q);return(0,AK.createElement)(Bd,{scope:Q,forceMount:B},(0,AK.createElement)(Au,{present:B||E.open},(0,AK.createElement)(BG,{asChild:!0,container:I},C)))},Bx=(0,QC.j)([],{variants:{display:{default:"inline-block",none:""},font:{mono:"font-mono",sans:"font-sans"},color:{verySubtle:"text-gray-700 dark:text-graydark-700",subtle:"text-gray-1000 dark:text-graydark-1000",contrast:"text-gray-1100 dark:text-white",lo:"text-white dark:text-graydark-50",accent:"text-accent-1100 dark:text-accentdark-1100",red:"text-red-700 dark:text-red-400",green:"text-emerald-700 dark:text-emerald-500",amber:"text-amber-600 dark:text-amber-500",none:""},weight:{extrabold:"font-extrabold",bold:"font-bold",medium:"font-medium",semibold:"font-semibold",regular:"font-normal",normal:"font-normal",light:"font-light",none:""},size:{10:"text-xxs",12:"text-xs",14:"text-sm",16:"text-base",18:"text-lg",20:"text-xl",24:"text-2xl",30:"text-3xl",36:"text-4xl",40:"text-5xl",48:"text-5xl",60:"text-6xl",64:"text-6xl"},scaleSize:{12:"text-xxs md:text-xs",14:"text-xs md:text-sm",16:"text-sm md:text-base",18:"text-base md:text-lg",20:"text-base md:text-xl",24:"text-xl md:text-2xl",30:"text-2xl md:text-3xl",36:"text-3xl md:text-4xl",40:"text-4xl md:text-5xl",48:"text-4xl md:text-5xl",60:"text-5xl md:text-6xl",64:"text-5xl md:text-6xl"},noWrap:{true:"whitespace-nowrap"},underline:{accent:"underline underline-offset-2 decoration-2 decoration-accent-900 dark:decoration-accentdark-900",show:"underline underline-offset-2 decoration-gray-1100 dark:decoration-gray-500",hover:"hover:underline underline-offset-2 decoration-gray-1100 dark:decoration-gray-500",none:""},ellipsis:{true:"overflow-hidden text-ellipsis whitespace-nowrap"},wrapEllipsis:{true:"overflow-hidden text-ellipsis"}},defaultVariants:{display:"default",weight:"regular",font:"sans",color:"contrast",underline:"none"}}),BV=AK.forwardRef((A,Q)=>{let{tag:B="span",className:C,font:I,color:E,weight:g,size:w,scaleSize:D,noWrap:M,underline:c,ellipsis:s,wrapEllipsis:y,...h}=A;return(0,At.jsx)(B,{ref:Q,className:(0,QC.cx)(C,Bx({font:I,color:E,weight:g,size:w,scaleSize:D,underline:c,noWrap:M,ellipsis:s,wrapEllipsis:y})),...h})}),Bz=AK.forwardRef((A,Q)=>{let{size:B="18",...C}=A;return(0,At.jsx)(BV,{tag:"p",...C,ref:Q,weight:"regular",scaleSize:B,color:"subtle",className:(0,QC.cx)("leading-relaxed md:leading-relaxed",A.className)})}),BW=(0,QC.j)(["transition-shadow ease-in-out duration-300","shadow-sm hover:shadow","rounded","border"],{variants:{color:{default:["bg-white dark:bg-graydark-200","border-gray-400 dark:border-graydark-400"],subtle:["border-gray-200 dark:border-graydark-200"]}},defaultVariants:{color:"default"}}),BP=AK.forwardRef((A,Q)=>{let{className:B,color:C,...I}=A;return(0,At.jsx)("div",{ref:Q,className:BW({className:B,color:C}),...I})});var Bq=B(93542);let BX=(void 0===Bq||Bq.env,"production"),B_=1/60*1e3,B$="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),B0="undefined"!=typeof window?A=>window.requestAnimationFrame(A):A=>setTimeout(()=>A(B$()),B_),B8=!0,B3=!1,B1=!1,B4={delta:0,timestamp:0},B2=["read","update","preRender","render","postRender"],B5=B2.reduce((A,Q)=>(A[Q]=function(A){let Q=[],B=[],C=0,I=!1,E=!1,g=new WeakSet,w={schedule:(A,E=!1,w=!1)=>{let D=w&&I,M=D?Q:B;return E&&g.add(A),-1===M.indexOf(A)&&(M.push(A),D&&I&&(C=Q.length)),A},cancel:A=>{let Q=B.indexOf(A);-1!==Q&&B.splice(Q,1),g.delete(A)},process:D=>{if(I){E=!0;return}if(I=!0,[Q,B]=[B,Q],B.length=0,C=Q.length)for(let B=0;BB3=!0),A),{}),B9=B2.reduce((A,Q)=>{let B=B5[Q];return A[Q]=(A,Q=!1,C=!1)=>(B3||CB(),B.schedule(A,Q,C)),A},{}),B6=B2.reduce((A,Q)=>(A[Q]=B5[Q].cancel,A),{}),B7=B2.reduce((A,Q)=>(A[Q]=()=>B5[Q].process(B4),A),{}),CA=A=>B5[A].process(B4),CQ=A=>{B3=!1,B4.delta=B8?B_:Math.max(Math.min(A-B4.timestamp,40),1),B4.timestamp=A,B1=!0,B2.forEach(CA),B1=!1,B3&&(B8=!1,B0(CQ))},CB=()=>{B3=!0,B8=!0,B1||B0(CQ)},CC=()=>B4,CI="undefined"!=typeof document,CE=CI?AK.useLayoutEffect:AK.useEffect;function Cg(){let A=(0,AK.useRef)(!1);return CE(()=>(A.current=!0,()=>{A.current=!1}),[]),A}let Cw=(0,AK.createContext)(null);function CD(A){let Q=(0,AK.useRef)(null);return null===Q.current&&(Q.current=A()),Q.current}class CM extends AK.Component{getSnapshotBeforeUpdate(A){let Q=this.props.childRef.current;if(Q&&A.isPresent&&!this.props.isPresent){let A=this.props.sizeRef.current;A.height=Q.offsetHeight||0,A.width=Q.offsetWidth||0,A.top=Q.offsetTop,A.left=Q.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Cc({children:A,isPresent:Q}){let B=(0,AK.useId)(),C=(0,AK.useRef)(null),I=(0,AK.useRef)({width:0,height:0,top:0,left:0});return(0,AK.useInsertionEffect)(()=>{let{width:A,height:E,top:g,left:w}=I.current;if(Q||!C.current||!A||!E)return;C.current.dataset.motionPopId=B;let D=document.createElement("style");return document.head.appendChild(D),D.sheet&&D.sheet.insertRule(` + */var B="function"==typeof Symbol&&Symbol.for,C=B?Symbol.for("react.element"):60103,I=B?Symbol.for("react.portal"):60106,E=B?Symbol.for("react.fragment"):60107,g=B?Symbol.for("react.strict_mode"):60108,w=B?Symbol.for("react.profiler"):60114,D=B?Symbol.for("react.provider"):60109,M=B?Symbol.for("react.context"):60110,c=B?Symbol.for("react.async_mode"):60111,s=B?Symbol.for("react.concurrent_mode"):60111,y=B?Symbol.for("react.forward_ref"):60112,h=B?Symbol.for("react.suspense"):60113,k=B?Symbol.for("react.suspense_list"):60120,n=B?Symbol.for("react.memo"):60115,t=B?Symbol.for("react.lazy"):60116,K=B?Symbol.for("react.block"):60121,L=B?Symbol.for("react.fundamental"):60117,U=B?Symbol.for("react.responder"):60118,i=B?Symbol.for("react.scope"):60119;function G(A){if("object"==typeof A&&null!==A){var Q=A.$$typeof;switch(Q){case C:switch(A=A.type){case c:case s:case E:case w:case g:case h:return A;default:switch(A=A&&A.$$typeof){case M:case y:case t:case n:case D:return A;default:return Q}}case I:return Q}}}function r(A){return G(A)===s}Q.AsyncMode=c,Q.ConcurrentMode=s,Q.ContextConsumer=M,Q.ContextProvider=D,Q.Element=C,Q.ForwardRef=y,Q.Fragment=E,Q.Lazy=t,Q.Memo=n,Q.Portal=I,Q.Profiler=w,Q.StrictMode=g,Q.Suspense=h,Q.isAsyncMode=function(A){return r(A)||G(A)===c},Q.isConcurrentMode=r,Q.isContextConsumer=function(A){return G(A)===M},Q.isContextProvider=function(A){return G(A)===D},Q.isElement=function(A){return"object"==typeof A&&null!==A&&A.$$typeof===C},Q.isForwardRef=function(A){return G(A)===y},Q.isFragment=function(A){return G(A)===E},Q.isLazy=function(A){return G(A)===t},Q.isMemo=function(A){return G(A)===n},Q.isPortal=function(A){return G(A)===I},Q.isProfiler=function(A){return G(A)===w},Q.isStrictMode=function(A){return G(A)===g},Q.isSuspense=function(A){return G(A)===h},Q.isValidElementType=function(A){return"string"==typeof A||"function"==typeof A||A===E||A===s||A===w||A===g||A===h||A===k||"object"==typeof A&&null!==A&&(A.$$typeof===t||A.$$typeof===n||A.$$typeof===D||A.$$typeof===M||A.$$typeof===y||A.$$typeof===L||A.$$typeof===U||A.$$typeof===i||A.$$typeof===K)},Q.typeOf=G},73887:function(A,Q,B){"use strict";A.exports=B(43459)},62333:function(A,Q){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */Q.read=function(A,Q,B,C,I){var E,g,w=8*I-C-1,D=(1<>1,c=-7,s=B?I-1:0,y=B?-1:1,h=A[Q+s];for(s+=y,E=h&(1<<-c)-1,h>>=-c,c+=w;c>0;E=256*E+A[Q+s],s+=y,c-=8);for(g=E&(1<<-c)-1,E>>=-c,c+=C;c>0;g=256*g+A[Q+s],s+=y,c-=8);if(0===E)E=1-M;else{if(E===D)return g?NaN:1/0*(h?-1:1);g+=Math.pow(2,C),E-=M}return(h?-1:1)*g*Math.pow(2,E-C)},Q.write=function(A,Q,B,C,I,E){var g,w,D,M=8*E-I-1,c=(1<>1,y=23===I?5960464477539062e-23:0,h=C?0:E-1,k=C?1:-1,n=Q<0||0===Q&&1/Q<0?1:0;for(isNaN(Q=Math.abs(Q))||Q===1/0?(w=isNaN(Q)?1:0,g=c):(g=Math.floor(Math.log(Q)/Math.LN2),Q*(D=Math.pow(2,-g))<1&&(g--,D*=2),g+s>=1?Q+=y/D:Q+=y*Math.pow(2,1-s),Q*D>=2&&(g++,D/=2),g+s>=c?(w=0,g=c):g+s>=1?(w=(Q*D-1)*Math.pow(2,I),g+=s):(w=Q*Math.pow(2,s-1)*Math.pow(2,I),g=0));I>=8;A[B+h]=255&w,h+=k,w/=256,I-=8);for(g=g<0;A[B+h]=255&g,h+=k,g/=256,M-=8);A[B+h-k]|=128*n}},39515:function(A,Q,B){var C=B(38761)(B(37772),"DataView");A.exports=C},89612:function(A,Q,B){var C=B(52118),I=B(96909),E=B(98138),g=B(4174),w=B(7942);function D(A){var Q=-1,B=null==A?0:A.length;for(this.clear();++QI?0:I+Q),(B=B>I?I:B)<0&&(B+=I),I=Q>B?0:B-Q>>>0,Q>>>=0;for(var E=Array(I);++C=I?A:C(A,Q,B)}},24019:function(A,Q,B){var C=B(37772)["__core-js_shared__"];A.exports=C},55463:function(A){A.exports=function(A){return function(Q,B,C){for(var I=-1,E=Object(Q),g=C(Q),w=g.length;w--;){var D=g[A?w:++I];if(!1===B(E[D],D,E))break}return Q}}},83126:function(A,Q,B){var C=B(23895),I=B(33880),E=B(8435),g=B(66188);A.exports=function(A){return function(Q){var B=I(Q=g(Q))?E(Q):void 0,w=B?B[0]:Q.charAt(0),D=B?C(B,1).join(""):Q.slice(1);return w[A]()+D}}},34311:function(A,Q,B){var C=B(81207),I=B(97329),E=B(11618),g=RegExp("['’]","g");A.exports=function(A){return function(Q){return C(E(I(Q).replace(g,"")),A,"")}}},61655:function(A,Q,B){var C=B(6435)({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"});A.exports=C},83043:function(A,Q,B){var C=B(38761),I=function(){try{var A=C(Object,"defineProperty");return A({},"",{}),A}catch(A){}}();A.exports=I},74871:function(A,Q,B){var C=B(45386),I=B(87064),E=B(59950);A.exports=function(A,Q,B,g,w,D){var M=1&B,c=A.length,s=Q.length;if(c!=s&&!(M&&s>c))return!1;var y=D.get(A),h=D.get(Q);if(y&&h)return y==Q&&h==A;var k=-1,n=!0,t=2&B?new C:void 0;for(D.set(A,Q),D.set(Q,A);++k-1&&A%1==0&&A-1}},94769:function(A,Q,B){var C=B(22218);A.exports=function(A,Q){var B=this.__data__,I=C(B,A);return I<0?(++this.size,B.push([A,Q])):B[I][1]=Q,this}},92411:function(A,Q,B){var C=B(89612),I=B(80235),E=B(10326);A.exports=function(){this.size=0,this.__data__={hash:new C,map:new(E||I),string:new C}}},36417:function(A,Q,B){var C=B(27937);A.exports=function(A){var Q=C(this,A).delete(A);return this.size-=Q?1:0,Q}},86928:function(A,Q,B){var C=B(27937);A.exports=function(A){return C(this,A).get(A)}},79493:function(A,Q,B){var C=B(27937);A.exports=function(A){return C(this,A).has(A)}},24150:function(A,Q,B){var C=B(27937);A.exports=function(A,Q){var B=C(this,A),I=B.size;return B.set(A,Q),this.size+=B.size==I?0:1,this}},75179:function(A){A.exports=function(A){var Q=-1,B=Array(A.size);return A.forEach(function(A,C){B[++Q]=[C,A]}),B}},73477:function(A){A.exports=function(A,Q){return function(B){return null!=B&&B[A]===Q&&(void 0!==Q||A in Object(B))}}},77777:function(A,Q,B){var C=B(30733);A.exports=function(A){var Q=C(A,function(A){return 500===B.size&&B.clear(),A}),B=Q.cache;return Q}},99191:function(A,Q,B){var C=B(38761)(Object,"create");A.exports=C},54248:function(A,Q,B){var C=B(60241)(Object.keys,Object);A.exports=C},4146:function(A,Q,B){A=B.nmd(A);var C=B(51242),I=Q&&!Q.nodeType&&Q,E=I&&A&&!A.nodeType&&A,g=E&&E.exports===I&&C.process,w=function(){try{var A=E&&E.require&&E.require("util").types;if(A)return A;return g&&g.binding&&g.binding("util")}catch(A){}}();A.exports=w},37157:function(A){var Q=Object.prototype.toString;A.exports=function(A){return Q.call(A)}},60241:function(A){A.exports=function(A,Q){return function(B){return A(Q(B))}}},37772:function(A,Q,B){var C=B(51242),I="object"==typeof self&&self&&self.Object===Object&&self,E=C||I||Function("return this")();A.exports=E},52842:function(A){A.exports=function(A){return this.__data__.set(A,"__lodash_hash_undefined__"),this}},52482:function(A){A.exports=function(A){return this.__data__.has(A)}},16909:function(A){A.exports=function(A){var Q=-1,B=Array(A.size);return A.forEach(function(A){B[++Q]=A}),B}},15243:function(A,Q,B){var C=B(80235);A.exports=function(){this.__data__=new C,this.size=0}},72858:function(A){A.exports=function(A){var Q=this.__data__,B=Q.delete(A);return this.size=Q.size,B}},4417:function(A){A.exports=function(A){return this.__data__.get(A)}},8605:function(A){A.exports=function(A){return this.__data__.has(A)}},71418:function(A,Q,B){var C=B(80235),I=B(10326),E=B(96738);A.exports=function(A,Q){var B=this.__data__;if(B instanceof C){var g=B.__data__;if(!I||g.length<199)return g.push([A,Q]),this.size=++B.size,this;B=this.__data__=new E(g)}return B.set(A,Q),this.size=B.size,this}},8435:function(A,Q,B){var C=B(50217),I=B(33880),E=B(63344);A.exports=function(A){return I(A)?E(A):C(A)}},54452:function(A,Q,B){var C=B(77777),I=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,E=/\\(\\)?/g,g=C(function(A){var Q=[];return 46===A.charCodeAt(0)&&Q.push(""),A.replace(I,function(A,B,C,I){Q.push(C?I.replace(E,"$1"):B||A)}),Q});A.exports=g},33812:function(A,Q,B){var C=B(4795),I=1/0;A.exports=function(A){if("string"==typeof A||C(A))return A;var Q=A+"";return"0"==Q&&1/A==-I?"-0":Q}},87035:function(A){var Q=Function.prototype.toString;A.exports=function(A){if(null!=A){try{return Q.call(A)}catch(A){}try{return A+""}catch(A){}}return""}},63344:function(A){var Q="\ud800-\udfff",B="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",C="\ud83c[\udffb-\udfff]",I="[^"+Q+"]",E="(?:\ud83c[\udde6-\uddff]){2}",g="[\ud800-\udbff][\udc00-\udfff]",w="(?:"+B+"|"+C+")?",D="[\\ufe0e\\ufe0f]?",M="(?:\\u200d(?:"+[I,E,g].join("|")+")"+D+w+")*",c=RegExp(C+"(?="+C+")|(?:"+[I+B+"?",B,E,g,"["+Q+"]"].join("|")+")"+(D+w+M),"g");A.exports=function(A){return A.match(c)||[]}},75304:function(A){var Q="\ud800-\udfff",B="\\u2700-\\u27bf",C="a-z\\xdf-\\xf6\\xf8-\\xff",I="A-Z\\xc0-\\xd6\\xd8-\\xde",E="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",g="['’]",w="["+E+"]",D="["+C+"]",M="[^"+Q+E+"\\d+"+B+C+I+"]",c="(?:\ud83c[\udde6-\uddff]){2}",s="[\ud800-\udbff][\udc00-\udfff]",y="["+I+"]",h="(?:"+D+"|"+M+")",k="(?:"+g+"(?:d|ll|m|re|s|t|ve))?",n="(?:"+g+"(?:D|LL|M|RE|S|T|VE))?",t="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\ud83c[\udffb-\udfff])?",K="[\\ufe0e\\ufe0f]?",L="(?:\\u200d(?:"+["[^"+Q+"]",c,s].join("|")+")"+K+t+")*",U="(?:"+["["+B+"]",c,s].join("|")+")"+(K+t+L),i=RegExp([y+"?"+D+"+"+k+"(?="+[w,y,"$"].join("|")+")","(?:"+y+"|"+M+")+"+n+"(?="+[w,y+h,"$"].join("|")+")",y+"?"+h+"+"+k,y+"+"+n,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])","\\d+",U].join("|"),"g");A.exports=function(A){return A.match(i)||[]}},96009:function(A,Q,B){var C=B(82108),I=B(34311)(function(A,Q,B){return Q=Q.toLowerCase(),A+(B?C(Q):Q)});A.exports=I},82108:function(A,Q,B){var C=B(66188),I=B(23779);A.exports=function(A){return I(C(A).toLowerCase())}},97329:function(A,Q,B){var C=B(61655),I=B(66188),E=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,g=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");A.exports=function(A){return(A=I(A))&&A.replace(E,C).replace(g,"")}},41225:function(A){A.exports=function(A,Q){return A===Q||A!=A&&Q!=Q}},72579:function(A,Q,B){var C=B(13324);A.exports=function(A,Q,B){var I=null==A?void 0:C(A,Q);return void 0===I?B:I}},93352:function(A,Q,B){var C=B(32726),I=B(1369);A.exports=function(A,Q){return null!=A&&I(A,Q,C)}},95041:function(A,Q,B){var C=B(20187),I=B(1369);A.exports=function(A,Q){return null!=A&&I(A,Q,C)}},23059:function(A){A.exports=function(A){return A}},79631:function(A,Q,B){var C=B(15183),I=B(15125),E=Object.prototype,g=E.hasOwnProperty,w=E.propertyIsEnumerable,D=C(function(){return arguments}())?C:function(A){return I(A)&&g.call(A,"callee")&&!w.call(A,"callee")};A.exports=D},86152:function(A){var Q=Array.isArray;A.exports=Q},67878:function(A,Q,B){var C=B(61049),I=B(61158);A.exports=function(A){return null!=A&&I(A.length)&&!C(A)}},73226:function(A,Q,B){A=B.nmd(A);var C=B(37772),I=B(36330),E=Q&&!Q.nodeType&&Q,g=E&&A&&!A.nodeType&&A,w=g&&g.exports===E?C.Buffer:void 0,D=w?w.isBuffer:void 0;A.exports=D||I},61049:function(A,Q,B){var C=B(53366),I=B(29259);A.exports=function(A){if(!I(A))return!1;var Q=C(A);return"[object Function]"==Q||"[object GeneratorFunction]"==Q||"[object AsyncFunction]"==Q||"[object Proxy]"==Q}},61158:function(A){A.exports=function(A){return"number"==typeof A&&A>-1&&A%1==0&&A<=9007199254740991}},29259:function(A){A.exports=function(A){var Q=typeof A;return null!=A&&("object"==Q||"function"==Q)}},15125:function(A){A.exports=function(A){return null!=A&&"object"==typeof A}},4795:function(A,Q,B){var C=B(53366),I=B(15125);A.exports=function(A){return"symbol"==typeof A||I(A)&&"[object Symbol]"==C(A)}},77598:function(A,Q,B){var C=B(35522),I=B(47826),E=B(4146),g=E&&E.isTypedArray,w=g?I(g):C;A.exports=w},90249:function(A,Q,B){var C=B(1634),I=B(86411),E=B(67878);A.exports=function(A){return E(A)?C(A):I(A)}},19950:function(A,Q,B){var C=B(13940),I=B(26548),E=B(68286);A.exports=function(A,Q){var B={};return Q=E(Q,3),I(A,function(A,I,E){C(B,Q(A,I,E),A)}),B}},34519:function(A,Q,B){var C=B(13940),I=B(26548),E=B(68286);A.exports=function(A,Q){var B={};return Q=E(Q,3),I(A,function(A,I,E){C(B,I,Q(A,I,E))}),B}},30733:function(A,Q,B){var C=B(96738);function I(A,Q){if("function"!=typeof A||null!=Q&&"function"!=typeof Q)throw TypeError("Expected a function");var B=function(){var C=arguments,I=Q?Q.apply(this,C):C[0],E=B.cache;if(E.has(I))return E.get(I);var g=A.apply(this,C);return B.cache=E.set(I,g)||E,g};return B.cache=new(I.Cache||C),B}I.Cache=C,A.exports=I},65798:function(A,Q,B){var C=B(20256),I=B(82952),E=B(21401),g=B(33812);A.exports=function(A){return E(A)?C(g(A)):I(A)}},57370:function(A,Q,B){var C=B(34311)(function(A,Q,B){return A+(B?"_":"")+Q.toLowerCase()});A.exports=C},30981:function(A){A.exports=function(){return[]}},36330:function(A){A.exports=function(){return!1}},66188:function(A,Q,B){var C=B(1054);A.exports=function(A){return null==A?"":C(A)}},23779:function(A,Q,B){var C=B(83126)("toUpperCase");A.exports=C},11618:function(A,Q,B){var C=B(45981),I=B(83559),E=B(66188),g=B(75304);A.exports=function(A,Q,B){return(A=E(A),void 0===(Q=B?void 0:Q))?I(A)?g(A):C(A):A.match(Q)||[]}},77105:function(A,Q,B){"use strict";let C=B(8006),I=Symbol("max"),E=Symbol("length"),g=Symbol("lengthCalculator"),w=Symbol("allowStale"),D=Symbol("maxAge"),M=Symbol("dispose"),c=Symbol("noDisposeOnSet"),s=Symbol("lruList"),y=Symbol("cache"),h=Symbol("updateAgeOnGet"),k=()=>1;class n{constructor(A){if("number"==typeof A&&(A={max:A}),A||(A={}),A.max&&("number"!=typeof A.max||A.max<0))throw TypeError("max must be a non-negative number");this[I]=A.max||1/0;let Q=A.length||k;if(this[g]="function"!=typeof Q?k:Q,this[w]=A.stale||!1,A.maxAge&&"number"!=typeof A.maxAge)throw TypeError("maxAge must be a number");this[D]=A.maxAge||0,this[M]=A.dispose,this[c]=A.noDisposeOnSet||!1,this[h]=A.updateAgeOnGet||!1,this.reset()}set max(A){if("number"!=typeof A||A<0)throw TypeError("max must be a non-negative number");this[I]=A||1/0,L(this)}get max(){return this[I]}set allowStale(A){this[w]=!!A}get allowStale(){return this[w]}set maxAge(A){if("number"!=typeof A)throw TypeError("maxAge must be a non-negative number");this[D]=A,L(this)}get maxAge(){return this[D]}set lengthCalculator(A){"function"!=typeof A&&(A=k),A!==this[g]&&(this[g]=A,this[E]=0,this[s].forEach(A=>{A.length=this[g](A.value,A.key),this[E]+=A.length})),L(this)}get lengthCalculator(){return this[g]}get length(){return this[E]}get itemCount(){return this[s].length}rforEach(A,Q){Q=Q||this;for(let B=this[s].tail;null!==B;){let C=B.prev;G(this,A,B,Q),B=C}}forEach(A,Q){Q=Q||this;for(let B=this[s].head;null!==B;){let C=B.next;G(this,A,B,Q),B=C}}keys(){return this[s].toArray().map(A=>A.key)}values(){return this[s].toArray().map(A=>A.value)}reset(){this[M]&&this[s]&&this[s].length&&this[s].forEach(A=>this[M](A.key,A.value)),this[y]=new Map,this[s]=new C,this[E]=0}dump(){return this[s].map(A=>!K(this,A)&&{k:A.key,v:A.value,e:A.now+(A.maxAge||0)}).toArray().filter(A=>A)}dumpLru(){return this[s]}set(A,Q,B){if((B=B||this[D])&&"number"!=typeof B)throw TypeError("maxAge must be a number");let C=B?Date.now():0,w=this[g](Q,A);if(this[y].has(A)){if(w>this[I])return U(this,this[y].get(A)),!1;let g=this[y].get(A).value;return this[M]&&!this[c]&&this[M](A,g.value),g.now=C,g.maxAge=B,g.value=Q,this[E]+=w-g.length,g.length=w,this.get(A),L(this),!0}let h=new i(A,Q,w,C,B);return h.length>this[I]?(this[M]&&this[M](A,Q),!1):(this[E]+=h.length,this[s].unshift(h),this[y].set(A,this[s].head),L(this),!0)}has(A){return!!this[y].has(A)&&!K(this,this[y].get(A).value)}get(A){return t(this,A,!0)}peek(A){return t(this,A,!1)}pop(){let A=this[s].tail;return A?(U(this,A),A.value):null}del(A){U(this,this[y].get(A))}load(A){this.reset();let Q=Date.now();for(let B=A.length-1;B>=0;B--){let C=A[B],I=C.e||0;if(0===I)this.set(C.k,C.v);else{let A=I-Q;A>0&&this.set(C.k,C.v,A)}}}prune(){this[y].forEach((A,Q)=>t(this,Q,!1))}}let t=(A,Q,B)=>{let C=A[y].get(Q);if(C){let Q=C.value;if(K(A,Q)){if(U(A,C),!A[w])return}else B&&(A[h]&&(C.value.now=Date.now()),A[s].unshiftNode(C));return Q.value}},K=(A,Q)=>{if(!Q||!Q.maxAge&&!A[D])return!1;let B=Date.now()-Q.now;return Q.maxAge?B>Q.maxAge:A[D]&&B>A[D]},L=A=>{if(A[E]>A[I])for(let Q=A[s].tail;A[E]>A[I]&&null!==Q;){let B=Q.prev;U(A,Q),Q=B}},U=(A,Q)=>{if(Q){let B=Q.value;A[M]&&A[M](B.key,B.value),A[E]-=B.length,A[y].delete(B.key),A[s].removeNode(Q)}};class i{constructor(A,Q,B,C,I){this.key=A,this.value=Q,this.length=B,this.now=C,this.maxAge=I||0}}let G=(A,Q,B,C)=>{let I=B.value;K(A,I)&&(U(A,B),A[w]||(I=void 0)),I&&Q.call(C,I.value,I.key,A)};A.exports=n},53207:function(A,Q,B){var C=B(96570);C.prototype.formulaEval=function(){"use strict";for(var A,Q,B,C=[],I=this.value,E=0;E"+Q.value+""+I[E].show+""+A.value+"",type:10}):C.push({value:(1!=Q.type?"(":"")+Q.value+(1!=Q.type?")":"")+""+A.value+"",type:1})):2===I[E].type||9===I[E].type?(A=C.pop(),Q=C.pop(),C.push({value:(1!=Q.type?"(":"")+Q.value+(1!=Q.type?")":"")+I[E].show+(1!=A.type?"(":"")+A.value+(1!=A.type?")":""),type:I[E].type})):12===I[E].type&&(A=C.pop(),Q=C.pop(),B=C.pop(),C.push({value:I[E].show+"("+B.value+","+Q.value+","+A.value+")",type:12}));return C[0].value},A.exports=C},66655:function(A,Q,B){"use strict";var C=B(72346);function I(A,Q){for(var B=0;Bk.length-2?k.length-1:A.length-D;B>0;B--)if(void 0!==k[B])for(I=0;I0&&aB)w.push(A);else{for(;B>=I&&!c||c&&I1)throw new C.Exception("Uncaught Syntax error");return E[0].value>1e15?"Infinity":parseFloat(E[0].value.toFixed(15))},C.eval=function(A,Q,B){return void 0===Q?this.lex(A).toPostfix().postfixEval():void 0!==B?this.lex(A,Q).toPostfix().postfixEval(B):void 0!==Q.length?this.lex(A,Q).toPostfix().postfixEval():this.lex(A).toPostfix().postfixEval(Q)},A.exports=C},93542:function(A,Q,B){"use strict";var C,I;A.exports=(null==(C=B.g.process)?void 0:C.env)&&"object"==typeof(null==(I=B.g.process)?void 0:I.env)?B.g.process:B(42351)},86570:function(A,Q,B){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return B(6723)}])},3440:function(A,Q,B){"use strict";B.d(Q,{u:function(){return w}});var C=B(52322),I=B(55261),E=B(36350),g=B(5137);function w(){let{openDialog:A}=(0,g.Rh)();return(0,C.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,C.jsx)(D,{title:E.z.walletAddNew.title,description:E.z.walletAddNew.description,onSelect:()=>A("walletAddNew")}),(0,C.jsx)(D,{title:E.z.walletAddRecover.title,description:E.z.walletAddRecover.description,onSelect:()=>A("walletAddRecover")}),(0,C.jsx)(D,{title:E.z.walletAddWatch.title,description:E.z.walletAddWatch.description,onSelect:()=>A("walletAddWatch")}),(0,C.jsx)(D,{title:E.z.walletAddLedger.title,description:E.z.walletAddLedger.description,onSelect:()=>A("walletAddLedger")})]})}function D(A){let{title:Q,description:B,disabled:E,onSelect:g}=A;return(0,C.jsx)(I.Wh3,{onClick:g,disabled:E,children:(0,C.jsxs)("div",{className:"flex flex-col gap-2 text-start",children:[(0,C.jsx)(I.X6q,{size:"20",children:Q}),(0,C.jsx)(I.nvN,{size:"14",color:"subtle",children:B})]})})}},12172:function(A,Q,B){"use strict";B.d(Q,{g:function(){return w}});var C=B(52322),I=B(55261),E=B(67537),g=B(5137);function w(A){let{wallet:{id:Q,metadata:B,state:w,actions:D},...M}=A,{openDialog:c}=(0,g.Rh)();return(0,C.jsxs)(I.h_2,{...M,children:[(0,C.jsx)(I.Juw,{children:"Actions"}),"seed"===B.type?"unlocked"===w.status?(0,C.jsxs)(I.Xiv,{onClick:A=>A.stopPropagation(),onSelect:()=>D.lock(),children:[(0,C.jsx)(I.KpP,{children:(0,C.jsx)(E.Lur,{})}),"Lock wallet"]}):(0,C.jsxs)(I.Xiv,{onClick:A=>A.stopPropagation(),onSelect:()=>D.unlock(),children:[(0,C.jsx)(I.KpP,{children:(0,C.jsx)(E.VmF,{})}),"Unlock wallet"]}):null,(0,C.jsxs)(I.Xiv,{onClick:A=>A.stopPropagation(),onSelect:()=>c("walletUpdate",{walletId:Q}),children:[(0,C.jsx)(I.KpP,{children:(0,C.jsx)(E.dr6,{})}),"Edit wallet"]}),(0,C.jsxs)(I.Xiv,{onClick:A=>A.stopPropagation(),onSelect:()=>c("walletRemove",{walletId:Q}),children:[(0,C.jsx)(I.KpP,{children:(0,C.jsx)(E.Jrl,{})}),"Delete wallet"]}),(0,C.jsxs)(I.Xiv,{onClick:A=>A.stopPropagation(),onSelect:()=>c("walletsRescan"),children:[(0,C.jsx)(I.KpP,{children:(0,C.jsx)(E.vs4,{})}),"Rescan blockchain"]})]})}},98334:function(A,Q,B){"use strict";B.d(Q,{_:function(){return I},h:function(){return E}});var C=B(43415);let I={home:"/",wallet:{base:"/wallets/",view:"/wallets/[id]",addresses:"/wallets/[id]/addresses"},node:{index:"/node",txPool:"/node/txpool",peers:"/node/peers"},login:"/login"},E=C.cz},9338:function(A,Q,B){"use strict";B.d(Q,{h:function(){return C}});let C=(0,B(55261).XBW)(15)},36350:function(A,Q,B){"use strict";B.d(Q,{_:function(){return w},z:function(){return g}});var C=B(52322),I=B(55261),E=B(67537);let g={walletAddNew:{title:"Create a wallet",description:(0,C.jsxs)(C.Fragment,{children:["Generate a new wallet seed. The seed will never be sent to"," ",(0,C.jsx)(I.EKh,{children:"walletd"}),", transactions are signed in the browser."]})},walletAddRecover:{title:"Recover a wallet",description:(0,C.jsxs)(C.Fragment,{children:["Restore a wallet from seed. The seed will never be sent to"," ",(0,C.jsx)(I.EKh,{children:"walletd"}),", transactions are signed in the browser."]})},walletAddWatch:{title:"Add a watch-only wallet",description:(0,C.jsx)(C.Fragment,{children:"Create a watch-only wallet that tracks a set of addresses."})},walletAddLedger:{title:"Add a Ledger hardware wallet",description:(0,C.jsx)(C.Fragment,{children:"Add a Ledger hardware wallet. Transactions are signed with your hardware device."})}},w={seed:{title:"Seed-based wallet",icon:(0,C.jsx)(E.sZp,{})},watch:{title:"Watch-only wallet",icon:(0,C.jsx)(E.xVB,{})},ledger:{title:"Ledger hardware wallet",icon:(0,C.jsx)(E._Gh,{})}}},54590:function(A,Q,B){"use strict";B.d(Q,{p:function(){return g}});var C=B(55261),I=B(2784),E=B(5137);function g(A){let{walletId:Q,response:B,filters:g}=A,{openDialog:w}=(0,E.Rh)(),D=(0,I.useMemo)(()=>B.data?B.data.map(A=>{let{address:B,description:C,metadata:I,spendPolicy:E}=A;return{id:B,address:B,description:C,spendPolicy:E,metadata:I||{},walletId:Q,onClick:()=>w("addressUpdate",{walletId:Q,address:B}),raw:A}}):null,[B.data,w,Q]),M=(0,C.c2j)(D,B.isValidating,B.error,g),c=(D||[]).reduce((A,Q)=>{let{metadata:B}=Q;return B.index>A?B.index:A},-1);return{dataset:D,dataState:M,error:B.error,lastIndex:c,filters:g}}},58723:function(A,Q,B){"use strict";B.d(Q,{OZ:function(){return L},Jz:function(){return K}});var C=B(52322),I=B(55261),E=B(90670),g=B(2784),w=B(3654),D=B(67537),M=B(5137);function c(A){let{address:{walletId:Q,id:B,metadata:g},...w}=A,{openDialog:c}=(0,M.Rh)(),s=(0,E.XF)();return(0,C.jsxs)(I.h_2,{...w,children:[(0,C.jsx)(I.Juw,{children:"Actions"}),(0,C.jsxs)(I.Xiv,{onClick:A=>A.stopPropagation(),onSelect:()=>c("confirm",{title:void 0!==g.index?"Remove address ".concat(g.index):"Remove address",action:"Remove",variant:"red",body:(0,C.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,C.jsx)(I.nvN,{size:"14",children:"Are you sure you would like to remove the following address?"}),(0,C.jsxs)(I.nvN,{size:"14",font:"mono",children:[(0,I.I13)(B).slice(0,40),"..."]})]}),onConfirm:async()=>{let A=await s.delete({params:{id:Q,addr:B}});A.error?(0,I.OHV)({title:"Error deleting address",body:A.error}):(0,I.OPV)({title:void 0!==g.index?"Address ".concat(g.index," removed"):"Address removed"})}}),children:[(0,C.jsx)(I.KpP,{children:(0,C.jsx)(D.Jrl,{})}),"Remove address"]})]})}let s=[{id:"actions",label:"",fixed:!0,cellClassName:"w-[50px] !pl-2 !pr-4 [&+*]:!pl-0",render:A=>{let{data:Q}=A;return(0,C.jsx)(c,{trigger:(0,C.jsx)(I.zxk,{variant:"ghost",icon:"hover",children:(0,C.jsx)(D.EMN,{})}),contentProps:{align:"start"},address:Q})}},{id:"address",label:"address",category:"general",fixed:!0,render:A=>{let{data:{address:Q,description:B},context:E}=A;return(0,C.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,C.jsx)(I.XxW,{maxLength:40,value:Q,type:"address",siascanUrl:E.siascanUrl}),B&&(0,C.jsx)(I.ua7,{content:(0,C.jsx)("pre",{children:(0,C.jsx)(I.nvN,{size:"12",className:"w-full whitespace-pre-wrap",children:B})}),children:(0,C.jsx)(I.nvN,{size:"12",children:B.split("\n")[0]})})]})}},{id:"index",label:"index",category:"general",render:A=>{let{data:{metadata:Q}}=A;return void 0===Q.index?null:(0,C.jsx)("div",{className:"flex flex-col gap-2",children:(0,C.jsx)(I.xvT,{children:Q.index.toLocaleString()})})}}];var y=B(5632),h=B(74667),k=B(9338),n=B(54590);let t=(0,g.createContext)({}),K=()=>(0,g.useContext)(t);function L(A){let{children:Q}=A,B=function(){let A=(0,y.useRouter)().query.id,Q=(0,E.bd)({disabled:!A,params:{id:A},config:{swr:{refreshInterval:k.h}}}),{filters:B,setFilter:C,removeFilter:D,removeLastFilter:M,resetFilters:c}=(0,I.Wdu)(),{dataset:t,dataState:K,lastIndex:L}=(0,n.p)({walletId:A,response:Q,filters:B}),{configurableColumns:U,enabledColumns:i,sortableColumns:G,toggleColumnVisibility:r,setColumnsVisible:p,setColumnsHidden:a,toggleSort:N,setSortDirection:o,setSortField:e,sortField:J,sortDirection:F,resetDefaultColumnVisibility:S}=(0,I.oy6)("walletd/v0/addresses",{columns:s,columnsDefaultVisible:w.gd,sortOptions:w.Fo,defaultSortField:w.nw}),l=(0,I._4u)({dataset:t,filters:B,sortField:J,sortDirection:F}),H=(0,g.useMemo)(()=>s.filter(A=>A.fixed||i.includes(A.id)),[i]),Y=(0,h.B)(),f=(0,g.useMemo)(()=>({siascanUrl:Y}),[Y]);return{dataState:K,error:Q.error,datasetCount:(null==l?void 0:l.length)||0,columns:H,dataset:l,cellContext:f,lastIndex:L,configurableColumns:U,enabledColumns:i,sortableColumns:G,toggleColumnVisibility:r,setColumnsVisible:p,setColumnsHidden:a,toggleSort:N,setSortDirection:o,setSortField:e,sortField:J,filters:B,setFilter:C,removeFilter:D,removeLastFilter:M,resetFilters:c,sortDirection:F,resetDefaultColumnVisibility:S}}();return(0,C.jsx)(t.Provider,{value:B,children:Q})}},3654:function(A,Q,B){"use strict";B.d(Q,{Fo:function(){return E},gd:function(){return C},nw:function(){return I}});let C=["actions","address","index"],I="index",E=[{id:"address",label:"address",category:"general"},{id:"index",label:"index",category:"general"}]},5137:function(A,Q,B){"use strict";B.d(Q,{Tu:function(){return AZ},xQ:function(){return AO},Rh:function(){return AT}});var C=B(52322),I=B(2784),E=B(55261),g=B(90670),w=B(3440);function D(A){let{open:Q,trigger:B,onOpenChange:I}=A;return(0,C.jsx)(E.VqE,{title:"Add Wallet",trigger:B,open:Q,onOpenChange:I,contentVariants:{className:"max-w-[600px]"},children:(0,C.jsx)(w.u,{})})}var M=B(67537),c=B(63955),s=B(23312),y=B(36350),h=B(81395);function k(A){let{copySeed:Q,children:B,icon:I,description:g}=A;return(0,C.jsxs)("div",{className:"",children:[B,(0,C.jsx)(E.s_4,{className:"mt-2",children:(0,C.jsxs)("div",{className:"flex gap-6 items-center py-4 px-4",children:[(0,C.jsx)("div",{className:"flex",children:I}),(0,C.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,C.jsx)(E.nvN,{size:"14",children:g}),Q&&(0,C.jsx)(E.zxk,{onClick:Q,children:"Copy Seed to Clipboard"})]})]})})]})}var n=B(48869);let t={name:"",description:"",mnemonic:"",hasCopied:!1};function K(A){let{trigger:Q,open:B,onOpenChange:w}=A,{openDialog:D}=AT(),K=(0,g.lT)(),L=(0,c.cI)({mode:"all",defaultValues:t}),U=L.watch("mnemonic"),i=(0,I.useCallback)(()=>{(0,E.vQq)(U,"seed"),L.setValue("hasCopied",!0,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),L.clearErrors(["mnemonic"])},[U,L]),G=(0,I.useCallback)(async()=>{let{phrase:A}=(0,n.K)().wallet.generateSeedPhrase();L.setValue("hasCopied",!1),L.setValue("mnemonic",A),L.clearErrors(["hasCopied","mnemonic"])},[L]);(0,I.useEffect)(()=>{B&&G()},[B]);let{dataset:r}=(0,s.r)(),p=function(A){let{walletNames:Q,copySeed:B}=A;return{name:{type:"text",title:"Name",placeholder:"name",validation:{validate:{unique:A=>!Q.includes(A)||"name is already in use"},required:"required",maxLength:30}},description:{type:"text",title:"Description",placeholder:"Optional description or notes about the wallet.",validation:{maxLength:200}},mnemonic:{type:"text",title:"Seed",onClick:A=>{A.currentTarget.select(),B()},readOnly:!0,placeholder:"",validation:{required:"required",validate:{valid:A=>{let{error:Q}=(0,n.K)().wallet.keyPairFromSeedPhrase(A,0);return!Q||"seed should be 12 word BIP39 mnemonic"},copied:(A,Q)=>Q.hasCopied||"Copy seed to continue"}}},hasCopied:{type:"boolean",title:"",validation:{}}}}({walletNames:(null==r?void 0:r.map(A=>A.name))||[],copySeed:i}),a=(0,I.useCallback)(async A=>{let Q=A.mnemonic.trim(),B=(0,h.blake2bHex)(Q),C=await K.post({payload:{name:A.name,description:A.description,metadata:{type:"seed",mnemonicHash:B}}});C.error?(0,E.OHV)({title:"Error creating wallet",body:C.error}):(D("walletAddressesGenerate",{walletId:C.data.id}),L.reset(t))},[L,D,K]);return(0,C.jsx)(E.VqE,{title:y.z.walletAddNew.title,trigger:Q,open:B,onOpenChange:w,contentVariants:{className:"w-[400px]"},onSubmit:L.handleSubmit(a),controls:(0,C.jsxs)("div",{className:"flex gap-2 px-1",children:[(0,C.jsx)(E.zxk,{size:"medium",onClick:()=>{D("walletAddType")},children:"back"}),(0,C.jsx)("div",{className:"flex-1"}),(0,C.jsx)(E.ZqQ,{size:"medium",form:L,children:"Add wallet"})]}),children:(0,C.jsxs)("div",{className:"flex flex-col gap-4 mb-2",children:[(0,C.jsx)(E.nvN,{size:"14",color:"subtle",children:y.z.walletAddNew.description}),(0,C.jsx)(E.yEL,{name:"name",form:L,fields:p}),(0,C.jsx)(E.Bau,{name:"description",form:L,fields:p}),(0,C.jsx)(k,{icon:(0,C.jsx)(M.fwm,{}),description:(0,C.jsx)(C.Fragment,{children:"This is the wallet's seed mnemonic. Make sure to save it somewhere secure."}),children:(0,C.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,C.jsx)(E.Bau,{form:L,fields:p,name:"mnemonic"}),(0,C.jsxs)("div",{className:"flex gap-2",children:[(0,C.jsxs)(E.zxk,{className:"flex-1",onClick:G,children:[(0,C.jsx)(M.nt4,{}),"Regenerate"]}),(0,C.jsxs)(E.zxk,{className:"flex-1",onClick:i,children:[(0,C.jsx)(M.olJ,{}),"Copy to clipboard"]})]})]})})]})})}var L=B(6391),U=B.n(L);function i(A){let{mnemonicHash:Q,mnemonicFieldType:B,setMnemonicFieldType:I}=A;return{type:B,title:"Seed",actions:(0,C.jsx)("div",{className:"flex gap-1",children:(0,C.jsx)(E.zxk,{tip:"password"===B?"Show seed":"Hide seed",tabIndex:-1,variant:"ghost",icon:"hover",onClick:()=>I("password"===B?"text":"password"),children:"password"===B?(0,C.jsx)(M.pHg,{}):(0,C.jsx)(M.xVB,{})})}),placeholder:"island submit vague scrub exhibit cherry front spoon crop debate filter virus",validation:{required:"required",validate:{valid:A=>{let{error:Q}=(0,n.K)().wallet.keyPairFromSeedPhrase(A,0);return!Q||"seed should be 12 word BIP39 mnemonic"},match:A=>(0,h.blake2bHex)(A)===Q||"seed phrase does not match"}}}}var G=B(3584);function r(A){let{walletId:Q,name:B,form:I,fields:g,actionText:w}=A,{dataset:D,walletAutoLockEnabled:c,walletAutoLockTimeout:y}=(0,s.r)(),h=null==D?void 0:D.find(A=>A.id===Q),n=null==h?void 0:h.state.mnemonic,t=(0,G.l)(y),K=w?" and ".concat(w):"";return n?(0,C.jsx)(k,{icon:(0,C.jsx)(M.R$y,{}),description:c?(0,C.jsxs)(C.Fragment,{children:["The wallet is currently unlocked. The wallet will stay unlocked until it is inactive for ",t.amount," ",t.units,", manually locked, or the app is closed."]}):(0,C.jsx)(C.Fragment,{children:"The wallet is currently unlocked. The wallet will stay unlocked until it is manually locked or the app is closed."})}):(0,C.jsx)(k,{icon:(0,C.jsx)(M.R$y,{}),description:c?(0,C.jsxs)(C.Fragment,{children:["Enter your seed mnemonic to unlock the wallet",K,". The wallet will stay unlocked until it is inactive for"," ",t.amount," ",t.units,", manually locked, or the app is closed."]}):(0,C.jsxs)(C.Fragment,{children:["Enter your seed mnemonic to unlock the wallet and",K,". The wallet will stay unlocked until it is manually locked or the app is closed."]}),children:(0,C.jsx)(E.yEL,{form:I,fields:g,name:B})})}var p=B(9338),a=B(54590);let N=[];function o(A){let{id:Q}=A,B=(0,g.bd)({disabled:!Q,params:{id:Q},config:{swr:{refreshInterval:p.h}}}),{dataset:C,dataState:I,lastIndex:E}=(0,a.p)({walletId:Q,response:B,filters:N});return{dataState:I,error:B.error,datasetCount:(null==C?void 0:C.length)||0,dataset:C,lastIndex:E}}function e(A){let{label:Q,description:B}=A;return(0,C.jsx)(E.bZj,{className:"!p-2",children:(0,C.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,C.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,C.jsx)(E.xvT,{children:(0,C.jsx)(M.qdM,{})}),(0,C.jsx)(E.xvT,{weight:"medium",children:Q})]}),(0,C.jsx)(E.xvT,{size:"14",color:"subtle",children:B})]})})}function J(){return{shouldRescan:{type:"boolean",title:"Enable",validation:{}},rescanStartHeight:{type:"number",decimalsLimit:0,title:"Start height",validation:{}}}}function F(){let{rescanStartHeight:A}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{shouldRescan:!1,rescanStartHeight:new(U())(A||0)}}function S(A){let{form:Q,fields:B}=A,I=Q.watch("shouldRescan");return(0,C.jsxs)("div",{className:"flex flex-col gap-1 pt-4",children:[(0,C.jsx)(E.Z0O,{className:"w-full my-2"}),(0,C.jsx)(E.__J,{color:"contrast",className:"pb-2",size:"16",children:"Advanced"}),(0,C.jsx)("div",{className:"flex flex-col gap-2",children:(0,C.jsx)(E.__J,{color:"contrast",children:"Rescan"})}),(0,C.jsxs)("div",{className:"flex justify-start gap-3",children:[(0,C.jsx)(E.QBj,{form:Q,fields:B,name:"shouldRescan"}),I&&(0,C.jsx)(E.jIp,{form:Q,fields:B,name:"rescanStartHeight"})]}),I&&(0,C.jsx)(E.xvT,{size:"14",color:"subtle",children:"Rescan the blockchain from the specified start height to find any missing transaction activity across all wallets."}),I&&(0,C.jsxs)("div",{className:"pt-2 flex flex-col gap-2",children:[(0,C.jsx)(l,{}),(0,C.jsx)(H,{})]})]})}function l(){return(0,C.jsx)(e,{label:"Warning",description:(0,C.jsx)(C.Fragment,{children:"Only rescan the blockchain if you have added addresses with past transactions activity. Rescanning the blockchain is a very expensive operation and can take a long time."})})}function H(){return(0,C.jsx)(e,{label:"Warning",description:(0,C.jsx)(C.Fragment,{children:"For start height, select the highest block height possible, but one that you are sure is before the first transaction activity for the addresses you have added."})})}function Y(){let A=(0,g.Ap)();return async Q=>{if(Q.shouldRescan){let B=await A.post({payload:Q.rescanStartHeight?Q.rescanStartHeight.toNumber():0});B.error?(0,E.OHV)({title:"Error rescanning the blockchain",body:B.error}):(0,E.OPV)({title:"Rescanning the blockchain",body:"The blockchain is being rescanned for relevant wallet events."})}}}var f=B(38855);function d(A){let{params:Q,trigger:B,open:w,onOpenChange:D}=A,{walletId:M}=Q||{},{lastIndex:y}=o({id:M}),{dataset:h,cacheWalletMnemonic:k}=(0,s.r)(),t=null==h?void 0:h.find(A=>A.id===M),K=y+1,L=function(A){let{nextIndex:Q,currentHeight:B}=A;return{mnemonic:"",index:new(U())(Q),count:new(U())(1),...F({rescanStartHeight:B})}}({nextIndex:K,currentHeight:(0,f.n)().nodeBlockHeight}),[G,p]=(0,I.useState)("password"),a=(0,c.cI)({mode:"all",defaultValues:L});(0,I.useEffect)(()=>{a.formState.isSubmitting||a.setValue("index",new(U())(K))},[K]);let{handleOpenChange:N,closeAndReset:e}=(0,E.t0Y)({form:a,onOpenChange:D,defaultValues:L}),l=a.watch("mnemonic"),H=a.watch("index"),d=a.watch("count"),u=a.watch("shouldRescan"),R=function(A){let{mnemonicHash:Q,mnemonicFieldType:B,setMnemonicFieldType:C}=A;return{mnemonic:i({mnemonicHash:Q,setMnemonicFieldType:C,mnemonicFieldType:B}),index:{type:"number",title:"Start index",decimalsLimit:0,placeholder:"0",validation:{required:"required"}},count:{type:"number",title:"Number of addresses",decimalsLimit:0,placeholder:"10",validation:{required:"required",max:1e3}},...J()}}({mnemonicHash:null==t?void 0:t.metadata.mnemonicHash,mnemonicFieldType:G,setMnemonicFieldType:p}),j=(0,g.yi)(),b=(0,I.useCallback)(async(A,Q,B)=>{function C(A,Q,B){(0,E.OHV)({title:"Error generating addresses",body:Q>0?"".concat(Q+1,"/").concat(A," addresses were generated and saved. Batch failed on with: ").concat(B):B})}for(let I=Q;I{await b(t.state.mnemonic||l,H.toNumber(),d.toNumber()),m(A)},[b,l,H,d,t,m]);return(0,C.jsxs)(E.VqE,{title:"Wallet ".concat(null==t?void 0:t.name,": generate addresses"),trigger:B,open:w,onOpenChange:N,contentVariants:{className:"w-[500px]"},onSubmit:a.handleSubmit(T),controls:(0,C.jsx)("div",{className:"flex justify-end",children:(0,C.jsxs)(E.ZqQ,{form:a,size:"medium",variant:u?"red":"accent",children:["Generate addresses",u?" and rescan":""]})}),children:[(0,C.jsx)(r,{walletId:M,name:"mnemonic",form:a,fields:R,actionText:"generate addresses"}),(0,C.jsxs)("div",{className:"flex gap-2 w-full pt-3",children:[(0,C.jsx)("div",{className:"flex-1",children:(0,C.jsx)(E.jIp,{form:a,fields:R,name:"index"})}),(0,C.jsx)("div",{className:"flex-1",children:(0,C.jsx)(E.jIp,{form:a,fields:R,name:"count"})})]}),(0,C.jsx)(S,{form:a,fields:R})]})}var u=B(5632),R=B(98334);let j={name:""};function b(A){let{params:Q,trigger:B,open:w,onOpenChange:D}=A,M=(0,u.useRouter)(),{walletId:y}=Q||{},{closeDialog:h}=AT(),{dataset:k}=(0,s.r)(),n=null==k?void 0:k.find(A=>A.id===y),t=(0,g.OZ)(),K=(0,c.cI)({mode:"all",defaultValues:j}),L=(0,I.useCallback)(async()=>{let A=await t.delete({params:{id:y}});A.error?(0,E.OHV)({title:"Error removing wallet",body:A.error}):((0,E.OPV)({title:"Wallet permanently removed"}),K.reset(),h(),M.push(R._.home))},[K,y,t,h,M]),U=(0,I.useMemo)(()=>{var A;return{name:{type:"text",title:"Name",placeholder:A=null==n?void 0:n.name,validation:{required:"required",validate:{equals:Q=>Q===A||"name does not match"}}}}},[n]),i=(0,E.WsO)(U);return(0,C.jsx)(E.VqE,{title:"Remove wallet",trigger:B,open:w,onOpenChange:A=>{A||K.reset(j),D(A)},contentVariants:{className:"w-[400px]"},onSubmit:K.handleSubmit(L,i),children:(0,C.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,C.jsxs)(E.nvN,{size:"14",children:["Are you sure you would like to permanently remove the wallet"," ",(0,C.jsx)(E.EKh,{children:null==n?void 0:n.name}),"?"]}),(0,C.jsx)(E.nvN,{size:"14",children:"Enter the wallet name to confirm the removal."}),(0,C.jsx)(E.yEL,{name:"name",form:K,fields:U}),(0,C.jsx)(E.ZqQ,{variant:"red",form:K,children:"Remove"})]})})}function m(A){let{trigger:Q,open:B,onOpenChange:w,params:D}=A,{walletId:M,address:s}=D||{},{openDialog:y}=AT(),{dataset:h,dataState:k}=o({id:M}),n=null==h?void 0:h.find(A=>A.id===s),t=(0,g.yi)(),K=function(A){let{description:Q}=A;return{description:Q||""}}({description:null==n?void 0:n.description}),L=(0,c.cI)({mode:"all",defaultValues:K}),{handleOpenChange:U,closeAndReset:i}=(0,E.t0Y)({form:L,onOpenChange:w,defaultValues:K,initKey:[D,void 0===k]}),G=(0,I.useCallback)(async A=>{let Q=await t.put({params:{id:M},payload:{...n.raw,address:s,description:A.description}});Q.error?(0,E.OHV)({title:"Error updating address",body:Q.error}):i()},[M,s,t,n,i]);return(0,C.jsx)(E.VqE,{title:(0,E.$Gg)(s,20),trigger:Q,open:B,onOpenChange:U,contentVariants:{className:"w-[400px]"},onSubmit:L.handleSubmit(G),controls:(0,C.jsxs)("div",{className:"flex gap-2 px-1",children:[(0,C.jsx)(E.zxk,{onClick:()=>y("addressRemove",{walletId:M,address:s}),children:"Remove address"}),(0,C.jsx)("div",{className:"flex-1"}),(0,C.jsx)(E.ZqQ,{size:"small",form:L,children:"Save changes"})]}),children:(0,C.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,C.jsx)(E.hKn,{address:(null==n?void 0:n.address)||""}),(0,C.jsx)(E.Bau,{name:"description",form:L,fields:{description:{type:"text",title:"Description",placeholder:"Optional description or notes about the wallet.",validation:{maxLength:200}}}})]})})}let T={name:"",description:""};function Z(A){let{params:Q,trigger:B,open:w,onOpenChange:D}=A,{walletId:M}=Q||{},{dataset:y}=(0,s.r)(),h=null==y?void 0:y.find(A=>A.id===M),k=(0,g.SK)(),n=h?{name:h.name,description:h.description}:T,t=(0,c.cI)({mode:"all",defaultValues:n}),{handleOpenChange:K,closeAndReset:L}=(0,E.t0Y)({form:t,onOpenChange:D,defaultValues:n}),U=function(A){let{walletNames:Q}=A;return{name:{type:"text",title:"Name",placeholder:"name",validation:{validate:{unique:A=>!Q.includes(A)||"name is already in use"},required:"required",maxLength:30}},description:{type:"text",title:"Description",placeholder:"Optional description or notes about the wallet.",validation:{maxLength:200}}}}({walletNames:(0,I.useMemo)(()=>(null==y?void 0:y.reduce((A,Q)=>Q.name!==(null==h?void 0:h.name)?A.concat(Q.name):A,[]))||[],[y,h])}),i=(0,I.useCallback)(async A=>{let Q=await k.post({params:{id:M},payload:{...h.raw,name:A.name,description:A.description}});Q.error?(0,E.OHV)({title:"Error updating wallet",body:Q.error}):L()},[M,k,h,L]);return(0,C.jsx)(E.VqE,{title:"".concat(null==h?void 0:h.name),trigger:B,open:w,onOpenChange:K,contentVariants:{className:"w-[400px]"},onSubmit:t.handleSubmit(i),controls:(0,C.jsxs)("div",{className:"flex gap-2 px-1",children:[(0,C.jsx)("div",{className:"flex-1"}),(0,C.jsx)(E.ZqQ,{size:"medium",form:t,children:"Save changes"})]}),children:(0,C.jsxs)("div",{className:"flex flex-col gap-4 mb-2",children:[(0,C.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,C.jsx)(E.__J,{children:"Type"}),(0,C.jsx)("div",{children:(0,C.jsx)(E.Cts,{children:null==h?void 0:h.metadata.type})})]}),(0,C.jsx)(E.yEL,{name:"name",form:t,fields:U}),(0,C.jsx)(E.Bau,{name:"description",form:t,fields:U})]})})}var O=B(79381),x=B(16694),v=B(73866),V=B(27748);async function z(){return(await Promise.all([v.Z.isSupported().then(async A=>{let Q=await W();return A&&!Q?"Bluetooth":null}),V.Z.isSupported().then(A=>A?"HID":null)])).filter(A=>A)}async function W(){return navigator.brave&&await navigator.brave.isBrave()}function P(A){let{title:Q,details:B,actions:I,shouldVerify:g}=A,{device:w,disconnect:D}=(0,x.c)();return(0,C.jsx)(E.s_4,{className:"mt-1 pl-3 pr-2 py-2",children:(0,C.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,C.jsxs)("div",{className:"flex gap-1 justify-between items-center",children:[(0,C.jsxs)("div",{className:"flex items-center",children:[g?(0,C.jsxs)(C.Fragment,{children:[!(null==w?void 0:w.publicKey0)&&(0,C.jsxs)("div",{className:"relative w-2 h-2 mr-2",children:[(0,C.jsx)("div",{className:"absolute w-2 h-2 rounded-full bg-amber-400 animate-pingslow"}),(0,C.jsx)("div",{className:"absolute w-2 h-2 rounded-full bg-amber-500 border border-amber-400"})]}),!!(null==w?void 0:w.publicKey0)&&(0,C.jsxs)("div",{className:"relative w-2 h-2 mr-2",children:[(0,C.jsx)("div",{className:"absolute w-2 h-2 rounded-full bg-green-400 animate-pingslow"}),(0,C.jsx)("div",{className:"absolute w-2 h-2 rounded-full bg-green-500 border border-green-400"})]})]}):(0,C.jsxs)("div",{className:"relative w-2 h-2 mr-2",children:[(0,C.jsx)("div",{className:"absolute w-2 h-2 rounded-full bg-green-400 animate-pingslow"}),(0,C.jsx)("div",{className:"absolute w-2 h-2 rounded-full bg-green-500 border border-green-400"})]}),(null==w?void 0:w.type)==="Bluetooth"&&(0,C.jsx)(E.ua7,{content:"Bluetooth",children:(0,C.jsx)(E.xvT,{weight:"semibold",size:"16",children:(0,C.jsx)(M.Ya6,{})})}),(null==w?void 0:w.type)==="USB"&&(0,C.jsx)(E.ua7,{content:"USB",children:(0,C.jsx)(E.xvT,{weight:"semibold",size:"16",children:(0,C.jsx)(M.Fhn,{size:16})})}),(null==w?void 0:w.type)==="HID"&&(0,C.jsx)(E.ua7,{content:"HID",children:(0,C.jsx)(E.xvT,{weight:"semibold",size:"16",children:(0,C.jsx)(M.Pj_,{size:16})})}),(0,C.jsx)(E.xvT,{weight:"semibold",size:"16",className:"ml-1",children:Q})]}),(0,C.jsxs)("div",{className:"flex gap-1 justify-between items-center",children:[I,!!w&&(0,C.jsx)(E.zxk,{variant:"ghost",onClick:D,children:(0,C.jsx)(M.PcV,{})})]})]}),B]})})}let q={transportType:""};function X(A){var Q;let{shouldVerify:B}=A,{device:g,connect:w,verify:D,setError:s,waitingForUser:y}=(0,x.c)(),h=(0,c.cI)({mode:"all",defaultValues:q}),k=h.watch("transportType"),n=!!(null==g?void 0:g.publicKey0),t=(0,O.ZP)("deviceConnect/supportedTransports",()=>z(),{revalidateOnFocus:!1});(0,I.useEffect)(()=>{t.data&&(h.setValue("transportType",t.data[0]),0===t.data.length&&s(Error("This browser does not support connecting to Ledger devices, please use a different browser.")))},[t.data]);let K=function(A){let{supportedTransports:Q}=A;return{transportType:{type:"select",title:"Transport",placeholder:"Select a transport",options:Q.map(A=>({value:A,label:A})),validation:{required:!0}}}}({supportedTransports:t.data||[]}),L=(0,I.useCallback)(async()=>{k&&w(k)},[w,k]),U=(0,I.useCallback)(async()=>{k&&await D()},[D,k]);return(0,C.jsx)("div",{className:"flex flex-col gap-1",children:g?B?n?(0,C.jsx)(P,{shouldVerify:B,title:g.transport.deviceModel.productName,details:(0,C.jsx)("div",{className:"flex flex-col gap-1",children:(0,C.jsx)(E.XxW,{value:g.publicKey0,label:"public key 0",color:"subtle",maxLength:30})})}):(0,C.jsx)(P,{shouldVerify:B,title:g.transport.deviceModel.productName,actions:(0,C.jsx)(C.Fragment,{children:(0,C.jsxs)(E.zxk,{variant:"accent",onClick:U,children:[(0,C.jsx)(M.j7C,{}),"Verify"]})}),details:y?(0,C.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,C.jsx)(E.xvT,{children:"Please confirm on device..."}),(0,C.jsx)(E.nvN,{size:"14",color:"subtle",children:"To continue, approve public key verification on device."})]}):(0,C.jsx)("div",{className:"flex flex-col gap-1",children:(0,C.jsx)(E.nvN,{size:"14",children:"Unlock device, open the Sia app, and make sure Ledger Live is closed. Then start wallet verification to continue."})})}):(0,C.jsx)(P,{shouldVerify:B,title:g.transport.deviceModel.productName}):(0,C.jsx)(P,{shouldVerify:B,title:"Connect Ledger...",actions:(null===(Q=t.data)||void 0===Q?void 0:Q.length)?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(E.WyV,{name:"transportType",form:h,fields:K,group:!1}),(0,C.jsx)(E.zxk,{size:"small",onClick:L,children:"Connect"})]}):null,details:y?(0,C.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,C.jsx)(E.xvT,{children:"Please confirm in browser and on device..."}),(0,C.jsx)(E.nvN,{size:"14",color:"subtle",children:"Connect your Ledger device. Make sure you unlock your Ledger and open the Sia App before trying to connect."})]}):(0,C.jsx)(E.nvN,{size:"14",color:"subtle",children:"Connect your Ledger device. Make sure you unlock your Ledger and open the Sia App before trying to connect."})})})}let _={name:"",description:"",ledgerConnectedAndVerified:!1};function $(A){let{trigger:Q,open:B,onOpenChange:w}=A,{openDialog:D}=AT(),M=(0,g.lT)(),h=(0,c.cI)({mode:"all",defaultValues:_}),{device:k,disconnect:t,error:K}=(0,x.c)();(0,I.useEffect)(()=>{B&&t()},[B]),(0,I.useEffect)(()=>{k&&k.publicKey0?h.setValue("ledgerConnectedAndVerified",!0):h.setValue("ledgerConnectedAndVerified",!1)},[h,k]),(0,I.useEffect)(()=>{K?h.setError("ledgerConnectedAndVerified",{message:K.message}):h.clearErrors("ledgerConnectedAndVerified")},[h,K]);let{dataset:L}=(0,s.r)(),U=function(A){let{walletNames:Q}=A;return{name:{type:"text",title:"Name",placeholder:"name",validation:{validate:{unique:A=>!Q.includes(A)||"name is already in use"},required:"required",maxLength:30}},description:{type:"text",title:"Description",placeholder:"Optional description or notes about the wallet.",validation:{maxLength:200}},ledgerConnectedAndVerified:{type:"boolean",title:"",validation:{validate:{ledgerConnectedAndVerified:A=>A||"Ledger must be connected, unlocked, and verified"}}}}}({walletNames:(null==L?void 0:L.map(A=>A.name))||[]}),i=(0,g.yi)(),G=(0,I.useCallback)(async(A,Q)=>{let{unlockConditions:B,address:C}=Q;if((await i.put({params:{id:A},payload:{address:C,description:"",metadata:{index:0,unlockConditions:B}}})).error){(0,E.OHV)({title:"Error saving address"});return}},[i]),r=(0,I.useCallback)(async A=>{if(!A.ledgerConnectedAndVerified||!k.publicKey0||!k.address0)return;let Q={type:"ledger",publicKey0:k.publicKey0,address0:k.address0},B=await M.post({payload:{name:A.name,description:A.description,metadata:Q}});if(B.error)(0,E.OHV)({title:"Error saving wallet",body:B.error});else{let A=(0,n.K)().wallet.standardUnlockConditions(k.publicKey0);A.error||G(B.data.id,{unlockConditions:A.unlockConditions,address:k.address0}),D("walletLedgerAddressGenerate",{walletId:B.data.id,walletJustCreated:!0}),h.reset(_)}},[h,D,M,k,G]);return h.register("ledgerConnectedAndVerified",U.ledgerConnectedAndVerified.validation),(0,C.jsx)(E.VqE,{title:y.z.walletAddLedger.title,trigger:Q,open:B,onOpenChange:w,contentVariants:{className:"w-[400px]"},onSubmit:h.handleSubmit(r),controls:(0,C.jsxs)("div",{className:"flex gap-2 pb-1",children:[(0,C.jsx)(E.zxk,{size:"medium",onClick:()=>{D("walletAddType")},children:"back"}),(0,C.jsx)("div",{className:"flex-1"}),(0,C.jsx)(E.ZqQ,{size:"medium",form:h,children:"Add wallet"})]}),children:(0,C.jsxs)("div",{className:"flex flex-col gap-4 mb-2",children:[(0,C.jsx)(E.nvN,{size:"14",color:"subtle",children:y.z.walletAddLedger.description}),(0,C.jsx)(E.yEL,{name:"name",form:h,fields:U}),(0,C.jsx)(E.Bau,{name:"description",form:h,fields:U}),(0,C.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,C.jsx)(E.Qyk,{title:"Device",name:"ledgerConnectedAndVerified"}),(0,C.jsx)(E.cp7,{name:"ledgerConnectedAndVerified",form:h}),(0,C.jsx)(X,{shouldVerify:!0})]})]})})}let AA={name:"",description:"",mnemonic:""};function AQ(A){let{trigger:Q,open:B,onOpenChange:w}=A,{openDialog:D}=AT(),t=(0,c.cI)({mode:"all",defaultValues:AA}),{dataset:K}=(0,s.r)(),L=function(A){let{walletNames:Q}=A;return{name:{type:"text",title:"Name",placeholder:"name",validation:{validate:{unique:A=>!Q.includes(A)||"name is already in use"},required:"required",maxLength:30}},description:{type:"text",title:"Description",placeholder:"Optional description or notes about the wallet.",validation:{maxLength:200}},mnemonic:{type:"text",title:"Seed",placeholder:"island submit vague scrub exhibit cherry front spoon crop debate filter virus",validation:{required:"required",validate:{valid:A=>{let{error:Q}=(0,n.K)().wallet.keyPairFromSeedPhrase(A,0);return!Q||"seed should be 12 word BIP39 mnemonic"}}}}}}({walletNames:(null==K?void 0:K.map(A=>A.name))||[]}),U=(0,g.lT)(),i=(0,I.useCallback)(async A=>{let Q=A.mnemonic.trim(),B=(0,h.blake2bHex)(Q),C=await U.post({payload:{name:A.name,description:A.description,metadata:{type:"seed",mnemonicHash:B}}});C.error?(0,E.OHV)({title:"Error adding wallet",body:C.error}):(D("walletAddressesGenerate",{walletId:C.data.id}),t.reset(AA))},[t,D,U]);return(0,C.jsx)(E.VqE,{title:y.z.walletAddRecover.title,trigger:Q,open:B,onOpenChange:w,contentVariants:{className:"w-[400px]"},onSubmit:t.handleSubmit(i),controls:(0,C.jsxs)("div",{className:"flex gap-2 px-1",children:[(0,C.jsx)(E.zxk,{size:"medium",onClick:()=>{D("walletAddType")},children:"back"}),(0,C.jsx)("div",{className:"flex-1"}),(0,C.jsx)(E.ZqQ,{size:"medium",form:t,children:"Add wallet"})]}),children:(0,C.jsxs)("div",{className:"flex flex-col gap-4 mb-2",children:[(0,C.jsx)(E.nvN,{size:"14",color:"subtle",children:y.z.walletAddRecover.description}),(0,C.jsx)(E.yEL,{name:"name",form:t,fields:L}),(0,C.jsx)(E.Bau,{name:"description",form:t,fields:L}),(0,C.jsx)(k,{icon:(0,C.jsx)(M.fwm,{}),description:(0,C.jsx)(C.Fragment,{children:"Enter the seed mnemonic for the wallet you are recovering."}),children:(0,C.jsx)(E.Bau,{form:t,fields:L,name:"mnemonic"})})]})})}let AB={name:"",description:""};function AC(A){let{trigger:Q,open:B,onOpenChange:w}=A,{openDialog:D}=AT(),M=(0,g.lT)(),h=(0,c.cI)({mode:"all",defaultValues:AB}),{dataset:k}=(0,s.r)(),n=function(A){let{walletNames:Q}=A;return{name:{type:"text",title:"Name",placeholder:"name",validation:{validate:{unique:A=>!Q.includes(A)||"name is already in use"},required:"required",maxLength:30}},description:{type:"text",title:"Description",placeholder:"Optional description or notes about the wallet.",validation:{maxLength:200}}}}({walletNames:(null==k?void 0:k.map(A=>A.name))||[]}),t=(0,I.useCallback)(async A=>{let Q=await M.post({payload:{name:A.name,description:A.description,metadata:{type:"watch"}}});Q.error?(0,E.OHV)({title:"Error adding wallet",body:Q.error}):(D("walletAddressesAdd",{walletId:Q.data.id}),h.reset(AB))},[h,D,M]);return(0,C.jsx)(E.VqE,{title:y.z.walletAddWatch.title,trigger:Q,open:B,onOpenChange:w,contentVariants:{className:"w-[400px]"},onSubmit:h.handleSubmit(t),controls:(0,C.jsxs)("div",{className:"flex gap-2 px-1",children:[(0,C.jsx)(E.zxk,{size:"medium",onClick:()=>{D("walletAddType")},children:"back"}),(0,C.jsx)("div",{className:"flex-1"}),(0,C.jsx)(E.ZqQ,{size:"medium",form:h,children:"Add wallet"})]}),children:(0,C.jsxs)("div",{className:"flex flex-col gap-4 mb-2",children:[(0,C.jsx)(E.nvN,{size:"14",color:"subtle",children:y.z.walletAddWatch.description}),(0,C.jsx)(E.yEL,{name:"name",form:h,fields:n}),(0,C.jsx)(E.Bau,{name:"description",form:h,fields:n})]})})}var AI=B(92581),AE=B(28356);let Ag={addresses:"",...F()};function Aw(A){return(0,AE.Z)(A.trim().split(/[^0-9a-fA-F]+/).map(A=>A).filter(A=>!!A))}function AD(A){let{params:Q,trigger:B,open:w,onOpenChange:D}=A,{walletId:M}=Q||{},{dataset:y}=(0,s.r)(),h=null==y?void 0:y.find(A=>A.id===M),k=(0,c.cI)({mode:"all",defaultValues:Ag}),{handleOpenChange:n,closeAndReset:t}=(0,E.t0Y)({form:k,onOpenChange:D,defaultValues:Ag}),K={addresses:{type:"text",title:"Addresses",placeholder:"91acbc0feb9e20d538db1f8a509d508362d1b1f3d725d9b6639306531d770c1ef9eb637b4903\nb58849e347356878bb0098908191550ff3e46cc35ed166d0c571fe184d2f17b835747991c266\nb811a04859809fe081884c10d50ca069f1429112ba4a8dc9181c95de41f7eca01416923daa6d\n03442c5643c1deb15c60104ca6ad80fa9563c67c8334f0bbe968b01cb9b8f81c8103a7a202c0\n",validation:{required:"required",validate:{valid:A=>{let Q=Aw(A||"");for(let A=0;A{let Q=Aw(A),B=Q.length,C=0;for(let A=0;A{let Q=await U(A.addresses);if(Q.error){1===Q.total?(0,E.OHV)({title:"Error saving address",body:Q.error}):(0,E.OHV)({title:"Error saving addresses",body:Q.successful>0?"".concat(Q.successful," of ").concat(Q.total," addresses were saved."):""});return}1===Q.total?(0,E.OPV)({title:"Added 1 address"}):(0,E.OPV)({title:"Added ".concat(Q.successful," addresses")}),i(A),t()},[U,t,i]),r=k.watch("addresses"),p=k.watch("shouldRescan"),a=Aw(r).length;return(0,C.jsx)(E.VqE,{title:"Wallet ".concat(null==h?void 0:h.name,": add addresses"),trigger:B,open:w,onOpenChange:n,contentVariants:{className:"w-[500px]"},onSubmit:k.handleSubmit(G),controls:(0,C.jsx)("div",{className:"flex justify-end",children:(0,C.jsxs)(E.ZqQ,{form:k,variant:p?"red":"accent",size:"medium",children:[0===a?"Add addresses":1===a?"Add 1 address":"Add ".concat(a.toLocaleString()," addresses"),p?" and rescan":""]})}),children:(0,C.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,C.jsx)(E.nvN,{size:"14",children:"Enter multiple addresses separated by spaces or commas."}),(0,C.jsx)(E.Bau,{form:k,fields:K,name:"addresses"}),(0,C.jsx)(S,{form:k,fields:K})]})})}let AM={address:""};function Ac(A){let{params:Q,trigger:B,open:w,onOpenChange:D}=A,{walletId:M,address:s}=Q||{},{closeDialog:y}=AT(),h=(0,g.XF)(),k=(0,c.cI)({defaultValues:AM}),n=(0,I.useCallback)(async()=>{let A=await h.delete({params:{id:M,addr:s}});A.error?(0,E.OHV)({title:"Error removing address",body:A.error}):((0,E.OPV)({title:"Address permanently removed"}),k.reset(),y())},[k,M,s,h,y]),t=(0,I.useMemo)(()=>({address:{type:"text",title:"Address",placeholder:s,validation:{required:"required",validate:{equals:A=>(0,E.I13)(A)===(0,E.I13)(s)||"address does not match"}}}}),[s]),K=(0,E.WsO)(t);return(0,C.jsx)(E.VqE,{title:"Remove address",trigger:B,open:w,onOpenChange:A=>{A||k.reset(AM),D(A)},contentVariants:{className:"w-[400px]"},onSubmit:k.handleSubmit(n,K),children:(0,C.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,C.jsxs)(E.nvN,{size:"14",children:["Are you sure you would like to permanently remove the address"," ",(0,C.jsxs)(E.EKh,{children:[(0,E.I13)(s).slice(0,12),"..."]}),"?"]}),(0,C.jsx)(E.nvN,{size:"14",children:"Enter the address name to confirm the removal."}),(0,C.jsx)(E.yEL,{name:"address",form:k,fields:t}),(0,C.jsx)(E.ZqQ,{variant:"red",form:k,children:"Remove"})]})})}let As="e3b1050aef388438668b52983cf78f40925af8f0aa8b9de80c18eadcefce8388d168a313e3f2",Ay=(0,AI.qN)(.00393),Ah={receiveAddress:"",changeAddress:"",claimAddress:"",customChangeAddress:!1,customClaimAddress:!1,mode:"siacoin",siacoin:void 0,siafund:void 0,includeFee:!1};function Ak(A){let{balanceSc:Q,balanceSf:B,onComplete:g,defaultChangeAddress:w,defaultClaimAddress:D}=A,s=(0,c.cI)({mode:"all",defaultValues:Ah}),y=function(A){let{balanceSc:Q,balanceSf:B,fee:I}=A;return{receiveAddress:{type:"text",title:"Recipient address",placeholder:As,validation:{validate:{required:A=>!!A||"required",valid:A=>(0,AI.At)(A)||"invalid address"}}},mode:{type:"select",title:"Action",options:[{value:"siacoin",label:"Send siacoins"},{value:"siafund",label:"Send siafunds"}],validation:{required:"required"}},siacoin:{type:"siacoin",title:"Siacoin",placeholder:"100",validation:{validate:{required:(A,Q)=>"siacoin"!==Q.mode||!!A||"required",gtz:(A,Q)=>"siacoin"!==Q.mode||!new(U())(A||0).isZero()||"must be greater than zero",balance:(A,B)=>"siacoin"!==B.mode||Q.gte((0,AI.qN)(A||0).plus(I))||"not enough funds in wallet"}}},siafund:{type:"number",title:"Siafunds",decimalsLimit:0,placeholder:"100",validation:{validate:{required:(A,Q)=>"siafund"!==Q.mode||!!A||"required",gtz:(A,Q)=>"siafund"!==Q.mode||(null==A?void 0:A.gt(0))||"must be greater than zero",balance:(A,C)=>"siafund"!==C.mode||(null==Q?void 0:Q.gte(I))&&(null==B?void 0:B.gte(A))||"not enough funds in wallet"}}},customChangeAddress:{type:"boolean",title:"Custom change adress",validation:{}},customClaimAddress:{type:"boolean",title:"Custom claim adress",validation:{}},changeAddress:{type:"text",title:"Change address",placeholder:As,actions:(0,C.jsx)(E.ua7,{content:(0,C.jsx)(C.Fragment,{children:"The address where any change from the transaction will be sent. If a custom change address is not specified it is automatically set to the wallet's address 0."}),children:(0,C.jsx)(E.xvT,{color:"subtle",className:"cursor-pointer",children:(0,C.jsx)(M.RdX,{className:"scale-75"})})}),validation:{validate:{required:(A,Q)=>!Q.customChangeAddress||!!A||"required",valid:(A,Q)=>!Q.customChangeAddress||(0,AI.At)(A)||"invalid address"}}},claimAddress:{type:"text",title:"Claim address",placeholder:As,actions:(0,C.jsx)(E.ua7,{content:(0,C.jsx)(C.Fragment,{children:"The address that will receive any unclaimed siacoin earnings from the siafund. If a custom claim address is not specified it is automatically set to the wallet's address 0."}),children:(0,C.jsx)(E.xvT,{color:"subtle",className:"cursor-pointer",children:(0,C.jsx)(M.RdX,{className:"scale-75"})})}),validation:{validate:{required:(A,Q)=>{let B="siafund"!==Q.mode,C=!Q.customChangeAddress;return B||C||!!A||"required"},valid:(A,Q)=>{let B="siafund"!==Q.mode,C=!Q.customChangeAddress;return B||C||(0,AI.At)(A)||"invalid address"}}}},includeFee:{type:"boolean",title:"",validation:{}}}}({balanceSc:Q,balanceSf:B,fee:Ay}),h=(0,I.useCallback)(async A=>{let Q=new(U())(A.siacoin||0),B=new(U())(A.siafund||0),C=A.includeFee?(0,AI.qN)(Q).minus(Ay):(0,AI.qN)(Q),I=B.toNumber();g({receiveAddress:A.receiveAddress,changeAddress:A.customChangeAddress?A.changeAddress:w,claimAddress:A.customClaimAddress?A.claimAddress:D,fee:Ay,mode:A.mode,siacoin:C,siafund:I})},[g,w,D]),k=(0,I.useMemo)(()=>s.handleSubmit(h),[s,h]),n=s.watch("siacoin"),t=s.watch("mode"),K=s.watch("customChangeAddress"),L=s.watch("customClaimAddress"),i=s.watch("includeFee"),G=(0,AI.qN)(n||0),r=(0,C.jsxs)("div",{className:"flex flex-col gap-4",children:[B.gt(0)&&(0,C.jsx)(E.WyV,{size:"medium",form:s,fields:y,name:"mode"}),(0,C.jsx)(E.yEL,{size:"medium",form:s,fields:y,name:"receiveAddress",autoComplete:"off"}),(0,C.jsxs)("div",{className:"flex gap-2",children:[(0,C.jsx)(E.QBj,{size:"small",form:s,fields:y,name:"customChangeAddress",group:!1,children:(0,C.jsxs)("div",{className:"flex items-center gap-px",children:[(0,C.jsx)(E.xvT,{color:"verySubtle",weight:"medium",size:"14",ellipsis:!0,children:"custom change address"}),y.changeAddress.actions]})}),"siafund"===t&&(0,C.jsx)(E.QBj,{size:"small",form:s,fields:y,name:"customClaimAddress",group:!1,children:(0,C.jsxs)("div",{className:"flex items-center gap-px",children:[(0,C.jsx)(E.xvT,{color:"verySubtle",weight:"medium",size:"14",ellipsis:!0,children:"custom claim address"}),y.claimAddress.actions]})})]}),K&&(0,C.jsx)(E.yEL,{size:"medium",form:s,fields:y,name:"changeAddress",autoComplete:"off"}),"siafund"===t&&L&&(0,C.jsx)(E.yEL,{size:"medium",form:s,fields:y,name:"claimAddress",autoComplete:"off"}),"siacoin"===t?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(E.qGu,{size:"medium",form:s,fields:y,name:"siacoin"}),(0,C.jsxs)("div",{className:"flex items-center",children:[(0,C.jsxs)(E.QBj,{size:"small",form:s,fields:y,name:"includeFee",children:[(0,C.jsx)(E.xvT,{children:"Include fee"}),(0,C.jsx)(E.Yqd,{children:"Include or exclude the network fee from the above transaction value."})]}),(0,C.jsx)("div",{className:"flex flex-1"})]})]}):(0,C.jsx)(E.jIp,{size:"medium",form:s,fields:y,name:"siafund"}),(0,C.jsxs)("div",{className:"flex flex-col gap-2 my-1",children:[(0,C.jsxs)("div",{className:"flex gap-2 justify-between items-center",children:[(0,C.jsx)(E.xvT,{color:"verySubtle",children:"Network fee"}),(0,C.jsx)("div",{className:"flex relative top-[-0.5px]",children:(0,C.jsx)(E.YKL,{size:"14",value:Ay,variant:"value",dynamicUnits:!1})})]}),"siacoin"===t&&(0,C.jsxs)("div",{className:"flex justify-between gap-2 items-center",children:[(0,C.jsx)(E.xvT,{color:"verySubtle",children:"Total"}),(0,C.jsx)("div",{className:"flex relative top-[-0.5px]",children:(0,C.jsx)(E.YKL,{size:"14",value:i?G:G.plus(Ay),variant:"value",dynamicUnits:!1})})]})]})]});return{form:s,el:r,handleSubmit:k,reset:()=>s.reset(Ah)}}function An(A){let{params:{receiveAddress:Q,changeAddress:B,claimAddress:I,mode:g,siacoin:w,siafund:D,fee:M},transactionId:c}=A,s=w.plus(M);return(0,C.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,C.jsxs)("div",{className:"flex gap-6 justify-between items-center",children:[(0,C.jsx)(E.xvT,{color:"verySubtle",noWrap:!0,children:"Recipient address"}),(0,C.jsx)(E.XxW,{value:Q,type:"address"})]}),(0,C.jsxs)("div",{className:"flex gap-6 justify-between items-center",children:[(0,C.jsx)(E.xvT,{color:"verySubtle",noWrap:!0,children:"Change address"}),(0,C.jsx)(E.XxW,{value:B,type:"address"})]}),"siafund"===g&&(0,C.jsxs)("div",{className:"flex gap-6 justify-between items-center",children:[(0,C.jsx)(E.xvT,{color:"verySubtle",noWrap:!0,children:"Claim address"}),(0,C.jsx)(E.XxW,{value:I,type:"address"})]}),(0,C.jsxs)("div",{className:"flex gap-2 justify-between items-center",children:[(0,C.jsx)(E.xvT,{color:"verySubtle",noWrap:!0,children:"Amount"}),(0,C.jsx)("div",{className:"flex relative top-[-0.5px]",children:"siacoin"===g?(0,C.jsx)(E.YKL,{size:"14",value:w,variant:"value",dynamicUnits:!1}):(0,C.jsx)(E.Sby,{size:"14",value:D,variant:"value"})})]}),(0,C.jsxs)("div",{className:"flex gap-2 justify-between items-center",children:[(0,C.jsx)(E.xvT,{color:"verySubtle",noWrap:!0,children:"Network fee"}),(0,C.jsx)("div",{className:"flex relative top-[-0.5px]",children:(0,C.jsx)(E.YKL,{size:"14",value:M,variant:"value",dynamicUnits:!1})})]}),"siacoin"===g&&(0,C.jsxs)("div",{className:"flex items-center gap-2 justify-between",children:[(0,C.jsx)(E.xvT,{color:"verySubtle",noWrap:!0,children:"Total"}),(0,C.jsx)("div",{className:"flex relative top-[-0.5px]",children:(0,C.jsx)(E.YKL,{size:"14",value:s,variant:"value",dynamicUnits:!1})})]}),c&&(0,C.jsxs)("div",{className:"flex gap-6 items-center justify-between",children:[(0,C.jsx)(E.xvT,{color:"verySubtle",noWrap:!0,children:"Transaction ID"}),(0,C.jsx)(E.XxW,{value:c,type:"transaction"})]})]})}function At(A){let{transaction:Q,toSign:B,addresses:C,siacoinOutputs:I,siafundOutputs:g}=A;if(!C)return{error:"No addresses"};if(!I)return{error:"No outputs"};for(let A of B){let B=(0,E.I13)(A),{address:w,siacoinUtxo:D,siafundUtxo:M,siacoinInput:c,siafundInput:s,error:y}=AK({toSignId:B,addresses:C,siacoinOutputs:I,siafundOutputs:g,transaction:Q});if(y)return{error:y};D&&(c.unlockConditions=w.metadata.unlockConditions),M&&(s.unlockConditions=w.metadata.unlockConditions),Q.signatures||(Q.signatures=[]),Q.signatures.push({parentID:B,publicKeyIndex:0,timelock:0,coveredFields:{wholeTransaction:!0}})}return{}}function AK(A){var Q,B;let{toSignId:C,transaction:I,addresses:g,siacoinOutputs:w,siafundOutputs:D}=A,M=(0,E.I13)(C),c=function(A){let{id:Q,addresses:B,siacoinOutputs:C}=A,I=(0,E.I13)(Q),g=null==C?void 0:C.find(A=>(0,E.I13)(A.id)===I);if(!g)return{error:"Missing utxo"};let w=null==B?void 0:B.find(A=>(0,E.I13)(A.address)===(0,E.I13)(g.siacoinOutput.address));return w?w.metadata?void 0===w.metadata.index?{error:"Missing address index"}:w.metadata.unlockConditions.publicKeys[0]?{utxo:g,address:w}:{error:"Missing address public key"}:{error:"Missing address metadata"}:{error:"Missing address"}}({id:M,addresses:g,siacoinOutputs:w});if(!c.error){let A=null===(Q=I.siacoinInputs)||void 0===Q?void 0:Q.find(A=>(0,E.I13)(A.parentID)===(0,E.I13)(c.utxo.id));return A?{address:c.address,siacoinUtxo:c.utxo,siacoinInput:A}:{error:"Missing input"}}let s=function(A){let{id:Q,addresses:B,siafundOutputs:C}=A,I=(0,E.I13)(Q),g=null==C?void 0:C.find(A=>(0,E.I13)(A.id)===I);if(!g)return{error:"Missing utxo"};let w=null==B?void 0:B.find(A=>(0,E.I13)(A.address)===(0,E.I13)(g.siafundOutput.address));return w?w.metadata?void 0===w.metadata.index?{error:"Missing address index"}:w.metadata.unlockConditions.publicKeys[0]?{utxo:g,address:w}:{error:"Missing address public key"}:{error:"Missing address metadata"}:{error:"Missing address"}}({id:M,addresses:g,siafundOutputs:D});if(!s.error){let A=null===(B=I.siafundInputs)||void 0===B?void 0:B.find(A=>(0,E.I13)(A.parentID)===(0,E.I13)(s.utxo.id));return A?{address:s.address,siafundUtxo:s.utxo,siafundInput:A}:{error:"Missing input"}}return s.error&&"Missing utxo"!==s.error?{error:s.error}:{error:c.error}}function AL(A){let{cancel:Q}=A,B=(0,g.ys)();return(0,I.useCallback)(async A=>{let{signedTransaction:C}=A;if(!C)return{error:"No signed transaction"};let I=await B.post({payload:{transactions:[C],v2transactions:[]}});return I.error?(Q(C),{error:I.error}):{}},[Q,B])}function AU(){let{wallet:A}=(0,s.r)(),Q=null==A?void 0:A.id,B=(0,g.zQ)();return(0,I.useCallback)(async A=>{var C,I;let g=(null===(C=A.siacoinInputs)||void 0===C?void 0:C.map(A=>A.parentID))||[],w=(null===(I=A.siafundInputs)||void 0===I?void 0:I.map(A=>A.parentID))||[],D=await B.post({params:{id:Q},payload:{siacoinOutputs:g,siafundOutputs:w}});D.error&&(0,E.OHV)({title:"Error canceling transaction",body:D.error})},[Q,B])}function Ai(){let{wallet:A}=(0,s.r)(),Q=null==A?void 0:A.id,B=(0,g.sv)(),C=(0,g.bW)();return(0,I.useCallback)(async A=>{let{receiveAddress:I,changeAddress:E,claimAddress:g,mode:w,siacoin:D,siafund:M,fee:c}=A;if(!I||!E||!g)return{error:"No addresses"};if("siacoin"===w){let A=await B.post({params:{id:Q},payload:{amount:D.plus(c).toString(),changeAddress:E,transaction:{minerFees:[c.toString()],siacoinOutputs:[{value:D.toString(),address:I}]}}});return A.error?{error:A.error}:{fundedTransaction:A.data.transaction,toSign:A.data.toSign}}if("siafund"===w){let A=[],w=await C.post({params:{id:Q},payload:{amount:M,changeAddress:E,claimAddress:g,transaction:{minerFees:[c.toString()],siafundOutputs:[{value:M,address:I}]}}});return w.error?{error:w.error}:(A.push(...w.data.toSign),(w=await B.post({params:{id:Q},payload:{amount:c.toString(),changeAddress:E,transaction:w.data.transaction}})).error)?{error:w.error}:(A.push(...w.data.toSign),{fundedTransaction:w.data.transaction,toSign:A})}},[B,C,Q])}let AG={mnemonic:""};function Ar(A){let{params:Q,transactionId:B}=A;return(0,C.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,C.jsx)(An,{params:Q,transactionId:B}),(0,C.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 my-4",children:[(0,C.jsx)(E.xvT,{children:(0,C.jsx)(M.Z$8,{})}),(0,C.jsx)(E.xvT,{children:"Transaction successfully broadcast."})]})]})}function Ap(A){let{trigger:Q,open:B,onOpenChange:I,sendParams:g,signedTxnId:w,step:D,send:M,compose:c,setStep:s,controls:y}=A;return(0,C.jsx)(E.VqE,{trigger:Q,open:B,onOpenChange:A=>{A||(c.reset(),M.reset(),s("compose")),I(A)},title:"Send",onSubmit:y?y.handleSubmit:void 0,controls:(null==y?void 0:y.form)&&(0,C.jsx)("div",{className:"flex flex-col gap-1",children:(0,C.jsx)(E.ZqQ,{form:y.form,children:y.submitLabel})}),contentVariants:{className:"w-[450px]"},children:(0,C.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,C.jsx)(E.tIK,{onChange:A=>{s(A)},activeStep:D,steps:[{id:"compose",label:"Compose"},{id:"send",label:"Sign & Send"},{id:"done",label:"Complete"}]}),(0,C.jsx)(E.Z0O,{className:"w-full mt-4"}),"compose"===D&&c.el,"send"===D&&M.el,"done"===D&&(0,C.jsx)(Ar,{params:g,transactionId:w})]})})}let Aa={receiveAddress:"",changeAddress:"",claimAddress:"",mode:"siacoin",siacoin:new(U())(0),siafund:0,fee:new(U())(0)};function AN(A){var Q,B;let{params:w,trigger:D,open:M,onOpenChange:y}=A,{walletId:h}=w||{},k=(0,g.tM)({disabled:!h,params:{id:h}}),{dataset:t}=o({id:h}),K=(0,I.useMemo)(()=>{var A;return new(U())((null===(A=k.data)||void 0===A?void 0:A.siacoins)||0)},[k.data]),L=(0,I.useMemo)(()=>{var A;return new(U())((null===(A=k.data)||void 0===A?void 0:A.siafunds)||0)},[k.data]),[G,p]=(0,I.useState)("compose"),[a,N]=(0,I.useState)(),[e,J]=(0,I.useState)(Aa),F=Ak({balanceSc:K,balanceSf:L,defaultChangeAddress:null==t?void 0:null===(Q=t[0])||void 0===Q?void 0:Q.address,defaultClaimAddress:null==t?void 0:null===(B=t[0])||void 0===B?void 0:B.address,onComplete:A=>{J(Q=>({...Q,...A})),p("send")}}),S=function(A){let{walletId:Q,params:B,onConfirm:w}=A,D=function(){let{wallet:A,cacheWalletMnemonic:Q}=(0,s.r)(),B=null==A?void 0:A.id,C=(0,g.jL)({disabled:!B,params:{id:B}}),E=(0,g.cd)({disabled:!B,params:{id:B}}),{dataset:w}=o({id:B}),D=(0,g.ek)(),M=(0,g.gM)(),c=Ai(),y=AU(),h=AL({cancel:y});return(0,I.useCallback)(async A=>{let{mnemonic:I,params:g}=A;if(!w)return{error:"No addresses found"};let{fundedTransaction:s,toSign:k,error:t}=await c(g);if(t)return{fundedTransaction:s,error:t};let{signedTransaction:K,error:L}=function(A){let{mnemonic:Q,transaction:B,toSign:C,consensusState:I,consensusNetwork:E,addresses:g,siacoinOutputs:w,siafundOutputs:D}=A;if(!I)return{error:"No consensus state"};if(!g)return{error:"No addresses"};if(!w)return{error:"No outputs"};let{error:M}=At({toSign:C,transaction:B,addresses:g,siacoinOutputs:w,siafundOutputs:D});if(M)return{error:M};for(let[A,M]of C.entries()){let{address:C,error:c}=AK({toSignId:M,transaction:B,addresses:g,siacoinOutputs:w,siafundOutputs:D});if(c)return{error:c};let s=(0,n.K)().wallet.keyPairFromSeedPhrase(Q,C.metadata.index);if(s.error)return{error:s.error};let{signature:y,error:h}=(0,n.K)().wallet.signTransactionV1(I,E,B,A,s.privateKey);if(h)return{error:h};B.signatures[A].signature=y}return{signedTransaction:B}}({mnemonic:I,transaction:s,toSign:k,consensusState:D.data,consensusNetwork:M.data,addresses:w,siacoinOutputs:C.data,siafundOutputs:E.data});return L?(y(s),{error:L}):(Q(B,I),h({signedTransaction:K}))},[y,w,c,B,D.data,M.data,C.data,E.data,Q,h])}(),{isSeedCached:M}=function(A){let{dataset:Q}=(0,s.r)(),B=null==Q?void 0:Q.find(Q=>Q.id===A),C=null==B?void 0:B.state.mnemonic;return{cachedMnemonic:C,isSeedCached:!!C}}(Q),{dataset:y}=(0,s.r)(),h=null==y?void 0:y.find(A=>A.id===Q),k=null==h?void 0:h.metadata.mnemonicHash,t=(0,c.cI)({mode:"all",defaultValues:AG}),[K,L]=(0,I.useState)("password"),U=(0,I.useMemo)(()=>(function(A){let{mnemonicHash:Q,mnemonicFieldType:B,setMnemonicFieldType:C,isSeedCached:I}=A;return{mnemonic:I?{title:"Seed",type:"text",validation:{}}:i({mnemonicHash:Q,setMnemonicFieldType:C,mnemonicFieldType:B})}})({mnemonicFieldType:K,setMnemonicFieldType:L,mnemonicHash:k,isSeedCached:M}),[K,L,k,M]),G=(0,I.useCallback)(async A=>{let{error:Q}=await D({mnemonic:h.state.mnemonic||A.mnemonic,params:B});if(Q){(0,E.OHV)({title:Q});return}w({})},[D,B,w,h]),p=(0,E.WsO)(U),a=(0,I.useMemo)(()=>t.handleSubmit(G,p),[t,G,p]),N=(0,C.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,C.jsx)(r,{walletId:Q,name:"mnemonic",form:t,fields:U,actionText:"complete the transaction"}),(0,C.jsx)(An,{params:B})]});return{form:t,el:N,handleSubmit:a,reset:()=>t.reset(AG)}}({walletId:h,params:e,onConfirm:A=>{let{transactionId:Q}=A;N(Q),p("done")}}),l=(0,I.useMemo)(()=>"compose"===G?{submitLabel:"Generate transaction",form:F.form,handleSubmit:F.handleSubmit,reset:F.reset}:"send"===G?{submitLabel:"Sign and broadcast transaction",form:S.form,handleSubmit:S.handleSubmit,reset:S.reset}:void 0,[G,F,S]);return(0,C.jsx)(Ap,{trigger:D,open:M,onOpenChange:A=>{A||(F.reset(),S.reset(),p("compose")),y(A)},controls:l,compose:F,send:S,sendParams:e,signedTxnId:a,step:G,setStep:p})}function Ao(A){let{title:Q,isSigned:B,isConnected:I,details:g,actions:w}=A;return(0,C.jsx)(E.s_4,{className:"mt-1 pl-3 pr-2 py-2",children:(0,C.jsxs)("div",{className:"flex flex-col",children:[(0,C.jsxs)("div",{className:"flex gap-1 justify-between items-center",children:[(0,C.jsxs)("div",{className:"flex items-center",children:[B?(0,C.jsxs)("div",{className:"relative w-2 h-2 mr-2",children:[(0,C.jsx)("div",{className:"absolute w-2 h-2 rounded-full bg-green-400 animate-pingslow"}),(0,C.jsx)("div",{className:"absolute w-2 h-2 rounded-full bg-green-500 border border-green-400"})]}):I?(0,C.jsxs)("div",{className:"relative w-2 h-2 mr-2",children:[(0,C.jsx)("div",{className:"absolute w-2 h-2 rounded-full bg-amber-400 animate-pingslow"}),(0,C.jsx)("div",{className:"absolute w-2 h-2 rounded-full bg-amber-500 border border-amber-400"})]}):(0,C.jsx)("div",{className:"relative w-2 h-2 mr-2",children:(0,C.jsx)("div",{className:"absolute w-2 h-2 rounded-full bg-gray-1000 border border-gray-900"})}),(0,C.jsx)(E.xvT,{weight:"semibold",size:"16",className:"ml-1",children:Q})]}),(0,C.jsx)("div",{className:"flex gap-1 justify-between items-center",children:w})]}),g]})})}function Ae(A){let{waitingForUser:Q,isConnected:B,isSigned:I,sign:g}=A;return(0,C.jsx)("div",{className:"flex flex-col gap-1",children:I?(0,C.jsx)(Ao,{isConnected:B,isSigned:I,title:"Transaction"}):B&&Q?(0,C.jsx)(Ao,{isConnected:B,isSigned:I,title:"Transaction",details:(0,C.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,C.jsx)(E.xvT,{children:"Please confirm on device..."}),(0,C.jsx)(E.nvN,{size:"14",color:"subtle",children:"To continue, approve signature on device."})]})}):B?(0,C.jsx)(Ao,{isConnected:B,isSigned:I,title:"Transaction",actions:(0,C.jsx)(C.Fragment,{children:(0,C.jsx)(E.zxk,{size:"small",onClick:g,children:"Sign"})})}):(0,C.jsx)(Ao,{isConnected:B,isSigned:I,title:"Transaction",details:(0,C.jsx)("div",{className:"flex flex-col gap-1",children:(0,C.jsx)(E.nvN,{size:"14",color:"subtle",children:"Connect device to start signing."})})})})}var AJ=B(48834).lW;async function AF(A){let{device:Q,transaction:B,toSign:C,addresses:I,siacoinOutputs:E,siafundOutputs:g}=A;if(!I)return{error:"No addresses"};if(!E)return{error:"No outputs"};let{error:w}=At({transaction:B,toSign:C,addresses:I,siacoinOutputs:E,siafundOutputs:g});if(w)return{error:w};for(let[A,w]of C.entries()){let C=AK({toSignId:w,addresses:I,siacoinOutputs:E,siafundOutputs:g,transaction:B});if(C.error)return{error:C.error};let D=await AS({device:Q,transaction:B,signatureIndex:A,keyIndex:C.address.metadata.index});if(D.error)return{error:D.error}}return{transaction:B}}async function AS(A){let Q,{device:B,transaction:C,signatureIndex:I,keyIndex:E}=A,{encodedTransaction:g,error:w}=(0,n.K)().wallet.encodeTransaction(C);if(w)return{error:w};let D=AJ.from(g,"utf-8"),M=0>function(A,Q){let B=/[^0-9.]/gi,C=A.replace(B,"").split("."),I=Q.replace(B,"").split("."),E=Math.max(C.length,I.length);for(let A=0;AB)return 1}return 0}(await B.sia.getVersion(),"0.4.5");try{Q=M?await B.sia.signTransactionV044(D,I,E):await B.sia.signTransaction(D,I,E,0)}catch(A){return{error:A.message}}return C.signatures[I].signature=Q,{transaction:C}}let Al={isConnected:!1,isSigned:!1};function AH(A){var Q,B;let{params:w,trigger:D,open:M,onOpenChange:y}=A,{walletId:h}=w||{},[k,n]=(0,I.useState)("compose"),[t,K]=(0,I.useState)(),[L,i]=(0,I.useState)(Aa),G=(0,g.tM)({disabled:!h,params:{id:h}}),{dataset:r}=o({id:h}),p=Ak({balanceSc:(0,I.useMemo)(()=>{var A;return new(U())((null===(A=G.data)||void 0===A?void 0:A.siacoins)||0)},[G.data]),balanceSf:(0,I.useMemo)(()=>{var A;return new(U())((null===(A=G.data)||void 0===A?void 0:A.siafunds)||0)},[G.data]),defaultChangeAddress:null==r?void 0:null===(Q=r[0])||void 0===Q?void 0:Q.address,defaultClaimAddress:null==r?void 0:null===(B=r[0])||void 0===B?void 0:B.address,onComplete:A=>{i(Q=>({...Q,...A})),n("send")}}),a=function(A){let{params:Q,step:B,onConfirm:w}=A,D=(0,c.cI)({mode:"all",defaultValues:Al}),M=D.watch("isConnected"),y=D.watch("isSigned"),{device:h,error:k}=(0,x.c)(),n=AU(),t=function(A){let{cancel:Q}=A,{wallet:B}=(0,s.r)(),C=null==B?void 0:B.id,E=(0,g.jL)({disabled:!C,params:{id:C}}),w=(0,g.cd)({disabled:!C,params:{id:C}}),{dataset:D}=o({id:C}),{device:M}=(0,x.c)();return(0,I.useCallback)(async A=>{let{fundedTransaction:B,toSign:C}=A;if(!M||!B)return;let I=await AF({device:M,transaction:B,toSign:C,addresses:D,siacoinOutputs:E.data,siafundOutputs:w.data});return I.error?(Q(B),{error:I.error}):{signedTransaction:I.transaction}},[M,D,E.data,w.data,Q])}({cancel:n}),K=AL({cancel:n}),L=function(A){let{fund:Q,cancel:B,sign:C}=A;return(0,I.useCallback)(async A=>{let{fundedTransaction:I,toSign:E,error:g}=await Q(A);if(g)return{fundedTransaction:I,error:g};let{signedTransaction:w,error:D}=await C({fundedTransaction:I,toSign:E});return D?(B(I),{fundedTransaction:I,error:D}):{signedTransaction:w}},[Q,C,B])}({cancel:n,fund:Ai(),sign:t}),[U,i]=(0,I.useState)(!1),[G,r]=(0,I.useState)();(0,I.useEffect)(()=>{"compose"===B&&r(void 0)},[B]),(0,I.useEffect)(()=>{h?D.setValue("isConnected",!0):(i(!1),D.setValue("isConnected",!1))},[D,h]),(0,I.useEffect)(()=>{k?D.setError("isConnected",{message:k.message}):D.clearErrors("isConnected")},[D,k]),(0,I.useEffect)(()=>{G||D.setValue("isSigned",!1)},[D,G]);let p=(0,I.useMemo)(()=>({isConnected:{type:"boolean",title:"",validation:{validate:{isConnected:A=>A||"Ledger must be connected"}}},isSigned:{type:"boolean",title:"",validation:{validate:{isSigned:A=>A||"Transaction must be signed"}}}}),[]),a=(0,I.useCallback)(async A=>{if(!A.isConnected)return;let{error:Q}=await K({signedTransaction:G});if(Q){(0,E.OHV)({title:Q});return}w({})},[K,G,w]),N=(0,E.WsO)(p),e=(0,I.useMemo)(()=>D.handleSubmit(a,N),[D,a,N]),J=(0,I.useCallback)(async()=>{i(!0);let{signedTransaction:A,error:B}=await L(Q);B?(0,E.OHV)({title:B}):(r(A),D.setValue("isSigned",!0)),i(!1)},[D,L,Q]),F=(0,C.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,C.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,C.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,C.jsx)(E.Qyk,{title:"Device",name:"isConnected"}),(0,C.jsx)(E.cp7,{name:"isConnected",form:D}),(0,C.jsx)(X,{})]}),(0,C.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,C.jsx)(E.Qyk,{title:"Signature",name:"isSigned"}),(0,C.jsx)(E.cp7,{name:"isSigned",form:D}),(0,C.jsx)(Ae,{waitingForUser:U,isConnected:M,isSigned:y,sign:J})]})]}),(0,C.jsx)(An,{params:Q})]});return{form:D,el:F,handleSubmit:e,cancel:()=>{G&&n(G)},reset:()=>D.reset(Al)}}({walletId:h,step:k,params:L,onConfirm:A=>{let{transactionId:Q}=A;K(Q),n("done")}}),N=(0,I.useMemo)(()=>"compose"===k?{submitLabel:"Generate transaction",form:p.form,handleSubmit:p.handleSubmit,reset:p.reset}:"send"===k?{submitLabel:"Sign and broadcast transaction",form:a.form,handleSubmit:a.handleSubmit,reset:a.reset}:void 0,[k,p,a]);return(0,C.jsx)(Ap,{trigger:D,open:M,onOpenChange:A=>{A||(p.reset(),a.reset(),n("compose")),y(A)},controls:N,compose:p,send:a,sendParams:L,signedTxnId:t,step:k,setStep:n})}function AY(A){let{params:Q,trigger:B,open:g,onOpenChange:w}=A,{walletId:D}=Q||{},{dataset:M,cacheWalletMnemonic:y}=(0,s.r)(),h=null==M?void 0:M.find(A=>A.id===D),k={mnemonic:""},[n,t]=(0,I.useState)("password"),K=(0,c.cI)({mode:"all",defaultValues:k}),{handleOpenChange:L,closeAndReset:U}=(0,E.t0Y)({form:K,onOpenChange:w,defaultValues:k}),G=function(A){let{mnemonicHash:Q,mnemonicFieldType:B,setMnemonicFieldType:C}=A;return{mnemonic:i({mnemonicHash:Q,setMnemonicFieldType:C,mnemonicFieldType:B})}}({mnemonicHash:null==h?void 0:h.metadata.mnemonicHash,mnemonicFieldType:n,setMnemonicFieldType:t}),p=(0,I.useCallback)(A=>{y(D,A.mnemonic),U()},[D,y,U]),a=(0,E.WsO)(G);return(0,C.jsx)(E.VqE,{title:"Unlock wallet: ".concat(null==h?void 0:h.name),trigger:B,open:g,onOpenChange:L,contentVariants:{className:"w-[500px]"},onSubmit:K.handleSubmit(p,a),controls:(0,C.jsx)("div",{className:"flex justify-end",children:(0,C.jsx)(E.ZqQ,{form:K,variant:"accent",size:"medium",children:"Continue"})}),children:(0,C.jsx)(r,{walletId:null==h?void 0:h.id,form:K,fields:G,name:"mnemonic"})})}function Af(A){let{open:Q,onOpenChange:B}=A,{walletAutoLockTimeout:I,setWalletAutoLockTimeout:g,setWalletAutoLockEnabled:w,walletAutoLockEnabled:D}=(0,s.r)();return(0,C.jsx)(E.DLL,{open:Q,onOpenChange:B,securityEl:(0,C.jsx)(E.bZj,{children:(0,C.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,C.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,C.jsx)(E.xvT,{children:(0,C.jsx)(M.RdX,{})}),(0,C.jsx)(E.X6q,{size:"20",className:"flex-1",children:"Lock wallets"}),(0,C.jsx)(E.rsf,{size:"medium",checked:D,onCheckedChange:A=>w(A)}),(0,C.jsxs)(E.PhF,{disabled:!D,value:String(I),onChange:A=>{g(Number(A.currentTarget.value))},children:[(0,C.jsx)(E.Wxm,{value:(0,E.sWj)(5),children:"5 minutes"}),(0,C.jsx)(E.Wxm,{value:(0,E.sWj)(10),children:"10 minutes"}),(0,C.jsx)(E.Wxm,{value:(0,E.sWj)(20),children:"20 minutes"}),(0,C.jsx)(E.Wxm,{value:(0,E.sWj)(30),children:"30 minutes"}),(0,C.jsx)(E.Wxm,{value:(0,E.sWj)(60),children:"1 hour"})]})]}),(0,C.jsx)(E.nvN,{size:"14",children:"Automatically lock each wallet after a certain period of inactivity."})]})})})}function Ad(A){let{title:Q,isNew:B,address:I,details:g,actions:w,remove:D}=A;return(0,C.jsx)(E.s_4,{className:"mt-1 pl-3 pr-2 py-2",children:(0,C.jsxs)("div",{className:"flex flex-col",children:[(0,C.jsxs)("div",{className:"flex gap-1 justify-between items-center",children:[(0,C.jsxs)("div",{className:"flex items-center",children:[I?B?(0,C.jsxs)("div",{className:"relative w-2 h-2 mr-2",children:[(0,C.jsx)("div",{className:"absolute w-2 h-2 rounded-full bg-green-400 animate-pingslow"}),(0,C.jsx)("div",{className:"absolute w-2 h-2 rounded-full bg-green-500 border border-green-400"})]}):(0,C.jsx)("div",{className:"relative w-2 h-2 mr-2",children:(0,C.jsx)("div",{className:"absolute w-2 h-2 rounded-full bg-gray-1000 border border-gray-900"})}):(0,C.jsxs)("div",{className:"relative w-2 h-2 mr-2",children:[(0,C.jsx)("div",{className:"absolute w-2 h-2 rounded-full bg-amber-400 animate-pingslow"}),(0,C.jsx)("div",{className:"absolute w-2 h-2 rounded-full bg-amber-500 border border-amber-400"})]}),(0,C.jsx)(E.xvT,{weight:"semibold",size:"16",className:"ml-1",children:Q})]}),(0,C.jsxs)("div",{className:"flex gap-1 justify-between items-center",children:[w,B&&(0,C.jsx)(E.zxk,{variant:"ghost",onClick:D,children:(0,C.jsx)(M.PcV,{})})]})]}),g]})})}function Au(A){let{index:Q,address:B,isNew:g,setAddress:w,remove:D}=A,{device:M,error:c,setError:s}=(0,x.c)(),[y,h]=(0,I.useState)(!1),k=(0,I.useCallback)(async()=>{if(M){if(c){(0,E.OHV)({title:"Error connecting to Ledger",body:c.message});return}try{h(!0);let A=await M.sia.verifyStandardAddress(Q);w({index:Q,address:A.address,publicKey:A.publicKey})}catch(A){s(A),console.log(A)}h(!1)}},[Q,M,c,s,w]);return(0,C.jsx)("div",{className:"flex flex-col gap-1",children:B?(0,C.jsx)(Ad,{title:"Address ".concat(Q),isNew:g,remove:D,address:B,details:(0,C.jsx)("div",{className:"flex flex-col gap-1",children:(0,C.jsx)(E.XxW,{value:B,label:"public key 0",color:"subtle",maxLength:30})})}):y?(0,C.jsx)(Ad,{title:"Address ".concat(Q),isNew:g,remove:D,details:(0,C.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,C.jsx)(E.xvT,{children:"Please confirm on device..."}),(0,C.jsx)(E.nvN,{size:"14",color:"subtle",children:"To continue, approve address generation on device."})]})}):(0,C.jsx)(Ad,{title:"Address ".concat(Q),isNew:g,remove:D,actions:(0,C.jsx)(C.Fragment,{children:(0,C.jsx)(E.zxk,{size:"small",onClick:k,children:"Generate"})})})})}function AR(A){return{isNew:!0,address:"",publicKey:"",index:A}}function Aj(A){let{params:Q,trigger:B,open:w,onOpenChange:D}=A,{walletId:M,walletJustCreated:y}=Q||{},{dataset:h,lastIndex:k,datasetCount:t}=o({id:M}),K=(0,f.n)(),{dataset:L}=(0,s.r)(),i=null==L?void 0:L.find(A=>A.id===M),G=k+1,r=function(A){let{nextIndex:Q,rescanStartHeight:B}=A;return{ledgerConnected:!1,index:new(U())(Q),count:new(U())(1),...F({rescanStartHeight:B})}}({nextIndex:G,rescanStartHeight:K.nodeBlockHeight}),p=(0,c.cI)({mode:"all",defaultValues:r}),{disconnect:a,error:N}=(0,x.c)();(0,I.useEffect)(()=>{!y&&w&&a()},[w]),(0,I.useEffect)(()=>{p.formState.isSubmitting||p.setValue("index",new(U())(G))},[G]);let e=p.watch("index"),l=p.watch("count"),H=p.watch("shouldRescan"),d={ledgerConnected:{type:"boolean",title:"",validation:{validate:{ledgerConnected:A=>A||"Ledger must be connected"}}},index:{type:"number",title:"Start index",decimalsLimit:0,placeholder:"0",validation:{required:"required"}},count:{type:"number",title:"Number of addresses",decimalsLimit:0,placeholder:"1",validation:{required:"required",max:1e3}},...J()},u=(0,g.yi)();(0,I.useEffect)(()=>{N?p.setError("ledgerConnected",{message:N.message}):p.clearErrors("ledgerConnected")},[p,N]);let[R,j]=(0,I.useState)({});(0,I.useEffect)(()=>{w&&y&&j({0:AR(0)})},[w]);let b=(0,I.useCallback)(()=>{if(!e||!l)return;let A={...R};for(let Q=e.toNumber();Q{j(Q=>{let B={...Q};return delete B[A],B})},[]),T=(0,I.useCallback)(A=>{let{index:Q,address:B,publicKey:C}=A;j(A=>{let I={...A};return I[Q]={...I[Q],address:B,publicKey:C},I})},[j]),Z=(0,I.useMemo)(()=>{let A={};for(let[Q,{address:B,publicKey:C}]of Object.entries(R)){let I=null==h?void 0:h.find(A=>A.metadata.index===Number(Q));A[Q]={isNew:!I,index:Number(Q),address:(null==I?void 0:I.address)||B,publicKey:(null==I?void 0:I.metadata.unlockConditions.publicKeys[0])||C}}return A},[h,R]),O=(0,I.useMemo)(()=>Object.entries(Z).filter(A=>{let[Q,B]=A;return B.isNew&&B.address}).map(A=>{let[Q,B]=A;return B}),[Z]),v=(0,I.useCallback)(async()=>{let A=O.length;function Q(A,Q,B){(0,E.OHV)({title:"Error generating addresses",body:Q>0?"".concat(Q+1,"/").concat(A," addresses were generated and saved. Batch failed on with: ").concat(B):B})}for(let[B,{address:C,publicKey:I,index:E}]of O.entries()){let g=(0,n.K)().wallet.standardUnlockConditions(I);if(g.error){Q(A,B,g.error);return}let w={index:E,unlockConditions:g.unlockConditions},D=await u.put({params:{id:M},payload:{address:C,description:"",metadata:w}});if(D.error){Q(A,B,D.error);return}}1===A?(0,E.OPV)({title:"Added 1 address"}):(0,E.OPV)({title:"Added ".concat(A," addresses")})},[u,M,O]),{handleOpenChange:V,closeAndReset:z}=(0,E.t0Y)({form:p,onOpenChange:A=>{j({}),D(A)},defaultValues:r}),W=Y(),P=(0,I.useCallback)(async A=>{O.length>0&&await v(),await W(A),z()},[O,v,z,W]);return(0,C.jsx)(E.VqE,{title:"Wallet ".concat(null==i?void 0:i.name,": generate addresses"),trigger:B,open:w,onOpenChange:V,contentVariants:{className:"w-[500px]"},onSubmit:p.handleSubmit(P),controls:(0,C.jsxs)("div",{className:"flex gap-1 justify-end",children:[(0,C.jsx)(E.zxk,{size:"medium",variant:"gray",onClick:z,children:"Close"}),(O.length>0||H)&&(0,C.jsx)(E.ZqQ,{form:p,size:"medium",variant:H?"red":"accent",children:O.length>0?"Save ".concat(O.length," ").concat(1===O.length?"address":"addresses").concat(H?" and rescan":""):"Rescan"})]}),children:(0,C.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,C.jsxs)(E.xvT,{children:["Wallet currently has ",t," ",1===t?"address":"addresses"," with a highest index of"," ",k,". Select a start index and the number of sequential addresses you would like to generate."]}),(0,C.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,C.jsx)(E.Qyk,{title:"Device",name:"ledgerConnected"}),(0,C.jsx)(E.cp7,{name:"ledgerConnected",form:p}),(0,C.jsx)(X,{})]}),(0,C.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,C.jsxs)("div",{className:"flex gap-2 w-full pt-3 items-end",children:[(0,C.jsx)("div",{className:"flex-1",children:(0,C.jsx)(E.jIp,{form:p,fields:d,name:"index"})}),(0,C.jsx)("div",{className:"flex-1",children:(0,C.jsx)(E.jIp,{form:p,fields:d,name:"count"})}),(0,C.jsx)(E.zxk,{onClick:b,children:"Add"})]}),(0,C.jsx)("div",{className:"flex flex-col gap-1",children:Object.entries(Z).map(A=>{let[Q,{address:B,isNew:I}]=A;return(0,C.jsx)(Au,{isNew:I,address:B,setAddress:T,index:Number(Q),remove:()=>m(Number(Q))},Q)})})]}),(0,C.jsx)(S,{form:p,fields:d})]})})}function Ab(A){let{trigger:Q,open:B,onOpenChange:g}=A,w=function(A){let{rescanStartHeight:Q}=A;return{...F({rescanStartHeight:Q}),shouldRescan:!0}}({rescanStartHeight:(0,f.n)().nodeBlockHeight}),D=(0,c.cI)({mode:"all",defaultValues:w}),{handleOpenChange:M,closeAndReset:s}=(0,E.t0Y)({form:D,onOpenChange:g,defaultValues:w}),y={...J()},h=Y(),k=(0,I.useCallback)(async A=>{h(A),s()},[s,h]);return(0,C.jsx)(E.VqE,{title:"Rescan the blockchain",trigger:Q,open:B,onOpenChange:M,contentVariants:{className:"w-[500px]"},onSubmit:D.handleSubmit(k),controls:(0,C.jsx)("div",{className:"flex justify-end",children:(0,C.jsx)(E.ZqQ,{form:D,variant:"red",size:"medium",children:"Rescan"})}),children:(0,C.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,C.jsx)(E.nvN,{size:"14",children:"Rescan the blockchain from the specified start height to find any missing transaction activity across all wallets."}),(0,C.jsx)("div",{className:"w-[100px]",children:(0,C.jsx)(E.jIp,{form:D,fields:y,name:"rescanStartHeight"})}),(0,C.jsxs)("div",{className:"pt-2 flex flex-col gap-2",children:[(0,C.jsx)(l,{}),(0,C.jsx)(H,{})]})]})})}let Am=(0,I.createContext)({}),AT=()=>(0,I.useContext)(Am);function AZ(A){let{children:Q}=A,B=function(){let[A,Q]=(0,I.useState)(),[B,C]=(0,I.useState)({}),E=(0,I.useCallback)((A,B)=>{C(Q=>({...Q,[A]:B})),Q(A)},[C,Q]),g=(0,I.useCallback)(()=>{C(Q=>({...Q,[A]:void 0})),Q(void 0)},[Q,C,A]),w=(0,I.useCallback)(A=>{A||g()},[g]);return{dialog:A,params:B,openDialog:E,confirm,closeDialog:g,onOpenChange:w}}();return(0,C.jsx)(Am.Provider,{value:B,children:Q})}function AO(){let{openDialog:A,onOpenChange:Q,closeDialog:B,dialog:I,params:w}=AT(),M=(0,g.Wl)();return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Af,{open:"settings"===I,onOpenChange:Q}),(0,C.jsx)(D,{open:"walletAddType"===I,params:w.walletAddType,onOpenChange:Q=>Q?A(I,w.walletAddType):B()}),(0,C.jsx)(K,{open:"walletAddNew"===I,params:w.walletAddNew,onOpenChange:Q=>Q?A(I,w.walletAddNew):B()}),(0,C.jsx)(AQ,{open:"walletAddRecover"===I,params:w.walletAddRecover,onOpenChange:Q=>Q?A(I,w.walletAddRecover):B()}),(0,C.jsx)($,{open:"walletAddLedger"===I,params:w.walletAddLedger,onOpenChange:Q=>Q?A(I,w.walletAddLedger):B()}),(0,C.jsx)(AC,{open:"walletAddWatch"===I,params:w.walletAddWatch,onOpenChange:Q=>Q?A(I,w.walletAddWatch):B()}),(0,C.jsx)(d,{open:"walletAddressesGenerate"===I,params:w.walletAddressesGenerate,onOpenChange:Q=>Q?A(I,w.walletAddressesGenerate):B()}),(0,C.jsx)(Aj,{open:"walletLedgerAddressGenerate"===I,params:w.walletLedgerAddressGenerate,onOpenChange:Q=>Q?A(I,w.walletLedgerAddressGenerate):B()}),(0,C.jsx)(AD,{open:"walletAddressesAdd"===I,params:w.walletAddressesAdd,onOpenChange:Q=>Q?A(I,w.walletAddressesAdd):B()}),(0,C.jsx)(b,{open:"walletRemove"===I,params:w.walletRemove,onOpenChange:Q=>Q?A(I,w.walletRemove):B()}),(0,C.jsx)(Z,{open:"walletUpdate"===I,params:w.walletUpdate,onOpenChange:Q=>Q?A(I,w.walletUpdate):B()}),(0,C.jsx)(AY,{open:"walletUnlock"===I,params:w.walletUnlock,onOpenChange:Q=>Q?A(I,w.walletUnlock):B()}),(0,C.jsx)(Ab,{open:"walletsRescan"===I,params:w.walletsRescan,onOpenChange:Q=>Q?A(I,w.walletsRescan):B()}),(0,C.jsx)(m,{open:"addressUpdate"===I,params:w.addressUpdate,onOpenChange:Q=>Q?A(I,w.addressUpdate):B()}),(0,C.jsx)(Ac,{open:"addressRemove"===I,params:w.addressRemove,onOpenChange:Q=>Q?A(I,w.addressRemove):B()}),(0,C.jsx)(E.D_D,{open:"connectPeer"===I,params:w.connectPeer,connect:A=>M.post({payload:A}),onOpenChange:Q=>Q?A(I,w.connectPeer):B()}),(0,C.jsx)(AN,{open:"walletSendSeed"===I,params:w.walletSendSeed,onOpenChange:Q=>Q?A(I,w.walletSendSeed):B()}),(0,C.jsx)(AH,{open:"walletSendLedger"===I,params:w.walletSendLedger,onOpenChange:Q=>Q?A(I,w.walletSendLedger):B()}),(0,C.jsx)(E.QHy,{open:"confirm"===I,params:w.confirm,onOpenChange:Q=>Q?A(I,w.confirm):B()})]})}},8714:function(A,Q,B){"use strict";B.d(Q,{Yl:function(){return i},hI:function(){return U}});var C=B(52322),I=B(55261),E=B(90670),g=B(2784);let w=["transactionId","type","height","timestamp","amount","fee"],D=[];var M=B(92581),c=B(67537);let s=[{id:"transactionId",label:"transaction ID",category:"general",render:A=>{let{data:{id:Q},context:B}=A;return Q?(0,C.jsx)(I.XxW,{size:"12",value:Q,label:"transaction ID",type:"transaction",siascanUrl:B.siascanUrl}):null}},{id:"type",label:"type",category:"general",fixed:!0,render:A=>{let{data:{type:Q}}=A;return(0,C.jsx)(I.xvT,{weight:"medium",ellipsis:!0,children:Q})}},{id:"height",label:"height",category:"general",contentClassName:"justify-end",render:A=>{let{data:{height:Q,pending:B,maturityHeight:E,isMature:g}}=A;return B?(0,C.jsx)(I.xvT,{size:"12",ellipsis:!0,children:(0,C.jsx)(I.xgg,{})}):Q?Q&&E&&E>Q?(0,C.jsx)(I.ua7,{content:g?"The maturity height has been reached.":"The maturity height has not been reached, therefore the output is still locked.",children:(0,C.jsxs)("div",{className:"flex flex-col gap-[5px]",children:[(0,C.jsx)("div",{className:"flex justify-end",children:(0,C.jsxs)(I.xvT,{size:"12",font:"mono",ellipsis:!0,color:g?"green":"red",className:"flex gap-1 items-center",children:[g?(0,C.jsx)(c.VmF,{}):(0,C.jsx)(c.Lur,{}),E.toLocaleString()]})}),(0,C.jsxs)("div",{className:"flex justify-between items-end gap-1",children:[(0,C.jsx)("div",{className:"pl-[8px] pb-[6px]",children:(0,C.jsx)("div",{className:"border-l border-b border-gray-800 dark:border-graydark-800 h-[20px] w-[7px]"})}),(0,C.jsx)(I.xvT,{size:"12",font:"mono",color:"subtle",ellipsis:!0,children:Q.toLocaleString()})]})]})}):(0,C.jsx)(I.xvT,{size:"12",font:"mono",ellipsis:!0,children:Q.toLocaleString()}):null}},{id:"timestamp",label:"timestamp",category:"general",contentClassName:"justify-end",render:A=>{let{data:{timestamp:Q,pending:B}}=A;return B?(0,C.jsx)(I.xvT,{size:"12",ellipsis:!0,children:(0,C.jsx)(I.xgg,{})}):(0,C.jsx)(I.xvT,{size:"12",ellipsis:!0,children:(0,M.rN)(Q,{timeStyle:"short"})})}},{id:"amount",label:"amount",category:"general",contentClassName:"w-[120px] justify-end",render:A=>{let{data:{amountSc:Q,amountSf:B}}=A;return Q?(0,C.jsxs)("div",{className:"flex flex-col gap-2 items-end",children:[!Q.isZero()&&(0,C.jsx)(I.ho9,{displayBoth:!0,size:"12",value:Q}),!!B&&(0,C.jsx)(I.Sby,{size:"12",value:B})]}):null}},{id:"fee",label:"fee",category:"general",contentClassName:"w-[120px] justify-end",render:A=>{let{data:{fee:Q}}=A;return Q?(0,C.jsx)(I.ho9,{displayBoth:!0,size:"12",variant:"value",value:Q}):null}},{id:"contractId",label:"contract ID",category:"general",render:A=>{let{data:{contractId:Q},context:B}=A;return Q?(0,C.jsx)(I.XxW,{size:"12",value:Q,label:"contract ID",siascanUrl:B.siascanUrl}):null}}];var y=B(5632),h=B(6391),k=B.n(h),n=B(74667),t=B(9338),K=B(38855);let L=(0,g.createContext)({}),U=()=>(0,g.useContext)(L);function i(A){let{children:Q}=A,B=function(){let A=(0,y.useRouter)(),Q=A.query.id,B=Number(A.query.limit||100),C=Number(A.query.offset||0),{filters:M,setFilter:c,removeFilter:h,removeLastFilter:L,resetFilters:U}=(0,I.Uu5)(),i=(0,E.jy)({disabled:!Q,params:{id:Q},config:{swr:{refreshInterval:t.h}}}),G=(0,E.sG)({disabled:!Q,params:{limit:B,offset:C,id:Q},config:{swr:{refreshInterval:t.h}}}),r=(0,K.n)(),p=(0,g.useMemo)(()=>{if(!G.data||!i.data)return null;let A=i.data.map(A=>({id:A.id,timestamp:0,pending:!0,type:A.type,isMature:!1,amount:new(k())(A.received).minus(A.sent)})),Q=G.data.map((A,Q)=>{let B=new(k())(0),C=0;if("data"in A&&"siacoinOutput"in A.data&&(B=new(k())(A.data.siacoinOutput.siacoinOutput.value)),"transaction"===A.type){var I,E,g,w,D,M,c,s;let Q=(null===(E=A.data)||void 0===E?void 0:null===(I=E.siacoinInputs)||void 0===I?void 0:I.reduce((Q,B)=>A.relevant.includes(B.siacoinOutput.address)?Q.plus(B.siacoinOutput.value):Q,new(k())(0)))||new(k())(0);B=((null===(w=A.data)||void 0===w?void 0:null===(g=w.siacoinOutputs)||void 0===g?void 0:g.reduce((Q,B)=>A.relevant.includes(B.siacoinOutput.address)?Q.plus(B.siacoinOutput.value):Q,new(k())(0)))||new(k())(0)).minus(Q);let y=(null===(M=A.data)||void 0===M?void 0:null===(D=M.siafundInputs)||void 0===D?void 0:D.reduce((Q,B)=>A.relevant.includes(B.siafundElement.siafundOutput.address)?Q+B.siafundElement.siafundOutput.value:Q,0))||0;C=((null===(s=A.data)||void 0===s?void 0:null===(c=s.siafundOutputs)||void 0===c?void 0:c.reduce((Q,B)=>A.relevant.includes(B.siafundOutput.address)?Q+B.siafundOutput.value:Q,0))||0)-y}let y=A.maturityHeight<=r.nodeBlockHeight,h={id:A.id,type:A.type,timestamp:new Date(A.timestamp).getTime(),maturityHeight:A.maturityHeight,isMature:y,height:A.index.height,pending:!1,amountSc:B,amountSf:C};return"data"in A&&"fee"in A.data&&(h.fee=new(k())(A.data.fee)),"contract payout"===A.type&&(h.contractId=A.data.fileContract.id),h});return[...A.reverse(),...Q]},[G.data,i.data,r.nodeBlockHeight]),{configurableColumns:a,enabledColumns:N,sortableColumns:o,toggleColumnVisibility:e,setColumnsVisible:J,setColumnsHidden:F,toggleSort:S,setSortDirection:l,setSortField:H,sortField:Y,sortDirection:f,resetDefaultColumnVisibility:d}=(0,I.oy6)("walletd/v0/events",{columns:s,columnsDefaultVisible:w,sortOptions:D,defaultSortField:"id"}),u=(0,g.useMemo)(()=>s.filter(A=>A.fixed||N.includes(A.id)),[N]),R=G.isValidating||i.isValidating,j=G.error||i.error,b=(0,I.c2j)(p,R,j,M),m=(0,n.B)(),T=(0,g.useMemo)(()=>({siascanUrl:m}),[m]);return{dataState:b,error:G.error,pageCount:(null==p?void 0:p.length)||0,columns:u,dataset:p,cellContext:T,configurableColumns:a,enabledColumns:N,sortableColumns:o,toggleColumnVisibility:e,setColumnsVisible:J,setColumnsHidden:F,toggleSort:S,setSortDirection:l,setSortField:H,sortField:Y,sortDirection:f,resetDefaultColumnVisibility:d,filters:M,setFilter:c,removeFilter:h,removeLastFilter:L,resetFilters:U,offset:C,limit:B}}();return(0,C.jsx)(L.Provider,{value:B,children:Q})}},16694:function(A,Q,B){"use strict";B.d(Q,{c:function(){return c},d:function(){return s}});var C=B(52322),I=B(73866),E=B(27748),g=B(35415),w=B.n(g),D=B(2784);let M=(0,D.createContext)({}),c=()=>(0,D.useContext)(M);function s(A){let{children:Q}=A,B=function(){let[A,Q]=(0,D.useState)(!1),[B,C]=(0,D.useState)(),[g,M]=(0,D.useState)(),c=(0,D.useCallback)(()=>{if(B){try{B.sia.close(),M(void 0)}catch(A){console.log(A)}C(void 0)}},[B]),s=(0,D.useCallback)(async A=>{let B=null;Q(!0);try{switch(A){case"HID":(B=await E.Z.openConnected())||(B=await E.Z.create());break;case"Bluetooth":B=await I.Z.create();break;default:throw Error("Unsupported transport method: ".concat(A))}if(B){M(void 0);let I=new(w())(B);C({type:A,sia:I,transport:B}),Q(!1)}}catch(A){M(A),Q(!1)}},[]),y=(0,D.useCallback)(async()=>{if(!B){M(Error("No device connected"));return}Q(!0);try{let A=await B.sia.verifyPublicKey(0);return M(void 0),C(Q=>({...Q,publicKey0:A.publicKey,address0:A.address})),Q(!1),A}catch(A){Q(!1),M(A)}},[B]);return(0,D.useEffect)(()=>{if(!(null==B?void 0:B.transport))return;let A=setInterval(async()=>{(null==B?void 0:B.transport._disconnectEmitted)&&C(void 0)},2e3);return()=>clearInterval(A)},[null==B?void 0:B.transport]),{connect:s,verify:y,disconnect:c,device:B,error:g,setError:M,waitingForUser:A}}();return(0,C.jsx)(M.Provider,{value:B,children:Q})}},23312:function(A,Q,B){"use strict";B.d(Q,{k:function(){return N},r:function(){return a}});var C=B(52322),I=B(55261),E=B(90670),g=B(2784),w=B(26249),D=B(67537),M=B(92581),c=B(3584),s=B(36350),y=B(6391),h=B.n(y),k=B(12172);let n=[{id:"actions",label:"",fixed:!0,cellClassName:"w-[50px] !pl-2 !pr-4 [&+*]:!pl-0",render:A=>{let{data:Q}=A;return(0,C.jsx)(k.g,{trigger:(0,C.jsx)(I.zxk,{variant:"ghost",icon:"hover",children:(0,C.jsx)(D.EMN,{})}),contentProps:{align:"start"},wallet:Q})}},{id:"details",label:"name",category:"general",fixed:!0,render:A=>{let{data:{id:Q,name:B,description:E}}=A;return(0,C.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,C.jsx)(I.xvT,{weight:"bold",ellipsis:!0,children:B||Q}),E&&(0,C.jsx)(I.ua7,{content:(0,C.jsx)("pre",{children:(0,C.jsx)(I.nvN,{size:"12",className:"w-full whitespace-pre-wrap",children:E})}),children:(0,C.jsx)(I.nvN,{size:"12",children:E.split("\n")[0]})})]})}},{id:"balance",label:"balance",category:"general",contentClassName:"justify-end",render:function(A){let{data:{id:Q}}=A,B=(0,E.tM)({params:{id:Q}});return B.data?(0,C.jsxs)("div",{className:"flex flex-col gap-2 items-end",children:[(0,C.jsx)(I.ho9,{displayBoth:!0,size:"12",variant:"value",value:new(h())(B.data.siacoins)}),!!B.data.siafunds&&(0,C.jsx)(I.Sby,{size:"12",variant:"value",value:B.data.siafunds})]}):null}},{id:"type",label:"type",category:"general",render:A=>{var Q,B;let{data:{metadata:{type:E}}}=A;return(0,C.jsx)(I.ua7,{content:null===(Q=s._[E])||void 0===Q?void 0:Q.title,children:(0,C.jsxs)(I.Cts,{interactive:!1,className:"flex gap-0.5 items-center",children:[(0,C.jsx)(I.xvT,{color:"subtle",className:"scale-75 relative top-px",children:null===(B=s._[E])||void 0===B?void 0:B.icon}),E]})})}},{id:"status",label:"status",category:"general",render:A=>{let{data:Q,context:{walletAutoLockEnabled:B,walletAutoLockTimeout:E}}=A,{type:g}=Q.metadata,{status:w,activityAt:M}=Q.state,{unlock:s,lock:y}=Q.actions;if("seed"===g){let A=new Date().getTime()-M,Q=(0,c.l)(Math.max(E-A,0)),g=B?"The wallet is currently unlocked. The wallet will stay unlocked until it is inactive for ".concat(Q.amount.toFixed(0)," more ").concat(Q.units,", manually locked, or the app is closed."):"The wallet is currently unlocked. The wallet will stay unlocked until it is manually locked or the app is closed.";return(0,C.jsx)(I.zxk,{tip:"unlocked"===w?g:"The wallet is currently locked.",color:"unlocked"===w?"contrast":"verySubtle",variant:"ghost",onClick:A=>{A.stopPropagation(),"unlocked"===w?y():s()},children:"unlocked"===w?(0,C.jsx)(D.VmF,{}):(0,C.jsx)(D.Lur,{})})}return null}},{id:"createdAt",label:"created on",category:"general",render:A=>{let{data:{createdAt:Q}}=A;return Q?(0,C.jsx)(I.xvT,{size:"12",children:(0,M.rN)(Q,{dateStyle:"medium"})}):null}}];var t=B(5632),K=B(98334),L=B(27429),U=B(92762),i=B(5137),G=B(67108),r=B(9338);let p=(0,g.createContext)({}),a=()=>(0,g.useContext)(p);function N(A){let{children:Q}=A,B=function(){let A=(0,E.rB)({config:{swr:{refreshInterval:r.h}}}),Q=(0,t.useRouter)(),{openDialog:B}=(0,i.Rh)(),{setOnLockCallback:C}=(0,G.Hv)(),{mnemonicCache:D,walletActivityAt:M,cacheWalletMnemonic:c,cachedMnemonicCount:s,lockAllWallets:y,walletAutoLockTimeout:h,setWalletAutoLockTimeout:k,setWalletAutoLockEnabled:p,walletAutoLockEnabled:a}=function(){let[A,Q]=(0,U.Z)("v0/wallets/walletAutoLockEnabled",{defaultValue:!0}),[B,C]=(0,U.Z)("v0/wallets/walletAutoLockTimeout",{defaultValue:(0,I.sWj)(5)}),[E,w]=(0,g.useState)({}),[D,M]=(0,g.useState)({}),c=(0,g.useMemo)(()=>Object.keys(D).length,[D]),s=(0,g.useCallback)(A=>{w(Q=>({...Q,[A]:new Date().getTime()}))},[w]),y=(0,g.useCallback)((A,Q)=>{M(B=>({...B,[A]:Q})),Q&&s(A)},[M,s]),h=(0,g.useCallback)(()=>{if(!A)return;let Q=new Date().getTime()-B;for(let[A,B]of Object.entries(D))B&&(E[A]||0){M({})},[M]),n=(0,t.useRouter)(),i=(0,g.useCallback)(()=>{n.pathname.startsWith(K._.wallet.base)&&s(n.query.id)},[n,s]);return(0,L.Yp)({onAction:i,throttle:5e3,eventsThrottle:5e3}),(0,g.useEffect)(()=>{if(!A)return;let Q=setInterval(()=>{h()},5e3);return()=>{clearInterval(Q)}},[A]),{walletActivityAt:E,updateWalletActivityAt:s,mnemonicCache:D,cacheWalletMnemonic:y,lockAllWallets:k,cachedMnemonicCount:c,walletAutoLockTimeout:B,setWalletAutoLockTimeout:C,setWalletAutoLockEnabled:Q,walletAutoLockEnabled:A}}();(0,g.useEffect)(()=>{C("wallets",()=>{y()})},[]);let N=(0,g.useMemo)(()=>A.data?A.data.map(A=>{let{id:C,name:I,description:E,dateCreated:g,lastUpdated:w,metadata:s}=A;return{id:C,name:I,description:E,createdAt:new Date(g).getTime()||0,updatedAt:new Date(w).getTime()||0,metadata:s||{},raw:A,state:{mnemonic:D[C],status:D[C]?"unlocked":"locked",activityAt:M[C]},actions:{unlock:()=>B("walletUnlock",{walletId:C}),lock:()=>c(C,void 0)},onClick:()=>Q.push({pathname:K._.wallet.view,query:{id:C}})}}):null,[Q,A.data,D,M,B,c]),o=null==N?void 0:N.find(A=>A.id===Q.query.id),{filters:e,setFilter:J,removeFilter:F,removeLastFilter:S,resetFilters:l}=(0,I.Wdu)(),{configurableColumns:H,enabledColumns:Y,sortableColumns:f,toggleColumnVisibility:d,setColumnsVisible:u,setColumnsHidden:R,toggleSort:j,setSortDirection:b,setSortField:m,sortField:T,sortDirection:Z,resetDefaultColumnVisibility:O}=(0,I.oy6)("walletd/v0/wallets",{columns:n,columnsDefaultVisible:w.gd,sortOptions:w.Fo,defaultSortField:w.nw}),x=(0,I._4u)({dataset:N,filters:e,sortField:T,sortDirection:Z}),v=(0,g.useMemo)(()=>n.filter(A=>A.fixed||Y.includes(A.id)),[Y]),V=(0,I.c2j)(N,A.isValidating,A.error,e),z=(0,g.useMemo)(()=>({walletAutoLockTimeout:h,walletAutoLockEnabled:a}),[a,h]);return{dataState:V,error:A.error,datasetCount:(null==x?void 0:x.length)||0,unlockedCount:s,columns:v,dataset:x,context:z,wallet:o,configurableColumns:H,enabledColumns:Y,sortableColumns:f,toggleColumnVisibility:d,setColumnsVisible:u,setColumnsHidden:R,toggleSort:j,setSortDirection:b,setSortField:m,sortField:T,filters:e,setFilter:J,removeFilter:F,removeLastFilter:S,resetFilters:l,sortDirection:Z,resetDefaultColumnVisibility:O,cacheWalletMnemonic:c,lockAllWallets:y,walletAutoLockTimeout:h,setWalletAutoLockTimeout:k,setWalletAutoLockEnabled:p,walletAutoLockEnabled:a}}();return(0,C.jsx)(p.Provider,{value:B,children:Q})}},26249:function(A,Q,B){"use strict";B.d(Q,{Fo:function(){return E},gd:function(){return C},nw:function(){return I}});let C=["actions","details","balance","type","status","createdAt"],I="name",E=[{id:"name",label:"name",category:"general"},{id:"type",label:"type",category:"general"},{id:"status",label:"status",category:"general"},{id:"createdAt",label:"created on",category:"general"}]},74667:function(A,Q,B){"use strict";B.d(Q,{B:function(){return E}});var C=B(55261),I=B(90670);function E(){var A;return(null===(A=(0,I.gM)().data)||void 0===A?void 0:A.name)==="zen"?C.nNd.explore.testnetZen:C.nNd.explore.mainnet}},38855:function(A,Q,B){"use strict";B.d(Q,{n:function(){return g}});var C=B(55261),I=B(67108),E=B(90670);function g(){var A;let{isUnlockedAndAuthedRoute:Q}=(0,I.Hv)(),B=(0,E.XC)({config:{swr:{refreshInterval:1e4}}}),C=(0,E.ek)({config:{swr:{refreshInterval:A=>w(A)?6e4:1e4}}}),g=(0,E.nH)(),D=B.data?null===(A=B.data)||void 0===A?void 0:A.height:0,M=Q&&D&&g?Number((100*Math.min(D/g,1)).toFixed(1)):0;return{isSynced:w(C.data),nodeBlockHeight:D,estimatedBlockHeight:g,syncPercent:M,moreThan100BlocksToSync:!!D&&!!g&&g-D>100,firstTimeSyncing:!!D&&!!g&&g-D>5e4}}function w(A){return!!A&&function(A){if(!A||!A.length)return!1;let Q=A[0],B=Date.now()-(0,C.ytg)(2);return new Date(Q).getTime()>B}(A.prevTimestamps)}},3584:function(A,Q,B){"use strict";function C(A){return!A||A<1e3?{amount:0,units:"seconds"}:(A/=1e3)<60?{amount:Math.floor(100*A)/100,units:"seconds"}:{amount:Math.floor(A/60*100)/100,units:"minutes"}}B.d(Q,{l:function(){return C}})},6723:function(A,Q,B){"use strict";B.r(Q),B.d(Q,{default:function(){return AA}});var C=B(52322);B(50521);var I=B(55261),E=B(5137),g=B(2784),w=B(23312),D=B(58723),M=B(8714),c=B(16694),s=B(48869);let y=(0,g.createContext)({});function h(A){let{children:Q}=A,B=((0,g.useEffect)(()=>{(async()=>{await (0,s.x)()})()},[]),{});return(0,C.jsx)(y.Provider,{value:B,children:Q})}var k=B(90670),n=B(38855),t=B(1645),K=B(66700),L=B(19785);function U(A){(0,L.Z)(1,arguments);var Q=(0,K.Z)(A);return Q.setHours(0,0,0,0),Q}var i=B(88811);function G(A){if(null===A||!0===A||!1===A)return NaN;var Q=Number(A);return isNaN(Q)?Q:Q<0?Math.ceil(Q):Math.floor(Q)}function r(A,Q){return(0,L.Z)(2,arguments),function(A,Q){return(0,L.Z)(2,arguments),new Date((0,K.Z)(A).getTime()+G(Q))}(A,-G(Q))}function p(A){(0,L.Z)(1,arguments);var Q=(0,K.Z)(A),B=Q.getUTCDay();return Q.setUTCDate(Q.getUTCDate()-((B<1?7:0)+B-1)),Q.setUTCHours(0,0,0,0),Q}function a(A){(0,L.Z)(1,arguments);var Q=(0,K.Z)(A),B=Q.getUTCFullYear(),C=new Date(0);C.setUTCFullYear(B+1,0,4),C.setUTCHours(0,0,0,0);var I=p(C),E=new Date(0);E.setUTCFullYear(B,0,4),E.setUTCHours(0,0,0,0);var g=p(E);return Q.getTime()>=I.getTime()?B+1:Q.getTime()>=g.getTime()?B:B-1}function N(A,Q){(0,L.Z)(1,arguments);var B=Q||{},C=B.locale,I=C&&C.options&&C.options.weekStartsOn,E=null==I?0:G(I),g=null==B.weekStartsOn?E:G(B.weekStartsOn);if(!(g>=0&&g<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");var w=(0,K.Z)(A),D=w.getUTCDay();return w.setUTCDate(w.getUTCDate()-((D=1&&D<=7))throw RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var M=new Date(0);M.setUTCFullYear(C+1,0,D),M.setUTCHours(0,0,0,0);var c=N(M,Q),s=new Date(0);s.setUTCFullYear(C,0,D),s.setUTCHours(0,0,0,0);var y=N(s,Q);return B.getTime()>=c.getTime()?C+1:B.getTime()>=y.getTime()?C:C-1}function e(A,Q){for(var B=Math.abs(A).toString();B.length0?B:1-B;return e("yy"===Q?C%100:C,Q.length)},M:function(A,Q){var B=A.getUTCMonth();return"M"===Q?String(B+1):e(B+1,2)},d:function(A,Q){return e(A.getUTCDate(),Q.length)},a:function(A,Q){var B=A.getUTCHours()/12>=1?"pm":"am";switch(Q){case"a":case"aa":return B.toUpperCase();case"aaa":return B;case"aaaaa":return B[0];default:return"am"===B?"a.m.":"p.m."}},h:function(A,Q){return e(A.getUTCHours()%12||12,Q.length)},H:function(A,Q){return e(A.getUTCHours(),Q.length)},m:function(A,Q){return e(A.getUTCMinutes(),Q.length)},s:function(A,Q){return e(A.getUTCSeconds(),Q.length)},S:function(A,Q){var B=Q.length;return e(Math.floor(A.getUTCMilliseconds()*Math.pow(10,B-3)),Q.length)}},F={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"};function S(A,Q){var B=A>0?"-":"+",C=Math.abs(A),I=Math.floor(C/60),E=C%60;return 0===E?B+String(I):B+String(I)+(Q||"")+e(E,2)}function l(A,Q){return A%60==0?(A>0?"-":"+")+e(Math.abs(A)/60,2):H(A,Q)}function H(A,Q){var B=Math.abs(A);return(A>0?"-":"+")+e(Math.floor(B/60),2)+(Q||"")+e(B%60,2)}var Y={G:function(A,Q,B){var C=A.getUTCFullYear()>0?1:0;switch(Q){case"G":case"GG":case"GGG":return B.era(C,{width:"abbreviated"});case"GGGGG":return B.era(C,{width:"narrow"});default:return B.era(C,{width:"wide"})}},y:function(A,Q,B){if("yo"===Q){var C=A.getUTCFullYear();return B.ordinalNumber(C>0?C:1-C,{unit:"year"})}return J.y(A,Q)},Y:function(A,Q,B,C){var I=o(A,C),E=I>0?I:1-I;return"YY"===Q?e(E%100,2):"Yo"===Q?B.ordinalNumber(E,{unit:"year"}):e(E,Q.length)},R:function(A,Q){return e(a(A),Q.length)},u:function(A,Q){return e(A.getUTCFullYear(),Q.length)},Q:function(A,Q,B){var C=Math.ceil((A.getUTCMonth()+1)/3);switch(Q){case"Q":return String(C);case"QQ":return e(C,2);case"Qo":return B.ordinalNumber(C,{unit:"quarter"});case"QQQ":return B.quarter(C,{width:"abbreviated",context:"formatting"});case"QQQQQ":return B.quarter(C,{width:"narrow",context:"formatting"});default:return B.quarter(C,{width:"wide",context:"formatting"})}},q:function(A,Q,B){var C=Math.ceil((A.getUTCMonth()+1)/3);switch(Q){case"q":return String(C);case"qq":return e(C,2);case"qo":return B.ordinalNumber(C,{unit:"quarter"});case"qqq":return B.quarter(C,{width:"abbreviated",context:"standalone"});case"qqqqq":return B.quarter(C,{width:"narrow",context:"standalone"});default:return B.quarter(C,{width:"wide",context:"standalone"})}},M:function(A,Q,B){var C=A.getUTCMonth();switch(Q){case"M":case"MM":return J.M(A,Q);case"Mo":return B.ordinalNumber(C+1,{unit:"month"});case"MMM":return B.month(C,{width:"abbreviated",context:"formatting"});case"MMMMM":return B.month(C,{width:"narrow",context:"formatting"});default:return B.month(C,{width:"wide",context:"formatting"})}},L:function(A,Q,B){var C=A.getUTCMonth();switch(Q){case"L":return String(C+1);case"LL":return e(C+1,2);case"Lo":return B.ordinalNumber(C+1,{unit:"month"});case"LLL":return B.month(C,{width:"abbreviated",context:"standalone"});case"LLLLL":return B.month(C,{width:"narrow",context:"standalone"});default:return B.month(C,{width:"wide",context:"standalone"})}},w:function(A,Q,B,C){var I=function(A,Q){(0,L.Z)(1,arguments);var B=(0,K.Z)(A);return Math.round((N(B,Q).getTime()-(function(A,Q){(0,L.Z)(1,arguments);var B=Q||{},C=B.locale,I=C&&C.options&&C.options.firstWeekContainsDate,E=null==I?1:G(I),g=null==B.firstWeekContainsDate?E:G(B.firstWeekContainsDate),w=o(A,Q),D=new Date(0);return D.setUTCFullYear(w,0,g),D.setUTCHours(0,0,0,0),N(D,Q)})(B,Q).getTime())/6048e5)+1}(A,C);return"wo"===Q?B.ordinalNumber(I,{unit:"week"}):e(I,Q.length)},I:function(A,Q,B){var C=function(A){(0,L.Z)(1,arguments);var Q=(0,K.Z)(A);return Math.round((p(Q).getTime()-(function(A){(0,L.Z)(1,arguments);var Q=a(A),B=new Date(0);return B.setUTCFullYear(Q,0,4),B.setUTCHours(0,0,0,0),p(B)})(Q).getTime())/6048e5)+1}(A);return"Io"===Q?B.ordinalNumber(C,{unit:"week"}):e(C,Q.length)},d:function(A,Q,B){return"do"===Q?B.ordinalNumber(A.getUTCDate(),{unit:"date"}):J.d(A,Q)},D:function(A,Q,B){var C=function(A){(0,L.Z)(1,arguments);var Q=(0,K.Z)(A),B=Q.getTime();return Q.setUTCMonth(0,1),Q.setUTCHours(0,0,0,0),Math.floor((B-Q.getTime())/864e5)+1}(A);return"Do"===Q?B.ordinalNumber(C,{unit:"dayOfYear"}):e(C,Q.length)},E:function(A,Q,B){var C=A.getUTCDay();switch(Q){case"E":case"EE":case"EEE":return B.day(C,{width:"abbreviated",context:"formatting"});case"EEEEE":return B.day(C,{width:"narrow",context:"formatting"});case"EEEEEE":return B.day(C,{width:"short",context:"formatting"});default:return B.day(C,{width:"wide",context:"formatting"})}},e:function(A,Q,B,C){var I=A.getUTCDay(),E=(I-C.weekStartsOn+8)%7||7;switch(Q){case"e":return String(E);case"ee":return e(E,2);case"eo":return B.ordinalNumber(E,{unit:"day"});case"eee":return B.day(I,{width:"abbreviated",context:"formatting"});case"eeeee":return B.day(I,{width:"narrow",context:"formatting"});case"eeeeee":return B.day(I,{width:"short",context:"formatting"});default:return B.day(I,{width:"wide",context:"formatting"})}},c:function(A,Q,B,C){var I=A.getUTCDay(),E=(I-C.weekStartsOn+8)%7||7;switch(Q){case"c":return String(E);case"cc":return e(E,Q.length);case"co":return B.ordinalNumber(E,{unit:"day"});case"ccc":return B.day(I,{width:"abbreviated",context:"standalone"});case"ccccc":return B.day(I,{width:"narrow",context:"standalone"});case"cccccc":return B.day(I,{width:"short",context:"standalone"});default:return B.day(I,{width:"wide",context:"standalone"})}},i:function(A,Q,B){var C=A.getUTCDay(),I=0===C?7:C;switch(Q){case"i":return String(I);case"ii":return e(I,Q.length);case"io":return B.ordinalNumber(I,{unit:"day"});case"iii":return B.day(C,{width:"abbreviated",context:"formatting"});case"iiiii":return B.day(C,{width:"narrow",context:"formatting"});case"iiiiii":return B.day(C,{width:"short",context:"formatting"});default:return B.day(C,{width:"wide",context:"formatting"})}},a:function(A,Q,B){var C=A.getUTCHours()/12>=1?"pm":"am";switch(Q){case"a":case"aa":return B.dayPeriod(C,{width:"abbreviated",context:"formatting"});case"aaa":return B.dayPeriod(C,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return B.dayPeriod(C,{width:"narrow",context:"formatting"});default:return B.dayPeriod(C,{width:"wide",context:"formatting"})}},b:function(A,Q,B){var C,I=A.getUTCHours();switch(C=12===I?F.noon:0===I?F.midnight:I/12>=1?"pm":"am",Q){case"b":case"bb":return B.dayPeriod(C,{width:"abbreviated",context:"formatting"});case"bbb":return B.dayPeriod(C,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return B.dayPeriod(C,{width:"narrow",context:"formatting"});default:return B.dayPeriod(C,{width:"wide",context:"formatting"})}},B:function(A,Q,B){var C,I=A.getUTCHours();switch(C=I>=17?F.evening:I>=12?F.afternoon:I>=4?F.morning:F.night,Q){case"B":case"BB":case"BBB":return B.dayPeriod(C,{width:"abbreviated",context:"formatting"});case"BBBBB":return B.dayPeriod(C,{width:"narrow",context:"formatting"});default:return B.dayPeriod(C,{width:"wide",context:"formatting"})}},h:function(A,Q,B){if("ho"===Q){var C=A.getUTCHours()%12;return 0===C&&(C=12),B.ordinalNumber(C,{unit:"hour"})}return J.h(A,Q)},H:function(A,Q,B){return"Ho"===Q?B.ordinalNumber(A.getUTCHours(),{unit:"hour"}):J.H(A,Q)},K:function(A,Q,B){var C=A.getUTCHours()%12;return"Ko"===Q?B.ordinalNumber(C,{unit:"hour"}):e(C,Q.length)},k:function(A,Q,B){var C=A.getUTCHours();return(0===C&&(C=24),"ko"===Q)?B.ordinalNumber(C,{unit:"hour"}):e(C,Q.length)},m:function(A,Q,B){return"mo"===Q?B.ordinalNumber(A.getUTCMinutes(),{unit:"minute"}):J.m(A,Q)},s:function(A,Q,B){return"so"===Q?B.ordinalNumber(A.getUTCSeconds(),{unit:"second"}):J.s(A,Q)},S:function(A,Q){return J.S(A,Q)},X:function(A,Q,B,C){var I=(C._originalDate||A).getTimezoneOffset();if(0===I)return"Z";switch(Q){case"X":return l(I);case"XXXX":case"XX":return H(I);default:return H(I,":")}},x:function(A,Q,B,C){var I=(C._originalDate||A).getTimezoneOffset();switch(Q){case"x":return l(I);case"xxxx":case"xx":return H(I);default:return H(I,":")}},O:function(A,Q,B,C){var I=(C._originalDate||A).getTimezoneOffset();switch(Q){case"O":case"OO":case"OOO":return"GMT"+S(I,":");default:return"GMT"+H(I,":")}},z:function(A,Q,B,C){var I=(C._originalDate||A).getTimezoneOffset();switch(Q){case"z":case"zz":case"zzz":return"GMT"+S(I,":");default:return"GMT"+H(I,":")}},t:function(A,Q,B,C){return e(Math.floor((C._originalDate||A).getTime()/1e3),Q.length)},T:function(A,Q,B,C){return e((C._originalDate||A).getTime(),Q.length)}};function f(A,Q){switch(A){case"P":return Q.date({width:"short"});case"PP":return Q.date({width:"medium"});case"PPP":return Q.date({width:"long"});default:return Q.date({width:"full"})}}function d(A,Q){switch(A){case"p":return Q.time({width:"short"});case"pp":return Q.time({width:"medium"});case"ppp":return Q.time({width:"long"});default:return Q.time({width:"full"})}}var u={p:d,P:function(A,Q){var B,C=A.match(/(P+)(p+)?/)||[],I=C[1],E=C[2];if(!E)return f(A,Q);switch(I){case"P":B=Q.dateTime({width:"short"});break;case"PP":B=Q.dateTime({width:"medium"});break;case"PPP":B=Q.dateTime({width:"long"});break;default:B=Q.dateTime({width:"full"})}return B.replace("{{date}}",f(I,Q)).replace("{{time}}",d(E,Q))}},R=["D","DD"],j=["YY","YYYY"];function b(A,Q,B){if("YYYY"===A)throw RangeError("Use `yyyy` instead of `YYYY` (in `".concat(Q,"`) for formatting years to the input `").concat(B,"`; see: https://git.io/fxCyr"));if("YY"===A)throw RangeError("Use `yy` instead of `YY` (in `".concat(Q,"`) for formatting years to the input `").concat(B,"`; see: https://git.io/fxCyr"));if("D"===A)throw RangeError("Use `d` instead of `D` (in `".concat(Q,"`) for formatting days of the month to the input `").concat(B,"`; see: https://git.io/fxCyr"));if("DD"===A)throw RangeError("Use `dd` instead of `DD` (in `".concat(Q,"`) for formatting days of the month to the input `").concat(B,"`; see: https://git.io/fxCyr"))}var m=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,T=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Z=/^'([^]*?)'?$/,O=/''/g,x=/[a-zA-Z]/,v=B(9338);function V(){let A=(0,n.n)(),Q=(0,k.R2)({config:{swr:{refreshInterval:v.h}}});if(!Q.data)return null;let B=Q.data.index.height=1&&D<=7))throw RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var M=E.options&&E.options.weekStartsOn,c=null==M?0:G(M),s=null==I.weekStartsOn?c:G(I.weekStartsOn);if(!(s>=0&&s<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!E.localize)throw RangeError("locale must contain localize property");if(!E.formatLong)throw RangeError("locale must contain formatLong property");var y=(0,K.Z)(A);if(!function(A){return(0,L.Z)(1,arguments),(!!function(A){return(0,L.Z)(1,arguments),A instanceof Date||"object"==typeof A&&"[object Date]"===Object.prototype.toString.call(A)}(A)||"number"==typeof A)&&!isNaN(Number((0,K.Z)(A)))}(y))throw RangeError("Invalid time value");var h=(0,t.Z)(y),k=r(y,h),n={firstWeekContainsDate:D,weekStartsOn:s,locale:E,_originalDate:y};return C.match(T).map(function(A){var Q=A[0];return"p"===Q||"P"===Q?(0,u[Q])(A,E.formatLong,n):A}).join("").match(m).map(function(B){if("''"===B)return"'";var C=B[0];if("'"===C)return B.match(Z)[1].replace(O,"'");var g=Y[C];if(g)return I.useAdditionalWeekYearTokens||-1===j.indexOf(B)||b(B,Q,A),I.useAdditionalDayOfYearTokens||-1===R.indexOf(B)||b(B,Q,A),g(k,B,E.localize,n);if(C.match(x))throw RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");return B}).join("")}(C,w.formatRelative(c<-6?"other":c<-1?"lastWeek":c<0?"yesterday":c<1?"today":c<2?"tomorrow":c<7?"nextWeek":"other",s,y,{locale:w,weekStartsOn:M}),{locale:w,weekStartsOn:M})}(new Date(Q.data.startTime),new Date)]})]}),Q.data.error&&(0,C.jsx)("div",{className:"flex flex-col gap-1 overflow-hidden pt-1",children:(0,C.jsx)(I.xvT,{color:"contrast",size:"12",children:Q.data.error})})]})}):null}function z(A){let{children:Q}=A;return(0,C.jsx)(h,{children:(0,C.jsx)(E.Tu,{children:(0,C.jsx)(c.d,{children:(0,C.jsx)(w.k,{children:(0,C.jsx)(D.OZ,{children:(0,C.jsxs)(M.Yl,{children:[(0,C.jsx)(E.xQ,{}),(0,C.jsx)(V,{}),Q]})})})})})})}var W=B(98334),P=B(46058),q=B.n(P),X=B(28863),_=B.n(X);let $=(0,B(82851).cx)(q().variable,_().variable);function AA(A){let{Component:Q,pageProps:B}=A;return(0,C.jsx)(I.PD$,{className:$,fallback:B.fallback,passwordProtectRequestHooks:!0,lockRoutes:W._,children:(0,C.jsx)(z,{children:(0,C.jsx)(Q,{...B})})})}},55261:function(A,Q,B){"use strict";let C,I,E,g,w;B.d(Q,{bZj:function(){return D8},tU3:function(){return e_},zXq:function(){return Jl},juT:function(){return ev},Cts:function(){return MI},WVB:function(){return yF},zxk:function(){return D_},EKh:function(){return Mg},QHy:function(){return lN},HfT:function(){return lJ},ncR:function(){return NO},VqE:function(){return sQ},h_2:function(){return yf},Xiv:function(){return yd},Juw:function(){return yu},KpP:function(){return yR},cp7:function(){return Nv},Qyk:function(){return Nx},jIp:function(){return ll},WyV:function(){return lf},qGu:function(){return lS},QBj:function(){return lY},yEL:function(){return JQ},Bau:function(){return lH},ZqQ:function(){return NW},X6q:function(){return yT},Yqd:function(){return kA},__J:function(){return yW},rUS:function(){return yX},Qjf:function(){return y_},xgg:function(){return pH},kFS:function(){return yS},FzK:function(){return la},Clw:function(){return yJ},PD$:function(){return lj},Wxm:function(){return kI},wFK:function(){return eb},s_4:function(){return BP},nvN:function(){return Bz},u5Q:function(){return lt},j4H:function(){return kQ},J2e:function(){return hy},kod:function(){return ho},tIK:function(){return lQ},PhF:function(){return kC},Wh3:function(){return nw},Z0O:function(){return yp},DLL:function(){return ln},KJW:function(){return eW},rsf:function(){return kU},D_D:function(){return lE},iA_:function(){return ej},t6k:function(){return lF},xvT:function(){return BV},ua7:function(){return Dq},XxW:function(){return NC},YKL:function(){return Ng},ho9:function(){return NM},Sby:function(){return NE},hKn:function(){return lw},vQq:function(){return a5},ytg:function(){return lc},sWj:function(){return lM},XBW:function(){return ls},I13:function(){return a6},OHV:function(){return a1},OPV:function(){return a3},$Gg:function(){return a9},_4u:function(){return lP},Wdu:function(){return lW},c2j:function(){return e$},t0Y:function(){return ld},WsO:function(){return JA},Uu5:function(){return lq},oy6:function(){return lV},nNd:function(){return lD}});var D,M,c,s,y,h,k,n,t,K,L,U,i,G,r,p,a,N,o,e,J,F,S,l,H,Y,f,d,u,R,j,b,m,T,Z,O,x,v,V,z,W,P,q,X,_,$,AA,AQ,AB,AC,AI,AE,Ag,Aw,AD,AM,Ac,As,Ay,Ah,Ak,An={};B.r(An),B.d(An,{useDropzone:function(){return KC}});var At=B(52322),AK=B(2784),AL=B.t(AK,2);function AU(){return(AU=Object.assign?Object.assign.bind():function(A){for(var Q=1;QC,Object.values(C));return(0,AK.createElement)(B.Provider,{value:I},Q)}return C.displayName=A+"Provider",[C,function(C){let I=(0,AK.useContext)(B);if(I)return I;if(void 0!==Q)return Q;throw Error(`\`${C}\` must be used within \`${A}\``)}]}function AG(A,Q=[]){let B=[],C=()=>{let Q=B.map(A=>(0,AK.createContext)(A));return function(B){let C=(null==B?void 0:B[A])||Q;return(0,AK.useMemo)(()=>({[`__scope${A}`]:{...B,[A]:C}}),[B,C])}};return C.scopeName=A,[function(Q,C){let I=(0,AK.createContext)(C),E=B.length;function g(Q){let{scope:B,children:C,...g}=Q,w=(null==B?void 0:B[A][E])||I,D=(0,AK.useMemo)(()=>g,Object.values(g));return(0,AK.createElement)(w.Provider,{value:D},C)}return B=[...B,C],g.displayName=Q+"Provider",[g,function(B,g){let w=(null==g?void 0:g[A][E])||I,D=(0,AK.useContext)(w);if(D)return D;if(void 0!==C)return C;throw Error(`\`${B}\` must be used within \`${Q}\``)}]},function(...A){let Q=A[0];if(1===A.length)return Q;let B=()=>{let B=A.map(A=>({useScope:A(),scopeName:A.scopeName}));return function(A){let C=B.reduce((Q,{useScope:B,scopeName:C})=>{let I=B(A)[`__scope${C}`];return{...Q,...I}},{});return(0,AK.useMemo)(()=>({[`__scope${Q.scopeName}`]:C}),[C])}};return B.scopeName=Q.scopeName,B}(C,...Q)]}function Ar(...A){return Q=>A.forEach(A=>{"function"==typeof A?A(Q):null!=A&&(A.current=Q)})}function Ap(...A){return(0,AK.useCallback)(Ar(...A),A)}let Aa=(0,AK.forwardRef)((A,Q)=>{let{children:B,...C}=A,I=AK.Children.toArray(B),E=I.find(Ae);if(E){let A=E.props.children,B=I.map(Q=>Q!==E?Q:AK.Children.count(A)>1?AK.Children.only(null):(0,AK.isValidElement)(A)?A.props.children:null);return(0,AK.createElement)(AN,AU({},C,{ref:Q}),(0,AK.isValidElement)(A)?(0,AK.cloneElement)(A,void 0,B):null)}return(0,AK.createElement)(AN,AU({},C,{ref:Q}),B)});Aa.displayName="Slot";let AN=(0,AK.forwardRef)((A,Q)=>{let{children:B,...C}=A;return(0,AK.isValidElement)(B)?(0,AK.cloneElement)(B,{...function(A,Q){let B={...Q};for(let C in Q){let I=A[C],E=Q[C];/^on[A-Z]/.test(C)?B[C]=(...A)=>{null==E||E(...A),null==I||I(...A)}:"style"===C?B[C]={...I,...E}:"className"===C&&(B[C]=[I,E].filter(Boolean).join(" "))}return{...A,...B}}(C,B.props),ref:Ar(Q,B.ref)}):AK.Children.count(B)>1?AK.Children.only(null):null});AN.displayName="SlotClone";let Ao=({children:A})=>(0,AK.createElement)(AK.Fragment,null,A);function Ae(A){return(0,AK.isValidElement)(A)&&A.type===Ao}function AJ(A){let Q=A+"CollectionProvider",[B,C]=AG(Q),[I,E]=B(Q,{collectionRef:{current:null},itemMap:new Map}),g=A+"CollectionSlot",w=AK.forwardRef((A,Q)=>{let{scope:B,children:C}=A,I=Ap(Q,E(g,B).collectionRef);return AK.createElement(Aa,{ref:I},C)}),D=A+"CollectionItemSlot",M="data-radix-collection-item";return[{Provider:A=>{let{scope:Q,children:B}=A,C=AK.useRef(null),E=AK.useRef(new Map).current;return AK.createElement(I,{scope:Q,itemMap:E,collectionRef:C},B)},Slot:w,ItemSlot:AK.forwardRef((A,Q)=>{let{scope:B,children:C,...I}=A,g=AK.useRef(null),w=Ap(Q,g),c=E(D,B);return AK.useEffect(()=>(c.itemMap.set(g,{ref:g,...I}),()=>void c.itemMap.delete(g))),AK.createElement(Aa,{[M]:"",ref:w},C)})},function(Q){let B=E(A+"CollectionConsumer",Q);return AK.useCallback(()=>{let A=B.collectionRef.current;if(!A)return[];let Q=Array.from(A.querySelectorAll(`[${M}]`));return Array.from(B.itemMap.values()).sort((A,B)=>Q.indexOf(A.ref.current)-Q.indexOf(B.ref.current))},[B.collectionRef,B.itemMap])},C]}function AF(A,Q,{checkForDefaultPrevented:B=!0}={}){return function(C){if(null==A||A(C),!1===B||!C.defaultPrevented)return null==Q?void 0:Q(C)}}function AS(A){let Q=(0,AK.useRef)(A);return(0,AK.useEffect)(()=>{Q.current=A}),(0,AK.useMemo)(()=>(...A)=>{var B;return null===(B=Q.current)||void 0===B?void 0:B.call(Q,...A)},[])}function Al({prop:A,defaultProp:Q,onChange:B=()=>{}}){let[C,I]=function({defaultProp:A,onChange:Q}){let B=(0,AK.useState)(A),[C]=B,I=(0,AK.useRef)(C),E=AS(Q);return(0,AK.useEffect)(()=>{I.current!==C&&(E(C),I.current=C)},[C,I,E]),B}({defaultProp:Q,onChange:B}),E=void 0!==A,g=E?A:C,w=AS(B);return[g,(0,AK.useCallback)(Q=>{if(E){let B="function"==typeof Q?Q(A):Q;B!==A&&w(B)}else I(Q)},[E,A,I,w])]}var AH=B(28316);let AY=["a","button","div","h2","h3","img","li","nav","ol","p","span","svg","ul"].reduce((A,Q)=>{let B=(0,AK.forwardRef)((A,B)=>{let{asChild:C,...I}=A,E=C?Aa:Q;return(0,AK.useEffect)(()=>{window[Symbol.for("radix-ui")]=!0},[]),(0,AK.createElement)(E,AU({},I,{ref:B}))});return B.displayName=`Primitive.${Q}`,{...A,[Q]:B}},{});function Af(A,Q){A&&(0,AH.flushSync)(()=>A.dispatchEvent(Q))}let Ad=(null==globalThis?void 0:globalThis.document)?AK.useLayoutEffect:()=>{},Au=A=>{let{present:Q,children:B}=A,C=function(A){var Q,B;let[C,I]=(0,AK.useState)(),E=(0,AK.useRef)({}),g=(0,AK.useRef)(A),w=(0,AK.useRef)("none"),[D,M]=(Q=A?"mounted":"unmounted",B={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},(0,AK.useReducer)((A,Q)=>{let C=B[A][Q];return null!=C?C:A},Q));return(0,AK.useEffect)(()=>{let A=AR(E.current);w.current="mounted"===D?A:"none"},[D]),Ad(()=>{let Q=E.current,B=g.current;if(B!==A){let C=w.current,I=AR(Q);A?M("MOUNT"):"none"===I||(null==Q?void 0:Q.display)==="none"?M("UNMOUNT"):B&&C!==I?M("ANIMATION_OUT"):M("UNMOUNT"),g.current=A}},[A,M]),Ad(()=>{if(C){let A=A=>{let Q=AR(E.current).includes(A.animationName);A.target===C&&Q&&(0,AH.flushSync)(()=>M("ANIMATION_END"))},Q=A=>{A.target===C&&(w.current=AR(E.current))};return C.addEventListener("animationstart",Q),C.addEventListener("animationcancel",A),C.addEventListener("animationend",A),()=>{C.removeEventListener("animationstart",Q),C.removeEventListener("animationcancel",A),C.removeEventListener("animationend",A)}}M("ANIMATION_END")},[C,M]),{isPresent:["mounted","unmountSuspended"].includes(D),ref:(0,AK.useCallback)(A=>{A&&(E.current=getComputedStyle(A)),I(A)},[])}}(Q),I="function"==typeof B?B({present:C.isPresent}):AK.Children.only(B),E=Ap(C.ref,I.ref);return"function"==typeof B||C.isPresent?(0,AK.cloneElement)(I,{ref:E}):null};function AR(A){return(null==A?void 0:A.animationName)||"none"}Au.displayName="Presence";let Aj=AL["useId".toString()]||(()=>void 0),Ab=0;function Am(A){let[Q,B]=AK.useState(Aj());return Ad(()=>{A||B(A=>null!=A?A:String(Ab++))},[A]),A||(Q?`radix-${Q}`:"")}let AT="Collapsible",[AZ,AO]=AG(AT),[Ax,Av]=AZ(AT),AV=((A,Q)=>{let{__scopeCollapsible:B,open:C,defaultOpen:I,disabled:E,onOpenChange:g,...w}=A,[D=!1,M]=Al({prop:C,defaultProp:I,onChange:g});return(0,AK.createElement)(Ax,{scope:B,disabled:E,contentId:Am(),open:D,onOpenToggle:(0,AK.useCallback)(()=>M(A=>!A),[M])},(0,AK.createElement)(AY.div,AU({"data-state":AW(D),"data-disabled":E?"":void 0},w,{ref:Q})))},"CollapsibleContent"),Az=((A,Q)=>{let{forceMount:B,...C}=A,I=Av(AV,A.__scopeCollapsible);return(0,AK.createElement)(Au,{present:B||I.open},({present:A})=>(0,AK.createElement)(Az,AU({},C,{ref:Q,present:A})))},(0,AK.forwardRef)((A,Q)=>{let{__scopeCollapsible:B,present:C,children:I,...E}=A,g=Av(AV,B),[w,D]=(0,AK.useState)(C),M=(0,AK.useRef)(null),c=Ap(Q,M),s=(0,AK.useRef)(0),y=s.current,h=(0,AK.useRef)(0),k=h.current,n=g.open||w,t=(0,AK.useRef)(n),K=(0,AK.useRef)();return(0,AK.useEffect)(()=>{let A=requestAnimationFrame(()=>t.current=!1);return()=>cancelAnimationFrame(A)},[]),Ad(()=>{let A=M.current;if(A){K.current=K.current||{transitionDuration:A.style.transitionDuration,animationDuration:A.style.animationDuration,animationFillMode:A.style.animationFillMode},A.style.transitionDuration="0s",A.style.animationDuration="0s",A.style.animationFillMode="none";let Q=A.getBoundingClientRect();s.current=Q.height,h.current=Q.width,t.current||(A.style.transitionDuration=K.current.transitionDuration,A.style.animationDuration=K.current.animationDuration,A.style.animationFillMode=K.current.animationFillMode),D(C)}},[g.open,C]),(0,AK.createElement)(AY.div,AU({"data-state":AW(g.open),"data-disabled":g.disabled?"":void 0,id:g.contentId,hidden:!n},E,{ref:c,style:{"--radix-collapsible-content-height":y?`${y}px`:void 0,"--radix-collapsible-content-width":k?`${k}px`:void 0,...A.style}}),n&&I)}));function AW(A){return A?"open":"closed"}let AP="Accordion",Aq=["Home","End","ArrowDown","ArrowUp"],[AX,A_,A$]=AJ(AP),[A0,A8]=AG(AP,[A$,AO]);AO(),AK.forwardRef((A,Q)=>{let{type:B,...C}=A;return AK.createElement(AX.Provider,{scope:A.__scopeAccordion},"multiple"===B?AK.createElement(A9,AU({},C,{ref:Q})):AK.createElement(A5,AU({},C,{ref:Q})))}).propTypes={type(A){let Q=A.value||A.defaultValue;return A.type&&!["single","multiple"].includes(A.type)?Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`."):"multiple"===A.type&&"string"==typeof Q?Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`."):"single"===A.type&&Array.isArray(Q)?Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`."):null}};let[A3,A1]=A0(AP),[A4,A2]=A0(AP,{collapsible:!1}),A5=AK.forwardRef((A,Q)=>{let{value:B,defaultValue:C,onValueChange:I=()=>{},collapsible:E=!1,...g}=A,[w,D]=Al({prop:B,defaultProp:C,onChange:I});return AK.createElement(A3,{scope:A.__scopeAccordion,value:w?[w]:[],onItemOpen:D,onItemClose:AK.useCallback(()=>E&&D(""),[E,D])},AK.createElement(A4,{scope:A.__scopeAccordion,collapsible:E},AK.createElement(QA,AU({},g,{ref:Q}))))}),A9=AK.forwardRef((A,Q)=>{let{value:B,defaultValue:C,onValueChange:I=()=>{},...E}=A,[g=[],w]=Al({prop:B,defaultProp:C,onChange:I}),D=AK.useCallback(A=>w((Q=[])=>[...Q,A]),[w]),M=AK.useCallback(A=>w((Q=[])=>Q.filter(Q=>Q!==A)),[w]);return AK.createElement(A3,{scope:A.__scopeAccordion,value:g,onItemOpen:D,onItemClose:M},AK.createElement(A4,{scope:A.__scopeAccordion,collapsible:!0},AK.createElement(QA,AU({},E,{ref:Q}))))}),[A6,A7]=A0(AP),QA=AK.forwardRef((A,Q)=>{let{__scopeAccordion:B,disabled:C,...I}=A,E=Ap(AK.useRef(null),Q),g=A_(B),w=AF(A.onKeyDown,A=>{var Q;if(!Aq.includes(A.key))return;let B=A.target,C=g().filter(A=>{var Q;return!(null!==(Q=A.ref.current)&&void 0!==Q&&Q.disabled)}),I=C.findIndex(A=>A.ref.current===B),E=C.length;if(-1===I)return;A.preventDefault();let w=I;switch(A.key){case"Home":w=0;break;case"End":w=E-1;break;case"ArrowDown":w=I+1;break;case"ArrowUp":(w=I-1)<0&&(w=E-1)}null===(Q=C[w%E].ref.current)||void 0===Q||Q.focus()});return AK.createElement(A6,{scope:B,disabled:C},AK.createElement(AX.Slot,{scope:B},AK.createElement(AY.div,AU({},I,{ref:E,onKeyDown:C?void 0:w}))))}),[QQ,QB]=A0("AccordionItem");var QC=B(82851);let QI="dismissableLayer.update",QE=(0,AK.createContext)({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Qg=(0,AK.forwardRef)((A,Q)=>{let{disableOutsidePointerEvents:B=!1,onEscapeKeyDown:I,onPointerDownOutside:E,onFocusOutside:g,onInteractOutside:w,onDismiss:D,...M}=A,c=(0,AK.useContext)(QE),[s,y]=(0,AK.useState)(null),[,h]=(0,AK.useState)({}),k=Ap(Q,A=>y(A)),n=Array.from(c.layers),[t]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),K=n.indexOf(t),L=s?n.indexOf(s):-1,U=c.layersWithOutsidePointerEventsDisabled.size>0,i=L>=K,G=function(A){let Q=AS(A),B=(0,AK.useRef)(!1),C=(0,AK.useRef)(()=>{});return(0,AK.useEffect)(()=>{let A=A=>{if(A.target&&!B.current){let B={originalEvent:A};function I(){QD("dismissableLayer.pointerDownOutside",Q,B,{discrete:!0})}"touch"===A.pointerType?(document.removeEventListener("click",C.current),C.current=I,document.addEventListener("click",C.current,{once:!0})):I()}B.current=!1},I=window.setTimeout(()=>{document.addEventListener("pointerdown",A)},0);return()=>{window.clearTimeout(I),document.removeEventListener("pointerdown",A),document.removeEventListener("click",C.current)}},[Q]),{onPointerDownCapture:()=>B.current=!0}}(A=>{let Q=A.target,B=[...c.branches].some(A=>A.contains(Q));!i||B||(null==E||E(A),null==w||w(A),A.defaultPrevented||null==D||D())}),r=function(A){let Q=AS(A),B=(0,AK.useRef)(!1);return(0,AK.useEffect)(()=>{let A=A=>{A.target&&!B.current&&QD("dismissableLayer.focusOutside",Q,{originalEvent:A},{discrete:!1})};return document.addEventListener("focusin",A),()=>document.removeEventListener("focusin",A)},[Q]),{onFocusCapture:()=>B.current=!0,onBlurCapture:()=>B.current=!1}}(A=>{let Q=A.target;[...c.branches].some(A=>A.contains(Q))||(null==g||g(A),null==w||w(A),A.defaultPrevented||null==D||D())});return!function(A){let Q=AS(A);(0,AK.useEffect)(()=>{let A=A=>{"Escape"===A.key&&Q(A)};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[Q])}(A=>{L!==c.layers.size-1||(null==I||I(A),!A.defaultPrevented&&D&&(A.preventDefault(),D()))}),(0,AK.useEffect)(()=>{if(s)return B&&(0===c.layersWithOutsidePointerEventsDisabled.size&&(C=document.body.style.pointerEvents,document.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(s)),c.layers.add(s),Qw(),()=>{B&&1===c.layersWithOutsidePointerEventsDisabled.size&&(document.body.style.pointerEvents=C)}},[s,B,c]),(0,AK.useEffect)(()=>()=>{s&&(c.layers.delete(s),c.layersWithOutsidePointerEventsDisabled.delete(s),Qw())},[s,c]),(0,AK.useEffect)(()=>{let A=()=>h({});return document.addEventListener(QI,A),()=>document.removeEventListener(QI,A)},[]),(0,AK.createElement)(AY.div,AU({},M,{ref:k,style:{pointerEvents:U?i?"auto":"none":void 0,...A.style},onFocusCapture:AF(A.onFocusCapture,r.onFocusCapture),onBlurCapture:AF(A.onBlurCapture,r.onBlurCapture),onPointerDownCapture:AF(A.onPointerDownCapture,G.onPointerDownCapture)}))});function Qw(){let A=new CustomEvent(QI);document.dispatchEvent(A)}function QD(A,Q,B,{discrete:C}){let I=B.originalEvent.target,E=new CustomEvent(A,{bubbles:!1,cancelable:!0,detail:B});Q&&I.addEventListener(A,Q,{once:!0}),C?Af(I,E):I.dispatchEvent(E)}function QM(A){return A.split("-")[0]}function Qc(A){return A.split("-")[1]}function Qs(A){return["top","bottom"].includes(QM(A))?"x":"y"}function Qy(A){return"y"===A?"height":"width"}function Qh(A,Q,B){let C,{reference:I,floating:E}=A,g=I.x+I.width/2-E.width/2,w=I.y+I.height/2-E.height/2,D=Qs(Q),M=Qy(D),c=I[M]/2-E[M]/2,s="x"===D;switch(QM(Q)){case"top":C={x:g,y:I.y-E.height};break;case"bottom":C={x:g,y:I.y+I.height};break;case"right":C={x:I.x+I.width,y:w};break;case"left":C={x:I.x-E.width,y:w};break;default:C={x:I.x,y:I.y}}switch(Qc(Q)){case"start":C[D]-=c*(B&&s?-1:1);break;case"end":C[D]+=c*(B&&s?-1:1)}return C}let Qk=async(A,Q,B)=>{let{placement:C="bottom",strategy:I="absolute",middleware:E=[],platform:g}=B,w=await (null==g.isRTL?void 0:g.isRTL(Q)),D=await g.getElementRects({reference:A,floating:Q,strategy:I}),{x:M,y:c}=Qh(D,C,w),s=C,y={},h=0;for(let B=0;B({name:"arrow",options:A,async fn(Q){let{element:B,padding:C=0}=null!=A?A:{},{x:I,y:E,placement:g,rects:w,platform:D}=Q;if(null==B)return{};let M=Qn(C),c={x:I,y:E},s=Qs(g),y=Qc(g),h=Qy(s),k=await D.getDimensions(B),n="y"===s?"top":"left",t="y"===s?"bottom":"right",K=w.reference[h]+w.reference[s]-c[s]-w.floating[h],L=c[s]-w.reference[s],U=await (null==D.getOffsetParent?void 0:D.getOffsetParent(B)),i=U?"y"===s?U.clientHeight||0:U.clientWidth||0:0;0===i&&(i=w.floating[h]);let G=M[n],r=i-k[h]-M[t],p=i/2-k[h]/2+(K/2-L/2),a=QU(G,QL(p,r)),N=("start"===y?M[n]:M[t])>0&&p!==a&&w.reference[h]<=w.floating[h];return{[s]:c[s]-(N?pQG[A])}let Qp={start:"end",end:"start"};function Qa(A){return A.replace(/start|end/g,A=>Qp[A])}let QN=["top","right","bottom","left"];QN.reduce((A,Q)=>A.concat(Q,Q+"-start",Q+"-end"),[]);let Qo=function(A){return void 0===A&&(A={}),{name:"flip",options:A,async fn(Q){var B,C,I,E;let{placement:g,middlewareData:w,rects:D,initialPlacement:M,platform:c,elements:s}=Q,{mainAxis:y=!0,crossAxis:h=!0,fallbackPlacements:k,fallbackStrategy:n="bestFit",flipAlignment:t=!0,...K}=A,L=QM(g),U=k||(L!==M&&t?function(A){let Q=Qr(A);return[Qa(A),Q,Qa(Q)]}(M):[Qr(M)]),i=[M,...U],G=await QK(Q,K),r=[],p=(null==(B=w.flip)?void 0:B.overflows)||[];if(y&&r.push(G[L]),h){let{main:A,cross:Q}=function(A,Q,B){void 0===B&&(B=!1);let C=Qc(A),I=Qs(A),E=Qy(I),g="x"===I?C===(B?"end":"start")?"right":"left":"start"===C?"bottom":"top";return Q.reference[E]>Q.floating[E]&&(g=Qr(g)),{main:g,cross:Qr(g)}}(g,D,await (null==c.isRTL?void 0:c.isRTL(s.floating)));r.push(G[A],G[Q])}if(p=[...p,{placement:g,overflows:r}],!r.every(A=>A<=0)){let A=(null!=(C=null==(I=w.flip)?void 0:I.index)?C:0)+1,Q=i[A];if(Q)return{data:{index:A,overflows:p},reset:{placement:Q}};let B="bottom";switch(n){case"bestFit":{let A=null==(E=p.map(A=>[A,A.overflows.filter(A=>A>0).reduce((A,Q)=>A+Q,0)]).sort((A,Q)=>A[1]-Q[1])[0])?void 0:E[0].placement;A&&(B=A);break}case"initialPlacement":B=M}if(g!==B)return{reset:{placement:B}}}return{}}}};function Qe(A,Q){return{top:A.top-Q.height,right:A.right-Q.width,bottom:A.bottom-Q.height,left:A.left-Q.width}}function QJ(A){return QN.some(Q=>A[Q]>=0)}let QF=function(A){let{strategy:Q="referenceHidden",...B}=void 0===A?{}:A;return{name:"hide",async fn(A){let{rects:C}=A;switch(Q){case"referenceHidden":{let Q=Qe(await QK(A,{...B,elementContext:"reference"}),C.reference);return{data:{referenceHiddenOffsets:Q,referenceHidden:QJ(Q)}}}case"escaped":{let Q=Qe(await QK(A,{...B,altBoundary:!0}),C.floating);return{data:{escapedOffsets:Q,escaped:QJ(Q)}}}default:return{}}}}},QS=function(A){return void 0===A&&(A=0),{name:"offset",options:A,async fn(Q){let{x:B,y:C}=Q,I=await async function(A,Q){let{placement:B,platform:C,elements:I}=A,E=await (null==C.isRTL?void 0:C.isRTL(I.floating)),g=QM(B),w=Qc(B),D="x"===Qs(B),M=["left","top"].includes(g)?-1:1,c=E&&D?-1:1,s="function"==typeof Q?Q(A):Q,{mainAxis:y,crossAxis:h,alignmentAxis:k}="number"==typeof s?{mainAxis:s,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...s};return w&&"number"==typeof k&&(h="end"===w?-1*k:k),D?{x:h*c,y:y*M}:{x:y*M,y:h*c}}(Q,A);return{x:B+I.x,y:C+I.y,data:I}}}};function Ql(A){return"x"===A?"y":"x"}let QH=function(A){return void 0===A&&(A={}),{name:"shift",options:A,async fn(Q){let{x:B,y:C,placement:I}=Q,{mainAxis:E=!0,crossAxis:g=!1,limiter:w={fn:A=>{let{x:Q,y:B}=A;return{x:Q,y:B}}},...D}=A,M={x:B,y:C},c=await QK(Q,D),s=Qs(QM(I)),y=Ql(s),h=M[s],k=M[y];if(E){let A="y"===s?"bottom":"right";h=QU(h+c["y"===s?"top":"left"],QL(h,h-c[A]))}if(g){let A="y"===y?"bottom":"right";k=QU(k+c["y"===y?"top":"left"],QL(k,k-c[A]))}let n=w.fn({...Q,[s]:h,[y]:k});return{...n,data:{x:n.x-B,y:n.y-C}}}}},QY=function(A){return void 0===A&&(A={}),{options:A,fn(Q){let{x:B,y:C,placement:I,rects:E,middlewareData:g}=Q,{offset:w=0,mainAxis:D=!0,crossAxis:M=!0}=A,c={x:B,y:C},s=Qs(I),y=Ql(s),h=c[s],k=c[y],n="function"==typeof w?w({...E,placement:I}):w,t="number"==typeof n?{mainAxis:n,crossAxis:0}:{mainAxis:0,crossAxis:0,...n};if(D){let A="y"===s?"height":"width",Q=E.reference[s]-E.floating[A]+t.mainAxis,B=E.reference[s]+E.reference[A]-t.mainAxis;hB&&(h=B)}if(M){var K,L,U,i;let A="y"===s?"width":"height",Q=["top","left"].includes(QM(I)),B=E.reference[y]-E.floating[A]+(Q&&null!=(K=null==(L=g.offset)?void 0:L[y])?K:0)+(Q?0:t.crossAxis),C=E.reference[y]+E.reference[A]+(Q?0:null!=(U=null==(i=g.offset)?void 0:i[y])?U:0)-(Q?t.crossAxis:0);kC&&(k=C)}return{[s]:h,[y]:k}}}};function Qf(A){return A&&A.document&&A.location&&A.alert&&A.setInterval}function Qd(A){if(null==A)return window;if(!Qf(A)){let Q=A.ownerDocument;return Q&&Q.defaultView||window}return A}function Qu(A){return Qd(A).getComputedStyle(A)}function QR(A){return Qf(A)?"":A?(A.nodeName||"").toLowerCase():""}function Qj(){let A=navigator.userAgentData;return null!=A&&A.brands?A.brands.map(A=>A.brand+"/"+A.version).join(" "):navigator.userAgent}function Qb(A){return A instanceof Qd(A).HTMLElement}function Qm(A){return A instanceof Qd(A).Element}function QT(A){return"undefined"!=typeof ShadowRoot&&(A instanceof Qd(A).ShadowRoot||A instanceof ShadowRoot)}function QZ(A){let{overflow:Q,overflowX:B,overflowY:C}=Qu(A);return/auto|scroll|overlay|hidden/.test(Q+C+B)}function QO(A){let Q=/firefox/i.test(Qj()),B=Qu(A);return"none"!==B.transform||"none"!==B.perspective||"paint"===B.contain||["transform","perspective"].includes(B.willChange)||Q&&"filter"===B.willChange||Q&&!!B.filter&&"none"!==B.filter}function Qx(){return!/^((?!chrome|android).)*safari/i.test(Qj())}let Qv=Math.min,QV=Math.max,Qz=Math.round;function QW(A,Q,B){var C,I,E,g;void 0===Q&&(Q=!1),void 0===B&&(B=!1);let w=A.getBoundingClientRect(),D=1,M=1;Q&&Qb(A)&&(D=A.offsetWidth>0&&Qz(w.width)/A.offsetWidth||1,M=A.offsetHeight>0&&Qz(w.height)/A.offsetHeight||1);let c=Qm(A)?Qd(A):window,s=!Qx()&&B,y=(w.left+(s&&null!=(C=null==(I=c.visualViewport)?void 0:I.offsetLeft)?C:0))/D,h=(w.top+(s&&null!=(E=null==(g=c.visualViewport)?void 0:g.offsetTop)?E:0))/M,k=w.width/D,n=w.height/M;return{width:k,height:n,top:h,right:y+k,bottom:h+n,left:y,x:y,y:h}}function QP(A){return((A instanceof Qd(A).Node?A.ownerDocument:A.document)||window.document).documentElement}function Qq(A){return Qm(A)?{scrollLeft:A.scrollLeft,scrollTop:A.scrollTop}:{scrollLeft:A.pageXOffset,scrollTop:A.pageYOffset}}function QX(A){return QW(QP(A)).left+Qq(A).scrollLeft}function Q_(A){return"html"===QR(A)?A:A.assignedSlot||A.parentNode||(QT(A)?A.host:null)||QP(A)}function Q$(A){return Qb(A)&&"fixed"!==getComputedStyle(A).position?A.offsetParent:null}function Q0(A){let Q=Qd(A),B=Q$(A);for(;B&&["table","td","th"].includes(QR(B))&&"static"===getComputedStyle(B).position;)B=Q$(B);return B&&("html"===QR(B)||"body"===QR(B)&&"static"===getComputedStyle(B).position&&!QO(B))?Q:B||function(A){let Q=Q_(A);for(QT(Q)&&(Q=Q.host);Qb(Q)&&!["html","body"].includes(QR(Q));){if(QO(Q))return Q;Q=Q.parentNode}return null}(A)||Q}function Q8(A){if(Qb(A))return{width:A.offsetWidth,height:A.offsetHeight};let Q=QW(A);return{width:Q.width,height:Q.height}}function Q3(A,Q){var B;void 0===Q&&(Q=[]);let C=function A(Q){let B=Q_(Q);return["html","body","#document"].includes(QR(B))?Q.ownerDocument.body:Qb(B)&&QZ(B)?B:A(B)}(A),I=C===(null==(B=A.ownerDocument)?void 0:B.body),E=Qd(C),g=I?[E].concat(E.visualViewport||[],QZ(C)?C:[]):C,w=Q.concat(g);return I?w:w.concat(Q3(g))}function Q1(A,Q,B){return"viewport"===Q?Qt(function(A,Q){let B=Qd(A),C=QP(A),I=B.visualViewport,E=C.clientWidth,g=C.clientHeight,w=0,D=0;if(I){E=I.width,g=I.height;let A=Qx();(A||!A&&"fixed"===Q)&&(w=I.offsetLeft,D=I.offsetTop)}return{width:E,height:g,x:w,y:D}}(A,B)):Qm(Q)?function(A,Q){let B=QW(A,!1,"fixed"===Q),C=B.top+A.clientTop,I=B.left+A.clientLeft;return{top:C,left:I,x:I,y:C,right:I+A.clientWidth,bottom:C+A.clientHeight,width:A.clientWidth,height:A.clientHeight}}(Q,B):Qt(function(A){var Q;let B=QP(A),C=Qq(A),I=null==(Q=A.ownerDocument)?void 0:Q.body,E=QV(B.scrollWidth,B.clientWidth,I?I.scrollWidth:0,I?I.clientWidth:0),g=QV(B.scrollHeight,B.clientHeight,I?I.scrollHeight:0,I?I.clientHeight:0),w=-C.scrollLeft+QX(A),D=-C.scrollTop;return"rtl"===Qu(I||B).direction&&(w+=QV(B.clientWidth,I?I.clientWidth:0)-E),{width:E,height:g,x:w,y:D}}(QP(A)))}let Q4={getClippingRect:function(A){let{element:Q,boundary:B,rootBoundary:C,strategy:I}=A,E=[..."clippingAncestors"===B?function(A){let Q=Q3(A),B=["absolute","fixed"].includes(Qu(A).position)&&Qb(A)?Q0(A):A;return Qm(B)?Q.filter(A=>Qm(A)&&function(A,Q){let B=null==Q.getRootNode?void 0:Q.getRootNode();if(A.contains(Q))return!0;if(B&&QT(B)){let B=Q;do{if(B&&A===B)return!0;B=B.parentNode||B.host}while(B)}return!1}(A,B)&&"body"!==QR(A)):[]}(Q):[].concat(B),C],g=E[0],w=E.reduce((A,B)=>{let C=Q1(Q,B,I);return A.top=QV(C.top,A.top),A.right=Qv(C.right,A.right),A.bottom=Qv(C.bottom,A.bottom),A.left=QV(C.left,A.left),A},Q1(Q,g,I));return{width:w.right-w.left,height:w.bottom-w.top,x:w.left,y:w.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(A){let{rect:Q,offsetParent:B,strategy:C}=A,I=Qb(B),E=QP(B);if(B===E)return Q;let g={scrollLeft:0,scrollTop:0},w={x:0,y:0};if((I||!I&&"fixed"!==C)&&(("body"!==QR(B)||QZ(E))&&(g=Qq(B)),Qb(B))){let A=QW(B,!0);w.x=A.x+B.clientLeft,w.y=A.y+B.clientTop}return{...Q,x:Q.x-g.scrollLeft+w.x,y:Q.y-g.scrollTop+w.y}},isElement:Qm,getDimensions:Q8,getOffsetParent:Q0,getDocumentElement:QP,getElementRects:A=>{let{reference:Q,floating:B,strategy:C}=A;return{reference:function(A,Q,B){let C=Qb(Q),I=QP(Q),E=QW(A,C&&function(A){let Q=QW(A);return Qz(Q.width)!==A.offsetWidth||Qz(Q.height)!==A.offsetHeight}(Q),"fixed"===B),g={scrollLeft:0,scrollTop:0},w={x:0,y:0};if(C||!C&&"fixed"!==B){if(("body"!==QR(Q)||QZ(I))&&(g=Qq(Q)),Qb(Q)){let A=QW(Q,!0);w.x=A.x+Q.clientLeft,w.y=A.y+Q.clientTop}else I&&(w.x=QX(I))}return{x:E.left+g.scrollLeft-w.x,y:E.top+g.scrollTop-w.y,width:E.width,height:E.height}}(Q,Q0(B),C),floating:{...Q8(B),x:0,y:0}}},getClientRects:A=>Array.from(A.getClientRects()),isRTL:A=>"rtl"===Qu(A).direction};function Q2(A,Q,B,C){void 0===C&&(C={});let{ancestorScroll:I=!0,ancestorResize:E=!0,elementResize:g=!0,animationFrame:w=!1}=C,D=I&&!w,M=E&&!w,c=D||M?[...Qm(A)?Q3(A):[],...Q3(Q)]:[];c.forEach(A=>{D&&A.addEventListener("scroll",B,{passive:!0}),M&&A.addEventListener("resize",B)});let s,y=null;if(g){let C=!0;y=new ResizeObserver(()=>{C||B(),C=!1}),Qm(A)&&!w&&y.observe(A),y.observe(Q)}let h=w?QW(A):null;return w&&function Q(){let C=QW(A);h&&(C.x!==h.x||C.y!==h.y||C.width!==h.width||C.height!==h.height)&&B(),h=C,s=requestAnimationFrame(Q)}(),B(),()=>{var A;c.forEach(A=>{D&&A.removeEventListener("scroll",B),M&&A.removeEventListener("resize",B)}),null==(A=y)||A.disconnect(),y=null,w&&cancelAnimationFrame(s)}}let Q5=(A,Q,B)=>Qk(A,Q,{platform:Q4,...B});var Q9="undefined"!=typeof document?AK.useLayoutEffect:AK.useEffect;function Q6(A){let{middleware:Q,placement:B="bottom",strategy:C="absolute",whileElementsMounted:I}=void 0===A?{}:A,E=AK.useRef(null),g=AK.useRef(null),w=function(A){let Q=AK.useRef(A);return Q9(()=>{Q.current=A}),Q}(I),D=AK.useRef(null),[M,c]=AK.useState({x:null,y:null,strategy:C,placement:B,middlewareData:{}}),[s,y]=AK.useState(Q);!function A(Q,B){let C,I,E;if(Q===B)return!0;if(typeof Q!=typeof B)return!1;if("function"==typeof Q&&Q.toString()===B.toString())return!0;if(Q&&B&&"object"==typeof Q){if(Array.isArray(Q)){if((C=Q.length)!=B.length)return!1;for(I=C;0!=I--;)if(!A(Q[I],B[I]))return!1;return!0}if((C=(E=Object.keys(Q)).length)!==Object.keys(B).length)return!1;for(I=C;0!=I--;)if(!Object.prototype.hasOwnProperty.call(B,E[I]))return!1;for(I=C;0!=I--;){let C=E[I];if(("_owner"!==C||!Q.$$typeof)&&!A(Q[C],B[C]))return!1}return!0}return Q!=Q&&B!=B}(null==s?void 0:s.map(A=>{let{options:Q}=A;return Q}),null==Q?void 0:Q.map(A=>{let{options:Q}=A;return Q}))&&y(Q);let h=AK.useCallback(()=>{E.current&&g.current&&Q5(E.current,g.current,{middleware:s,placement:B,strategy:C}).then(A=>{k.current&&AH.flushSync(()=>{c(A)})})},[s,B,C]);Q9(()=>{k.current&&h()},[h]);let k=AK.useRef(!1);Q9(()=>(k.current=!0,()=>{k.current=!1}),[]);let n=AK.useCallback(()=>{if("function"==typeof D.current&&(D.current(),D.current=null),E.current&&g.current){if(w.current){let A=w.current(E.current,g.current,h);D.current=A}else h()}},[h,w]),t=AK.useCallback(A=>{E.current=A,n()},[n]),K=AK.useCallback(A=>{g.current=A,n()},[n]),L=AK.useMemo(()=>({reference:E,floating:g}),[]);return AK.useMemo(()=>({...M,update:h,refs:L,reference:t,floating:K}),[M,h,L,t,K])}let Q7=A=>{let{element:Q,padding:B}=A;return{name:"arrow",options:A,fn(A){if(Object.prototype.hasOwnProperty.call(Q,"current")){if(null!=Q.current)return Qi({element:Q.current,padding:B}).fn(A)}else if(Q)return Qi({element:Q,padding:B}).fn(A);return{}}}},BA=(0,AK.forwardRef)((A,Q)=>{let{children:B,width:C=10,height:I=5,...E}=A;return(0,AK.createElement)(AY.svg,AU({},E,{ref:Q,width:C,height:I,viewBox:"0 0 30 10",preserveAspectRatio:"none"}),A.asChild?B:(0,AK.createElement)("polygon",{points:"0,0 30,0 15,10"}))});function BQ(A){let[Q,B]=(0,AK.useState)(void 0);return Ad(()=>{if(A){B({width:A.offsetWidth,height:A.offsetHeight});let Q=new ResizeObserver(Q=>{let C,I;if(!Array.isArray(Q)||!Q.length)return;let E=Q[0];if("borderBoxSize"in E){let A=E.borderBoxSize,Q=Array.isArray(A)?A[0]:A;C=Q.inlineSize,I=Q.blockSize}else C=A.offsetWidth,I=A.offsetHeight;B({width:C,height:I})});return Q.observe(A,{box:"border-box"}),()=>Q.unobserve(A)}B(void 0)},[A]),Q}let BB="Popper",[BC,BI]=AG(BB),[BE,Bg]=BC(BB),Bw=(0,AK.forwardRef)((A,Q)=>{let{__scopePopper:B,virtualRef:C,...I}=A,E=Bg("PopperAnchor",B),g=(0,AK.useRef)(null),w=Ap(Q,g);return(0,AK.useEffect)(()=>{E.onAnchorChange((null==C?void 0:C.current)||g.current)}),C?null:(0,AK.createElement)(AY.div,AU({},I,{ref:w}))}),BD="PopperContent",[BM,Bc]=BC(BD),[Bs,By]=BC(BD,{hasParent:!1,positionUpdateFns:new Set}),Bh=(0,AK.forwardRef)((A,Q)=>{var B,C,I,E,g,w,D,M;let{__scopePopper:c,side:s="bottom",sideOffset:y=0,align:h="center",alignOffset:k=0,arrowPadding:n=0,collisionBoundary:t=[],collisionPadding:K=0,sticky:L="partial",hideWhenDetached:U=!1,avoidCollisions:i=!0,...G}=A,r=Bg(BD,c),[p,a]=(0,AK.useState)(null),N=Ap(Q,A=>a(A)),[o,e]=(0,AK.useState)(null),J=BQ(o),F=null!==(B=null==J?void 0:J.width)&&void 0!==B?B:0,S=null!==(C=null==J?void 0:J.height)&&void 0!==C?C:0,l="number"==typeof K?K:{top:0,right:0,bottom:0,left:0,...K},H=Array.isArray(t)?t:[t],Y=H.length>0,f={padding:l,boundary:H.filter(BK),altBoundary:Y},{reference:d,floating:u,strategy:R,x:j,y:b,placement:m,middlewareData:T,update:Z}=Q6({strategy:"fixed",placement:s+("center"!==h?"-"+h:""),whileElementsMounted:Q2,middleware:[QS({mainAxis:y+S,alignmentAxis:k}),i?QH({mainAxis:!0,crossAxis:!1,limiter:"partial"===L?QY():void 0,...f}):void 0,o?Q7({element:o,padding:n}):void 0,i?Qo({...f}):void 0,BL({arrowWidth:F,arrowHeight:S}),U?QF({strategy:"referenceHidden"}):void 0].filter(Bt)});Ad(()=>{d(r.anchor)},[d,r.anchor]);let O=null!==j&&null!==b,[x,v]=BU(m),V=null===(I=T.arrow)||void 0===I?void 0:I.x,z=null===(E=T.arrow)||void 0===E?void 0:E.y,W=(null===(g=T.arrow)||void 0===g?void 0:g.centerOffset)!==0,[P,q]=(0,AK.useState)();Ad(()=>{p&&q(window.getComputedStyle(p).zIndex)},[p]);let{hasParent:X,positionUpdateFns:_}=By(BD,c),$=!X;(0,AK.useLayoutEffect)(()=>{if(!$)return _.add(Z),()=>{_.delete(Z)}},[$,_,Z]),(0,AK.useLayoutEffect)(()=>{$&&O&&Array.from(_).reverse().forEach(A=>requestAnimationFrame(A))},[$,O,_]);let AA={"data-side":x,"data-align":v,...G,ref:N,style:{...G.style,animation:O?void 0:"none",opacity:null!==(w=T.hide)&&void 0!==w&&w.referenceHidden?0:void 0}};return(0,AK.createElement)("div",{ref:u,"data-radix-popper-content-wrapper":"",style:{position:R,left:0,top:0,transform:O?`translate3d(${Math.round(j)}px, ${Math.round(b)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:P,"--radix-popper-transform-origin":[null===(D=T.transformOrigin)||void 0===D?void 0:D.x,null===(M=T.transformOrigin)||void 0===M?void 0:M.y].join(" ")}},(0,AK.createElement)(BM,{scope:c,placedSide:x,onArrowChange:e,arrowX:V,arrowY:z,shouldHideArrow:W},$?(0,AK.createElement)(Bs,{scope:c,hasParent:!0,positionUpdateFns:_},(0,AK.createElement)(AY.div,AA)):(0,AK.createElement)(AY.div,AA)))}),Bk={top:"bottom",right:"left",bottom:"top",left:"right"},Bn=(0,AK.forwardRef)(function(A,Q){let{__scopePopper:B,...C}=A,I=Bc("PopperArrow",B),E=Bk[I.placedSide];return(0,AK.createElement)("span",{ref:I.onArrowChange,style:{position:"absolute",left:I.arrowX,top:I.arrowY,[E]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[I.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[I.placedSide],visibility:I.shouldHideArrow?"hidden":void 0}},(0,AK.createElement)(BA,AU({},C,{ref:Q,style:{...C.style,display:"block"}})))});function Bt(A){return void 0!==A}function BK(A){return null!==A}let BL=A=>({name:"transformOrigin",options:A,fn(Q){var B,C,I,E,g;let{placement:w,rects:D,middlewareData:M}=Q,c=(null===(B=M.arrow)||void 0===B?void 0:B.centerOffset)!==0,s=c?0:A.arrowWidth,y=c?0:A.arrowHeight,[h,k]=BU(w),n={start:"0%",center:"50%",end:"100%"}[k],t=(null!==(C=null===(I=M.arrow)||void 0===I?void 0:I.x)&&void 0!==C?C:0)+s/2,K=(null!==(E=null===(g=M.arrow)||void 0===g?void 0:g.y)&&void 0!==E?E:0)+y/2,L="",U="";return"bottom"===h?(L=c?n:`${t}px`,U=`${-y}px`):"top"===h?(L=c?n:`${t}px`,U=`${D.floating.height+y}px`):"right"===h?(L=`${-y}px`,U=c?n:`${K}px`):"left"===h&&(L=`${D.floating.width+y}px`,U=c?n:`${K}px`),{data:{x:L,y:U}}}});function BU(A){let[Q,B="center"]=A.split("-");return[Q,B]}let Bi=A=>{let{__scopePopper:Q,children:B}=A,[C,I]=(0,AK.useState)(null);return(0,AK.createElement)(BE,{scope:Q,anchor:C,onAnchorChange:I},B)},BG=(0,AK.forwardRef)((A,Q)=>{var B;let{container:C=null==globalThis?void 0:null===(B=globalThis.document)||void 0===B?void 0:B.body,...I}=A;return C?AH.createPortal((0,AK.createElement)(AY.div,AU({},I,{ref:Q})),C):null}),Br=(0,AK.forwardRef)((A,Q)=>(0,AK.createElement)(AY.span,AU({},A,{ref:Q,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...A.style}}))),[Bp,Ba]=AG("Tooltip",[BI]),BN=BI(),Bo="tooltip.open",[Be,BJ]=Bp("TooltipProvider"),BF="Tooltip",[BS,Bl]=Bp(BF),BH="TooltipTrigger",BY=(0,AK.forwardRef)((A,Q)=>{let{__scopeTooltip:B,...C}=A,I=Bl(BH,B),E=BJ(BH,B),g=BN(B),w=Ap(Q,(0,AK.useRef)(null),I.onTriggerChange),D=(0,AK.useRef)(!1),M=(0,AK.useRef)(!1),c=(0,AK.useCallback)(()=>D.current=!1,[]);return(0,AK.useEffect)(()=>()=>document.removeEventListener("pointerup",c),[c]),(0,AK.createElement)(Bw,AU({asChild:!0},g),(0,AK.createElement)(AY.button,AU({"aria-describedby":I.open?I.contentId:void 0,"data-state":I.stateAttribute},C,{ref:w,onPointerMove:AF(A.onPointerMove,A=>{"touch"===A.pointerType||M.current||E.isPointerInTransitRef.current||(I.onTriggerEnter(),M.current=!0)}),onPointerLeave:AF(A.onPointerLeave,()=>{I.onTriggerLeave(),M.current=!1}),onPointerDown:AF(A.onPointerDown,()=>{D.current=!0,document.addEventListener("pointerup",c,{once:!0})}),onFocus:AF(A.onFocus,()=>{D.current||I.onOpen()}),onBlur:AF(A.onBlur,I.onClose),onClick:AF(A.onClick,A=>{0===A.detail&&I.onClose()})})))}),Bf="TooltipPortal",[Bd,Bu]=Bp(Bf,{forceMount:void 0}),BR="TooltipContent",Bj=(0,AK.forwardRef)((A,Q)=>{let B=Bu(BR,A.__scopeTooltip),{forceMount:C=B.forceMount,side:I="top",...E}=A,g=Bl(BR,A.__scopeTooltip);return(0,AK.createElement)(Au,{present:C||g.open},g.disableHoverableContent?(0,AK.createElement)(BZ,AU({side:I},E,{ref:Q})):(0,AK.createElement)(Bb,AU({side:I},E,{ref:Q})))}),Bb=(0,AK.forwardRef)((A,Q)=>{let B=Bl(BR,A.__scopeTooltip),C=BJ(BR,A.__scopeTooltip),I=(0,AK.useRef)(null),E=Ap(Q,I),[g,w]=(0,AK.useState)(null),{trigger:D,onClose:M}=B,c=I.current,{onPointerInTransitChange:s}=C,y=(0,AK.useCallback)(()=>{w(null),s(!1)},[s]),h=(0,AK.useCallback)((A,Q)=>{let B=A.currentTarget,C=function(A,Q){let B=Math.abs(Q.top-A.y),C=Math.abs(Q.bottom-A.y),I=Math.abs(Q.right-A.x),E=Math.abs(Q.left-A.x);switch(Math.min(B,C,I,E)){case E:return"left";case I:return"right";case B:return"top";case C:return"bottom";default:return null}}({x:A.clientX,y:A.clientY},B.getBoundingClientRect()),I="right"===C||"bottom"===C?-5:5;w(function(A){let Q=A.slice();return Q.sort((A,Q)=>A.xQ.x?1:A.yQ.y?1:0),function(A){if(A.length<=1)return A.slice();let Q=[];for(let B=0;B=2;){let A=Q[Q.length-1],B=Q[Q.length-2];if((A.x-B.x)*(C.y-B.y)>=(A.y-B.y)*(C.x-B.x))Q.pop();else break}Q.push(C)}Q.pop();let B=[];for(let Q=A.length-1;Q>=0;Q--){let C=A[Q];for(;B.length>=2;){let A=B[B.length-1],Q=B[B.length-2];if((A.x-Q.x)*(C.y-Q.y)>=(A.y-Q.y)*(C.x-Q.x))B.pop();else break}B.push(C)}return(B.pop(),1===Q.length&&1===B.length&&Q[0].x===B[0].x&&Q[0].y===B[0].y)?Q:Q.concat(B)}(Q)}(["right"===C||"left"===C?{x:A.clientX+I,y:A.clientY}:{x:A.clientX,y:A.clientY+I},...function(A){let{top:Q,right:B,bottom:C,left:I}=A;return[{x:I,y:Q},{x:B,y:Q},{x:B,y:C},{x:I,y:C}]}(Q.getBoundingClientRect())])),s(!0)},[s]);return(0,AK.useEffect)(()=>()=>y(),[y]),(0,AK.useEffect)(()=>{if(D&&c){let A=A=>h(A,c),Q=A=>h(A,D);return D.addEventListener("pointerleave",A),c.addEventListener("pointerleave",Q),()=>{D.removeEventListener("pointerleave",A),c.removeEventListener("pointerleave",Q)}}},[D,c,h,y]),(0,AK.useEffect)(()=>{if(g){let A=A=>{let Q=A.target,B={x:A.clientX,y:A.clientY},C=(null==D?void 0:D.contains(Q))||(null==c?void 0:c.contains(Q)),I=!function(A,Q){let{x:B,y:C}=A,I=!1;for(let A=0,E=Q.length-1;AC!=M>C&&B<(D-g)*(C-w)/(M-w)+g&&(I=!I)}return I}(B,g);C?y():I&&(y(),M())};return document.addEventListener("pointermove",A),()=>document.removeEventListener("pointermove",A)}},[D,c,g,M,y]),(0,AK.createElement)(BZ,AU({},A,{ref:E}))}),[Bm,BT]=Bp(BF,{isInside:!1}),BZ=(0,AK.forwardRef)((A,Q)=>{let{__scopeTooltip:B,children:C,"aria-label":I,onEscapeKeyDown:E,onPointerDownOutside:g,...w}=A,D=Bl(BR,B),M=BN(B),{onClose:c}=D;return(0,AK.useEffect)(()=>(document.addEventListener(Bo,c),()=>document.removeEventListener(Bo,c)),[c]),(0,AK.useEffect)(()=>{if(D.trigger){let A=A=>{let Q=A.target;null!=Q&&Q.contains(D.trigger)&&c()};return window.addEventListener("scroll",A,{capture:!0}),()=>window.removeEventListener("scroll",A,{capture:!0})}},[D.trigger,c]),(0,AK.createElement)(Qg,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:E,onPointerDownOutside:g,onFocusOutside:A=>A.preventDefault(),onDismiss:c},(0,AK.createElement)(Bh,AU({"data-state":D.stateAttribute},M,w,{ref:Q,style:{...w.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)"}}),(0,AK.createElement)(Ao,null,C),(0,AK.createElement)(Bm,{scope:B,isInside:!0},(0,AK.createElement)(Br,{id:D.contentId,role:"tooltip"},I||C))))}),BO=A=>{let{__scopeTooltip:Q,children:B,open:C,defaultOpen:I=!1,onOpenChange:E,disableHoverableContent:g,delayDuration:w}=A,D=BJ(BF,A.__scopeTooltip),M=BN(Q),[c,s]=(0,AK.useState)(null),y=Am(),h=(0,AK.useRef)(0),k=null!=g?g:D.disableHoverableContent,n=null!=w?w:D.delayDuration,t=(0,AK.useRef)(!1),[K=!1,L]=Al({prop:C,defaultProp:I,onChange:A=>{A?(D.onOpen(),document.dispatchEvent(new CustomEvent(Bo))):D.onClose(),null==E||E(A)}}),U=(0,AK.useMemo)(()=>K?t.current?"delayed-open":"instant-open":"closed",[K]),i=(0,AK.useCallback)(()=>{window.clearTimeout(h.current),t.current=!1,L(!0)},[L]),G=(0,AK.useCallback)(()=>{window.clearTimeout(h.current),L(!1)},[L]),r=(0,AK.useCallback)(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{t.current=!0,L(!0)},n)},[n,L]);return(0,AK.useEffect)(()=>()=>window.clearTimeout(h.current),[]),(0,AK.createElement)(Bi,M,(0,AK.createElement)(BS,{scope:Q,contentId:y,open:K,stateAttribute:U,trigger:c,onTriggerChange:s,onTriggerEnter:(0,AK.useCallback)(()=>{D.isOpenDelayed?r():i()},[D.isOpenDelayed,r,i]),onTriggerLeave:(0,AK.useCallback)(()=>{k?G():window.clearTimeout(h.current)},[G,k]),onOpen:i,onClose:G,disableHoverableContent:k},B))},Bx=A=>{let{__scopeTooltip:Q,forceMount:B,children:C,container:I}=A,E=Bl(Bf,Q);return(0,AK.createElement)(Bd,{scope:Q,forceMount:B},(0,AK.createElement)(Au,{present:B||E.open},(0,AK.createElement)(BG,{asChild:!0,container:I},C)))},Bv=(0,QC.j)([],{variants:{display:{default:"inline-block",none:""},font:{mono:"font-mono",sans:"font-sans"},color:{verySubtle:"text-gray-700 dark:text-graydark-700",subtle:"text-gray-1000 dark:text-graydark-1000",contrast:"text-gray-1100 dark:text-white",lo:"text-white dark:text-graydark-50",accent:"text-accent-1100 dark:text-accentdark-1100",red:"text-red-700 dark:text-red-400",green:"text-emerald-700 dark:text-emerald-500",amber:"text-amber-600 dark:text-amber-500",none:""},weight:{extrabold:"font-extrabold",bold:"font-bold",medium:"font-medium",semibold:"font-semibold",regular:"font-normal",normal:"font-normal",light:"font-light",none:""},size:{10:"text-xxs",12:"text-xs",14:"text-sm",16:"text-base",18:"text-lg",20:"text-xl",24:"text-2xl",30:"text-3xl",36:"text-4xl",40:"text-5xl",48:"text-5xl",60:"text-6xl",64:"text-6xl"},scaleSize:{12:"text-xxs md:text-xs",14:"text-xs md:text-sm",16:"text-sm md:text-base",18:"text-base md:text-lg",20:"text-base md:text-xl",24:"text-xl md:text-2xl",30:"text-2xl md:text-3xl",36:"text-3xl md:text-4xl",40:"text-4xl md:text-5xl",48:"text-4xl md:text-5xl",60:"text-5xl md:text-6xl",64:"text-5xl md:text-6xl"},noWrap:{true:"whitespace-nowrap"},underline:{accent:"underline underline-offset-2 decoration-2 decoration-accent-900 dark:decoration-accentdark-900",show:"underline underline-offset-2 decoration-gray-1100 dark:decoration-gray-500",hover:"hover:underline underline-offset-2 decoration-gray-1100 dark:decoration-gray-500",none:""},ellipsis:{true:"overflow-hidden text-ellipsis whitespace-nowrap"},wrapEllipsis:{true:"overflow-hidden text-ellipsis"}},defaultVariants:{display:"default",weight:"regular",font:"sans",color:"contrast",underline:"none"}}),BV=AK.forwardRef((A,Q)=>{let{tag:B="span",className:C,font:I,color:E,weight:g,size:w,scaleSize:D,noWrap:M,underline:c,ellipsis:s,wrapEllipsis:y,...h}=A;return(0,At.jsx)(B,{ref:Q,className:(0,QC.cx)(C,Bv({font:I,color:E,weight:g,size:w,scaleSize:D,underline:c,noWrap:M,ellipsis:s,wrapEllipsis:y})),...h})}),Bz=AK.forwardRef((A,Q)=>{let{size:B="18",...C}=A;return(0,At.jsx)(BV,{tag:"p",...C,ref:Q,weight:"regular",scaleSize:B,color:"subtle",className:(0,QC.cx)("leading-relaxed md:leading-relaxed",A.className)})}),BW=(0,QC.j)(["transition-shadow ease-in-out duration-300","shadow-sm hover:shadow","rounded","border"],{variants:{color:{default:["bg-white dark:bg-graydark-200","border-gray-400 dark:border-graydark-400"],subtle:["border-gray-200 dark:border-graydark-200"]}},defaultVariants:{color:"default"}}),BP=AK.forwardRef((A,Q)=>{let{className:B,color:C,...I}=A;return(0,At.jsx)("div",{ref:Q,className:BW({className:B,color:C}),...I})});var Bq=B(93542);let BX=(void 0===Bq||Bq.env,"production"),B_=1/60*1e3,B$="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),B0="undefined"!=typeof window?A=>window.requestAnimationFrame(A):A=>setTimeout(()=>A(B$()),B_),B8=!0,B3=!1,B1=!1,B4={delta:0,timestamp:0},B2=["read","update","preRender","render","postRender"],B5=B2.reduce((A,Q)=>(A[Q]=function(A){let Q=[],B=[],C=0,I=!1,E=!1,g=new WeakSet,w={schedule:(A,E=!1,w=!1)=>{let D=w&&I,M=D?Q:B;return E&&g.add(A),-1===M.indexOf(A)&&(M.push(A),D&&I&&(C=Q.length)),A},cancel:A=>{let Q=B.indexOf(A);-1!==Q&&B.splice(Q,1),g.delete(A)},process:D=>{if(I){E=!0;return}if(I=!0,[Q,B]=[B,Q],B.length=0,C=Q.length)for(let B=0;BB3=!0),A),{}),B9=B2.reduce((A,Q)=>{let B=B5[Q];return A[Q]=(A,Q=!1,C=!1)=>(B3||CB(),B.schedule(A,Q,C)),A},{}),B6=B2.reduce((A,Q)=>(A[Q]=B5[Q].cancel,A),{}),B7=B2.reduce((A,Q)=>(A[Q]=()=>B5[Q].process(B4),A),{}),CA=A=>B5[A].process(B4),CQ=A=>{B3=!1,B4.delta=B8?B_:Math.max(Math.min(A-B4.timestamp,40),1),B4.timestamp=A,B1=!0,B2.forEach(CA),B1=!1,B3&&(B8=!1,B0(CQ))},CB=()=>{B3=!0,B8=!0,B1||B0(CQ)},CC=()=>B4,CI="undefined"!=typeof document,CE=CI?AK.useLayoutEffect:AK.useEffect;function Cg(){let A=(0,AK.useRef)(!1);return CE(()=>(A.current=!0,()=>{A.current=!1}),[]),A}let Cw=(0,AK.createContext)(null);function CD(A){let Q=(0,AK.useRef)(null);return null===Q.current&&(Q.current=A()),Q.current}class CM extends AK.Component{getSnapshotBeforeUpdate(A){let Q=this.props.childRef.current;if(Q&&A.isPresent&&!this.props.isPresent){let A=this.props.sizeRef.current;A.height=Q.offsetHeight||0,A.width=Q.offsetWidth||0,A.top=Q.offsetTop,A.left=Q.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Cc({children:A,isPresent:Q}){let B=(0,AK.useId)(),C=(0,AK.useRef)(null),I=(0,AK.useRef)({width:0,height:0,top:0,left:0});return(0,AK.useInsertionEffect)(()=>{let{width:A,height:E,top:g,left:w}=I.current;if(Q||!C.current||!A||!E)return;C.current.dataset.motionPopId=B;let D=document.createElement("style");return document.head.appendChild(D),D.sheet&&D.sheet.insertRule(` [data-motion-pop-id="${B}"] { position: absolute !important; width: ${A}px !important; @@ -27,19 +27,19 @@ top: ${g}px !important; left: ${w}px !important; } - `),()=>{document.head.removeChild(D)}},[Q]),AK.createElement(CM,{isPresent:Q,childRef:C,sizeRef:I},AK.cloneElement(A,{ref:C}))}let Cs=({children:A,initial:Q,isPresent:B,onExitComplete:C,custom:I,presenceAffectsLayout:E,mode:g})=>{let w=CD(Cy),D=(0,AK.useId)(),M=(0,AK.useMemo)(()=>({id:D,initial:Q,isPresent:B,custom:I,onExitComplete:A=>{for(let Q of(w.set(A,!0),w.values()))if(!Q)return;C&&C()},register:A=>(w.set(A,!1),()=>w.delete(A))}),E?void 0:[B]);return(0,AK.useMemo)(()=>{w.forEach((A,Q)=>w.set(Q,!1))},[B]),AK.useEffect(()=>{B||w.size||!C||C()},[B]),"popLayout"===g&&(A=AK.createElement(Cc,{isPresent:B},A)),AK.createElement(Cw.Provider,{value:M},A)};function Cy(){return new Map}let Ch=(0,AK.createContext)({});function Ck(A){return(0,AK.useEffect)(()=>()=>A(),[])}let Cn=new Set;function Ct(A,Q,B){A||Cn.has(Q)||(console.warn(Q),B&&console.warn(B),Cn.add(Q))}let CK=A=>A.key||"",CL=({children:A,custom:Q,initial:B=!0,onExitComplete:C,exitBeforeEnter:I,presenceAffectsLayout:E=!0,mode:g="sync"})=>{I&&(g="wait",Ct(!1,"Replace exitBeforeEnter with mode='wait'"));let[w]=function(){let A=Cg(),[Q,B]=(0,AK.useState)(0),C=(0,AK.useCallback)(()=>{A.current&&B(Q+1)},[Q]);return[(0,AK.useCallback)(()=>B9.postRender(C),[C]),Q]}(),D=(0,AK.useContext)(Ch).forceRender;D&&(w=D);let M=Cg(),c=function(A){let Q=[];return AK.Children.forEach(A,A=>{(0,AK.isValidElement)(A)&&Q.push(A)}),Q}(A),s=c,y=new Set,h=(0,AK.useRef)(s),k=(0,AK.useRef)(new Map).current,n=(0,AK.useRef)(!0);if(CE(()=>{n.current=!1,function(A,Q){A.forEach(A=>{let B=CK(A);Q.set(B,A)})}(c,k),h.current=s}),Ck(()=>{n.current=!0,k.clear(),y.clear()}),n.current)return AK.createElement(AK.Fragment,null,s.map(A=>AK.createElement(Cs,{key:CK(A),isPresent:!0,initial:!!B&&void 0,presenceAffectsLayout:E,mode:g},A)));s=[...s];let t=h.current.map(CK),K=c.map(CK),L=t.length;for(let A=0;A{if(-1!==K.indexOf(A))return;let B=k.get(A);if(!B)return;let I=t.indexOf(A);s.splice(I,0,AK.createElement(Cs,{key:CK(B),isPresent:!1,onExitComplete:()=>{k.delete(A),y.delete(A);let Q=h.current.findIndex(Q=>Q.key===A);if(h.current.splice(Q,1),!y.size){if(h.current=c,!1===M.current)return;w(),C&&C()}},custom:Q,presenceAffectsLayout:E,mode:g},B))}),s=s.map(A=>{let Q=A.key;return y.has(Q)?A:AK.createElement(Cs,{key:CK(A),isPresent:!0,presenceAffectsLayout:E,mode:g},A)}),"production"!==BX&&"wait"===g&&s.length>1&&console.warn('You\'re attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.'),AK.createElement(AK.Fragment,null,y.size?s:s.map(A=>(0,AK.cloneElement)(A)))},CU=(0,AK.createContext)({transformPagePoint:A=>A,isStatic:!1,reducedMotion:"never"}),Ci=(0,AK.createContext)({}),CG=(0,AK.createContext)({strict:!1});function Cr(A){return"object"==typeof A&&Object.prototype.hasOwnProperty.call(A,"current")}function Cp(A){return"string"==typeof A||Array.isArray(A)}function Ca(A){return"object"==typeof A&&"function"==typeof A.start}let CN=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function Co(A){return Ca(A.animate)||CN.some(Q=>Cp(A[Q]))}function Ce(A){return!!(Co(A)||A.variants)}function CJ(A){return Array.isArray(A)?A.join(" "):A}let CF=A=>({isEnabled:Q=>A.some(A=>!!Q[A])}),CS={measureLayout:CF(["layout","layoutId","drag"]),animation:CF(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:CF(["exit"]),drag:CF(["drag","dragControls"]),focus:CF(["whileFocus"]),hover:CF(["whileHover","onHoverStart","onHoverEnd"]),tap:CF(["whileTap","onTap","onTapStart","onTapCancel"]),pan:CF(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:CF(["whileInView","onViewportEnter","onViewportLeave"])},Cl={hasAnimatedSinceResize:!0,hasEverUpdated:!1},CH=1;class CY extends AK.Component{getSnapshotBeforeUpdate(){let{visualElement:A,props:Q}=this.props;return A&&A.setProps(Q),null}componentDidUpdate(){}render(){return this.props.children}}let Cf=(0,AK.createContext)({}),Cd=Symbol.for("motionComponentSymbol"),Cu=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function CR(A){if("string"!=typeof A||A.includes("-"));else if(Cu.indexOf(A)>-1||/[A-Z]/.test(A))return!0;return!1}let Cj={},Cb=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Cm=new Set(Cb);function CT(A,{layout:Q,layoutId:B}){return Cm.has(A)||A.startsWith("origin")||(Q||void 0!==B)&&(!!Cj[A]||"opacity"===A)}let CZ=A=>!!(null==A?void 0:A.getVelocity),CO={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Cv=(A,Q)=>Cb.indexOf(A)-Cb.indexOf(Q);function Cx(A){return A.startsWith("--")}let CV=(A,Q)=>Q&&"number"==typeof A?Q.transform(A):A,Cz=(A,Q)=>B=>Math.max(Math.min(B,Q),A),CW=A=>A%1?Number(A.toFixed(5)):A,CP=/(-)?([\d]*\.?[\d])+/g,Cq=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,CX=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function C_(A){return"string"==typeof A}let C$=A=>({test:Q=>C_(Q)&&Q.endsWith(A)&&1===Q.split(" ").length,parse:parseFloat,transform:Q=>`${Q}${A}`}),C0=C$("deg"),C8=C$("%"),C3=C$("px"),C1=C$("vh"),C4=C$("vw"),C2=Object.assign(Object.assign({},C8),{parse:A=>C8.parse(A)/100,transform:A=>C8.transform(100*A)}),C5={test:A=>"number"==typeof A,parse:parseFloat,transform:A=>A},C9=Object.assign(Object.assign({},C5),{transform:Cz(0,1)}),C6=Object.assign(Object.assign({},C5),{default:1}),C7={...C5,transform:Math.round},IA={borderWidth:C3,borderTopWidth:C3,borderRightWidth:C3,borderBottomWidth:C3,borderLeftWidth:C3,borderRadius:C3,radius:C3,borderTopLeftRadius:C3,borderTopRightRadius:C3,borderBottomRightRadius:C3,borderBottomLeftRadius:C3,width:C3,maxWidth:C3,height:C3,maxHeight:C3,size:C3,top:C3,right:C3,bottom:C3,left:C3,padding:C3,paddingTop:C3,paddingRight:C3,paddingBottom:C3,paddingLeft:C3,margin:C3,marginTop:C3,marginRight:C3,marginBottom:C3,marginLeft:C3,rotate:C0,rotateX:C0,rotateY:C0,rotateZ:C0,scale:C6,scaleX:C6,scaleY:C6,scaleZ:C6,skew:C0,skewX:C0,skewY:C0,distance:C3,translateX:C3,translateY:C3,translateZ:C3,x:C3,y:C3,z:C3,perspective:C3,transformPerspective:C3,opacity:C9,originX:C2,originY:C2,originZ:C3,zIndex:C7,fillOpacity:C9,strokeOpacity:C9,numOctaves:C7};function IQ(A,Q,B,C){let{style:I,vars:E,transform:g,transformKeys:w,transformOrigin:D}=A;w.length=0;let M=!1,c=!1,s=!0;for(let A in Q){let B=Q[A];if(Cx(A)){E[A]=B;continue}let C=IA[A],y=CV(B,C);if(Cm.has(A)){if(M=!0,g[A]=y,w.push(A),!s)continue;B!==(C.default||0)&&(s=!1)}else A.startsWith("origin")?(c=!0,D[A]=y):I[A]=y}if(!Q.transform&&(M||C?I.transform=function({transform:A,transformKeys:Q},{enableHardwareAcceleration:B=!0,allowTransformNone:C=!0},I,E){let g="";for(let B of(Q.sort(Cv),Q))g+=`${CO[B]||B}(${A[B]}) `;return B&&!A.z&&(g+="translateZ(0)"),g=g.trim(),E?g=E(A,I?"":g):C&&I&&(g="none"),g}(A,B,s,C):I.transform&&(I.transform="none")),c){let{originX:A="50%",originY:Q="50%",originZ:B=0}=D;I.transformOrigin=`${A} ${Q} ${B}`}}let IB=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function IC(A,Q,B){for(let C in Q)CZ(Q[C])||CT(C,B)||(A[C]=Q[C])}let II=new Set(["initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","onHoverStart","onHoverEnd","layoutScroll","whileInView","onViewportEnter","onViewportLeave","viewport","whileTap","onTap","onTapStart","onTapCancel","animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView","onPan","onPanStart","onPanSessionStart","onPanEnd"]);function IE(A){return II.has(A)}let Ig=A=>!IE(A);try{(D=require("@emotion/is-prop-valid").default)&&(Ig=A=>A.startsWith("on")?!IE(A):D(A))}catch(A){}function Iw(A,Q,B){return"string"==typeof A?A:C3.transform(Q+B*A)}let ID={offset:"stroke-dashoffset",array:"stroke-dasharray"},IM={offset:"strokeDashoffset",array:"strokeDasharray"};function Ic(A,{attrX:Q,attrY:B,originX:C,originY:I,pathLength:E,pathSpacing:g=1,pathOffset:w=0,...D},M,c){IQ(A,D,M,c),A.attrs=A.style,A.style={};let{attrs:s,style:y,dimensions:h}=A;s.transform&&(h&&(y.transform=s.transform),delete s.transform),h&&(void 0!==C||void 0!==I||y.transform)&&(y.transformOrigin=function(A,Q,B){let C=Iw(Q,A.x,A.width),I=Iw(B,A.y,A.height);return`${C} ${I}`}(h,void 0!==C?C:.5,void 0!==I?I:.5)),void 0!==Q&&(s.x=Q),void 0!==B&&(s.y=B),void 0!==E&&function(A,Q,B=1,C=0,I=!0){A.pathLength=1;let E=I?ID:IM;A[E.offset]=C3.transform(-C);let g=C3.transform(Q),w=C3.transform(B);A[E.array]=`${g} ${w}`}(s,E,g,w,!1)}let Is=()=>({...IB(),attrs:{}}),Iy=A=>A.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function Ih(A,{style:Q,vars:B},C,I){for(let E in Object.assign(A.style,Q,I&&I.getProjectionStyles(C)),B)A.style.setProperty(E,B[E])}let Ik=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);function In(A,Q,B,C){for(let B in Ih(A,Q,void 0,C),Q.attrs)A.setAttribute(Ik.has(B)?B:Iy(B),Q.attrs[B])}function It(A){let{style:Q}=A,B={};for(let C in Q)(CZ(Q[C])||CT(C,A))&&(B[C]=Q[C]);return B}function IK(A){let Q=It(A);for(let B in A)CZ(A[B])&&(Q["x"===B||"y"===B?"attr"+B.toUpperCase():B]=A[B]);return Q}function IL(A,Q,B,C={},I={}){return"function"==typeof Q&&(Q=Q(void 0!==B?B:A.custom,C,I)),"string"==typeof Q&&(Q=A.variants&&A.variants[Q]),"function"==typeof Q&&(Q=Q(void 0!==B?B:A.custom,C,I)),Q}let IU=A=>Array.isArray(A),Ii=A=>!!(A&&"object"==typeof A&&A.mix&&A.toValue),IG=A=>IU(A)?A[A.length-1]||0:A;function Ir(A){let Q=CZ(A)?A.get():A;return Ii(Q)?Q.toValue():Q}let Ip=A=>(Q,B)=>{let C=(0,AK.useContext)(Ci),I=(0,AK.useContext)(Cw),E=()=>(function({scrapeMotionValuesFromProps:A,createRenderState:Q,onMount:B},C,I,E){let g={latestValues:function(A,Q,B,C){let I={},E=C(A);for(let A in E)I[A]=Ir(E[A]);let{initial:g,animate:w}=A,D=Co(A),M=Ce(A);Q&&M&&!D&&!1!==A.inherit&&(void 0===g&&(g=Q.initial),void 0===w&&(w=Q.animate));let c=!!B&&!1===B.initial,s=(c=c||!1===g)?w:g;return s&&"boolean"!=typeof s&&!Ca(s)&&(Array.isArray(s)?s:[s]).forEach(Q=>{let B=IL(A,Q);if(!B)return;let{transitionEnd:C,transition:E,...g}=B;for(let A in g){let Q=g[A];if(Array.isArray(Q)){let A=c?Q.length-1:0;Q=Q[A]}null!==Q&&(I[A]=Q)}for(let A in C)I[A]=C[A]}),I}(C,I,E,A),renderState:Q()};return B&&(g.mount=A=>B(C,A,g)),g})(A,Q,C,I);return B?E():CD(E)},Ia={useVisualState:Ip({scrapeMotionValuesFromProps:IK,createRenderState:Is,onMount:(A,Q,{renderState:B,latestValues:C})=>{try{B.dimensions="function"==typeof Q.getBBox?Q.getBBox():Q.getBoundingClientRect()}catch(A){B.dimensions={x:0,y:0,width:0,height:0}}Ic(B,C,{enableHardwareAcceleration:!1},A.transformTemplate),In(Q,B)}})},IN={useVisualState:Ip({scrapeMotionValuesFromProps:It,createRenderState:IB})};function Io(A,Q,B,C={passive:!0}){return A.addEventListener(Q,B,C),()=>A.removeEventListener(Q,B)}function Ie(A,Q,B,C){(0,AK.useEffect)(()=>{let I=A.current;if(B&&I)return Io(I,Q,B,C)},[A,Q,B,C])}function IJ(A){return"undefined"!=typeof PointerEvent&&A instanceof PointerEvent?!("mouse"!==A.pointerType):A instanceof MouseEvent}(M=T||(T={})).Animate="animate",M.Hover="whileHover",M.Tap="whileTap",M.Drag="whileDrag",M.Focus="whileFocus",M.InView="whileInView",M.Exit="exit";let IF={pageX:0,pageY:0};function IS(A,Q="page"){return{point:A.touches?function(A,Q="page"){let B=A.touches[0]||A.changedTouches[0]||IF;return{x:B[Q+"X"],y:B[Q+"Y"]}}(A,Q):function(A,Q="page"){return{x:A[Q+"X"],y:A[Q+"Y"]}}(A,Q)}}let Il=(A,Q=!1)=>{let B=Q=>A(Q,IS(Q));return Q?A=>{let Q=A instanceof MouseEvent;(!Q||Q&&0===A.button)&&B(A)}:B},IH=()=>CI&&null===window.onpointerdown,IY=()=>CI&&null===window.ontouchstart,If=()=>CI&&null===window.onmousedown,Id={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},Iu={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function IR(A){if(IH());else if(IY())return Iu[A];else if(If())return Id[A];return A}function Ij(A,Q,B,C){return Io(A,IR(Q),Il(B,"pointerdown"===Q),C)}function Ib(A,Q,B,C){return Ie(A,IR(Q),B&&Il(B,"pointerdown"===Q),C)}function Im(A){let Q=null;return()=>null===Q&&(Q=A,()=>{Q=null})}let IT=Im("dragHorizontal"),IZ=Im("dragVertical");function IO(A){let Q=!1;if("y"===A)Q=IZ();else if("x"===A)Q=IT();else{let A=IT(),B=IZ();A&&B?Q=()=>{A(),B()}:(A&&A(),B&&B())}return Q}function Iv(){let A=IO(!0);return!A||(A(),!1)}function Ix(A,Q,B){return(C,I)=>{!(!IJ(C)||Iv())&&(A.animationState&&A.animationState.setActive(T.Hover,Q),B&&B(C,I))}}let IV=(A,Q)=>!!Q&&(A===Q||IV(A,Q.parentElement)),Iz=(A,Q)=>B=>Q(A(B)),IW=(...A)=>A.reduce(Iz),IP=new WeakMap,Iq=new WeakMap,IX=A=>{let Q=IP.get(A.target);Q&&Q(A)},I_=A=>{A.forEach(IX)},I$={some:0,all:1},I0=A=>Q=>(A(Q),null),I8={inView:I0(function({visualElement:A,whileInView:Q,onViewportEnter:B,onViewportLeave:C,viewport:I={}}){let E=(0,AK.useRef)({hasEnteredView:!1,isInView:!1}),g=!!(Q||B||C);I.once&&E.current.hasEnteredView&&(g=!1),("undefined"==typeof IntersectionObserver?function(A,Q,B,{fallback:C=!0}){(0,AK.useEffect)(()=>{A&&C&&("production"!==BX&&Ct(!1,"IntersectionObserver not available on this device. whileInView animations will trigger on mount."),requestAnimationFrame(()=>{Q.hasEnteredView=!0;let{onViewportEnter:A}=B.getProps();A&&A(null),B.animationState&&B.animationState.setActive(T.InView,!0)}))},[A])}:function(A,Q,B,{root:C,margin:I,amount:E="some",once:g}){(0,AK.useEffect)(()=>{if(!A||!B.current)return;let w={root:null==C?void 0:C.current,rootMargin:I,threshold:"number"==typeof E?E:I$[E]};return function(A,Q,B){let C=function({root:A,...Q}){let B=A||document;Iq.has(B)||Iq.set(B,{});let C=Iq.get(B),I=JSON.stringify(Q);return C[I]||(C[I]=new IntersectionObserver(I_,{root:A,...Q})),C[I]}(Q);return IP.set(A,B),C.observe(A),()=>{IP.delete(A),C.unobserve(A)}}(B.current,w,A=>{let{isIntersecting:C}=A;if(Q.isInView===C||(Q.isInView=C,g&&!C&&Q.hasEnteredView))return;C&&(Q.hasEnteredView=!0),B.animationState&&B.animationState.setActive(T.InView,C);let I=B.getProps(),E=C?I.onViewportEnter:I.onViewportLeave;E&&E(A)})},[A,C,I,E])})(g,E.current,A,I)}),tap:I0(function({onTap:A,onTapStart:Q,onTapCancel:B,whileTap:C,visualElement:I}){let E=A||Q||B||C,g=(0,AK.useRef)(!1),w=(0,AK.useRef)(null),D={passive:!(Q||A||B||h)};function M(){w.current&&w.current(),w.current=null}function c(){return M(),g.current=!1,I.animationState&&I.animationState.setActive(T.Tap,!1),!Iv()}function s(Q,C){c()&&(IV(I.current,Q.target)?A&&A(Q,C):B&&B(Q,C))}function y(A,Q){c()&&B&&B(A,Q)}function h(A,B){M(),!g.current&&(g.current=!0,w.current=IW(Ij(window,"pointerup",s,D),Ij(window,"pointercancel",y,D)),I.animationState&&I.animationState.setActive(T.Tap,!0),Q&&Q(A,B))}Ib(I,"pointerdown",E?h:void 0,D),Ck(M)}),focus:I0(function({whileFocus:A,visualElement:Q}){let{animationState:B}=Q;Ie(Q,"focus",A?()=>{B&&B.setActive(T.Focus,!0)}:void 0),Ie(Q,"blur",A?()=>{B&&B.setActive(T.Focus,!1)}:void 0)}),hover:I0(function({onHoverStart:A,onHoverEnd:Q,whileHover:B,visualElement:C}){Ib(C,"pointerenter",A||B?Ix(C,!0,A):void 0,{passive:!A}),Ib(C,"pointerleave",Q||B?Ix(C,!1,Q):void 0,{passive:!Q})})};function I3(){let A=(0,AK.useContext)(Cw);if(null===A)return[!0,null];let{isPresent:Q,onExitComplete:B,register:C}=A,I=(0,AK.useId)();return(0,AK.useEffect)(()=>C(I),[]),!Q&&B?[!1,()=>B&&B(I)]:[!0]}function I1(A,Q){if(!Array.isArray(Q))return!1;let B=Q.length;if(B!==A.length)return!1;for(let C=0;CQ.indexOf(C)&&(B[C]=A[C]);if(null!=A&&"function"==typeof Object.getOwnPropertySymbols)for(var I=0,C=Object.getOwnPropertySymbols(A);IQ.indexOf(C[I])&&Object.prototype.propertyIsEnumerable.call(A,C[I])&&(B[C[I]]=A[C[I]]);return B}var I2=function(){},I5=function(){};let I9=(A,Q,B)=>Math.min(Math.max(B,A),Q);function I6(A,Q){return A*Math.sqrt(1-Q*Q)}let I7=["duration","bounce"],EA=["stiffness","damping","mass"];function EQ(A,Q){return Q.some(Q=>void 0!==A[Q])}function EB(A){var{from:Q=0,to:B=1,restSpeed:C=2,restDelta:I}=A,E=I4(A,["from","to","restSpeed","restDelta"]);let g={done:!1,value:Q},{stiffness:w,damping:D,mass:M,velocity:c,duration:s,isResolvedFromDuration:y}=function(A){let Q=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},A);if(!EQ(A,EA)&&EQ(A,I7)){let B=function({duration:A=800,bounce:Q=.25,velocity:B=0,mass:C=1}){let I,E;I2(A<=1e4,"Spring duration must be 10 seconds or less");let g=1-Q;g=I9(.05,1,g),A=I9(.01,10,A/1e3),g<1?(I=Q=>{let C=Q*g,I=C*A;return .001-(C-B)/I6(Q,g)*Math.exp(-I)},E=Q=>{let C=Q*g*A,E=Math.pow(g,2)*Math.pow(Q,2)*A,w=Math.exp(-C),D=I6(Math.pow(Q,2),g);return(C*B+B-E)*w*(-I(Q)+.001>0?-1:1)/D}):(I=Q=>-.001+Math.exp(-Q*A)*((Q-B)*A+1),E=Q=>A*A*(B-Q)*Math.exp(-Q*A));let w=function(A,Q,B){let C=B;for(let B=1;B<12;B++)C-=A(C)/Q(C);return C}(I,E,5/A);if(A*=1e3,isNaN(w))return{stiffness:100,damping:10,duration:A};{let Q=Math.pow(w,2)*C;return{stiffness:Q,damping:2*g*Math.sqrt(C*Q),duration:A}}}(A);(Q=Object.assign(Object.assign(Object.assign({},Q),B),{velocity:0,mass:1})).isResolvedFromDuration=!0}return Q}(E),h=EC,k=EC;function n(){let A=c?-(c/1e3):0,C=B-Q,E=D/(2*Math.sqrt(w*M)),g=Math.sqrt(w/M)/1e3;if(void 0===I&&(I=Math.min(Math.abs(B-Q)/100,.4)),E<1){let Q=I6(g,E);h=I=>B-Math.exp(-E*g*I)*((A+E*g*C)/Q*Math.sin(Q*I)+C*Math.cos(Q*I)),k=B=>{let I=Math.exp(-E*g*B);return E*g*I*(Math.sin(Q*B)*(A+E*g*C)/Q+C*Math.cos(Q*B))-I*(Math.cos(Q*B)*(A+E*g*C)-Q*C*Math.sin(Q*B))}}else if(1===E)h=Q=>B-Math.exp(-g*Q)*(C+(A+g*C)*Q);else{let Q=g*Math.sqrt(E*E-1);h=I=>{let w=Math.exp(-E*g*I),D=Math.min(Q*I,300);return B-w*((A+E*g*C)*Math.sinh(D)+Q*C*Math.cosh(D))/Q}}}return n(),{next:A=>{let Q=h(A);if(y)g.done=A>=s;else{let E=1e3*k(A),w=Math.abs(B-Q)<=I;g.done=Math.abs(E)<=C&&w}return g.value=g.done?B:Q,g},flipTarget:()=>{c=-c,[Q,B]=[B,Q],n()}}}EB.needsInterpolation=(A,Q)=>"string"==typeof A||"string"==typeof Q;let EC=A=>0,EI=(A,Q,B)=>{let C=Q-A;return 0===C?1:(B-A)/C},EE=(A,Q,B)=>-B*A+B*Q+A,Eg=(A,Q)=>B=>!!(C_(B)&&CX.test(B)&&B.startsWith(A)||Q&&Object.prototype.hasOwnProperty.call(B,Q)),Ew=(A,Q,B)=>C=>{if(!C_(C))return C;let[I,E,g,w]=C.match(CP);return{[A]:parseFloat(I),[Q]:parseFloat(E),[B]:parseFloat(g),alpha:void 0!==w?parseFloat(w):1}},ED=Cz(0,255),EM=Object.assign(Object.assign({},C5),{transform:A=>Math.round(ED(A))}),Ec={test:Eg("rgb","red"),parse:Ew("red","green","blue"),transform:({red:A,green:Q,blue:B,alpha:C=1})=>"rgba("+EM.transform(A)+", "+EM.transform(Q)+", "+EM.transform(B)+", "+CW(C9.transform(C))+")"},Es={test:Eg("#"),parse:function(A){let Q="",B="",C="",I="";return A.length>5?(Q=A.substr(1,2),B=A.substr(3,2),C=A.substr(5,2),I=A.substr(7,2)):(Q=A.substr(1,1),B=A.substr(2,1),C=A.substr(3,1),I=A.substr(4,1),Q+=Q,B+=B,C+=C,I+=I),{red:parseInt(Q,16),green:parseInt(B,16),blue:parseInt(C,16),alpha:I?parseInt(I,16)/255:1}},transform:Ec.transform},Ey={test:Eg("hsl","hue"),parse:Ew("hue","saturation","lightness"),transform:({hue:A,saturation:Q,lightness:B,alpha:C=1})=>"hsla("+Math.round(A)+", "+C8.transform(CW(Q))+", "+C8.transform(CW(B))+", "+CW(C9.transform(C))+")"};function Eh(A,Q,B){return(B<0&&(B+=1),B>1&&(B-=1),B<1/6)?A+(Q-A)*6*B:B<.5?Q:B<2/3?A+(Q-A)*(2/3-B)*6:A}function Ek({hue:A,saturation:Q,lightness:B,alpha:C}){A/=360,B/=100;let I=0,E=0,g=0;if(Q/=100){let C=B<.5?B*(1+Q):B+Q-B*Q,w=2*B-C;I=Eh(w,C,A+1/3),E=Eh(w,C,A),g=Eh(w,C,A-1/3)}else I=E=g=B;return{red:Math.round(255*I),green:Math.round(255*E),blue:Math.round(255*g),alpha:C}}let En=(A,Q,B)=>{let C=A*A;return Math.sqrt(Math.max(0,B*(Q*Q-C)+C))},Et=[Es,Ec,Ey],EK=A=>Et.find(Q=>Q.test(A)),EL=A=>`'${A}' is not an animatable color. Use the equivalent color code instead.`,EU=(A,Q)=>{let B=EK(A),C=EK(Q);I5(!!B,EL(A)),I5(!!C,EL(Q));let I=B.parse(A),E=C.parse(Q);B===Ey&&(I=Ek(I),B=Ec),C===Ey&&(E=Ek(E),C=Ec);let g=Object.assign({},I);return A=>{for(let Q in g)"alpha"!==Q&&(g[Q]=En(I[Q],E[Q],A));return g.alpha=EE(I.alpha,E.alpha,A),B.transform(g)}},Ei={test:A=>Ec.test(A)||Es.test(A)||Ey.test(A),parse:A=>Ec.test(A)?Ec.parse(A):Ey.test(A)?Ey.parse(A):Es.parse(A),transform:A=>C_(A)?A:A.hasOwnProperty("red")?Ec.transform(A):Ey.transform(A)},EG="${c}",Er="${n}";function Ep(A){"number"==typeof A&&(A=`${A}`);let Q=[],B=0,C=A.match(Cq);C&&(B=C.length,A=A.replace(Cq,EG),Q.push(...C.map(Ei.parse)));let I=A.match(CP);return I&&(A=A.replace(CP,Er),Q.push(...I.map(C5.parse))),{values:Q,numColors:B,tokenised:A}}function Ea(A){return Ep(A).values}function EN(A){let{values:Q,numColors:B,tokenised:C}=Ep(A),I=Q.length;return A=>{let Q=C;for(let C=0;C"number"==typeof A?0:A,Ee={test:function(A){var Q,B,C,I;return isNaN(A)&&C_(A)&&(null!==(B=null===(Q=A.match(CP))||void 0===Q?void 0:Q.length)&&void 0!==B?B:0)+(null!==(I=null===(C=A.match(Cq))||void 0===C?void 0:C.length)&&void 0!==I?I:0)>0},parse:Ea,createTransformer:EN,getAnimatableNone:function(A){let Q=Ea(A);return EN(A)(Q.map(Eo))}},EJ=A=>"number"==typeof A;function EF(A,Q){return EJ(A)?B=>EE(A,Q,B):Ei.test(A)?EU(A,Q):EY(A,Q)}let ES=(A,Q)=>{let B=[...A],C=B.length,I=A.map((A,B)=>EF(A,Q[B]));return A=>{for(let Q=0;Q{let B=Object.assign(Object.assign({},A),Q),C={};for(let I in B)void 0!==A[I]&&void 0!==Q[I]&&(C[I]=EF(A[I],Q[I]));return A=>{for(let Q in C)B[Q]=C[Q](A);return B}};function EH(A){let Q=Ee.parse(A),B=Q.length,C=0,I=0,E=0;for(let A=0;A{let B=Ee.createTransformer(Q),C=EH(A),I=EH(Q);return C.numHSL===I.numHSL&&C.numRGB===I.numRGB&&C.numNumbers>=I.numNumbers?IW(ES(C.parsed,I.parsed),B):(I2(!0,`Complex values '${A}' and '${Q}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),B=>`${B>0?Q:A}`)},Ef=(A,Q)=>B=>EE(A,Q,B);function Ed(A,Q,{clamp:B=!0,ease:C,mixer:I}={}){let E=A.length;I5(E===Q.length,"Both input and output ranges must be the same length"),I5(!C||!Array.isArray(C)||C.length===E-1,"Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values."),A[0]>A[E-1]&&(A=[].concat(A),Q=[].concat(Q),A.reverse(),Q.reverse());let g=function(A,Q,B){var C;let I=[],E=B||("number"==typeof(C=A[0])?Ef:"string"==typeof C?Ei.test(C)?EU:EY:Array.isArray(C)?ES:"object"==typeof C?El:void 0),g=A.length-1;for(let B=0;BB(EI(A,Q,C))}(A,g):function(A,Q){let B=A.length,C=B-1;return I=>{let E=0,g=!1;if(I<=A[0]?g=!0:I>=A[C]&&(E=C-1,g=!0),!g){let Q=1;for(;QI)&&Q!==C;Q++);E=Q-1}let w=EI(A[E],A[E+1],I);return Q[E](w)}}(A,g);return B?Q=>w(I9(A[0],A[E-1],Q)):w}let Eu=A=>Q=>1-A(1-Q),ER=A=>Q=>Q<=.5?A(2*Q)/2:(2-A(2*(1-Q)))/2,Ej=A=>Q=>Q*Q*((A+1)*Q-A),Eb=4/11,Em=8/11,ET=A=>A,EZ=A=>Math.pow(A,2),EO=Eu(EZ),Ev=ER(EZ),Ex=A=>1-Math.sin(Math.acos(A)),EV=Eu(Ex),Ez=ER(EV),EW=Ej(1.525),EP=Eu(EW),Eq=ER(EW),EX=(A=>{let Q=Ej(1.525);return A=>(A*=2)<1?.5*Q(A):.5*(2-Math.pow(2,-10*(A-1)))})(0),E_=4356/361,E$=35442/1805,E0=16061/1805,E8=A=>{if(1===A||0===A)return A;let Q=A*A;return A0!==B?B/(Q-1):0)}(g)).map(A=>A*I);function D(){return Ed(w,g,{ease:Array.isArray(B)?B:g.map(()=>B||Ev).splice(0,g.length-1)})}let M=D();return{next:A=>(E.value=M(A),E.done=A>=I,E),flipTarget:()=>{g.reverse(),M=D()}}}let E4={keyframes:E1,spring:EB,decay:function({velocity:A=0,from:Q=0,power:B=.8,timeConstant:C=350,restDelta:I=.5,modifyTarget:E}){let g={done:!1,value:Q},w=B*A,D=Q+w,M=void 0===E?D:E(D);return M!==D&&(w=M-Q),{next:A=>{let Q=-w*Math.exp(-A/C);return g.done=!(Q>I||Q<-I),g.value=g.done?M:M+Q,g},flipTarget:()=>{}}}};function E2(A,Q,B=0){return A-Q-B}let E5=A=>{let Q=({delta:Q})=>A(Q);return{start:()=>B9.update(Q,!0),stop:()=>B6.update(Q)}};function E9(A){let Q,B,C;var I,{from:E,autoplay:g=!0,driver:w=E5,elapsed:D=0,repeat:M=0,repeatType:c="loop",repeatDelay:s=0,onPlay:y,onStop:h,onComplete:k,onRepeat:n,onUpdate:t}=A,K=I4(A,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:L}=K,U=0,i=K.duration,G=!1,r=!0,p=function(A){if(Array.isArray(A.to))return E1;if(E4[A.type])return E4[A.type];let Q=new Set(Object.keys(A));if(Q.has("ease")||Q.has("duration")&&!Q.has("dampingRatio"));else if(Q.has("dampingRatio")||Q.has("stiffness")||Q.has("mass")||Q.has("damping")||Q.has("restSpeed")||Q.has("restDelta"))return EB;return E1}(K);(null===(I=p.needsInterpolation)||void 0===I?void 0:I.call(p,E,L))&&(C=Ed([0,100],[E,L],{clamp:!1}),E=0,L=100);let a=p(Object.assign(Object.assign({},K),{from:E,to:L}));return g&&(null==y||y(),(Q=w(function(A){if(r||(A=-A),D+=A,!G){let A=a.next(Math.max(0,D));B=A.value,C&&(B=C(B)),G=r?A.done:D<=0}if(null==t||t(B),G){if(0===U&&(null!=i||(i=D)),U=E+s:I<=-s)&&(U++,"reverse"===c?D=function(A,Q,B=0,C=!0){return C?E2(Q+-A,Q,B):Q-(A-Q)+B}(D,i,s,r=U%2==0):(D=E2(D,i,s),"mirror"===c&&a.flipTarget()),G=!1,n&&n())}else Q.stop(),k&&k()}})).start()),{stop:()=>{null==h||h(),Q.stop()}}}let E6=A=>1e3*A,E7=(A,Q)=>1-3*Q+3*A,gA=(A,Q)=>3*Q-6*A,gQ=A=>3*A,gB=(A,Q,B)=>((E7(Q,B)*A+gA(Q,B))*A+gQ(Q))*A,gC=(A,Q,B)=>3*E7(Q,B)*A*A+2*gA(Q,B)*A+gQ(Q),gI={linear:ET,easeIn:EZ,easeInOut:Ev,easeOut:EO,circIn:Ex,circInOut:Ez,circOut:EV,backIn:EW,backInOut:Eq,backOut:EP,anticipate:EX,bounceIn:E3,bounceInOut:A=>A<.5?.5*(1-E8(1-2*A)):.5*E8(2*A-1)+.5,bounceOut:E8},gE=A=>{if(Array.isArray(A)){I5(4===A.length,"Cubic bezier arrays must contain four numerical values.");let[Q,B,C,I]=A;return function(A,Q,B,C){if(A===Q&&B===C)return ET;let I=new Float32Array(11);for(let Q=0;Q<11;++Q)I[Q]=gB(.1*Q,A,B);return E=>0===E||1===E?E:gB(function(Q){let C=0,E=1;for(;10!==E&&I[E]<=Q;++E)C+=.1;let g=C+(Q-I[--E])/(I[E+1]-I[E])*.1,w=gC(g,A,B);return w>=.001?function(A,Q,B,C){for(let I=0;I<8;++I){let I=gC(Q,B,C);if(0===I)break;let E=gB(Q,B,C)-A;Q-=E/I}return Q}(Q,g,A,B):0===w?g:function(A,Q,B,C,I){let E,g;let w=0;do(E=gB(g=Q+(B-Q)/2,C,I)-A)>0?B=g:Q=g;while(Math.abs(E)>1e-7&&++w<10);return g}(Q,C,C+.1,A,B)}(E),Q,C)}(Q,B,C,I)}return"string"==typeof A?(I5(void 0!==gI[A],`Invalid easing type '${A}'`),gI[A]):A},gg=A=>Array.isArray(A)&&"number"!=typeof A[0],gw=(A,Q)=>"zIndex"!==A&&!!("number"==typeof Q||Array.isArray(Q)||"string"==typeof Q&&Ee.test(Q)&&!Q.startsWith("url(")),gD=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),gM=A=>({type:"spring",stiffness:550,damping:0===A?2*Math.sqrt(550):30,restSpeed:10}),gc=()=>({type:"keyframes",ease:"linear",duration:.3}),gs=A=>({type:"keyframes",duration:.8,values:A}),gy={x:gD,y:gD,z:gD,rotate:gD,rotateX:gD,rotateY:gD,rotateZ:gD,scaleX:gM,scaleY:gM,scale:gM,opacity:gc,backgroundColor:gc,color:gc,default:gM},gh=(A,Q)=>{let B;return B=IU(Q)?gs:gy[A]||gy.default,{to:Q,...B(Q)}},gk=new Set(["brightness","contrast","saturate","opacity"]);function gn(A){let[Q,B]=A.slice(0,-1).split("(");if("drop-shadow"===Q)return A;let[C]=B.match(CP)||[];if(!C)return A;let I=B.replace(C,""),E=gk.has(Q)?1:0;return C!==B&&(E*=100),Q+"("+E+I+")"}let gt=/([a-z-]*)\(.*?\)/g,gK=Object.assign(Object.assign({},Ee),{getAnimatableNone:A=>{let Q=A.match(gt);return Q?Q.map(gn).join(" "):A}}),gL={...IA,color:Ei,backgroundColor:Ei,outlineColor:Ei,fill:Ei,stroke:Ei,borderColor:Ei,borderTopColor:Ei,borderRightColor:Ei,borderBottomColor:Ei,borderLeftColor:Ei,filter:gK,WebkitFilter:gK},gU=A=>gL[A];function gi(A,Q){var B;let C=gU(A);return C!==gK&&(C=Ee),null===(B=C.getAnimatableNone)||void 0===B?void 0:B.call(C,Q)}let gG={current:!1};function gr(A,Q){let B=performance.now(),C=({timestamp:I})=>{let E=I-B;E>=Q&&(B6.read(C),A(E-Q))};return B9.read(C,!0),()=>B6.read(C)}let gp=!1;function ga(A){return 0===A||"string"==typeof A&&0===parseFloat(A)&&-1===A.indexOf(" ")}function gN(A){return"number"==typeof A?0:gi("",A)}function go(A,Q){return A[Q]||A.default||A}function ge(A,Q,B,C={}){return gG.current&&(C={type:!1}),Q.start(I=>{var E,g,w;let D,M;let c=function(A,Q,B,C,I){let E=go(C,A)||{},g=void 0!==E.from?E.from:Q.get(),w=gw(A,B);"none"===g&&w&&"string"==typeof B?g=gi(A,B):ga(g)&&"string"==typeof B?g=gN(B):!Array.isArray(B)&&ga(B)&&"string"==typeof g&&(B=gN(g));let D=gw(A,g);return I2(D===w,`You are trying to animate ${A} from "${g}" to "${B}". ${g} is not an animatable value - to enable this animation set ${g} to a value animatable to ${B} via the \`style\` property.`),D&&w&&!1!==E.type?function(){var C;let w={from:g,to:B,velocity:Q.getVelocity(),onComplete:I,onUpdate:A=>Q.set(A)};return"inertia"===E.type||"decay"===E.type?function({from:A=0,velocity:Q=0,min:B,max:C,power:I=.8,timeConstant:E=750,bounceStiffness:g=500,bounceDamping:w=10,restDelta:D=1,modifyTarget:M,driver:c,onUpdate:s,onComplete:y,onStop:h}){let k;function n(A){return void 0!==B&&AC}function t(A){return void 0===B?C:void 0===C?B:Math.abs(B-A){var B;null==s||s(Q),null===(B=A.onUpdate)||void 0===B||B.call(A,Q)},onComplete:y,onStop:h}))}function L(A){K(Object.assign({type:"spring",stiffness:g,damping:w,restDelta:D},A))}if(n(A))L({from:A,velocity:Q,to:t(A)});else{let C,g,w=I*Q+A;void 0!==M&&(w=M(w));let c=t(w),s=c===B?-1:1;K({type:"decay",from:A,velocity:Q,timeConstant:E,power:I,restDelta:D,modifyTarget:M,onUpdate:n(w)?A=>{var B,I;C=g,g=A,B=A-C,Q=(I=CC().delta)?1e3/I*B:0,(1===s&&A>c||-1===s&&Anull==k?void 0:k.stop()}}({...w,...E}):E9({...(C=E,Array.isArray(w.to)&&void 0===C.duration&&(C.duration=.8),Array.isArray(w.to)&&null===w.to[0]&&(w.to=[...w.to],w.to[0]=w.from),!function({when:A,delay:Q,delayChildren:B,staggerChildren:C,staggerDirection:I,repeat:E,repeatType:g,repeatDelay:w,from:D,...M}){return!!Object.keys(M).length}(C)&&(C={...C,...gh(A,w.to)}),{...w,...function({ease:A,times:Q,yoyo:B,flip:C,loop:I,...E}){let g={...E};return Q&&(g.offset=Q),E.duration&&(g.duration=E6(E.duration)),E.repeatDelay&&(g.repeatDelay=E6(E.repeatDelay)),A&&(g.ease=gg(A)?A.map(gE):gE(A)),"tween"===E.type&&(g.type="keyframes"),(B||I||C)&&(I2(!gp,"yoyo, loop and flip have been removed from the API. Replace with repeat and repeatType options."),gp=!0,B?g.repeatType="reverse":I?g.repeatType="loop":C&&(g.repeatType="mirror"),g.repeat=I||B||C||E.repeat),"spring"!==E.type&&(g.type="keyframes"),g}(C)}),onUpdate:A=>{w.onUpdate(A),E.onUpdate&&E.onUpdate(A)},onComplete:()=>{w.onComplete(),E.onComplete&&E.onComplete()}})}:function(){let A=IG(B);return Q.set(A),I(),E.onUpdate&&E.onUpdate(A),E.onComplete&&E.onComplete(),{stop:()=>{}}}}(A,Q,B,C,I),s=null!==(w=null!==(g=(go(E=C,A)||{}).delay)&&void 0!==g?g:E.delay)&&void 0!==w?w:0,y=()=>D=c();return s?M=gr(y,E6(s)):y(),()=>{M&&M(),D&&D.stop()}})}let gJ=A=>/^\-?\d*\.?\d+$/.test(A),gF=A=>/^0[^.\s]+$/.test(A);function gS(A,Q){-1===A.indexOf(Q)&&A.push(Q)}function gl(A,Q){let B=A.indexOf(Q);B>-1&&A.splice(B,1)}class gH{constructor(){this.subscriptions=[]}add(A){return gS(this.subscriptions,A),()=>gl(this.subscriptions,A)}notify(A,Q,B){let C=this.subscriptions.length;if(C){if(1===C)this.subscriptions[0](A,Q,B);else for(let I=0;I!isNaN(parseFloat(A));class gf{constructor(A){this.version="7.6.5",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new gH,this.velocityUpdateSubscribers=new gH,this.renderSubscribers=new gH,this.canTrackVelocity=!1,this.updateAndNotify=(A,Q=!0)=>{this.prev=this.current,this.current=A;let{delta:B,timestamp:C}=CC();this.lastUpdated!==C&&(this.timeDelta=B,this.lastUpdated=C,B9.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.updateSubscribers.notify(this.current),this.velocityUpdateSubscribers.getSize()&&this.velocityUpdateSubscribers.notify(this.getVelocity()),Q&&this.renderSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>B9.postRender(this.velocityCheck),this.velocityCheck=({timestamp:A})=>{A!==this.lastUpdated&&(this.prev=this.current,this.velocityUpdateSubscribers.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=A,this.canTrackVelocity=gY(this.current)}onChange(A){return this.updateSubscribers.add(A)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(A){return A(this.get()),this.renderSubscribers.add(A)}attach(A){this.passiveEffect=A}set(A,Q=!0){Q&&this.passiveEffect?this.passiveEffect(A,this.updateAndNotify):this.updateAndNotify(A,Q)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){var A,Q;return this.canTrackVelocity?(A=parseFloat(this.current)-parseFloat(this.prev),(Q=this.timeDelta)?1e3/Q*A:0):0}start(A){return this.stop(),new Promise(Q=>{this.hasAnimated=!0,this.stopAnimation=A(Q)}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}function gd(A){return new gf(A)}let gu=A=>Q=>Q.test(A),gR=[C5,C3,C8,C0,C4,C1,{test:A=>"auto"===A,parse:A=>A}],gj=A=>gR.find(gu(A)),gb=[...gR,Ei,Ee],gm=A=>gb.find(gu(A));function gT(A,Q,B){let C=A.getProps();return IL(C,Q,void 0!==B?B:C.custom,function(A){let Q={};return A.values.forEach((A,B)=>Q[B]=A.get()),Q}(A),function(A){let Q={};return A.values.forEach((A,B)=>Q[B]=A.getVelocity()),Q}(A))}function gZ(A){return!!(CZ(A)&&A.add)}function gO(A,Q,B={}){var C;let I=gT(A,Q,B.custom),{transition:E=A.getDefaultTransition()||{}}=I||{};B.transitionOverride&&(E=B.transitionOverride);let g=I?()=>gv(A,I,B):()=>Promise.resolve(),w=(null===(C=A.variantChildren)||void 0===C?void 0:C.size)?(C=0)=>{let{delayChildren:I=0,staggerChildren:g,staggerDirection:w}=E;return function(A,Q,B=0,C=0,I=1,E){let g=[],w=(A.variantChildren.size-1)*C,D=1===I?(A=0)=>A*C:(A=0)=>w-A*C;return Array.from(A.variantChildren).sort(gx).forEach((A,C)=>{g.push(gO(A,Q,{...E,delay:B+D(C)}).then(()=>A.notify("AnimationComplete",Q)))}),Promise.all(g)}(A,Q,I+C,g,w,B)}:()=>Promise.resolve(),{when:D}=E;if(!D)return Promise.all([g(),w(B.delay)]);{let[A,Q]="beforeChildren"===D?[g,w]:[w,g];return A().then(Q)}}function gv(A,Q,{delay:B=0,transitionOverride:C,type:I}={}){var E;let{transition:g=A.getDefaultTransition(),transitionEnd:w,...D}=A.makeTargetAnimatable(Q),M=A.getValue("willChange");C&&(g=C);let c=[],s=I&&(null===(E=A.animationState)||void 0===E?void 0:E.getState()[I]);for(let Q in D){let C=A.getValue(Q),I=D[Q];if(!C||void 0===I||s&&function({protectedKeys:A,needsAnimating:Q},B){let C=A.hasOwnProperty(B)&&!0!==Q[B];return Q[B]=!1,C}(s,Q))continue;let E={delay:B,...g};A.shouldReduceMotion&&Cm.has(Q)&&(E={...E,type:!1,delay:0});let w=ge(Q,C,I,E);gZ(M)&&(M.add(Q),w=w.then(()=>M.remove(Q))),c.push(w)}return Promise.all(c).then(()=>{w&&function(A,Q){let B=gT(A,Q),{transitionEnd:C={},transition:I={},...E}=B?A.makeTargetAnimatable(B,!1):{};for(let Q in E={...E,...C}){let B=IG(E[Q]);A.hasValue(Q)?A.getValue(Q).set(B):A.addValue(Q,gd(B))}}(A,w)})}function gx(A,Q){return A.sortNodePosition(Q)}let gV=[T.Animate,T.InView,T.Focus,T.Hover,T.Tap,T.Drag,T.Exit],gz=[...gV].reverse(),gW=gV.length;function gP(A=!1){return{isActive:A,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}let gq={animation:I0(({visualElement:A,animate:Q})=>{A.animationState||(A.animationState=function(A){let Q=Q=>Promise.all(Q.map(({animation:Q,options:B})=>(function(A,Q,B={}){let C;if(A.notify("AnimationStart",Q),Array.isArray(Q))C=Promise.all(Q.map(Q=>gO(A,Q,B)));else if("string"==typeof Q)C=gO(A,Q,B);else{let I="function"==typeof Q?gT(A,Q,B.custom):Q;C=gv(A,I,B)}return C.then(()=>A.notify("AnimationComplete",Q))})(A,Q,B))),B={[T.Animate]:gP(!0),[T.InView]:gP(),[T.Hover]:gP(),[T.Tap]:gP(),[T.Drag]:gP(),[T.Focus]:gP(),[T.Exit]:gP()},C=!0,I=(Q,B)=>{let C=gT(A,B);if(C){let{transition:A,transitionEnd:B,...I}=C;Q={...Q,...I,...B}}return Q};function E(E,g){var w,D;let M=A.getProps(),c=A.getVariantContext(!0)||{},s=[],y=new Set,h={},k=1/0;for(let Q=0;Qk&&L,p=Array.isArray(K)?K:[K],a=p.reduce(I,{});!1===U&&(a={});let{prevResolvedValues:N={}}=t,o={...N,...a},e=A=>{r=!0,y.delete(A),t.needsAnimating[A]=!0};for(let A in o){let Q=a[A],B=N[A];h.hasOwnProperty(A)||(Q!==B?IU(Q)&&IU(B)?!I1(Q,B)||G?e(A):t.protectedKeys[A]=!0:void 0!==Q?e(A):y.add(A):void 0!==Q&&y.has(A)?e(A):t.protectedKeys[A]=!0)}t.prevProp=K,t.prevResolvedValues=a,t.isActive&&(h={...h,...a}),C&&A.blockInitialAnimation&&(r=!1),r&&!i&&s.push(...p.map(A=>({animation:A,options:{type:n,...E}})))}if(y.size){let Q={};y.forEach(B=>{let C=A.getBaseTarget(B);void 0!==C&&(Q[B]=C)}),s.push({animation:Q})}let n=!!s.length;return C&&!1===M.initial&&!A.manuallyAnimateOnMount&&(n=!1),C=!1,n?Q(s):Promise.resolve()}return{animateChanges:E,setActive:function(Q,C,I){var g;if(B[Q].isActive===C)return Promise.resolve();null===(g=A.variantChildren)||void 0===g||g.forEach(A=>{var B;return null===(B=A.animationState)||void 0===B?void 0:B.setActive(Q,C)}),B[Q].isActive=C;let w=E(I,Q);for(let A in B)B[A].protectedKeys={};return w},setAnimateFunction:function(B){Q=B(A)},getState:()=>B}}(A)),Ca(Q)&&(0,AK.useEffect)(()=>Q.subscribe(A),[Q])}),exit:I0(A=>{let{custom:Q,visualElement:B}=A,[C,I]=I3(),E=(0,AK.useContext)(Cw);(0,AK.useEffect)(()=>{B.isPresent=C;let A=B.animationState&&B.animationState.setActive(T.Exit,!C,{custom:E&&E.custom||Q});A&&!C&&A.then(I)},[C])})},gX=A=>A.hasOwnProperty("x")&&A.hasOwnProperty("y"),g_=A=>gX(A)&&A.hasOwnProperty("z"),g$=(A,Q)=>Math.abs(A-Q);function g0(A,Q){return EJ(A)&&EJ(Q)?g$(A,Q):gX(A)&&gX(Q)?Math.sqrt(Math.pow(g$(A.x,Q.x),2)+Math.pow(g$(A.y,Q.y),2)+Math.pow(g_(A)&&g_(Q)?g$(A.z,Q.z):0,2)):void 0}class g8{constructor(A,Q,{transformPagePoint:B}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let A=g4(this.lastMoveEventInfo,this.history),Q=null!==this.startEvent,B=g0(A.offset,{x:0,y:0})>=3;if(!Q&&!B)return;let{point:C}=A,{timestamp:I}=CC();this.history.push({...C,timestamp:I});let{onStart:E,onMove:g}=this.handlers;Q||(E&&E(this.lastMoveEvent,A),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,A)},this.handlePointerMove=(A,Q)=>{if(this.lastMoveEvent=A,this.lastMoveEventInfo=g3(Q,this.transformPagePoint),IJ(A)&&0===A.buttons){this.handlePointerUp(A,Q);return}B9.update(this.updatePoint,!0)},this.handlePointerUp=(A,Q)=>{this.end();let{onEnd:B,onSessionEnd:C}=this.handlers,I=g4(g3(Q,this.transformPagePoint),this.history);this.startEvent&&B&&B(A,I),C&&C(A,I)},A.touches&&A.touches.length>1)return;this.handlers=Q,this.transformPagePoint=B;let C=g3(IS(A),this.transformPagePoint),{point:I}=C,{timestamp:E}=CC();this.history=[{...I,timestamp:E}];let{onSessionStart:g}=Q;g&&g(A,g4(C,this.history)),this.removeListeners=IW(Ij(window,"pointermove",this.handlePointerMove),Ij(window,"pointerup",this.handlePointerUp),Ij(window,"pointercancel",this.handlePointerUp))}updateHandlers(A){this.handlers=A}end(){this.removeListeners&&this.removeListeners(),B6.update(this.updatePoint)}}function g3(A,Q){return Q?{point:Q(A.point)}:A}function g1(A,Q){return{x:A.x-Q.x,y:A.y-Q.y}}function g4({point:A},Q){return{point:A,delta:g1(A,g2(Q)),offset:g1(A,Q[0]),velocity:function(A,Q){if(A.length<2)return{x:0,y:0};let B=A.length-1,C=null,I=g2(A);for(;B>=0&&(C=A[B],!(I.timestamp-C.timestamp>E6(.1)));)B--;if(!C)return{x:0,y:0};let E=(I.timestamp-C.timestamp)/1e3;if(0===E)return{x:0,y:0};let g={x:(I.x-C.x)/E,y:(I.y-C.y)/E};return g.x===1/0&&(g.x=0),g.y===1/0&&(g.y=0),g}(Q,0)}}function g2(A){return A[A.length-1]}function g5(A){return A.max-A.min}function g9(A,Q=0,B=.01){return g0(A,Q)({translate:0,scale:1,origin:0,originPoint:0}),wD=()=>({x:ww(),y:ww()}),wM=()=>({min:0,max:0}),wc=()=>({x:wM(),y:wM()});function ws(A){return[A("x"),A("y")]}function wy({top:A,left:Q,right:B,bottom:C}){return{x:{min:Q,max:B},y:{min:A,max:C}}}function wh(A){return void 0===A||1===A}function wk({scale:A,scaleX:Q,scaleY:B}){return!wh(A)||!wh(Q)||!wh(B)}function wn(A){return wk(A)||wt(A)||A.z||A.rotate||A.rotateX||A.rotateY}function wt(A){var Q,B;return(Q=A.x)&&"0%"!==Q||(B=A.y)&&"0%"!==B}function wK(A,Q,B,C,I){return void 0!==I&&(A=C+I*(A-C)),C+B*(A-C)+Q}function wL(A,Q=0,B=1,C,I){A.min=wK(A.min,Q,B,C,I),A.max=wK(A.max,Q,B,C,I)}function wU(A,{x:Q,y:B}){wL(A.x,Q.translate,Q.scale,Q.originPoint),wL(A.y,B.translate,B.scale,B.originPoint)}function wi(A,Q){A.min=A.min+Q,A.max=A.max+Q}function wG(A,Q,[B,C,I]){let E=void 0!==Q[I]?Q[I]:.5,g=EE(A.min,A.max,E);wL(A,Q[B],Q[C],g,Q.scale)}let wr=["x","scaleX","originX"],wp=["y","scaleY","originY"];function wa(A,Q){wG(A.x,Q,wr),wG(A.y,Q,wp)}function wN(A,Q){return wy(function(A,Q){if(!Q)return A;let B=Q({x:A.left,y:A.top}),C=Q({x:A.right,y:A.bottom});return{top:B.y,left:B.x,bottom:C.y,right:C.x}}(A.getBoundingClientRect(),Q))}let wo=new WeakMap;class we{constructor(A){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=wc(),this.visualElement=A}start(A,{snapToCursor:Q=!1}={}){!1!==this.visualElement.isPresent&&(this.panSession=new g8(A,{onSessionStart:A=>{this.stopAnimation(),Q&&this.snapToCursor(IS(A,"page").point)},onStart:(A,Q)=>{var B;let{drag:C,dragPropagation:I,onDragStart:E}=this.getProps();(!C||I||(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=IO(C),this.openGlobalLock))&&(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ws(A=>{var Q,B;let C=this.getAxisMotionValue(A).get()||0;if(C8.test(C)){let I=null===(B=null===(Q=this.visualElement.projection)||void 0===Q?void 0:Q.layout)||void 0===B?void 0:B.actual[A];if(I){let A=g5(I);C=parseFloat(C)/100*A}}this.originPoint[A]=C}),null==E||E(A,Q),null===(B=this.visualElement.animationState)||void 0===B||B.setActive(T.Drag,!0))},onMove:(A,Q)=>{let{dragPropagation:B,dragDirectionLock:C,onDirectionLock:I,onDrag:E}=this.getProps();if(!B&&!this.openGlobalLock)return;let{offset:g}=Q;if(C&&null===this.currentDirection){this.currentDirection=function(A,Q=10){let B=null;return Math.abs(A.y)>Q?B="y":Math.abs(A.x)>Q&&(B="x"),B}(g),null!==this.currentDirection&&(null==I||I(this.currentDirection));return}this.updateAxis("x",Q.point,g),this.updateAxis("y",Q.point,g),this.visualElement.render(),null==E||E(A,Q)},onSessionEnd:(A,Q)=>this.stop(A,Q)},{transformPagePoint:this.visualElement.getTransformPagePoint()}))}stop(A,Q){let B=this.isDragging;if(this.cancel(),!B)return;let{velocity:C}=Q;this.startAnimation(C);let{onDragEnd:I}=this.getProps();null==I||I(A,Q)}cancel(){var A,Q;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),null===(A=this.panSession)||void 0===A||A.end(),this.panSession=void 0;let{dragPropagation:B}=this.getProps();!B&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),null===(Q=this.visualElement.animationState)||void 0===Q||Q.setActive(T.Drag,!1)}updateAxis(A,Q,B){let{drag:C}=this.getProps();if(!B||!wJ(A,C,this.currentDirection))return;let I=this.getAxisMotionValue(A),E=this.originPoint[A]+B[A];this.constraints&&this.constraints[A]&&(E=function(A,{min:Q,max:B},C){return void 0!==Q&&AB&&(A=C?EE(B,A,C.max):Math.min(A,B)),A}(E,this.constraints[A],this.elastic[A])),I.set(E)}resolveConstraints(){let{dragConstraints:A,dragElastic:Q}=this.getProps(),{layout:B}=this.visualElement.projection||{},C=this.constraints;A&&Cr(A)?this.constraints||(this.constraints=this.resolveRefConstraints()):A&&B?this.constraints=function(A,{top:Q,left:B,bottom:C,right:I}){return{x:wC(A.x,B,I),y:wC(A.y,Q,C)}}(B.actual,A):this.constraints=!1,this.elastic=function(A=.35){return!1===A?A=0:!0===A&&(A=.35),{x:wE(A,"left","right"),y:wE(A,"top","bottom")}}(Q),C!==this.constraints&&B&&this.constraints&&!this.hasMutatedConstraints&&ws(A=>{this.getAxisMotionValue(A)&&(this.constraints[A]=function(A,Q){let B={};return void 0!==Q.min&&(B.min=Q.min-A.min),void 0!==Q.max&&(B.max=Q.max-A.min),B}(B.actual[A],this.constraints[A]))})}resolveRefConstraints(){var A;let{dragConstraints:Q,onMeasureDragConstraints:B}=this.getProps();if(!Q||!Cr(Q))return!1;let C=Q.current;I5(null!==C,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");let{projection:I}=this.visualElement;if(!I||!I.layout)return!1;let E=function(A,Q,B){let C=wN(A,B),{scroll:I}=Q;return I&&(wi(C.x,I.x),wi(C.y,I.y)),C}(C,I.root,this.visualElement.getTransformPagePoint()),g={x:wI((A=I.layout.actual).x,E.x),y:wI(A.y,E.y)};if(B){let A=B(function({x:A,y:Q}){return{top:Q.min,right:A.max,bottom:Q.max,left:A.min}}(g));this.hasMutatedConstraints=!!A,A&&(g=wy(A))}return g}startAnimation(A){let{drag:Q,dragMomentum:B,dragElastic:C,dragTransition:I,dragSnapToOrigin:E,onDragTransitionEnd:g}=this.getProps(),w=this.constraints||{};return Promise.all(ws(g=>{var D;if(!wJ(g,Q,this.currentDirection))return;let M=null!==(D=null==w?void 0:w[g])&&void 0!==D?D:{};E&&(M={min:0,max:0});let c={type:"inertia",velocity:B?A[g]:0,bounceStiffness:C?200:1e6,bounceDamping:C?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...I,...M};return this.startAxisValueAnimation(g,c)})).then(g)}startAxisValueAnimation(A,Q){let B=this.getAxisMotionValue(A);return ge(A,B,0,Q)}stopAnimation(){ws(A=>this.getAxisMotionValue(A).stop())}getAxisMotionValue(A){var Q,B;let C="_drag"+A.toUpperCase();return this.visualElement.getProps()[C]||this.visualElement.getValue(A,null!==(B=null===(Q=this.visualElement.getProps().initial)||void 0===Q?void 0:Q[A])&&void 0!==B?B:0)}snapToCursor(A){ws(Q=>{let{drag:B}=this.getProps();if(!wJ(Q,B,this.currentDirection))return;let{projection:C}=this.visualElement,I=this.getAxisMotionValue(Q);if(C&&C.layout){let{min:B,max:E}=C.layout.actual[Q];I.set(A[Q]-EE(B,E,.5))}})}scalePositionWithinConstraints(){var A;if(!this.visualElement.current)return;let{drag:Q,dragConstraints:B}=this.getProps(),{projection:C}=this.visualElement;if(!Cr(B)||!C||!this.constraints)return;this.stopAnimation();let I={x:0,y:0};ws(A=>{let Q=this.getAxisMotionValue(A);if(Q){let B=Q.get();I[A]=function(A,Q){let B=.5,C=g5(A),I=g5(Q);return I>C?B=EI(Q.min,Q.max-C,A.min):C>I&&(B=EI(A.min,A.max-I,Q.min)),I9(0,1,B)}({min:B,max:B},this.constraints[A])}});let{transformTemplate:E}=this.visualElement.getProps();this.visualElement.current.style.transform=E?E({},""):"none",null===(A=C.root)||void 0===A||A.updateScroll(),C.updateLayout(),this.resolveConstraints(),ws(A=>{if(!wJ(A,Q,null))return;let B=this.getAxisMotionValue(A),{min:C,max:E}=this.constraints[A];B.set(EE(C,E,I[A]))})}addListeners(){var A;if(!this.visualElement.current)return;wo.set(this.visualElement,this);let Q=Ij(this.visualElement.current,"pointerdown",A=>{let{drag:Q,dragListener:B=!0}=this.getProps();Q&&B&&this.start(A)}),B=()=>{let{dragConstraints:A}=this.getProps();Cr(A)&&(this.constraints=this.resolveRefConstraints())},{projection:C}=this.visualElement,I=C.addEventListener("measure",B);C&&!C.layout&&(null===(A=C.root)||void 0===A||A.updateScroll(),C.updateLayout()),B();let E=Io(window,"resize",()=>this.scalePositionWithinConstraints()),g=C.addEventListener("didUpdate",({delta:A,hasLayoutChanged:Q})=>{this.isDragging&&Q&&(ws(Q=>{let B=this.getAxisMotionValue(Q);B&&(this.originPoint[Q]+=A[Q].translate,B.set(B.get()+A[Q].translate))}),this.visualElement.render())});return()=>{E(),Q(),I(),null==g||g()}}getProps(){let A=this.visualElement.getProps(),{drag:Q=!1,dragDirectionLock:B=!1,dragPropagation:C=!1,dragConstraints:I=!1,dragElastic:E=.35,dragMomentum:g=!0}=A;return{...A,drag:Q,dragDirectionLock:B,dragPropagation:C,dragConstraints:I,dragElastic:E,dragMomentum:g}}}function wJ(A,Q,B){return(!0===Q||Q===A)&&(null===B||B===A)}let wF={pan:I0(function({onPan:A,onPanStart:Q,onPanEnd:B,onPanSessionStart:C,visualElement:I}){let E=(0,AK.useRef)(null),{transformPagePoint:g}=(0,AK.useContext)(CU),w={onSessionStart:C,onStart:Q,onMove:A,onEnd:(A,Q)=>{E.current=null,B&&B(A,Q)}};(0,AK.useEffect)(()=>{null!==E.current&&E.current.updateHandlers(w)}),Ib(I,"pointerdown",(A||Q||B||C)&&function(A){E.current=new g8(A,w,{transformPagePoint:g})}),Ck(()=>E.current&&E.current.end())}),drag:I0(function(A){let{dragControls:Q,visualElement:B}=A,C=CD(()=>new we(B));(0,AK.useEffect)(()=>Q&&Q.subscribe(C),[C,Q]),(0,AK.useEffect)(()=>C.addListeners(),[C])})};function wS(A){return"string"==typeof A&&A.startsWith("var(--")}let wl=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function wH(A,Q,B=1){I5(B<=4,`Max CSS variable fallback depth detected in property "${A}". This may indicate a circular fallback dependency.`);let[C,I]=function(A){let Q=wl.exec(A);if(!Q)return[,];let[,B,C]=Q;return[B,C]}(A);if(!C)return;let E=window.getComputedStyle(Q).getPropertyValue(C);return E?E.trim():wS(I)?wH(I,Q,B+1):I}let wY=new Set(["width","height","top","left","right","bottom","x","y"]),wf=A=>wY.has(A),wd=A=>Object.keys(A).some(wf),wu=(A,Q)=>{A.set(Q,!1),A.set(Q)},wR=A=>A===C5||A===C3;(c=Z||(Z={})).width="width",c.height="height",c.left="left",c.right="right",c.top="top",c.bottom="bottom";let wj=(A,Q)=>parseFloat(A.split(", ")[Q]),wb=(A,Q)=>(B,{transform:C})=>{if("none"===C||!C)return 0;let I=C.match(/^matrix3d\((.+)\)$/);if(I)return wj(I[1],Q);{let Q=C.match(/^matrix\((.+)\)$/);return Q?wj(Q[1],A):0}},wm=new Set(["x","y","z"]),wT=Cb.filter(A=>!wm.has(A)),wZ={width:({x:A},{paddingLeft:Q="0",paddingRight:B="0"})=>A.max-A.min-parseFloat(Q)-parseFloat(B),height:({y:A},{paddingTop:Q="0",paddingBottom:B="0"})=>A.max-A.min-parseFloat(Q)-parseFloat(B),top:(A,{top:Q})=>parseFloat(Q),left:(A,{left:Q})=>parseFloat(Q),bottom:({y:A},{top:Q})=>parseFloat(Q)+(A.max-A.min),right:({x:A},{left:Q})=>parseFloat(Q)+(A.max-A.min),x:wb(4,13),y:wb(5,14)},wO=(A,Q,B)=>{let C=Q.measureViewportBox(),I=Q.current,E=getComputedStyle(I),{display:g}=E,w={};"none"===g&&Q.setStaticValue("display",A.display||"block"),B.forEach(A=>{w[A]=wZ[A](C,E)}),Q.render();let D=Q.measureViewportBox();return B.forEach(B=>{wu(Q.getValue(B),w[B]),A[B]=wZ[B](D,E)}),A},wv=(A,Q,B={},C={})=>{Q={...Q},C={...C};let I=Object.keys(Q).filter(wf),E=[],g=!1,w=[];if(I.forEach(I=>{let D;let M=A.getValue(I);if(!A.hasValue(I))return;let c=B[I],s=gj(c),y=Q[I];if(IU(y)){let A=y.length,Q=null===y[0]?1:0;s=gj(c=y[Q]);for(let B=Q;B{let C=A.getValue(B);void 0!==C&&(Q.push([B,C.get()]),C.set(B.startsWith("scale")?1:0))}),Q.length&&A.render(),Q}(A),g=!0),w.push(I),C[I]=void 0!==C[I]?C[I]:Q[I],wu(M,y))}}),!w.length)return{target:Q,transitionEnd:C};{let B=w.indexOf("height")>=0?window.pageYOffset:null,I=wO(Q,A,w);return E.length&&E.forEach(([Q,B])=>{A.getValue(Q).set(B)}),A.render(),CI&&null!==B&&window.scrollTo({top:B}),{target:I,transitionEnd:C}}},wx=(A,Q,B,C)=>{var I,E;let g=function(A,{...Q},B){let C=A.current;if(!(C instanceof Element))return{target:Q,transitionEnd:B};for(let I in B&&(B={...B}),A.values.forEach(A=>{let Q=A.get();if(!wS(Q))return;let B=wH(Q,C);B&&A.set(B)}),Q){let A=Q[I];if(!wS(A))continue;let E=wH(A,C);E&&(Q[I]=E,B&&void 0===B[I]&&(B[I]=A))}return{target:Q,transitionEnd:B}}(A,Q,C);return Q=g.target,C=g.transitionEnd,I=Q,E=C,wd(I)?wv(A,I,B,E):{target:I,transitionEnd:E}},wV={current:null},wz={current:!1},wW=Object.keys(CS),wP=wW.length,wq=["AnimationStart","AnimationComplete","Update","Unmount","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class wX{constructor({parent:A,props:Q,reducedMotionConfig:B,visualState:C},I={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>B9.render(this.render,!1,!0);let{latestValues:E,renderState:g}=C;this.latestValues=E,this.baseTarget={...E},this.initialValues=Q.initial?{...E}:{},this.renderState=g,this.parent=A,this.props=Q,this.depth=A?A.depth+1:0,this.reducedMotionConfig=B,this.options=I,this.isControllingVariants=Co(Q),this.isVariantNode=Ce(Q),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(A&&A.current);let{willChange:w,...D}=this.scrapeMotionValuesFromProps(Q);for(let A in D){let Q=D[A];void 0!==E[A]&&CZ(Q)&&(Q.set(E[A],!1),gZ(w)&&w.add(A))}if(Q.values)for(let A in Q.values){let B=Q.values[A];void 0!==E[A]&&CZ(B)&&B.set(E[A])}}scrapeMotionValuesFromProps(A){return{}}mount(A){var Q;this.current=A,this.projection&&this.projection.mount(A),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=null===(Q=this.parent)||void 0===Q?void 0:Q.addVariantChild(this)),this.values.forEach((A,Q)=>this.bindToMotionValue(Q,A)),wz.current||function(){if(wz.current=!0,CI){if(window.matchMedia){let A=window.matchMedia("(prefers-reduced-motion)"),Q=()=>wV.current=A.matches;A.addListener(Q),Q()}else wV.current=!1}}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||wV.current),this.parent&&this.parent.children.add(this),this.setProps(this.props)}unmount(){var A,Q,B;for(let C in null===(A=this.projection)||void 0===A||A.unmount(),B6.update(this.notifyUpdate),B6.render(this.render),this.valueSubscriptions.forEach(A=>A()),null===(Q=this.removeFromVariantTree)||void 0===Q||Q.call(this),null===(B=this.parent)||void 0===B||B.children.delete(this),this.events)this.events[C].clear();this.current=null}bindToMotionValue(A,Q){let B=Q.onChange(Q=>{this.latestValues[A]=Q,this.props.onUpdate&&B9.update(this.notifyUpdate,!1,!0)}),C=Q.onRenderRequest(this.scheduleRender);this.valueSubscriptions.set(A,()=>{B(),C()})}sortNodePosition(A){return this.current&&this.sortInstanceNodePosition&&this.type===A.type?this.sortInstanceNodePosition(this.current,A.current):0}loadFeatures(A,Q,B,C,I,E){let g=[];"production"!==BX&&B&&Q&&I5(!1,"You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.");for(let Q=0;Qthis.scheduleRender(),animationType:"string"==typeof B?B:"both",initialPromotionConfig:E,layoutScroll:D})}return g}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):wc()}getStaticValue(A){return this.latestValues[A]}setStaticValue(A,Q){this.latestValues[A]=Q}makeTargetAnimatable(A,Q=!0){return this.makeTargetAnimatableFromInstance(A,this.props,Q)}setProps(A){(A.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.props=A;for(let Q=0;QB.variantChildren.delete(A)}addValue(A,Q){this.hasValue(A)&&this.removeValue(A),this.values.set(A,Q),this.latestValues[A]=Q.get(),this.bindToMotionValue(A,Q)}removeValue(A){var Q;this.values.delete(A),null===(Q=this.valueSubscriptions.get(A))||void 0===Q||Q(),this.valueSubscriptions.delete(A),delete this.latestValues[A],this.removeValueFromRenderState(A,this.renderState)}hasValue(A){return this.values.has(A)}getValue(A,Q){if(this.props.values&&this.props.values[A])return this.props.values[A];let B=this.values.get(A);return void 0===B&&void 0!==Q&&(B=gd(Q),this.addValue(A,B)),B}readValue(A){return void 0===this.latestValues[A]&&this.current?this.readValueFromInstance(this.current,A,this.options):this.latestValues[A]}setBaseTarget(A,Q){this.baseTarget[A]=Q}getBaseTarget(A){var Q;let{initial:B}=this.props,C="string"==typeof B||"object"==typeof B?null===(Q=IL(this.props,B))||void 0===Q?void 0:Q[A]:void 0;if(B&&void 0!==C)return C;let I=this.getBaseTargetFromProps(this.props,A);return void 0===I||CZ(I)?void 0!==this.initialValues[A]&&void 0===C?void 0:this.baseTarget[A]:I}on(A,Q){return this.events[A]||(this.events[A]=new gH),this.events[A].add(Q)}notify(A,...Q){var B;null===(B=this.events[A])||void 0===B||B.notify(...Q)}}let w_=["initial",...gV],w$=w_.length;class w0 extends wX{sortInstanceNodePosition(A,Q){return 2&A.compareDocumentPosition(Q)?1:-1}getBaseTargetFromProps(A,Q){var B;return null===(B=A.style)||void 0===B?void 0:B[Q]}removeValueFromRenderState(A,{vars:Q,style:B}){delete Q[A],delete B[A]}makeTargetAnimatableFromInstance({transition:A,transitionEnd:Q,...B},{transformValues:C},I){let E=function(A,Q,B){var C;let I={};for(let E in A){let A=function(A,Q){if(Q)return(Q[A]||Q.default||Q).from}(E,Q);I[E]=void 0!==A?A:null===(C=B.getValue(E))||void 0===C?void 0:C.get()}return I}(B,A||{},this);if(C&&(Q&&(Q=C(Q)),B&&(B=C(B)),E&&(E=C(E))),I){!function(A,Q,B){var C,I;let E=Object.keys(Q).filter(Q=>!A.hasValue(Q)),g=E.length;if(g)for(let w=0;wCR(A)?new w3(Q,{enableHardwareAcceleration:!1}):new w8(Q,{enableHardwareAcceleration:!0});function w4(A,Q){return Q.max===Q.min?0:A/(Q.max-Q.min)*100}let w2={correct:(A,Q)=>{if(!Q.target)return A;if("string"==typeof A){if(!C3.test(A))return A;A=parseFloat(A)}let B=w4(A,Q.target.x),C=w4(A,Q.target.y);return`${B}% ${C}%`}},w5="_$css",w9={correct:(A,{treeScale:Q,projectionDelta:B})=>{let C=A,I=A.includes("var("),E=[];I&&(A=A.replace(wl,A=>(E.push(A),w5)));let g=Ee.parse(A);if(g.length>5)return C;let w=Ee.createTransformer(A),D="number"!=typeof g[0]?1:0,M=B.x.scale*Q.x,c=B.y.scale*Q.y;g[0+D]/=M,g[1+D]/=c;let s=EE(M,c,.5);"number"==typeof g[2+D]&&(g[2+D]/=s),"number"==typeof g[3+D]&&(g[3+D]/=s);let y=w(g);if(I){let A=0;y=y.replace(w5,()=>{let Q=E[A];return A++,Q})}return y}};class w6 extends AK.Component{componentDidMount(){let{visualElement:A,layoutGroup:Q,switchLayoutGroup:B,layoutId:C}=this.props,{projection:I}=A;Object.assign(Cj,w7),I&&(Q.group&&Q.group.add(I),B&&B.register&&C&&B.register(I),I.root.didUpdate(),I.addEventListener("animationComplete",()=>{this.safeToRemove()}),I.setOptions({...I.options,onExitComplete:()=>this.safeToRemove()})),Cl.hasEverUpdated=!0}getSnapshotBeforeUpdate(A){let{layoutDependency:Q,visualElement:B,drag:C,isPresent:I}=this.props,E=B.projection;return E&&(E.isPresent=I,C||A.layoutDependency!==Q||void 0===Q?E.willUpdate():this.safeToRemove(),A.isPresent===I||(I?E.promote():E.relegate()||B9.postRender(()=>{var A;(null===(A=E.getStack())||void 0===A?void 0:A.members.length)||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:A}=this.props.visualElement;A&&(A.root.didUpdate(),!A.currentAnimation&&A.isLead()&&this.safeToRemove())}componentWillUnmount(){let{visualElement:A,layoutGroup:Q,switchLayoutGroup:B}=this.props,{projection:C}=A;C&&(C.scheduleCheckAfterUnmount(),(null==Q?void 0:Q.group)&&Q.group.remove(C),(null==B?void 0:B.deregister)&&B.deregister(C))}safeToRemove(){let{safeToRemove:A}=this.props;null==A||A()}render(){return null}}let w7={borderRadius:{...w2,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:w2,borderTopRightRadius:w2,borderBottomLeftRadius:w2,borderBottomRightRadius:w2,boxShadow:w9},DA=["TopLeft","TopRight","BottomLeft","BottomRight"],DQ=DA.length,DB=A=>"string"==typeof A?parseFloat(A):A,DC=A=>"number"==typeof A||C3.test(A);function DI(A,Q){var B;return null!==(B=A[Q])&&void 0!==B?B:A.borderRadius}let DE=Dw(0,.5,EV),Dg=Dw(.5,.95,ET);function Dw(A,Q,B){return C=>CQ?1:B(EI(A,Q,C))}function DD(A,Q){A.min=Q.min,A.max=Q.max}function DM(A,Q){DD(A.x,Q.x),DD(A.y,Q.y)}function Dc(A,Q,B,C,I){return A-=Q,A=C+1/B*(A-C),void 0!==I&&(A=C+1/I*(A-C)),A}function Ds(A,Q,[B,C,I],E,g){!function(A,Q=0,B=1,C=.5,I,E=A,g=A){if(C8.test(Q)&&(Q=parseFloat(Q),Q=EE(g.min,g.max,Q/100)-g.min),"number"!=typeof Q)return;let w=EE(E.min,E.max,C);A===E&&(w-=Q),A.min=Dc(A.min,Q,B,w,I),A.max=Dc(A.max,Q,B,w,I)}(A,Q[B],Q[C],Q[I],Q.scale,E,g)}let Dy=["x","scaleX","originX"],Dh=["y","scaleY","originY"];function Dk(A,Q,B,C){Ds(A.x,Q,Dy,null==B?void 0:B.x,null==C?void 0:C.x),Ds(A.y,Q,Dh,null==B?void 0:B.y,null==C?void 0:C.y)}function Dn(A){return 0===A.translate&&1===A.scale}function Dt(A){return Dn(A.x)&&Dn(A.y)}function DK(A,Q){return A.x.min===Q.x.min&&A.x.max===Q.x.max&&A.y.min===Q.y.min&&A.y.max===Q.y.max}function DL(A){return g5(A.x)/g5(A.y)}class DU{constructor(){this.members=[]}add(A){gS(this.members,A),A.scheduleRender()}remove(A){if(gl(this.members,A),A===this.prevLead&&(this.prevLead=void 0),A===this.lead){let A=this.members[this.members.length-1];A&&this.promote(A)}}relegate(A){let Q;let B=this.members.findIndex(Q=>A===Q);if(0===B)return!1;for(let A=B;A>=0;A--){let B=this.members[A];if(!1!==B.isPresent){Q=B;break}}return!!Q&&(this.promote(Q),!0)}promote(A,Q){var B;let C=this.lead;if(A!==C&&(this.prevLead=C,this.lead=A,A.show(),C)){C.instance&&C.scheduleRender(),A.scheduleRender(),A.resumeFrom=C,Q&&(A.resumeFrom.preserveOpacity=!0),C.snapshot&&(A.snapshot=C.snapshot,A.snapshot.latestValues=C.animationValues||C.latestValues,A.snapshot.isShared=!0),(null===(B=A.root)||void 0===B?void 0:B.isUpdating)&&(A.isLayoutDirty=!0);let{crossfade:I}=A.options;!1===I&&C.hide()}}exitAnimationComplete(){this.members.forEach(A=>{var Q,B,C,I,E;null===(B=(Q=A.options).onExitComplete)||void 0===B||B.call(Q),null===(E=null===(C=A.resumingFrom)||void 0===C?void 0:(I=C.options).onExitComplete)||void 0===E||E.call(I)})}scheduleRender(){this.members.forEach(A=>{A.instance&&A.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Di(A,Q,B){let C=A.x.translate/Q.x,I=A.y.translate/Q.y,E=`translate3d(${C}px, ${I}px, 0) `;if(E+=`scale(${1/Q.x}, ${1/Q.y}) `,B){let{rotate:A,rotateX:Q,rotateY:C}=B;A&&(E+=`rotate(${A}deg) `),Q&&(E+=`rotateX(${Q}deg) `),C&&(E+=`rotateY(${C}deg) `)}let g=A.x.scale*Q.x,w=A.y.scale*Q.y;return"translate3d(0px, 0px, 0) scale(1, 1) scale(1, 1)"==(E+=`scale(${g}, ${w})`)?"none":E}let DG=(A,Q)=>A.depth-Q.depth;class Dr{constructor(){this.children=[],this.isDirty=!1}add(A){gS(this.children,A),this.isDirty=!0}remove(A){gl(this.children,A),this.isDirty=!0}forEach(A){this.isDirty&&this.children.sort(DG),this.isDirty=!1,this.children.forEach(A)}}let Dp=["","X","Y","Z"];function Da({attachResizeListener:A,defaultParent:Q,measureScroll:B,checkIsScrollRoot:C,resetTransform:I}){return class{constructor(A,B={},C=null==Q?void 0:Q()){this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(Dl),this.nodes.forEach(DH)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.id=A,this.latestValues=B,this.root=C?C.root||C:this,this.path=C?[...C.path,C]:[],this.parent=C,this.depth=C?C.depth+1:0,A&&this.root.registerPotentialNode(A,this);for(let A=0;Athis.root.updateBlockedByResize=!1;A(Q,()=>{this.root.updateBlockedByResize=!0,B&&B(),B=gr(C,250),Cl.hasAnimatedSinceResize&&(Cl.hasAnimatedSinceResize=!1,this.nodes.forEach(DS))})}I&&this.root.registerSharedNode(I,this),!1!==this.options.animate&&g&&(I||E)&&this.addEventListener("didUpdate",({delta:A,hasLayoutChanged:Q,hasRelativeTargetChanged:B,layout:C})=>{var I,E,w,D,M;if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let c=null!==(E=null!==(I=this.options.transition)&&void 0!==I?I:g.getDefaultTransition())&&void 0!==E?E:Dj,{onLayoutAnimationStart:s,onLayoutAnimationComplete:y}=g.getProps(),h=!this.targetLayout||!DK(this.targetLayout,C)||B,k=!Q&&B;if((null===(w=this.resumeFrom)||void 0===w?void 0:w.instance)||k||Q&&(h||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(A,k);let Q={...go(c,"layout"),onPlay:s,onComplete:y};g.shouldReduceMotion&&(Q.delay=0,Q.type=!1),this.startAnimation(Q)}else Q||0!==this.animationProgress||DS(this),this.isLead()&&(null===(M=(D=this.options).onExitComplete)||void 0===M||M.call(D));this.targetLayout=C})}unmount(){var A,Q;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),null===(A=this.getStack())||void 0===A||A.remove(this),null===(Q=this.parent)||void 0===Q||Q.children.delete(this),this.instance=void 0,B6.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){var A;return this.isAnimationBlocked||(null===(A=this.parent)||void 0===A?void 0:A.isTreeAnimationBlocked())||!1}startUpdate(){var A;this.isUpdateBlocked()||(this.isUpdating=!0,null===(A=this.nodes)||void 0===A||A.forEach(DY))}willUpdate(A=!0){var Q,B,C;if(this.root.isUpdateBlocked()){null===(B=(Q=this.options).onExitComplete)||void 0===B||B.call(Q);return}if(this.root.isUpdating||this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let A=0;A{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){if(this.snapshot||!this.instance)return;let A=this.measure(),Q=this.removeTransform(this.removeElementScroll(A));DT(Q),this.snapshot={measured:A,layout:Q,latestValues:{}}}updateLayout(){var A;if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let A=0;A=((null===(B=this.getStack())||void 0===B?void 0:B.members.length)||0),c=!!(D&&!M&&!0===this.options.crossfade&&!this.path.some(DR));this.animationProgress=0,this.mixTargetDelta=Q=>{var B,C,s;let y=Q/1e3;Dd(g.x,A.x,y),Dd(g.y,A.y,y),this.setTargetDelta(g),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&(null===(B=this.relativeParent)||void 0===B?void 0:B.layout)&&(wB(w,this.layout.actual,this.relativeParent.layout.actual),C=this.relativeTarget,s=this.relativeTargetOrigin,Du(C.x,s.x,w.x,y),Du(C.y,s.y,w.y,y)),D&&(this.animationValues=E,function(A,Q,B,C,I,E){var g,w,D,M;I?(A.opacity=EE(0,null!==(g=B.opacity)&&void 0!==g?g:1,DE(C)),A.opacityExit=EE(null!==(w=Q.opacity)&&void 0!==w?w:1,0,Dg(C))):E&&(A.opacity=EE(null!==(D=Q.opacity)&&void 0!==D?D:1,null!==(M=B.opacity)&&void 0!==M?M:1,C));for(let I=0;I{Cl.hasAnimatedSinceResize=!0,this.currentAnimation=function(A,Q,B={}){let C=CZ(A)?A:gd(A);return ge("",C,1e3,B),{stop:()=>C.stop(),isAnimating:()=>C.isAnimating()}}(0,0,{...A,onUpdate:Q=>{var B;this.mixTargetDelta(Q),null===(B=A.onUpdate)||void 0===B||B.call(A,Q)},onComplete:()=>{var Q;null===(Q=A.onComplete)||void 0===Q||Q.call(A),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){var A;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),null===(A=this.getStack())||void 0===A||A.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var A;this.currentAnimation&&(null===(A=this.mixTargetDelta)||void 0===A||A.call(this,1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let A=this.getLead(),{targetWithTransforms:Q,target:B,layout:C,latestValues:I}=A;if(Q&&B&&C){if(this!==A&&this.layout&&C&&DZ(this.options.animationType,this.layout.actual,C.actual)){B=this.target||wc();let Q=g5(this.layout.actual.x);B.x.min=A.target.x.min,B.x.max=B.x.min+Q;let C=g5(this.layout.actual.y);B.y.min=A.target.y.min,B.y.max=B.y.min+C}DM(Q,B),wa(Q,I),g7(this.projectionDeltaWithTransform,this.layoutCorrected,Q,I)}}registerSharedNode(A,Q){var B,C,I;this.sharedNodes.has(A)||this.sharedNodes.set(A,new DU),this.sharedNodes.get(A).add(Q),Q.promote({transition:null===(B=Q.options.initialPromotionConfig)||void 0===B?void 0:B.transition,preserveFollowOpacity:null===(I=null===(C=Q.options.initialPromotionConfig)||void 0===C?void 0:C.shouldPreserveFollowOpacity)||void 0===I?void 0:I.call(C,Q)})}isLead(){let A=this.getStack();return!A||A.lead===this}getLead(){var A;let{layoutId:Q}=this.options;return Q&&(null===(A=this.getStack())||void 0===A?void 0:A.lead)||this}getPrevLead(){var A;let{layoutId:Q}=this.options;return Q?null===(A=this.getStack())||void 0===A?void 0:A.prevLead:void 0}getStack(){let{layoutId:A}=this.options;if(A)return this.root.sharedNodes.get(A)}promote({needsReset:A,transition:Q,preserveFollowOpacity:B}={}){let C=this.getStack();C&&C.promote(this,B),A&&(this.projectionDelta=void 0,this.needsReset=!0),Q&&this.setOptions({transition:Q})}relegate(){let A=this.getStack();return!!A&&A.relegate(this)}resetRotation(){let{visualElement:A}=this.options;if(!A)return;let Q=!1,B={};for(let C=0;C{var Q;return null===(Q=A.currentAnimation)||void 0===Q?void 0:Q.stop()}),this.root.nodes.forEach(DJ),this.root.sharedNodes.clear()}}}function DN(A){A.updateLayout()}function Do(A){var Q,B,C;let I=(null===(Q=A.resumeFrom)||void 0===Q?void 0:Q.snapshot)||A.snapshot;if(A.isLead()&&A.layout&&I&&A.hasListeners("didUpdate")){let{actual:Q,measured:B}=A.layout,{animationType:C}=A.options;"size"===C?ws(A=>{let B=I.isShared?I.measured[A]:I.layout[A],C=g5(B);B.min=Q[A].min,B.max=B.min+C}):DZ(C,I.layout,Q)&&ws(A=>{let B=I.isShared?I.measured[A]:I.layout[A],C=g5(Q[A]);B.max=B.min+C});let E=wD();g7(E,Q,I.layout);let g=wD();I.isShared?g7(g,A.applyTransform(B,!0),I.measured):g7(g,Q,I.layout);let w=!Dt(E),D=!1;if(!A.resumeFrom){let B=A.getClosestProjectingParent();if(B&&!B.resumeFrom){let{snapshot:A,layout:C}=B;if(A&&C){let B=wc();wB(B,I.layout,A.layout);let E=wc();wB(E,Q,C.actual),DK(B,E)||(D=!0)}}}A.notifyListeners("didUpdate",{layout:Q,snapshot:I,delta:g,layoutDelta:E,hasLayoutChanged:w,hasRelativeTargetChanged:D})}else A.isLead()&&(null===(C=(B=A.options).onExitComplete)||void 0===C||C.call(B));A.options.transition=void 0}function De(A){A.clearSnapshot()}function DJ(A){A.clearMeasurements()}function DF(A){let{visualElement:Q}=A.options;(null==Q?void 0:Q.getProps().onBeforeLayoutMeasure)&&Q.notify("BeforeLayoutMeasure"),A.resetTransform()}function DS(A){A.finishAnimation(),A.targetDelta=A.relativeTarget=A.target=void 0}function Dl(A){A.resolveTargetDelta()}function DH(A){A.calcProjection()}function DY(A){A.resetRotation()}function Df(A){A.removeLeadSnapshot()}function Dd(A,Q,B){A.translate=EE(Q.translate,0,B),A.scale=EE(Q.scale,1,B),A.origin=Q.origin,A.originPoint=Q.originPoint}function Du(A,Q,B,C){A.min=EE(Q.min,B.min,C),A.max=EE(Q.max,B.max,C)}function DR(A){return A.animationValues&&void 0!==A.animationValues.opacityExit}let Dj={duration:.45,ease:[.4,0,.1,1]};function Db(A,Q){let B=A.root;for(let Q=A.path.length-1;Q>=0;Q--)if(A.path[Q].instance){B=A.path[Q];break}let C=(B&&B!==A.root?B.instance:document).querySelector(`[data-projection-id="${Q}"]`);C&&A.mount(C,!0)}function Dm(A){A.min=Math.round(A.min),A.max=Math.round(A.max)}function DT(A){Dm(A.x),Dm(A.y)}function DZ(A,Q,B){return"position"===A||"preserve-aspect"===A&&!function(A,Q,B=.1){return g0(A,Q)<=B}(DL(Q),DL(B),.2)}let DO=Da({attachResizeListener:(A,Q)=>Io(A,"resize",Q),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Dv={current:void 0},Dx=Da({measureScroll:A=>({x:A.scrollLeft,y:A.scrollTop}),defaultParent:()=>{if(!Dv.current){let A=new DO(0,{});A.mount(window),A.setOptions({layoutScroll:!0}),Dv.current=A}return Dv.current},resetTransform:(A,Q)=>{A.style.transform=void 0!==Q?Q:"none"},checkIsScrollRoot:A=>"fixed"===window.getComputedStyle(A).position}),DV={...gq,...I8,...wF,measureLayout:function(A){let[Q,B]=I3(),C=(0,AK.useContext)(Ch);return AK.createElement(w6,{...A,layoutGroup:C,switchLayoutGroup:(0,AK.useContext)(Cf),isPresent:Q,safeToRemove:B})}},Dz=function(A){function Q(Q,B={}){return function({preloadedFeatures:A,createVisualElement:Q,projectionNodeConstructor:B,useRender:C,useVisualState:I,Component:E}){A&&function(A){for(let Q in A)"projectionNodeConstructor"===Q?CS.projectionNodeConstructor=A[Q]:CS[Q].Component=A[Q]}(A);let g=(0,AK.forwardRef)(function(g,w){var D;let M={...(0,AK.useContext)(CU),...g,layoutId:function({layoutId:A}){let Q=(0,AK.useContext)(Ch).id;return Q&&void 0!==A?Q+"-"+A:A}(g)},{isStatic:c}=M,s=null,y=function(A){let{initial:Q,animate:B}=function(A,Q){if(Co(A)){let{initial:Q,animate:B}=A;return{initial:!1===Q||Cp(Q)?Q:void 0,animate:Cp(B)?B:void 0}}return!1!==A.inherit?Q:{}}(A,(0,AK.useContext)(Ci));return(0,AK.useMemo)(()=>({initial:Q,animate:B}),[CJ(Q),CJ(B)])}(g),h=c?void 0:CD(()=>{if(Cl.hasEverUpdated)return CH++}),k=I(g,c);if(!c&&CI){y.visualElement=function(A,Q,B,C){let I=(0,AK.useContext)(Ci).visualElement,E=(0,AK.useContext)(CG),g=(0,AK.useContext)(Cw),w=(0,AK.useContext)(CU).reducedMotion,D=(0,AK.useRef)();C=C||E.renderer,!D.current&&C&&(D.current=C(A,{visualState:Q,parent:I,props:B,presenceId:g?g.id:void 0,blockInitialAnimation:!!g&&!1===g.initial,reducedMotionConfig:w}));let M=D.current;return CE(()=>{M&&M.render()}),(0,AK.useEffect)(()=>{M&&M.animationState&&M.animationState.animateChanges()}),CE(()=>()=>M&&M.notify("Unmount"),[]),M}(E,k,M,Q);let C=(0,AK.useContext)(CG).strict,I=(0,AK.useContext)(Cf);y.visualElement&&(s=y.visualElement.loadFeatures(M,C,A,h,B||CS.projectionNodeConstructor,I))}return AK.createElement(CY,{visualElement:y.visualElement,props:M},s,AK.createElement(Ci.Provider,{value:y},C(E,g,h,(D=y.visualElement,(0,AK.useCallback)(A=>{A&&k.mount&&k.mount(A),D&&(A?D.mount(A):D.unmount()),w&&("function"==typeof w?w(A):Cr(w)&&(w.current=A))},[D])),k,c,y.visualElement)))});return g[Cd]=E,g}(A(Q,B))}if("undefined"==typeof Proxy)return Q;let B=new Map;return new Proxy(Q,{get:(A,C)=>(B.has(C)||B.set(C,Q(C)),B.get(C))})}((A,Q)=>(function(A,{forwardMotionProps:Q=!1},B,C,I){return{...CR(A)?Ia:IN,preloadedFeatures:B,useRender:function(A=!1){return(Q,B,C,I,{latestValues:E},g)=>{let w=(CR(Q)?function(A,Q){let B=(0,AK.useMemo)(()=>{let B=Is();return Ic(B,Q,{enableHardwareAcceleration:!1},A.transformTemplate),{...B.attrs,style:{...B.style}}},[Q]);if(A.style){let Q={};IC(Q,A.style,A),B.style={...Q,...B.style}}return B}:function(A,Q,B){let C={},I=function(A,Q,B){let C=A.style||{},I={};return IC(I,C,A),Object.assign(I,function({transformTemplate:A},Q,B){return(0,AK.useMemo)(()=>{let C=IB();return IQ(C,Q,{enableHardwareAcceleration:!B},A),Object.assign({},C.vars,C.style)},[Q])}(A,Q,B)),A.transformValues?A.transformValues(I):I}(A,Q,B);return A.drag&&!1!==A.dragListener&&(C.draggable=!1,I.userSelect=I.WebkitUserSelect=I.WebkitTouchCallout="none",I.touchAction=!0===A.drag?"none":`pan-${"x"===A.drag?"y":"x"}`),C.style=I,C})(B,E,g),D={...function(A,Q,B){let C={};for(let I in A)(Ig(I)||!0===B&&IE(I)||!Q&&!IE(I)||A.draggable&&I.startsWith("onDrag"))&&(C[I]=A[I]);return C}(B,"string"==typeof Q,A),...w,ref:I};return C&&(D["data-projection-id"]=C),(0,AK.createElement)(Q,D)}}(Q),createVisualElement:C,projectionNodeConstructor:I,Component:A}})(A,Q,DV,w1,Dx));function DW(A){let{open:Q,onOpenChange:B}=A,[C,I]=(0,AK.useState)(!1);return{open:(0,AK.useMemo)(()=>B?Q:C,[B,C,Q]),onOpenChange:(0,AK.useCallback)(A=>{B?B(A):I(A)},[B])}}let DP={show:{opacity:[0,1],scale:[.95,1],transition:{duration:.1,ease:"easeOut"}},exit:{opacity:[1,0],scale:[1,.95],transition:{duration:.1,ease:"easeIn"}}};function Dq(A){let{children:Q,content:B,defaultOpen:C,open:I,onOpenChange:E,delayDuration:g=300,disableHoverableContent:w,...D}=A,{open:M,onOpenChange:c}=DW({open:I,onOpenChange:E});return(0,At.jsxs)(BO,{open:M,delayDuration:g,disableHoverableContent:w,defaultOpen:C,onOpenChange:c,children:[(0,At.jsx)(BY,{asChild:!0,children:Q}),(0,At.jsx)(CL,{children:B&&M?(0,At.jsx)(Bv,{forceMount:!0,children:(0,At.jsx)(Bj,{forceMount:!0,asChild:!0,side:"top",align:"center",sideOffset:D.sideOffset||5,...D,children:(0,At.jsx)(Dz.div,{variants:DP,initial:"init",animate:"show",exit:"exit",className:(0,QC.cx)("relative","z-50","data-[side=top]:bottom-1","data-[side=top]:origin-bottom","data-[side=bottom]:top-1","data-[side=bottom]:origin-top","data-[side=left]:right-1","data-[side=left]:origin-right","data-[side=right]:left-1","data-[side=right]:origin-left"),children:(0,At.jsx)("div",{className:(0,QC.cx)("py-1 px-2","max-w-xs","overflow-hidden",BW()),children:(0,At.jsx)(Bz,{size:"12",children:B})})})})}):null})]})}let DX=(0,QC.j)(["inline-flex","gap-1","appearance-none","shrink-0","items-center","justify-center","select-none","leading-normal","font-sans","cursor-pointer","overflow-hidden","focus:z-10","disabled:cursor-auto","disabled:pointer-events-none","outline-none","focus:ring ring-blue-500 dark:ring-blue-200","transition-colors duration-75"],{variants:{size:{small:["text-xs","px-2","h-7"],medium:["text-base","px-4","h-10"],large:["text-lg","px-4","h-12"],none:[]},state:{waiting:["pointer-events-none"]},disabled:{true:"cursor-auto pointer-events-none"},rounded:{true:"rounded",false:""},variant:{accent:["border","text-white dark:text-white","enabled:bg-green-700 enabled:dark:bg-green-700","enabled:border-green-800/30 enabled:dark:border-green-600/70","enabled:hover:bg-green-800/90 dark:enabled:hover:bg-green-700/90","enabled:hover:border-green-800/50 enabled:hover:dark:border-green-600","disabled:text-white/50 disabled:dark:text-white/50","disabled:bg-green-700/70 disabled:dark:bg-green-600/70","disabled:border-green-600/50 disabled:dark:border-green-500/30","[&[href]]:bg-green-700 [&[href]]:dark:bg-green-700","[&[href]]:border-green-800/30 [&[href]]:dark:border-green-600/70","[&[href]]:hover:bg-green-800/90 dark:[&[href]]:hover:bg-green-700/90","[&[href]]:hover:border-green-800/50 [href]]:hover:dark:border-green-600"],red:["border","bg-red-700 dark:bg-red-700","border-red-800/30 dark:border-red-600/70","enabled:hover:bg-red-800/90 dark:enabled:hover:bg-red-700/90","enabled:hover:border-red-800/50 enabled:hover:dark:border-red-600","disabled:bg-red-700/70 disabled:dark:bg-red-600/70","disabled:border-red-600/50 disabled:dark:border-red-500/30","text-white dark:text-white","disabled:text-white/50 disabled:dark:text-white/50"],amber:["border","bg-amber-700 dark:bg-amber-700","border-amber-800/30 dark:border-amber-600/70","enabled:hover:bg-amber-800/90 dark:enabled:hover:bg-amber-700/90","enabled:hover:border-amber-800/50 enabled:hover:dark:border-amber-600","disabled:bg-amber-700/70 disabled:dark:bg-amber-600/70","disabled:border-amber-600/50 disabled:dark:border-amber-500/30","text-white dark:text-white","disabled:text-white/50 disabled:dark:text-white/50"],gray:["border","bg-white dark:bg-graydark-200","enabled:hover:bg-gray-50 dark:enabled:hover:bg-graydark-300","disabled:bg-gray-200 disabled:dark:bg-graydark-200","border-gray-400 dark:border-graydark-400","enabled:hover:border-gray-500 enabled:hover:dark:border-graydark-500","text-gray-1100 dark:text-gray-300","disabled:text-gray-600 disabled:dark:text-graydark-700"],active:["border","bg-gray-200 dark:bg-graydark-400","enabled:hover:bg-gray-50 dark:enabled:hover:bg-graydark-300","disabled:bg-gray-200 disabled:dark:bg-graydark-200","border-gray-500 dark:border-graydark-500","enabled:hover:border-gray-500 enabled:hover:dark:border-graydark-500","text-gray-1100 dark:text-white","disabled:text-gray-600 disabled:dark:text-graydark-700"],inactive:["border","bg-white dark:bg-graydark-200","enabled:hover:bg-gray-50 dark:enabled:hover:bg-graydark-300","disabled:bg-gray-200 disabled:dark:bg-graydark-200","border-gray-400/70 dark:border-graydark-400/70","enabled:hover:border-gray-500 enabled:hover:dark:border-graydark-500","text-gray-1100/30 dark:text-white/30","enabled:hover:text-gray-1100 enabled:hover:dark:text-white","disabled:text-gray-600 disabled:dark:text-graydark-700"],ghost:["appearance-none border-none bg-transparent","text-gray-1100 dark:text-white","disabled:text-gray-600 disabled:dark:text-graydark-700"],state:["open:text-gray-1100 open:dark:text-white","hover:text-gray-1000 hover:dark:text-graydark-1000","text-gray-700 dark:text-graydark-800"]},icon:{contrast:"",hover:"[&>svg]:opacity-50 hover:[&>svg]:opacity-100 transition-opacity",subtle:"[&>svg]:opacity-50"},color:{verySubtle:"!text-gray-700 dark:!text-graydark-700",subtle:"!text-gray-1000 dark:!text-graydark-1000",contrast:"!text-gray-1100 dark:!text-white",lo:"!text-white dark:!text-graydark-50",accent:"!text-accent-1100 dark:!text-accentdark-1100",red:"!text-red-700 dark:!text-red-400",green:"!text-emerald-700 dark:!text-emerald-500",amber:"!text-amber-600 dark:!text-amber-500",none:""}},defaultVariants:{variant:"gray",size:"small",rounded:!0,icon:"subtle",color:"none"}}),D_=AK.forwardRef((A,Q)=>{let{variant:B,size:C,state:I,rounded:E,disabled:g,icon:w,color:D,tip:M,tipAlign:c,tipSide:s,className:y,type:h="button",...k}=A;return M?(0,At.jsx)(Dq,{content:M,align:c,side:s,children:(0,At.jsx)("button",{ref:Q,type:h,disabled:g,className:DX({variant:B,size:C,state:I,rounded:E,disabled:g,icon:w,color:D,className:y}),...k})}):(0,At.jsx)("button",{ref:Q,disabled:g,type:h,className:DX({variant:B,size:C,state:I,rounded:E,disabled:g,icon:w,color:D,className:y}),...k})});var D$=B(3208);(0,QC.j)([],{variants:{variant:{default:"border-t border-gray-500 dark:border-graydark-500 last-of-type:border-b",ghost:""}},defaultVariants:{variant:"default"}});let D0=(0,QC.j)("border border-gray-500 dark:border-graydark-500 bg-gray-100 dark:bg-graydark-100 rounded p-4"),D8=AK.forwardRef((A,Q)=>{let{className:B,...C}=A;return(0,At.jsx)("div",{...C,className:D0({className:B}),ref:Q})}),D3="Avatar",[D1,D4]=AG(D3),[D2,D5]=D1(D3),D9=(0,AK.forwardRef)((A,Q)=>{let{__scopeAvatar:B,...C}=A,[I,E]=(0,AK.useState)("idle");return(0,AK.createElement)(D2,{scope:B,imageLoadingStatus:I,onImageLoadingStatusChange:E},(0,AK.createElement)(AY.span,AU({},C,{ref:Q})))}),D6=(0,AK.forwardRef)((A,Q)=>{let{__scopeAvatar:B,src:C,onLoadingStatusChange:I=()=>{},...E}=A,g=D5("AvatarImage",B),w=function(A){let[Q,B]=(0,AK.useState)("idle");return(0,AK.useEffect)(()=>{if(!A){B("error");return}let Q=!0,C=new window.Image,I=A=>()=>{Q&&B(A)};return B("loading"),C.onload=I("loaded"),C.onerror=I("error"),C.src=A,()=>{Q=!1}},[A]),Q}(C),D=AS(A=>{I(A),g.onImageLoadingStatusChange(A)});return Ad(()=>{"idle"!==w&&D(w)},[w,D]),"loaded"===w?(0,AK.createElement)(AY.img,AU({},E,{ref:Q,src:C})):null}),D7=(0,AK.forwardRef)((A,Q)=>{let{__scopeAvatar:B,delayMs:C,...I}=A,E=D5("AvatarFallback",B),[g,w]=(0,AK.useState)(void 0===C);return(0,AK.useEffect)(()=>{if(void 0!==C){let A=window.setTimeout(()=>w(!0),C);return()=>window.clearTimeout(A)}},[C]),g&&"loaded"!==E.imageLoadingStatus?(0,AK.createElement)(AY.span,AU({},I,{ref:Q})):null}),MA=(0,QC.j)(["items-center justify-center align-middle flex flex-shrink-0 relative","overflow-hidden select-none outline-none","font-sans font-medium text-sm","border"],{variants:{size:{1:"w-6 h-6",2:"w-12 h-12",3:"w-16 h-16",4:"w-28 h-28"},variant:{filter:"bg-transparent",hiContrast:["bg-gray-900 dark:bg-white text-white dark:text-gray-1100","border-gray-900 dark:border-white text-white dark:text-gray-1100"],gray:["bg-gray-500 dark:bg-gray-800 text-gray-1100 dark:text-white","border-gray-500 dark:border-gray-800 text-gray-1100 dark:text-white"]},shape:{square:"rounded",circle:"rounded-full"},inactive:{true:"opacity-30"},interactive:{true:"cursor-pointer"}},defaultVariants:{size:"2",variant:"gray",shape:"circle"}}),MQ=(0,QC.j)("uppercase",{variants:{size:{1:"text-sm",2:"text-base",3:"text-lg",4:"text-lg"}},defaultVariants:{size:"2"}}),MB=AK.forwardRef((A,Q)=>{let{alt:B,src:C,fallback:I,size:E,variant:g,shape:w,interactive:D,inactive:M,className:c,...s}=A;return(0,At.jsx)("div",{className:(0,QC.cx)("relative h-fit w-fit",c),children:(0,At.jsxs)(D9,{...s,ref:Q,className:MA({className:c,size:E,variant:g,interactive:D,inactive:M,shape:w}),children:["filter"===g&&(0,At.jsx)("div",{className:"absolute w-full h-full z-10",style:{backgroundColor:"rgba(30, 169, 76, 0.3)"}}),(0,At.jsx)(D6,{alt:B,src:C,className:"flex object-cover h-full align-middle w-full"}),(0,At.jsx)(D7,{className:MQ({size:E}),children:I})]})})}),MC=(0,QC.j)(["items-center appearance-none inline-flex flex-shrink-0 whitespace-nowrap","font-sans font-regular","justify-center align-middle outline-none decoration-none select-none","disabled:pointer-events-none"],{variants:{size:{default:"text-sm py-0.5 px-2",small:"text-xs py-px px-1"},variant:{active:["border","bg-gray-800 text-gray-900 border-gray-900","dark:bg-transparent dark:text-white dark:border-white/10"],simple:"bg-gray-300 dark:bg-graydark-800 text-gray-900 dark:text-white",green:["border","[&>svg]:opacity-50","bg-green-700 dark:bg-green-700","border-green-800/30 dark:border-green-600/70","hover:bg-green-800/90 dark:hover:bg-green-700/90","hover:border-green-800/50 hover:dark:border-green-600","text-white dark:text-white"],accent:["border","[&>svg]:opacity-50","bg-green-700 dark:bg-green-700","border-green-800/30 dark:border-green-600/70","hover:bg-green-800/90 dark:hover:bg-green-700/90","hover:border-green-800/50 hover:dark:border-green-600","text-white dark:text-white"],red:["border","[&>svg]:opacity-50","bg-red-700 dark:bg-red-700","border-red-800/30 dark:border-red-600/70","hover:bg-red-800/90 dark:hover:bg-red-700/90","hover:border-red-800/50 hover:dark:border-red-600","text-white dark:text-white"],amber:["border","[&>svg]:opacity-50","bg-amber-700 dark:bg-amber-700","border-amber-800/30 dark:border-amber-600/70","hover:bg-amber-800/90 dark:hover:bg-amber-700/90","hover:border-amber-800/50 hover:dark:border-amber-600","text-white dark:text-white"],gray:["border","[&>svg]:opacity-50","bg-white dark:bg-graydark-200","border-gray-400 dark:border-graydark-400","hover:bg-gray-50 dark:hover:bg-graydark-300","hover:border-gray-500 hover:dark:border-graydark-500","text-gray-1100 dark:text-white"],inactive:["border","[&>svg]:opacity-50","bg-white dark:bg-transparent","border-gray-400 dark:border-graydark-400","hover:border-gray-500 hover:dark:border-graydark-500","text-gray-1100/30 dark:text-white/30","hover:text-gray-1100/50 hover:dark:text-white/50"]},interactive:{true:"cursor-pointer",false:"cursor-auto"},rounded:{true:"rounded",false:""}},defaultVariants:{variant:"gray",size:"default",rounded:!0,interactive:!1}}),MI=AK.forwardRef((A,Q)=>{let{variant:B,size:C,interactive:I,rounded:E,className:g,...w}=A;return(0,At.jsx)("div",{...w,className:MC({variant:B,size:C,interactive:I,rounded:E,className:g}),ref:Q})}),ME=(0,QC.j)(["font-mono","whitespace-nowrap","rounded"],{variants:{color:{gray:["bg-gray-200 dark:bg-graydark-200","text-gray-1100 dark:text-graydark-1100"],accent:["bg-accent-200 dark:bg-accentdark-200","text-accent-1100 dark:text-accentdark-1100"]}},defaultVariants:{color:"accent"}}),Mg=AK.forwardRef((A,Q)=>{let{color:B,className:C,...I}=A;return(0,At.jsx)("code",{...I,className:ME({color:B,className:C}),ref:Q})}),Mw=(0,QC.j)(["flex","relative","[&>*]:rounded-none [&>*:last-child]:rounded-r [&>*:first-child]:rounded-l","[&>*]:border-r-0 [&>*]:border-l [&>*:first-child]:border-l [&>*:last-child]:border-r"]),MD=AK.forwardRef((A,Q)=>{let{className:B,...C}=A;return(0,At.jsx)("div",{ref:Q,className:Mw({className:B}),...C})});(0,QC.j)(["select-none appearance-none outline-none overflow-hidden","inline-flex items-center justify-center","focus:ring ring-blue-500 dark:ring-blue-200","border","bg-gray-300 dark:bg-graydark-50","autofill:bg-blue-100 autofill:dark:bg-blue-800","border-gray-400 dark:border-graydark-400","enabled:hover:border-gray-500 enabled:hover:dark:border-graydark-500","disabled:cursor-default","enabled:data-[state=checked]:bg-green-600 dark:enabled:data-[state=checked]:bg-green-500","disabled:data-[state=checked]:bg-green-600/50 dark:disabled:data-[state=checked]:bg-green-500/50"],{variants:{size:{small:"w-4 h-4 rounded",medium:"w-6 h-6 rounded"}},defaultVariants:{size:"small"}});let MM=(0,QC.j)(["flex-shrink-0 w-full mx-auto"],{variants:{pad:{true:"px-5 md:px-10",false:""},size:{1:"max-w-screen-sm",2:"max-w-screen-md",3:"max-w-[1145px]",4:"max-w-screen-2xl",full:"max-w-none"}},defaultVariants:{pad:!0,size:"3"}}),Mc=AK.forwardRef((A,Q)=>{let{className:B,pad:C,size:I,...E}=A;return(0,At.jsx)("div",{ref:Q,...E,className:MM({size:I,pad:C,className:B})})}),Ms="focusScope.autoFocusOnMount",My="focusScope.autoFocusOnUnmount",Mh={bubbles:!1,cancelable:!0},Mk=(0,AK.forwardRef)((A,Q)=>{let{loop:B=!1,trapped:C=!1,onMountAutoFocus:I,onUnmountAutoFocus:E,...g}=A,[w,D]=(0,AK.useState)(null),M=AS(I),c=AS(E),s=(0,AK.useRef)(null),y=Ap(Q,A=>D(A)),h=(0,AK.useRef)({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;(0,AK.useEffect)(()=>{if(C){function A(A){if(h.paused||!w)return;let Q=A.target;w.contains(Q)?s.current=Q:MK(s.current,{select:!0})}function Q(A){h.paused||!w||w.contains(A.relatedTarget)||MK(s.current,{select:!0})}return document.addEventListener("focusin",A),document.addEventListener("focusout",Q),()=>{document.removeEventListener("focusin",A),document.removeEventListener("focusout",Q)}}},[C,w,h.paused]),(0,AK.useEffect)(()=>{if(w){ML.add(h);let A=document.activeElement;if(!w.contains(A)){let Q=new CustomEvent(Ms,Mh);w.addEventListener(Ms,M),w.dispatchEvent(Q),Q.defaultPrevented||(function(A,{select:Q=!1}={}){let B=document.activeElement;for(let C of A)if(MK(C,{select:Q}),document.activeElement!==B)return}(Mn(w).filter(A=>"A"!==A.tagName),{select:!0}),document.activeElement===A&&MK(w))}return()=>{w.removeEventListener(Ms,M),setTimeout(()=>{let Q=new CustomEvent(My,Mh);w.addEventListener(My,c),w.dispatchEvent(Q),Q.defaultPrevented||MK(null!=A?A:document.body,{select:!0}),w.removeEventListener(My,c),ML.remove(h)},0)}}},[w,M,c,h]);let k=(0,AK.useCallback)(A=>{if(!B&&!C||h.paused)return;let Q="Tab"===A.key&&!A.altKey&&!A.ctrlKey&&!A.metaKey,I=document.activeElement;if(Q&&I){let Q=A.currentTarget,[C,E]=function(A){let Q=Mn(A);return[Mt(Q,A),Mt(Q.reverse(),A)]}(Q);C&&E?A.shiftKey||I!==E?A.shiftKey&&I===C&&(A.preventDefault(),B&&MK(E,{select:!0})):(A.preventDefault(),B&&MK(C,{select:!0})):I===Q&&A.preventDefault()}},[B,C,h.paused]);return(0,AK.createElement)(AY.div,AU({tabIndex:-1},g,{ref:y,onKeyDown:k}))});function Mn(A){let Q=[],B=document.createTreeWalker(A,NodeFilter.SHOW_ELEMENT,{acceptNode:A=>{let Q="INPUT"===A.tagName&&"hidden"===A.type;return A.disabled||A.hidden||Q?NodeFilter.FILTER_SKIP:A.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;B.nextNode();)Q.push(B.currentNode);return Q}function Mt(A,Q){for(let B of A)if(!function(A,{upTo:Q}){if("hidden"===getComputedStyle(A).visibility)return!0;for(;A&&(void 0===Q||A!==Q);){if("none"===getComputedStyle(A).display)return!0;A=A.parentElement}return!1}(B,{upTo:Q}))return B}function MK(A,{select:Q=!1}={}){if(A&&A.focus){var B;let C=document.activeElement;A.focus({preventScroll:!0}),A!==C&&(B=A)instanceof HTMLInputElement&&"select"in B&&Q&&A.select()}}let ML=(w=[],{add(A){let Q=w[0];A!==Q&&(null==Q||Q.pause()),(w=MU(w,A)).unshift(A)},remove(A){var Q;null===(Q=(w=MU(w,A))[0])||void 0===Q||Q.resume()}});function MU(A,Q){let B=[...A],C=B.indexOf(Q);return -1!==C&&B.splice(C,1),B}let Mi=0;function MG(){(0,AK.useEffect)(()=>{var A,Q;let B=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",null!==(A=B[0])&&void 0!==A?A:Mr()),document.body.insertAdjacentElement("beforeend",null!==(Q=B[1])&&void 0!==Q?Q:Mr()),Mi++,()=>{1===Mi&&document.querySelectorAll("[data-radix-focus-guard]").forEach(A=>A.remove()),Mi--}},[])}function Mr(){let A=document.createElement("span");return A.setAttribute("data-radix-focus-guard",""),A.tabIndex=0,A.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",A}var Mp=function(){return(Mp=Object.assign||function(A){for(var Q,B=1,C=arguments.length;BQ.indexOf(C)&&(B[C]=A[C]);if(null!=A&&"function"==typeof Object.getOwnPropertySymbols)for(var I=0,C=Object.getOwnPropertySymbols(A);IQ.indexOf(C[I])&&Object.prototype.propertyIsEnumerable.call(A,C[I])&&(B[C[I]]=A[C[I]]);return B}function MN(A,Q,B,C){return new(B||(B=Promise))(function(I,E){function g(A){try{D(C.next(A))}catch(A){E(A)}}function w(A){try{D(C.throw(A))}catch(A){E(A)}}function D(A){var Q;A.done?I(A.value):((Q=A.value)instanceof B?Q:new B(function(A){A(Q)})).then(g,w)}D((C=C.apply(A,Q||[])).next())})}function Mo(A,Q){var B,C,I,E,g={label:0,sent:function(){if(1&I[0])throw I[1];return I[1]},trys:[],ops:[]};return E={next:w(0),throw:w(1),return:w(2)},"function"==typeof Symbol&&(E[Symbol.iterator]=function(){return this}),E;function w(w){return function(D){return function(w){if(B)throw TypeError("Generator is already executing.");for(;E&&(E=0,w[0]&&(g=0)),g;)try{if(B=1,C&&(I=2&w[0]?C.return:w[0]?C.throw||((I=C.return)&&I.call(C),0):C.next)&&!(I=I.call(C,w[1])).done)return I;switch(C=0,I&&(w=[2&w[0],I.value]),w[0]){case 0:case 1:I=w;break;case 4:return g.label++,{value:w[1],done:!1};case 5:g.label++,C=w[1],w=[0];continue;case 7:w=g.ops.pop(),g.trys.pop();continue;default:if(!(I=(I=g.trys).length>0&&I[I.length-1])&&(6===w[0]||2===w[0])){g=0;continue}if(3===w[0]&&(!I||w[1]>I[0]&&w[1]0)&&!(C=E.next()).done;)g.push(C.value)}catch(A){I={error:A}}finally{try{C&&!C.done&&(B=E.return)&&B.call(E)}finally{if(I)throw I.error}}return g}function MJ(A,Q,B){if(B||2==arguments.length)for(var C,I=0,E=Q.length;I