@ar.io/sdk 3.8.0 → 3.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +133 -63
- package/bundles/web.bundle.min.js +3 -3
- package/lib/cjs/cli/utils.js +2 -5
- package/lib/cjs/common/ant.js +4 -4
- package/lib/cjs/common/io.js +2 -2
- package/lib/cjs/utils/arweave.js +3 -3
- package/lib/cjs/utils/processes.js +2 -2
- package/lib/cjs/version.js +1 -1
- package/lib/esm/cli/utils.js +2 -5
- package/lib/esm/common/ant.js +4 -4
- package/lib/esm/common/io.js +3 -3
- package/lib/esm/utils/arweave.js +4 -4
- package/lib/esm/utils/processes.js +3 -3
- package/lib/esm/version.js +1 -1
- package/lib/types/cli/utils.d.ts +1 -1
- package/lib/types/common/ant.d.ts +4 -4
- package/lib/types/utils/arweave.d.ts +1 -1
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -131,7 +131,7 @@ Found: ${e.toString().split(`
|
|
|
131
131
|
`)+`
|
|
132
132
|
`)}static register(e,r){if(r||(r=e.locale),S6e)try{let o=window;o._ethers&&o._ethers.wordlists&&(o._ethers.wordlists[r]||hr(o._ethers.wordlists,r,e))}catch{}}};ie();ae();ne();ie();ae();ne();var A6e="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo",Xm=null;function GG(t){if(Xm==null&&(Xm=A6e.replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),Xp.check(t)!=="0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"))throw Xm=null,new Error("BIP39 Wordlist for en (English) FAILED")}var WA=class extends Xp{constructor(){super("en")}getWord(e){return GG(this),Xm[e]}getWordIndex(e){return GG(this),Xm.indexOf(e)}},VA=new WA;Xp.register(VA);var q3={en:VA};ie();ae();ne();var YG="hdnode/5.7.0";var F3=new tr(YG),R6e=rn.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),T6e=Ca("Bitcoin seed"),Qm=2147483648;function XG(t){return(1<<t)-1<<8-t}function I6e(t){return(1<<t)-1}function U3(t){return Ea(fr(t),32)}function JG(t){return HA.encode(Ro([t,_h(Pc(Pc(t)),0,4)]))}function GA(t){if(t==null)return q3.en;if(typeof t=="string"){let e=q3[t];return e==null&&F3.throwArgumentError("unknown locale","wordlist",t),e}return t}var Qp={},Cc="m/44'/60'/0'/0/0",J0=class t{constructor(e,r,o,i,h,c,v,b){if(e!==Qp)throw new Error("HDNode constructor cannot be called directly");if(r){let g=new Eu(r);hr(this,"privateKey",g.privateKey),hr(this,"publicKey",g.compressedPublicKey)}else hr(this,"privateKey",null),hr(this,"publicKey",fr(o));hr(this,"parentFingerprint",i),hr(this,"fingerprint",_h(KA(Pc(this.publicKey)),0,4)),hr(this,"address",xs(this.publicKey)),hr(this,"chainCode",h),hr(this,"index",c),hr(this,"depth",v),b==null?(hr(this,"mnemonic",null),hr(this,"path",null)):typeof b=="string"?(hr(this,"mnemonic",null),hr(this,"path",b)):(hr(this,"mnemonic",b),hr(this,"path",b.path))}get extendedKey(){if(this.depth>=256)throw new Error("Depth too large!");return JG(Ro([this.privateKey!=null?"0x0488ADE4":"0x0488B21E",fr(this.depth),this.parentFingerprint,Ea(fr(this.index),4),this.chainCode,this.privateKey!=null?Ro(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new t(Qp,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw new Error("invalid index - "+String(e));let r=this.path;r&&(r+="/"+(e&~Qm));let o=new Uint8Array(37);if(e&Qm){if(!this.privateKey)throw new Error("cannot derive child of neutered node");o.set(Lt(this.privateKey),1),r&&(r+="'")}else o.set(Lt(this.publicKey));for(let M=24;M>=0;M-=8)o[33+(M>>3)]=e>>24-M&255;let i=Lt(Oc(Y0.sha512,this.chainCode,o)),h=i.slice(0,32),c=i.slice(32),v=null,b=null;this.privateKey?v=U3(rn.from(h).add(this.privateKey).mod(R6e)):b=new Eu(fr(h))._addPoint(this.publicKey);let g=r,_=this.mnemonic;return _&&(g=Object.freeze({phrase:_.phrase,path:r,locale:_.locale||"en"})),new t(Qp,v,b,this.fingerprint,U3(c),e,this.depth+1,g)}derivePath(e){let r=e.split("/");if(r.length===0||r[0]==="m"&&this.depth!==0)throw new Error("invalid path - "+e);r[0]==="m"&&r.shift();let o=this;for(let i=0;i<r.length;i++){let h=r[i];if(h.match(/^[0-9]+'$/)){let c=parseInt(h.substring(0,h.length-1));if(c>=Qm)throw new Error("invalid path index - "+h);o=o._derive(Qm+c)}else if(h.match(/^[0-9]+$/)){let c=parseInt(h);if(c>=Qm)throw new Error("invalid path index - "+h);o=o._derive(c)}else throw new Error("invalid path component - "+h)}return o}static _fromSeed(e,r){let o=Lt(e);if(o.length<16||o.length>64)throw new Error("invalid seed");let i=Lt(Oc(Y0.sha512,T6e,o));return new t(Qp,U3(i.slice(0,32)),null,"0x00000000",U3(i.slice(32)),0,0,r)}static fromMnemonic(e,r,o){return o=GA(o),e=eg(YA(e,o),o),t._fromSeed(k6e(e,r),{phrase:e,path:"m",locale:o.locale})}static fromSeed(e){return t._fromSeed(e,null)}static fromExtendedKey(e){let r=HA.decode(e);(r.length!==82||JG(r.slice(0,78))!==e)&&F3.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");let o=r[4],i=fr(r.slice(5,9)),h=parseInt(fr(r.slice(9,13)).substring(2),16),c=fr(r.slice(13,45)),v=r.slice(45,78);switch(fr(r.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new t(Qp,null,fr(v),i,c,h,o,null);case"0x0488ade4":case"0x04358394 ":if(v[0]!==0)break;return new t(Qp,fr(v.slice(1)),null,i,c,h,o,null)}return F3.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}};function k6e(t,e){e||(e="");let r=Ca("mnemonic"+e,mu.NFKD);return Nc(Ca(t,mu.NFKD),r,2048,64,"sha512")}function YA(t,e){e=GA(e),F3.checkNormalize();let r=e.split(t);if(r.length%3!==0)throw new Error("invalid mnemonic");let o=Lt(new Uint8Array(Math.ceil(11*r.length/8))),i=0;for(let g=0;g<r.length;g++){let _=e.getWordIndex(r[g].normalize("NFKD"));if(_===-1)throw new Error("invalid mnemonic");for(let M=0;M<11;M++)_&1<<10-M&&(o[i>>3]|=1<<7-i%8),i++}let h=32*r.length/3,c=r.length/3,v=XG(c);if((Lt(Pc(o.slice(0,h/8)))[0]&v)!==(o[o.length-1]&v))throw new Error("invalid checksum");return fr(o.slice(0,h/8))}function eg(t,e){if(e=GA(e),t=Lt(t),t.length%4!==0||t.length<16||t.length>32)throw new Error("invalid entropy");let r=[0],o=11;for(let c=0;c<t.length;c++)o>8?(r[r.length-1]<<=8,r[r.length-1]|=t[c],o-=8):(r[r.length-1]<<=o,r[r.length-1]|=t[c]>>8-o,r.push(t[c]&I6e(8-o)),o+=3);let i=t.length/4,h=Lt(Pc(t))[0]&XG(i);return r[r.length-1]<<=i,r[r.length-1]|=h>>8-i,e.join(r.map(c=>e.getWord(c)))}ie();ae();ne();ie();ae();ne();ie();ae();ne();var QG="random/5.7.0";var JA=new tr(QG);function B6e(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}var eY=B6e(),j3=eY.crypto||eY.msCrypto;(!j3||!j3.getRandomValues)&&(JA.warn("WARNING: Missing strong random number source"),j3={getRandomValues:function(t){return JA.throwError("no secure random source avaialble",tr.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});function X0(t){(t<=0||t>1024||t%1||t!=t)&&JA.throwArgumentError("invalid length","length",t);let e=new Uint8Array(t);return j3.getRandomValues(e),Lt(e)}ie();ae();ne();ie();ae();ne();var eR=mi(QA());ie();ae();ne();var z3="json-wallets/5.7.0";ie();ae();ne();function Rh(t){return typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),Lt(t)}function e1(t,e){for(t=String(t);t.length<e;)t="0"+t;return t}function tg(t){return typeof t=="string"?Ca(t,mu.NFKC):Lt(t)}function an(t,e){let r=t,o=e.toLowerCase().split("/");for(let i=0;i<o.length;i++){let h=null;for(let c in r)if(c.toLowerCase()===o[i]){h=r[c];break}if(h===null)return null;r=h}return r}function rY(t){let e=Lt(t);e[6]=e[6]&15|64,e[8]=e[8]&63|128;let r=fr(e);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}var P6e=new tr(z3),tR=class extends Tc{isCrowdsaleAccount(e){return!!(e&&e._isCrowdsaleAccount)}};function rR(t,e){let r=JSON.parse(t);e=tg(e);let o=Aa(an(r,"ethaddr")),i=Rh(an(r,"encseed"));(!i||i.length%16!==0)&&P6e.throwArgumentError("invalid encseed","json",t);let h=Lt(Nc(e,e,2e3,32,"sha256")).slice(0,16),c=i.slice(0,16),v=i.slice(16),b=new eR.default.ModeOfOperation.cbc(h,c),g=eR.default.padding.pkcs7.strip(Lt(b.decrypt(v))),_="";for(let E=0;E<g.length;E++)_+=String.fromCharCode(g[E]);let M=Ca(_),x=tn(M);return new tR({_isCrowdsaleAccount:!0,address:o,privateKey:x})}ie();ae();ne();function iR(t){let e=null;try{e=JSON.parse(t)}catch{return!1}return e.encseed&&e.ethaddr}function nR(t){let e=null;try{e=JSON.parse(t)}catch{return!1}return!(!e.version||parseInt(e.version)!==e.version||parseInt(e.version)!==3)}ie();ae();ne();var Th=mi(QA()),Z3=mi(nY());var O6e=function(t,e,r,o){function i(h){return h instanceof r?h:new r(function(c){c(h)})}return new(r||(r=Promise))(function(h,c){function v(_){try{g(o.next(_))}catch(M){c(M)}}function b(_){try{g(o.throw(_))}catch(M){c(M)}}function g(_){_.done?h(_.value):i(_.value).then(v,b)}g((o=o.apply(t,e||[])).next())})},oR=new tr(z3);function aY(t){return t!=null&&t.mnemonic&&t.mnemonic.phrase}var sR=class extends Tc{isKeystoreAccount(e){return!!(e&&e._isKeystoreAccount)}};function N6e(t,e,r){if(an(t,"crypto/cipher")==="aes-128-ctr"){let i=Rh(an(t,"crypto/cipherparams/iv")),h=new Th.default.Counter(i),c=new Th.default.ModeOfOperation.ctr(e,h);return Lt(c.decrypt(r))}return null}function oY(t,e){let r=Rh(an(t,"crypto/ciphertext"));if(fr(tn(Ro([e.slice(16,32),r]))).substring(2)!==an(t,"crypto/mac").toLowerCase())throw new Error("invalid password");let i=N6e(t,e.slice(0,16),r);i||oR.throwError("unsupported cipher",tr.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});let h=e.slice(32,64),c=xs(i);if(t.address){let b=t.address.toLowerCase();if(b.substring(0,2)!=="0x"&&(b="0x"+b),Aa(b)!==c)throw new Error("address mismatch")}let v={_isKeystoreAccount:!0,address:c,privateKey:fr(i)};if(an(t,"x-ethers/version")==="0.1"){let b=Rh(an(t,"x-ethers/mnemonicCiphertext")),g=Rh(an(t,"x-ethers/mnemonicCounter")),_=new Th.default.Counter(g),M=new Th.default.ModeOfOperation.ctr(h,_),x=an(t,"x-ethers/path")||Cc,E=an(t,"x-ethers/locale")||"en",A=Lt(M.decrypt(b));try{let I=eg(A,E),P=J0.fromMnemonic(I,null,E).derivePath(x);if(P.privateKey!=v.privateKey)throw new Error("mnemonic mismatch");v.mnemonic=P.mnemonic}catch(I){if(I.code!==tr.errors.INVALID_ARGUMENT||I.argument!=="wordlist")throw I}}return new sR(v)}function sY(t,e,r,o,i){return Lt(Nc(t,e,r,o,i))}function C6e(t,e,r,o,i){return Promise.resolve(sY(t,e,r,o,i))}function fY(t,e,r,o,i){let h=tg(e),c=an(t,"crypto/kdf");if(c&&typeof c=="string"){let v=function(b,g){return oR.throwArgumentError("invalid key-derivation function parameters",b,g)};if(c.toLowerCase()==="scrypt"){let b=Rh(an(t,"crypto/kdfparams/salt")),g=parseInt(an(t,"crypto/kdfparams/n")),_=parseInt(an(t,"crypto/kdfparams/r")),M=parseInt(an(t,"crypto/kdfparams/p"));(!g||!_||!M)&&v("kdf",c),(g&g-1)!==0&&v("N",g);let x=parseInt(an(t,"crypto/kdfparams/dklen"));return x!==32&&v("dklen",x),o(h,b,g,_,M,64,i)}else if(c.toLowerCase()==="pbkdf2"){let b=Rh(an(t,"crypto/kdfparams/salt")),g=null,_=an(t,"crypto/kdfparams/prf");_==="hmac-sha256"?g="sha256":_==="hmac-sha512"?g="sha512":v("prf",_);let M=parseInt(an(t,"crypto/kdfparams/c")),x=parseInt(an(t,"crypto/kdfparams/dklen"));return x!==32&&v("dklen",x),r(h,b,M,x,g)}}return oR.throwArgumentError("unsupported key-derivation function","kdf",c)}function uY(t,e){let r=JSON.parse(t),o=fY(r,e,sY,Z3.default.syncScrypt);return oY(r,o)}function hY(t,e,r){return O6e(this,void 0,void 0,function*(){let o=JSON.parse(t),i=yield fY(o,e,C6e,Z3.default.scrypt,r);return oY(o,i)})}function fR(t,e,r,o){try{if(Aa(t.address)!==xs(t.privateKey))throw new Error("address/privateKey mismatch");if(aY(t)){let P=t.mnemonic;if(J0.fromMnemonic(P.phrase,null,P.locale).derivePath(P.path||Cc).privateKey!=t.privateKey)throw new Error("mnemonic mismatch")}}catch(P){return Promise.reject(P)}typeof r=="function"&&!o&&(o=r,r={}),r||(r={});let i=Lt(t.privateKey),h=tg(e),c=null,v=null,b=null;if(aY(t)){let P=t.mnemonic;c=Lt(YA(P.phrase,P.locale||"en")),v=P.path||Cc,b=P.locale||"en"}let g=r.client;g||(g="ethers.js");let _=null;r.salt?_=Lt(r.salt):_=X0(32);let M=null;if(r.iv){if(M=Lt(r.iv),M.length!==16)throw new Error("invalid iv")}else M=X0(16);let x=null;if(r.uuid){if(x=Lt(r.uuid),x.length!==16)throw new Error("invalid uuid")}else x=X0(16);let E=1<<17,A=8,I=1;return r.scrypt&&(r.scrypt.N&&(E=r.scrypt.N),r.scrypt.r&&(A=r.scrypt.r),r.scrypt.p&&(I=r.scrypt.p)),Z3.default.scrypt(h,_,E,A,I,64,o).then(P=>{P=Lt(P);let N=P.slice(0,16),L=P.slice(16,32),C=P.slice(32,64),Y=new Th.default.Counter(M),G=new Th.default.ModeOfOperation.ctr(N,Y),te=Lt(G.encrypt(i)),$=tn(Ro([L,te])),F={address:t.address.substring(2).toLowerCase(),id:rY(x),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:fr(M).substring(2)},ciphertext:fr(te).substring(2),kdf:"scrypt",kdfparams:{salt:fr(_).substring(2),n:E,dklen:32,p:I,r:A},mac:$.substring(2)}};if(c){let V=X0(16),w=new Th.default.Counter(V),n=new Th.default.ModeOfOperation.ctr(C,w),s=Lt(n.encrypt(c)),f=new Date,u=f.getUTCFullYear()+"-"+e1(f.getUTCMonth()+1,2)+"-"+e1(f.getUTCDate(),2)+"T"+e1(f.getUTCHours(),2)+"-"+e1(f.getUTCMinutes(),2)+"-"+e1(f.getUTCSeconds(),2)+".0Z";F["x-ethers"]={client:g,gethFilename:"UTC--"+u+"--"+F.address,mnemonicCounter:fr(V).substring(2),mnemonicCiphertext:fr(s).substring(2),path:v,locale:b,version:"0.1"}}return JSON.stringify(F)})}function lY(t,e,r){if(iR(t)){r&&r(0);let o=rR(t,e);return r&&r(1),Promise.resolve(o)}return nR(t)?hY(t,e,r):Promise.reject(new Error("invalid JSON wallet"))}function cY(t,e){if(iR(t))return rR(t,e);if(nR(t))return uY(t,e);throw new Error("invalid JSON wallet")}ie();ae();ne();var dY="wallet/5.7.0";var pY=function(t,e,r,o){function i(h){return h instanceof r?h:new r(function(c){c(h)})}return new(r||(r=Promise))(function(h,c){function v(_){try{g(o.next(_))}catch(M){c(M)}}function b(_){try{g(o.throw(_))}catch(M){c(M)}}function g(_){_.done?h(_.value):i(_.value).then(v,b)}g((o=o.apply(t,e||[])).next())})},t1=new tr(dY);function L6e(t){return t!=null&&Dn(t.privateKey,32)&&t.address!=null}function D6e(t){let e=t.mnemonic;return e&&e.phrase}var r1=class t extends D3{constructor(e,r){if(super(),L6e(e)){let o=new Eu(e.privateKey);if(hr(this,"_signingKey",()=>o),hr(this,"address",xs(this.publicKey)),this.address!==Aa(e.address)&&t1.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),D6e(e)){let i=e.mnemonic;hr(this,"_mnemonic",()=>({phrase:i.phrase,path:i.path||Cc,locale:i.locale||"en"}));let h=this.mnemonic,c=J0.fromMnemonic(h.phrase,null,h.locale).derivePath(h.path);xs(c.privateKey)!==this.address&&t1.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else hr(this,"_mnemonic",()=>null)}else{if(Eu.isSigningKey(e))e.curve!=="secp256k1"&&t1.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),hr(this,"_signingKey",()=>e);else{typeof e=="string"&&e.match(/^[0-9a-f]*$/i)&&e.length===64&&(e="0x"+e);let o=new Eu(e);hr(this,"_signingKey",()=>o)}hr(this,"_mnemonic",()=>null),hr(this,"address",xs(this.publicKey))}r&&!L3.isProvider(r)&&t1.throwArgumentError("invalid provider","provider",r),hr(this,"provider",r||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(e){return new t(this,e)}signTransaction(e){return xh(e).then(r=>{r.from!=null&&(Aa(r.from)!==this.address&&t1.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete r.from);let o=this._signingKey().signDigest(tn(ZA(r)));return ZA(r,o)})}signMessage(e){return pY(this,void 0,void 0,function*(){return gA(this._signingKey().signDigest(K0(e)))})}_signTypedData(e,r,o){return pY(this,void 0,void 0,function*(){let i=yield Ic.resolveNames(e,r,o,h=>(this.provider==null&&t1.throwError("cannot resolve ENS names without a provider",tr.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:h}),this.provider.resolveName(h)));return gA(this._signingKey().signDigest(Ic.hash(i.domain,r,i.value)))})}encrypt(e,r,o){if(typeof r=="function"&&!o&&(o=r,r={}),o&&typeof o!="function")throw new Error("invalid callback");return r||(r={}),fR(this,e,r,o)}static createRandom(e){let r=X0(16);e||(e={}),e.extraEntropy&&(r=Lt(_h(tn(Ro([r,e.extraEntropy])),0,16)));let o=eg(r,e.locale);return t.fromMnemonic(o,e.path,e.locale)}static fromEncryptedJson(e,r,o){return lY(e,r,o).then(i=>new t(i))}static fromEncryptedJsonSync(e,r){return new t(cY(e,r))}static fromMnemonic(e,r,o){return r||(r=Cc),new t(J0.fromMnemonic(e,null,o).derivePath(r))}};function vY(t,e){return zA(K0(t),e)}function H3(t,e,r,o){return zA(Ic.hash(t,e,r),o)}var uR=class{signer;publicKey;ownerLength=Kr[wr.ETHEREUM].pubLength;signatureLength=Kr[wr.ETHEREUM].sigLength;signatureType=wr.ETHEREUM;constructor(e){this.signer=e.getSigner()}async setPublicKey(){let e="sign this message to connect to Bundlr.Network",r=await this.signer.signMessage(e),o=await K0(e),i=C3(Lt(o),r);this.publicKey=Se.from(Lt(i))}async sign(e){this.publicKey||await this.setPublicKey();let r=await this.signer.signMessage(e);return Se.from(r.slice(2),"hex")}static verify(e,r,o){let i=xs(e);return vY(r,o)===i}};ie();ae();ne();var i1=mi(_Y(),1),Ih=class extends So{get publicKey(){return i1.default.decode(this.pk)}get key(){return i1.default.decode(this._key)}constructor(e){let r=i1.default.decode(e);super(i1.default.encode(r.subarray(0,32)),i1.default.encode(r.subarray(32,64)))}};ie();ae();ne();ie();ae();ne();ie();ae();ne();var FX=mi(Uo(),1),nT=mi(IR(),1);ie();ae();ne();Wa();var NX=mi(OX(),1);function iT(t){return t=CX(t),(0,NX.default)("keccak256").update(t).digest()}function CX(t){if(!Se.isBuffer(t))if(Array.isArray(t))t=Se.from(t);else if(typeof t=="string")LX(t)?t=Se.from(x8(DX(t)),"hex"):t=Se.from(t);else if(typeof t=="number")t=qX(t);else if(typeof t=="bigint")t=e4e(t);else if(t==null)t=Se.allocUnsafe(0);else throw new Error("invalid type");return t}function LX(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}function x8(t){if(typeof t!="string")throw new Error(`while padding to even, value must be string, is currently ${typeof t}, while padToEven.`);return t.length%2&&(t=`0${t}`),t}function DX(t){return typeof t!="string"?t:$X(t)?t.slice(2):t}function $X(t){if(typeof t!="string")throw new Error("value must be type 'string', is currently type "+typeof t+", while checking isHexPrefixed.");return t.startsWith("0x")}function qX(t){let e=UX(t);return Se.from(x8(e.slice(2)),"hex")}function UX(t){return`0x${t.toString(16)}`}function e4e(t){let e=t.toString(16);return Se.from(x8(e),"hex")}typeof window<"u"&&(window.keccak256=iT);var dg=iT,t4e={intToBuffer:qX,intToHex:UX,isHexPrefixed:$X,stripHexPrefix:DX,padToEven:x8,isHexString:LX,toBuffer:CX};var Yc=class{_key;ownerLength=Kr[wr.ETHEREUM].pubLength;signatureLength=Kr[wr.ETHEREUM].sigLength;signatureType=wr.ETHEREUM;pk;constructor(e,r){this._key=e,this.pk=r.toString("hex")}get publicKey(){throw new Error("You must implement `publicKey`")}get key(){return Se.from(this._key,"hex")}static async verify(e,r,o){let i=e;typeof e=="string"&&(i=FX.default.toBuffer(e));let h=!1;try{h=nT.default.ecdsaVerify(o,dg(Se.from(r)),i)}catch{}return h}async sign(e){return nT.default.ecdsaSign(dg(Se.from(e)),Se.from(this.key)).signature}};var aT=mi(IR(),1),jX=mi(Uo(),1);var Bo=class extends Yc{get publicKey(){return Se.from(this.pk,"hex")}constructor(e){e.startsWith("0x")&&(e=e.slice(2));let r=Se.from(e,"hex"),o=aT.default.publicKeyCreate(r,!1);super(e,Se.from(o))}async sign(e){return new r1(this._key).signMessage(e).then(o=>Se.from(o.slice(2),"hex"))}static async verify(e,r,o){return aT.default.ecdsaVerify(o.length===65?o.slice(0,-1):o,Lt(K0(r)),typeof e=="string"?jX.default.toBuffer(e):e)}};var pg=class extends Bo{};ie();ae();ne();var vg=class extends Ih{constructor(e){super(e.replace("ed25519:",""))}};ie();ae();ne();var mg=class extends So{get publicKey(){return Se.from(this.pk)}get key(){return Se.from(this._key)}constructor(e,r){super(e.subarray(0,32),r)}};ie();ae();ne();var Jc=class extends Ac{signatureType=4;constructor(e){super(e)}async sign(e){return super.sign(Se.from(Se.from(e).toString("hex")))}static async verify(e,r,o){return super.verify(e,Se.from(Se.from(r).toString("hex")),o)}};ie();ae();ne();var gg=class extends Ih{signatureType=4;constructor(e){super(e)}async sign(e){return super.sign(Se.from(Se.from(e).toString("hex")))}static async verify(e,r,o){return super.verify(e,Se.from(Se.from(r).toString("hex")),o)}};ie();ae();ne();var bg=class extends So{constructor(e,r){super(e,r)}get publicKey(){return Se.from(this.pk.slice(2),"hex")}get key(){return Se.from(this._key.slice(2),"hex")}};ie();ae();ne();var Xc=class{_publicKey;ownerLength=Kr[wr.INJECTEDAPTOS].pubLength;signatureLength=Kr[wr.INJECTEDAPTOS].sigLength;signatureType=wr.INJECTEDAPTOS;pem;provider;constructor(e,r){this.provider=e,this._publicKey=r}get publicKey(){return this._publicKey}async sign(e){if(!this.provider.signMessage)throw new Error("Selected Wallet does not support message signing");let o=(await this.provider.signMessage({message:Se.from(e).toString("hex"),nonce:"bundlr"})).signature;return typeof o=="string"?Se.from(o,"hex"):o.data.toUint8Array()}static async verify(e,r,o){let i=e;return D0(Se.from(o),Se.from(`APTOS
|
|
133
133
|
message: ${Se.from(r).toString("hex")}
|
|
134
|
-
nonce: bundlr`),Se.from(i))}};ie();ae();ne();var Qc=class{_publicKey;ownerLength=Kr[wr.MULTIAPTOS].pubLength;signatureLength=Kr[wr.MULTIAPTOS].sigLength;signatureType=wr.MULTIAPTOS;collectSignatures;provider;constructor(e,r){this._publicKey=e,this.collectSignatures=r}get publicKey(){return this._publicKey}async sign(e){let{signatures:r,bitmap:o}=await this.collectSignatures(e),i=128,h=new Uint8Array([0,0,0,0]),c=new Set;o.forEach(g=>{if(g>=32)throw new Error(`Invalid bit value ${g}.`);if(c.has(g))throw new Error("Duplicated bits detected.");c.add(g);let _=Math.floor(g/8),M=h[_];M|=i>>g%8,h[_]=M});let v=Se.alloc(this.signatureLength),b=0;for(let g=0;g<32;g++)o.includes(g)&&v.set(r[b++],g*64);return v.set(h,this.signatureLength-4),v}static async verify(e,r,o){let h=Kr[wr.MULTIAPTOS].sigLength-4,c=o.slice(0,h),v=o.slice(h),b=!1;for(let g=0;g<32;g++){let _=Math.floor(g/8),M=g-_*8;if((v[_]&128>>M)!==0){let E=c.slice(g*64,(g+1)*64),A=e.slice(g*32,(g+1)*32);await D0(Se.from(E),Se.from(r),Se.from(A))||(b=!0)}}return!b}};ie();ae();ne();var ed=class extends Bo{ownerLength=Kr[wr.TYPEDETHEREUM].pubLength;signatureLength=Kr[wr.TYPEDETHEREUM].sigLength;signatureType=wr.TYPEDETHEREUM;address;signer;constructor(e){super(e),this.address="0x"+dg(super.publicKey.slice(1)).slice(-20).toString("hex"),this.signer=new r1(e)}get publicKey(){return Se.from(this.address)}async sign(e){let r=await this.signer._signTypedData(yg,wg,{address:this.address,"Transaction hash":e});return Se.from(r.slice(2),"hex")}static async verify(e,r,o){let i=e.toString(),h=H3(yg,wg,{address:i,"Transaction hash":r},o);return i.toLowerCase()===h.toLowerCase()}},yg={name:"Bundlr",version:"1"},wg={Bundlr:[{name:"Transaction hash",type:"bytes"},{name:"address",type:"address"}]};ie();ae();ne();var oT=class{ownerLength=Kr[wr.TYPEDETHEREUM].pubLength;signatureLength=Kr[wr.TYPEDETHEREUM].sigLength;signatureType=wr.TYPEDETHEREUM;address;signer;publicKey;constructor(e){this.signer=e.getSigner()}async ready(){this.address=(await this.signer.getAddress()).toString().toLowerCase(),this.publicKey=Se.from(this.address)}async sign(e){let r=await this.signer._signTypedData(yg,wg,{address:this.address,"Transaction hash":e});return Se.from(r.slice(2),"hex")}static verify(e,r,o){let i=e.toString(),h=H3(yg,wg,{address:i,"Transaction hash":r},o);return i.toLowerCase()===h.toLowerCase()}};ie();ae();ne();var zX=mi(Uo(),1);var ul=class{signer;publicKey;ownerLength=Kr[wr.ARWEAVE].pubLength;signatureLength=Kr[wr.ARWEAVE].sigLength;signatureType=wr.ARWEAVE;constructor(e){this.signer=e}async setPublicKey(){let e=await this.signer.getActivePublicKey();this.publicKey=zX.default.toBuffer(e)}async sign(e){this.publicKey||await this.setPublicKey();let r={name:"RSA-PSS",saltLength:32},o=await this.signer.signature(e,r);return new Uint8Array(Object.values(o).map(h=>+h))}static async verify(e,r,o){return await xn().verify(e,r,o)}};ie();ae();ne();var _g=class extends Bo{signatureType=wr.KYVE};var Mg={1:z0,2:So,3:Bo,4:Jc,5:Xc,6:Qc,7:ed};ie();ae();ne();ie();ae();ne();async function r4e(t){return $0([(0,Bi.stringToBuffer)("dataitem"),(0,Bi.stringToBuffer)("1"),(0,Bi.stringToBuffer)(t.signatureType.toString()),t.rawOwner,t.rawTarget,t.rawAnchor,t.rawTags,t.rawData])}var xg=r4e;ie();ae();ne();ie();ae();ne();function Sg(t,e){let r=new Uint8Array(t);if(e<0)throw new Error("Array is unsigned, cannot represent -ve numbers");if(e>2**(t*8)-1)throw new Error(`Number ${e} is too large for an array of ${t} bytes`);for(let o=0;o<r.length;o++){let i=e&255;r[o]=i,e=(e-i)/256}return r}function S8(t){return Sg(8,t)}function sT(t){return Sg(2,t)}function i4e(t){return Sg(16,t)}function E8(t){return Sg(32,t)}function bn(t){let e=0;for(let r=t.length-1;r>=0;r--)e=e*256+t[r];return e}ie();ae();ne();var Ag=mi(Uo(),1);ie();ae();ne();var ks=mi(Uo(),1);Wa();ie();ae();ne();var Eg=class{buf;pos;constructor(e=Se.alloc(A8),r=0){this.buf=e,this.pos=r}writeTags(e){if(!Array.isArray(e))throw new Error("input must be array");let r=e.length,o;if(r)for(this.writeLong(r),o=0;o<r;o++){let i=e[o];if(typeof i?.name!="string"||typeof i?.value!="string")throw new Error(`Invalid tag format for ${i}, expected {name:string, value: string}`);this.writeString(i.name),this.writeString(i.value)}this.writeLong(0)}toBuffer(){let e=Se.alloc(this.pos);if(this.pos>this.buf.length)throw new Error(`Too many tag bytes (${this.pos} > ${this.buf.length})`);return this.buf.copy(e,0,0,this.pos),e}writeLong(e){let r=this.buf,o,i;if(e>=-1073741824&&e<1073741824){i=e>=0?e<<1:~e<<1|1;do r[this.pos]=i&127,i>>=7;while(i&&(r[this.pos++]|=128))}else{o=e>=0?e*2:-e*2-1;do r[this.pos]=o&127,o/=128;while(o>=1&&(r[this.pos++]|=128))}this.pos++,this.buf=r}writeString(e){let r=Se.byteLength(e),o=this.buf;this.writeLong(r);let i=this.pos;if(this.pos+=r,!(this.pos>o.length)){if(r>64)this.buf.write(e,this.pos-r,r,"utf8");else{let h,c,v,b;for(h=0,c=r;h<c;h++)v=e.charCodeAt(h),v<128?o[i++]=v:v<2048?(o[i++]=v>>6|192,o[i++]=v&63|128):(v&64512)===55296&&((b=e.charCodeAt(h+1))&64512)===56320?(v=65536+((v&1023)<<10)+(b&1023),h++,o[i++]=v>>18|240,o[i++]=v>>12&63|128,o[i++]=v>>6&63|128,o[i++]=v&63|128):(o[i++]=v>>12|224,o[i++]=v>>6&63|128,o[i++]=v&63|128)}this.buf=o}}readLong(){let e=0,r=0,o=this.buf,i,h,c,v;do i=o[this.pos++],h=i&128,e|=(i&127)<<r,r+=7;while(h&&r<28);if(h){c=e,v=268435456;do i=o[this.pos++],c+=(i&127)*v,v*=128;while(i&128);return(c%2?-(c+1):c)/2}return e>>1^-(e&1)}skipLong(){let e=this.buf;for(;e[this.pos++]&128;);}readTags(){let e=[],r;for(;r=this.readLong();)for(r<0&&(r=-r,this.skipLong());r--;){let o=this.readString(),i=this.readString();e.push({name:o,value:i})}return e}readString(){let e=this.readLong(),r=this.pos,o=this.buf;if(this.pos+=e,this.pos>o.length)throw new Error("TAP Position out of range");return this.buf.slice(r,r+e).toString()}};function fT(t){if(t?.length===0)return Se.allocUnsafe(0);let e=new Eg;return e.writeTags(t),e.toBuffer()}function v1(t){return new Eg(t).readTags()}cu();var R8=80,A8=4096,m1=class t{binary;_id;constructor(e){this.binary=e}static isDataItem(e){return e.binary!==void 0}get signatureType(){let e=bn(this.binary.subarray(0,2));if(wr?.[e]!==void 0)return e;throw new Error("Unknown signature type: "+e)}async isValid(){return t.verify(this.binary)}get id(){return ks.default.encode(this.rawId)}set id(e){this._id=ks.default.toBuffer(e)}get rawId(){return cf("sha256").update(this.rawSignature).digest()}set rawId(e){this._id=e}get rawSignature(){return this.binary.subarray(2,2+this.signatureLength)}get signature(){return ks.default.encode(this.rawSignature)}set rawOwner(e){if(e.byteLength!=this.ownerLength)throw new Error(`Expected raw owner (pubkey) to be ${this.ownerLength} bytes, got ${e.byteLength} bytes.`);this.binary.set(e,2+this.signatureLength)}get rawOwner(){return this.binary.subarray(2+this.signatureLength,2+this.signatureLength+this.ownerLength)}get signatureLength(){return Kr[this.signatureType].sigLength}get owner(){return ks.default.encode(this.rawOwner)}get ownerLength(){return Kr[this.signatureType].pubLength}get rawTarget(){let e=this.getTargetStart();return this.binary[e]==1?this.binary.subarray(e+1,e+33):Se.alloc(0)}get target(){return ks.default.encode(this.rawTarget)}get rawAnchor(){let e=this.getAnchorStart();return this.binary[e]==1?this.binary.subarray(e+1,e+33):Se.alloc(0)}get anchor(){return ks.default.encode(this.rawAnchor)}get rawTags(){let e=this.getTagsStart(),r=bn(this.binary.subarray(e+8,e+16));return this.binary.subarray(e+16,e+16+r)}get tags(){let e=this.getTagsStart();if(bn(this.binary.subarray(e,e+8))==0)return[];let o=bn(this.binary.subarray(e+8,e+16));return v1(Se.from(this.binary.subarray(e+16,e+16+o)))}get tagsB64Url(){return this.tags.map(r=>({name:ks.default.encode(r.name),value:ks.default.encode(r.value)}))}getStartOfData(){let e=this.getTagsStart(),r=this.binary.subarray(e+8,e+16),o=bn(r);return e+16+o}get rawData(){let e=this.getTagsStart(),r=this.binary.subarray(e+8,e+16),o=bn(r),i=e+16+o;return this.binary.subarray(i,this.binary.length)}get data(){return ks.default.encode(this.rawData)}getRaw(){return this.binary}async sign(e){return this._id=await T8(this,e),this.rawId}async setSignature(e){this.binary.set(e,2),this._id=Se.from(await xn().hash(e))}isSigned(){return(this._id?.length??0)>0}toJSON(){return{signature:this.signature,owner:this.owner,target:this.target,tags:this.tags.map(e=>({name:ks.default.encode(e.name),value:ks.default.encode(e.value)})),data:this.data}}static async verify(e){if(e.byteLength<R8)return!1;let r=new t(e),o=r.signatureType,i=r.getTagsStart(),h=bn(e.subarray(i,i+8)),c=e.subarray(i+8,i+16),v=bn(c);if(v>A8)return!1;if(h>0)try{if(v1(Se.from(e.subarray(i+16,i+16+v))).length!==h)return!1}catch{return!1}let b=Mg[o],g=await xg(r);return await b.verify(r.rawOwner,g,r.rawSignature)}async getSignatureData(){return xg(this)}getTagsStart(){let e=this.getTargetStart(),r=this.binary[e]==1,o=e+(r?33:1),i=this.binary[o]==1;return o+=i?33:1,o}getTargetStart(){return 2+this.signatureLength+this.ownerLength}getAnchorStart(){let e=this.getTargetStart()+1,r=this.binary[this.getTargetStart()]==1;return e+=r?32:0,e}},g1=m1;cu();var Bu=32,I8=class{length;items;binary;constructor(e){this.binary=e,this.length=this.getDataItemCount(),this.items=this.getItems()}getRaw(){return this.binary}get(e){if(typeof e=="number"){if(e>=this.length)throw new RangeError("Index out of range");return this.getByIndex(e)}else return this.getById(e)}getSizes(){let e=[];for(let r=Bu;r<Bu+64*this.length;r+=64)e.push(bn(this.binary.subarray(r,r+32)));return e}getIds(){let e=[];for(let r=Bu;r<Bu+64*this.length;r+=64){let o=this.binary.subarray(r+32,r+64);if(o.length===0)throw new Error("Invalid bundle, id specified in headers doesn't exist");e.push(Ag.default.encode(o))}return e}getIdBy(e){if(e>this.length-1)throw new RangeError("Index of bundle out of range");let r=64+64*e;return Ag.default.encode(this.binary.subarray(r,r+32))}async toTransaction(e,r,o){let i=await r.createTransaction({data:this.binary,...e},o);return i.addTag("Bundle-Format","binary"),i.addTag("Bundle-Version","2.0.0"),i}async verify(){for(let e of this.items){let r=await e.isValid(),o=(0,Ag.default)(cf("sha256").update(e.rawSignature).digest());if(!(r&&e.id===o))return!1}return!0}getOffset(e){let r=0;for(let o=Bu;o<Bu+64*this.length;o+=64){let i=bn(this.binary.subarray(o,o+32));r+=i;let h=this.binary.subarray(o+32,o+64);if(Se.compare(h,e)===0)return{startOffset:r,size:i}}return{startOffset:-1,size:-1}}getByIndex(e){let r=0,o=this.getBundleStart(),i=0,h,c;for(let _=Bu;_<Bu+64*this.length;_+=64){if(h=bn(this.binary.subarray(_,_+32)),i++===e){c=this.binary.subarray(_+32,_+64);break}r+=h}let v=o+r,b=this.binary.subarray(v,v+h),g=new g1(b);return g.rawId=c,g}getById(e){let r=Ag.default.toBuffer(e),o=this.getOffset(r);if(o.startOffset===-1)throw new Error("Transaction not found");let h=this.getBundleStart()+o.startOffset;return new g1(this.binary.subarray(h,h+o.size))}getDataItemCount(){return bn(this.binary.subarray(0,32))}getBundleStart(){return 32+64*this.length}getItems(){let e=new Array(this.length),r=0,o=this.getBundleStart(),i=0;for(let h=Bu;h<Bu+64*this.length;h+=64){let c=bn(this.binary.subarray(h,h+32)),v=this.binary.subarray(h+32,h+64);if(v.length===0)throw new Error("Invalid bundle, id specified in headers doesn't exist");let b=o+r,g=this.binary.subarray(b,b+c);r+=c;let _=new g1(g);_.rawId=v,e[i]=_,i++}return e}},uT=I8;function n4e(t){return new uT(t)}async function a4e(t,e){let r=new Uint8Array(64*t.length),o=await Promise.all(t.map(async(h,c)=>{let v=h.isSigned()?h.rawId:await T8(h,e),b=new Uint8Array(64);return b.set(E8(h.getRaw().byteLength),0),b.set(v,32),r.set(b,64*c),h.getRaw()})).then(h=>Se.concat(h)),i=Se.concat([Se.from(E8(t.length)),Se.from(r),o]);return new uT(i)}async function ZX(t,e){let r=await xg(t),o=await e.sign(r),i=await xn().hash(o);return{signature:Se.from(o),id:Se.from(i)}}async function T8(t,e){let{signature:r,id:o}=await ZX(t,e);return t.getRaw().set(r,2),o}ie();ae();ne();var HX=mi(Uo(),1);function Rg(t,e,r){let o=e.publicKey,i=r?.target?HX.default.toBuffer(r.target):null,h=1+(i?.byteLength??0),c=r?.anchor?Se.from(r.anchor):null,v=1+(c?.byteLength??0),b=(r?.tags?.length??0)>0?fT(r?.tags):null,g=16+(b?b.byteLength:0),_=typeof t=="string"?Se.from(t):Se.from(t),M=_.byteLength,x=2+e.signatureLength+e.ownerLength+h+v+g+M,E=Se.alloc(x);if(E.set(sT(e.signatureType),0),E.set(new Uint8Array(e.signatureLength).fill(0),2),o.byteLength!==e.ownerLength)throw new Error(`Owner must be ${e.ownerLength} bytes, but was incorrectly ${o.byteLength}`);E.set(o,2+e.signatureLength);let A=2+e.signatureLength+e.ownerLength;if(E[A]=i?1:0,i){if(i.byteLength!==32)throw new Error(`Target must be 32 bytes but was incorrectly ${i.byteLength}`);E.set(i,A+1)}let I=A+h,P=I+1;if(E[I]=c?1:0,c){if(P+=c.byteLength,c.byteLength!==32)throw new Error("Anchor must be 32 bytes");E.set(c,I+1)}E.set(S8(r?.tags?.length??0),P);let N=S8(b?.byteLength??0);E.set(N,P+8),b&&E.set(b,P+16);let L=P+g;return E.set(_,L),new g1(E)}ie();ae();ne();ie();ae();ne();var hT=class{signatureType;rawSignature;signature;signatureLength;rawOwner;owner;ownerLength;rawTarget;target;rawAnchor;anchor;rawTags;tags;rawData;data;static async verify(...e){throw new Error("You must implement `verify`")}};ie();ae();ne();ie();ae();ne();var pT={};Ka(pT,{default:()=>f4e,processStream:()=>YX,streamExportForTesting:()=>u4e,streamSigner:()=>s4e});ie();ae();ne();k8();var td=mi(Uo(),1);cu();async function YX(t){let e=JX(t),r=(await e.next()).value;r=await La(e,r,32);let o=bn(r.subarray(0,32));r=r.subarray(32);let i=64*o;r=await La(e,r,i);let h=new Array(o);for(let b=0;b<i;b+=64)h[b/64]=[bn(r.subarray(b,b+32)),(0,td.default)(Se.from(r.subarray(b+32,b+64)))];r=r.subarray(i);let c=32+i,v=[];for(let[b,g]of h){r=await La(e,r,R8),r=await La(e,r,2);let _=bn(r.subarray(0,2));r=r.subarray(2);let{sigLength:M,pubLength:x,sigName:E}=Kr[_];r=await La(e,r,M);let A=r.subarray(0,M);r=r.subarray(M),r=await La(e,r,x);let I=r.subarray(0,x);r=r.subarray(x),r=await La(e,r,1);let P=r[0]===1;P&&(r=await La(e,r,33));let N=P?r.subarray(1,33):Se.allocUnsafe(0);r=r.subarray(P?33:1),r=await La(e,r,1);let L=r[0]===1;L&&(r=await La(e,r,33));let C=L?r.subarray(1,33):Se.allocUnsafe(0);r=r.subarray(L?33:1),r=await La(e,r,8);let Y=bn(r.subarray(0,8));r=r.subarray(8),r=await La(e,r,8);let G=bn(r.subarray(0,8));r=r.subarray(8),r=await La(e,r,G);let te=r.subarray(0,G),$=Y!==0&&G!==0?v1(Se.from(te)):[];if($.length!==Y)throw new Error("Tags lengths don't match");r=r.subarray(G);let F=new VX;F._transform=function(f,u,l){this.push(f),l()};let V=$0([(0,Bi.stringToBuffer)("dataitem"),(0,Bi.stringToBuffer)("1"),(0,Bi.stringToBuffer)(_.toString()),I,N,C,te,F]),w=2+M+x+(P?33:1)+(L?33:1)+16+G,n=b-w;if(r.byteLength>n)F.write(r.subarray(0,n)),r=r.subarray(n);else{let f=r.byteLength;for(F.write(r);n>f;){if(r=(await e.next()).value,!r)throw new Error(`Not enough data bytes expected: ${n} received: ${f}`);f+=r.byteLength,f>n?F.write(r.subarray(0,r.byteLength-(f-n))):F.write(r)}r=r.subarray(r.byteLength-(f-n))}if(F.end(),g!==(0,td.default)(cf("sha256").update(A).digest()))throw new Error("ID doesn't match signature");if(!await Mg[_].verify(I,await V,A))throw new Error("Invalid signature");v.push({id:g,sigName:E,signature:(0,td.default)(Se.from(A)),target:(0,td.default)(Se.from(N)),anchor:(0,td.default)(Se.from(C)),owner:(0,td.default)(Se.from(I)),tags:$,dataOffset:c+w,dataSize:n}),c+=w+n}return v}async function s4e(t,e,r,o){let i=Rg("",r,o),h=new GX,c=[(0,Bi.stringToBuffer)("dataitem"),(0,Bi.stringToBuffer)("1"),(0,Bi.stringToBuffer)(i.signatureType.toString()),i.rawOwner,i.rawTarget,i.rawAnchor,i.rawTags,t],v=await $0(c),b=Se.from(await r.sign(v));return i.setSignature(b),h.write(i.getRaw()),e.pipe(h)}async function La(t,e,r){if(e.byteLength>=r)return e;let{done:o,value:i}=await t.next();if(o&&!i)throw new Error("Invalid buffer");return La(t,Se.concat([Se.from(e),Se.from(i)]),r)}async function*JX(t){for await(let e of t)yield e}var f4e=YX,u4e={readBytes:La,getReader:JX};var h4e={...lT,stream:pT};globalThis.arbundles??=h4e;ie();ae();ne();ie();ae();ne();ie();ae();ne();ie();ae();ne();var si;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let h={};for(let c of i)h[c]=c;return h},t.getValidEnumValues=i=>{let h=t.objectKeys(i).filter(v=>typeof i[i[v]]!="number"),c={};for(let v of h)c[v]=i[v];return t.objectValues(c)},t.objectValues=i=>t.objectKeys(i).map(function(h){return i[h]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let h=[];for(let c in i)Object.prototype.hasOwnProperty.call(i,c)&&h.push(c);return h},t.find=(i,h)=>{for(let c of i)if(h(c))return c},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function o(i,h=" | "){return i.map(c=>typeof c=="string"?`'${c}'`:c).join(h)}t.joinValues=o,t.jsonStringifyReplacer=(i,h)=>typeof h=="bigint"?h.toString():h})(si||(si={}));var mT;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(mT||(mT={}));var Yt=si.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),hl=t=>{switch(typeof t){case"undefined":return Yt.undefined;case"string":return Yt.string;case"number":return isNaN(t)?Yt.nan:Yt.number;case"boolean":return Yt.boolean;case"function":return Yt.function;case"bigint":return Yt.bigint;case"symbol":return Yt.symbol;case"object":return Array.isArray(t)?Yt.array:t===null?Yt.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Yt.promise:typeof Map<"u"&&t instanceof Map?Yt.map:typeof Set<"u"&&t instanceof Set?Yt.set:typeof Date<"u"&&t instanceof Date?Yt.date:Yt.object;default:return Yt.unknown}},Ot=si.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),l4e=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Po=class t extends Error{constructor(e){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(h){return h.message},o={_errors:[]},i=h=>{for(let c of h.issues)if(c.code==="invalid_union")c.unionErrors.map(i);else if(c.code==="invalid_return_type")i(c.returnTypeError);else if(c.code==="invalid_arguments")i(c.argumentsError);else if(c.path.length===0)o._errors.push(r(c));else{let v=o,b=0;for(;b<c.path.length;){let g=c.path[b];b===c.path.length-1?(v[g]=v[g]||{_errors:[]},v[g]._errors.push(r(c))):v[g]=v[g]||{_errors:[]},v=v[g],b++}}};return i(this),o}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,si.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},o=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):o.push(e(i));return{formErrors:o,fieldErrors:r}}get formErrors(){return this.flatten()}};Po.create=t=>new Po(t);var w1=(t,e)=>{let r;switch(t.code){case Ot.invalid_type:t.received===Yt.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case Ot.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,si.jsonStringifyReplacer)}`;break;case Ot.unrecognized_keys:r=`Unrecognized key(s) in object: ${si.joinValues(t.keys,", ")}`;break;case Ot.invalid_union:r="Invalid input";break;case Ot.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${si.joinValues(t.options)}`;break;case Ot.invalid_enum_value:r=`Invalid enum value. Expected ${si.joinValues(t.options)}, received '${t.received}'`;break;case Ot.invalid_arguments:r="Invalid function arguments";break;case Ot.invalid_return_type:r="Invalid function return type";break;case Ot.invalid_date:r="Invalid date";break;case Ot.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:si.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case Ot.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case Ot.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case Ot.custom:r="Invalid input";break;case Ot.invalid_intersection_types:r="Intersection results could not be merged";break;case Ot.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case Ot.not_finite:r="Number must be finite";break;default:r=e.defaultError,si.assertNever(t)}return{message:r}},eQ=w1;function c4e(t){eQ=t}function B8(){return eQ}var P8=t=>{let{data:e,path:r,errorMaps:o,issueData:i}=t,h=[...r,...i.path||[]],c={...i,path:h};if(i.message!==void 0)return{...i,path:h,message:i.message};let v="",b=o.filter(g=>!!g).slice().reverse();for(let g of b)v=g(c,{data:e,defaultError:v}).message;return{...i,path:h,message:v}},d4e=[];function Wt(t,e){let r=B8(),o=P8({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===w1?void 0:w1].filter(i=>!!i)});t.common.issues.push(o)}var ka=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let o=[];for(let i of r){if(i.status==="aborted")return vr;i.status==="dirty"&&e.dirty(),o.push(i.value)}return{status:e.value,value:o}}static async mergeObjectAsync(e,r){let o=[];for(let i of r){let h=await i.key,c=await i.value;o.push({key:h,value:c})}return t.mergeObjectSync(e,o)}static mergeObjectSync(e,r){let o={};for(let i of r){let{key:h,value:c}=i;if(h.status==="aborted"||c.status==="aborted")return vr;h.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),h.value!=="__proto__"&&(typeof c.value<"u"||i.alwaysSet)&&(o[h.value]=c.value)}return{status:e.value,value:o}}},vr=Object.freeze({status:"aborted"}),y1=t=>({status:"dirty",value:t}),Da=t=>({status:"valid",value:t}),gT=t=>t.status==="aborted",bT=t=>t.status==="dirty",Bg=t=>t.status==="valid",Pg=t=>typeof Promise<"u"&&t instanceof Promise;function O8(t,e,r,o){if(r==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?o:r==="a"?o.call(t):o?o.value:e.get(t)}function tQ(t,e,r,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}var ir;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(ir||(ir={}));var Ig,kg,Ps=class{constructor(e,r,o,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=o,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},XX=(t,e)=>{if(Bg(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Po(t.common.issues);return this._error=r,this._error}}};function Br(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:o,description:i}=t;if(e&&(r||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(c,v)=>{var b,g;let{message:_}=t;return c.code==="invalid_enum_value"?{message:_??v.defaultError}:typeof v.data>"u"?{message:(b=_??o)!==null&&b!==void 0?b:v.defaultError}:c.code!=="invalid_type"?{message:v.defaultError}:{message:(g=_??r)!==null&&g!==void 0?g:v.defaultError}},description:i}}var Pr=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return hl(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:hl(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ka,ctx:{common:e.parent.common,data:e.data,parsedType:hl(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Pg(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let o=this.safeParse(e,r);if(o.success)return o.data;throw o.error}safeParse(e,r){var o;let i={common:{issues:[],async:(o=r?.async)!==null&&o!==void 0?o:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:hl(e)},h=this._parseSync({data:e,path:i.path,parent:i});return XX(i,h)}async parseAsync(e,r){let o=await this.safeParseAsync(e,r);if(o.success)return o.data;throw o.error}async safeParseAsync(e,r){let o={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:hl(e)},i=this._parse({data:e,path:o.path,parent:o}),h=await(Pg(i)?i:Promise.resolve(i));return XX(o,h)}refine(e,r){let o=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,h)=>{let c=e(i),v=()=>h.addIssue({code:Ot.custom,...o(i)});return typeof Promise<"u"&&c instanceof Promise?c.then(b=>b?!0:(v(),!1)):c?!0:(v(),!1)})}refinement(e,r){return this._refinement((o,i)=>e(o)?!0:(i.addIssue(typeof r=="function"?r(o,i):r),!1))}_refinement(e){return new Oo({schema:this,typeName:cr.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Bs.create(this,this._def)}nullable(){return Ou.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ch.create(this,this._def)}promise(){return dl.create(this,this._def)}or(e){return fd.create([this,e],this._def)}and(e){return ud.create(this,e,this._def)}transform(e){return new Oo({...Br(this._def),schema:this,typeName:cr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new pd({...Br(this._def),innerType:this,defaultValue:r,typeName:cr.ZodDefault})}brand(){return new Og({typeName:cr.ZodBranded,type:this,...Br(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new vd({...Br(this._def),innerType:this,catchValue:r,typeName:cr.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Ng.create(this,e)}readonly(){return md.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},p4e=/^c[^\s-]{8,}$/i,v4e=/^[0-9a-z]+$/,m4e=/^[0-9A-HJKMNP-TV-Z]{26}$/,g4e=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,b4e=/^[a-z0-9_-]{21}$/i,y4e=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,w4e=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_4e="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",vT,M4e=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,x4e=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,S4e=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,rQ="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",E4e=new RegExp(`^${rQ}$`);function iQ(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function A4e(t){return new RegExp(`^${iQ(t)}$`)}function nQ(t){let e=`${rQ}T${iQ(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function R4e(t,e){return!!((e==="v4"||!e)&&M4e.test(t)||(e==="v6"||!e)&&x4e.test(t))}var ll=class t extends Pr{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Yt.string){let h=this._getOrReturnCtx(e);return Wt(h,{code:Ot.invalid_type,expected:Yt.string,received:h.parsedType}),vr}let o=new ka,i;for(let h of this._def.checks)if(h.kind==="min")e.data.length<h.value&&(i=this._getOrReturnCtx(e,i),Wt(i,{code:Ot.too_small,minimum:h.value,type:"string",inclusive:!0,exact:!1,message:h.message}),o.dirty());else if(h.kind==="max")e.data.length>h.value&&(i=this._getOrReturnCtx(e,i),Wt(i,{code:Ot.too_big,maximum:h.value,type:"string",inclusive:!0,exact:!1,message:h.message}),o.dirty());else if(h.kind==="length"){let c=e.data.length>h.value,v=e.data.length<h.value;(c||v)&&(i=this._getOrReturnCtx(e,i),c?Wt(i,{code:Ot.too_big,maximum:h.value,type:"string",inclusive:!0,exact:!0,message:h.message}):v&&Wt(i,{code:Ot.too_small,minimum:h.value,type:"string",inclusive:!0,exact:!0,message:h.message}),o.dirty())}else if(h.kind==="email")w4e.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"email",code:Ot.invalid_string,message:h.message}),o.dirty());else if(h.kind==="emoji")vT||(vT=new RegExp(_4e,"u")),vT.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"emoji",code:Ot.invalid_string,message:h.message}),o.dirty());else if(h.kind==="uuid")g4e.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"uuid",code:Ot.invalid_string,message:h.message}),o.dirty());else if(h.kind==="nanoid")b4e.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"nanoid",code:Ot.invalid_string,message:h.message}),o.dirty());else if(h.kind==="cuid")p4e.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"cuid",code:Ot.invalid_string,message:h.message}),o.dirty());else if(h.kind==="cuid2")v4e.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"cuid2",code:Ot.invalid_string,message:h.message}),o.dirty());else if(h.kind==="ulid")m4e.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"ulid",code:Ot.invalid_string,message:h.message}),o.dirty());else if(h.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),Wt(i,{validation:"url",code:Ot.invalid_string,message:h.message}),o.dirty()}else h.kind==="regex"?(h.regex.lastIndex=0,h.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"regex",code:Ot.invalid_string,message:h.message}),o.dirty())):h.kind==="trim"?e.data=e.data.trim():h.kind==="includes"?e.data.includes(h.value,h.position)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Ot.invalid_string,validation:{includes:h.value,position:h.position},message:h.message}),o.dirty()):h.kind==="toLowerCase"?e.data=e.data.toLowerCase():h.kind==="toUpperCase"?e.data=e.data.toUpperCase():h.kind==="startsWith"?e.data.startsWith(h.value)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Ot.invalid_string,validation:{startsWith:h.value},message:h.message}),o.dirty()):h.kind==="endsWith"?e.data.endsWith(h.value)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Ot.invalid_string,validation:{endsWith:h.value},message:h.message}),o.dirty()):h.kind==="datetime"?nQ(h).test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Ot.invalid_string,validation:"datetime",message:h.message}),o.dirty()):h.kind==="date"?E4e.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Ot.invalid_string,validation:"date",message:h.message}),o.dirty()):h.kind==="time"?A4e(h).test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Ot.invalid_string,validation:"time",message:h.message}),o.dirty()):h.kind==="duration"?y4e.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"duration",code:Ot.invalid_string,message:h.message}),o.dirty()):h.kind==="ip"?R4e(e.data,h.version)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"ip",code:Ot.invalid_string,message:h.message}),o.dirty()):h.kind==="base64"?S4e.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"base64",code:Ot.invalid_string,message:h.message}),o.dirty()):si.assertNever(h);return{status:o.value,value:e.data}}_regex(e,r,o){return this.refinement(i=>e.test(i),{validation:r,code:Ot.invalid_string,...ir.errToObj(o)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ir.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ir.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ir.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ir.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ir.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ir.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ir.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ir.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ir.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ir.errToObj(e)})}datetime(e){var r,o;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!==null&&r!==void 0?r:!1,local:(o=e?.local)!==null&&o!==void 0?o:!1,...ir.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...ir.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...ir.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...ir.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...ir.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...ir.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...ir.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...ir.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...ir.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...ir.errToObj(r)})}nonempty(e){return this.min(1,ir.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};ll.create=t=>{var e;return new ll({checks:[],typeName:cr.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Br(t)})};function T4e(t,e){let r=(t.toString().split(".")[1]||"").length,o=(e.toString().split(".")[1]||"").length,i=r>o?r:o,h=parseInt(t.toFixed(i).replace(".","")),c=parseInt(e.toFixed(i).replace(".",""));return h%c/Math.pow(10,i)}var rd=class t extends Pr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Yt.number){let h=this._getOrReturnCtx(e);return Wt(h,{code:Ot.invalid_type,expected:Yt.number,received:h.parsedType}),vr}let o,i=new ka;for(let h of this._def.checks)h.kind==="int"?si.isInteger(e.data)||(o=this._getOrReturnCtx(e,o),Wt(o,{code:Ot.invalid_type,expected:"integer",received:"float",message:h.message}),i.dirty()):h.kind==="min"?(h.inclusive?e.data<h.value:e.data<=h.value)&&(o=this._getOrReturnCtx(e,o),Wt(o,{code:Ot.too_small,minimum:h.value,type:"number",inclusive:h.inclusive,exact:!1,message:h.message}),i.dirty()):h.kind==="max"?(h.inclusive?e.data>h.value:e.data>=h.value)&&(o=this._getOrReturnCtx(e,o),Wt(o,{code:Ot.too_big,maximum:h.value,type:"number",inclusive:h.inclusive,exact:!1,message:h.message}),i.dirty()):h.kind==="multipleOf"?T4e(e.data,h.value)!==0&&(o=this._getOrReturnCtx(e,o),Wt(o,{code:Ot.not_multiple_of,multipleOf:h.value,message:h.message}),i.dirty()):h.kind==="finite"?Number.isFinite(e.data)||(o=this._getOrReturnCtx(e,o),Wt(o,{code:Ot.not_finite,message:h.message}),i.dirty()):si.assertNever(h);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,ir.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ir.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ir.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ir.toString(r))}setLimit(e,r,o,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:o,message:ir.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ir.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ir.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ir.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ir.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ir.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ir.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:ir.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ir.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ir.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&si.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(r===null||o.value>r)&&(r=o.value):o.kind==="max"&&(e===null||o.value<e)&&(e=o.value)}return Number.isFinite(r)&&Number.isFinite(e)}};rd.create=t=>new rd({checks:[],typeName:cr.ZodNumber,coerce:t?.coerce||!1,...Br(t)});var id=class t extends Pr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==Yt.bigint){let h=this._getOrReturnCtx(e);return Wt(h,{code:Ot.invalid_type,expected:Yt.bigint,received:h.parsedType}),vr}let o,i=new ka;for(let h of this._def.checks)h.kind==="min"?(h.inclusive?e.data<h.value:e.data<=h.value)&&(o=this._getOrReturnCtx(e,o),Wt(o,{code:Ot.too_small,type:"bigint",minimum:h.value,inclusive:h.inclusive,message:h.message}),i.dirty()):h.kind==="max"?(h.inclusive?e.data>h.value:e.data>=h.value)&&(o=this._getOrReturnCtx(e,o),Wt(o,{code:Ot.too_big,type:"bigint",maximum:h.value,inclusive:h.inclusive,message:h.message}),i.dirty()):h.kind==="multipleOf"?e.data%h.value!==BigInt(0)&&(o=this._getOrReturnCtx(e,o),Wt(o,{code:Ot.not_multiple_of,multipleOf:h.value,message:h.message}),i.dirty()):si.assertNever(h);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,ir.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ir.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ir.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ir.toString(r))}setLimit(e,r,o,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:o,message:ir.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ir.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ir.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ir.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ir.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ir.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};id.create=t=>{var e;return new id({checks:[],typeName:cr.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Br(t)})};var nd=class extends Pr{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Yt.boolean){let o=this._getOrReturnCtx(e);return Wt(o,{code:Ot.invalid_type,expected:Yt.boolean,received:o.parsedType}),vr}return Da(e.data)}};nd.create=t=>new nd({typeName:cr.ZodBoolean,coerce:t?.coerce||!1,...Br(t)});var ad=class t extends Pr{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Yt.date){let h=this._getOrReturnCtx(e);return Wt(h,{code:Ot.invalid_type,expected:Yt.date,received:h.parsedType}),vr}if(isNaN(e.data.getTime())){let h=this._getOrReturnCtx(e);return Wt(h,{code:Ot.invalid_date}),vr}let o=new ka,i;for(let h of this._def.checks)h.kind==="min"?e.data.getTime()<h.value&&(i=this._getOrReturnCtx(e,i),Wt(i,{code:Ot.too_small,message:h.message,inclusive:!0,exact:!1,minimum:h.value,type:"date"}),o.dirty()):h.kind==="max"?e.data.getTime()>h.value&&(i=this._getOrReturnCtx(e,i),Wt(i,{code:Ot.too_big,message:h.message,inclusive:!0,exact:!1,maximum:h.value,type:"date"}),o.dirty()):si.assertNever(h);return{status:o.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:ir.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:ir.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};ad.create=t=>new ad({checks:[],coerce:t?.coerce||!1,typeName:cr.ZodDate,...Br(t)});var _1=class extends Pr{_parse(e){if(this._getType(e)!==Yt.symbol){let o=this._getOrReturnCtx(e);return Wt(o,{code:Ot.invalid_type,expected:Yt.symbol,received:o.parsedType}),vr}return Da(e.data)}};_1.create=t=>new _1({typeName:cr.ZodSymbol,...Br(t)});var od=class extends Pr{_parse(e){if(this._getType(e)!==Yt.undefined){let o=this._getOrReturnCtx(e);return Wt(o,{code:Ot.invalid_type,expected:Yt.undefined,received:o.parsedType}),vr}return Da(e.data)}};od.create=t=>new od({typeName:cr.ZodUndefined,...Br(t)});var sd=class extends Pr{_parse(e){if(this._getType(e)!==Yt.null){let o=this._getOrReturnCtx(e);return Wt(o,{code:Ot.invalid_type,expected:Yt.null,received:o.parsedType}),vr}return Da(e.data)}};sd.create=t=>new sd({typeName:cr.ZodNull,...Br(t)});var cl=class extends Pr{constructor(){super(...arguments),this._any=!0}_parse(e){return Da(e.data)}};cl.create=t=>new cl({typeName:cr.ZodAny,...Br(t)});var Nh=class extends Pr{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Da(e.data)}};Nh.create=t=>new Nh({typeName:cr.ZodUnknown,...Br(t)});var Af=class extends Pr{_parse(e){let r=this._getOrReturnCtx(e);return Wt(r,{code:Ot.invalid_type,expected:Yt.never,received:r.parsedType}),vr}};Af.create=t=>new Af({typeName:cr.ZodNever,...Br(t)});var M1=class extends Pr{_parse(e){if(this._getType(e)!==Yt.undefined){let o=this._getOrReturnCtx(e);return Wt(o,{code:Ot.invalid_type,expected:Yt.void,received:o.parsedType}),vr}return Da(e.data)}};M1.create=t=>new M1({typeName:cr.ZodVoid,...Br(t)});var Ch=class t extends Pr{_parse(e){let{ctx:r,status:o}=this._processInputParams(e),i=this._def;if(r.parsedType!==Yt.array)return Wt(r,{code:Ot.invalid_type,expected:Yt.array,received:r.parsedType}),vr;if(i.exactLength!==null){let c=r.data.length>i.exactLength.value,v=r.data.length<i.exactLength.value;(c||v)&&(Wt(r,{code:c?Ot.too_big:Ot.too_small,minimum:v?i.exactLength.value:void 0,maximum:c?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),o.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(Wt(r,{code:Ot.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),o.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(Wt(r,{code:Ot.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),o.dirty()),r.common.async)return Promise.all([...r.data].map((c,v)=>i.type._parseAsync(new Ps(r,c,r.path,v)))).then(c=>ka.mergeArray(o,c));let h=[...r.data].map((c,v)=>i.type._parseSync(new Ps(r,c,r.path,v)));return ka.mergeArray(o,h)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:ir.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:ir.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:ir.toString(r)}})}nonempty(e){return this.min(1,e)}};Ch.create=(t,e)=>new Ch({type:t,minLength:null,maxLength:null,exactLength:null,typeName:cr.ZodArray,...Br(e)});function b1(t){if(t instanceof so){let e={};for(let r in t.shape){let o=t.shape[r];e[r]=Bs.create(b1(o))}return new so({...t._def,shape:()=>e})}else return t instanceof Ch?new Ch({...t._def,type:b1(t.element)}):t instanceof Bs?Bs.create(b1(t.unwrap())):t instanceof Ou?Ou.create(b1(t.unwrap())):t instanceof Pu?Pu.create(t.items.map(e=>b1(e))):t}var so=class t extends Pr{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=si.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==Yt.object){let g=this._getOrReturnCtx(e);return Wt(g,{code:Ot.invalid_type,expected:Yt.object,received:g.parsedType}),vr}let{status:o,ctx:i}=this._processInputParams(e),{shape:h,keys:c}=this._getCached(),v=[];if(!(this._def.catchall instanceof Af&&this._def.unknownKeys==="strip"))for(let g in i.data)c.includes(g)||v.push(g);let b=[];for(let g of c){let _=h[g],M=i.data[g];b.push({key:{status:"valid",value:g},value:_._parse(new Ps(i,M,i.path,g)),alwaysSet:g in i.data})}if(this._def.catchall instanceof Af){let g=this._def.unknownKeys;if(g==="passthrough")for(let _ of v)b.push({key:{status:"valid",value:_},value:{status:"valid",value:i.data[_]}});else if(g==="strict")v.length>0&&(Wt(i,{code:Ot.unrecognized_keys,keys:v}),o.dirty());else if(g!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let g=this._def.catchall;for(let _ of v){let M=i.data[_];b.push({key:{status:"valid",value:_},value:g._parse(new Ps(i,M,i.path,_)),alwaysSet:_ in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let g=[];for(let _ of b){let M=await _.key,x=await _.value;g.push({key:M,value:x,alwaysSet:_.alwaysSet})}return g}).then(g=>ka.mergeObjectSync(o,g)):ka.mergeObjectSync(o,b)}get shape(){return this._def.shape()}strict(e){return ir.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,o)=>{var i,h,c,v;let b=(c=(h=(i=this._def).errorMap)===null||h===void 0?void 0:h.call(i,r,o).message)!==null&&c!==void 0?c:o.defaultError;return r.code==="unrecognized_keys"?{message:(v=ir.errToObj(e).message)!==null&&v!==void 0?v:b}:{message:b}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:cr.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};return si.objectKeys(e).forEach(o=>{e[o]&&this.shape[o]&&(r[o]=this.shape[o])}),new t({...this._def,shape:()=>r})}omit(e){let r={};return si.objectKeys(this.shape).forEach(o=>{e[o]||(r[o]=this.shape[o])}),new t({...this._def,shape:()=>r})}deepPartial(){return b1(this)}partial(e){let r={};return si.objectKeys(this.shape).forEach(o=>{let i=this.shape[o];e&&!e[o]?r[o]=i:r[o]=i.optional()}),new t({...this._def,shape:()=>r})}required(e){let r={};return si.objectKeys(this.shape).forEach(o=>{if(e&&!e[o])r[o]=this.shape[o];else{let h=this.shape[o];for(;h instanceof Bs;)h=h._def.innerType;r[o]=h}}),new t({...this._def,shape:()=>r})}keyof(){return aQ(si.objectKeys(this.shape))}};so.create=(t,e)=>new so({shape:()=>t,unknownKeys:"strip",catchall:Af.create(),typeName:cr.ZodObject,...Br(e)});so.strictCreate=(t,e)=>new so({shape:()=>t,unknownKeys:"strict",catchall:Af.create(),typeName:cr.ZodObject,...Br(e)});so.lazycreate=(t,e)=>new so({shape:t,unknownKeys:"strip",catchall:Af.create(),typeName:cr.ZodObject,...Br(e)});var fd=class extends Pr{_parse(e){let{ctx:r}=this._processInputParams(e),o=this._def.options;function i(h){for(let v of h)if(v.result.status==="valid")return v.result;for(let v of h)if(v.result.status==="dirty")return r.common.issues.push(...v.ctx.common.issues),v.result;let c=h.map(v=>new Po(v.ctx.common.issues));return Wt(r,{code:Ot.invalid_union,unionErrors:c}),vr}if(r.common.async)return Promise.all(o.map(async h=>{let c={...r,common:{...r.common,issues:[]},parent:null};return{result:await h._parseAsync({data:r.data,path:r.path,parent:c}),ctx:c}})).then(i);{let h,c=[];for(let b of o){let g={...r,common:{...r.common,issues:[]},parent:null},_=b._parseSync({data:r.data,path:r.path,parent:g});if(_.status==="valid")return _;_.status==="dirty"&&!h&&(h={result:_,ctx:g}),g.common.issues.length&&c.push(g.common.issues)}if(h)return r.common.issues.push(...h.ctx.common.issues),h.result;let v=c.map(b=>new Po(b));return Wt(r,{code:Ot.invalid_union,unionErrors:v}),vr}}get options(){return this._def.options}};fd.create=(t,e)=>new fd({options:t,typeName:cr.ZodUnion,...Br(e)});var Oh=t=>t instanceof hd?Oh(t.schema):t instanceof Oo?Oh(t.innerType()):t instanceof ld?[t.value]:t instanceof cd?t.options:t instanceof dd?si.objectValues(t.enum):t instanceof pd?Oh(t._def.innerType):t instanceof od?[void 0]:t instanceof sd?[null]:t instanceof Bs?[void 0,...Oh(t.unwrap())]:t instanceof Ou?[null,...Oh(t.unwrap())]:t instanceof Og||t instanceof md?Oh(t.unwrap()):t instanceof vd?Oh(t._def.innerType):[],N8=class t extends Pr{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Yt.object)return Wt(r,{code:Ot.invalid_type,expected:Yt.object,received:r.parsedType}),vr;let o=this.discriminator,i=r.data[o],h=this.optionsMap.get(i);return h?r.common.async?h._parseAsync({data:r.data,path:r.path,parent:r}):h._parseSync({data:r.data,path:r.path,parent:r}):(Wt(r,{code:Ot.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),vr)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,o){let i=new Map;for(let h of r){let c=Oh(h.shape[e]);if(!c.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let v of c){if(i.has(v))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(v)}`);i.set(v,h)}}return new t({typeName:cr.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...Br(o)})}};function yT(t,e){let r=hl(t),o=hl(e);if(t===e)return{valid:!0,data:t};if(r===Yt.object&&o===Yt.object){let i=si.objectKeys(e),h=si.objectKeys(t).filter(v=>i.indexOf(v)!==-1),c={...t,...e};for(let v of h){let b=yT(t[v],e[v]);if(!b.valid)return{valid:!1};c[v]=b.data}return{valid:!0,data:c}}else if(r===Yt.array&&o===Yt.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let h=0;h<t.length;h++){let c=t[h],v=e[h],b=yT(c,v);if(!b.valid)return{valid:!1};i.push(b.data)}return{valid:!0,data:i}}else return r===Yt.date&&o===Yt.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var ud=class extends Pr{_parse(e){let{status:r,ctx:o}=this._processInputParams(e),i=(h,c)=>{if(gT(h)||gT(c))return vr;let v=yT(h.value,c.value);return v.valid?((bT(h)||bT(c))&&r.dirty(),{status:r.value,value:v.data}):(Wt(o,{code:Ot.invalid_intersection_types}),vr)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([h,c])=>i(h,c)):i(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}};ud.create=(t,e,r)=>new ud({left:t,right:e,typeName:cr.ZodIntersection,...Br(r)});var Pu=class t extends Pr{_parse(e){let{status:r,ctx:o}=this._processInputParams(e);if(o.parsedType!==Yt.array)return Wt(o,{code:Ot.invalid_type,expected:Yt.array,received:o.parsedType}),vr;if(o.data.length<this._def.items.length)return Wt(o,{code:Ot.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),vr;!this._def.rest&&o.data.length>this._def.items.length&&(Wt(o,{code:Ot.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let h=[...o.data].map((c,v)=>{let b=this._def.items[v]||this._def.rest;return b?b._parse(new Ps(o,c,o.path,v)):null}).filter(c=>!!c);return o.common.async?Promise.all(h).then(c=>ka.mergeArray(r,c)):ka.mergeArray(r,h)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Pu.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Pu({items:t,typeName:cr.ZodTuple,rest:null,...Br(e)})};var C8=class t extends Pr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:o}=this._processInputParams(e);if(o.parsedType!==Yt.object)return Wt(o,{code:Ot.invalid_type,expected:Yt.object,received:o.parsedType}),vr;let i=[],h=this._def.keyType,c=this._def.valueType;for(let v in o.data)i.push({key:h._parse(new Ps(o,v,o.path,v)),value:c._parse(new Ps(o,o.data[v],o.path,v)),alwaysSet:v in o.data});return o.common.async?ka.mergeObjectAsync(r,i):ka.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,o){return r instanceof Pr?new t({keyType:e,valueType:r,typeName:cr.ZodRecord,...Br(o)}):new t({keyType:ll.create(),valueType:e,typeName:cr.ZodRecord,...Br(r)})}},x1=class extends Pr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:o}=this._processInputParams(e);if(o.parsedType!==Yt.map)return Wt(o,{code:Ot.invalid_type,expected:Yt.map,received:o.parsedType}),vr;let i=this._def.keyType,h=this._def.valueType,c=[...o.data.entries()].map(([v,b],g)=>({key:i._parse(new Ps(o,v,o.path,[g,"key"])),value:h._parse(new Ps(o,b,o.path,[g,"value"]))}));if(o.common.async){let v=new Map;return Promise.resolve().then(async()=>{for(let b of c){let g=await b.key,_=await b.value;if(g.status==="aborted"||_.status==="aborted")return vr;(g.status==="dirty"||_.status==="dirty")&&r.dirty(),v.set(g.value,_.value)}return{status:r.value,value:v}})}else{let v=new Map;for(let b of c){let g=b.key,_=b.value;if(g.status==="aborted"||_.status==="aborted")return vr;(g.status==="dirty"||_.status==="dirty")&&r.dirty(),v.set(g.value,_.value)}return{status:r.value,value:v}}}};x1.create=(t,e,r)=>new x1({valueType:e,keyType:t,typeName:cr.ZodMap,...Br(r)});var S1=class t extends Pr{_parse(e){let{status:r,ctx:o}=this._processInputParams(e);if(o.parsedType!==Yt.set)return Wt(o,{code:Ot.invalid_type,expected:Yt.set,received:o.parsedType}),vr;let i=this._def;i.minSize!==null&&o.data.size<i.minSize.value&&(Wt(o,{code:Ot.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&o.data.size>i.maxSize.value&&(Wt(o,{code:Ot.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let h=this._def.valueType;function c(b){let g=new Set;for(let _ of b){if(_.status==="aborted")return vr;_.status==="dirty"&&r.dirty(),g.add(_.value)}return{status:r.value,value:g}}let v=[...o.data.values()].map((b,g)=>h._parse(new Ps(o,b,o.path,g)));return o.common.async?Promise.all(v).then(b=>c(b)):c(v)}min(e,r){return new t({...this._def,minSize:{value:e,message:ir.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:ir.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};S1.create=(t,e)=>new S1({valueType:t,minSize:null,maxSize:null,typeName:cr.ZodSet,...Br(e)});var L8=class t extends Pr{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Yt.function)return Wt(r,{code:Ot.invalid_type,expected:Yt.function,received:r.parsedType}),vr;function o(v,b){return P8({data:v,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,B8(),w1].filter(g=>!!g),issueData:{code:Ot.invalid_arguments,argumentsError:b}})}function i(v,b){return P8({data:v,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,B8(),w1].filter(g=>!!g),issueData:{code:Ot.invalid_return_type,returnTypeError:b}})}let h={errorMap:r.common.contextualErrorMap},c=r.data;if(this._def.returns instanceof dl){let v=this;return Da(async function(...b){let g=new Po([]),_=await v._def.args.parseAsync(b,h).catch(E=>{throw g.addIssue(o(b,E)),g}),M=await Reflect.apply(c,this,_);return await v._def.returns._def.type.parseAsync(M,h).catch(E=>{throw g.addIssue(i(M,E)),g})})}else{let v=this;return Da(function(...b){let g=v._def.args.safeParse(b,h);if(!g.success)throw new Po([o(b,g.error)]);let _=Reflect.apply(c,this,g.data),M=v._def.returns.safeParse(_,h);if(!M.success)throw new Po([i(_,M.error)]);return M.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Pu.create(e).rest(Nh.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,o){return new t({args:e||Pu.create([]).rest(Nh.create()),returns:r||Nh.create(),typeName:cr.ZodFunction,...Br(o)})}},hd=class extends Pr{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};hd.create=(t,e)=>new hd({getter:t,typeName:cr.ZodLazy,...Br(e)});var ld=class extends Pr{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return Wt(r,{received:r.data,code:Ot.invalid_literal,expected:this._def.value}),vr}return{status:"valid",value:e.data}}get value(){return this._def.value}};ld.create=(t,e)=>new ld({value:t,typeName:cr.ZodLiteral,...Br(e)});function aQ(t,e){return new cd({values:t,typeName:cr.ZodEnum,...Br(e)})}var cd=class t extends Pr{constructor(){super(...arguments),Ig.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),o=this._def.values;return Wt(r,{expected:si.joinValues(o),received:r.parsedType,code:Ot.invalid_type}),vr}if(O8(this,Ig,"f")||tQ(this,Ig,new Set(this._def.values),"f"),!O8(this,Ig,"f").has(e.data)){let r=this._getOrReturnCtx(e),o=this._def.values;return Wt(r,{received:r.data,code:Ot.invalid_enum_value,options:o}),vr}return Da(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(o=>!e.includes(o)),{...this._def,...r})}};Ig=new WeakMap;cd.create=aQ;var dd=class extends Pr{constructor(){super(...arguments),kg.set(this,void 0)}_parse(e){let r=si.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(e);if(o.parsedType!==Yt.string&&o.parsedType!==Yt.number){let i=si.objectValues(r);return Wt(o,{expected:si.joinValues(i),received:o.parsedType,code:Ot.invalid_type}),vr}if(O8(this,kg,"f")||tQ(this,kg,new Set(si.getValidEnumValues(this._def.values)),"f"),!O8(this,kg,"f").has(e.data)){let i=si.objectValues(r);return Wt(o,{received:o.data,code:Ot.invalid_enum_value,options:i}),vr}return Da(e.data)}get enum(){return this._def.values}};kg=new WeakMap;dd.create=(t,e)=>new dd({values:t,typeName:cr.ZodNativeEnum,...Br(e)});var dl=class extends Pr{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Yt.promise&&r.common.async===!1)return Wt(r,{code:Ot.invalid_type,expected:Yt.promise,received:r.parsedType}),vr;let o=r.parsedType===Yt.promise?r.data:Promise.resolve(r.data);return Da(o.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};dl.create=(t,e)=>new dl({type:t,typeName:cr.ZodPromise,...Br(e)});var Oo=class extends Pr{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===cr.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:o}=this._processInputParams(e),i=this._def.effect||null,h={addIssue:c=>{Wt(o,c),c.fatal?r.abort():r.dirty()},get path(){return o.path}};if(h.addIssue=h.addIssue.bind(h),i.type==="preprocess"){let c=i.transform(o.data,h);if(o.common.async)return Promise.resolve(c).then(async v=>{if(r.value==="aborted")return vr;let b=await this._def.schema._parseAsync({data:v,path:o.path,parent:o});return b.status==="aborted"?vr:b.status==="dirty"||r.value==="dirty"?y1(b.value):b});{if(r.value==="aborted")return vr;let v=this._def.schema._parseSync({data:c,path:o.path,parent:o});return v.status==="aborted"?vr:v.status==="dirty"||r.value==="dirty"?y1(v.value):v}}if(i.type==="refinement"){let c=v=>{let b=i.refinement(v,h);if(o.common.async)return Promise.resolve(b);if(b instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return v};if(o.common.async===!1){let v=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return v.status==="aborted"?vr:(v.status==="dirty"&&r.dirty(),c(v.value),{status:r.value,value:v.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(v=>v.status==="aborted"?vr:(v.status==="dirty"&&r.dirty(),c(v.value).then(()=>({status:r.value,value:v.value}))))}if(i.type==="transform")if(o.common.async===!1){let c=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!Bg(c))return c;let v=i.transform(c.value,h);if(v instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:v}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(c=>Bg(c)?Promise.resolve(i.transform(c.value,h)).then(v=>({status:r.value,value:v})):c);si.assertNever(i)}};Oo.create=(t,e,r)=>new Oo({schema:t,typeName:cr.ZodEffects,effect:e,...Br(r)});Oo.createWithPreprocess=(t,e,r)=>new Oo({schema:e,effect:{type:"preprocess",transform:t},typeName:cr.ZodEffects,...Br(r)});var Bs=class extends Pr{_parse(e){return this._getType(e)===Yt.undefined?Da(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Bs.create=(t,e)=>new Bs({innerType:t,typeName:cr.ZodOptional,...Br(e)});var Ou=class extends Pr{_parse(e){return this._getType(e)===Yt.null?Da(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ou.create=(t,e)=>new Ou({innerType:t,typeName:cr.ZodNullable,...Br(e)});var pd=class extends Pr{_parse(e){let{ctx:r}=this._processInputParams(e),o=r.data;return r.parsedType===Yt.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};pd.create=(t,e)=>new pd({innerType:t,typeName:cr.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Br(e)});var vd=class extends Pr{_parse(e){let{ctx:r}=this._processInputParams(e),o={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return Pg(i)?i.then(h=>({status:"valid",value:h.status==="valid"?h.value:this._def.catchValue({get error(){return new Po(o.common.issues)},input:o.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Po(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}};vd.create=(t,e)=>new vd({innerType:t,typeName:cr.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Br(e)});var E1=class extends Pr{_parse(e){if(this._getType(e)!==Yt.nan){let o=this._getOrReturnCtx(e);return Wt(o,{code:Ot.invalid_type,expected:Yt.nan,received:o.parsedType}),vr}return{status:"valid",value:e.data}}};E1.create=t=>new E1({typeName:cr.ZodNaN,...Br(t)});var I4e=Symbol("zod_brand"),Og=class extends Pr{_parse(e){let{ctx:r}=this._processInputParams(e),o=r.data;return this._def.type._parse({data:o,path:r.path,parent:r})}unwrap(){return this._def.type}},Ng=class t extends Pr{_parse(e){let{status:r,ctx:o}=this._processInputParams(e);if(o.common.async)return(async()=>{let h=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return h.status==="aborted"?vr:h.status==="dirty"?(r.dirty(),y1(h.value)):this._def.out._parseAsync({data:h.value,path:o.path,parent:o})})();{let i=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return i.status==="aborted"?vr:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:o.path,parent:o})}}static create(e,r){return new t({in:e,out:r,typeName:cr.ZodPipeline})}},md=class extends Pr{_parse(e){let r=this._def.innerType._parse(e),o=i=>(Bg(i)&&(i.value=Object.freeze(i.value)),i);return Pg(r)?r.then(i=>o(i)):o(r)}unwrap(){return this._def.innerType}};md.create=(t,e)=>new md({innerType:t,typeName:cr.ZodReadonly,...Br(e)});function oQ(t,e={},r){return t?cl.create().superRefine((o,i)=>{var h,c;if(!t(o)){let v=typeof e=="function"?e(o):typeof e=="string"?{message:e}:e,b=(c=(h=v.fatal)!==null&&h!==void 0?h:r)!==null&&c!==void 0?c:!0,g=typeof v=="string"?{message:v}:v;i.addIssue({code:"custom",...g,fatal:b})}}):cl.create()}var k4e={object:so.lazycreate},cr;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(cr||(cr={}));var B4e=(t,e={message:`Input not instance of ${t.name}`})=>oQ(r=>r instanceof t,e),sQ=ll.create,fQ=rd.create,P4e=E1.create,O4e=id.create,uQ=nd.create,N4e=ad.create,C4e=_1.create,L4e=od.create,D4e=sd.create,$4e=cl.create,q4e=Nh.create,U4e=Af.create,F4e=M1.create,j4e=Ch.create,z4e=so.create,Z4e=so.strictCreate,H4e=fd.create,K4e=N8.create,W4e=ud.create,V4e=Pu.create,G4e=C8.create,Y4e=x1.create,J4e=S1.create,X4e=L8.create,Q4e=hd.create,e5e=ld.create,t5e=cd.create,r5e=dd.create,i5e=dl.create,QX=Oo.create,n5e=Bs.create,a5e=Ou.create,o5e=Oo.createWithPreprocess,s5e=Ng.create,f5e=()=>sQ().optional(),u5e=()=>fQ().optional(),h5e=()=>uQ().optional(),l5e={string:t=>ll.create({...t,coerce:!0}),number:t=>rd.create({...t,coerce:!0}),boolean:t=>nd.create({...t,coerce:!0}),bigint:t=>id.create({...t,coerce:!0}),date:t=>ad.create({...t,coerce:!0})},c5e=vr,Qt=Object.freeze({__proto__:null,defaultErrorMap:w1,setErrorMap:c4e,getErrorMap:B8,makeIssue:P8,EMPTY_PATH:d4e,addIssueToContext:Wt,ParseStatus:ka,INVALID:vr,DIRTY:y1,OK:Da,isAborted:gT,isDirty:bT,isValid:Bg,isAsync:Pg,get util(){return si},get objectUtil(){return mT},ZodParsedType:Yt,getParsedType:hl,ZodType:Pr,datetimeRegex:nQ,ZodString:ll,ZodNumber:rd,ZodBigInt:id,ZodBoolean:nd,ZodDate:ad,ZodSymbol:_1,ZodUndefined:od,ZodNull:sd,ZodAny:cl,ZodUnknown:Nh,ZodNever:Af,ZodVoid:M1,ZodArray:Ch,ZodObject:so,ZodUnion:fd,ZodDiscriminatedUnion:N8,ZodIntersection:ud,ZodTuple:Pu,ZodRecord:C8,ZodMap:x1,ZodSet:S1,ZodFunction:L8,ZodLazy:hd,ZodLiteral:ld,ZodEnum:cd,ZodNativeEnum:dd,ZodPromise:dl,ZodEffects:Oo,ZodTransformer:Oo,ZodOptional:Bs,ZodNullable:Ou,ZodDefault:pd,ZodCatch:vd,ZodNaN:E1,BRAND:I4e,ZodBranded:Og,ZodPipeline:Ng,ZodReadonly:md,custom:oQ,Schema:Pr,ZodSchema:Pr,late:k4e,get ZodFirstPartyTypeKind(){return cr},coerce:l5e,any:$4e,array:j4e,bigint:O4e,boolean:uQ,date:N4e,discriminatedUnion:K4e,effect:QX,enum:t5e,function:X4e,instanceof:B4e,intersection:W4e,lazy:Q4e,literal:e5e,map:Y4e,nan:P4e,nativeEnum:r5e,never:U4e,null:D4e,nullable:a5e,number:fQ,object:z4e,oboolean:h5e,onumber:u5e,optional:n5e,ostring:f5e,pipeline:s5e,preprocess:o5e,promise:i5e,record:G4e,set:J4e,strictObject:Z4e,string:sQ,symbol:C4e,transformer:QX,tuple:V4e,undefined:L4e,union:H4e,unknown:q4e,void:F4e,NEVER:c5e,ZodIssueCode:Ot,quotelessJson:l4e,ZodError:Po});ie();ae();ne();var D8=new RegExp("^[a-zA-Z0-9_-]{43}$"),Xft=new RegExp("^(?:(?!-)[A-Za-z0-9-]{1,63}(?<!-)\\.)+[A-Za-z]{1,63}$"),Qft=new RegExp("^[0-9]{12},[0-9]{13},[a-fA-F0-9]{64}$"),eut=He.env.ARNS_REGISTRY_TX??"bLAgYxAdX2Ry-nt6aH2ixgvJXbpsEYm28NgJgyqfs-U",tut="_NctcA2sRy1-J4OmIQZbYFPM17piNcbdBPH2ncX2RL8",d5e="GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6GcRGrHc",rut=d5e,Lh="agYcCFJtrMG6cqMuZfskIkFTGvUPddICmtQSBIoPdiA",iut="qNvAoz0TgcH7DMg8BCVn8jF32QH5L6T29VjHxhHqqGE",$8="i_le_yKKPVstLTDSmkHRqf-wYphMnwB9OhleiTgMkWc",wT=1e6,hQ="pb4fCvdJqwT-_bn38ERMdqnOF4weRMjoJ6bY6yfl4a8",lQ="OO2ewZKq4AHoqGQmYUIl-NhJ-llQyFJ3ha4Uf4-w5RI",cQ="fcoN_xJeisVsPXA-trzVAuIiqO3ydLQxM-L4XbrQKzY",dQ="_GQ33BkPtZrqxA84vM8Zk-N2aO0toNNu_C-l-rawrBA";var gd=Qt.string({description:"Arweave Transaction ID"}).refine(t=>D8.test(t),{message:"Must be an Arweave Transaction ID"}),pQ=Qt.string({description:"Integer String"}).refine(t=>{let e=parseInt(t);return Number.isInteger(e)&&e>=0},{message:"Must be a non negative integer string"}),p5e=Qt.string(),mQ=Qt.array(Qt.string()),q8=Qt.object({transactionId:gd.describe("The Target ID of the undername"),ttlSeconds:Qt.number(),priority:Qt.number().optional()}),_T=Qt.record(Qt.string(),q8),MT=Qt.array(gd.describe("Controller address")),xT=Qt.record(gd.describe("Holder address"),Qt.number()),ST=Qt.object({Name:Qt.string().describe("The name of the ANT."),Ticker:Qt.string().describe("The ticker symbol for the ANT."),Description:Qt.string().describe("The description for the ANT."),Keywords:mQ.describe("The keywords for the ANT."),Denomination:Qt.number().describe("The number of decimal places to use for the ANT. Defaults to 0 if not set representing whole numbers.").min(0,{message:"Denomination must be a non-negative number"}),Owner:gd.describe("The Owners address."),Controllers:MT.describe("Controllers of the ANT who have administrative privileges."),Records:_T.describe("Records associated with the ANT."),Balances:xT.describe("Balance details for each address holding the ANT."),Logo:gd.describe("Transaction ID of the ANT logo."),TotalSupply:Qt.number().describe("Total supply of the ANT in circulation.").min(0,{message:"Total supply must be a non-negative number"}),Initialized:Qt.boolean().describe("Flag indicating whether the ANT has been initialized.")}),v5e=["balance","balances","totalSupply","info","controllers","record","records","state"],m5e=["_eval","_default","transfer","addController","removeController","setRecord","removeRecord","setName","setTicker","setDescription","setKeywords","setLogo","initializeState","releaseName","reassignName","approvePrimaryName","removePrimaryNames"],g5e=[...v5e,...m5e],vQ=Qt.array(Qt.string({description:"Handler Name"})).refine(t=>g5e.every(e=>t.includes(e)),{message:"ANT is missing required handlers"}),gQ=Qt.object({Name:Qt.string().describe("The name of the ANT."),Owner:gd.describe("The Owners address."),Ticker:Qt.string().describe("The ticker symbol for the ANT."),"Total-Supply":pQ.describe("Total supply of the ANT in circulation."),Description:p5e.describe("The description for the ANT."),Keywords:mQ.describe("The keywords for the ANT."),Logo:gd.describe("Transaction ID of the ANT logo."),Denomination:pQ.describe("The number of decimal places to use for the ANT. Defaults to 0 if not set representing whole numbers."),Handlers:vQ.optional().describe("List of handlers for the ANT."),HandlerNames:vQ.optional().describe('Deprecated: List of handlers for the ANT. Use "Handlers" instead.')});function hut(t){return ST.safeParse(t).success}ie();ae();ne();ie();ae();ne();ie();ae();ne();ie();ae();ne();ie();ae();ne();var b5e=Object.create,aI=Object.defineProperty,y5e=Object.getOwnPropertyDescriptor,zQ=Object.getOwnPropertyNames,w5e=Object.getPrototypeOf,_5e=Object.prototype.hasOwnProperty,No=(t,e)=>function(){return e||(0,t[zQ(t)[0]])((e={exports:{}}).exports,e),e.exports},ZQ=(t,e)=>{for(var r in e)aI(t,r,{get:e[r],enumerable:!0})},M5e=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of zQ(e))!_5e.call(t,i)&&i!==r&&aI(t,i,{get:()=>e[i],enumerable:!(o=y5e(e,i))||o.enumerable});return t},oI=(t,e,r)=>(r=t!=null?b5e(w5e(t)):{},M5e(e||!t||!t.__esModule?aI(r,"default",{value:t,enumerable:!0}):r,t)),x5e=No({"node_modules/obliterator/iterator.js"(t,e){function r(o){if(typeof o!="function")throw new Error("obliterator/iterator: expecting a function!");this.next=o}typeof Symbol<"u"&&(r.prototype[Symbol.iterator]=function(){return this}),r.of=function(){var o=arguments,i=o.length,h=0;return new r(function(){return h>=i?{done:!0}:{done:!1,value:o[h++]}})},r.empty=function(){var o=new r(function(){return{done:!0}});return o},r.fromSequence=function(o){var i=0,h=o.length;return new r(function(){return i>=h?{done:!0}:{done:!1,value:o[i++]}})},r.is=function(o){return o instanceof r?!0:typeof o=="object"&&o!==null&&typeof o.next=="function"},e.exports=r}}),S5e=No({"node_modules/obliterator/support.js"(t){t.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<"u",t.SYMBOL_SUPPORT=typeof Symbol<"u"}}),sI=No({"node_modules/obliterator/foreach.js"(t,e){var r=S5e(),o=r.ARRAY_BUFFER_SUPPORT,i=r.SYMBOL_SUPPORT;e.exports=function(c,v){var b,g,_,M,x;if(!c)throw new Error("obliterator/forEach: invalid iterable.");if(typeof v!="function")throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(c)||o&&ArrayBuffer.isView(c)||typeof c=="string"||c.toString()==="[object Arguments]"){for(_=0,M=c.length;_<M;_++)v(c[_],_);return}if(typeof c.forEach=="function"){c.forEach(v);return}if(i&&Symbol.iterator in c&&typeof c.next!="function"&&(c=c[Symbol.iterator]()),typeof c.next=="function"){for(b=c,_=0;x=b.next(),x.done!==!0;)v(x.value,_),_++;return}for(g in c)c.hasOwnProperty(g)&&v(c[g],g)}}}),fI=No({"node_modules/mnemonist/utils/typed-arrays.js"(t){var e=Math.pow(2,8)-1,r=Math.pow(2,16)-1,o=Math.pow(2,32)-1,i=Math.pow(2,7)-1,h=Math.pow(2,15)-1,c=Math.pow(2,31)-1;t.getPointerArray=function(b){var g=b-1;if(g<=e)return Uint8Array;if(g<=r)return Uint16Array;if(g<=o)return Uint32Array;throw new Error("mnemonist: Pointer Array of size > 4294967295 is not supported.")},t.getSignedPointerArray=function(b){var g=b-1;return g<=i?Int8Array:g<=h?Int16Array:g<=c?Int32Array:Float64Array},t.getNumberType=function(b){return b===(b|0)?Math.sign(b)===-1?b<=127&&b>=-128?Int8Array:b<=32767&&b>=-32768?Int16Array:Int32Array:b<=255?Uint8Array:b<=65535?Uint16Array:Uint32Array:Float64Array};var v={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};t.getMinimalRepresentation=function(b,g){var _=null,M=0,x,E,A,I,P;for(I=0,P=b.length;I<P;I++)A=g?g(b[I]):b[I],E=t.getNumberType(A),x=v[E.name],x>M&&(M=x,_=E);return _},t.isTypedArray=function(b){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView(b)},t.concat=function(){var b=0,g,_,M;for(g=0,M=arguments.length;g<M;g++)b+=arguments[g].length;var x=new arguments[0].constructor(b);for(g=0,_=0;g<M;g++)x.set(arguments[g],_),_+=arguments[g].length;return x},t.indices=function(b){for(var g=t.getPointerArray(b),_=new g(b),M=0;M<b;M++)_[M]=M;return _}}}),HQ=No({"node_modules/mnemonist/utils/iterables.js"(t){var e=sI(),r=fI();function o(v){return Array.isArray(v)||r.isTypedArray(v)}function i(v){if(typeof v.length=="number")return v.length;if(typeof v.size=="number")return v.size}function h(v){var b=i(v),g=typeof b=="number"?new Array(b):[],_=0;return e(v,function(M){g[_++]=M}),g}function c(v){var b=i(v),g=typeof b=="number"?r.getPointerArray(b):Array,_=typeof b=="number"?new Array(b):[],M=typeof b=="number"?new g(b):[],x=0;return e(v,function(E){_[x]=E,M[x]=x++}),[_,M]}t.isArrayLike=o,t.guessLength=i,t.toArray=h,t.toArrayWithIndices=c}}),E5e=No({"node_modules/mnemonist/lru-cache.js"(t,e){var r=x5e(),o=sI(),i=fI(),h=HQ();function c(v,b,g){if(arguments.length<2&&(g=v,v=null,b=null),this.capacity=g,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-cache: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-cache: capacity should be a finite positive integer.");var _=i.getPointerArray(g);this.forward=new _(g),this.backward=new _(g),this.K=typeof v=="function"?new v(g):new Array(g),this.V=typeof b=="function"?new b(g):new Array(g),this.size=0,this.head=0,this.tail=0,this.items={}}c.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items={}},c.prototype.splayOnTop=function(v){var b=this.head;if(this.head===v)return this;var g=this.backward[v],_=this.forward[v];return this.tail===v?this.tail=g:this.backward[_]=g,this.forward[g]=_,this.backward[b]=v,this.head=v,this.forward[v]=b,this},c.prototype.set=function(v,b){var g=this.items[v];if(typeof g<"u"){this.splayOnTop(g),this.V[g]=b;return}this.size<this.capacity?g=this.size++:(g=this.tail,this.tail=this.backward[g],delete this.items[this.K[g]]),this.items[v]=g,this.K[g]=v,this.V[g]=b,this.forward[g]=this.head,this.backward[this.head]=g,this.head=g},c.prototype.setpop=function(v,b){var g=null,_=null,M=this.items[v];return typeof M<"u"?(this.splayOnTop(M),g=this.V[M],this.V[M]=b,{evicted:!1,key:v,value:g}):(this.size<this.capacity?M=this.size++:(M=this.tail,this.tail=this.backward[M],g=this.V[M],_=this.K[M],delete this.items[_]),this.items[v]=M,this.K[M]=v,this.V[M]=b,this.forward[M]=this.head,this.backward[this.head]=M,this.head=M,_?{evicted:!0,key:_,value:g}:null)},c.prototype.has=function(v){return v in this.items},c.prototype.get=function(v){var b=this.items[v];if(!(typeof b>"u"))return this.splayOnTop(b),this.V[b]},c.prototype.peek=function(v){var b=this.items[v];if(!(typeof b>"u"))return this.V[b]},c.prototype.forEach=function(v,b){b=arguments.length>1?b:this;for(var g=0,_=this.size,M=this.head,x=this.K,E=this.V,A=this.forward;g<_;)v.call(b,E[M],x[M],this),M=A[M],g++},c.prototype.keys=function(){var v=0,b=this.size,g=this.head,_=this.K,M=this.forward;return new r(function(){if(v>=b)return{done:!0};var x=_[g];return v++,v<b&&(g=M[g]),{done:!1,value:x}})},c.prototype.values=function(){var v=0,b=this.size,g=this.head,_=this.V,M=this.forward;return new r(function(){if(v>=b)return{done:!0};var x=_[g];return v++,v<b&&(g=M[g]),{done:!1,value:x}})},c.prototype.entries=function(){var v=0,b=this.size,g=this.head,_=this.K,M=this.V,x=this.forward;return new r(function(){if(v>=b)return{done:!0};var E=_[g],A=M[g];return v++,v<b&&(g=x[g]),{done:!1,value:[E,A]}})},typeof Symbol<"u"&&(c.prototype[Symbol.iterator]=c.prototype.entries),c.prototype.inspect=function(){for(var v=new Map,b=this.entries(),g;g=b.next(),!g.done;)v.set(g.value[0],g.value[1]);return Object.defineProperty(v,"constructor",{value:c,enumerable:!1}),v},typeof Symbol<"u"&&(c.prototype[Symbol.for("nodejs.util.inspect.custom")]=c.prototype.inspect),c.from=function(v,b,g,_){if(arguments.length<2){if(_=h.guessLength(v),typeof _!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(_=b,b=null,g=null);var M=new c(b,g,_);return o(v,function(x,E){M.set(E,x)}),M},e.exports=c}}),A5e=No({"node_modules/mnemonist/lru-map.js"(t,e){var r=E5e(),o=sI(),i=fI(),h=HQ();function c(v,b,g){if(arguments.length<2&&(g=v,v=null,b=null),this.capacity=g,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-map: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-map: capacity should be a finite positive integer.");var _=i.getPointerArray(g);this.forward=new _(g),this.backward=new _(g),this.K=typeof v=="function"?new v(g):new Array(g),this.V=typeof b=="function"?new b(g):new Array(g),this.size=0,this.head=0,this.tail=0,this.items=new Map}c.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items.clear()},c.prototype.set=function(v,b){var g=this.items.get(v);if(typeof g<"u"){this.splayOnTop(g),this.V[g]=b;return}this.size<this.capacity?g=this.size++:(g=this.tail,this.tail=this.backward[g],this.items.delete(this.K[g])),this.items.set(v,g),this.K[g]=v,this.V[g]=b,this.forward[g]=this.head,this.backward[this.head]=g,this.head=g},c.prototype.setpop=function(v,b){var g=null,_=null,M=this.items.get(v);return typeof M<"u"?(this.splayOnTop(M),g=this.V[M],this.V[M]=b,{evicted:!1,key:v,value:g}):(this.size<this.capacity?M=this.size++:(M=this.tail,this.tail=this.backward[M],g=this.V[M],_=this.K[M],this.items.delete(_)),this.items.set(v,M),this.K[M]=v,this.V[M]=b,this.forward[M]=this.head,this.backward[this.head]=M,this.head=M,_?{evicted:!0,key:_,value:g}:null)},c.prototype.has=function(v){return this.items.has(v)},c.prototype.get=function(v){var b=this.items.get(v);if(!(typeof b>"u"))return this.splayOnTop(b),this.V[b]},c.prototype.peek=function(v){var b=this.items.get(v);if(!(typeof b>"u"))return this.V[b]},c.prototype.splayOnTop=r.prototype.splayOnTop,c.prototype.forEach=r.prototype.forEach,c.prototype.keys=r.prototype.keys,c.prototype.values=r.prototype.values,c.prototype.entries=r.prototype.entries,typeof Symbol<"u"&&(c.prototype[Symbol.iterator]=c.prototype.entries),c.prototype.inspect=r.prototype.inspect,c.from=function(v,b,g,_){if(arguments.length<2){if(_=h.guessLength(v),typeof _!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(_=b,b=null,g=null);var M=new c(b,g,_);return o(v,function(x,E){M.set(E,x)}),M},e.exports=c}}),R5e=No({"node_modules/ms/index.js"(t,e){var r=1e3,o=r*60,i=o*60,h=i*24,c=h*7,v=h*365.25;e.exports=function(x,E){E=E||{};var A=typeof x;if(A==="string"&&x.length>0)return b(x);if(A==="number"&&isFinite(x))return E.long?_(x):g(x);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(x))};function b(x){if(x=String(x),!(x.length>100)){var E=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(x);if(E){var A=parseFloat(E[1]),I=(E[2]||"ms").toLowerCase();switch(I){case"years":case"year":case"yrs":case"yr":case"y":return A*v;case"weeks":case"week":case"w":return A*c;case"days":case"day":case"d":return A*h;case"hours":case"hour":case"hrs":case"hr":case"h":return A*i;case"minutes":case"minute":case"mins":case"min":case"m":return A*o;case"seconds":case"second":case"secs":case"sec":case"s":return A*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return A;default:return}}}}function g(x){var E=Math.abs(x);return E>=h?Math.round(x/h)+"d":E>=i?Math.round(x/i)+"h":E>=o?Math.round(x/o)+"m":E>=r?Math.round(x/r)+"s":x+"ms"}function _(x){var E=Math.abs(x);return E>=h?M(x,E,h,"day"):E>=i?M(x,E,i,"hour"):E>=o?M(x,E,o,"minute"):E>=r?M(x,E,r,"second"):x+" ms"}function M(x,E,A,I){var P=E>=A*1.5;return Math.round(x/A)+" "+I+(P?"s":"")}}}),T5e=No({"node_modules/debug/src/common.js"(t,e){function r(o){h.debug=h,h.default=h,h.coerce=M,h.disable=b,h.enable=v,h.enabled=g,h.humanize=R5e(),h.destroy=x,Object.keys(o).forEach(E=>{h[E]=o[E]}),h.names=[],h.skips=[],h.formatters={};function i(E){let A=0;for(let I=0;I<E.length;I++)A=(A<<5)-A+E.charCodeAt(I),A|=0;return h.colors[Math.abs(A)%h.colors.length]}h.selectColor=i;function h(E){let A,I=null,P,N;function L(...C){if(!L.enabled)return;let Y=L,G=Number(new Date),te=G-(A||G);Y.diff=te,Y.prev=A,Y.curr=G,A=G,C[0]=h.coerce(C[0]),typeof C[0]!="string"&&C.unshift("%O");let $=0;C[0]=C[0].replace(/%([a-zA-Z%])/g,(V,w)=>{if(V==="%%")return"%";$++;let n=h.formatters[w];if(typeof n=="function"){let s=C[$];V=n.call(Y,s),C.splice($,1),$--}return V}),h.formatArgs.call(Y,C),(Y.log||h.log).apply(Y,C)}return L.namespace=E,L.useColors=h.useColors(),L.color=h.selectColor(E),L.extend=c,L.destroy=h.destroy,Object.defineProperty(L,"enabled",{enumerable:!0,configurable:!1,get:()=>I!==null?I:(P!==h.namespaces&&(P=h.namespaces,N=h.enabled(E)),N),set:C=>{I=C}}),typeof h.init=="function"&&h.init(L),L}function c(E,A){let I=h(this.namespace+(typeof A>"u"?":":A)+E);return I.log=this.log,I}function v(E){h.save(E),h.namespaces=E,h.names=[],h.skips=[];let A,I=(typeof E=="string"?E:"").split(/[\s,]+/),P=I.length;for(A=0;A<P;A++)I[A]&&(E=I[A].replace(/\*/g,".*?"),E[0]==="-"?h.skips.push(new RegExp("^"+E.slice(1)+"$")):h.names.push(new RegExp("^"+E+"$")))}function b(){let E=[...h.names.map(_),...h.skips.map(_).map(A=>"-"+A)].join(",");return h.enable(""),E}function g(E){if(E[E.length-1]==="*")return!0;let A,I;for(A=0,I=h.skips.length;A<I;A++)if(h.skips[A].test(E))return!1;for(A=0,I=h.names.length;A<I;A++)if(h.names[A].test(E))return!0;return!1}function _(E){return E.toString().substring(2,E.toString().length-2).replace(/\.\*\?$/,"*")}function M(E){return E instanceof Error?E.stack||E.message:E}function x(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return h.enable(h.load()),h}e.exports=r}}),I5e=No({"node_modules/debug/src/browser.js"(t,e){t.formatArgs=o,t.save=i,t.load=h,t.useColors=r,t.storage=c(),t.destroy=(()=>{let b=!1;return()=>{b||(b=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function o(b){if(b[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+b[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;let g="color: "+this.color;b.splice(1,0,g,"color: inherit");let _=0,M=0;b[0].replace(/%[a-zA-Z%]/g,x=>{x!=="%%"&&(_++,x==="%c"&&(M=_))}),b.splice(M,0,g)}t.log=console.debug||console.log||(()=>{});function i(b){try{b?t.storage.setItem("debug",b):t.storage.removeItem("debug")}catch{}}function h(){let b;try{b=t.storage.getItem("debug")}catch{}return!b&&typeof He<"u"&&"env"in He&&(b=He.env.DEBUG),b}function c(){try{return localStorage}catch{}}e.exports=T5e()(t);var{formatters:v}=e.exports;v.j=function(b){try{return JSON.stringify(b)}catch(g){return"[UnexpectedJSONParseError]: "+g.message}}}}),k5e=No({"node_modules/base64-js/index.js"(t){"use strict";t.byteLength=b,t.toByteArray=_,t.fromByteArray=E;var e=[],r=[],o=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(h=0,c=i.length;h<c;++h)e[h]=i[h],r[i.charCodeAt(h)]=h;var h,c;r[45]=62,r[95]=63;function v(A){var I=A.length;if(I%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var P=A.indexOf("=");P===-1&&(P=I);var N=P===I?0:4-P%4;return[P,N]}function b(A){var I=v(A),P=I[0],N=I[1];return(P+N)*3/4-N}function g(A,I,P){return(I+P)*3/4-P}function _(A){var I,P=v(A),N=P[0],L=P[1],C=new o(g(A,N,L)),Y=0,G=L>0?N-4:N,te;for(te=0;te<G;te+=4)I=r[A.charCodeAt(te)]<<18|r[A.charCodeAt(te+1)]<<12|r[A.charCodeAt(te+2)]<<6|r[A.charCodeAt(te+3)],C[Y++]=I>>16&255,C[Y++]=I>>8&255,C[Y++]=I&255;return L===2&&(I=r[A.charCodeAt(te)]<<2|r[A.charCodeAt(te+1)]>>4,C[Y++]=I&255),L===1&&(I=r[A.charCodeAt(te)]<<10|r[A.charCodeAt(te+1)]<<4|r[A.charCodeAt(te+2)]>>2,C[Y++]=I>>8&255,C[Y++]=I&255),C}function M(A){return e[A>>18&63]+e[A>>12&63]+e[A>>6&63]+e[A&63]}function x(A,I,P){for(var N,L=[],C=I;C<P;C+=3)N=(A[C]<<16&16711680)+(A[C+1]<<8&65280)+(A[C+2]&255),L.push(M(N));return L.join("")}function E(A){for(var I,P=A.length,N=P%3,L=[],C=16383,Y=0,G=P-N;Y<G;Y+=C)L.push(x(A,Y,Y+C>G?G:Y+C));return N===1?(I=A[P-1],L.push(e[I>>2]+e[I<<4&63]+"==")):N===2&&(I=(A[P-2]<<8)+A[P-1],L.push(e[I>>10]+e[I>>4&63]+e[I<<2&63]+"=")),L.join("")}}}),B5e=No({"node_modules/ieee754/index.js"(t){t.read=function(e,r,o,i,h){var c,v,b=h*8-i-1,g=(1<<b)-1,_=g>>1,M=-7,x=o?h-1:0,E=o?-1:1,A=e[r+x];for(x+=E,c=A&(1<<-M)-1,A>>=-M,M+=b;M>0;c=c*256+e[r+x],x+=E,M-=8);for(v=c&(1<<-M)-1,c>>=-M,M+=i;M>0;v=v*256+e[r+x],x+=E,M-=8);if(c===0)c=1-_;else{if(c===g)return v?NaN:(A?-1:1)*(1/0);v=v+Math.pow(2,i),c=c-_}return(A?-1:1)*v*Math.pow(2,c-i)},t.write=function(e,r,o,i,h,c){var v,b,g,_=c*8-h-1,M=(1<<_)-1,x=M>>1,E=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=i?0:c-1,I=i?1:-1,P=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(b=isNaN(r)?1:0,v=M):(v=Math.floor(Math.log(r)/Math.LN2),r*(g=Math.pow(2,-v))<1&&(v--,g*=2),v+x>=1?r+=E/g:r+=E*Math.pow(2,1-x),r*g>=2&&(v++,g/=2),v+x>=M?(b=0,v=M):v+x>=1?(b=(r*g-1)*Math.pow(2,h),v=v+x):(b=r*Math.pow(2,x-1)*Math.pow(2,h),v=0));h>=8;e[o+A]=b&255,A+=I,b/=256,h-=8);for(v=v<<h|b,_+=h;_>0;e[o+A]=v&255,A+=I,v/=256,_-=8);e[o+A-I]|=P*128}}}),P5e=No({"node_modules/buffer/index.js"(t){"use strict";var e=k5e(),r=B5e(),o=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=v,t.SlowBuffer=L,t.INSPECT_MAX_BYTES=50;var i=2147483647;t.kMaxLength=i,v.TYPED_ARRAY_SUPPORT=h(),!v.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function h(){try{let T=new Uint8Array(1),k={foo:function(){return 42}};return Object.setPrototypeOf(k,Uint8Array.prototype),Object.setPrototypeOf(T,k),T.foo()===42}catch{return!1}}Object.defineProperty(v.prototype,"parent",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.buffer}}),Object.defineProperty(v.prototype,"offset",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.byteOffset}});function c(T){if(T>i)throw new RangeError('The value "'+T+'" is invalid for option "size"');let k=new Uint8Array(T);return Object.setPrototypeOf(k,v.prototype),k}function v(T,k,O){if(typeof T=="number"){if(typeof k=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return M(T)}return b(T,k,O)}v.poolSize=8192;function b(T,k,O){if(typeof T=="string")return x(T,k);if(ArrayBuffer.isView(T))return A(T);if(T==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T);if(ut(T,ArrayBuffer)||T&&ut(T.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ut(T,SharedArrayBuffer)||T&&ut(T.buffer,SharedArrayBuffer)))return I(T,k,O);if(typeof T=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let q=T.valueOf&&T.valueOf();if(q!=null&&q!==T)return v.from(q,k,O);let H=P(T);if(H)return H;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof T[Symbol.toPrimitive]=="function")return v.from(T[Symbol.toPrimitive]("string"),k,O);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T)}v.from=function(T,k,O){return b(T,k,O)},Object.setPrototypeOf(v.prototype,Uint8Array.prototype),Object.setPrototypeOf(v,Uint8Array);function g(T){if(typeof T!="number")throw new TypeError('"size" argument must be of type number');if(T<0)throw new RangeError('The value "'+T+'" is invalid for option "size"')}function _(T,k,O){return g(T),T<=0?c(T):k!==void 0?typeof O=="string"?c(T).fill(k,O):c(T).fill(k):c(T)}v.alloc=function(T,k,O){return _(T,k,O)};function M(T){return g(T),c(T<0?0:N(T)|0)}v.allocUnsafe=function(T){return M(T)},v.allocUnsafeSlow=function(T){return M(T)};function x(T,k){if((typeof k!="string"||k==="")&&(k="utf8"),!v.isEncoding(k))throw new TypeError("Unknown encoding: "+k);let O=C(T,k)|0,q=c(O),H=q.write(T,k);return H!==O&&(q=q.slice(0,H)),q}function E(T){let k=T.length<0?0:N(T.length)|0,O=c(k);for(let q=0;q<k;q+=1)O[q]=T[q]&255;return O}function A(T){if(ut(T,Uint8Array)){let k=new Uint8Array(T);return I(k.buffer,k.byteOffset,k.byteLength)}return E(T)}function I(T,k,O){if(k<0||T.byteLength<k)throw new RangeError('"offset" is outside of buffer bounds');if(T.byteLength<k+(O||0))throw new RangeError('"length" is outside of buffer bounds');let q;return k===void 0&&O===void 0?q=new Uint8Array(T):O===void 0?q=new Uint8Array(T,k):q=new Uint8Array(T,k,O),Object.setPrototypeOf(q,v.prototype),q}function P(T){if(v.isBuffer(T)){let k=N(T.length)|0,O=c(k);return O.length===0||T.copy(O,0,0,k),O}if(T.length!==void 0)return typeof T.length!="number"||Ae(T.length)?c(0):E(T);if(T.type==="Buffer"&&Array.isArray(T.data))return E(T.data)}function N(T){if(T>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return T|0}function L(T){return+T!=T&&(T=0),v.alloc(+T)}v.isBuffer=function(k){return k!=null&&k._isBuffer===!0&&k!==v.prototype},v.compare=function(k,O){if(ut(k,Uint8Array)&&(k=v.from(k,k.offset,k.byteLength)),ut(O,Uint8Array)&&(O=v.from(O,O.offset,O.byteLength)),!v.isBuffer(k)||!v.isBuffer(O))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(k===O)return 0;let q=k.length,H=O.length;for(let W=0,se=Math.min(q,H);W<se;++W)if(k[W]!==O[W]){q=k[W],H=O[W];break}return q<H?-1:H<q?1:0},v.isEncoding=function(k){switch(String(k).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},v.concat=function(k,O){if(!Array.isArray(k))throw new TypeError('"list" argument must be an Array of Buffers');if(k.length===0)return v.alloc(0);let q;if(O===void 0)for(O=0,q=0;q<k.length;++q)O+=k[q].length;let H=v.allocUnsafe(O),W=0;for(q=0;q<k.length;++q){let se=k[q];if(ut(se,Uint8Array))W+se.length>H.length?(v.isBuffer(se)||(se=v.from(se)),se.copy(H,W)):Uint8Array.prototype.set.call(H,se,W);else if(v.isBuffer(se))se.copy(H,W);else throw new TypeError('"list" argument must be an Array of Buffers');W+=se.length}return H};function C(T,k){if(v.isBuffer(T))return T.length;if(ArrayBuffer.isView(T)||ut(T,ArrayBuffer))return T.byteLength;if(typeof T!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof T);let O=T.length,q=arguments.length>2&&arguments[2]===!0;if(!q&&O===0)return 0;let H=!1;for(;;)switch(k){case"ascii":case"latin1":case"binary":return O;case"utf8":case"utf-8":return oe(T).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O*2;case"hex":return O>>>1;case"base64":return ge(T).length;default:if(H)return q?-1:oe(T).length;k=(""+k).toLowerCase(),H=!0}}v.byteLength=C;function Y(T,k,O){let q=!1;if((k===void 0||k<0)&&(k=0),k>this.length||((O===void 0||O>this.length)&&(O=this.length),O<=0)||(O>>>=0,k>>>=0,O<=k))return"";for(T||(T="utf8");;)switch(T){case"hex":return a(this,k,O);case"utf8":case"utf-8":return u(this,k,O);case"ascii":return y(this,k,O);case"latin1":case"binary":return d(this,k,O);case"base64":return f(this,k,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return p(this,k,O);default:if(q)throw new TypeError("Unknown encoding: "+T);T=(T+"").toLowerCase(),q=!0}}v.prototype._isBuffer=!0;function G(T,k,O){let q=T[k];T[k]=T[O],T[O]=q}v.prototype.swap16=function(){let k=this.length;if(k%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let O=0;O<k;O+=2)G(this,O,O+1);return this},v.prototype.swap32=function(){let k=this.length;if(k%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let O=0;O<k;O+=4)G(this,O,O+3),G(this,O+1,O+2);return this},v.prototype.swap64=function(){let k=this.length;if(k%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let O=0;O<k;O+=8)G(this,O,O+7),G(this,O+1,O+6),G(this,O+2,O+5),G(this,O+3,O+4);return this},v.prototype.toString=function(){let k=this.length;return k===0?"":arguments.length===0?u(this,0,k):Y.apply(this,arguments)},v.prototype.toLocaleString=v.prototype.toString,v.prototype.equals=function(k){if(!v.isBuffer(k))throw new TypeError("Argument must be a Buffer");return this===k?!0:v.compare(this,k)===0},v.prototype.inspect=function(){let k="",O=t.INSPECT_MAX_BYTES;return k=this.toString("hex",0,O).replace(/(.{2})/g,"$1 ").trim(),this.length>O&&(k+=" ... "),"<Buffer "+k+">"},o&&(v.prototype[o]=v.prototype.inspect),v.prototype.compare=function(k,O,q,H,W){if(ut(k,Uint8Array)&&(k=v.from(k,k.offset,k.byteLength)),!v.isBuffer(k))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof k);if(O===void 0&&(O=0),q===void 0&&(q=k?k.length:0),H===void 0&&(H=0),W===void 0&&(W=this.length),O<0||q>k.length||H<0||W>this.length)throw new RangeError("out of range index");if(H>=W&&O>=q)return 0;if(H>=W)return-1;if(O>=q)return 1;if(O>>>=0,q>>>=0,H>>>=0,W>>>=0,this===k)return 0;let se=W-H,st=q-O,ue=Math.min(se,st),pe=this.slice(H,W),ve=k.slice(O,q);for(let be=0;be<ue;++be)if(pe[be]!==ve[be]){se=pe[be],st=ve[be];break}return se<st?-1:st<se?1:0};function te(T,k,O,q,H){if(T.length===0)return-1;if(typeof O=="string"?(q=O,O=0):O>2147483647?O=2147483647:O<-2147483648&&(O=-2147483648),O=+O,Ae(O)&&(O=H?0:T.length-1),O<0&&(O=T.length+O),O>=T.length){if(H)return-1;O=T.length-1}else if(O<0)if(H)O=0;else return-1;if(typeof k=="string"&&(k=v.from(k,q)),v.isBuffer(k))return k.length===0?-1:$(T,k,O,q,H);if(typeof k=="number")return k=k&255,typeof Uint8Array.prototype.indexOf=="function"?H?Uint8Array.prototype.indexOf.call(T,k,O):Uint8Array.prototype.lastIndexOf.call(T,k,O):$(T,[k],O,q,H);throw new TypeError("val must be string, number or Buffer")}function $(T,k,O,q,H){let W=1,se=T.length,st=k.length;if(q!==void 0&&(q=String(q).toLowerCase(),q==="ucs2"||q==="ucs-2"||q==="utf16le"||q==="utf-16le")){if(T.length<2||k.length<2)return-1;W=2,se/=2,st/=2,O/=2}function ue(ve,be){return W===1?ve[be]:ve.readUInt16BE(be*W)}let pe;if(H){let ve=-1;for(pe=O;pe<se;pe++)if(ue(T,pe)===ue(k,ve===-1?0:pe-ve)){if(ve===-1&&(ve=pe),pe-ve+1===st)return ve*W}else ve!==-1&&(pe-=pe-ve),ve=-1}else for(O+st>se&&(O=se-st),pe=O;pe>=0;pe--){let ve=!0;for(let be=0;be<st;be++)if(ue(T,pe+be)!==ue(k,be)){ve=!1;break}if(ve)return pe}return-1}v.prototype.includes=function(k,O,q){return this.indexOf(k,O,q)!==-1},v.prototype.indexOf=function(k,O,q){return te(this,k,O,q,!0)},v.prototype.lastIndexOf=function(k,O,q){return te(this,k,O,q,!1)};function F(T,k,O,q){O=Number(O)||0;let H=T.length-O;q?(q=Number(q),q>H&&(q=H)):q=H;let W=k.length;q>W/2&&(q=W/2);let se;for(se=0;se<q;++se){let st=parseInt(k.substr(se*2,2),16);if(Ae(st))return se;T[O+se]=st}return se}function V(T,k,O,q){return xe(oe(k,T.length-O),T,O,q)}function w(T,k,O,q){return xe(le(k),T,O,q)}function n(T,k,O,q){return xe(ge(k),T,O,q)}function s(T,k,O,q){return xe(ot(k,T.length-O),T,O,q)}v.prototype.write=function(k,O,q,H){if(O===void 0)H="utf8",q=this.length,O=0;else if(q===void 0&&typeof O=="string")H=O,q=this.length,O=0;else if(isFinite(O))O=O>>>0,isFinite(q)?(q=q>>>0,H===void 0&&(H="utf8")):(H=q,q=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let W=this.length-O;if((q===void 0||q>W)&&(q=W),k.length>0&&(q<0||O<0)||O>this.length)throw new RangeError("Attempt to write outside buffer bounds");H||(H="utf8");let se=!1;for(;;)switch(H){case"hex":return F(this,k,O,q);case"utf8":case"utf-8":return V(this,k,O,q);case"ascii":case"latin1":case"binary":return w(this,k,O,q);case"base64":return n(this,k,O,q);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s(this,k,O,q);default:if(se)throw new TypeError("Unknown encoding: "+H);H=(""+H).toLowerCase(),se=!0}},v.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function f(T,k,O){return k===0&&O===T.length?e.fromByteArray(T):e.fromByteArray(T.slice(k,O))}function u(T,k,O){O=Math.min(T.length,O);let q=[],H=k;for(;H<O;){let W=T[H],se=null,st=W>239?4:W>223?3:W>191?2:1;if(H+st<=O){let ue,pe,ve,be;switch(st){case 1:W<128&&(se=W);break;case 2:ue=T[H+1],(ue&192)===128&&(be=(W&31)<<6|ue&63,be>127&&(se=be));break;case 3:ue=T[H+1],pe=T[H+2],(ue&192)===128&&(pe&192)===128&&(be=(W&15)<<12|(ue&63)<<6|pe&63,be>2047&&(be<55296||be>57343)&&(se=be));break;case 4:ue=T[H+1],pe=T[H+2],ve=T[H+3],(ue&192)===128&&(pe&192)===128&&(ve&192)===128&&(be=(W&15)<<18|(ue&63)<<12|(pe&63)<<6|ve&63,be>65535&&be<1114112&&(se=be))}}se===null?(se=65533,st=1):se>65535&&(se-=65536,q.push(se>>>10&1023|55296),se=56320|se&1023),q.push(se),H+=st}return m(q)}var l=4096;function m(T){let k=T.length;if(k<=l)return String.fromCharCode.apply(String,T);let O="",q=0;for(;q<k;)O+=String.fromCharCode.apply(String,T.slice(q,q+=l));return O}function y(T,k,O){let q="";O=Math.min(T.length,O);for(let H=k;H<O;++H)q+=String.fromCharCode(T[H]&127);return q}function d(T,k,O){let q="";O=Math.min(T.length,O);for(let H=k;H<O;++H)q+=String.fromCharCode(T[H]);return q}function a(T,k,O){let q=T.length;(!k||k<0)&&(k=0),(!O||O<0||O>q)&&(O=q);let H="";for(let W=k;W<O;++W)H+=Ge[T[W]];return H}function p(T,k,O){let q=T.slice(k,O),H="";for(let W=0;W<q.length-1;W+=2)H+=String.fromCharCode(q[W]+q[W+1]*256);return H}v.prototype.slice=function(k,O){let q=this.length;k=~~k,O=O===void 0?q:~~O,k<0?(k+=q,k<0&&(k=0)):k>q&&(k=q),O<0?(O+=q,O<0&&(O=0)):O>q&&(O=q),O<k&&(O=k);let H=this.subarray(k,O);return Object.setPrototypeOf(H,v.prototype),H};function R(T,k,O){if(T%1!==0||T<0)throw new RangeError("offset is not uint");if(T+k>O)throw new RangeError("Trying to access beyond buffer length")}v.prototype.readUintLE=v.prototype.readUIntLE=function(k,O,q){k=k>>>0,O=O>>>0,q||R(k,O,this.length);let H=this[k],W=1,se=0;for(;++se<O&&(W*=256);)H+=this[k+se]*W;return H},v.prototype.readUintBE=v.prototype.readUIntBE=function(k,O,q){k=k>>>0,O=O>>>0,q||R(k,O,this.length);let H=this[k+--O],W=1;for(;O>0&&(W*=256);)H+=this[k+--O]*W;return H},v.prototype.readUint8=v.prototype.readUInt8=function(k,O){return k=k>>>0,O||R(k,1,this.length),this[k]},v.prototype.readUint16LE=v.prototype.readUInt16LE=function(k,O){return k=k>>>0,O||R(k,2,this.length),this[k]|this[k+1]<<8},v.prototype.readUint16BE=v.prototype.readUInt16BE=function(k,O){return k=k>>>0,O||R(k,2,this.length),this[k]<<8|this[k+1]},v.prototype.readUint32LE=v.prototype.readUInt32LE=function(k,O){return k=k>>>0,O||R(k,4,this.length),(this[k]|this[k+1]<<8|this[k+2]<<16)+this[k+3]*16777216},v.prototype.readUint32BE=v.prototype.readUInt32BE=function(k,O){return k=k>>>0,O||R(k,4,this.length),this[k]*16777216+(this[k+1]<<16|this[k+2]<<8|this[k+3])},v.prototype.readBigUInt64LE=lt(function(k){k=k>>>0,J(k,"offset");let O=this[k],q=this[k+7];(O===void 0||q===void 0)&&X(k,this.length-8);let H=O+this[++k]*2**8+this[++k]*2**16+this[++k]*2**24,W=this[++k]+this[++k]*2**8+this[++k]*2**16+q*2**24;return BigInt(H)+(BigInt(W)<<BigInt(32))}),v.prototype.readBigUInt64BE=lt(function(k){k=k>>>0,J(k,"offset");let O=this[k],q=this[k+7];(O===void 0||q===void 0)&&X(k,this.length-8);let H=O*2**24+this[++k]*2**16+this[++k]*2**8+this[++k],W=this[++k]*2**24+this[++k]*2**16+this[++k]*2**8+q;return(BigInt(H)<<BigInt(32))+BigInt(W)}),v.prototype.readIntLE=function(k,O,q){k=k>>>0,O=O>>>0,q||R(k,O,this.length);let H=this[k],W=1,se=0;for(;++se<O&&(W*=256);)H+=this[k+se]*W;return W*=128,H>=W&&(H-=Math.pow(2,8*O)),H},v.prototype.readIntBE=function(k,O,q){k=k>>>0,O=O>>>0,q||R(k,O,this.length);let H=O,W=1,se=this[k+--H];for(;H>0&&(W*=256);)se+=this[k+--H]*W;return W*=128,se>=W&&(se-=Math.pow(2,8*O)),se},v.prototype.readInt8=function(k,O){return k=k>>>0,O||R(k,1,this.length),this[k]&128?(255-this[k]+1)*-1:this[k]},v.prototype.readInt16LE=function(k,O){k=k>>>0,O||R(k,2,this.length);let q=this[k]|this[k+1]<<8;return q&32768?q|4294901760:q},v.prototype.readInt16BE=function(k,O){k=k>>>0,O||R(k,2,this.length);let q=this[k+1]|this[k]<<8;return q&32768?q|4294901760:q},v.prototype.readInt32LE=function(k,O){return k=k>>>0,O||R(k,4,this.length),this[k]|this[k+1]<<8|this[k+2]<<16|this[k+3]<<24},v.prototype.readInt32BE=function(k,O){return k=k>>>0,O||R(k,4,this.length),this[k]<<24|this[k+1]<<16|this[k+2]<<8|this[k+3]},v.prototype.readBigInt64LE=lt(function(k){k=k>>>0,J(k,"offset");let O=this[k],q=this[k+7];(O===void 0||q===void 0)&&X(k,this.length-8);let H=this[k+4]+this[k+5]*2**8+this[k+6]*2**16+(q<<24);return(BigInt(H)<<BigInt(32))+BigInt(O+this[++k]*2**8+this[++k]*2**16+this[++k]*2**24)}),v.prototype.readBigInt64BE=lt(function(k){k=k>>>0,J(k,"offset");let O=this[k],q=this[k+7];(O===void 0||q===void 0)&&X(k,this.length-8);let H=(O<<24)+this[++k]*2**16+this[++k]*2**8+this[++k];return(BigInt(H)<<BigInt(32))+BigInt(this[++k]*2**24+this[++k]*2**16+this[++k]*2**8+q)}),v.prototype.readFloatLE=function(k,O){return k=k>>>0,O||R(k,4,this.length),r.read(this,k,!0,23,4)},v.prototype.readFloatBE=function(k,O){return k=k>>>0,O||R(k,4,this.length),r.read(this,k,!1,23,4)},v.prototype.readDoubleLE=function(k,O){return k=k>>>0,O||R(k,8,this.length),r.read(this,k,!0,52,8)},v.prototype.readDoubleBE=function(k,O){return k=k>>>0,O||R(k,8,this.length),r.read(this,k,!1,52,8)};function S(T,k,O,q,H,W){if(!v.isBuffer(T))throw new TypeError('"buffer" argument must be a Buffer instance');if(k>H||k<W)throw new RangeError('"value" argument is out of bounds');if(O+q>T.length)throw new RangeError("Index out of range")}v.prototype.writeUintLE=v.prototype.writeUIntLE=function(k,O,q,H){if(k=+k,O=O>>>0,q=q>>>0,!H){let st=Math.pow(2,8*q)-1;S(this,k,O,q,st,0)}let W=1,se=0;for(this[O]=k&255;++se<q&&(W*=256);)this[O+se]=k/W&255;return O+q},v.prototype.writeUintBE=v.prototype.writeUIntBE=function(k,O,q,H){if(k=+k,O=O>>>0,q=q>>>0,!H){let st=Math.pow(2,8*q)-1;S(this,k,O,q,st,0)}let W=q-1,se=1;for(this[O+W]=k&255;--W>=0&&(se*=256);)this[O+W]=k/se&255;return O+q},v.prototype.writeUint8=v.prototype.writeUInt8=function(k,O,q){return k=+k,O=O>>>0,q||S(this,k,O,1,255,0),this[O]=k&255,O+1},v.prototype.writeUint16LE=v.prototype.writeUInt16LE=function(k,O,q){return k=+k,O=O>>>0,q||S(this,k,O,2,65535,0),this[O]=k&255,this[O+1]=k>>>8,O+2},v.prototype.writeUint16BE=v.prototype.writeUInt16BE=function(k,O,q){return k=+k,O=O>>>0,q||S(this,k,O,2,65535,0),this[O]=k>>>8,this[O+1]=k&255,O+2},v.prototype.writeUint32LE=v.prototype.writeUInt32LE=function(k,O,q){return k=+k,O=O>>>0,q||S(this,k,O,4,4294967295,0),this[O+3]=k>>>24,this[O+2]=k>>>16,this[O+1]=k>>>8,this[O]=k&255,O+4},v.prototype.writeUint32BE=v.prototype.writeUInt32BE=function(k,O,q){return k=+k,O=O>>>0,q||S(this,k,O,4,4294967295,0),this[O]=k>>>24,this[O+1]=k>>>16,this[O+2]=k>>>8,this[O+3]=k&255,O+4};function B(T,k,O,q,H){j(k,q,H,T,O,7);let W=Number(k&BigInt(4294967295));T[O++]=W,W=W>>8,T[O++]=W,W=W>>8,T[O++]=W,W=W>>8,T[O++]=W;let se=Number(k>>BigInt(32)&BigInt(4294967295));return T[O++]=se,se=se>>8,T[O++]=se,se=se>>8,T[O++]=se,se=se>>8,T[O++]=se,O}function U(T,k,O,q,H){j(k,q,H,T,O,7);let W=Number(k&BigInt(4294967295));T[O+7]=W,W=W>>8,T[O+6]=W,W=W>>8,T[O+5]=W,W=W>>8,T[O+4]=W;let se=Number(k>>BigInt(32)&BigInt(4294967295));return T[O+3]=se,se=se>>8,T[O+2]=se,se=se>>8,T[O+1]=se,se=se>>8,T[O]=se,O+8}v.prototype.writeBigUInt64LE=lt(function(k,O=0){return B(this,k,O,BigInt(0),BigInt("0xffffffffffffffff"))}),v.prototype.writeBigUInt64BE=lt(function(k,O=0){return U(this,k,O,BigInt(0),BigInt("0xffffffffffffffff"))}),v.prototype.writeIntLE=function(k,O,q,H){if(k=+k,O=O>>>0,!H){let ue=Math.pow(2,8*q-1);S(this,k,O,q,ue-1,-ue)}let W=0,se=1,st=0;for(this[O]=k&255;++W<q&&(se*=256);)k<0&&st===0&&this[O+W-1]!==0&&(st=1),this[O+W]=(k/se>>0)-st&255;return O+q},v.prototype.writeIntBE=function(k,O,q,H){if(k=+k,O=O>>>0,!H){let ue=Math.pow(2,8*q-1);S(this,k,O,q,ue-1,-ue)}let W=q-1,se=1,st=0;for(this[O+W]=k&255;--W>=0&&(se*=256);)k<0&&st===0&&this[O+W+1]!==0&&(st=1),this[O+W]=(k/se>>0)-st&255;return O+q},v.prototype.writeInt8=function(k,O,q){return k=+k,O=O>>>0,q||S(this,k,O,1,127,-128),k<0&&(k=255+k+1),this[O]=k&255,O+1},v.prototype.writeInt16LE=function(k,O,q){return k=+k,O=O>>>0,q||S(this,k,O,2,32767,-32768),this[O]=k&255,this[O+1]=k>>>8,O+2},v.prototype.writeInt16BE=function(k,O,q){return k=+k,O=O>>>0,q||S(this,k,O,2,32767,-32768),this[O]=k>>>8,this[O+1]=k&255,O+2},v.prototype.writeInt32LE=function(k,O,q){return k=+k,O=O>>>0,q||S(this,k,O,4,2147483647,-2147483648),this[O]=k&255,this[O+1]=k>>>8,this[O+2]=k>>>16,this[O+3]=k>>>24,O+4},v.prototype.writeInt32BE=function(k,O,q){return k=+k,O=O>>>0,q||S(this,k,O,4,2147483647,-2147483648),k<0&&(k=4294967295+k+1),this[O]=k>>>24,this[O+1]=k>>>16,this[O+2]=k>>>8,this[O+3]=k&255,O+4},v.prototype.writeBigInt64LE=lt(function(k,O=0){return B(this,k,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),v.prototype.writeBigInt64BE=lt(function(k,O=0){return U(this,k,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function D(T,k,O,q,H,W){if(O+q>T.length)throw new RangeError("Index out of range");if(O<0)throw new RangeError("Index out of range")}function re(T,k,O,q,H){return k=+k,O=O>>>0,H||D(T,k,O,4,34028234663852886e22,-34028234663852886e22),r.write(T,k,O,q,23,4),O+4}v.prototype.writeFloatLE=function(k,O,q){return re(this,k,O,!0,q)},v.prototype.writeFloatBE=function(k,O,q){return re(this,k,O,!1,q)};function Q(T,k,O,q,H){return k=+k,O=O>>>0,H||D(T,k,O,8,17976931348623157e292,-17976931348623157e292),r.write(T,k,O,q,52,8),O+8}v.prototype.writeDoubleLE=function(k,O,q){return Q(this,k,O,!0,q)},v.prototype.writeDoubleBE=function(k,O,q){return Q(this,k,O,!1,q)},v.prototype.copy=function(k,O,q,H){if(!v.isBuffer(k))throw new TypeError("argument should be a Buffer");if(q||(q=0),!H&&H!==0&&(H=this.length),O>=k.length&&(O=k.length),O||(O=0),H>0&&H<q&&(H=q),H===q||k.length===0||this.length===0)return 0;if(O<0)throw new RangeError("targetStart out of bounds");if(q<0||q>=this.length)throw new RangeError("Index out of range");if(H<0)throw new RangeError("sourceEnd out of bounds");H>this.length&&(H=this.length),k.length-O<H-q&&(H=k.length-O+q);let W=H-q;return this===k&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(O,q,H):Uint8Array.prototype.set.call(k,this.subarray(q,H),O),W},v.prototype.fill=function(k,O,q,H){if(typeof k=="string"){if(typeof O=="string"?(H=O,O=0,q=this.length):typeof q=="string"&&(H=q,q=this.length),H!==void 0&&typeof H!="string")throw new TypeError("encoding must be a string");if(typeof H=="string"&&!v.isEncoding(H))throw new TypeError("Unknown encoding: "+H);if(k.length===1){let se=k.charCodeAt(0);(H==="utf8"&&se<128||H==="latin1")&&(k=se)}}else typeof k=="number"?k=k&255:typeof k=="boolean"&&(k=Number(k));if(O<0||this.length<O||this.length<q)throw new RangeError("Out of range index");if(q<=O)return this;O=O>>>0,q=q===void 0?this.length:q>>>0,k||(k=0);let W;if(typeof k=="number")for(W=O;W<q;++W)this[W]=k;else{let se=v.isBuffer(k)?k:v.from(k,H),st=se.length;if(st===0)throw new TypeError('The value "'+k+'" is invalid for argument "value"');for(W=0;W<q-O;++W)this[W+O]=se[W%st]}return this};var Z={};function K(T,k,O){Z[T]=class extends O{constructor(){super(),Object.defineProperty(this,"message",{value:k.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${T}]`,this.stack,delete this.name}get code(){return T}set code(H){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:H,writable:!0})}toString(){return`${this.name} [${T}]: ${this.message}`}}}K("ERR_BUFFER_OUT_OF_BOUNDS",function(T){return T?`${T} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),K("ERR_INVALID_ARG_TYPE",function(T,k){return`The "${T}" argument must be of type number. Received type ${typeof k}`},TypeError),K("ERR_OUT_OF_RANGE",function(T,k,O){let q=`The value of "${T}" is out of range.`,H=O;return Number.isInteger(O)&&Math.abs(O)>2**32?H=ce(String(O)):typeof O=="bigint"&&(H=String(O),(O>BigInt(2)**BigInt(32)||O<-(BigInt(2)**BigInt(32)))&&(H=ce(H)),H+="n"),q+=` It must be ${k}. Received ${H}`,q},RangeError);function ce(T){let k="",O=T.length,q=T[0]==="-"?1:0;for(;O>=q+4;O-=3)k=`_${T.slice(O-3,O)}${k}`;return`${T.slice(0,O)}${k}`}function ee(T,k,O){J(k,"offset"),(T[k]===void 0||T[k+O]===void 0)&&X(k,T.length-(O+1))}function j(T,k,O,q,H,W){if(T>O||T<k){let se=typeof k=="bigint"?"n":"",st;throw W>3?k===0||k===BigInt(0)?st=`>= 0${se} and < 2${se} ** ${(W+1)*8}${se}`:st=`>= -(2${se} ** ${(W+1)*8-1}${se}) and < 2 ** ${(W+1)*8-1}${se}`:st=`>= ${k}${se} and <= ${O}${se}`,new Z.ERR_OUT_OF_RANGE("value",st,T)}ee(q,H,W)}function J(T,k){if(typeof T!="number")throw new Z.ERR_INVALID_ARG_TYPE(k,"number",T)}function X(T,k,O){throw Math.floor(T)!==T?(J(T,O),new Z.ERR_OUT_OF_RANGE(O||"offset","an integer",T)):k<0?new Z.ERR_BUFFER_OUT_OF_BOUNDS:new Z.ERR_OUT_OF_RANGE(O||"offset",`>= ${O?1:0} and <= ${k}`,T)}var he=/[^+/0-9A-Za-z-_]/g;function Ie(T){if(T=T.split("=")[0],T=T.trim().replace(he,""),T.length<2)return"";for(;T.length%4!==0;)T=T+"=";return T}function oe(T,k){k=k||1/0;let O,q=T.length,H=null,W=[];for(let se=0;se<q;++se){if(O=T.charCodeAt(se),O>55295&&O<57344){if(!H){if(O>56319){(k-=3)>-1&&W.push(239,191,189);continue}else if(se+1===q){(k-=3)>-1&&W.push(239,191,189);continue}H=O;continue}if(O<56320){(k-=3)>-1&&W.push(239,191,189),H=O;continue}O=(H-55296<<10|O-56320)+65536}else H&&(k-=3)>-1&&W.push(239,191,189);if(H=null,O<128){if((k-=1)<0)break;W.push(O)}else if(O<2048){if((k-=2)<0)break;W.push(O>>6|192,O&63|128)}else if(O<65536){if((k-=3)<0)break;W.push(O>>12|224,O>>6&63|128,O&63|128)}else if(O<1114112){if((k-=4)<0)break;W.push(O>>18|240,O>>12&63|128,O>>6&63|128,O&63|128)}else throw new Error("Invalid code point")}return W}function le(T){let k=[];for(let O=0;O<T.length;++O)k.push(T.charCodeAt(O)&255);return k}function ot(T,k){let O,q,H,W=[];for(let se=0;se<T.length&&!((k-=2)<0);++se)O=T.charCodeAt(se),q=O>>8,H=O%256,W.push(H),W.push(q);return W}function ge(T){return e.toByteArray(Ie(T))}function xe(T,k,O,q){let H;for(H=0;H<q&&!(H+O>=k.length||H>=T.length);++H)k[H+O]=T[H];return H}function ut(T,k){return T instanceof k||T!=null&&T.constructor!=null&&T.constructor.name!=null&&T.constructor.name===k.name}function Ae(T){return T!==T}var Ge=function(){let T="0123456789abcdef",k=new Array(256);for(let O=0;O<16;++O){let q=O*16;for(let H=0;H<16;++H)k[q+H]=T[O]+T[H]}return k}();function lt(T){return typeof BigInt>"u"?z:T}function z(){throw new Error("BigInt not supported")}}}),O5e={"@@functional/placeholder":!0};function Vi(t){return t===O5e}function $a(t){return function e(r){return arguments.length===0||Vi(r)?e:t.apply(this,arguments)}}function $n(t){return function e(r,o){switch(arguments.length){case 0:return e;case 1:return Vi(r)?e:$a(function(i){return t(r,i)});default:return Vi(r)&&Vi(o)?e:Vi(r)?$a(function(i){return t(i,o)}):Vi(o)?$a(function(i){return t(r,i)}):t(r,o)}}}function mw(t,e){switch(t){case 0:return function(){return e.apply(this,arguments)};case 1:return function(r){return e.apply(this,arguments)};case 2:return function(r,o){return e.apply(this,arguments)};case 3:return function(r,o,i){return e.apply(this,arguments)};case 4:return function(r,o,i,h){return e.apply(this,arguments)};case 5:return function(r,o,i,h,c){return e.apply(this,arguments)};case 6:return function(r,o,i,h,c,v){return e.apply(this,arguments)};case 7:return function(r,o,i,h,c,v,b){return e.apply(this,arguments)};case 8:return function(r,o,i,h,c,v,b,g){return e.apply(this,arguments)};case 9:return function(r,o,i,h,c,v,b,g,_){return e.apply(this,arguments)};case 10:return function(r,o,i,h,c,v,b,g,_,M){return e.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}function KQ(t,e,r){return function(){for(var o=[],i=0,h=t,c=0,v=!1;c<e.length||i<arguments.length;){var b;c<e.length&&(!Vi(e[c])||i>=arguments.length)?b=e[c]:(b=arguments[i],i+=1),o[c]=b,Vi(b)?v=!0:h-=1,c+=1}return!v&&h<=0?r.apply(this,o):mw(Math.max(0,h),KQ(t,o,r))}}var N5e=$n(function(t,e){return t===1?$a(e):mw(t,KQ(t,[],e))}),WQ=N5e;function uI(t){return function e(r,o,i){switch(arguments.length){case 0:return e;case 1:return Vi(r)?e:$n(function(h,c){return t(r,h,c)});case 2:return Vi(r)&&Vi(o)?e:Vi(r)?$n(function(h,c){return t(h,o,c)}):Vi(o)?$n(function(h,c){return t(r,h,c)}):$a(function(h){return t(r,o,h)});default:return Vi(r)&&Vi(o)&&Vi(i)?e:Vi(r)&&Vi(o)?$n(function(h,c){return t(h,c,i)}):Vi(r)&&Vi(i)?$n(function(h,c){return t(h,o,c)}):Vi(o)&&Vi(i)?$n(function(h,c){return t(r,h,c)}):Vi(r)?$a(function(h){return t(h,o,i)}):Vi(o)?$a(function(h){return t(r,h,i)}):Vi(i)?$a(function(h){return t(r,o,h)}):t(r,o,i)}}}var hI=Array.isArray||function(t){return t!=null&&t.length>=0&&Object.prototype.toString.call(t)==="[object Array]"};function C5e(t){return t!=null&&typeof t["@@transducer/step"]=="function"}function lI(t,e,r){return function(){if(arguments.length===0)return r();var o=arguments[arguments.length-1];if(!hI(o)){for(var i=0;i<t.length;){if(typeof o[t[i]]=="function")return o[t[i]].apply(o,Array.prototype.slice.call(arguments,0,-1));i+=1}if(C5e(o)){var h=e.apply(null,Array.prototype.slice.call(arguments,0,-1));return h(o)}}return r.apply(this,arguments)}}function L5e(t){return t&&t["@@transducer/reduced"]?t:{"@@transducer/value":t,"@@transducer/reduced":!0}}var Vg={init:function(){return this.xf["@@transducer/init"]()},result:function(t){return this.xf["@@transducer/result"](t)}};function bQ(t){for(var e=[],r;!(r=t.next()).done;)e.push(r.value);return e}function yQ(t,e,r){for(var o=0,i=r.length;o<i;){if(t(e,r[o]))return!0;o+=1}return!1}function D5e(t){var e=String(t).match(/^function (\w*)/);return e==null?"":e[1]}function K8(t,e){return Object.prototype.hasOwnProperty.call(e,t)}function $5e(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}var ET=typeof Object.is=="function"?Object.is:$5e,wQ=Object.prototype.toString,q5e=function(){return wQ.call(arguments)==="[object Arguments]"?function(t){return wQ.call(t)==="[object Arguments]"}:function(t){return K8("callee",t)}}(),U5e=q5e,F5e=!{toString:null}.propertyIsEnumerable("toString"),_Q=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],MQ=function(){"use strict";return arguments.propertyIsEnumerable("length")}(),j5e=function(t,e){for(var r=0;r<t.length;){if(t[r]===e)return!0;r+=1}return!1},z5e=$a(typeof Object.keys=="function"&&!MQ?function(t){return Object(t)!==t?[]:Object.keys(t)}:function(t){if(Object(t)!==t)return[];var e,r,o=[],i=MQ&&U5e(t);for(e in t)K8(e,t)&&(!i||e!=="length")&&(o[o.length]=e);if(F5e)for(r=_Q.length-1;r>=0;)e=_Q[r],K8(e,t)&&!j5e(o,e)&&(o[o.length]=e),r-=1;return o}),O1=z5e,Z5e=$a(function(t){return t===null?"Null":t===void 0?"Undefined":Object.prototype.toString.call(t).slice(8,-1)}),xQ=Z5e;function SQ(t,e,r,o){var i=bQ(t),h=bQ(e);function c(v,b){return cI(v,b,r.slice(),o.slice())}return!yQ(function(v,b){return!yQ(c,b,v)},h,i)}function cI(t,e,r,o){if(ET(t,e))return!0;var i=xQ(t);if(i!==xQ(e))return!1;if(typeof t["fantasy-land/equals"]=="function"||typeof e["fantasy-land/equals"]=="function")return typeof t["fantasy-land/equals"]=="function"&&t["fantasy-land/equals"](e)&&typeof e["fantasy-land/equals"]=="function"&&e["fantasy-land/equals"](t);if(typeof t.equals=="function"||typeof e.equals=="function")return typeof t.equals=="function"&&t.equals(e)&&typeof e.equals=="function"&&e.equals(t);switch(i){case"Arguments":case"Array":case"Object":if(typeof t.constructor=="function"&&D5e(t.constructor)==="Promise")return t===e;break;case"Boolean":case"Number":case"String":if(!(typeof t==typeof e&&ET(t.valueOf(),e.valueOf())))return!1;break;case"Date":if(!ET(t.valueOf(),e.valueOf()))return!1;break;case"Error":return t.name===e.name&&t.message===e.message;case"RegExp":if(!(t.source===e.source&&t.global===e.global&&t.ignoreCase===e.ignoreCase&&t.multiline===e.multiline&&t.sticky===e.sticky&&t.unicode===e.unicode))return!1;break}for(var h=r.length-1;h>=0;){if(r[h]===t)return o[h]===e;h-=1}switch(i){case"Map":return t.size!==e.size?!1:SQ(t.entries(),e.entries(),r.concat([t]),o.concat([e]));case"Set":return t.size!==e.size?!1:SQ(t.values(),e.values(),r.concat([t]),o.concat([e]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var c=O1(t);if(c.length!==O1(e).length)return!1;var v=r.concat([t]),b=o.concat([e]);for(h=c.length-1;h>=0;){var g=c[h];if(!(K8(g,e)&&cI(e[g],t[g],v,b)))return!1;h-=1}return!0}var H5e=$n(function(t,e){return cI(t,e,[],[])}),VQ=H5e;function K5e(t,e,r){var o,i;if(typeof t.indexOf=="function")switch(typeof e){case"number":if(e===0){for(o=1/e;r<t.length;){if(i=t[r],i===0&&1/i===o)return r;r+=1}return-1}else if(e!==e){for(;r<t.length;){if(i=t[r],typeof i=="number"&&i!==i)return r;r+=1}return-1}return t.indexOf(e,r);case"string":case"boolean":case"function":case"undefined":return t.indexOf(e,r);case"object":if(e===null)return t.indexOf(e,r)}for(;r<t.length;){if(VQ(t[r],e))return r;r+=1}return-1}function W5e(t,e){return K5e(e,t,0)>=0}function Kg(t,e){for(var r=0,o=e.length,i=Array(o);r<o;)i[r]=t(e[r]),r+=1;return i}function AT(t){var e=t.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0");return'"'+e.replace(/"/g,'\\"')+'"'}var Cg=function(t){return(t<10?"0":"")+t},V5e=typeof Date.prototype.toISOString=="function"?function(t){return t.toISOString()}:function(t){return t.getUTCFullYear()+"-"+Cg(t.getUTCMonth()+1)+"-"+Cg(t.getUTCDate())+"T"+Cg(t.getUTCHours())+":"+Cg(t.getUTCMinutes())+":"+Cg(t.getUTCSeconds())+"."+(t.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"},G5e=V5e;function Y5e(t){return function(){return!t.apply(this,arguments)}}function GQ(t,e,r){for(var o=0,i=r.length;o<i;)e=t(e,r[o]),o+=1;return e}function J5e(t,e){for(var r=0,o=e.length,i=[];r<o;)t(e[r])&&(i[i.length]=e[r]),r+=1;return i}function X5e(t){return Object.prototype.toString.call(t)==="[object Object]"}var Q5e=function(){function t(e,r){this.xf=r,this.f=e}return t.prototype["@@transducer/init"]=Vg.init,t.prototype["@@transducer/result"]=Vg.result,t.prototype["@@transducer/step"]=function(e,r){return this.f(r)?this.xf["@@transducer/step"](e,r):e},t}();function e7e(t){return function(e){return new Q5e(t,e)}}var t7e=$n(lI(["fantasy-land/filter","filter"],e7e,function(t,e){return X5e(e)?GQ(function(r,o){return t(e[o])&&(r[o]=e[o]),r},{},O1(e)):J5e(t,e)})),r7e=t7e,i7e=$n(function(t,e){return r7e(Y5e(t),e)}),n7e=i7e;function YQ(t,e){var r=function(h){var c=e.concat([t]);return W5e(h,c)?"<Circular>":YQ(h,c)},o=function(h,c){return Kg(function(v){return AT(v)+": "+r(h[v])},c.slice().sort())};switch(Object.prototype.toString.call(t)){case"[object Arguments]":return"(function() { return arguments; }("+Kg(r,t).join(", ")+"))";case"[object Array]":return"["+Kg(r,t).concat(o(t,n7e(function(h){return/^\d+$/.test(h)},O1(t)))).join(", ")+"]";case"[object Boolean]":return typeof t=="object"?"new Boolean("+r(t.valueOf())+")":t.toString();case"[object Date]":return"new Date("+(isNaN(t.valueOf())?r(NaN):AT(G5e(t)))+")";case"[object Map]":return"new Map("+r(Array.from(t))+")";case"[object Null]":return"null";case"[object Number]":return typeof t=="object"?"new Number("+r(t.valueOf())+")":1/t===-1/0?"-0":t.toString(10);case"[object Set]":return"new Set("+r(Array.from(t).sort())+")";case"[object String]":return typeof t=="object"?"new String("+r(t.valueOf())+")":AT(t);case"[object Undefined]":return"undefined";default:if(typeof t.toString=="function"){var i=t.toString();if(i!=="[object Object]")return i}return"{"+o(t,O1(t)).join(", ")+"}"}}var a7e=$a(function(t){return YQ(t,[])}),EQ=a7e,o7e=$n(function(t,e){if(t===e)return e;function r(v,b){if(v>b!=b>v)return b>v?b:v}var o=r(t,e);if(o!==void 0)return o;var i=r(typeof t,typeof e);if(i!==void 0)return i===typeof t?t:e;var h=EQ(t),c=r(h,EQ(e));return c!==void 0&&c===h?t:e}),s7e=o7e,f7e=function(){function t(e,r){this.xf=r,this.f=e}return t.prototype["@@transducer/init"]=Vg.init,t.prototype["@@transducer/result"]=Vg.result,t.prototype["@@transducer/step"]=function(e,r){return this.xf["@@transducer/step"](e,this.f(r))},t}(),u7e=function(t){return function(e){return new f7e(t,e)}},h7e=u7e,l7e=$n(lI(["fantasy-land/map","map"],h7e,function(t,e){switch(Object.prototype.toString.call(e)){case"[object Function]":return WQ(e.length,function(){return t.call(this,e.apply(this,arguments))});case"[object Object]":return GQ(function(r,o){return r[o]=t(e[o]),r},{},O1(e));default:return Kg(t,e)}})),c7e=l7e,JQ=Number.isInteger||function(t){return t<<0===t};function XQ(t){return Object.prototype.toString.call(t)==="[object String]"}function QQ(t,e){var r=t<0?e.length+t:t;return XQ(e)?e.charAt(r):e[r]}var d7e=$n(function(t,e){if(e!=null)return JQ(t)?QQ(t,e):e[t]}),gw=d7e,p7e=$n(function(t,e){return c7e(gw(t),e)}),v7e=p7e,m7e=$a(function(t){return hI(t)?!0:!t||typeof t!="object"||XQ(t)?!1:t.length===0?!0:t.length>0?t.hasOwnProperty(0)&&t.hasOwnProperty(t.length-1):!1}),g7e=m7e,AQ=typeof Symbol<"u"?Symbol.iterator:"@@iterator";function b7e(t,e,r){return function(o,i,h){if(g7e(h))return t(o,i,h);if(h==null)return i;if(typeof h["fantasy-land/reduce"]=="function")return e(o,i,h,"fantasy-land/reduce");if(h[AQ]!=null)return r(o,i,h[AQ]());if(typeof h.next=="function")return r(o,i,h);if(typeof h.reduce=="function")return e(o,i,h,"reduce");throw new TypeError("reduce: list must be array or iterable")}}function y7e(t,e,r){for(var o=0,i=r.length;o<i;){if(e=t["@@transducer/step"](e,r[o]),e&&e["@@transducer/reduced"]){e=e["@@transducer/value"];break}o+=1}return t["@@transducer/result"](e)}var w7e=$n(function(t,e){return mw(t.length,function(){return t.apply(e,arguments)})}),_7e=w7e;function M7e(t,e,r){for(var o=r.next();!o.done;){if(e=t["@@transducer/step"](e,o.value),e&&e["@@transducer/reduced"]){e=e["@@transducer/value"];break}o=r.next()}return t["@@transducer/result"](e)}function x7e(t,e,r,o){return t["@@transducer/result"](r[o](_7e(t["@@transducer/step"],t),e))}var S7e=b7e(y7e,x7e,M7e),E7e=S7e,A7e=function(){function t(e){this.f=e}return t.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},t.prototype["@@transducer/result"]=function(e){return e},t.prototype["@@transducer/step"]=function(e,r){return this.f(e,r)},t}();function R7e(t){return new A7e(t)}var T7e=uI(function(t,e,r){return E7e(typeof t=="function"?R7e(t):t,e,r)}),eee=T7e;function I7e(t,e){return function(){return e.call(this,t.apply(this,arguments))}}function tee(t,e){return function(){var r=arguments.length;if(r===0)return e();var o=arguments[r-1];return hI(o)||typeof o[t]!="function"?e.apply(this,arguments):o[t].apply(o,Array.prototype.slice.call(arguments,0,r-1))}}var k7e=uI(tee("slice",function(t,e,r){return Array.prototype.slice.call(r,t,e)})),B7e=k7e,P7e=$a(tee("tail",B7e(1,1/0))),O7e=P7e;function ree(){if(arguments.length===0)throw new Error("pipe requires at least one argument");return mw(arguments[0].length,eee(I7e,arguments[0],O7e(arguments)))}var N7e=$n(function(t,e){return WQ(eee(s7e,0,v7e("length",e)),function(){var r=arguments,o=this;return t.apply(o,Kg(function(i){return i.apply(o,r)},e))})}),C7e=N7e,L7e=$n(function(t,e){return e==null||e!==e?t:e}),NT=L7e,D7e=function(){function t(e,r){this.xf=r,this.f=e,this.found=!1}return t.prototype["@@transducer/init"]=Vg.init,t.prototype["@@transducer/result"]=function(e){return this.found||(e=this.xf["@@transducer/step"](e,void 0)),this.xf["@@transducer/result"](e)},t.prototype["@@transducer/step"]=function(e,r){return this.f(r)&&(this.found=!0,e=L5e(this.xf["@@transducer/step"](e,r))),e},t}();function $7e(t){return function(e){return new D7e(t,e)}}var q7e=$n(lI(["find"],$7e,function(t,e){for(var r=0,o=e.length;r<o;){if(t(e[r]))return e[r];r+=1}})),U7e=q7e,F7e=$a(function(t){return C7e(function(){return Array.prototype.slice.call(arguments,0)},t)}),j7e=F7e;function z7e(t,e){for(var r=e,o=0;o<t.length;o+=1){if(r==null)return;var i=t[o];JQ(i)?r=QQ(i,r):r=r[i]}return r}var Z7e=$n(z7e),iee=Z7e,H7e=uI(function(t,e,r){return VQ(t,gw(e,r))}),K7e=H7e,W8=class extends Error{name="InvalidSchedulerLocation"},W7e=class extends Error{name="SchedulerTagNotFound"},V7e=class extends Error{name="TransactionNotFound"},G7e="Url",Y7e="Time-To-Live",J7e="Scheduler",CT=t=>ree(NT([]),U7e(K7e(t,"name")),NT({}),gw("value")),nee=t=>ree(e=>{if(!e)throw new V7e(t);return e},gw("tags"),NT([]));function aee({fetch:t,GRAPHQL_URL:e}){return async({query:r,variables:o})=>t(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:r,variables:o})}).then(i=>i.json())}function X7e({fetch:t,GRAPHQL_URL:e}){let r=aee({fetch:t,GRAPHQL_URL:e}),o=oee({fetch:t,GRAPHQL_URL:e}),i=`
|
|
134
|
+
nonce: bundlr`),Se.from(i))}};ie();ae();ne();var Qc=class{_publicKey;ownerLength=Kr[wr.MULTIAPTOS].pubLength;signatureLength=Kr[wr.MULTIAPTOS].sigLength;signatureType=wr.MULTIAPTOS;collectSignatures;provider;constructor(e,r){this._publicKey=e,this.collectSignatures=r}get publicKey(){return this._publicKey}async sign(e){let{signatures:r,bitmap:o}=await this.collectSignatures(e),i=128,h=new Uint8Array([0,0,0,0]),c=new Set;o.forEach(g=>{if(g>=32)throw new Error(`Invalid bit value ${g}.`);if(c.has(g))throw new Error("Duplicated bits detected.");c.add(g);let _=Math.floor(g/8),M=h[_];M|=i>>g%8,h[_]=M});let v=Se.alloc(this.signatureLength),b=0;for(let g=0;g<32;g++)o.includes(g)&&v.set(r[b++],g*64);return v.set(h,this.signatureLength-4),v}static async verify(e,r,o){let h=Kr[wr.MULTIAPTOS].sigLength-4,c=o.slice(0,h),v=o.slice(h),b=!1;for(let g=0;g<32;g++){let _=Math.floor(g/8),M=g-_*8;if((v[_]&128>>M)!==0){let E=c.slice(g*64,(g+1)*64),A=e.slice(g*32,(g+1)*32);await D0(Se.from(E),Se.from(r),Se.from(A))||(b=!0)}}return!b}};ie();ae();ne();var ed=class extends Bo{ownerLength=Kr[wr.TYPEDETHEREUM].pubLength;signatureLength=Kr[wr.TYPEDETHEREUM].sigLength;signatureType=wr.TYPEDETHEREUM;address;signer;constructor(e){super(e),this.address="0x"+dg(super.publicKey.slice(1)).slice(-20).toString("hex"),this.signer=new r1(e)}get publicKey(){return Se.from(this.address)}async sign(e){let r=await this.signer._signTypedData(yg,wg,{address:this.address,"Transaction hash":e});return Se.from(r.slice(2),"hex")}static async verify(e,r,o){let i=e.toString(),h=H3(yg,wg,{address:i,"Transaction hash":r},o);return i.toLowerCase()===h.toLowerCase()}},yg={name:"Bundlr",version:"1"},wg={Bundlr:[{name:"Transaction hash",type:"bytes"},{name:"address",type:"address"}]};ie();ae();ne();var oT=class{ownerLength=Kr[wr.TYPEDETHEREUM].pubLength;signatureLength=Kr[wr.TYPEDETHEREUM].sigLength;signatureType=wr.TYPEDETHEREUM;address;signer;publicKey;constructor(e){this.signer=e.getSigner()}async ready(){this.address=(await this.signer.getAddress()).toString().toLowerCase(),this.publicKey=Se.from(this.address)}async sign(e){let r=await this.signer._signTypedData(yg,wg,{address:this.address,"Transaction hash":e});return Se.from(r.slice(2),"hex")}static verify(e,r,o){let i=e.toString(),h=H3(yg,wg,{address:i,"Transaction hash":r},o);return i.toLowerCase()===h.toLowerCase()}};ie();ae();ne();var zX=mi(Uo(),1);var ul=class{signer;publicKey;ownerLength=Kr[wr.ARWEAVE].pubLength;signatureLength=Kr[wr.ARWEAVE].sigLength;signatureType=wr.ARWEAVE;constructor(e){this.signer=e}async setPublicKey(){let e=await this.signer.getActivePublicKey();this.publicKey=zX.default.toBuffer(e)}async sign(e){this.publicKey||await this.setPublicKey();let r={name:"RSA-PSS",saltLength:32},o=await this.signer.signature(e,r);return new Uint8Array(Object.values(o).map(h=>+h))}static async verify(e,r,o){return await xn().verify(e,r,o)}};ie();ae();ne();var _g=class extends Bo{signatureType=wr.KYVE};var Mg={1:z0,2:So,3:Bo,4:Jc,5:Xc,6:Qc,7:ed};ie();ae();ne();ie();ae();ne();async function r4e(t){return $0([(0,Bi.stringToBuffer)("dataitem"),(0,Bi.stringToBuffer)("1"),(0,Bi.stringToBuffer)(t.signatureType.toString()),t.rawOwner,t.rawTarget,t.rawAnchor,t.rawTags,t.rawData])}var xg=r4e;ie();ae();ne();ie();ae();ne();function Sg(t,e){let r=new Uint8Array(t);if(e<0)throw new Error("Array is unsigned, cannot represent -ve numbers");if(e>2**(t*8)-1)throw new Error(`Number ${e} is too large for an array of ${t} bytes`);for(let o=0;o<r.length;o++){let i=e&255;r[o]=i,e=(e-i)/256}return r}function S8(t){return Sg(8,t)}function sT(t){return Sg(2,t)}function i4e(t){return Sg(16,t)}function E8(t){return Sg(32,t)}function bn(t){let e=0;for(let r=t.length-1;r>=0;r--)e=e*256+t[r];return e}ie();ae();ne();var Ag=mi(Uo(),1);ie();ae();ne();var ks=mi(Uo(),1);Wa();ie();ae();ne();var Eg=class{buf;pos;constructor(e=Se.alloc(A8),r=0){this.buf=e,this.pos=r}writeTags(e){if(!Array.isArray(e))throw new Error("input must be array");let r=e.length,o;if(r)for(this.writeLong(r),o=0;o<r;o++){let i=e[o];if(typeof i?.name!="string"||typeof i?.value!="string")throw new Error(`Invalid tag format for ${i}, expected {name:string, value: string}`);this.writeString(i.name),this.writeString(i.value)}this.writeLong(0)}toBuffer(){let e=Se.alloc(this.pos);if(this.pos>this.buf.length)throw new Error(`Too many tag bytes (${this.pos} > ${this.buf.length})`);return this.buf.copy(e,0,0,this.pos),e}writeLong(e){let r=this.buf,o,i;if(e>=-1073741824&&e<1073741824){i=e>=0?e<<1:~e<<1|1;do r[this.pos]=i&127,i>>=7;while(i&&(r[this.pos++]|=128))}else{o=e>=0?e*2:-e*2-1;do r[this.pos]=o&127,o/=128;while(o>=1&&(r[this.pos++]|=128))}this.pos++,this.buf=r}writeString(e){let r=Se.byteLength(e),o=this.buf;this.writeLong(r);let i=this.pos;if(this.pos+=r,!(this.pos>o.length)){if(r>64)this.buf.write(e,this.pos-r,r,"utf8");else{let h,c,v,b;for(h=0,c=r;h<c;h++)v=e.charCodeAt(h),v<128?o[i++]=v:v<2048?(o[i++]=v>>6|192,o[i++]=v&63|128):(v&64512)===55296&&((b=e.charCodeAt(h+1))&64512)===56320?(v=65536+((v&1023)<<10)+(b&1023),h++,o[i++]=v>>18|240,o[i++]=v>>12&63|128,o[i++]=v>>6&63|128,o[i++]=v&63|128):(o[i++]=v>>12|224,o[i++]=v>>6&63|128,o[i++]=v&63|128)}this.buf=o}}readLong(){let e=0,r=0,o=this.buf,i,h,c,v;do i=o[this.pos++],h=i&128,e|=(i&127)<<r,r+=7;while(h&&r<28);if(h){c=e,v=268435456;do i=o[this.pos++],c+=(i&127)*v,v*=128;while(i&128);return(c%2?-(c+1):c)/2}return e>>1^-(e&1)}skipLong(){let e=this.buf;for(;e[this.pos++]&128;);}readTags(){let e=[],r;for(;r=this.readLong();)for(r<0&&(r=-r,this.skipLong());r--;){let o=this.readString(),i=this.readString();e.push({name:o,value:i})}return e}readString(){let e=this.readLong(),r=this.pos,o=this.buf;if(this.pos+=e,this.pos>o.length)throw new Error("TAP Position out of range");return this.buf.slice(r,r+e).toString()}};function fT(t){if(t?.length===0)return Se.allocUnsafe(0);let e=new Eg;return e.writeTags(t),e.toBuffer()}function v1(t){return new Eg(t).readTags()}cu();var R8=80,A8=4096,m1=class t{binary;_id;constructor(e){this.binary=e}static isDataItem(e){return e.binary!==void 0}get signatureType(){let e=bn(this.binary.subarray(0,2));if(wr?.[e]!==void 0)return e;throw new Error("Unknown signature type: "+e)}async isValid(){return t.verify(this.binary)}get id(){return ks.default.encode(this.rawId)}set id(e){this._id=ks.default.toBuffer(e)}get rawId(){return cf("sha256").update(this.rawSignature).digest()}set rawId(e){this._id=e}get rawSignature(){return this.binary.subarray(2,2+this.signatureLength)}get signature(){return ks.default.encode(this.rawSignature)}set rawOwner(e){if(e.byteLength!=this.ownerLength)throw new Error(`Expected raw owner (pubkey) to be ${this.ownerLength} bytes, got ${e.byteLength} bytes.`);this.binary.set(e,2+this.signatureLength)}get rawOwner(){return this.binary.subarray(2+this.signatureLength,2+this.signatureLength+this.ownerLength)}get signatureLength(){return Kr[this.signatureType].sigLength}get owner(){return ks.default.encode(this.rawOwner)}get ownerLength(){return Kr[this.signatureType].pubLength}get rawTarget(){let e=this.getTargetStart();return this.binary[e]==1?this.binary.subarray(e+1,e+33):Se.alloc(0)}get target(){return ks.default.encode(this.rawTarget)}get rawAnchor(){let e=this.getAnchorStart();return this.binary[e]==1?this.binary.subarray(e+1,e+33):Se.alloc(0)}get anchor(){return ks.default.encode(this.rawAnchor)}get rawTags(){let e=this.getTagsStart(),r=bn(this.binary.subarray(e+8,e+16));return this.binary.subarray(e+16,e+16+r)}get tags(){let e=this.getTagsStart();if(bn(this.binary.subarray(e,e+8))==0)return[];let o=bn(this.binary.subarray(e+8,e+16));return v1(Se.from(this.binary.subarray(e+16,e+16+o)))}get tagsB64Url(){return this.tags.map(r=>({name:ks.default.encode(r.name),value:ks.default.encode(r.value)}))}getStartOfData(){let e=this.getTagsStart(),r=this.binary.subarray(e+8,e+16),o=bn(r);return e+16+o}get rawData(){let e=this.getTagsStart(),r=this.binary.subarray(e+8,e+16),o=bn(r),i=e+16+o;return this.binary.subarray(i,this.binary.length)}get data(){return ks.default.encode(this.rawData)}getRaw(){return this.binary}async sign(e){return this._id=await T8(this,e),this.rawId}async setSignature(e){this.binary.set(e,2),this._id=Se.from(await xn().hash(e))}isSigned(){return(this._id?.length??0)>0}toJSON(){return{signature:this.signature,owner:this.owner,target:this.target,tags:this.tags.map(e=>({name:ks.default.encode(e.name),value:ks.default.encode(e.value)})),data:this.data}}static async verify(e){if(e.byteLength<R8)return!1;let r=new t(e),o=r.signatureType,i=r.getTagsStart(),h=bn(e.subarray(i,i+8)),c=e.subarray(i+8,i+16),v=bn(c);if(v>A8)return!1;if(h>0)try{if(v1(Se.from(e.subarray(i+16,i+16+v))).length!==h)return!1}catch{return!1}let b=Mg[o],g=await xg(r);return await b.verify(r.rawOwner,g,r.rawSignature)}async getSignatureData(){return xg(this)}getTagsStart(){let e=this.getTargetStart(),r=this.binary[e]==1,o=e+(r?33:1),i=this.binary[o]==1;return o+=i?33:1,o}getTargetStart(){return 2+this.signatureLength+this.ownerLength}getAnchorStart(){let e=this.getTargetStart()+1,r=this.binary[this.getTargetStart()]==1;return e+=r?32:0,e}},g1=m1;cu();var Bu=32,I8=class{length;items;binary;constructor(e){this.binary=e,this.length=this.getDataItemCount(),this.items=this.getItems()}getRaw(){return this.binary}get(e){if(typeof e=="number"){if(e>=this.length)throw new RangeError("Index out of range");return this.getByIndex(e)}else return this.getById(e)}getSizes(){let e=[];for(let r=Bu;r<Bu+64*this.length;r+=64)e.push(bn(this.binary.subarray(r,r+32)));return e}getIds(){let e=[];for(let r=Bu;r<Bu+64*this.length;r+=64){let o=this.binary.subarray(r+32,r+64);if(o.length===0)throw new Error("Invalid bundle, id specified in headers doesn't exist");e.push(Ag.default.encode(o))}return e}getIdBy(e){if(e>this.length-1)throw new RangeError("Index of bundle out of range");let r=64+64*e;return Ag.default.encode(this.binary.subarray(r,r+32))}async toTransaction(e,r,o){let i=await r.createTransaction({data:this.binary,...e},o);return i.addTag("Bundle-Format","binary"),i.addTag("Bundle-Version","2.0.0"),i}async verify(){for(let e of this.items){let r=await e.isValid(),o=(0,Ag.default)(cf("sha256").update(e.rawSignature).digest());if(!(r&&e.id===o))return!1}return!0}getOffset(e){let r=0;for(let o=Bu;o<Bu+64*this.length;o+=64){let i=bn(this.binary.subarray(o,o+32));r+=i;let h=this.binary.subarray(o+32,o+64);if(Se.compare(h,e)===0)return{startOffset:r,size:i}}return{startOffset:-1,size:-1}}getByIndex(e){let r=0,o=this.getBundleStart(),i=0,h,c;for(let _=Bu;_<Bu+64*this.length;_+=64){if(h=bn(this.binary.subarray(_,_+32)),i++===e){c=this.binary.subarray(_+32,_+64);break}r+=h}let v=o+r,b=this.binary.subarray(v,v+h),g=new g1(b);return g.rawId=c,g}getById(e){let r=Ag.default.toBuffer(e),o=this.getOffset(r);if(o.startOffset===-1)throw new Error("Transaction not found");let h=this.getBundleStart()+o.startOffset;return new g1(this.binary.subarray(h,h+o.size))}getDataItemCount(){return bn(this.binary.subarray(0,32))}getBundleStart(){return 32+64*this.length}getItems(){let e=new Array(this.length),r=0,o=this.getBundleStart(),i=0;for(let h=Bu;h<Bu+64*this.length;h+=64){let c=bn(this.binary.subarray(h,h+32)),v=this.binary.subarray(h+32,h+64);if(v.length===0)throw new Error("Invalid bundle, id specified in headers doesn't exist");let b=o+r,g=this.binary.subarray(b,b+c);r+=c;let _=new g1(g);_.rawId=v,e[i]=_,i++}return e}},uT=I8;function n4e(t){return new uT(t)}async function a4e(t,e){let r=new Uint8Array(64*t.length),o=await Promise.all(t.map(async(h,c)=>{let v=h.isSigned()?h.rawId:await T8(h,e),b=new Uint8Array(64);return b.set(E8(h.getRaw().byteLength),0),b.set(v,32),r.set(b,64*c),h.getRaw()})).then(h=>Se.concat(h)),i=Se.concat([Se.from(E8(t.length)),Se.from(r),o]);return new uT(i)}async function ZX(t,e){let r=await xg(t),o=await e.sign(r),i=await xn().hash(o);return{signature:Se.from(o),id:Se.from(i)}}async function T8(t,e){let{signature:r,id:o}=await ZX(t,e);return t.getRaw().set(r,2),o}ie();ae();ne();var HX=mi(Uo(),1);function Rg(t,e,r){let o=e.publicKey,i=r?.target?HX.default.toBuffer(r.target):null,h=1+(i?.byteLength??0),c=r?.anchor?Se.from(r.anchor):null,v=1+(c?.byteLength??0),b=(r?.tags?.length??0)>0?fT(r?.tags):null,g=16+(b?b.byteLength:0),_=typeof t=="string"?Se.from(t):Se.from(t),M=_.byteLength,x=2+e.signatureLength+e.ownerLength+h+v+g+M,E=Se.alloc(x);if(E.set(sT(e.signatureType),0),E.set(new Uint8Array(e.signatureLength).fill(0),2),o.byteLength!==e.ownerLength)throw new Error(`Owner must be ${e.ownerLength} bytes, but was incorrectly ${o.byteLength}`);E.set(o,2+e.signatureLength);let A=2+e.signatureLength+e.ownerLength;if(E[A]=i?1:0,i){if(i.byteLength!==32)throw new Error(`Target must be 32 bytes but was incorrectly ${i.byteLength}`);E.set(i,A+1)}let I=A+h,P=I+1;if(E[I]=c?1:0,c){if(P+=c.byteLength,c.byteLength!==32)throw new Error("Anchor must be 32 bytes");E.set(c,I+1)}E.set(S8(r?.tags?.length??0),P);let N=S8(b?.byteLength??0);E.set(N,P+8),b&&E.set(b,P+16);let L=P+g;return E.set(_,L),new g1(E)}ie();ae();ne();ie();ae();ne();var hT=class{signatureType;rawSignature;signature;signatureLength;rawOwner;owner;ownerLength;rawTarget;target;rawAnchor;anchor;rawTags;tags;rawData;data;static async verify(...e){throw new Error("You must implement `verify`")}};ie();ae();ne();ie();ae();ne();var pT={};Ka(pT,{default:()=>f4e,processStream:()=>YX,streamExportForTesting:()=>u4e,streamSigner:()=>s4e});ie();ae();ne();k8();var td=mi(Uo(),1);cu();async function YX(t){let e=JX(t),r=(await e.next()).value;r=await La(e,r,32);let o=bn(r.subarray(0,32));r=r.subarray(32);let i=64*o;r=await La(e,r,i);let h=new Array(o);for(let b=0;b<i;b+=64)h[b/64]=[bn(r.subarray(b,b+32)),(0,td.default)(Se.from(r.subarray(b+32,b+64)))];r=r.subarray(i);let c=32+i,v=[];for(let[b,g]of h){r=await La(e,r,R8),r=await La(e,r,2);let _=bn(r.subarray(0,2));r=r.subarray(2);let{sigLength:M,pubLength:x,sigName:E}=Kr[_];r=await La(e,r,M);let A=r.subarray(0,M);r=r.subarray(M),r=await La(e,r,x);let I=r.subarray(0,x);r=r.subarray(x),r=await La(e,r,1);let P=r[0]===1;P&&(r=await La(e,r,33));let N=P?r.subarray(1,33):Se.allocUnsafe(0);r=r.subarray(P?33:1),r=await La(e,r,1);let L=r[0]===1;L&&(r=await La(e,r,33));let C=L?r.subarray(1,33):Se.allocUnsafe(0);r=r.subarray(L?33:1),r=await La(e,r,8);let Y=bn(r.subarray(0,8));r=r.subarray(8),r=await La(e,r,8);let G=bn(r.subarray(0,8));r=r.subarray(8),r=await La(e,r,G);let te=r.subarray(0,G),$=Y!==0&&G!==0?v1(Se.from(te)):[];if($.length!==Y)throw new Error("Tags lengths don't match");r=r.subarray(G);let F=new VX;F._transform=function(f,u,l){this.push(f),l()};let V=$0([(0,Bi.stringToBuffer)("dataitem"),(0,Bi.stringToBuffer)("1"),(0,Bi.stringToBuffer)(_.toString()),I,N,C,te,F]),w=2+M+x+(P?33:1)+(L?33:1)+16+G,n=b-w;if(r.byteLength>n)F.write(r.subarray(0,n)),r=r.subarray(n);else{let f=r.byteLength;for(F.write(r);n>f;){if(r=(await e.next()).value,!r)throw new Error(`Not enough data bytes expected: ${n} received: ${f}`);f+=r.byteLength,f>n?F.write(r.subarray(0,r.byteLength-(f-n))):F.write(r)}r=r.subarray(r.byteLength-(f-n))}if(F.end(),g!==(0,td.default)(cf("sha256").update(A).digest()))throw new Error("ID doesn't match signature");if(!await Mg[_].verify(I,await V,A))throw new Error("Invalid signature");v.push({id:g,sigName:E,signature:(0,td.default)(Se.from(A)),target:(0,td.default)(Se.from(N)),anchor:(0,td.default)(Se.from(C)),owner:(0,td.default)(Se.from(I)),tags:$,dataOffset:c+w,dataSize:n}),c+=w+n}return v}async function s4e(t,e,r,o){let i=Rg("",r,o),h=new GX,c=[(0,Bi.stringToBuffer)("dataitem"),(0,Bi.stringToBuffer)("1"),(0,Bi.stringToBuffer)(i.signatureType.toString()),i.rawOwner,i.rawTarget,i.rawAnchor,i.rawTags,t],v=await $0(c),b=Se.from(await r.sign(v));return i.setSignature(b),h.write(i.getRaw()),e.pipe(h)}async function La(t,e,r){if(e.byteLength>=r)return e;let{done:o,value:i}=await t.next();if(o&&!i)throw new Error("Invalid buffer");return La(t,Se.concat([Se.from(e),Se.from(i)]),r)}async function*JX(t){for await(let e of t)yield e}var f4e=YX,u4e={readBytes:La,getReader:JX};var h4e={...lT,stream:pT};globalThis.arbundles??=h4e;ie();ae();ne();ie();ae();ne();ie();ae();ne();ie();ae();ne();var si;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let h={};for(let c of i)h[c]=c;return h},t.getValidEnumValues=i=>{let h=t.objectKeys(i).filter(v=>typeof i[i[v]]!="number"),c={};for(let v of h)c[v]=i[v];return t.objectValues(c)},t.objectValues=i=>t.objectKeys(i).map(function(h){return i[h]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let h=[];for(let c in i)Object.prototype.hasOwnProperty.call(i,c)&&h.push(c);return h},t.find=(i,h)=>{for(let c of i)if(h(c))return c},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function o(i,h=" | "){return i.map(c=>typeof c=="string"?`'${c}'`:c).join(h)}t.joinValues=o,t.jsonStringifyReplacer=(i,h)=>typeof h=="bigint"?h.toString():h})(si||(si={}));var mT;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(mT||(mT={}));var Yt=si.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),hl=t=>{switch(typeof t){case"undefined":return Yt.undefined;case"string":return Yt.string;case"number":return isNaN(t)?Yt.nan:Yt.number;case"boolean":return Yt.boolean;case"function":return Yt.function;case"bigint":return Yt.bigint;case"symbol":return Yt.symbol;case"object":return Array.isArray(t)?Yt.array:t===null?Yt.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Yt.promise:typeof Map<"u"&&t instanceof Map?Yt.map:typeof Set<"u"&&t instanceof Set?Yt.set:typeof Date<"u"&&t instanceof Date?Yt.date:Yt.object;default:return Yt.unknown}},Ot=si.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),l4e=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Po=class t extends Error{constructor(e){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(h){return h.message},o={_errors:[]},i=h=>{for(let c of h.issues)if(c.code==="invalid_union")c.unionErrors.map(i);else if(c.code==="invalid_return_type")i(c.returnTypeError);else if(c.code==="invalid_arguments")i(c.argumentsError);else if(c.path.length===0)o._errors.push(r(c));else{let v=o,b=0;for(;b<c.path.length;){let g=c.path[b];b===c.path.length-1?(v[g]=v[g]||{_errors:[]},v[g]._errors.push(r(c))):v[g]=v[g]||{_errors:[]},v=v[g],b++}}};return i(this),o}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,si.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},o=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):o.push(e(i));return{formErrors:o,fieldErrors:r}}get formErrors(){return this.flatten()}};Po.create=t=>new Po(t);var w1=(t,e)=>{let r;switch(t.code){case Ot.invalid_type:t.received===Yt.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case Ot.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,si.jsonStringifyReplacer)}`;break;case Ot.unrecognized_keys:r=`Unrecognized key(s) in object: ${si.joinValues(t.keys,", ")}`;break;case Ot.invalid_union:r="Invalid input";break;case Ot.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${si.joinValues(t.options)}`;break;case Ot.invalid_enum_value:r=`Invalid enum value. Expected ${si.joinValues(t.options)}, received '${t.received}'`;break;case Ot.invalid_arguments:r="Invalid function arguments";break;case Ot.invalid_return_type:r="Invalid function return type";break;case Ot.invalid_date:r="Invalid date";break;case Ot.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:si.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case Ot.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case Ot.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case Ot.custom:r="Invalid input";break;case Ot.invalid_intersection_types:r="Intersection results could not be merged";break;case Ot.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case Ot.not_finite:r="Number must be finite";break;default:r=e.defaultError,si.assertNever(t)}return{message:r}},eQ=w1;function c4e(t){eQ=t}function B8(){return eQ}var P8=t=>{let{data:e,path:r,errorMaps:o,issueData:i}=t,h=[...r,...i.path||[]],c={...i,path:h};if(i.message!==void 0)return{...i,path:h,message:i.message};let v="",b=o.filter(g=>!!g).slice().reverse();for(let g of b)v=g(c,{data:e,defaultError:v}).message;return{...i,path:h,message:v}},d4e=[];function Wt(t,e){let r=B8(),o=P8({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===w1?void 0:w1].filter(i=>!!i)});t.common.issues.push(o)}var ka=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let o=[];for(let i of r){if(i.status==="aborted")return vr;i.status==="dirty"&&e.dirty(),o.push(i.value)}return{status:e.value,value:o}}static async mergeObjectAsync(e,r){let o=[];for(let i of r){let h=await i.key,c=await i.value;o.push({key:h,value:c})}return t.mergeObjectSync(e,o)}static mergeObjectSync(e,r){let o={};for(let i of r){let{key:h,value:c}=i;if(h.status==="aborted"||c.status==="aborted")return vr;h.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),h.value!=="__proto__"&&(typeof c.value<"u"||i.alwaysSet)&&(o[h.value]=c.value)}return{status:e.value,value:o}}},vr=Object.freeze({status:"aborted"}),y1=t=>({status:"dirty",value:t}),Da=t=>({status:"valid",value:t}),gT=t=>t.status==="aborted",bT=t=>t.status==="dirty",Bg=t=>t.status==="valid",Pg=t=>typeof Promise<"u"&&t instanceof Promise;function O8(t,e,r,o){if(r==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?o:r==="a"?o.call(t):o?o.value:e.get(t)}function tQ(t,e,r,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}var ir;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(ir||(ir={}));var Ig,kg,Ps=class{constructor(e,r,o,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=o,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},XX=(t,e)=>{if(Bg(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Po(t.common.issues);return this._error=r,this._error}}};function Br(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:o,description:i}=t;if(e&&(r||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(c,v)=>{var b,g;let{message:_}=t;return c.code==="invalid_enum_value"?{message:_??v.defaultError}:typeof v.data>"u"?{message:(b=_??o)!==null&&b!==void 0?b:v.defaultError}:c.code!=="invalid_type"?{message:v.defaultError}:{message:(g=_??r)!==null&&g!==void 0?g:v.defaultError}},description:i}}var Pr=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return hl(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:hl(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ka,ctx:{common:e.parent.common,data:e.data,parsedType:hl(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Pg(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let o=this.safeParse(e,r);if(o.success)return o.data;throw o.error}safeParse(e,r){var o;let i={common:{issues:[],async:(o=r?.async)!==null&&o!==void 0?o:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:hl(e)},h=this._parseSync({data:e,path:i.path,parent:i});return XX(i,h)}async parseAsync(e,r){let o=await this.safeParseAsync(e,r);if(o.success)return o.data;throw o.error}async safeParseAsync(e,r){let o={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:hl(e)},i=this._parse({data:e,path:o.path,parent:o}),h=await(Pg(i)?i:Promise.resolve(i));return XX(o,h)}refine(e,r){let o=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,h)=>{let c=e(i),v=()=>h.addIssue({code:Ot.custom,...o(i)});return typeof Promise<"u"&&c instanceof Promise?c.then(b=>b?!0:(v(),!1)):c?!0:(v(),!1)})}refinement(e,r){return this._refinement((o,i)=>e(o)?!0:(i.addIssue(typeof r=="function"?r(o,i):r),!1))}_refinement(e){return new Oo({schema:this,typeName:cr.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Bs.create(this,this._def)}nullable(){return Ou.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ch.create(this,this._def)}promise(){return dl.create(this,this._def)}or(e){return fd.create([this,e],this._def)}and(e){return ud.create(this,e,this._def)}transform(e){return new Oo({...Br(this._def),schema:this,typeName:cr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new pd({...Br(this._def),innerType:this,defaultValue:r,typeName:cr.ZodDefault})}brand(){return new Og({typeName:cr.ZodBranded,type:this,...Br(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new vd({...Br(this._def),innerType:this,catchValue:r,typeName:cr.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Ng.create(this,e)}readonly(){return md.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},p4e=/^c[^\s-]{8,}$/i,v4e=/^[0-9a-z]+$/,m4e=/^[0-9A-HJKMNP-TV-Z]{26}$/,g4e=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,b4e=/^[a-z0-9_-]{21}$/i,y4e=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,w4e=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_4e="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",vT,M4e=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,x4e=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,S4e=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,rQ="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",E4e=new RegExp(`^${rQ}$`);function iQ(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function A4e(t){return new RegExp(`^${iQ(t)}$`)}function nQ(t){let e=`${rQ}T${iQ(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function R4e(t,e){return!!((e==="v4"||!e)&&M4e.test(t)||(e==="v6"||!e)&&x4e.test(t))}var ll=class t extends Pr{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Yt.string){let h=this._getOrReturnCtx(e);return Wt(h,{code:Ot.invalid_type,expected:Yt.string,received:h.parsedType}),vr}let o=new ka,i;for(let h of this._def.checks)if(h.kind==="min")e.data.length<h.value&&(i=this._getOrReturnCtx(e,i),Wt(i,{code:Ot.too_small,minimum:h.value,type:"string",inclusive:!0,exact:!1,message:h.message}),o.dirty());else if(h.kind==="max")e.data.length>h.value&&(i=this._getOrReturnCtx(e,i),Wt(i,{code:Ot.too_big,maximum:h.value,type:"string",inclusive:!0,exact:!1,message:h.message}),o.dirty());else if(h.kind==="length"){let c=e.data.length>h.value,v=e.data.length<h.value;(c||v)&&(i=this._getOrReturnCtx(e,i),c?Wt(i,{code:Ot.too_big,maximum:h.value,type:"string",inclusive:!0,exact:!0,message:h.message}):v&&Wt(i,{code:Ot.too_small,minimum:h.value,type:"string",inclusive:!0,exact:!0,message:h.message}),o.dirty())}else if(h.kind==="email")w4e.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"email",code:Ot.invalid_string,message:h.message}),o.dirty());else if(h.kind==="emoji")vT||(vT=new RegExp(_4e,"u")),vT.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"emoji",code:Ot.invalid_string,message:h.message}),o.dirty());else if(h.kind==="uuid")g4e.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"uuid",code:Ot.invalid_string,message:h.message}),o.dirty());else if(h.kind==="nanoid")b4e.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"nanoid",code:Ot.invalid_string,message:h.message}),o.dirty());else if(h.kind==="cuid")p4e.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"cuid",code:Ot.invalid_string,message:h.message}),o.dirty());else if(h.kind==="cuid2")v4e.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"cuid2",code:Ot.invalid_string,message:h.message}),o.dirty());else if(h.kind==="ulid")m4e.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"ulid",code:Ot.invalid_string,message:h.message}),o.dirty());else if(h.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),Wt(i,{validation:"url",code:Ot.invalid_string,message:h.message}),o.dirty()}else h.kind==="regex"?(h.regex.lastIndex=0,h.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"regex",code:Ot.invalid_string,message:h.message}),o.dirty())):h.kind==="trim"?e.data=e.data.trim():h.kind==="includes"?e.data.includes(h.value,h.position)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Ot.invalid_string,validation:{includes:h.value,position:h.position},message:h.message}),o.dirty()):h.kind==="toLowerCase"?e.data=e.data.toLowerCase():h.kind==="toUpperCase"?e.data=e.data.toUpperCase():h.kind==="startsWith"?e.data.startsWith(h.value)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Ot.invalid_string,validation:{startsWith:h.value},message:h.message}),o.dirty()):h.kind==="endsWith"?e.data.endsWith(h.value)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Ot.invalid_string,validation:{endsWith:h.value},message:h.message}),o.dirty()):h.kind==="datetime"?nQ(h).test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Ot.invalid_string,validation:"datetime",message:h.message}),o.dirty()):h.kind==="date"?E4e.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Ot.invalid_string,validation:"date",message:h.message}),o.dirty()):h.kind==="time"?A4e(h).test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Ot.invalid_string,validation:"time",message:h.message}),o.dirty()):h.kind==="duration"?y4e.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"duration",code:Ot.invalid_string,message:h.message}),o.dirty()):h.kind==="ip"?R4e(e.data,h.version)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"ip",code:Ot.invalid_string,message:h.message}),o.dirty()):h.kind==="base64"?S4e.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"base64",code:Ot.invalid_string,message:h.message}),o.dirty()):si.assertNever(h);return{status:o.value,value:e.data}}_regex(e,r,o){return this.refinement(i=>e.test(i),{validation:r,code:Ot.invalid_string,...ir.errToObj(o)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ir.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ir.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ir.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ir.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ir.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ir.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ir.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ir.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ir.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ir.errToObj(e)})}datetime(e){var r,o;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!==null&&r!==void 0?r:!1,local:(o=e?.local)!==null&&o!==void 0?o:!1,...ir.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...ir.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...ir.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...ir.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...ir.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...ir.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...ir.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...ir.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...ir.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...ir.errToObj(r)})}nonempty(e){return this.min(1,ir.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};ll.create=t=>{var e;return new ll({checks:[],typeName:cr.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Br(t)})};function T4e(t,e){let r=(t.toString().split(".")[1]||"").length,o=(e.toString().split(".")[1]||"").length,i=r>o?r:o,h=parseInt(t.toFixed(i).replace(".","")),c=parseInt(e.toFixed(i).replace(".",""));return h%c/Math.pow(10,i)}var rd=class t extends Pr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Yt.number){let h=this._getOrReturnCtx(e);return Wt(h,{code:Ot.invalid_type,expected:Yt.number,received:h.parsedType}),vr}let o,i=new ka;for(let h of this._def.checks)h.kind==="int"?si.isInteger(e.data)||(o=this._getOrReturnCtx(e,o),Wt(o,{code:Ot.invalid_type,expected:"integer",received:"float",message:h.message}),i.dirty()):h.kind==="min"?(h.inclusive?e.data<h.value:e.data<=h.value)&&(o=this._getOrReturnCtx(e,o),Wt(o,{code:Ot.too_small,minimum:h.value,type:"number",inclusive:h.inclusive,exact:!1,message:h.message}),i.dirty()):h.kind==="max"?(h.inclusive?e.data>h.value:e.data>=h.value)&&(o=this._getOrReturnCtx(e,o),Wt(o,{code:Ot.too_big,maximum:h.value,type:"number",inclusive:h.inclusive,exact:!1,message:h.message}),i.dirty()):h.kind==="multipleOf"?T4e(e.data,h.value)!==0&&(o=this._getOrReturnCtx(e,o),Wt(o,{code:Ot.not_multiple_of,multipleOf:h.value,message:h.message}),i.dirty()):h.kind==="finite"?Number.isFinite(e.data)||(o=this._getOrReturnCtx(e,o),Wt(o,{code:Ot.not_finite,message:h.message}),i.dirty()):si.assertNever(h);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,ir.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ir.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ir.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ir.toString(r))}setLimit(e,r,o,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:o,message:ir.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ir.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ir.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ir.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ir.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ir.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ir.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:ir.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ir.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ir.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&si.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(r===null||o.value>r)&&(r=o.value):o.kind==="max"&&(e===null||o.value<e)&&(e=o.value)}return Number.isFinite(r)&&Number.isFinite(e)}};rd.create=t=>new rd({checks:[],typeName:cr.ZodNumber,coerce:t?.coerce||!1,...Br(t)});var id=class t extends Pr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==Yt.bigint){let h=this._getOrReturnCtx(e);return Wt(h,{code:Ot.invalid_type,expected:Yt.bigint,received:h.parsedType}),vr}let o,i=new ka;for(let h of this._def.checks)h.kind==="min"?(h.inclusive?e.data<h.value:e.data<=h.value)&&(o=this._getOrReturnCtx(e,o),Wt(o,{code:Ot.too_small,type:"bigint",minimum:h.value,inclusive:h.inclusive,message:h.message}),i.dirty()):h.kind==="max"?(h.inclusive?e.data>h.value:e.data>=h.value)&&(o=this._getOrReturnCtx(e,o),Wt(o,{code:Ot.too_big,type:"bigint",maximum:h.value,inclusive:h.inclusive,message:h.message}),i.dirty()):h.kind==="multipleOf"?e.data%h.value!==BigInt(0)&&(o=this._getOrReturnCtx(e,o),Wt(o,{code:Ot.not_multiple_of,multipleOf:h.value,message:h.message}),i.dirty()):si.assertNever(h);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,ir.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ir.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ir.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ir.toString(r))}setLimit(e,r,o,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:o,message:ir.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ir.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ir.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ir.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ir.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ir.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};id.create=t=>{var e;return new id({checks:[],typeName:cr.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Br(t)})};var nd=class extends Pr{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Yt.boolean){let o=this._getOrReturnCtx(e);return Wt(o,{code:Ot.invalid_type,expected:Yt.boolean,received:o.parsedType}),vr}return Da(e.data)}};nd.create=t=>new nd({typeName:cr.ZodBoolean,coerce:t?.coerce||!1,...Br(t)});var ad=class t extends Pr{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Yt.date){let h=this._getOrReturnCtx(e);return Wt(h,{code:Ot.invalid_type,expected:Yt.date,received:h.parsedType}),vr}if(isNaN(e.data.getTime())){let h=this._getOrReturnCtx(e);return Wt(h,{code:Ot.invalid_date}),vr}let o=new ka,i;for(let h of this._def.checks)h.kind==="min"?e.data.getTime()<h.value&&(i=this._getOrReturnCtx(e,i),Wt(i,{code:Ot.too_small,message:h.message,inclusive:!0,exact:!1,minimum:h.value,type:"date"}),o.dirty()):h.kind==="max"?e.data.getTime()>h.value&&(i=this._getOrReturnCtx(e,i),Wt(i,{code:Ot.too_big,message:h.message,inclusive:!0,exact:!1,maximum:h.value,type:"date"}),o.dirty()):si.assertNever(h);return{status:o.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:ir.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:ir.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};ad.create=t=>new ad({checks:[],coerce:t?.coerce||!1,typeName:cr.ZodDate,...Br(t)});var _1=class extends Pr{_parse(e){if(this._getType(e)!==Yt.symbol){let o=this._getOrReturnCtx(e);return Wt(o,{code:Ot.invalid_type,expected:Yt.symbol,received:o.parsedType}),vr}return Da(e.data)}};_1.create=t=>new _1({typeName:cr.ZodSymbol,...Br(t)});var od=class extends Pr{_parse(e){if(this._getType(e)!==Yt.undefined){let o=this._getOrReturnCtx(e);return Wt(o,{code:Ot.invalid_type,expected:Yt.undefined,received:o.parsedType}),vr}return Da(e.data)}};od.create=t=>new od({typeName:cr.ZodUndefined,...Br(t)});var sd=class extends Pr{_parse(e){if(this._getType(e)!==Yt.null){let o=this._getOrReturnCtx(e);return Wt(o,{code:Ot.invalid_type,expected:Yt.null,received:o.parsedType}),vr}return Da(e.data)}};sd.create=t=>new sd({typeName:cr.ZodNull,...Br(t)});var cl=class extends Pr{constructor(){super(...arguments),this._any=!0}_parse(e){return Da(e.data)}};cl.create=t=>new cl({typeName:cr.ZodAny,...Br(t)});var Nh=class extends Pr{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Da(e.data)}};Nh.create=t=>new Nh({typeName:cr.ZodUnknown,...Br(t)});var Af=class extends Pr{_parse(e){let r=this._getOrReturnCtx(e);return Wt(r,{code:Ot.invalid_type,expected:Yt.never,received:r.parsedType}),vr}};Af.create=t=>new Af({typeName:cr.ZodNever,...Br(t)});var M1=class extends Pr{_parse(e){if(this._getType(e)!==Yt.undefined){let o=this._getOrReturnCtx(e);return Wt(o,{code:Ot.invalid_type,expected:Yt.void,received:o.parsedType}),vr}return Da(e.data)}};M1.create=t=>new M1({typeName:cr.ZodVoid,...Br(t)});var Ch=class t extends Pr{_parse(e){let{ctx:r,status:o}=this._processInputParams(e),i=this._def;if(r.parsedType!==Yt.array)return Wt(r,{code:Ot.invalid_type,expected:Yt.array,received:r.parsedType}),vr;if(i.exactLength!==null){let c=r.data.length>i.exactLength.value,v=r.data.length<i.exactLength.value;(c||v)&&(Wt(r,{code:c?Ot.too_big:Ot.too_small,minimum:v?i.exactLength.value:void 0,maximum:c?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),o.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(Wt(r,{code:Ot.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),o.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(Wt(r,{code:Ot.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),o.dirty()),r.common.async)return Promise.all([...r.data].map((c,v)=>i.type._parseAsync(new Ps(r,c,r.path,v)))).then(c=>ka.mergeArray(o,c));let h=[...r.data].map((c,v)=>i.type._parseSync(new Ps(r,c,r.path,v)));return ka.mergeArray(o,h)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:ir.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:ir.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:ir.toString(r)}})}nonempty(e){return this.min(1,e)}};Ch.create=(t,e)=>new Ch({type:t,minLength:null,maxLength:null,exactLength:null,typeName:cr.ZodArray,...Br(e)});function b1(t){if(t instanceof so){let e={};for(let r in t.shape){let o=t.shape[r];e[r]=Bs.create(b1(o))}return new so({...t._def,shape:()=>e})}else return t instanceof Ch?new Ch({...t._def,type:b1(t.element)}):t instanceof Bs?Bs.create(b1(t.unwrap())):t instanceof Ou?Ou.create(b1(t.unwrap())):t instanceof Pu?Pu.create(t.items.map(e=>b1(e))):t}var so=class t extends Pr{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=si.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==Yt.object){let g=this._getOrReturnCtx(e);return Wt(g,{code:Ot.invalid_type,expected:Yt.object,received:g.parsedType}),vr}let{status:o,ctx:i}=this._processInputParams(e),{shape:h,keys:c}=this._getCached(),v=[];if(!(this._def.catchall instanceof Af&&this._def.unknownKeys==="strip"))for(let g in i.data)c.includes(g)||v.push(g);let b=[];for(let g of c){let _=h[g],M=i.data[g];b.push({key:{status:"valid",value:g},value:_._parse(new Ps(i,M,i.path,g)),alwaysSet:g in i.data})}if(this._def.catchall instanceof Af){let g=this._def.unknownKeys;if(g==="passthrough")for(let _ of v)b.push({key:{status:"valid",value:_},value:{status:"valid",value:i.data[_]}});else if(g==="strict")v.length>0&&(Wt(i,{code:Ot.unrecognized_keys,keys:v}),o.dirty());else if(g!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let g=this._def.catchall;for(let _ of v){let M=i.data[_];b.push({key:{status:"valid",value:_},value:g._parse(new Ps(i,M,i.path,_)),alwaysSet:_ in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let g=[];for(let _ of b){let M=await _.key,x=await _.value;g.push({key:M,value:x,alwaysSet:_.alwaysSet})}return g}).then(g=>ka.mergeObjectSync(o,g)):ka.mergeObjectSync(o,b)}get shape(){return this._def.shape()}strict(e){return ir.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,o)=>{var i,h,c,v;let b=(c=(h=(i=this._def).errorMap)===null||h===void 0?void 0:h.call(i,r,o).message)!==null&&c!==void 0?c:o.defaultError;return r.code==="unrecognized_keys"?{message:(v=ir.errToObj(e).message)!==null&&v!==void 0?v:b}:{message:b}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:cr.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};return si.objectKeys(e).forEach(o=>{e[o]&&this.shape[o]&&(r[o]=this.shape[o])}),new t({...this._def,shape:()=>r})}omit(e){let r={};return si.objectKeys(this.shape).forEach(o=>{e[o]||(r[o]=this.shape[o])}),new t({...this._def,shape:()=>r})}deepPartial(){return b1(this)}partial(e){let r={};return si.objectKeys(this.shape).forEach(o=>{let i=this.shape[o];e&&!e[o]?r[o]=i:r[o]=i.optional()}),new t({...this._def,shape:()=>r})}required(e){let r={};return si.objectKeys(this.shape).forEach(o=>{if(e&&!e[o])r[o]=this.shape[o];else{let h=this.shape[o];for(;h instanceof Bs;)h=h._def.innerType;r[o]=h}}),new t({...this._def,shape:()=>r})}keyof(){return aQ(si.objectKeys(this.shape))}};so.create=(t,e)=>new so({shape:()=>t,unknownKeys:"strip",catchall:Af.create(),typeName:cr.ZodObject,...Br(e)});so.strictCreate=(t,e)=>new so({shape:()=>t,unknownKeys:"strict",catchall:Af.create(),typeName:cr.ZodObject,...Br(e)});so.lazycreate=(t,e)=>new so({shape:t,unknownKeys:"strip",catchall:Af.create(),typeName:cr.ZodObject,...Br(e)});var fd=class extends Pr{_parse(e){let{ctx:r}=this._processInputParams(e),o=this._def.options;function i(h){for(let v of h)if(v.result.status==="valid")return v.result;for(let v of h)if(v.result.status==="dirty")return r.common.issues.push(...v.ctx.common.issues),v.result;let c=h.map(v=>new Po(v.ctx.common.issues));return Wt(r,{code:Ot.invalid_union,unionErrors:c}),vr}if(r.common.async)return Promise.all(o.map(async h=>{let c={...r,common:{...r.common,issues:[]},parent:null};return{result:await h._parseAsync({data:r.data,path:r.path,parent:c}),ctx:c}})).then(i);{let h,c=[];for(let b of o){let g={...r,common:{...r.common,issues:[]},parent:null},_=b._parseSync({data:r.data,path:r.path,parent:g});if(_.status==="valid")return _;_.status==="dirty"&&!h&&(h={result:_,ctx:g}),g.common.issues.length&&c.push(g.common.issues)}if(h)return r.common.issues.push(...h.ctx.common.issues),h.result;let v=c.map(b=>new Po(b));return Wt(r,{code:Ot.invalid_union,unionErrors:v}),vr}}get options(){return this._def.options}};fd.create=(t,e)=>new fd({options:t,typeName:cr.ZodUnion,...Br(e)});var Oh=t=>t instanceof hd?Oh(t.schema):t instanceof Oo?Oh(t.innerType()):t instanceof ld?[t.value]:t instanceof cd?t.options:t instanceof dd?si.objectValues(t.enum):t instanceof pd?Oh(t._def.innerType):t instanceof od?[void 0]:t instanceof sd?[null]:t instanceof Bs?[void 0,...Oh(t.unwrap())]:t instanceof Ou?[null,...Oh(t.unwrap())]:t instanceof Og||t instanceof md?Oh(t.unwrap()):t instanceof vd?Oh(t._def.innerType):[],N8=class t extends Pr{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Yt.object)return Wt(r,{code:Ot.invalid_type,expected:Yt.object,received:r.parsedType}),vr;let o=this.discriminator,i=r.data[o],h=this.optionsMap.get(i);return h?r.common.async?h._parseAsync({data:r.data,path:r.path,parent:r}):h._parseSync({data:r.data,path:r.path,parent:r}):(Wt(r,{code:Ot.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),vr)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,o){let i=new Map;for(let h of r){let c=Oh(h.shape[e]);if(!c.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let v of c){if(i.has(v))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(v)}`);i.set(v,h)}}return new t({typeName:cr.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...Br(o)})}};function yT(t,e){let r=hl(t),o=hl(e);if(t===e)return{valid:!0,data:t};if(r===Yt.object&&o===Yt.object){let i=si.objectKeys(e),h=si.objectKeys(t).filter(v=>i.indexOf(v)!==-1),c={...t,...e};for(let v of h){let b=yT(t[v],e[v]);if(!b.valid)return{valid:!1};c[v]=b.data}return{valid:!0,data:c}}else if(r===Yt.array&&o===Yt.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let h=0;h<t.length;h++){let c=t[h],v=e[h],b=yT(c,v);if(!b.valid)return{valid:!1};i.push(b.data)}return{valid:!0,data:i}}else return r===Yt.date&&o===Yt.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var ud=class extends Pr{_parse(e){let{status:r,ctx:o}=this._processInputParams(e),i=(h,c)=>{if(gT(h)||gT(c))return vr;let v=yT(h.value,c.value);return v.valid?((bT(h)||bT(c))&&r.dirty(),{status:r.value,value:v.data}):(Wt(o,{code:Ot.invalid_intersection_types}),vr)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([h,c])=>i(h,c)):i(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}};ud.create=(t,e,r)=>new ud({left:t,right:e,typeName:cr.ZodIntersection,...Br(r)});var Pu=class t extends Pr{_parse(e){let{status:r,ctx:o}=this._processInputParams(e);if(o.parsedType!==Yt.array)return Wt(o,{code:Ot.invalid_type,expected:Yt.array,received:o.parsedType}),vr;if(o.data.length<this._def.items.length)return Wt(o,{code:Ot.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),vr;!this._def.rest&&o.data.length>this._def.items.length&&(Wt(o,{code:Ot.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let h=[...o.data].map((c,v)=>{let b=this._def.items[v]||this._def.rest;return b?b._parse(new Ps(o,c,o.path,v)):null}).filter(c=>!!c);return o.common.async?Promise.all(h).then(c=>ka.mergeArray(r,c)):ka.mergeArray(r,h)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Pu.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Pu({items:t,typeName:cr.ZodTuple,rest:null,...Br(e)})};var C8=class t extends Pr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:o}=this._processInputParams(e);if(o.parsedType!==Yt.object)return Wt(o,{code:Ot.invalid_type,expected:Yt.object,received:o.parsedType}),vr;let i=[],h=this._def.keyType,c=this._def.valueType;for(let v in o.data)i.push({key:h._parse(new Ps(o,v,o.path,v)),value:c._parse(new Ps(o,o.data[v],o.path,v)),alwaysSet:v in o.data});return o.common.async?ka.mergeObjectAsync(r,i):ka.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,o){return r instanceof Pr?new t({keyType:e,valueType:r,typeName:cr.ZodRecord,...Br(o)}):new t({keyType:ll.create(),valueType:e,typeName:cr.ZodRecord,...Br(r)})}},x1=class extends Pr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:o}=this._processInputParams(e);if(o.parsedType!==Yt.map)return Wt(o,{code:Ot.invalid_type,expected:Yt.map,received:o.parsedType}),vr;let i=this._def.keyType,h=this._def.valueType,c=[...o.data.entries()].map(([v,b],g)=>({key:i._parse(new Ps(o,v,o.path,[g,"key"])),value:h._parse(new Ps(o,b,o.path,[g,"value"]))}));if(o.common.async){let v=new Map;return Promise.resolve().then(async()=>{for(let b of c){let g=await b.key,_=await b.value;if(g.status==="aborted"||_.status==="aborted")return vr;(g.status==="dirty"||_.status==="dirty")&&r.dirty(),v.set(g.value,_.value)}return{status:r.value,value:v}})}else{let v=new Map;for(let b of c){let g=b.key,_=b.value;if(g.status==="aborted"||_.status==="aborted")return vr;(g.status==="dirty"||_.status==="dirty")&&r.dirty(),v.set(g.value,_.value)}return{status:r.value,value:v}}}};x1.create=(t,e,r)=>new x1({valueType:e,keyType:t,typeName:cr.ZodMap,...Br(r)});var S1=class t extends Pr{_parse(e){let{status:r,ctx:o}=this._processInputParams(e);if(o.parsedType!==Yt.set)return Wt(o,{code:Ot.invalid_type,expected:Yt.set,received:o.parsedType}),vr;let i=this._def;i.minSize!==null&&o.data.size<i.minSize.value&&(Wt(o,{code:Ot.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&o.data.size>i.maxSize.value&&(Wt(o,{code:Ot.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let h=this._def.valueType;function c(b){let g=new Set;for(let _ of b){if(_.status==="aborted")return vr;_.status==="dirty"&&r.dirty(),g.add(_.value)}return{status:r.value,value:g}}let v=[...o.data.values()].map((b,g)=>h._parse(new Ps(o,b,o.path,g)));return o.common.async?Promise.all(v).then(b=>c(b)):c(v)}min(e,r){return new t({...this._def,minSize:{value:e,message:ir.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:ir.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};S1.create=(t,e)=>new S1({valueType:t,minSize:null,maxSize:null,typeName:cr.ZodSet,...Br(e)});var L8=class t extends Pr{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Yt.function)return Wt(r,{code:Ot.invalid_type,expected:Yt.function,received:r.parsedType}),vr;function o(v,b){return P8({data:v,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,B8(),w1].filter(g=>!!g),issueData:{code:Ot.invalid_arguments,argumentsError:b}})}function i(v,b){return P8({data:v,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,B8(),w1].filter(g=>!!g),issueData:{code:Ot.invalid_return_type,returnTypeError:b}})}let h={errorMap:r.common.contextualErrorMap},c=r.data;if(this._def.returns instanceof dl){let v=this;return Da(async function(...b){let g=new Po([]),_=await v._def.args.parseAsync(b,h).catch(E=>{throw g.addIssue(o(b,E)),g}),M=await Reflect.apply(c,this,_);return await v._def.returns._def.type.parseAsync(M,h).catch(E=>{throw g.addIssue(i(M,E)),g})})}else{let v=this;return Da(function(...b){let g=v._def.args.safeParse(b,h);if(!g.success)throw new Po([o(b,g.error)]);let _=Reflect.apply(c,this,g.data),M=v._def.returns.safeParse(_,h);if(!M.success)throw new Po([i(_,M.error)]);return M.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Pu.create(e).rest(Nh.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,o){return new t({args:e||Pu.create([]).rest(Nh.create()),returns:r||Nh.create(),typeName:cr.ZodFunction,...Br(o)})}},hd=class extends Pr{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};hd.create=(t,e)=>new hd({getter:t,typeName:cr.ZodLazy,...Br(e)});var ld=class extends Pr{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return Wt(r,{received:r.data,code:Ot.invalid_literal,expected:this._def.value}),vr}return{status:"valid",value:e.data}}get value(){return this._def.value}};ld.create=(t,e)=>new ld({value:t,typeName:cr.ZodLiteral,...Br(e)});function aQ(t,e){return new cd({values:t,typeName:cr.ZodEnum,...Br(e)})}var cd=class t extends Pr{constructor(){super(...arguments),Ig.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),o=this._def.values;return Wt(r,{expected:si.joinValues(o),received:r.parsedType,code:Ot.invalid_type}),vr}if(O8(this,Ig,"f")||tQ(this,Ig,new Set(this._def.values),"f"),!O8(this,Ig,"f").has(e.data)){let r=this._getOrReturnCtx(e),o=this._def.values;return Wt(r,{received:r.data,code:Ot.invalid_enum_value,options:o}),vr}return Da(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(o=>!e.includes(o)),{...this._def,...r})}};Ig=new WeakMap;cd.create=aQ;var dd=class extends Pr{constructor(){super(...arguments),kg.set(this,void 0)}_parse(e){let r=si.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(e);if(o.parsedType!==Yt.string&&o.parsedType!==Yt.number){let i=si.objectValues(r);return Wt(o,{expected:si.joinValues(i),received:o.parsedType,code:Ot.invalid_type}),vr}if(O8(this,kg,"f")||tQ(this,kg,new Set(si.getValidEnumValues(this._def.values)),"f"),!O8(this,kg,"f").has(e.data)){let i=si.objectValues(r);return Wt(o,{received:o.data,code:Ot.invalid_enum_value,options:i}),vr}return Da(e.data)}get enum(){return this._def.values}};kg=new WeakMap;dd.create=(t,e)=>new dd({values:t,typeName:cr.ZodNativeEnum,...Br(e)});var dl=class extends Pr{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Yt.promise&&r.common.async===!1)return Wt(r,{code:Ot.invalid_type,expected:Yt.promise,received:r.parsedType}),vr;let o=r.parsedType===Yt.promise?r.data:Promise.resolve(r.data);return Da(o.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};dl.create=(t,e)=>new dl({type:t,typeName:cr.ZodPromise,...Br(e)});var Oo=class extends Pr{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===cr.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:o}=this._processInputParams(e),i=this._def.effect||null,h={addIssue:c=>{Wt(o,c),c.fatal?r.abort():r.dirty()},get path(){return o.path}};if(h.addIssue=h.addIssue.bind(h),i.type==="preprocess"){let c=i.transform(o.data,h);if(o.common.async)return Promise.resolve(c).then(async v=>{if(r.value==="aborted")return vr;let b=await this._def.schema._parseAsync({data:v,path:o.path,parent:o});return b.status==="aborted"?vr:b.status==="dirty"||r.value==="dirty"?y1(b.value):b});{if(r.value==="aborted")return vr;let v=this._def.schema._parseSync({data:c,path:o.path,parent:o});return v.status==="aborted"?vr:v.status==="dirty"||r.value==="dirty"?y1(v.value):v}}if(i.type==="refinement"){let c=v=>{let b=i.refinement(v,h);if(o.common.async)return Promise.resolve(b);if(b instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return v};if(o.common.async===!1){let v=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return v.status==="aborted"?vr:(v.status==="dirty"&&r.dirty(),c(v.value),{status:r.value,value:v.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(v=>v.status==="aborted"?vr:(v.status==="dirty"&&r.dirty(),c(v.value).then(()=>({status:r.value,value:v.value}))))}if(i.type==="transform")if(o.common.async===!1){let c=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!Bg(c))return c;let v=i.transform(c.value,h);if(v instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:v}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(c=>Bg(c)?Promise.resolve(i.transform(c.value,h)).then(v=>({status:r.value,value:v})):c);si.assertNever(i)}};Oo.create=(t,e,r)=>new Oo({schema:t,typeName:cr.ZodEffects,effect:e,...Br(r)});Oo.createWithPreprocess=(t,e,r)=>new Oo({schema:e,effect:{type:"preprocess",transform:t},typeName:cr.ZodEffects,...Br(r)});var Bs=class extends Pr{_parse(e){return this._getType(e)===Yt.undefined?Da(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Bs.create=(t,e)=>new Bs({innerType:t,typeName:cr.ZodOptional,...Br(e)});var Ou=class extends Pr{_parse(e){return this._getType(e)===Yt.null?Da(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ou.create=(t,e)=>new Ou({innerType:t,typeName:cr.ZodNullable,...Br(e)});var pd=class extends Pr{_parse(e){let{ctx:r}=this._processInputParams(e),o=r.data;return r.parsedType===Yt.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};pd.create=(t,e)=>new pd({innerType:t,typeName:cr.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Br(e)});var vd=class extends Pr{_parse(e){let{ctx:r}=this._processInputParams(e),o={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return Pg(i)?i.then(h=>({status:"valid",value:h.status==="valid"?h.value:this._def.catchValue({get error(){return new Po(o.common.issues)},input:o.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Po(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}};vd.create=(t,e)=>new vd({innerType:t,typeName:cr.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Br(e)});var E1=class extends Pr{_parse(e){if(this._getType(e)!==Yt.nan){let o=this._getOrReturnCtx(e);return Wt(o,{code:Ot.invalid_type,expected:Yt.nan,received:o.parsedType}),vr}return{status:"valid",value:e.data}}};E1.create=t=>new E1({typeName:cr.ZodNaN,...Br(t)});var I4e=Symbol("zod_brand"),Og=class extends Pr{_parse(e){let{ctx:r}=this._processInputParams(e),o=r.data;return this._def.type._parse({data:o,path:r.path,parent:r})}unwrap(){return this._def.type}},Ng=class t extends Pr{_parse(e){let{status:r,ctx:o}=this._processInputParams(e);if(o.common.async)return(async()=>{let h=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return h.status==="aborted"?vr:h.status==="dirty"?(r.dirty(),y1(h.value)):this._def.out._parseAsync({data:h.value,path:o.path,parent:o})})();{let i=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return i.status==="aborted"?vr:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:o.path,parent:o})}}static create(e,r){return new t({in:e,out:r,typeName:cr.ZodPipeline})}},md=class extends Pr{_parse(e){let r=this._def.innerType._parse(e),o=i=>(Bg(i)&&(i.value=Object.freeze(i.value)),i);return Pg(r)?r.then(i=>o(i)):o(r)}unwrap(){return this._def.innerType}};md.create=(t,e)=>new md({innerType:t,typeName:cr.ZodReadonly,...Br(e)});function oQ(t,e={},r){return t?cl.create().superRefine((o,i)=>{var h,c;if(!t(o)){let v=typeof e=="function"?e(o):typeof e=="string"?{message:e}:e,b=(c=(h=v.fatal)!==null&&h!==void 0?h:r)!==null&&c!==void 0?c:!0,g=typeof v=="string"?{message:v}:v;i.addIssue({code:"custom",...g,fatal:b})}}):cl.create()}var k4e={object:so.lazycreate},cr;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(cr||(cr={}));var B4e=(t,e={message:`Input not instance of ${t.name}`})=>oQ(r=>r instanceof t,e),sQ=ll.create,fQ=rd.create,P4e=E1.create,O4e=id.create,uQ=nd.create,N4e=ad.create,C4e=_1.create,L4e=od.create,D4e=sd.create,$4e=cl.create,q4e=Nh.create,U4e=Af.create,F4e=M1.create,j4e=Ch.create,z4e=so.create,Z4e=so.strictCreate,H4e=fd.create,K4e=N8.create,W4e=ud.create,V4e=Pu.create,G4e=C8.create,Y4e=x1.create,J4e=S1.create,X4e=L8.create,Q4e=hd.create,e5e=ld.create,t5e=cd.create,r5e=dd.create,i5e=dl.create,QX=Oo.create,n5e=Bs.create,a5e=Ou.create,o5e=Oo.createWithPreprocess,s5e=Ng.create,f5e=()=>sQ().optional(),u5e=()=>fQ().optional(),h5e=()=>uQ().optional(),l5e={string:t=>ll.create({...t,coerce:!0}),number:t=>rd.create({...t,coerce:!0}),boolean:t=>nd.create({...t,coerce:!0}),bigint:t=>id.create({...t,coerce:!0}),date:t=>ad.create({...t,coerce:!0})},c5e=vr,Qt=Object.freeze({__proto__:null,defaultErrorMap:w1,setErrorMap:c4e,getErrorMap:B8,makeIssue:P8,EMPTY_PATH:d4e,addIssueToContext:Wt,ParseStatus:ka,INVALID:vr,DIRTY:y1,OK:Da,isAborted:gT,isDirty:bT,isValid:Bg,isAsync:Pg,get util(){return si},get objectUtil(){return mT},ZodParsedType:Yt,getParsedType:hl,ZodType:Pr,datetimeRegex:nQ,ZodString:ll,ZodNumber:rd,ZodBigInt:id,ZodBoolean:nd,ZodDate:ad,ZodSymbol:_1,ZodUndefined:od,ZodNull:sd,ZodAny:cl,ZodUnknown:Nh,ZodNever:Af,ZodVoid:M1,ZodArray:Ch,ZodObject:so,ZodUnion:fd,ZodDiscriminatedUnion:N8,ZodIntersection:ud,ZodTuple:Pu,ZodRecord:C8,ZodMap:x1,ZodSet:S1,ZodFunction:L8,ZodLazy:hd,ZodLiteral:ld,ZodEnum:cd,ZodNativeEnum:dd,ZodPromise:dl,ZodEffects:Oo,ZodTransformer:Oo,ZodOptional:Bs,ZodNullable:Ou,ZodDefault:pd,ZodCatch:vd,ZodNaN:E1,BRAND:I4e,ZodBranded:Og,ZodPipeline:Ng,ZodReadonly:md,custom:oQ,Schema:Pr,ZodSchema:Pr,late:k4e,get ZodFirstPartyTypeKind(){return cr},coerce:l5e,any:$4e,array:j4e,bigint:O4e,boolean:uQ,date:N4e,discriminatedUnion:K4e,effect:QX,enum:t5e,function:X4e,instanceof:B4e,intersection:W4e,lazy:Q4e,literal:e5e,map:Y4e,nan:P4e,nativeEnum:r5e,never:U4e,null:D4e,nullable:a5e,number:fQ,object:z4e,oboolean:h5e,onumber:u5e,optional:n5e,ostring:f5e,pipeline:s5e,preprocess:o5e,promise:i5e,record:G4e,set:J4e,strictObject:Z4e,string:sQ,symbol:C4e,transformer:QX,tuple:V4e,undefined:L4e,union:H4e,unknown:q4e,void:F4e,NEVER:c5e,ZodIssueCode:Ot,quotelessJson:l4e,ZodError:Po});ie();ae();ne();var D8=new RegExp("^[a-zA-Z0-9_-]{43}$"),Xft=new RegExp("^(?:(?!-)[A-Za-z0-9-]{1,63}(?<!-)\\.)+[A-Za-z]{1,63}$"),Qft=new RegExp("^[0-9]{12},[0-9]{13},[a-fA-F0-9]{64}$"),eut=He.env.ARNS_REGISTRY_TX??"bLAgYxAdX2Ry-nt6aH2ixgvJXbpsEYm28NgJgyqfs-U",tut="_NctcA2sRy1-J4OmIQZbYFPM17piNcbdBPH2ncX2RL8",d5e="GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6GcRGrHc",rut=d5e,iut="agYcCFJtrMG6cqMuZfskIkFTGvUPddICmtQSBIoPdiA",Lh="qNvAoz0TgcH7DMg8BCVn8jF32QH5L6T29VjHxhHqqGE",$8="i_le_yKKPVstLTDSmkHRqf-wYphMnwB9OhleiTgMkWc",wT=1e6,hQ="pb4fCvdJqwT-_bn38ERMdqnOF4weRMjoJ6bY6yfl4a8",lQ="OO2ewZKq4AHoqGQmYUIl-NhJ-llQyFJ3ha4Uf4-w5RI",cQ="fcoN_xJeisVsPXA-trzVAuIiqO3ydLQxM-L4XbrQKzY",dQ="_GQ33BkPtZrqxA84vM8Zk-N2aO0toNNu_C-l-rawrBA";var gd=Qt.string({description:"Arweave Transaction ID"}).refine(t=>D8.test(t),{message:"Must be an Arweave Transaction ID"}),pQ=Qt.string({description:"Integer String"}).refine(t=>{let e=parseInt(t);return Number.isInteger(e)&&e>=0},{message:"Must be a non negative integer string"}),p5e=Qt.string(),mQ=Qt.array(Qt.string()),q8=Qt.object({transactionId:gd.describe("The Target ID of the undername"),ttlSeconds:Qt.number(),priority:Qt.number().optional()}),_T=Qt.record(Qt.string(),q8),MT=Qt.array(gd.describe("Controller address")),xT=Qt.record(gd.describe("Holder address"),Qt.number()),ST=Qt.object({Name:Qt.string().describe("The name of the ANT."),Ticker:Qt.string().describe("The ticker symbol for the ANT."),Description:Qt.string().describe("The description for the ANT."),Keywords:mQ.describe("The keywords for the ANT."),Denomination:Qt.number().describe("The number of decimal places to use for the ANT. Defaults to 0 if not set representing whole numbers.").min(0,{message:"Denomination must be a non-negative number"}),Owner:gd.describe("The Owners address."),Controllers:MT.describe("Controllers of the ANT who have administrative privileges."),Records:_T.describe("Records associated with the ANT."),Balances:xT.describe("Balance details for each address holding the ANT."),Logo:gd.describe("Transaction ID of the ANT logo."),TotalSupply:Qt.number().describe("Total supply of the ANT in circulation.").min(0,{message:"Total supply must be a non-negative number"}),Initialized:Qt.boolean().describe("Flag indicating whether the ANT has been initialized.")}),v5e=["balance","balances","totalSupply","info","controllers","record","records","state"],m5e=["_eval","_default","transfer","addController","removeController","setRecord","removeRecord","setName","setTicker","setDescription","setKeywords","setLogo","initializeState","releaseName","reassignName","approvePrimaryName","removePrimaryNames"],g5e=[...v5e,...m5e],vQ=Qt.array(Qt.string({description:"Handler Name"})).refine(t=>g5e.every(e=>t.includes(e)),{message:"ANT is missing required handlers"}),gQ=Qt.object({Name:Qt.string().describe("The name of the ANT."),Owner:gd.describe("The Owners address."),Ticker:Qt.string().describe("The ticker symbol for the ANT."),"Total-Supply":pQ.describe("Total supply of the ANT in circulation."),Description:p5e.describe("The description for the ANT."),Keywords:mQ.describe("The keywords for the ANT."),Logo:gd.describe("Transaction ID of the ANT logo."),Denomination:pQ.describe("The number of decimal places to use for the ANT. Defaults to 0 if not set representing whole numbers."),Handlers:vQ.optional().describe("List of handlers for the ANT."),HandlerNames:vQ.optional().describe('Deprecated: List of handlers for the ANT. Use "Handlers" instead.')});function hut(t){return ST.safeParse(t).success}ie();ae();ne();ie();ae();ne();ie();ae();ne();ie();ae();ne();ie();ae();ne();var b5e=Object.create,aI=Object.defineProperty,y5e=Object.getOwnPropertyDescriptor,zQ=Object.getOwnPropertyNames,w5e=Object.getPrototypeOf,_5e=Object.prototype.hasOwnProperty,No=(t,e)=>function(){return e||(0,t[zQ(t)[0]])((e={exports:{}}).exports,e),e.exports},ZQ=(t,e)=>{for(var r in e)aI(t,r,{get:e[r],enumerable:!0})},M5e=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of zQ(e))!_5e.call(t,i)&&i!==r&&aI(t,i,{get:()=>e[i],enumerable:!(o=y5e(e,i))||o.enumerable});return t},oI=(t,e,r)=>(r=t!=null?b5e(w5e(t)):{},M5e(e||!t||!t.__esModule?aI(r,"default",{value:t,enumerable:!0}):r,t)),x5e=No({"node_modules/obliterator/iterator.js"(t,e){function r(o){if(typeof o!="function")throw new Error("obliterator/iterator: expecting a function!");this.next=o}typeof Symbol<"u"&&(r.prototype[Symbol.iterator]=function(){return this}),r.of=function(){var o=arguments,i=o.length,h=0;return new r(function(){return h>=i?{done:!0}:{done:!1,value:o[h++]}})},r.empty=function(){var o=new r(function(){return{done:!0}});return o},r.fromSequence=function(o){var i=0,h=o.length;return new r(function(){return i>=h?{done:!0}:{done:!1,value:o[i++]}})},r.is=function(o){return o instanceof r?!0:typeof o=="object"&&o!==null&&typeof o.next=="function"},e.exports=r}}),S5e=No({"node_modules/obliterator/support.js"(t){t.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<"u",t.SYMBOL_SUPPORT=typeof Symbol<"u"}}),sI=No({"node_modules/obliterator/foreach.js"(t,e){var r=S5e(),o=r.ARRAY_BUFFER_SUPPORT,i=r.SYMBOL_SUPPORT;e.exports=function(c,v){var b,g,_,M,x;if(!c)throw new Error("obliterator/forEach: invalid iterable.");if(typeof v!="function")throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(c)||o&&ArrayBuffer.isView(c)||typeof c=="string"||c.toString()==="[object Arguments]"){for(_=0,M=c.length;_<M;_++)v(c[_],_);return}if(typeof c.forEach=="function"){c.forEach(v);return}if(i&&Symbol.iterator in c&&typeof c.next!="function"&&(c=c[Symbol.iterator]()),typeof c.next=="function"){for(b=c,_=0;x=b.next(),x.done!==!0;)v(x.value,_),_++;return}for(g in c)c.hasOwnProperty(g)&&v(c[g],g)}}}),fI=No({"node_modules/mnemonist/utils/typed-arrays.js"(t){var e=Math.pow(2,8)-1,r=Math.pow(2,16)-1,o=Math.pow(2,32)-1,i=Math.pow(2,7)-1,h=Math.pow(2,15)-1,c=Math.pow(2,31)-1;t.getPointerArray=function(b){var g=b-1;if(g<=e)return Uint8Array;if(g<=r)return Uint16Array;if(g<=o)return Uint32Array;throw new Error("mnemonist: Pointer Array of size > 4294967295 is not supported.")},t.getSignedPointerArray=function(b){var g=b-1;return g<=i?Int8Array:g<=h?Int16Array:g<=c?Int32Array:Float64Array},t.getNumberType=function(b){return b===(b|0)?Math.sign(b)===-1?b<=127&&b>=-128?Int8Array:b<=32767&&b>=-32768?Int16Array:Int32Array:b<=255?Uint8Array:b<=65535?Uint16Array:Uint32Array:Float64Array};var v={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};t.getMinimalRepresentation=function(b,g){var _=null,M=0,x,E,A,I,P;for(I=0,P=b.length;I<P;I++)A=g?g(b[I]):b[I],E=t.getNumberType(A),x=v[E.name],x>M&&(M=x,_=E);return _},t.isTypedArray=function(b){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView(b)},t.concat=function(){var b=0,g,_,M;for(g=0,M=arguments.length;g<M;g++)b+=arguments[g].length;var x=new arguments[0].constructor(b);for(g=0,_=0;g<M;g++)x.set(arguments[g],_),_+=arguments[g].length;return x},t.indices=function(b){for(var g=t.getPointerArray(b),_=new g(b),M=0;M<b;M++)_[M]=M;return _}}}),HQ=No({"node_modules/mnemonist/utils/iterables.js"(t){var e=sI(),r=fI();function o(v){return Array.isArray(v)||r.isTypedArray(v)}function i(v){if(typeof v.length=="number")return v.length;if(typeof v.size=="number")return v.size}function h(v){var b=i(v),g=typeof b=="number"?new Array(b):[],_=0;return e(v,function(M){g[_++]=M}),g}function c(v){var b=i(v),g=typeof b=="number"?r.getPointerArray(b):Array,_=typeof b=="number"?new Array(b):[],M=typeof b=="number"?new g(b):[],x=0;return e(v,function(E){_[x]=E,M[x]=x++}),[_,M]}t.isArrayLike=o,t.guessLength=i,t.toArray=h,t.toArrayWithIndices=c}}),E5e=No({"node_modules/mnemonist/lru-cache.js"(t,e){var r=x5e(),o=sI(),i=fI(),h=HQ();function c(v,b,g){if(arguments.length<2&&(g=v,v=null,b=null),this.capacity=g,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-cache: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-cache: capacity should be a finite positive integer.");var _=i.getPointerArray(g);this.forward=new _(g),this.backward=new _(g),this.K=typeof v=="function"?new v(g):new Array(g),this.V=typeof b=="function"?new b(g):new Array(g),this.size=0,this.head=0,this.tail=0,this.items={}}c.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items={}},c.prototype.splayOnTop=function(v){var b=this.head;if(this.head===v)return this;var g=this.backward[v],_=this.forward[v];return this.tail===v?this.tail=g:this.backward[_]=g,this.forward[g]=_,this.backward[b]=v,this.head=v,this.forward[v]=b,this},c.prototype.set=function(v,b){var g=this.items[v];if(typeof g<"u"){this.splayOnTop(g),this.V[g]=b;return}this.size<this.capacity?g=this.size++:(g=this.tail,this.tail=this.backward[g],delete this.items[this.K[g]]),this.items[v]=g,this.K[g]=v,this.V[g]=b,this.forward[g]=this.head,this.backward[this.head]=g,this.head=g},c.prototype.setpop=function(v,b){var g=null,_=null,M=this.items[v];return typeof M<"u"?(this.splayOnTop(M),g=this.V[M],this.V[M]=b,{evicted:!1,key:v,value:g}):(this.size<this.capacity?M=this.size++:(M=this.tail,this.tail=this.backward[M],g=this.V[M],_=this.K[M],delete this.items[_]),this.items[v]=M,this.K[M]=v,this.V[M]=b,this.forward[M]=this.head,this.backward[this.head]=M,this.head=M,_?{evicted:!0,key:_,value:g}:null)},c.prototype.has=function(v){return v in this.items},c.prototype.get=function(v){var b=this.items[v];if(!(typeof b>"u"))return this.splayOnTop(b),this.V[b]},c.prototype.peek=function(v){var b=this.items[v];if(!(typeof b>"u"))return this.V[b]},c.prototype.forEach=function(v,b){b=arguments.length>1?b:this;for(var g=0,_=this.size,M=this.head,x=this.K,E=this.V,A=this.forward;g<_;)v.call(b,E[M],x[M],this),M=A[M],g++},c.prototype.keys=function(){var v=0,b=this.size,g=this.head,_=this.K,M=this.forward;return new r(function(){if(v>=b)return{done:!0};var x=_[g];return v++,v<b&&(g=M[g]),{done:!1,value:x}})},c.prototype.values=function(){var v=0,b=this.size,g=this.head,_=this.V,M=this.forward;return new r(function(){if(v>=b)return{done:!0};var x=_[g];return v++,v<b&&(g=M[g]),{done:!1,value:x}})},c.prototype.entries=function(){var v=0,b=this.size,g=this.head,_=this.K,M=this.V,x=this.forward;return new r(function(){if(v>=b)return{done:!0};var E=_[g],A=M[g];return v++,v<b&&(g=x[g]),{done:!1,value:[E,A]}})},typeof Symbol<"u"&&(c.prototype[Symbol.iterator]=c.prototype.entries),c.prototype.inspect=function(){for(var v=new Map,b=this.entries(),g;g=b.next(),!g.done;)v.set(g.value[0],g.value[1]);return Object.defineProperty(v,"constructor",{value:c,enumerable:!1}),v},typeof Symbol<"u"&&(c.prototype[Symbol.for("nodejs.util.inspect.custom")]=c.prototype.inspect),c.from=function(v,b,g,_){if(arguments.length<2){if(_=h.guessLength(v),typeof _!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(_=b,b=null,g=null);var M=new c(b,g,_);return o(v,function(x,E){M.set(E,x)}),M},e.exports=c}}),A5e=No({"node_modules/mnemonist/lru-map.js"(t,e){var r=E5e(),o=sI(),i=fI(),h=HQ();function c(v,b,g){if(arguments.length<2&&(g=v,v=null,b=null),this.capacity=g,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-map: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-map: capacity should be a finite positive integer.");var _=i.getPointerArray(g);this.forward=new _(g),this.backward=new _(g),this.K=typeof v=="function"?new v(g):new Array(g),this.V=typeof b=="function"?new b(g):new Array(g),this.size=0,this.head=0,this.tail=0,this.items=new Map}c.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items.clear()},c.prototype.set=function(v,b){var g=this.items.get(v);if(typeof g<"u"){this.splayOnTop(g),this.V[g]=b;return}this.size<this.capacity?g=this.size++:(g=this.tail,this.tail=this.backward[g],this.items.delete(this.K[g])),this.items.set(v,g),this.K[g]=v,this.V[g]=b,this.forward[g]=this.head,this.backward[this.head]=g,this.head=g},c.prototype.setpop=function(v,b){var g=null,_=null,M=this.items.get(v);return typeof M<"u"?(this.splayOnTop(M),g=this.V[M],this.V[M]=b,{evicted:!1,key:v,value:g}):(this.size<this.capacity?M=this.size++:(M=this.tail,this.tail=this.backward[M],g=this.V[M],_=this.K[M],this.items.delete(_)),this.items.set(v,M),this.K[M]=v,this.V[M]=b,this.forward[M]=this.head,this.backward[this.head]=M,this.head=M,_?{evicted:!0,key:_,value:g}:null)},c.prototype.has=function(v){return this.items.has(v)},c.prototype.get=function(v){var b=this.items.get(v);if(!(typeof b>"u"))return this.splayOnTop(b),this.V[b]},c.prototype.peek=function(v){var b=this.items.get(v);if(!(typeof b>"u"))return this.V[b]},c.prototype.splayOnTop=r.prototype.splayOnTop,c.prototype.forEach=r.prototype.forEach,c.prototype.keys=r.prototype.keys,c.prototype.values=r.prototype.values,c.prototype.entries=r.prototype.entries,typeof Symbol<"u"&&(c.prototype[Symbol.iterator]=c.prototype.entries),c.prototype.inspect=r.prototype.inspect,c.from=function(v,b,g,_){if(arguments.length<2){if(_=h.guessLength(v),typeof _!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(_=b,b=null,g=null);var M=new c(b,g,_);return o(v,function(x,E){M.set(E,x)}),M},e.exports=c}}),R5e=No({"node_modules/ms/index.js"(t,e){var r=1e3,o=r*60,i=o*60,h=i*24,c=h*7,v=h*365.25;e.exports=function(x,E){E=E||{};var A=typeof x;if(A==="string"&&x.length>0)return b(x);if(A==="number"&&isFinite(x))return E.long?_(x):g(x);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(x))};function b(x){if(x=String(x),!(x.length>100)){var E=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(x);if(E){var A=parseFloat(E[1]),I=(E[2]||"ms").toLowerCase();switch(I){case"years":case"year":case"yrs":case"yr":case"y":return A*v;case"weeks":case"week":case"w":return A*c;case"days":case"day":case"d":return A*h;case"hours":case"hour":case"hrs":case"hr":case"h":return A*i;case"minutes":case"minute":case"mins":case"min":case"m":return A*o;case"seconds":case"second":case"secs":case"sec":case"s":return A*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return A;default:return}}}}function g(x){var E=Math.abs(x);return E>=h?Math.round(x/h)+"d":E>=i?Math.round(x/i)+"h":E>=o?Math.round(x/o)+"m":E>=r?Math.round(x/r)+"s":x+"ms"}function _(x){var E=Math.abs(x);return E>=h?M(x,E,h,"day"):E>=i?M(x,E,i,"hour"):E>=o?M(x,E,o,"minute"):E>=r?M(x,E,r,"second"):x+" ms"}function M(x,E,A,I){var P=E>=A*1.5;return Math.round(x/A)+" "+I+(P?"s":"")}}}),T5e=No({"node_modules/debug/src/common.js"(t,e){function r(o){h.debug=h,h.default=h,h.coerce=M,h.disable=b,h.enable=v,h.enabled=g,h.humanize=R5e(),h.destroy=x,Object.keys(o).forEach(E=>{h[E]=o[E]}),h.names=[],h.skips=[],h.formatters={};function i(E){let A=0;for(let I=0;I<E.length;I++)A=(A<<5)-A+E.charCodeAt(I),A|=0;return h.colors[Math.abs(A)%h.colors.length]}h.selectColor=i;function h(E){let A,I=null,P,N;function L(...C){if(!L.enabled)return;let Y=L,G=Number(new Date),te=G-(A||G);Y.diff=te,Y.prev=A,Y.curr=G,A=G,C[0]=h.coerce(C[0]),typeof C[0]!="string"&&C.unshift("%O");let $=0;C[0]=C[0].replace(/%([a-zA-Z%])/g,(V,w)=>{if(V==="%%")return"%";$++;let n=h.formatters[w];if(typeof n=="function"){let s=C[$];V=n.call(Y,s),C.splice($,1),$--}return V}),h.formatArgs.call(Y,C),(Y.log||h.log).apply(Y,C)}return L.namespace=E,L.useColors=h.useColors(),L.color=h.selectColor(E),L.extend=c,L.destroy=h.destroy,Object.defineProperty(L,"enabled",{enumerable:!0,configurable:!1,get:()=>I!==null?I:(P!==h.namespaces&&(P=h.namespaces,N=h.enabled(E)),N),set:C=>{I=C}}),typeof h.init=="function"&&h.init(L),L}function c(E,A){let I=h(this.namespace+(typeof A>"u"?":":A)+E);return I.log=this.log,I}function v(E){h.save(E),h.namespaces=E,h.names=[],h.skips=[];let A,I=(typeof E=="string"?E:"").split(/[\s,]+/),P=I.length;for(A=0;A<P;A++)I[A]&&(E=I[A].replace(/\*/g,".*?"),E[0]==="-"?h.skips.push(new RegExp("^"+E.slice(1)+"$")):h.names.push(new RegExp("^"+E+"$")))}function b(){let E=[...h.names.map(_),...h.skips.map(_).map(A=>"-"+A)].join(",");return h.enable(""),E}function g(E){if(E[E.length-1]==="*")return!0;let A,I;for(A=0,I=h.skips.length;A<I;A++)if(h.skips[A].test(E))return!1;for(A=0,I=h.names.length;A<I;A++)if(h.names[A].test(E))return!0;return!1}function _(E){return E.toString().substring(2,E.toString().length-2).replace(/\.\*\?$/,"*")}function M(E){return E instanceof Error?E.stack||E.message:E}function x(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return h.enable(h.load()),h}e.exports=r}}),I5e=No({"node_modules/debug/src/browser.js"(t,e){t.formatArgs=o,t.save=i,t.load=h,t.useColors=r,t.storage=c(),t.destroy=(()=>{let b=!1;return()=>{b||(b=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function o(b){if(b[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+b[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;let g="color: "+this.color;b.splice(1,0,g,"color: inherit");let _=0,M=0;b[0].replace(/%[a-zA-Z%]/g,x=>{x!=="%%"&&(_++,x==="%c"&&(M=_))}),b.splice(M,0,g)}t.log=console.debug||console.log||(()=>{});function i(b){try{b?t.storage.setItem("debug",b):t.storage.removeItem("debug")}catch{}}function h(){let b;try{b=t.storage.getItem("debug")}catch{}return!b&&typeof He<"u"&&"env"in He&&(b=He.env.DEBUG),b}function c(){try{return localStorage}catch{}}e.exports=T5e()(t);var{formatters:v}=e.exports;v.j=function(b){try{return JSON.stringify(b)}catch(g){return"[UnexpectedJSONParseError]: "+g.message}}}}),k5e=No({"node_modules/base64-js/index.js"(t){"use strict";t.byteLength=b,t.toByteArray=_,t.fromByteArray=E;var e=[],r=[],o=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(h=0,c=i.length;h<c;++h)e[h]=i[h],r[i.charCodeAt(h)]=h;var h,c;r[45]=62,r[95]=63;function v(A){var I=A.length;if(I%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var P=A.indexOf("=");P===-1&&(P=I);var N=P===I?0:4-P%4;return[P,N]}function b(A){var I=v(A),P=I[0],N=I[1];return(P+N)*3/4-N}function g(A,I,P){return(I+P)*3/4-P}function _(A){var I,P=v(A),N=P[0],L=P[1],C=new o(g(A,N,L)),Y=0,G=L>0?N-4:N,te;for(te=0;te<G;te+=4)I=r[A.charCodeAt(te)]<<18|r[A.charCodeAt(te+1)]<<12|r[A.charCodeAt(te+2)]<<6|r[A.charCodeAt(te+3)],C[Y++]=I>>16&255,C[Y++]=I>>8&255,C[Y++]=I&255;return L===2&&(I=r[A.charCodeAt(te)]<<2|r[A.charCodeAt(te+1)]>>4,C[Y++]=I&255),L===1&&(I=r[A.charCodeAt(te)]<<10|r[A.charCodeAt(te+1)]<<4|r[A.charCodeAt(te+2)]>>2,C[Y++]=I>>8&255,C[Y++]=I&255),C}function M(A){return e[A>>18&63]+e[A>>12&63]+e[A>>6&63]+e[A&63]}function x(A,I,P){for(var N,L=[],C=I;C<P;C+=3)N=(A[C]<<16&16711680)+(A[C+1]<<8&65280)+(A[C+2]&255),L.push(M(N));return L.join("")}function E(A){for(var I,P=A.length,N=P%3,L=[],C=16383,Y=0,G=P-N;Y<G;Y+=C)L.push(x(A,Y,Y+C>G?G:Y+C));return N===1?(I=A[P-1],L.push(e[I>>2]+e[I<<4&63]+"==")):N===2&&(I=(A[P-2]<<8)+A[P-1],L.push(e[I>>10]+e[I>>4&63]+e[I<<2&63]+"=")),L.join("")}}}),B5e=No({"node_modules/ieee754/index.js"(t){t.read=function(e,r,o,i,h){var c,v,b=h*8-i-1,g=(1<<b)-1,_=g>>1,M=-7,x=o?h-1:0,E=o?-1:1,A=e[r+x];for(x+=E,c=A&(1<<-M)-1,A>>=-M,M+=b;M>0;c=c*256+e[r+x],x+=E,M-=8);for(v=c&(1<<-M)-1,c>>=-M,M+=i;M>0;v=v*256+e[r+x],x+=E,M-=8);if(c===0)c=1-_;else{if(c===g)return v?NaN:(A?-1:1)*(1/0);v=v+Math.pow(2,i),c=c-_}return(A?-1:1)*v*Math.pow(2,c-i)},t.write=function(e,r,o,i,h,c){var v,b,g,_=c*8-h-1,M=(1<<_)-1,x=M>>1,E=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=i?0:c-1,I=i?1:-1,P=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(b=isNaN(r)?1:0,v=M):(v=Math.floor(Math.log(r)/Math.LN2),r*(g=Math.pow(2,-v))<1&&(v--,g*=2),v+x>=1?r+=E/g:r+=E*Math.pow(2,1-x),r*g>=2&&(v++,g/=2),v+x>=M?(b=0,v=M):v+x>=1?(b=(r*g-1)*Math.pow(2,h),v=v+x):(b=r*Math.pow(2,x-1)*Math.pow(2,h),v=0));h>=8;e[o+A]=b&255,A+=I,b/=256,h-=8);for(v=v<<h|b,_+=h;_>0;e[o+A]=v&255,A+=I,v/=256,_-=8);e[o+A-I]|=P*128}}}),P5e=No({"node_modules/buffer/index.js"(t){"use strict";var e=k5e(),r=B5e(),o=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=v,t.SlowBuffer=L,t.INSPECT_MAX_BYTES=50;var i=2147483647;t.kMaxLength=i,v.TYPED_ARRAY_SUPPORT=h(),!v.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function h(){try{let T=new Uint8Array(1),k={foo:function(){return 42}};return Object.setPrototypeOf(k,Uint8Array.prototype),Object.setPrototypeOf(T,k),T.foo()===42}catch{return!1}}Object.defineProperty(v.prototype,"parent",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.buffer}}),Object.defineProperty(v.prototype,"offset",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.byteOffset}});function c(T){if(T>i)throw new RangeError('The value "'+T+'" is invalid for option "size"');let k=new Uint8Array(T);return Object.setPrototypeOf(k,v.prototype),k}function v(T,k,O){if(typeof T=="number"){if(typeof k=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return M(T)}return b(T,k,O)}v.poolSize=8192;function b(T,k,O){if(typeof T=="string")return x(T,k);if(ArrayBuffer.isView(T))return A(T);if(T==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T);if(ut(T,ArrayBuffer)||T&&ut(T.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ut(T,SharedArrayBuffer)||T&&ut(T.buffer,SharedArrayBuffer)))return I(T,k,O);if(typeof T=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let q=T.valueOf&&T.valueOf();if(q!=null&&q!==T)return v.from(q,k,O);let H=P(T);if(H)return H;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof T[Symbol.toPrimitive]=="function")return v.from(T[Symbol.toPrimitive]("string"),k,O);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T)}v.from=function(T,k,O){return b(T,k,O)},Object.setPrototypeOf(v.prototype,Uint8Array.prototype),Object.setPrototypeOf(v,Uint8Array);function g(T){if(typeof T!="number")throw new TypeError('"size" argument must be of type number');if(T<0)throw new RangeError('The value "'+T+'" is invalid for option "size"')}function _(T,k,O){return g(T),T<=0?c(T):k!==void 0?typeof O=="string"?c(T).fill(k,O):c(T).fill(k):c(T)}v.alloc=function(T,k,O){return _(T,k,O)};function M(T){return g(T),c(T<0?0:N(T)|0)}v.allocUnsafe=function(T){return M(T)},v.allocUnsafeSlow=function(T){return M(T)};function x(T,k){if((typeof k!="string"||k==="")&&(k="utf8"),!v.isEncoding(k))throw new TypeError("Unknown encoding: "+k);let O=C(T,k)|0,q=c(O),H=q.write(T,k);return H!==O&&(q=q.slice(0,H)),q}function E(T){let k=T.length<0?0:N(T.length)|0,O=c(k);for(let q=0;q<k;q+=1)O[q]=T[q]&255;return O}function A(T){if(ut(T,Uint8Array)){let k=new Uint8Array(T);return I(k.buffer,k.byteOffset,k.byteLength)}return E(T)}function I(T,k,O){if(k<0||T.byteLength<k)throw new RangeError('"offset" is outside of buffer bounds');if(T.byteLength<k+(O||0))throw new RangeError('"length" is outside of buffer bounds');let q;return k===void 0&&O===void 0?q=new Uint8Array(T):O===void 0?q=new Uint8Array(T,k):q=new Uint8Array(T,k,O),Object.setPrototypeOf(q,v.prototype),q}function P(T){if(v.isBuffer(T)){let k=N(T.length)|0,O=c(k);return O.length===0||T.copy(O,0,0,k),O}if(T.length!==void 0)return typeof T.length!="number"||Ae(T.length)?c(0):E(T);if(T.type==="Buffer"&&Array.isArray(T.data))return E(T.data)}function N(T){if(T>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return T|0}function L(T){return+T!=T&&(T=0),v.alloc(+T)}v.isBuffer=function(k){return k!=null&&k._isBuffer===!0&&k!==v.prototype},v.compare=function(k,O){if(ut(k,Uint8Array)&&(k=v.from(k,k.offset,k.byteLength)),ut(O,Uint8Array)&&(O=v.from(O,O.offset,O.byteLength)),!v.isBuffer(k)||!v.isBuffer(O))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(k===O)return 0;let q=k.length,H=O.length;for(let W=0,se=Math.min(q,H);W<se;++W)if(k[W]!==O[W]){q=k[W],H=O[W];break}return q<H?-1:H<q?1:0},v.isEncoding=function(k){switch(String(k).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},v.concat=function(k,O){if(!Array.isArray(k))throw new TypeError('"list" argument must be an Array of Buffers');if(k.length===0)return v.alloc(0);let q;if(O===void 0)for(O=0,q=0;q<k.length;++q)O+=k[q].length;let H=v.allocUnsafe(O),W=0;for(q=0;q<k.length;++q){let se=k[q];if(ut(se,Uint8Array))W+se.length>H.length?(v.isBuffer(se)||(se=v.from(se)),se.copy(H,W)):Uint8Array.prototype.set.call(H,se,W);else if(v.isBuffer(se))se.copy(H,W);else throw new TypeError('"list" argument must be an Array of Buffers');W+=se.length}return H};function C(T,k){if(v.isBuffer(T))return T.length;if(ArrayBuffer.isView(T)||ut(T,ArrayBuffer))return T.byteLength;if(typeof T!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof T);let O=T.length,q=arguments.length>2&&arguments[2]===!0;if(!q&&O===0)return 0;let H=!1;for(;;)switch(k){case"ascii":case"latin1":case"binary":return O;case"utf8":case"utf-8":return oe(T).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O*2;case"hex":return O>>>1;case"base64":return ge(T).length;default:if(H)return q?-1:oe(T).length;k=(""+k).toLowerCase(),H=!0}}v.byteLength=C;function Y(T,k,O){let q=!1;if((k===void 0||k<0)&&(k=0),k>this.length||((O===void 0||O>this.length)&&(O=this.length),O<=0)||(O>>>=0,k>>>=0,O<=k))return"";for(T||(T="utf8");;)switch(T){case"hex":return a(this,k,O);case"utf8":case"utf-8":return u(this,k,O);case"ascii":return y(this,k,O);case"latin1":case"binary":return d(this,k,O);case"base64":return f(this,k,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return p(this,k,O);default:if(q)throw new TypeError("Unknown encoding: "+T);T=(T+"").toLowerCase(),q=!0}}v.prototype._isBuffer=!0;function G(T,k,O){let q=T[k];T[k]=T[O],T[O]=q}v.prototype.swap16=function(){let k=this.length;if(k%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let O=0;O<k;O+=2)G(this,O,O+1);return this},v.prototype.swap32=function(){let k=this.length;if(k%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let O=0;O<k;O+=4)G(this,O,O+3),G(this,O+1,O+2);return this},v.prototype.swap64=function(){let k=this.length;if(k%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let O=0;O<k;O+=8)G(this,O,O+7),G(this,O+1,O+6),G(this,O+2,O+5),G(this,O+3,O+4);return this},v.prototype.toString=function(){let k=this.length;return k===0?"":arguments.length===0?u(this,0,k):Y.apply(this,arguments)},v.prototype.toLocaleString=v.prototype.toString,v.prototype.equals=function(k){if(!v.isBuffer(k))throw new TypeError("Argument must be a Buffer");return this===k?!0:v.compare(this,k)===0},v.prototype.inspect=function(){let k="",O=t.INSPECT_MAX_BYTES;return k=this.toString("hex",0,O).replace(/(.{2})/g,"$1 ").trim(),this.length>O&&(k+=" ... "),"<Buffer "+k+">"},o&&(v.prototype[o]=v.prototype.inspect),v.prototype.compare=function(k,O,q,H,W){if(ut(k,Uint8Array)&&(k=v.from(k,k.offset,k.byteLength)),!v.isBuffer(k))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof k);if(O===void 0&&(O=0),q===void 0&&(q=k?k.length:0),H===void 0&&(H=0),W===void 0&&(W=this.length),O<0||q>k.length||H<0||W>this.length)throw new RangeError("out of range index");if(H>=W&&O>=q)return 0;if(H>=W)return-1;if(O>=q)return 1;if(O>>>=0,q>>>=0,H>>>=0,W>>>=0,this===k)return 0;let se=W-H,st=q-O,ue=Math.min(se,st),pe=this.slice(H,W),ve=k.slice(O,q);for(let be=0;be<ue;++be)if(pe[be]!==ve[be]){se=pe[be],st=ve[be];break}return se<st?-1:st<se?1:0};function te(T,k,O,q,H){if(T.length===0)return-1;if(typeof O=="string"?(q=O,O=0):O>2147483647?O=2147483647:O<-2147483648&&(O=-2147483648),O=+O,Ae(O)&&(O=H?0:T.length-1),O<0&&(O=T.length+O),O>=T.length){if(H)return-1;O=T.length-1}else if(O<0)if(H)O=0;else return-1;if(typeof k=="string"&&(k=v.from(k,q)),v.isBuffer(k))return k.length===0?-1:$(T,k,O,q,H);if(typeof k=="number")return k=k&255,typeof Uint8Array.prototype.indexOf=="function"?H?Uint8Array.prototype.indexOf.call(T,k,O):Uint8Array.prototype.lastIndexOf.call(T,k,O):$(T,[k],O,q,H);throw new TypeError("val must be string, number or Buffer")}function $(T,k,O,q,H){let W=1,se=T.length,st=k.length;if(q!==void 0&&(q=String(q).toLowerCase(),q==="ucs2"||q==="ucs-2"||q==="utf16le"||q==="utf-16le")){if(T.length<2||k.length<2)return-1;W=2,se/=2,st/=2,O/=2}function ue(ve,be){return W===1?ve[be]:ve.readUInt16BE(be*W)}let pe;if(H){let ve=-1;for(pe=O;pe<se;pe++)if(ue(T,pe)===ue(k,ve===-1?0:pe-ve)){if(ve===-1&&(ve=pe),pe-ve+1===st)return ve*W}else ve!==-1&&(pe-=pe-ve),ve=-1}else for(O+st>se&&(O=se-st),pe=O;pe>=0;pe--){let ve=!0;for(let be=0;be<st;be++)if(ue(T,pe+be)!==ue(k,be)){ve=!1;break}if(ve)return pe}return-1}v.prototype.includes=function(k,O,q){return this.indexOf(k,O,q)!==-1},v.prototype.indexOf=function(k,O,q){return te(this,k,O,q,!0)},v.prototype.lastIndexOf=function(k,O,q){return te(this,k,O,q,!1)};function F(T,k,O,q){O=Number(O)||0;let H=T.length-O;q?(q=Number(q),q>H&&(q=H)):q=H;let W=k.length;q>W/2&&(q=W/2);let se;for(se=0;se<q;++se){let st=parseInt(k.substr(se*2,2),16);if(Ae(st))return se;T[O+se]=st}return se}function V(T,k,O,q){return xe(oe(k,T.length-O),T,O,q)}function w(T,k,O,q){return xe(le(k),T,O,q)}function n(T,k,O,q){return xe(ge(k),T,O,q)}function s(T,k,O,q){return xe(ot(k,T.length-O),T,O,q)}v.prototype.write=function(k,O,q,H){if(O===void 0)H="utf8",q=this.length,O=0;else if(q===void 0&&typeof O=="string")H=O,q=this.length,O=0;else if(isFinite(O))O=O>>>0,isFinite(q)?(q=q>>>0,H===void 0&&(H="utf8")):(H=q,q=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let W=this.length-O;if((q===void 0||q>W)&&(q=W),k.length>0&&(q<0||O<0)||O>this.length)throw new RangeError("Attempt to write outside buffer bounds");H||(H="utf8");let se=!1;for(;;)switch(H){case"hex":return F(this,k,O,q);case"utf8":case"utf-8":return V(this,k,O,q);case"ascii":case"latin1":case"binary":return w(this,k,O,q);case"base64":return n(this,k,O,q);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s(this,k,O,q);default:if(se)throw new TypeError("Unknown encoding: "+H);H=(""+H).toLowerCase(),se=!0}},v.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function f(T,k,O){return k===0&&O===T.length?e.fromByteArray(T):e.fromByteArray(T.slice(k,O))}function u(T,k,O){O=Math.min(T.length,O);let q=[],H=k;for(;H<O;){let W=T[H],se=null,st=W>239?4:W>223?3:W>191?2:1;if(H+st<=O){let ue,pe,ve,be;switch(st){case 1:W<128&&(se=W);break;case 2:ue=T[H+1],(ue&192)===128&&(be=(W&31)<<6|ue&63,be>127&&(se=be));break;case 3:ue=T[H+1],pe=T[H+2],(ue&192)===128&&(pe&192)===128&&(be=(W&15)<<12|(ue&63)<<6|pe&63,be>2047&&(be<55296||be>57343)&&(se=be));break;case 4:ue=T[H+1],pe=T[H+2],ve=T[H+3],(ue&192)===128&&(pe&192)===128&&(ve&192)===128&&(be=(W&15)<<18|(ue&63)<<12|(pe&63)<<6|ve&63,be>65535&&be<1114112&&(se=be))}}se===null?(se=65533,st=1):se>65535&&(se-=65536,q.push(se>>>10&1023|55296),se=56320|se&1023),q.push(se),H+=st}return m(q)}var l=4096;function m(T){let k=T.length;if(k<=l)return String.fromCharCode.apply(String,T);let O="",q=0;for(;q<k;)O+=String.fromCharCode.apply(String,T.slice(q,q+=l));return O}function y(T,k,O){let q="";O=Math.min(T.length,O);for(let H=k;H<O;++H)q+=String.fromCharCode(T[H]&127);return q}function d(T,k,O){let q="";O=Math.min(T.length,O);for(let H=k;H<O;++H)q+=String.fromCharCode(T[H]);return q}function a(T,k,O){let q=T.length;(!k||k<0)&&(k=0),(!O||O<0||O>q)&&(O=q);let H="";for(let W=k;W<O;++W)H+=Ge[T[W]];return H}function p(T,k,O){let q=T.slice(k,O),H="";for(let W=0;W<q.length-1;W+=2)H+=String.fromCharCode(q[W]+q[W+1]*256);return H}v.prototype.slice=function(k,O){let q=this.length;k=~~k,O=O===void 0?q:~~O,k<0?(k+=q,k<0&&(k=0)):k>q&&(k=q),O<0?(O+=q,O<0&&(O=0)):O>q&&(O=q),O<k&&(O=k);let H=this.subarray(k,O);return Object.setPrototypeOf(H,v.prototype),H};function R(T,k,O){if(T%1!==0||T<0)throw new RangeError("offset is not uint");if(T+k>O)throw new RangeError("Trying to access beyond buffer length")}v.prototype.readUintLE=v.prototype.readUIntLE=function(k,O,q){k=k>>>0,O=O>>>0,q||R(k,O,this.length);let H=this[k],W=1,se=0;for(;++se<O&&(W*=256);)H+=this[k+se]*W;return H},v.prototype.readUintBE=v.prototype.readUIntBE=function(k,O,q){k=k>>>0,O=O>>>0,q||R(k,O,this.length);let H=this[k+--O],W=1;for(;O>0&&(W*=256);)H+=this[k+--O]*W;return H},v.prototype.readUint8=v.prototype.readUInt8=function(k,O){return k=k>>>0,O||R(k,1,this.length),this[k]},v.prototype.readUint16LE=v.prototype.readUInt16LE=function(k,O){return k=k>>>0,O||R(k,2,this.length),this[k]|this[k+1]<<8},v.prototype.readUint16BE=v.prototype.readUInt16BE=function(k,O){return k=k>>>0,O||R(k,2,this.length),this[k]<<8|this[k+1]},v.prototype.readUint32LE=v.prototype.readUInt32LE=function(k,O){return k=k>>>0,O||R(k,4,this.length),(this[k]|this[k+1]<<8|this[k+2]<<16)+this[k+3]*16777216},v.prototype.readUint32BE=v.prototype.readUInt32BE=function(k,O){return k=k>>>0,O||R(k,4,this.length),this[k]*16777216+(this[k+1]<<16|this[k+2]<<8|this[k+3])},v.prototype.readBigUInt64LE=lt(function(k){k=k>>>0,J(k,"offset");let O=this[k],q=this[k+7];(O===void 0||q===void 0)&&X(k,this.length-8);let H=O+this[++k]*2**8+this[++k]*2**16+this[++k]*2**24,W=this[++k]+this[++k]*2**8+this[++k]*2**16+q*2**24;return BigInt(H)+(BigInt(W)<<BigInt(32))}),v.prototype.readBigUInt64BE=lt(function(k){k=k>>>0,J(k,"offset");let O=this[k],q=this[k+7];(O===void 0||q===void 0)&&X(k,this.length-8);let H=O*2**24+this[++k]*2**16+this[++k]*2**8+this[++k],W=this[++k]*2**24+this[++k]*2**16+this[++k]*2**8+q;return(BigInt(H)<<BigInt(32))+BigInt(W)}),v.prototype.readIntLE=function(k,O,q){k=k>>>0,O=O>>>0,q||R(k,O,this.length);let H=this[k],W=1,se=0;for(;++se<O&&(W*=256);)H+=this[k+se]*W;return W*=128,H>=W&&(H-=Math.pow(2,8*O)),H},v.prototype.readIntBE=function(k,O,q){k=k>>>0,O=O>>>0,q||R(k,O,this.length);let H=O,W=1,se=this[k+--H];for(;H>0&&(W*=256);)se+=this[k+--H]*W;return W*=128,se>=W&&(se-=Math.pow(2,8*O)),se},v.prototype.readInt8=function(k,O){return k=k>>>0,O||R(k,1,this.length),this[k]&128?(255-this[k]+1)*-1:this[k]},v.prototype.readInt16LE=function(k,O){k=k>>>0,O||R(k,2,this.length);let q=this[k]|this[k+1]<<8;return q&32768?q|4294901760:q},v.prototype.readInt16BE=function(k,O){k=k>>>0,O||R(k,2,this.length);let q=this[k+1]|this[k]<<8;return q&32768?q|4294901760:q},v.prototype.readInt32LE=function(k,O){return k=k>>>0,O||R(k,4,this.length),this[k]|this[k+1]<<8|this[k+2]<<16|this[k+3]<<24},v.prototype.readInt32BE=function(k,O){return k=k>>>0,O||R(k,4,this.length),this[k]<<24|this[k+1]<<16|this[k+2]<<8|this[k+3]},v.prototype.readBigInt64LE=lt(function(k){k=k>>>0,J(k,"offset");let O=this[k],q=this[k+7];(O===void 0||q===void 0)&&X(k,this.length-8);let H=this[k+4]+this[k+5]*2**8+this[k+6]*2**16+(q<<24);return(BigInt(H)<<BigInt(32))+BigInt(O+this[++k]*2**8+this[++k]*2**16+this[++k]*2**24)}),v.prototype.readBigInt64BE=lt(function(k){k=k>>>0,J(k,"offset");let O=this[k],q=this[k+7];(O===void 0||q===void 0)&&X(k,this.length-8);let H=(O<<24)+this[++k]*2**16+this[++k]*2**8+this[++k];return(BigInt(H)<<BigInt(32))+BigInt(this[++k]*2**24+this[++k]*2**16+this[++k]*2**8+q)}),v.prototype.readFloatLE=function(k,O){return k=k>>>0,O||R(k,4,this.length),r.read(this,k,!0,23,4)},v.prototype.readFloatBE=function(k,O){return k=k>>>0,O||R(k,4,this.length),r.read(this,k,!1,23,4)},v.prototype.readDoubleLE=function(k,O){return k=k>>>0,O||R(k,8,this.length),r.read(this,k,!0,52,8)},v.prototype.readDoubleBE=function(k,O){return k=k>>>0,O||R(k,8,this.length),r.read(this,k,!1,52,8)};function S(T,k,O,q,H,W){if(!v.isBuffer(T))throw new TypeError('"buffer" argument must be a Buffer instance');if(k>H||k<W)throw new RangeError('"value" argument is out of bounds');if(O+q>T.length)throw new RangeError("Index out of range")}v.prototype.writeUintLE=v.prototype.writeUIntLE=function(k,O,q,H){if(k=+k,O=O>>>0,q=q>>>0,!H){let st=Math.pow(2,8*q)-1;S(this,k,O,q,st,0)}let W=1,se=0;for(this[O]=k&255;++se<q&&(W*=256);)this[O+se]=k/W&255;return O+q},v.prototype.writeUintBE=v.prototype.writeUIntBE=function(k,O,q,H){if(k=+k,O=O>>>0,q=q>>>0,!H){let st=Math.pow(2,8*q)-1;S(this,k,O,q,st,0)}let W=q-1,se=1;for(this[O+W]=k&255;--W>=0&&(se*=256);)this[O+W]=k/se&255;return O+q},v.prototype.writeUint8=v.prototype.writeUInt8=function(k,O,q){return k=+k,O=O>>>0,q||S(this,k,O,1,255,0),this[O]=k&255,O+1},v.prototype.writeUint16LE=v.prototype.writeUInt16LE=function(k,O,q){return k=+k,O=O>>>0,q||S(this,k,O,2,65535,0),this[O]=k&255,this[O+1]=k>>>8,O+2},v.prototype.writeUint16BE=v.prototype.writeUInt16BE=function(k,O,q){return k=+k,O=O>>>0,q||S(this,k,O,2,65535,0),this[O]=k>>>8,this[O+1]=k&255,O+2},v.prototype.writeUint32LE=v.prototype.writeUInt32LE=function(k,O,q){return k=+k,O=O>>>0,q||S(this,k,O,4,4294967295,0),this[O+3]=k>>>24,this[O+2]=k>>>16,this[O+1]=k>>>8,this[O]=k&255,O+4},v.prototype.writeUint32BE=v.prototype.writeUInt32BE=function(k,O,q){return k=+k,O=O>>>0,q||S(this,k,O,4,4294967295,0),this[O]=k>>>24,this[O+1]=k>>>16,this[O+2]=k>>>8,this[O+3]=k&255,O+4};function B(T,k,O,q,H){j(k,q,H,T,O,7);let W=Number(k&BigInt(4294967295));T[O++]=W,W=W>>8,T[O++]=W,W=W>>8,T[O++]=W,W=W>>8,T[O++]=W;let se=Number(k>>BigInt(32)&BigInt(4294967295));return T[O++]=se,se=se>>8,T[O++]=se,se=se>>8,T[O++]=se,se=se>>8,T[O++]=se,O}function U(T,k,O,q,H){j(k,q,H,T,O,7);let W=Number(k&BigInt(4294967295));T[O+7]=W,W=W>>8,T[O+6]=W,W=W>>8,T[O+5]=W,W=W>>8,T[O+4]=W;let se=Number(k>>BigInt(32)&BigInt(4294967295));return T[O+3]=se,se=se>>8,T[O+2]=se,se=se>>8,T[O+1]=se,se=se>>8,T[O]=se,O+8}v.prototype.writeBigUInt64LE=lt(function(k,O=0){return B(this,k,O,BigInt(0),BigInt("0xffffffffffffffff"))}),v.prototype.writeBigUInt64BE=lt(function(k,O=0){return U(this,k,O,BigInt(0),BigInt("0xffffffffffffffff"))}),v.prototype.writeIntLE=function(k,O,q,H){if(k=+k,O=O>>>0,!H){let ue=Math.pow(2,8*q-1);S(this,k,O,q,ue-1,-ue)}let W=0,se=1,st=0;for(this[O]=k&255;++W<q&&(se*=256);)k<0&&st===0&&this[O+W-1]!==0&&(st=1),this[O+W]=(k/se>>0)-st&255;return O+q},v.prototype.writeIntBE=function(k,O,q,H){if(k=+k,O=O>>>0,!H){let ue=Math.pow(2,8*q-1);S(this,k,O,q,ue-1,-ue)}let W=q-1,se=1,st=0;for(this[O+W]=k&255;--W>=0&&(se*=256);)k<0&&st===0&&this[O+W+1]!==0&&(st=1),this[O+W]=(k/se>>0)-st&255;return O+q},v.prototype.writeInt8=function(k,O,q){return k=+k,O=O>>>0,q||S(this,k,O,1,127,-128),k<0&&(k=255+k+1),this[O]=k&255,O+1},v.prototype.writeInt16LE=function(k,O,q){return k=+k,O=O>>>0,q||S(this,k,O,2,32767,-32768),this[O]=k&255,this[O+1]=k>>>8,O+2},v.prototype.writeInt16BE=function(k,O,q){return k=+k,O=O>>>0,q||S(this,k,O,2,32767,-32768),this[O]=k>>>8,this[O+1]=k&255,O+2},v.prototype.writeInt32LE=function(k,O,q){return k=+k,O=O>>>0,q||S(this,k,O,4,2147483647,-2147483648),this[O]=k&255,this[O+1]=k>>>8,this[O+2]=k>>>16,this[O+3]=k>>>24,O+4},v.prototype.writeInt32BE=function(k,O,q){return k=+k,O=O>>>0,q||S(this,k,O,4,2147483647,-2147483648),k<0&&(k=4294967295+k+1),this[O]=k>>>24,this[O+1]=k>>>16,this[O+2]=k>>>8,this[O+3]=k&255,O+4},v.prototype.writeBigInt64LE=lt(function(k,O=0){return B(this,k,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),v.prototype.writeBigInt64BE=lt(function(k,O=0){return U(this,k,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function D(T,k,O,q,H,W){if(O+q>T.length)throw new RangeError("Index out of range");if(O<0)throw new RangeError("Index out of range")}function re(T,k,O,q,H){return k=+k,O=O>>>0,H||D(T,k,O,4,34028234663852886e22,-34028234663852886e22),r.write(T,k,O,q,23,4),O+4}v.prototype.writeFloatLE=function(k,O,q){return re(this,k,O,!0,q)},v.prototype.writeFloatBE=function(k,O,q){return re(this,k,O,!1,q)};function Q(T,k,O,q,H){return k=+k,O=O>>>0,H||D(T,k,O,8,17976931348623157e292,-17976931348623157e292),r.write(T,k,O,q,52,8),O+8}v.prototype.writeDoubleLE=function(k,O,q){return Q(this,k,O,!0,q)},v.prototype.writeDoubleBE=function(k,O,q){return Q(this,k,O,!1,q)},v.prototype.copy=function(k,O,q,H){if(!v.isBuffer(k))throw new TypeError("argument should be a Buffer");if(q||(q=0),!H&&H!==0&&(H=this.length),O>=k.length&&(O=k.length),O||(O=0),H>0&&H<q&&(H=q),H===q||k.length===0||this.length===0)return 0;if(O<0)throw new RangeError("targetStart out of bounds");if(q<0||q>=this.length)throw new RangeError("Index out of range");if(H<0)throw new RangeError("sourceEnd out of bounds");H>this.length&&(H=this.length),k.length-O<H-q&&(H=k.length-O+q);let W=H-q;return this===k&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(O,q,H):Uint8Array.prototype.set.call(k,this.subarray(q,H),O),W},v.prototype.fill=function(k,O,q,H){if(typeof k=="string"){if(typeof O=="string"?(H=O,O=0,q=this.length):typeof q=="string"&&(H=q,q=this.length),H!==void 0&&typeof H!="string")throw new TypeError("encoding must be a string");if(typeof H=="string"&&!v.isEncoding(H))throw new TypeError("Unknown encoding: "+H);if(k.length===1){let se=k.charCodeAt(0);(H==="utf8"&&se<128||H==="latin1")&&(k=se)}}else typeof k=="number"?k=k&255:typeof k=="boolean"&&(k=Number(k));if(O<0||this.length<O||this.length<q)throw new RangeError("Out of range index");if(q<=O)return this;O=O>>>0,q=q===void 0?this.length:q>>>0,k||(k=0);let W;if(typeof k=="number")for(W=O;W<q;++W)this[W]=k;else{let se=v.isBuffer(k)?k:v.from(k,H),st=se.length;if(st===0)throw new TypeError('The value "'+k+'" is invalid for argument "value"');for(W=0;W<q-O;++W)this[W+O]=se[W%st]}return this};var Z={};function K(T,k,O){Z[T]=class extends O{constructor(){super(),Object.defineProperty(this,"message",{value:k.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${T}]`,this.stack,delete this.name}get code(){return T}set code(H){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:H,writable:!0})}toString(){return`${this.name} [${T}]: ${this.message}`}}}K("ERR_BUFFER_OUT_OF_BOUNDS",function(T){return T?`${T} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),K("ERR_INVALID_ARG_TYPE",function(T,k){return`The "${T}" argument must be of type number. Received type ${typeof k}`},TypeError),K("ERR_OUT_OF_RANGE",function(T,k,O){let q=`The value of "${T}" is out of range.`,H=O;return Number.isInteger(O)&&Math.abs(O)>2**32?H=ce(String(O)):typeof O=="bigint"&&(H=String(O),(O>BigInt(2)**BigInt(32)||O<-(BigInt(2)**BigInt(32)))&&(H=ce(H)),H+="n"),q+=` It must be ${k}. Received ${H}`,q},RangeError);function ce(T){let k="",O=T.length,q=T[0]==="-"?1:0;for(;O>=q+4;O-=3)k=`_${T.slice(O-3,O)}${k}`;return`${T.slice(0,O)}${k}`}function ee(T,k,O){J(k,"offset"),(T[k]===void 0||T[k+O]===void 0)&&X(k,T.length-(O+1))}function j(T,k,O,q,H,W){if(T>O||T<k){let se=typeof k=="bigint"?"n":"",st;throw W>3?k===0||k===BigInt(0)?st=`>= 0${se} and < 2${se} ** ${(W+1)*8}${se}`:st=`>= -(2${se} ** ${(W+1)*8-1}${se}) and < 2 ** ${(W+1)*8-1}${se}`:st=`>= ${k}${se} and <= ${O}${se}`,new Z.ERR_OUT_OF_RANGE("value",st,T)}ee(q,H,W)}function J(T,k){if(typeof T!="number")throw new Z.ERR_INVALID_ARG_TYPE(k,"number",T)}function X(T,k,O){throw Math.floor(T)!==T?(J(T,O),new Z.ERR_OUT_OF_RANGE(O||"offset","an integer",T)):k<0?new Z.ERR_BUFFER_OUT_OF_BOUNDS:new Z.ERR_OUT_OF_RANGE(O||"offset",`>= ${O?1:0} and <= ${k}`,T)}var he=/[^+/0-9A-Za-z-_]/g;function Ie(T){if(T=T.split("=")[0],T=T.trim().replace(he,""),T.length<2)return"";for(;T.length%4!==0;)T=T+"=";return T}function oe(T,k){k=k||1/0;let O,q=T.length,H=null,W=[];for(let se=0;se<q;++se){if(O=T.charCodeAt(se),O>55295&&O<57344){if(!H){if(O>56319){(k-=3)>-1&&W.push(239,191,189);continue}else if(se+1===q){(k-=3)>-1&&W.push(239,191,189);continue}H=O;continue}if(O<56320){(k-=3)>-1&&W.push(239,191,189),H=O;continue}O=(H-55296<<10|O-56320)+65536}else H&&(k-=3)>-1&&W.push(239,191,189);if(H=null,O<128){if((k-=1)<0)break;W.push(O)}else if(O<2048){if((k-=2)<0)break;W.push(O>>6|192,O&63|128)}else if(O<65536){if((k-=3)<0)break;W.push(O>>12|224,O>>6&63|128,O&63|128)}else if(O<1114112){if((k-=4)<0)break;W.push(O>>18|240,O>>12&63|128,O>>6&63|128,O&63|128)}else throw new Error("Invalid code point")}return W}function le(T){let k=[];for(let O=0;O<T.length;++O)k.push(T.charCodeAt(O)&255);return k}function ot(T,k){let O,q,H,W=[];for(let se=0;se<T.length&&!((k-=2)<0);++se)O=T.charCodeAt(se),q=O>>8,H=O%256,W.push(H),W.push(q);return W}function ge(T){return e.toByteArray(Ie(T))}function xe(T,k,O,q){let H;for(H=0;H<q&&!(H+O>=k.length||H>=T.length);++H)k[H+O]=T[H];return H}function ut(T,k){return T instanceof k||T!=null&&T.constructor!=null&&T.constructor.name!=null&&T.constructor.name===k.name}function Ae(T){return T!==T}var Ge=function(){let T="0123456789abcdef",k=new Array(256);for(let O=0;O<16;++O){let q=O*16;for(let H=0;H<16;++H)k[q+H]=T[O]+T[H]}return k}();function lt(T){return typeof BigInt>"u"?z:T}function z(){throw new Error("BigInt not supported")}}}),O5e={"@@functional/placeholder":!0};function Vi(t){return t===O5e}function $a(t){return function e(r){return arguments.length===0||Vi(r)?e:t.apply(this,arguments)}}function $n(t){return function e(r,o){switch(arguments.length){case 0:return e;case 1:return Vi(r)?e:$a(function(i){return t(r,i)});default:return Vi(r)&&Vi(o)?e:Vi(r)?$a(function(i){return t(i,o)}):Vi(o)?$a(function(i){return t(r,i)}):t(r,o)}}}function mw(t,e){switch(t){case 0:return function(){return e.apply(this,arguments)};case 1:return function(r){return e.apply(this,arguments)};case 2:return function(r,o){return e.apply(this,arguments)};case 3:return function(r,o,i){return e.apply(this,arguments)};case 4:return function(r,o,i,h){return e.apply(this,arguments)};case 5:return function(r,o,i,h,c){return e.apply(this,arguments)};case 6:return function(r,o,i,h,c,v){return e.apply(this,arguments)};case 7:return function(r,o,i,h,c,v,b){return e.apply(this,arguments)};case 8:return function(r,o,i,h,c,v,b,g){return e.apply(this,arguments)};case 9:return function(r,o,i,h,c,v,b,g,_){return e.apply(this,arguments)};case 10:return function(r,o,i,h,c,v,b,g,_,M){return e.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}function KQ(t,e,r){return function(){for(var o=[],i=0,h=t,c=0,v=!1;c<e.length||i<arguments.length;){var b;c<e.length&&(!Vi(e[c])||i>=arguments.length)?b=e[c]:(b=arguments[i],i+=1),o[c]=b,Vi(b)?v=!0:h-=1,c+=1}return!v&&h<=0?r.apply(this,o):mw(Math.max(0,h),KQ(t,o,r))}}var N5e=$n(function(t,e){return t===1?$a(e):mw(t,KQ(t,[],e))}),WQ=N5e;function uI(t){return function e(r,o,i){switch(arguments.length){case 0:return e;case 1:return Vi(r)?e:$n(function(h,c){return t(r,h,c)});case 2:return Vi(r)&&Vi(o)?e:Vi(r)?$n(function(h,c){return t(h,o,c)}):Vi(o)?$n(function(h,c){return t(r,h,c)}):$a(function(h){return t(r,o,h)});default:return Vi(r)&&Vi(o)&&Vi(i)?e:Vi(r)&&Vi(o)?$n(function(h,c){return t(h,c,i)}):Vi(r)&&Vi(i)?$n(function(h,c){return t(h,o,c)}):Vi(o)&&Vi(i)?$n(function(h,c){return t(r,h,c)}):Vi(r)?$a(function(h){return t(h,o,i)}):Vi(o)?$a(function(h){return t(r,h,i)}):Vi(i)?$a(function(h){return t(r,o,h)}):t(r,o,i)}}}var hI=Array.isArray||function(t){return t!=null&&t.length>=0&&Object.prototype.toString.call(t)==="[object Array]"};function C5e(t){return t!=null&&typeof t["@@transducer/step"]=="function"}function lI(t,e,r){return function(){if(arguments.length===0)return r();var o=arguments[arguments.length-1];if(!hI(o)){for(var i=0;i<t.length;){if(typeof o[t[i]]=="function")return o[t[i]].apply(o,Array.prototype.slice.call(arguments,0,-1));i+=1}if(C5e(o)){var h=e.apply(null,Array.prototype.slice.call(arguments,0,-1));return h(o)}}return r.apply(this,arguments)}}function L5e(t){return t&&t["@@transducer/reduced"]?t:{"@@transducer/value":t,"@@transducer/reduced":!0}}var Vg={init:function(){return this.xf["@@transducer/init"]()},result:function(t){return this.xf["@@transducer/result"](t)}};function bQ(t){for(var e=[],r;!(r=t.next()).done;)e.push(r.value);return e}function yQ(t,e,r){for(var o=0,i=r.length;o<i;){if(t(e,r[o]))return!0;o+=1}return!1}function D5e(t){var e=String(t).match(/^function (\w*)/);return e==null?"":e[1]}function K8(t,e){return Object.prototype.hasOwnProperty.call(e,t)}function $5e(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}var ET=typeof Object.is=="function"?Object.is:$5e,wQ=Object.prototype.toString,q5e=function(){return wQ.call(arguments)==="[object Arguments]"?function(t){return wQ.call(t)==="[object Arguments]"}:function(t){return K8("callee",t)}}(),U5e=q5e,F5e=!{toString:null}.propertyIsEnumerable("toString"),_Q=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],MQ=function(){"use strict";return arguments.propertyIsEnumerable("length")}(),j5e=function(t,e){for(var r=0;r<t.length;){if(t[r]===e)return!0;r+=1}return!1},z5e=$a(typeof Object.keys=="function"&&!MQ?function(t){return Object(t)!==t?[]:Object.keys(t)}:function(t){if(Object(t)!==t)return[];var e,r,o=[],i=MQ&&U5e(t);for(e in t)K8(e,t)&&(!i||e!=="length")&&(o[o.length]=e);if(F5e)for(r=_Q.length-1;r>=0;)e=_Q[r],K8(e,t)&&!j5e(o,e)&&(o[o.length]=e),r-=1;return o}),O1=z5e,Z5e=$a(function(t){return t===null?"Null":t===void 0?"Undefined":Object.prototype.toString.call(t).slice(8,-1)}),xQ=Z5e;function SQ(t,e,r,o){var i=bQ(t),h=bQ(e);function c(v,b){return cI(v,b,r.slice(),o.slice())}return!yQ(function(v,b){return!yQ(c,b,v)},h,i)}function cI(t,e,r,o){if(ET(t,e))return!0;var i=xQ(t);if(i!==xQ(e))return!1;if(typeof t["fantasy-land/equals"]=="function"||typeof e["fantasy-land/equals"]=="function")return typeof t["fantasy-land/equals"]=="function"&&t["fantasy-land/equals"](e)&&typeof e["fantasy-land/equals"]=="function"&&e["fantasy-land/equals"](t);if(typeof t.equals=="function"||typeof e.equals=="function")return typeof t.equals=="function"&&t.equals(e)&&typeof e.equals=="function"&&e.equals(t);switch(i){case"Arguments":case"Array":case"Object":if(typeof t.constructor=="function"&&D5e(t.constructor)==="Promise")return t===e;break;case"Boolean":case"Number":case"String":if(!(typeof t==typeof e&&ET(t.valueOf(),e.valueOf())))return!1;break;case"Date":if(!ET(t.valueOf(),e.valueOf()))return!1;break;case"Error":return t.name===e.name&&t.message===e.message;case"RegExp":if(!(t.source===e.source&&t.global===e.global&&t.ignoreCase===e.ignoreCase&&t.multiline===e.multiline&&t.sticky===e.sticky&&t.unicode===e.unicode))return!1;break}for(var h=r.length-1;h>=0;){if(r[h]===t)return o[h]===e;h-=1}switch(i){case"Map":return t.size!==e.size?!1:SQ(t.entries(),e.entries(),r.concat([t]),o.concat([e]));case"Set":return t.size!==e.size?!1:SQ(t.values(),e.values(),r.concat([t]),o.concat([e]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var c=O1(t);if(c.length!==O1(e).length)return!1;var v=r.concat([t]),b=o.concat([e]);for(h=c.length-1;h>=0;){var g=c[h];if(!(K8(g,e)&&cI(e[g],t[g],v,b)))return!1;h-=1}return!0}var H5e=$n(function(t,e){return cI(t,e,[],[])}),VQ=H5e;function K5e(t,e,r){var o,i;if(typeof t.indexOf=="function")switch(typeof e){case"number":if(e===0){for(o=1/e;r<t.length;){if(i=t[r],i===0&&1/i===o)return r;r+=1}return-1}else if(e!==e){for(;r<t.length;){if(i=t[r],typeof i=="number"&&i!==i)return r;r+=1}return-1}return t.indexOf(e,r);case"string":case"boolean":case"function":case"undefined":return t.indexOf(e,r);case"object":if(e===null)return t.indexOf(e,r)}for(;r<t.length;){if(VQ(t[r],e))return r;r+=1}return-1}function W5e(t,e){return K5e(e,t,0)>=0}function Kg(t,e){for(var r=0,o=e.length,i=Array(o);r<o;)i[r]=t(e[r]),r+=1;return i}function AT(t){var e=t.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0");return'"'+e.replace(/"/g,'\\"')+'"'}var Cg=function(t){return(t<10?"0":"")+t},V5e=typeof Date.prototype.toISOString=="function"?function(t){return t.toISOString()}:function(t){return t.getUTCFullYear()+"-"+Cg(t.getUTCMonth()+1)+"-"+Cg(t.getUTCDate())+"T"+Cg(t.getUTCHours())+":"+Cg(t.getUTCMinutes())+":"+Cg(t.getUTCSeconds())+"."+(t.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"},G5e=V5e;function Y5e(t){return function(){return!t.apply(this,arguments)}}function GQ(t,e,r){for(var o=0,i=r.length;o<i;)e=t(e,r[o]),o+=1;return e}function J5e(t,e){for(var r=0,o=e.length,i=[];r<o;)t(e[r])&&(i[i.length]=e[r]),r+=1;return i}function X5e(t){return Object.prototype.toString.call(t)==="[object Object]"}var Q5e=function(){function t(e,r){this.xf=r,this.f=e}return t.prototype["@@transducer/init"]=Vg.init,t.prototype["@@transducer/result"]=Vg.result,t.prototype["@@transducer/step"]=function(e,r){return this.f(r)?this.xf["@@transducer/step"](e,r):e},t}();function e7e(t){return function(e){return new Q5e(t,e)}}var t7e=$n(lI(["fantasy-land/filter","filter"],e7e,function(t,e){return X5e(e)?GQ(function(r,o){return t(e[o])&&(r[o]=e[o]),r},{},O1(e)):J5e(t,e)})),r7e=t7e,i7e=$n(function(t,e){return r7e(Y5e(t),e)}),n7e=i7e;function YQ(t,e){var r=function(h){var c=e.concat([t]);return W5e(h,c)?"<Circular>":YQ(h,c)},o=function(h,c){return Kg(function(v){return AT(v)+": "+r(h[v])},c.slice().sort())};switch(Object.prototype.toString.call(t)){case"[object Arguments]":return"(function() { return arguments; }("+Kg(r,t).join(", ")+"))";case"[object Array]":return"["+Kg(r,t).concat(o(t,n7e(function(h){return/^\d+$/.test(h)},O1(t)))).join(", ")+"]";case"[object Boolean]":return typeof t=="object"?"new Boolean("+r(t.valueOf())+")":t.toString();case"[object Date]":return"new Date("+(isNaN(t.valueOf())?r(NaN):AT(G5e(t)))+")";case"[object Map]":return"new Map("+r(Array.from(t))+")";case"[object Null]":return"null";case"[object Number]":return typeof t=="object"?"new Number("+r(t.valueOf())+")":1/t===-1/0?"-0":t.toString(10);case"[object Set]":return"new Set("+r(Array.from(t).sort())+")";case"[object String]":return typeof t=="object"?"new String("+r(t.valueOf())+")":AT(t);case"[object Undefined]":return"undefined";default:if(typeof t.toString=="function"){var i=t.toString();if(i!=="[object Object]")return i}return"{"+o(t,O1(t)).join(", ")+"}"}}var a7e=$a(function(t){return YQ(t,[])}),EQ=a7e,o7e=$n(function(t,e){if(t===e)return e;function r(v,b){if(v>b!=b>v)return b>v?b:v}var o=r(t,e);if(o!==void 0)return o;var i=r(typeof t,typeof e);if(i!==void 0)return i===typeof t?t:e;var h=EQ(t),c=r(h,EQ(e));return c!==void 0&&c===h?t:e}),s7e=o7e,f7e=function(){function t(e,r){this.xf=r,this.f=e}return t.prototype["@@transducer/init"]=Vg.init,t.prototype["@@transducer/result"]=Vg.result,t.prototype["@@transducer/step"]=function(e,r){return this.xf["@@transducer/step"](e,this.f(r))},t}(),u7e=function(t){return function(e){return new f7e(t,e)}},h7e=u7e,l7e=$n(lI(["fantasy-land/map","map"],h7e,function(t,e){switch(Object.prototype.toString.call(e)){case"[object Function]":return WQ(e.length,function(){return t.call(this,e.apply(this,arguments))});case"[object Object]":return GQ(function(r,o){return r[o]=t(e[o]),r},{},O1(e));default:return Kg(t,e)}})),c7e=l7e,JQ=Number.isInteger||function(t){return t<<0===t};function XQ(t){return Object.prototype.toString.call(t)==="[object String]"}function QQ(t,e){var r=t<0?e.length+t:t;return XQ(e)?e.charAt(r):e[r]}var d7e=$n(function(t,e){if(e!=null)return JQ(t)?QQ(t,e):e[t]}),gw=d7e,p7e=$n(function(t,e){return c7e(gw(t),e)}),v7e=p7e,m7e=$a(function(t){return hI(t)?!0:!t||typeof t!="object"||XQ(t)?!1:t.length===0?!0:t.length>0?t.hasOwnProperty(0)&&t.hasOwnProperty(t.length-1):!1}),g7e=m7e,AQ=typeof Symbol<"u"?Symbol.iterator:"@@iterator";function b7e(t,e,r){return function(o,i,h){if(g7e(h))return t(o,i,h);if(h==null)return i;if(typeof h["fantasy-land/reduce"]=="function")return e(o,i,h,"fantasy-land/reduce");if(h[AQ]!=null)return r(o,i,h[AQ]());if(typeof h.next=="function")return r(o,i,h);if(typeof h.reduce=="function")return e(o,i,h,"reduce");throw new TypeError("reduce: list must be array or iterable")}}function y7e(t,e,r){for(var o=0,i=r.length;o<i;){if(e=t["@@transducer/step"](e,r[o]),e&&e["@@transducer/reduced"]){e=e["@@transducer/value"];break}o+=1}return t["@@transducer/result"](e)}var w7e=$n(function(t,e){return mw(t.length,function(){return t.apply(e,arguments)})}),_7e=w7e;function M7e(t,e,r){for(var o=r.next();!o.done;){if(e=t["@@transducer/step"](e,o.value),e&&e["@@transducer/reduced"]){e=e["@@transducer/value"];break}o=r.next()}return t["@@transducer/result"](e)}function x7e(t,e,r,o){return t["@@transducer/result"](r[o](_7e(t["@@transducer/step"],t),e))}var S7e=b7e(y7e,x7e,M7e),E7e=S7e,A7e=function(){function t(e){this.f=e}return t.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},t.prototype["@@transducer/result"]=function(e){return e},t.prototype["@@transducer/step"]=function(e,r){return this.f(e,r)},t}();function R7e(t){return new A7e(t)}var T7e=uI(function(t,e,r){return E7e(typeof t=="function"?R7e(t):t,e,r)}),eee=T7e;function I7e(t,e){return function(){return e.call(this,t.apply(this,arguments))}}function tee(t,e){return function(){var r=arguments.length;if(r===0)return e();var o=arguments[r-1];return hI(o)||typeof o[t]!="function"?e.apply(this,arguments):o[t].apply(o,Array.prototype.slice.call(arguments,0,r-1))}}var k7e=uI(tee("slice",function(t,e,r){return Array.prototype.slice.call(r,t,e)})),B7e=k7e,P7e=$a(tee("tail",B7e(1,1/0))),O7e=P7e;function ree(){if(arguments.length===0)throw new Error("pipe requires at least one argument");return mw(arguments[0].length,eee(I7e,arguments[0],O7e(arguments)))}var N7e=$n(function(t,e){return WQ(eee(s7e,0,v7e("length",e)),function(){var r=arguments,o=this;return t.apply(o,Kg(function(i){return i.apply(o,r)},e))})}),C7e=N7e,L7e=$n(function(t,e){return e==null||e!==e?t:e}),NT=L7e,D7e=function(){function t(e,r){this.xf=r,this.f=e,this.found=!1}return t.prototype["@@transducer/init"]=Vg.init,t.prototype["@@transducer/result"]=function(e){return this.found||(e=this.xf["@@transducer/step"](e,void 0)),this.xf["@@transducer/result"](e)},t.prototype["@@transducer/step"]=function(e,r){return this.f(r)&&(this.found=!0,e=L5e(this.xf["@@transducer/step"](e,r))),e},t}();function $7e(t){return function(e){return new D7e(t,e)}}var q7e=$n(lI(["find"],$7e,function(t,e){for(var r=0,o=e.length;r<o;){if(t(e[r]))return e[r];r+=1}})),U7e=q7e,F7e=$a(function(t){return C7e(function(){return Array.prototype.slice.call(arguments,0)},t)}),j7e=F7e;function z7e(t,e){for(var r=e,o=0;o<t.length;o+=1){if(r==null)return;var i=t[o];JQ(i)?r=QQ(i,r):r=r[i]}return r}var Z7e=$n(z7e),iee=Z7e,H7e=uI(function(t,e,r){return VQ(t,gw(e,r))}),K7e=H7e,W8=class extends Error{name="InvalidSchedulerLocation"},W7e=class extends Error{name="SchedulerTagNotFound"},V7e=class extends Error{name="TransactionNotFound"},G7e="Url",Y7e="Time-To-Live",J7e="Scheduler",CT=t=>ree(NT([]),U7e(K7e(t,"name")),NT({}),gw("value")),nee=t=>ree(e=>{if(!e)throw new V7e(t);return e},gw("tags"),NT([]));function aee({fetch:t,GRAPHQL_URL:e}){return async({query:r,variables:o})=>t(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:r,variables:o})}).then(i=>i.json())}function X7e({fetch:t,GRAPHQL_URL:e}){let r=aee({fetch:t,GRAPHQL_URL:e}),o=oee({fetch:t,GRAPHQL_URL:e}),i=`
|
|
135
135
|
query GetTransactions ($transactionIds: [ID!]!) {
|
|
136
136
|
transactions(ids: $transactionIds) {
|
|
137
137
|
edges {
|
|
@@ -186,7 +186,7 @@ nonce: bundlr`),Se.from(i))}};ie();ae();ne();var Qc=class{_publicKey;ownerLength
|
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
}`,i=_t.object({data:_t.object({transactions:_t.object({edges:_t.array(_t.object({node:_t.record(_t.any())}))})})});return h=>jr(h).chain(Li(c=>t(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:o,variables:{transactionIds:[c]}})}).then(async v=>{if(v.ok)return v.json();throw r('Error Encountered when querying gateway for transaction "%s"',c),new Error(`${v.status}: ${await v.text()}`)}).then(i.parse).then(hxe(["data","transactions","edges","0","node"])))).toPromise()}var _Se=oI(I5e(),1),cte=(t="@permaweb/aoconnect")=>{let e=(0,_Se.default)(t);return e.child=r=>cte(`${e.namespace}:${r}`),e.tap=(r,...o)=>gxe((...i)=>e(r,...o,...i)),e},dte=({url:t,path:e})=>e?e.startsWith("/")?dte({url:t,path:e.slice(1)}):(t=new URL(t),t.pathname+=e,t.toString()):t;function MSe(t){return j1(xw([]),F1((e,r)=>j1(dxe([],r.name),MI(r.value),Ds(r.name,Fh,e))(e),{}),_w(e=>e.length>1?e:e[0]))(t)}function Ns(t,e){return r=>Lee(MMe([$Q(t,"name"),SI(_I(e),$Q(e,"value"),bI)]),r)}function FQ(t){return Kee([[Wg(String),B1(t)],[Wg(Array),txe(t)],[bI,P9e]])}function Ad(t){let e;return Wg(Cs,t)?(e=new Error(xSe(t)),e.stack+=t.stack):Wg(Error,t)?e=t:XMe("message",t)?e=new Error(t.message):Wg(String,t)?e=new Error(t):e=new Error("An error occurred"),e}function xSe(t){return j1(e=>function r(o,i,h){return F1((c,v)=>j1(Kee([[B1(Tt.invalid_arguments),()=>r(v.argumentsError,422,"Invalid Arguments")],[B1(Tt.invalid_return_type),()=>r(v.returnTypeError,500,"Invalid Return")],[B1(Tt.invalid_union),()=>$Me(b=>r(b,400,"Invalid Union"),v.unionErrors)],[bI,()=>[{...v,status:i,contextCode:h}]]]),xI(c))(v.code),[],o.issues)}(e,400,""),e=>F1((r,o)=>{let{message:i,path:h,contextCode:c}=o,v=h[1]||h[0],b=c?`${c} `:"";return r.push(`${b}'${v}': ${i}.`),r},[],e),sxe(" | "))(t)}var SSe=_t.object({id:_t.string().min(1,{message:"message is required to be a message id"}),processId:_t.string().min(1,{message:"process is required to be a process id"})});function ESe(){return t=>jr(t).map(SSe.parse).map(()=>t)}var k2=_t.object({name:_t.string(),value:_t.string()}),ASe=_t.function().args(_t.object({Id:_t.string(),Target:_t.string(),Owner:_t.string(),Anchor:_t.string().optional(),Data:_t.any().default("1234"),Tags:_t.array(_t.object({name:_t.string(),value:_t.string()}))})).returns(_t.promise(_t.any())),RSe=_t.function().args(_t.object({id:_t.string().min(1,{message:"message id is required"}),processId:_t.string().min(1,{message:"process id is required"})})).returns(_t.promise(_t.any())),TSe=_t.function().args(_t.object({process:_t.string().min(1,{message:"process id is required"}),from:_t.string().optional(),to:_t.string().optional(),sort:_t.enum(["ASC","DESC"]).default("ASC"),limit:_t.number().optional()})).returns(_t.promise(_t.object({edges:_t.array(_t.object({cursor:_t.string(),node:_t.object({Output:_t.any().optional(),Messages:_t.array(_t.any()).optional(),Spawns:_t.array(_t.any()).optional(),Error:_t.any().optional()})}))}))),pte=_t.function().args(_t.object({processId:_t.string(),data:_t.any(),tags:_t.array(k2),anchor:_t.string().optional(),signer:_t.any()})).returns(_t.promise(_t.object({messageId:_t.string()}).passthrough())),ISe=_t.function().args(_t.object({data:_t.any(),tags:_t.array(k2),signer:_t.any()})).returns(_t.promise(_t.object({processId:_t.string()}).passthrough())),kSe=_t.function().args(_t.object({process:_t.string(),message:_t.string(),baseLayer:_t.boolean().optional(),exclude:_t.array(_t.string()).optional()})).returns(_t.promise(_t.object({assignmentId:_t.string()}).passthrough())),vte=pte,xut=_t.function().args(_t.object({suUrl:_t.string().url(),processId:_t.string()})).returns(_t.promise(_t.object({tags:_t.array(k2)}).passthrough())),Sut=_t.function().args(_t.string()).returns(_t.promise(_t.object({url:_t.string()}))),BSe=_t.function().args(_t.string()).returns(_t.promise(_t.boolean())),PSe=_t.function().args(_t.string()).returns(_t.promise(_t.object({tags:_t.array(k2)}).passthrough())),Sw=_t.function().args(_t.object({data:_t.any(),tags:_t.array(k2),target:_t.string().optional(),anchor:_t.string().optional()})).returns(_t.promise(_t.object({id:_t.string(),raw:_t.any()})));function OSe({loadResult:t}){return t=Li(RSe.implement(t)),e=>jr({id:e.id,processId:e.processId}).chain(t)}function NSe(t){let e=ESe(t),r=OSe(t);return({message:o,process:i})=>jr({id:o,processId:i}).chain(e).chain(r).map(t.logger.tap('readResult result for message "%s": %O',o)).map(h=>h).bimap(Ad,Ed).toPromise()}var CSe=_t.array(_t.object({name:_t.string(),value:_t.string()}));function LSe(){return t=>jr(t.tags).map(xw([])).map(Ns("Data-Protocol","ao")).map(Ns("Variant")).map(Ns("Type")).map(Ns("SDK")).map(xI(Fh,[{name:"Data-Protocol",value:"ao"},{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Message"},{name:"SDK",value:"aoconnect"}])).map(CSe.parse).map(Ds("tags",Fh,t))}function DSe({logger:t}){return e=>jr(e).chain(SI(_I(e.data),()=>_d(e),()=>_d(Math.random().toString().slice(-4)).map(Ds("data",Fh,e)).map(r=>j1(Sd("tags"),Ns("Content-Type"),MI({name:"Content-Type",value:"text/plain"}),Ds("tags",Fh,r))(r)).map(t.tap('added pseudo-random string as message "data"'))))}function $Se(t){let e=LSe(t),r=DSe(t),o=pte.implement(t.deployMessage);return i=>jr(i).chain(e).chain(r).chain(Li(({id:h,data:c,tags:v,anchor:b,signer:g})=>o({processId:h,data:c,tags:v,anchor:b,signer:Sw.implement(g)}))).map(h=>Ds("messageId",h.messageId,i))}function qSe(t){let e=$Se(t);return({process:r,data:o,tags:i,anchor:h,signer:c})=>jr({id:r,data:o,tags:i,anchor:h,signer:c}).chain(e).map(v=>v.messageId).bimap(Ad,Ed).toPromise()}var Dg=(t,e,r)=>o=>e(o[t])?_d(o):xl(`Tag '${t}': ${r}`);function USe({loadTransactionMeta:t,logger:e}){return t=Li(PSe.implement(t)),r=>jr(r).chain(t).map(Sd("tags")).map(MSe).chain(Dg("Data-Protocol",FQ("ao"),"value 'ao' was not found on module")).chain(Dg("Type",FQ("Module"),"value 'Module' was not found on module")).chain(Dg("Module-Format",BT,"was not found on module")).chain(Dg("Input-Encoding",BT,"was not found on module")).chain(Dg("Output-Encoding",BT,"was not found on module")).bimap(e.tap("Verifying module source failed: %s"),e.tap("Verified module source"))}function FSe({logger:t,validateScheduler:e}){return e=Li(BSe.implement(e)),r=>jr(r).chain(o=>e(o).chain(i=>i?_d(o):xl(`Valid Scheduler-Location owned by ${o} not found`))).bimap(t.tap("Verifying scheduler failed: %s"),t.tap("Verified scheduler"))}function jSe({logger:t}){return e=>jr(e).map(t.tap("Checking for signer")).chain(r=>r?_d(r):xl("signer not found"))}function zSe(t){let e=t.logger.child("verifyInput");t={...t,logger:e};let r=USe(t),o=FSe(t),i=jSe(t);return h=>jr(h).chain(c=>r(c.module).map(()=>c)).chain(c=>o(c.scheduler)).map(()=>h).chain(c=>i(c.signer).map(()=>c)).bimap(e.tap("Error when verify input: %s"),e.tap("Successfully verified inputs"))}var ZSe=_t.array(_t.object({name:_t.string(),value:_t.string()}));function HSe(){return t=>jr(t).map(Sd("tags")).map(xw([])).map(Ns("Data-Protocol","ao")).map(Ns("Variant")).map(Ns("Type")).map(Ns("Module")).map(Ns("Scheduler")).map(Ns("SDK")).map(xI(Fh,[{name:"Data-Protocol",value:"ao"},{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Process"},{name:"Module",value:t.module},{name:"Scheduler",value:t.scheduler},{name:"SDK",value:"aoconnect"}])).map(ZSe.parse).map(Ds("tags",Fh,t))}function KSe({logger:t}){return e=>jr(e).chain(SI(_I(e.data),()=>_d(e),()=>_d(Math.random().toString().slice(-4)).map(Ds("data",Fh,e)).map(r=>j1(Sd("tags"),Ns("Content-Type"),MI({name:"Content-Type",value:"text/plain"}),Ds("tags",Fh,r))(r)).map(t.tap('added pseudo-random string as process "data"'))))}function WSe(t){let e=t.logger.child("uploadProcess");t={...t,logger:e};let r=HSe(t),o=KSe(t),i=ISe.implement(t.deployProcess);return h=>jr(h).chain(r).chain(o).chain(Li(({data:c,tags:v,signer:b})=>i({data:c,tags:v,signer:Sw.implement(b)}))).map(c=>Ds("processId",c.processId,h))}function VSe(t){let e=zSe(t),r=WSe(t);return({module:o,scheduler:i,signer:h,tags:c,data:v})=>jr({module:o,scheduler:i,signer:h,tags:c,data:v}).chain(e).chain(r).map(b=>b.processId).bimap(Ad,Ed).toPromise()}function GSe(t){let e=vte.implement(t.deployMonitor);return r=>jr(r).chain(Li(({id:o,signer:i})=>e({processId:o,signer:Sw.implement(i),data:Math.random().toString().slice(-4),tags:[]}))).map(o=>Ds("monitorId",o.messageId,r))}function YSe(t){let e=GSe(t);return({process:r,signer:o})=>jr({id:r,signer:o}).chain(e).map(i=>i.monitorId).bimap(Ad,Ed).toPromise()}function JSe(t){let e=vte.implement(t.deployUnmonitor);return r=>jr(r).chain(Li(({id:o,signer:i})=>e({processId:o,signer:Sw.implement(i),data:Math.random().toString().slice(-4),tags:[]}))).map(o=>Ds("monitorId",o.messageId,r))}function XSe(t){let e=JSe(t);return({process:r,signer:o})=>jr({id:r,signer:o}).chain(e).map(i=>i.monitorId).bimap(Ad,Ed).toPromise()}var QSe=_t.object({process:_t.string().min(1,{message:"process identifier is required"}),from:_t.string().optional(),to:_t.string().optional(),sort:_t.enum(["ASC","DESC"]).default("ASC"),limit:_t.number().optional()});function eEe(){return t=>jr(t).map(QSe.parse).map(()=>t)}function tEe({queryResults:t}){return t=Li(TSe.implement(t)),e=>jr({process:e.process,from:e.from,to:e.to,sort:e.sort,limit:e.limit}).chain(t)}function rEe(t){let e=eEe(t),r=tEe(t);return({process:o,from:i,to:h,sort:c,limit:v})=>jr({process:o,from:i,to:h,sort:c,limit:v}).chain(e).chain(r).map(t.logger.tap('readResults result for message "%s": %O',o)).map(b=>b).bimap(Ad,Ed).toPromise()}var iEe=_t.object({Id:_t.string(),Target:_t.string(),Owner:_t.string(),Anchor:_t.string().optional(),Data:_t.any().default("1234"),Tags:_t.array(_t.object({name:_t.string(),value:_t.string()}))});function nEe(){return t=>jr(t).map(iEe.parse).map(e=>(e.Tags=e.Tags.concat([{name:"Data-Protocol",value:"ao"},{name:"Type",value:"Message"},{name:"Variant",value:"ao.TN.1"}]),e))}function aEe({dryrunFetch:t}){return Li(ASe.implement(t))}function oEe(t){let e=nEe(t),r=aEe(t);return o=>jr(o).map(sEe).chain(e).chain(r).toPromise()}function sEe({process:t,data:e,tags:r,anchor:o,...i}){return{Id:"1234",Owner:"1234",...i,Target:t,Data:e||"1234",Tags:r||[],Anchor:o||"0"}}function fEe(t){let e=kSe.implement(t.deployAssign);return r=>jr(r).chain(Li(({process:o,message:i,baseLayer:h,exclude:c})=>e({process:o,message:i,baseLayer:h,exclude:c}))).map(o=>Ds("assignmentId",o.assignmentId,r))}function uEe(t){let e=fEe(t);return({process:r,message:o,baseLayer:i,exclude:h})=>jr({process:r,message:o,baseLayer:i,exclude:h}).chain(e).map(c=>c.assignmentId).bimap(Ad,Ed).toPromise()}var hEe="https://arweave.net",lEe="https://mu.ao-testnet.xyz",cEe="https://cu.ao-testnet.xyz";function Sl({GRAPHQL_URL:t,GATEWAY_URL:e=hEe,MU_URL:r=lEe,CU_URL:o=cEe}={}){let i=cte();t||(t=dte({url:e,path:"/graphql"}));let{validate:h}=Pee({cacheSize:100,GRAPHQL_URL:t}),c=k9e({MAX_SIZE:25}),v=i.child("result"),b=NSe({loadResult:R9e({fetch,CU_URL:o,logger:v}),logger:v}),g=i.child("message"),_=qSe({loadProcessMeta:TT({fetch,cache:c,logger:g}),deployMessage:_9e({fetch,MU_URL:r,logger:g}),logger:g}),M=i.child("spawn"),x=VSe({loadTransactionMeta:wSe({fetch,GRAPHQL_URL:t,logger:M}),validateScheduler:h,deployProcess:M9e({fetch,MU_URL:r,logger:M}),logger:M}),E=i.child("monitor"),A=YSe({loadProcessMeta:TT({fetch,cache:c,logger:E}),deployMonitor:x9e({fetch,MU_URL:r,logger:E}),logger:E}),I=i.child("unmonitor"),P=XSe({loadProcessMeta:TT({fetch,cache:c,logger:I}),deployUnmonitor:S9e({fetch,MU_URL:r,logger:I}),logger:E}),N=i.child("results"),L=rEe({queryResults:T9e({fetch,CU_URL:o,logger:N}),logger:N}),C=i.child("dryrun"),Y=oEe({dryrunFetch:A9e({fetch,CU_URL:o,logger:C}),logger:C}),G=i.child("assign"),te=uEe({deployAssign:E9e({fetch,MU_URL:r,logger:G}),logger:g});return{result:b,results:L,message:_,spawn:x,monitor:A,unmonitor:P,dryrun:Y,assign:te}}var mte={};ZQ(mte,{createDataItemSigner:()=>DEe});var gte=oI(P5e(),1),bte={};ZQ(bte,{AVSCTap:()=>B2,ArweaveSigner:()=>II,DataItem:()=>A2,MAX_TAG_BYTES:()=>Ew,MIN_BINARY_SIZE:()=>PI,SIG_CONFIG:()=>W1,SignatureConfig:()=>Os,Signer:()=>Mte,createData:()=>Ate,default:()=>NEe,deserializeTags:()=>vw,indexToType:()=>kI,serializeTags:()=>BI,tagsExceedLimit:()=>Ete,warparbundles:()=>CEe});var dEe=Object.create,RI=Object.defineProperty,pEe=Object.getOwnPropertyDescriptor,vEe=Object.getOwnPropertyNames,mEe=Object.getPrototypeOf,gEe=Object.prototype.hasOwnProperty,zh=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),bEe=(t,e)=>{for(var r in e)RI(t,r,{get:e[r],enumerable:!0})},yEe=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of vEe(e))!gEe.call(t,i)&&i!==r&&RI(t,i,{get:()=>e[i],enumerable:!(o=pEe(e,i))||o.enumerable});return t},Rd=(t,e,r)=>(r=t!=null?dEe(mEe(t)):{},yEe(e||!t||!t.__esModule?RI(r,"default",{value:t,enumerable:!0}):r,t)),wEe=zh(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});function e(r){var o=4,i=r.length,h=i%o;if(!h)return r;var c=i,v=o-h,b=i+v,g=Se.alloc(b);for(g.write(r);v--;)g.write("=",c++);return g.toString()}t.default=e}),_Ee=zh(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=wEe();function r(b,g){return g===void 0&&(g="utf8"),Se.isBuffer(b)?h(b.toString("base64")):h(Se.from(b,g).toString("base64"))}function o(b,g){return g===void 0&&(g="utf8"),Se.from(i(b),"base64").toString(g)}function i(b){return b=b.toString(),e.default(b).replace(/\-/g,"+").replace(/_/g,"/")}function h(b){return b.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function c(b){return Se.from(i(b),"base64")}var v=r;v.encode=r,v.decode=o,v.toBase64=i,v.fromBase64=h,v.toBuffer=c,t.default=v}),TI=zh((t,e)=>{e.exports=_Ee().default,e.exports.default=e.exports}),yte=zh(t=>{"use strict";t.byteLength=b,t.toByteArray=_,t.fromByteArray=E;var e=[],r=[],o=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(h=0,c=i.length;h<c;++h)e[h]=i[h],r[i.charCodeAt(h)]=h;var h,c;r[45]=62,r[95]=63;function v(A){var I=A.length;if(I%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var P=A.indexOf("=");P===-1&&(P=I);var N=P===I?0:4-P%4;return[P,N]}function b(A){var I=v(A),P=I[0],N=I[1];return(P+N)*3/4-N}function g(A,I,P){return(I+P)*3/4-P}function _(A){var I,P=v(A),N=P[0],L=P[1],C=new o(g(A,N,L)),Y=0,G=L>0?N-4:N,te;for(te=0;te<G;te+=4)I=r[A.charCodeAt(te)]<<18|r[A.charCodeAt(te+1)]<<12|r[A.charCodeAt(te+2)]<<6|r[A.charCodeAt(te+3)],C[Y++]=I>>16&255,C[Y++]=I>>8&255,C[Y++]=I&255;return L===2&&(I=r[A.charCodeAt(te)]<<2|r[A.charCodeAt(te+1)]>>4,C[Y++]=I&255),L===1&&(I=r[A.charCodeAt(te)]<<10|r[A.charCodeAt(te+1)]<<4|r[A.charCodeAt(te+2)]>>2,C[Y++]=I>>8&255,C[Y++]=I&255),C}function M(A){return e[A>>18&63]+e[A>>12&63]+e[A>>6&63]+e[A&63]}function x(A,I,P){for(var N,L=[],C=I;C<P;C+=3)N=(A[C]<<16&16711680)+(A[C+1]<<8&65280)+(A[C+2]&255),L.push(M(N));return L.join("")}function E(A){for(var I,P=A.length,N=P%3,L=[],C=16383,Y=0,G=P-N;Y<G;Y+=C)L.push(x(A,Y,Y+C>G?G:Y+C));return N===1?(I=A[P-1],L.push(e[I>>2]+e[I<<4&63]+"==")):N===2&&(I=(A[P-2]<<8)+A[P-1],L.push(e[I>>10]+e[I>>4&63]+e[I<<2&63]+"=")),L.join("")}}),wte=zh(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.b64UrlDecode=t.b64UrlEncode=t.bufferTob64Url=t.bufferTob64=t.b64UrlToBuffer=t.stringToB64Url=t.stringToBuffer=t.bufferToString=t.b64UrlToString=t.concatBuffers=void 0;var e=yte();function r(x){let E=0;for(let P=0;P<x.length;P++)E+=x[P].byteLength;let A=new Uint8Array(E),I=0;A.set(new Uint8Array(x[0]),I),I+=x[0].byteLength;for(let P=1;P<x.length;P++)A.set(new Uint8Array(x[P]),I),I+=x[P].byteLength;return A}t.concatBuffers=r;function o(x){let E=v(x);return i(E)}t.b64UrlToString=o;function i(x){return new TextDecoder("utf-8",{fatal:!0}).decode(x)}t.bufferToString=i;function h(x){return new TextEncoder().encode(x)}t.stringToBuffer=h;function c(x){return g(h(x))}t.stringToB64Url=c;function v(x){return new Uint8Array(e.toByteArray(M(x)))}t.b64UrlToBuffer=v;function b(x){return e.fromByteArray(new Uint8Array(x))}t.bufferTob64=b;function g(x){return _(b(x))}t.bufferTob64Url=g;function _(x){return x.replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}t.b64UrlEncode=_;function M(x){x=x.replace(/\-/g,"+").replace(/\_/g,"/");let E;return x.length%4==0?E=0:E=4-x.length%4,x.concat("=".repeat(E))}t.b64UrlDecode=M}),MEe=zh(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=wte(),r=class{keyLength=4096;publicExponent=65537;hashAlgorithm="sha256";driver;constructor(){if(!this.detectWebCrypto())throw new Error("SubtleCrypto not available!");this.driver=crypto.subtle}async generateJWK(){let o=await this.driver.generateKey({name:"RSA-PSS",modulusLength:4096,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign"]),i=await this.driver.exportKey("jwk",o.privateKey);return{kty:i.kty,e:i.e,n:i.n,d:i.d,p:i.p,q:i.q,dp:i.dp,dq:i.dq,qi:i.qi}}async sign(o,i,{saltLength:h}={}){let c=await this.driver.sign({name:"RSA-PSS",saltLength:32},await this.jwkToCryptoKey(o),i);return new Uint8Array(c)}async hash(o,i="SHA-256"){let h=await this.driver.digest(i,o);return new Uint8Array(h)}async verify(o,i,h){let c={kty:"RSA",e:"AQAB",n:o},v=await this.jwkToPublicCryptoKey(c),b=await this.driver.digest("SHA-256",i),g=await this.driver.verify({name:"RSA-PSS",saltLength:0},v,h,i),_=await this.driver.verify({name:"RSA-PSS",saltLength:32},v,h,i),M=await this.driver.verify({name:"RSA-PSS",saltLength:Math.ceil((v.algorithm.modulusLength-1)/8)-b.byteLength-2},v,h,i);return g||_||M}async jwkToCryptoKey(o){return this.driver.importKey("jwk",o,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["sign"])}async jwkToPublicCryptoKey(o){return this.driver.importKey("jwk",o,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["verify"])}detectWebCrypto(){if(typeof crypto>"u")return!1;let o=crypto?.subtle;return o===void 0?!1:["generateKey","importKey","exportKey","digest","sign"].every(i=>typeof o[i]=="function")}async encrypt(o,i,h){let c=await this.driver.importKey("raw",typeof i=="string"?e.stringToBuffer(i):i,{name:"PBKDF2",length:32},!1,["deriveKey"]),v=await this.driver.deriveKey({name:"PBKDF2",salt:h?e.stringToBuffer(h):e.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},c,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),b=new Uint8Array(16);crypto.getRandomValues(b);let g=await this.driver.encrypt({name:"AES-CBC",iv:b},v,o);return e.concatBuffers([b,g])}async decrypt(o,i,h){let c=await this.driver.importKey("raw",typeof i=="string"?e.stringToBuffer(i):i,{name:"PBKDF2",length:32},!1,["deriveKey"]),v=await this.driver.deriveKey({name:"PBKDF2",salt:h?e.stringToBuffer(h):e.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},c,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),b=o.slice(0,16),g=await this.driver.decrypt({name:"AES-CBC",iv:b},v,o.slice(16));return e.concatBuffers([g])}};t.default=r}),xEe=zh(t=>{t.read=function(e,r,o,i,h){var c,v,b=h*8-i-1,g=(1<<b)-1,_=g>>1,M=-7,x=o?h-1:0,E=o?-1:1,A=e[r+x];for(x+=E,c=A&(1<<-M)-1,A>>=-M,M+=b;M>0;c=c*256+e[r+x],x+=E,M-=8);for(v=c&(1<<-M)-1,c>>=-M,M+=i;M>0;v=v*256+e[r+x],x+=E,M-=8);if(c===0)c=1-_;else{if(c===g)return v?NaN:(A?-1:1)*(1/0);v=v+Math.pow(2,i),c=c-_}return(A?-1:1)*v*Math.pow(2,c-i)},t.write=function(e,r,o,i,h,c){var v,b,g,_=c*8-h-1,M=(1<<_)-1,x=M>>1,E=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=i?0:c-1,I=i?1:-1,P=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(b=isNaN(r)?1:0,v=M):(v=Math.floor(Math.log(r)/Math.LN2),r*(g=Math.pow(2,-v))<1&&(v--,g*=2),v+x>=1?r+=E/g:r+=E*Math.pow(2,1-x),r*g>=2&&(v++,g/=2),v+x>=M?(b=0,v=M):v+x>=1?(b=(r*g-1)*Math.pow(2,h),v=v+x):(b=r*Math.pow(2,x-1)*Math.pow(2,h),v=0));h>=8;e[o+A]=b&255,A+=I,b/=256,h-=8);for(v=v<<h|b,_+=h;_>0;e[o+A]=v&255,A+=I,v/=256,_-=8);e[o+A-I]|=P*128}}),iI=zh(t=>{"use strict";var e=yte(),r=xEe(),o=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=v,t.SlowBuffer=L,t.INSPECT_MAX_BYTES=50;var i=2147483647;t.kMaxLength=i,v.TYPED_ARRAY_SUPPORT=h(),!v.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function h(){try{let T=new Uint8Array(1),k={foo:function(){return 42}};return Object.setPrototypeOf(k,Uint8Array.prototype),Object.setPrototypeOf(T,k),T.foo()===42}catch{return!1}}Object.defineProperty(v.prototype,"parent",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.buffer}}),Object.defineProperty(v.prototype,"offset",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.byteOffset}});function c(T){if(T>i)throw new RangeError('The value "'+T+'" is invalid for option "size"');let k=new Uint8Array(T);return Object.setPrototypeOf(k,v.prototype),k}function v(T,k,O){if(typeof T=="number"){if(typeof k=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return M(T)}return b(T,k,O)}v.poolSize=8192;function b(T,k,O){if(typeof T=="string")return x(T,k);if(ArrayBuffer.isView(T))return A(T);if(T==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T);if(ut(T,ArrayBuffer)||T&&ut(T.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ut(T,SharedArrayBuffer)||T&&ut(T.buffer,SharedArrayBuffer)))return I(T,k,O);if(typeof T=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let q=T.valueOf&&T.valueOf();if(q!=null&&q!==T)return v.from(q,k,O);let H=P(T);if(H)return H;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof T[Symbol.toPrimitive]=="function")return v.from(T[Symbol.toPrimitive]("string"),k,O);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T)}v.from=function(T,k,O){return b(T,k,O)},Object.setPrototypeOf(v.prototype,Uint8Array.prototype),Object.setPrototypeOf(v,Uint8Array);function g(T){if(typeof T!="number")throw new TypeError('"size" argument must be of type number');if(T<0)throw new RangeError('The value "'+T+'" is invalid for option "size"')}function _(T,k,O){return g(T),T<=0?c(T):k!==void 0?typeof O=="string"?c(T).fill(k,O):c(T).fill(k):c(T)}v.alloc=function(T,k,O){return _(T,k,O)};function M(T){return g(T),c(T<0?0:N(T)|0)}v.allocUnsafe=function(T){return M(T)},v.allocUnsafeSlow=function(T){return M(T)};function x(T,k){if((typeof k!="string"||k==="")&&(k="utf8"),!v.isEncoding(k))throw new TypeError("Unknown encoding: "+k);let O=C(T,k)|0,q=c(O),H=q.write(T,k);return H!==O&&(q=q.slice(0,H)),q}function E(T){let k=T.length<0?0:N(T.length)|0,O=c(k);for(let q=0;q<k;q+=1)O[q]=T[q]&255;return O}function A(T){if(ut(T,Uint8Array)){let k=new Uint8Array(T);return I(k.buffer,k.byteOffset,k.byteLength)}return E(T)}function I(T,k,O){if(k<0||T.byteLength<k)throw new RangeError('"offset" is outside of buffer bounds');if(T.byteLength<k+(O||0))throw new RangeError('"length" is outside of buffer bounds');let q;return k===void 0&&O===void 0?q=new Uint8Array(T):O===void 0?q=new Uint8Array(T,k):q=new Uint8Array(T,k,O),Object.setPrototypeOf(q,v.prototype),q}function P(T){if(v.isBuffer(T)){let k=N(T.length)|0,O=c(k);return O.length===0||T.copy(O,0,0,k),O}if(T.length!==void 0)return typeof T.length!="number"||Ae(T.length)?c(0):E(T);if(T.type==="Buffer"&&Array.isArray(T.data))return E(T.data)}function N(T){if(T>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return T|0}function L(T){return+T!=T&&(T=0),v.alloc(+T)}v.isBuffer=function(T){return T!=null&&T._isBuffer===!0&&T!==v.prototype},v.compare=function(T,k){if(ut(T,Uint8Array)&&(T=v.from(T,T.offset,T.byteLength)),ut(k,Uint8Array)&&(k=v.from(k,k.offset,k.byteLength)),!v.isBuffer(T)||!v.isBuffer(k))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(T===k)return 0;let O=T.length,q=k.length;for(let H=0,W=Math.min(O,q);H<W;++H)if(T[H]!==k[H]){O=T[H],q=k[H];break}return O<q?-1:q<O?1:0},v.isEncoding=function(T){switch(String(T).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},v.concat=function(T,k){if(!Array.isArray(T))throw new TypeError('"list" argument must be an Array of Buffers');if(T.length===0)return v.alloc(0);let O;if(k===void 0)for(k=0,O=0;O<T.length;++O)k+=T[O].length;let q=v.allocUnsafe(k),H=0;for(O=0;O<T.length;++O){let W=T[O];if(ut(W,Uint8Array))H+W.length>q.length?(v.isBuffer(W)||(W=v.from(W)),W.copy(q,H)):Uint8Array.prototype.set.call(q,W,H);else if(v.isBuffer(W))W.copy(q,H);else throw new TypeError('"list" argument must be an Array of Buffers');H+=W.length}return q};function C(T,k){if(v.isBuffer(T))return T.length;if(ArrayBuffer.isView(T)||ut(T,ArrayBuffer))return T.byteLength;if(typeof T!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof T);let O=T.length,q=arguments.length>2&&arguments[2]===!0;if(!q&&O===0)return 0;let H=!1;for(;;)switch(k){case"ascii":case"latin1":case"binary":return O;case"utf8":case"utf-8":return oe(T).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O*2;case"hex":return O>>>1;case"base64":return ge(T).length;default:if(H)return q?-1:oe(T).length;k=(""+k).toLowerCase(),H=!0}}v.byteLength=C;function Y(T,k,O){let q=!1;if((k===void 0||k<0)&&(k=0),k>this.length||((O===void 0||O>this.length)&&(O=this.length),O<=0)||(O>>>=0,k>>>=0,O<=k))return"";for(T||(T="utf8");;)switch(T){case"hex":return a(this,k,O);case"utf8":case"utf-8":return u(this,k,O);case"ascii":return y(this,k,O);case"latin1":case"binary":return d(this,k,O);case"base64":return f(this,k,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return p(this,k,O);default:if(q)throw new TypeError("Unknown encoding: "+T);T=(T+"").toLowerCase(),q=!0}}v.prototype._isBuffer=!0;function G(T,k,O){let q=T[k];T[k]=T[O],T[O]=q}v.prototype.swap16=function(){let T=this.length;if(T%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let k=0;k<T;k+=2)G(this,k,k+1);return this},v.prototype.swap32=function(){let T=this.length;if(T%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let k=0;k<T;k+=4)G(this,k,k+3),G(this,k+1,k+2);return this},v.prototype.swap64=function(){let T=this.length;if(T%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let k=0;k<T;k+=8)G(this,k,k+7),G(this,k+1,k+6),G(this,k+2,k+5),G(this,k+3,k+4);return this},v.prototype.toString=function(){let T=this.length;return T===0?"":arguments.length===0?u(this,0,T):Y.apply(this,arguments)},v.prototype.toLocaleString=v.prototype.toString,v.prototype.equals=function(T){if(!v.isBuffer(T))throw new TypeError("Argument must be a Buffer");return this===T?!0:v.compare(this,T)===0},v.prototype.inspect=function(){let T="",k=t.INSPECT_MAX_BYTES;return T=this.toString("hex",0,k).replace(/(.{2})/g,"$1 ").trim(),this.length>k&&(T+=" ... "),"<Buffer "+T+">"},o&&(v.prototype[o]=v.prototype.inspect),v.prototype.compare=function(T,k,O,q,H){if(ut(T,Uint8Array)&&(T=v.from(T,T.offset,T.byteLength)),!v.isBuffer(T))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof T);if(k===void 0&&(k=0),O===void 0&&(O=T?T.length:0),q===void 0&&(q=0),H===void 0&&(H=this.length),k<0||O>T.length||q<0||H>this.length)throw new RangeError("out of range index");if(q>=H&&k>=O)return 0;if(q>=H)return-1;if(k>=O)return 1;if(k>>>=0,O>>>=0,q>>>=0,H>>>=0,this===T)return 0;let W=H-q,se=O-k,st=Math.min(W,se),ue=this.slice(q,H),pe=T.slice(k,O);for(let ve=0;ve<st;++ve)if(ue[ve]!==pe[ve]){W=ue[ve],se=pe[ve];break}return W<se?-1:se<W?1:0};function te(T,k,O,q,H){if(T.length===0)return-1;if(typeof O=="string"?(q=O,O=0):O>2147483647?O=2147483647:O<-2147483648&&(O=-2147483648),O=+O,Ae(O)&&(O=H?0:T.length-1),O<0&&(O=T.length+O),O>=T.length){if(H)return-1;O=T.length-1}else if(O<0)if(H)O=0;else return-1;if(typeof k=="string"&&(k=v.from(k,q)),v.isBuffer(k))return k.length===0?-1:$(T,k,O,q,H);if(typeof k=="number")return k=k&255,typeof Uint8Array.prototype.indexOf=="function"?H?Uint8Array.prototype.indexOf.call(T,k,O):Uint8Array.prototype.lastIndexOf.call(T,k,O):$(T,[k],O,q,H);throw new TypeError("val must be string, number or Buffer")}function $(T,k,O,q,H){let W=1,se=T.length,st=k.length;if(q!==void 0&&(q=String(q).toLowerCase(),q==="ucs2"||q==="ucs-2"||q==="utf16le"||q==="utf-16le")){if(T.length<2||k.length<2)return-1;W=2,se/=2,st/=2,O/=2}function ue(ve,be){return W===1?ve[be]:ve.readUInt16BE(be*W)}let pe;if(H){let ve=-1;for(pe=O;pe<se;pe++)if(ue(T,pe)===ue(k,ve===-1?0:pe-ve)){if(ve===-1&&(ve=pe),pe-ve+1===st)return ve*W}else ve!==-1&&(pe-=pe-ve),ve=-1}else for(O+st>se&&(O=se-st),pe=O;pe>=0;pe--){let ve=!0;for(let be=0;be<st;be++)if(ue(T,pe+be)!==ue(k,be)){ve=!1;break}if(ve)return pe}return-1}v.prototype.includes=function(T,k,O){return this.indexOf(T,k,O)!==-1},v.prototype.indexOf=function(T,k,O){return te(this,T,k,O,!0)},v.prototype.lastIndexOf=function(T,k,O){return te(this,T,k,O,!1)};function F(T,k,O,q){O=Number(O)||0;let H=T.length-O;q?(q=Number(q),q>H&&(q=H)):q=H;let W=k.length;q>W/2&&(q=W/2);let se;for(se=0;se<q;++se){let st=parseInt(k.substr(se*2,2),16);if(Ae(st))return se;T[O+se]=st}return se}function V(T,k,O,q){return xe(oe(k,T.length-O),T,O,q)}function w(T,k,O,q){return xe(le(k),T,O,q)}function n(T,k,O,q){return xe(ge(k),T,O,q)}function s(T,k,O,q){return xe(ot(k,T.length-O),T,O,q)}v.prototype.write=function(T,k,O,q){if(k===void 0)q="utf8",O=this.length,k=0;else if(O===void 0&&typeof k=="string")q=k,O=this.length,k=0;else if(isFinite(k))k=k>>>0,isFinite(O)?(O=O>>>0,q===void 0&&(q="utf8")):(q=O,O=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let H=this.length-k;if((O===void 0||O>H)&&(O=H),T.length>0&&(O<0||k<0)||k>this.length)throw new RangeError("Attempt to write outside buffer bounds");q||(q="utf8");let W=!1;for(;;)switch(q){case"hex":return F(this,T,k,O);case"utf8":case"utf-8":return V(this,T,k,O);case"ascii":case"latin1":case"binary":return w(this,T,k,O);case"base64":return n(this,T,k,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s(this,T,k,O);default:if(W)throw new TypeError("Unknown encoding: "+q);q=(""+q).toLowerCase(),W=!0}},v.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function f(T,k,O){return k===0&&O===T.length?e.fromByteArray(T):e.fromByteArray(T.slice(k,O))}function u(T,k,O){O=Math.min(T.length,O);let q=[],H=k;for(;H<O;){let W=T[H],se=null,st=W>239?4:W>223?3:W>191?2:1;if(H+st<=O){let ue,pe,ve,be;switch(st){case 1:W<128&&(se=W);break;case 2:ue=T[H+1],(ue&192)===128&&(be=(W&31)<<6|ue&63,be>127&&(se=be));break;case 3:ue=T[H+1],pe=T[H+2],(ue&192)===128&&(pe&192)===128&&(be=(W&15)<<12|(ue&63)<<6|pe&63,be>2047&&(be<55296||be>57343)&&(se=be));break;case 4:ue=T[H+1],pe=T[H+2],ve=T[H+3],(ue&192)===128&&(pe&192)===128&&(ve&192)===128&&(be=(W&15)<<18|(ue&63)<<12|(pe&63)<<6|ve&63,be>65535&&be<1114112&&(se=be))}}se===null?(se=65533,st=1):se>65535&&(se-=65536,q.push(se>>>10&1023|55296),se=56320|se&1023),q.push(se),H+=st}return m(q)}var l=4096;function m(T){let k=T.length;if(k<=l)return String.fromCharCode.apply(String,T);let O="",q=0;for(;q<k;)O+=String.fromCharCode.apply(String,T.slice(q,q+=l));return O}function y(T,k,O){let q="";O=Math.min(T.length,O);for(let H=k;H<O;++H)q+=String.fromCharCode(T[H]&127);return q}function d(T,k,O){let q="";O=Math.min(T.length,O);for(let H=k;H<O;++H)q+=String.fromCharCode(T[H]);return q}function a(T,k,O){let q=T.length;(!k||k<0)&&(k=0),(!O||O<0||O>q)&&(O=q);let H="";for(let W=k;W<O;++W)H+=Ge[T[W]];return H}function p(T,k,O){let q=T.slice(k,O),H="";for(let W=0;W<q.length-1;W+=2)H+=String.fromCharCode(q[W]+q[W+1]*256);return H}v.prototype.slice=function(T,k){let O=this.length;T=~~T,k=k===void 0?O:~~k,T<0?(T+=O,T<0&&(T=0)):T>O&&(T=O),k<0?(k+=O,k<0&&(k=0)):k>O&&(k=O),k<T&&(k=T);let q=this.subarray(T,k);return Object.setPrototypeOf(q,v.prototype),q};function R(T,k,O){if(T%1!==0||T<0)throw new RangeError("offset is not uint");if(T+k>O)throw new RangeError("Trying to access beyond buffer length")}v.prototype.readUintLE=v.prototype.readUIntLE=function(T,k,O){T=T>>>0,k=k>>>0,O||R(T,k,this.length);let q=this[T],H=1,W=0;for(;++W<k&&(H*=256);)q+=this[T+W]*H;return q},v.prototype.readUintBE=v.prototype.readUIntBE=function(T,k,O){T=T>>>0,k=k>>>0,O||R(T,k,this.length);let q=this[T+--k],H=1;for(;k>0&&(H*=256);)q+=this[T+--k]*H;return q},v.prototype.readUint8=v.prototype.readUInt8=function(T,k){return T=T>>>0,k||R(T,1,this.length),this[T]},v.prototype.readUint16LE=v.prototype.readUInt16LE=function(T,k){return T=T>>>0,k||R(T,2,this.length),this[T]|this[T+1]<<8},v.prototype.readUint16BE=v.prototype.readUInt16BE=function(T,k){return T=T>>>0,k||R(T,2,this.length),this[T]<<8|this[T+1]},v.prototype.readUint32LE=v.prototype.readUInt32LE=function(T,k){return T=T>>>0,k||R(T,4,this.length),(this[T]|this[T+1]<<8|this[T+2]<<16)+this[T+3]*16777216},v.prototype.readUint32BE=v.prototype.readUInt32BE=function(T,k){return T=T>>>0,k||R(T,4,this.length),this[T]*16777216+(this[T+1]<<16|this[T+2]<<8|this[T+3])},v.prototype.readBigUInt64LE=lt(function(T){T=T>>>0,J(T,"offset");let k=this[T],O=this[T+7];(k===void 0||O===void 0)&&X(T,this.length-8);let q=k+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24,H=this[++T]+this[++T]*2**8+this[++T]*2**16+O*2**24;return BigInt(q)+(BigInt(H)<<BigInt(32))}),v.prototype.readBigUInt64BE=lt(function(T){T=T>>>0,J(T,"offset");let k=this[T],O=this[T+7];(k===void 0||O===void 0)&&X(T,this.length-8);let q=k*2**24+this[++T]*2**16+this[++T]*2**8+this[++T],H=this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+O;return(BigInt(q)<<BigInt(32))+BigInt(H)}),v.prototype.readIntLE=function(T,k,O){T=T>>>0,k=k>>>0,O||R(T,k,this.length);let q=this[T],H=1,W=0;for(;++W<k&&(H*=256);)q+=this[T+W]*H;return H*=128,q>=H&&(q-=Math.pow(2,8*k)),q},v.prototype.readIntBE=function(T,k,O){T=T>>>0,k=k>>>0,O||R(T,k,this.length);let q=k,H=1,W=this[T+--q];for(;q>0&&(H*=256);)W+=this[T+--q]*H;return H*=128,W>=H&&(W-=Math.pow(2,8*k)),W},v.prototype.readInt8=function(T,k){return T=T>>>0,k||R(T,1,this.length),this[T]&128?(255-this[T]+1)*-1:this[T]},v.prototype.readInt16LE=function(T,k){T=T>>>0,k||R(T,2,this.length);let O=this[T]|this[T+1]<<8;return O&32768?O|4294901760:O},v.prototype.readInt16BE=function(T,k){T=T>>>0,k||R(T,2,this.length);let O=this[T+1]|this[T]<<8;return O&32768?O|4294901760:O},v.prototype.readInt32LE=function(T,k){return T=T>>>0,k||R(T,4,this.length),this[T]|this[T+1]<<8|this[T+2]<<16|this[T+3]<<24},v.prototype.readInt32BE=function(T,k){return T=T>>>0,k||R(T,4,this.length),this[T]<<24|this[T+1]<<16|this[T+2]<<8|this[T+3]},v.prototype.readBigInt64LE=lt(function(T){T=T>>>0,J(T,"offset");let k=this[T],O=this[T+7];(k===void 0||O===void 0)&&X(T,this.length-8);let q=this[T+4]+this[T+5]*2**8+this[T+6]*2**16+(O<<24);return(BigInt(q)<<BigInt(32))+BigInt(k+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24)}),v.prototype.readBigInt64BE=lt(function(T){T=T>>>0,J(T,"offset");let k=this[T],O=this[T+7];(k===void 0||O===void 0)&&X(T,this.length-8);let q=(k<<24)+this[++T]*2**16+this[++T]*2**8+this[++T];return(BigInt(q)<<BigInt(32))+BigInt(this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+O)}),v.prototype.readFloatLE=function(T,k){return T=T>>>0,k||R(T,4,this.length),r.read(this,T,!0,23,4)},v.prototype.readFloatBE=function(T,k){return T=T>>>0,k||R(T,4,this.length),r.read(this,T,!1,23,4)},v.prototype.readDoubleLE=function(T,k){return T=T>>>0,k||R(T,8,this.length),r.read(this,T,!0,52,8)},v.prototype.readDoubleBE=function(T,k){return T=T>>>0,k||R(T,8,this.length),r.read(this,T,!1,52,8)};function S(T,k,O,q,H,W){if(!v.isBuffer(T))throw new TypeError('"buffer" argument must be a Buffer instance');if(k>H||k<W)throw new RangeError('"value" argument is out of bounds');if(O+q>T.length)throw new RangeError("Index out of range")}v.prototype.writeUintLE=v.prototype.writeUIntLE=function(T,k,O,q){if(T=+T,k=k>>>0,O=O>>>0,!q){let se=Math.pow(2,8*O)-1;S(this,T,k,O,se,0)}let H=1,W=0;for(this[k]=T&255;++W<O&&(H*=256);)this[k+W]=T/H&255;return k+O},v.prototype.writeUintBE=v.prototype.writeUIntBE=function(T,k,O,q){if(T=+T,k=k>>>0,O=O>>>0,!q){let se=Math.pow(2,8*O)-1;S(this,T,k,O,se,0)}let H=O-1,W=1;for(this[k+H]=T&255;--H>=0&&(W*=256);)this[k+H]=T/W&255;return k+O},v.prototype.writeUint8=v.prototype.writeUInt8=function(T,k,O){return T=+T,k=k>>>0,O||S(this,T,k,1,255,0),this[k]=T&255,k+1},v.prototype.writeUint16LE=v.prototype.writeUInt16LE=function(T,k,O){return T=+T,k=k>>>0,O||S(this,T,k,2,65535,0),this[k]=T&255,this[k+1]=T>>>8,k+2},v.prototype.writeUint16BE=v.prototype.writeUInt16BE=function(T,k,O){return T=+T,k=k>>>0,O||S(this,T,k,2,65535,0),this[k]=T>>>8,this[k+1]=T&255,k+2},v.prototype.writeUint32LE=v.prototype.writeUInt32LE=function(T,k,O){return T=+T,k=k>>>0,O||S(this,T,k,4,4294967295,0),this[k+3]=T>>>24,this[k+2]=T>>>16,this[k+1]=T>>>8,this[k]=T&255,k+4},v.prototype.writeUint32BE=v.prototype.writeUInt32BE=function(T,k,O){return T=+T,k=k>>>0,O||S(this,T,k,4,4294967295,0),this[k]=T>>>24,this[k+1]=T>>>16,this[k+2]=T>>>8,this[k+3]=T&255,k+4};function B(T,k,O,q,H){j(k,q,H,T,O,7);let W=Number(k&BigInt(4294967295));T[O++]=W,W=W>>8,T[O++]=W,W=W>>8,T[O++]=W,W=W>>8,T[O++]=W;let se=Number(k>>BigInt(32)&BigInt(4294967295));return T[O++]=se,se=se>>8,T[O++]=se,se=se>>8,T[O++]=se,se=se>>8,T[O++]=se,O}function U(T,k,O,q,H){j(k,q,H,T,O,7);let W=Number(k&BigInt(4294967295));T[O+7]=W,W=W>>8,T[O+6]=W,W=W>>8,T[O+5]=W,W=W>>8,T[O+4]=W;let se=Number(k>>BigInt(32)&BigInt(4294967295));return T[O+3]=se,se=se>>8,T[O+2]=se,se=se>>8,T[O+1]=se,se=se>>8,T[O]=se,O+8}v.prototype.writeBigUInt64LE=lt(function(T,k=0){return B(this,T,k,BigInt(0),BigInt("0xffffffffffffffff"))}),v.prototype.writeBigUInt64BE=lt(function(T,k=0){return U(this,T,k,BigInt(0),BigInt("0xffffffffffffffff"))}),v.prototype.writeIntLE=function(T,k,O,q){if(T=+T,k=k>>>0,!q){let st=Math.pow(2,8*O-1);S(this,T,k,O,st-1,-st)}let H=0,W=1,se=0;for(this[k]=T&255;++H<O&&(W*=256);)T<0&&se===0&&this[k+H-1]!==0&&(se=1),this[k+H]=(T/W>>0)-se&255;return k+O},v.prototype.writeIntBE=function(T,k,O,q){if(T=+T,k=k>>>0,!q){let st=Math.pow(2,8*O-1);S(this,T,k,O,st-1,-st)}let H=O-1,W=1,se=0;for(this[k+H]=T&255;--H>=0&&(W*=256);)T<0&&se===0&&this[k+H+1]!==0&&(se=1),this[k+H]=(T/W>>0)-se&255;return k+O},v.prototype.writeInt8=function(T,k,O){return T=+T,k=k>>>0,O||S(this,T,k,1,127,-128),T<0&&(T=255+T+1),this[k]=T&255,k+1},v.prototype.writeInt16LE=function(T,k,O){return T=+T,k=k>>>0,O||S(this,T,k,2,32767,-32768),this[k]=T&255,this[k+1]=T>>>8,k+2},v.prototype.writeInt16BE=function(T,k,O){return T=+T,k=k>>>0,O||S(this,T,k,2,32767,-32768),this[k]=T>>>8,this[k+1]=T&255,k+2},v.prototype.writeInt32LE=function(T,k,O){return T=+T,k=k>>>0,O||S(this,T,k,4,2147483647,-2147483648),this[k]=T&255,this[k+1]=T>>>8,this[k+2]=T>>>16,this[k+3]=T>>>24,k+4},v.prototype.writeInt32BE=function(T,k,O){return T=+T,k=k>>>0,O||S(this,T,k,4,2147483647,-2147483648),T<0&&(T=4294967295+T+1),this[k]=T>>>24,this[k+1]=T>>>16,this[k+2]=T>>>8,this[k+3]=T&255,k+4},v.prototype.writeBigInt64LE=lt(function(T,k=0){return B(this,T,k,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),v.prototype.writeBigInt64BE=lt(function(T,k=0){return U(this,T,k,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function D(T,k,O,q,H,W){if(O+q>T.length)throw new RangeError("Index out of range");if(O<0)throw new RangeError("Index out of range")}function re(T,k,O,q,H){return k=+k,O=O>>>0,H||D(T,k,O,4,34028234663852886e22,-34028234663852886e22),r.write(T,k,O,q,23,4),O+4}v.prototype.writeFloatLE=function(T,k,O){return re(this,T,k,!0,O)},v.prototype.writeFloatBE=function(T,k,O){return re(this,T,k,!1,O)};function Q(T,k,O,q,H){return k=+k,O=O>>>0,H||D(T,k,O,8,17976931348623157e292,-17976931348623157e292),r.write(T,k,O,q,52,8),O+8}v.prototype.writeDoubleLE=function(T,k,O){return Q(this,T,k,!0,O)},v.prototype.writeDoubleBE=function(T,k,O){return Q(this,T,k,!1,O)},v.prototype.copy=function(T,k,O,q){if(!v.isBuffer(T))throw new TypeError("argument should be a Buffer");if(O||(O=0),!q&&q!==0&&(q=this.length),k>=T.length&&(k=T.length),k||(k=0),q>0&&q<O&&(q=O),q===O||T.length===0||this.length===0)return 0;if(k<0)throw new RangeError("targetStart out of bounds");if(O<0||O>=this.length)throw new RangeError("Index out of range");if(q<0)throw new RangeError("sourceEnd out of bounds");q>this.length&&(q=this.length),T.length-k<q-O&&(q=T.length-k+O);let H=q-O;return this===T&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(k,O,q):Uint8Array.prototype.set.call(T,this.subarray(O,q),k),H},v.prototype.fill=function(T,k,O,q){if(typeof T=="string"){if(typeof k=="string"?(q=k,k=0,O=this.length):typeof O=="string"&&(q=O,O=this.length),q!==void 0&&typeof q!="string")throw new TypeError("encoding must be a string");if(typeof q=="string"&&!v.isEncoding(q))throw new TypeError("Unknown encoding: "+q);if(T.length===1){let W=T.charCodeAt(0);(q==="utf8"&&W<128||q==="latin1")&&(T=W)}}else typeof T=="number"?T=T&255:typeof T=="boolean"&&(T=Number(T));if(k<0||this.length<k||this.length<O)throw new RangeError("Out of range index");if(O<=k)return this;k=k>>>0,O=O===void 0?this.length:O>>>0,T||(T=0);let H;if(typeof T=="number")for(H=k;H<O;++H)this[H]=T;else{let W=v.isBuffer(T)?T:v.from(T,q),se=W.length;if(se===0)throw new TypeError('The value "'+T+'" is invalid for argument "value"');for(H=0;H<O-k;++H)this[H+k]=W[H%se]}return this};var Z={};function K(T,k,O){Z[T]=class extends O{constructor(){super(),Object.defineProperty(this,"message",{value:k.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${T}]`,this.stack,delete this.name}get code(){return T}set code(q){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:q,writable:!0})}toString(){return`${this.name} [${T}]: ${this.message}`}}}K("ERR_BUFFER_OUT_OF_BOUNDS",function(T){return T?`${T} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),K("ERR_INVALID_ARG_TYPE",function(T,k){return`The "${T}" argument must be of type number. Received type ${typeof k}`},TypeError),K("ERR_OUT_OF_RANGE",function(T,k,O){let q=`The value of "${T}" is out of range.`,H=O;return Number.isInteger(O)&&Math.abs(O)>2**32?H=ce(String(O)):typeof O=="bigint"&&(H=String(O),(O>BigInt(2)**BigInt(32)||O<-(BigInt(2)**BigInt(32)))&&(H=ce(H)),H+="n"),q+=` It must be ${k}. Received ${H}`,q},RangeError);function ce(T){let k="",O=T.length,q=T[0]==="-"?1:0;for(;O>=q+4;O-=3)k=`_${T.slice(O-3,O)}${k}`;return`${T.slice(0,O)}${k}`}function ee(T,k,O){J(k,"offset"),(T[k]===void 0||T[k+O]===void 0)&&X(k,T.length-(O+1))}function j(T,k,O,q,H,W){if(T>O||T<k){let se=typeof k=="bigint"?"n":"",st;throw W>3?k===0||k===BigInt(0)?st=`>= 0${se} and < 2${se} ** ${(W+1)*8}${se}`:st=`>= -(2${se} ** ${(W+1)*8-1}${se}) and < 2 ** ${(W+1)*8-1}${se}`:st=`>= ${k}${se} and <= ${O}${se}`,new Z.ERR_OUT_OF_RANGE("value",st,T)}ee(q,H,W)}function J(T,k){if(typeof T!="number")throw new Z.ERR_INVALID_ARG_TYPE(k,"number",T)}function X(T,k,O){throw Math.floor(T)!==T?(J(T,O),new Z.ERR_OUT_OF_RANGE(O||"offset","an integer",T)):k<0?new Z.ERR_BUFFER_OUT_OF_BOUNDS:new Z.ERR_OUT_OF_RANGE(O||"offset",`>= ${O?1:0} and <= ${k}`,T)}var he=/[^+/0-9A-Za-z-_]/g;function Ie(T){if(T=T.split("=")[0],T=T.trim().replace(he,""),T.length<2)return"";for(;T.length%4!==0;)T=T+"=";return T}function oe(T,k){k=k||1/0;let O,q=T.length,H=null,W=[];for(let se=0;se<q;++se){if(O=T.charCodeAt(se),O>55295&&O<57344){if(!H){if(O>56319){(k-=3)>-1&&W.push(239,191,189);continue}else if(se+1===q){(k-=3)>-1&&W.push(239,191,189);continue}H=O;continue}if(O<56320){(k-=3)>-1&&W.push(239,191,189),H=O;continue}O=(H-55296<<10|O-56320)+65536}else H&&(k-=3)>-1&&W.push(239,191,189);if(H=null,O<128){if((k-=1)<0)break;W.push(O)}else if(O<2048){if((k-=2)<0)break;W.push(O>>6|192,O&63|128)}else if(O<65536){if((k-=3)<0)break;W.push(O>>12|224,O>>6&63|128,O&63|128)}else if(O<1114112){if((k-=4)<0)break;W.push(O>>18|240,O>>12&63|128,O>>6&63|128,O&63|128)}else throw new Error("Invalid code point")}return W}function le(T){let k=[];for(let O=0;O<T.length;++O)k.push(T.charCodeAt(O)&255);return k}function ot(T,k){let O,q,H,W=[];for(let se=0;se<T.length&&!((k-=2)<0);++se)O=T.charCodeAt(se),q=O>>8,H=O%256,W.push(H),W.push(q);return W}function ge(T){return e.toByteArray(Ie(T))}function xe(T,k,O,q){let H;for(H=0;H<q&&!(H+O>=k.length||H>=T.length);++H)k[H+O]=T[H];return H}function ut(T,k){return T instanceof k||T!=null&&T.constructor!=null&&T.constructor.name!=null&&T.constructor.name===k.name}function Ae(T){return T!==T}var Ge=function(){let T="0123456789abcdef",k=new Array(256);for(let O=0;O<16;++O){let q=O*16;for(let H=0;H<16;++H)k[q+H]=T[O]+T[H]}return k}();function lt(T){return typeof BigInt>"u"?z:T}function z(){throw new Error("BigInt not supported")}}),SEe=zh((t,e)=>{typeof window<"u"?(window.global=window,global.fetch=window.fetch,e.exports={Buffer:iI().Buffer,Crypto:window.crypto}):e.exports={Buffer:iI().Buffer,Crypto:crypto}}),_te={};bEe(_te,{AVSCTap:()=>B2,ArweaveSigner:()=>II,DataItem:()=>A2,MAX_TAG_BYTES:()=>Ew,MIN_BINARY_SIZE:()=>PI,SIG_CONFIG:()=>W1,SignatureConfig:()=>Os,Signer:()=>Mte,createData:()=>Ate,deserializeTags:()=>vw,indexToType:()=>kI,serializeTags:()=>BI,tagsExceedLimit:()=>Ete});var Mte=class{signer;publicKey;signatureType;signatureLength;ownerLength;pem;static verify(t,e,r,o){throw new Error("You must implement verify method on child")}},EEe=Rd(TI(),1),If=Rd(wte(),1);async function xte(t){if(Array.isArray(t)){let i=(0,If.concatBuffers)([(0,If.stringToBuffer)("list"),(0,If.stringToBuffer)(t.length.toString())]);return await Ste(t,await qh().hash(i,"SHA-384"))}let e=t,r=(0,If.concatBuffers)([(0,If.stringToBuffer)("blob"),(0,If.stringToBuffer)(e.byteLength.toString())]),o=(0,If.concatBuffers)([await qh().hash(r,"SHA-384"),await qh().hash(e,"SHA-384")]);return await qh().hash(o,"SHA-384")}async function Ste(t,e){if(t.length<1)return e;let r=(0,If.concatBuffers)([e,await xte(t[0])]),o=await qh().hash(r,"SHA-384");return await Ste(t.slice(1),o)}var OT=Rd(MEe(),1),AEe=OT.default.default?OT.default.default:OT.default,REe=class extends AEe{getPublicKey(t){throw new Error("Unimplemented")}},TEe;function qh(){return TEe??=new REe}var Os;(function(t){t[t.ARWEAVE=1]="ARWEAVE",t[t.ED25519=2]="ED25519",t[t.ETHEREUM=3]="ETHEREUM",t[t.SOLANA=4]="SOLANA",t[t.INJECTEDAPTOS=5]="INJECTEDAPTOS",t[t.MULTIAPTOS=6]="MULTIAPTOS",t[t.TYPEDETHEREUM=7]="TYPEDETHEREUM"})(Os||(Os={}));var W1={[Os.ARWEAVE]:{sigLength:512,pubLength:512,sigName:"arweave"},[Os.ED25519]:{sigLength:64,pubLength:32,sigName:"ed25519"},[Os.ETHEREUM]:{sigLength:65,pubLength:65,sigName:"ethereum"},[Os.SOLANA]:{sigLength:64,pubLength:32,sigName:"solana"},[Os.INJECTEDAPTOS]:{sigLength:64,pubLength:32,sigName:"injectedAptos"},[Os.MULTIAPTOS]:{sigLength:64*32+4,pubLength:32*32+1,sigName:"multiAptos"},[Os.TYPEDETHEREUM]:{sigLength:65,pubLength:42,sigName:"typedEthereum"}},II=class{signatureType=1;ownerLength=W1[1].pubLength;signatureLength=W1[1].sigLength;jwk;pk;constructor(t){this.pk=t.n,this.jwk=t}get publicKey(){return EEe.default.toBuffer(this.pk)}sign(t){return qh().sign(this.jwk,t)}static async verify(t,e,r){return await qh().verify(t,e,r)}},kI={1:II},Nu=Rd(TI(),1);async function nI(t){return xte([(0,If.stringToBuffer)("dataitem"),(0,If.stringToBuffer)("1"),(0,If.stringToBuffer)(t.signatureType.toString()),t.rawOwner,t.rawTarget,t.rawAnchor,t.rawTags,t.rawData])}async function IEe(t,e){let r=await nI(t),o=await e.sign(r),i=await qh().hash(o);return{signature:Se.from(o),id:Se.from(i)}}async function kEe(t,e){let{signature:r,id:o}=await IEe(t,e);return t.getRaw().set(r,2),o}var B2=class{buf;pos;constructor(t=Se.alloc(Ew),e=0){this.buf=t,this.pos=e}writeTags(t){if(!Array.isArray(t))throw new Error("input must be array");let e=t.length,r;if(e)for(this.writeLong(e),r=0;r<e;r++){let o=t[r];if(o?.name===void 0||o?.value===void 0)throw new Error(`Invalid tag format for ${o}, expected {name:string, value: string}`);this.writeString(o.name),this.writeString(o.value)}this.writeLong(0)}toBuffer(){let t=Se.alloc(this.pos);if(this.pos>this.buf.length)throw new Error(`Too many tag bytes (${this.pos} > ${this.buf.length})`);return this.buf.copy(t,0,0,this.pos),t}tagsExceedLimit(){return this.pos>this.buf.length}writeLong(t){let e=this.buf,r,o;if(t>=-1073741824&&t<1073741824){o=t>=0?t<<1:~t<<1|1;do e[this.pos]=o&127,o>>=7;while(o&&(e[this.pos++]|=128))}else{r=t>=0?t*2:-t*2-1;do e[this.pos]=r&127,r/=128;while(r>=1&&(e[this.pos++]|=128))}this.pos++,this.buf=e}writeString(t){let e=Se.byteLength(t),r=this.buf;this.writeLong(e);let o=this.pos;if(this.pos+=e,!(this.pos>r.length)){if(e>64)this.buf.write(t,this.pos-e,e,"utf8");else{let i,h,c,v;for(i=0,h=e;i<h;i++)c=t.charCodeAt(i),c<128?r[o++]=c:c<2048?(r[o++]=c>>6|192,r[o++]=c&63|128):(c&64512)===55296&&((v=t.charCodeAt(i+1))&64512)===56320?(c=65536+((c&1023)<<10)+(v&1023),i++,r[o++]=c>>18|240,r[o++]=c>>12&63|128,r[o++]=c>>6&63|128,r[o++]=c&63|128):(r[o++]=c>>12|224,r[o++]=c>>6&63|128,r[o++]=c&63|128)}this.buf=r}}readLong(){let t=0,e=0,r=this.buf,o,i,h,c;do o=r[this.pos++],i=o&128,t|=(o&127)<<e,e+=7;while(i&&e<28);if(i){h=t,c=268435456;do o=r[this.pos++],h+=(o&127)*c,c*=128;while(o&128);return(h%2?-(h+1):h)/2}return t>>1^-(t&1)}skipLong(){let t=this.buf;for(;t[this.pos++]&128;);}readTags(){let t=[],e;for(;e=this.readLong();)for(e<0&&(e=-e,this.skipLong());e--;){let r=this.readString(),o=this.readString();t.push({name:r,value:o})}return t}readString(){let t=this.readLong(),e=this.pos,r=this.buf;if(this.pos+=t,!(this.pos>r.length))return this.buf.slice(e,e+t).toString()}};function BI(t){let e=new B2;return e.writeTags(t),e.toBuffer()}function Ete(t){let e=new B2;return e.writeTags(t),e.tagsExceedLimit()}function vw(t){return new B2(t).readTags()}function pl(t){let e=0;for(let r=t.length-1;r>=0;r--)e=e*256+t[r];return e}function BEe(t){if(t>29)throw new Error("Short too long");let e=[0,0];for(let r=0;r<e.length;r++){let o=t&255;e[r]=o,t=(t-o)/256}return Uint8Array.from(e)}function jQ(t){let e=[0,0,0,0,0,0,0,0];for(let r=0;r<e.length;r++){let o=t&255;e[r]=o,t=(t-o)/256}return Uint8Array.from(e)}var PEe=Rd(SEe(),1),R1=Rd(iI(),1),Ew=4096,PI=80,A2=class{binary;_id;constructor(t){this.binary=t}static isDataItem(t){return t.binary!==void 0}get signatureType(){let t=pl(this.binary.subarray(0,2));if(Os?.[t]!==void 0)return t;throw new Error("Unknown signature type: "+t)}async isValid(){return A2.verify(this.binary)}get id(){return(async()=>Nu.default.encode(await this.rawId))()}set id(t){this._id=Nu.default.toBuffer(t)}get rawId(){return(async()=>R1.Buffer.from(await PEe.Crypto.subtle.digest("SHA-256",this.rawSignature)))()}set rawId(t){this._id=t}get rawSignature(){return this.binary.subarray(2,2+this.signatureLength)}get signature(){return Nu.default.encode(this.rawSignature)}set rawOwner(t){if(t.byteLength!=this.ownerLength)throw new Error(`Expected raw owner (pubkey) to be ${this.ownerLength} bytes, got ${t.byteLength} bytes.`);this.binary.set(t,2+this.signatureLength)}get rawOwner(){return this.binary.subarray(2+this.signatureLength,2+this.signatureLength+this.ownerLength)}get signatureLength(){return W1[this.signatureType].sigLength}get owner(){return Nu.default.encode(this.rawOwner)}get ownerLength(){return W1[this.signatureType].pubLength}get rawTarget(){let t=this.getTargetStart();return this.binary[t]==1?this.binary.subarray(t+1,t+33):R1.Buffer.alloc(0)}get target(){return Nu.default.encode(this.rawTarget)}get rawAnchor(){let t=this.getAnchorStart();return this.binary[t]==1?this.binary.subarray(t+1,t+33):R1.Buffer.alloc(0)}get anchor(){return this.rawAnchor.toString()}get rawTags(){let t=this.getTagsStart(),e=pl(this.binary.subarray(t+8,t+16));return this.binary.subarray(t+16,t+16+e)}get tags(){let t=this.getTagsStart();if(pl(this.binary.subarray(t,t+8))==0)return[];let e=pl(this.binary.subarray(t+8,t+16));return vw(R1.Buffer.from(this.binary.subarray(t+16,t+16+e)))}get tagsB64Url(){return this.tags.map(t=>({name:Nu.default.encode(t.name),value:Nu.default.encode(t.value)}))}getStartOfData(){let t=this.getTagsStart(),e=this.binary.subarray(t+8,t+16),r=pl(e);return t+16+r}get rawData(){let t=this.getTagsStart(),e=this.binary.subarray(t+8,t+16),r=pl(e),o=t+16+r;return this.binary.subarray(o,this.binary.length)}get data(){return Nu.default.encode(this.rawData)}getRaw(){return this.binary}async sign(t){return this._id=await kEe(this,t),this.rawId}async setSignature(t){this.binary.set(t,2),this._id=R1.Buffer.from(await qh().hash(t))}isSigned(){return(this._id?.length??0)>0}toJSON(){return{signature:this.signature,owner:this.owner,target:this.target,tags:this.tags.map(t=>({name:Nu.default.encode(t.name),value:Nu.default.encode(t.value)})),data:this.data}}static async verify(t){if(t.byteLength<PI)return!1;let e=new A2(t),r=e.signatureType,o=e.getTagsStart(),i=pl(t.subarray(o,o+8)),h=t.subarray(o+8,o+16),c=pl(h);if(c>Ew)return!1;if(i>0)try{if(vw(R1.Buffer.from(t.subarray(o+16,o+16+c))).length!==i)return!1}catch{return!1}let v=kI[r],b=await nI(e);return await v.verify(e.rawOwner,b,e.rawSignature)}async getSignatureData(){return nI(this)}getTagsStart(){let t=this.getTargetStart(),e=this.binary[t]==1,r=t+(e?33:1),o=this.binary[r]==1;return r+=o?33:1,r}getTargetStart(){return 2+this.signatureLength+this.ownerLength}getAnchorStart(){let t=this.getTargetStart()+1,e=this.binary[this.getTargetStart()]==1;return t+=e?32:0,t}},OEe=Rd(TI(),1);function Ate(t,e,r){let o=e.publicKey,i=r?.target?OEe.default.toBuffer(r.target):null,h=1+(i?.byteLength??0),c=r?.anchor?Se.from(r.anchor):null,v=1+(c?.byteLength??0),b=(r?.tags?.length??0)>0?BI(r.tags):null,g=16+(b?b.byteLength:0),_=Se.from(t),M=_.byteLength,x=2+e.signatureLength+e.ownerLength+h+v+g+M,E=Se.alloc(x);if(E.set(BEe(e.signatureType),0),E.set(new Uint8Array(e.signatureLength).fill(0),2),o.byteLength!==e.ownerLength)throw new Error(`Owner must be ${e.ownerLength} bytes, but was incorrectly ${o.byteLength}`);E.set(o,2+e.signatureLength);let A=2+e.signatureLength+e.ownerLength;if(E[A]=i?1:0,i){if(i.byteLength!==32)throw new Error(`Target must be 32 bytes but was incorrectly ${i.byteLength}`);E.set(i,A+1)}let I=A+h,P=I+1;if(E[I]=c?1:0,c){if(P+=c.byteLength,c.byteLength!==32)throw new Error("Anchor must be 32 bytes");E.set(c,I+1)}E.set(jQ(r?.tags?.length??0),P);let N=jQ(b?.byteLength??0);E.set(N,P+8),b&&E.set(b,P+16);let L=P+g;return E.set(_,L),new A2(E)}var OI={..._te};globalThis.arbundles??=OI;var NEe=OI,CEe=OI;globalThis.Buffer||(globalThis.Buffer=gte.Buffer);var{DataItem:LEe}=bte;function DEe(t){return async({data:r,tags:o,target:i,anchor:h,createDataItem:c=v=>new LEe(v)})=>{let v=await t.signDataItem({data:r,tags:o,target:i,anchor:h}),b=c(gte.Buffer.from(v));return{id:await b.id,raw:await b.getRaw()}}}var $Ee=globalThis.GATEWAY_URL||void 0,qEe=globalThis.MU_URL||void 0,UEe=globalThis.CU_URL||void 0,FEe=globalThis.GRAPHQL_URL||void 0,{result:Eut,results:Aut,message:Rut,spawn:Tut,monitor:Iut,unmonitor:kut,dryrun:But,assign:Put}=Sl({GATEWAY_URL:$Ee,MU_URL:qEe,CU_URL:UEe,GRAPHQL_URL:FEe}),Rte=mte.createDataItemSigner;ie();ae();ne();var wre=mi(yre(),1),Nw=wre.default.init({host:"arweave.net",port:443,protocol:"https"});ie();ae();ne();ie();ae();ne();var Lf=class extends Error{constructor(e){super(e),this.name=this.constructor.name}},_re=class extends Lf{},Mre=class extends Lf{},xre=class extends Lf{constructor(e,r){super(`Failed request: ${e}: ${r}`)}},Sre=class extends Lf{},Cw=class extends Lf{},Ere=class extends Lf{constructor(){super("Invalid signer. Please provide a valid signer to interact with the contract.")}},Rl=class extends Lf{constructor(){super("Invalid contract configuration")}},Are=class extends Lf{constructor(){super("Invalid process configuration")}},Rre=class extends Lf{};ie();ae();ne();var Hf=mi(Wfe(),1);ie();ae();ne();var j4="3.7.1";var Vu=class t{logger;silent=!1;static default=new t;constructor({level:e="info"}={}){e==="none"&&(this.silent=!0),typeof window<"u"?this.logger=console:this.logger=(0,Hf.createLogger)({level:e,silent:this.silent,defaultMeta:{name:"ar-io-sdk",version:j4},format:Hf.format.combine(Hf.format.timestamp(),Hf.format.json()),transports:[new Hf.transports.Console({format:Hf.format.combine(Hf.format.timestamp(),Hf.format.json())})]})}info(e,...r){this.silent||this.logger.info(e,...r)}warn(e,...r){this.silent||this.logger.warn(e,...r)}error(e,...r){this.silent||this.logger.error(e,...r)}debug(e,...r){this.silent||this.logger.debug(e,...r)}setLogLevel(e){this.silent=e==="none","silent"in this.logger&&(this.logger.silent=e==="none"),"level"in this.logger&&(this.logger.level=e)}};ie();ae();ne();ie();ae();ne();var Vfe=t=>{let e=Object.entries(t).sort(([r,o],[i,h])=>r==="@"?-1:i==="@"?1:"priority"in o&&!("priority"in h)?-1:!("priority"in o)&&"priority"in h?1:o.priority!==void 0&&h.priority!==void 0?o.priority===h.priority?r<i?-1:r>i?1:0:o.priority-h.priority:r<i?-1:r>i?1:0);return Object.fromEntries(e.map(([r,o],i)=>[r,{...o,index:i}]))};ie();ae();ne();function Pl(t,e){let r=t.safeParse(e);if(!r.success)throw new Error(JSON.stringify(r.error.format(),null,2));return r}var z4=class{static init(e){return e!==void 0&&"signer"in e?new hP(e):new Z4(e)}},Z4=class{process;processId;strict;constructor(e){if(this.strict=e.strict||!1,mv(e))this.process=e.process;else if(gv(e))this.process=new Za({processId:e.processId});else throw new Rl;this.processId=this.process.processId}async getState({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"State"}],o=await this.process.read({tags:r});return e&&Pl(ST.passthrough().and(Qt.object({Records:Qt.record(Qt.string(),q8.passthrough())})),o),o}async getInfo({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"Info"}],o=await this.process.read({tags:r});return e&&Pl(gQ.passthrough(),o),o}async getLogo(){return(await this.getInfo()).Logo}async getRecord({undername:e},{strict:r}={strict:this.strict}){let o=[{name:"Sub-Domain",value:e},{name:"Action",value:"Record"}],i=await this.process.read({tags:o});return r&&Pl(q8.passthrough(),i),i}async getRecords({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"Records"}],o=await this.process.read({tags:r});return e&&Pl(_T,o),Vfe(o)}async getOwner({strict:e}={strict:this.strict}){return(await this.getInfo({strict:e})).Owner}async getControllers({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"Controllers"}],o=await this.process.read({tags:r});return e&&Pl(MT,o),o}async getName({strict:e}={strict:this.strict}){return(await this.getInfo({strict:e})).Name}async getTicker({strict:e}={strict:this.strict}){return(await this.getInfo({strict:e})).Ticker}async getBalances({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"Balances"}],o=await this.process.read({tags:r});return e&&Pl(xT,o),o}async getBalance({address:e},{strict:r}={strict:this.strict}){let o=[{name:"Action",value:"Balance"},{name:"Recipient",value:e}],i=await this.process.read({tags:o});return r&&Pl(Qt.number(),i),i}async getHandlers(){let e=await this.getInfo();return e.Handlers??e.HandlerNames}},hP=class extends Z4{signer;constructor({signer:e,...r}){super(r),this.signer=vv(e)}async transfer({target:e},r){let o=[...r?.tags??[],{name:"Action",value:"Transfer"},{name:"Recipient",value:e}];return this.process.send({tags:o,signer:this.signer})}async addController({controller:e},r){let o=[...r?.tags??[],{name:"Action",value:"Add-Controller"},{name:"Controller",value:e}];return this.process.send({tags:o,signer:this.signer})}async removeController({controller:e},r){let o=[...r?.tags??[],{name:"Action",value:"Remove-Controller"},{name:"Controller",value:e}];return this.process.send({tags:o,signer:this.signer})}async setRecord({undername:e,transactionId:r,ttlSeconds:o},i){return this.process.send({tags:[...i?.tags??[],{name:"Action",value:"Set-Record"},{name:"Sub-Domain",value:e},{name:"Transaction-Id",value:r},{name:"TTL-Seconds",value:o.toString()}],signer:this.signer})}async setBaseNameRecord({transactionId:e,ttlSeconds:r},o){return this.setRecord({transactionId:e,ttlSeconds:r,undername:"@"},o)}async setUndernameRecord({undername:e,transactionId:r,ttlSeconds:o},i){return this.setRecord({undername:e,transactionId:r,ttlSeconds:o},i)}async removeUndernameRecord({undername:e}){return this.removeRecord({undername:e})}async removeRecord({undername:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Remove-Record"},{name:"Sub-Domain",value:e}],signer:this.signer})}async setTicker({ticker:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Ticker"},{name:"Ticker",value:e}],signer:this.signer})}async setName({name:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Name"},{name:"Name",value:e}],signer:this.signer})}async setDescription({description:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Description"},{name:"Description",value:e}],signer:this.signer})}async setKeywords({keywords:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Keywords"},{name:"Keywords",value:JSON.stringify(e)}],signer:this.signer})}async setLogo({txId:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Logo"},{name:"Logo",value:e}],signer:this.signer})}async releaseName({name:e,arioProcessId:r},o){return this.process.send({tags:[...o?.tags??[],{name:"Action",value:"Release-Name"},{name:"Name",value:e},{name:"IO-Process-Id",value:r},{name:"ARIO-Process-Id",value:r}],signer:this.signer})}async reassignName({name:e,arioProcessId:r,antProcessId:o},i){return this.process.send({tags:[...i?.tags??[],{name:"Action",value:"Reassign-Name"},{name:"Name",value:e},{name:"IO-Process-Id",value:r},{name:"ARIO-Process-Id",value:r},{name:"Process-Id",value:o}],signer:this.signer})}async approvePrimaryNameRequest({name:e,address:r,arioProcessId:o},i){return this.process.send({tags:[...i?.tags??[],{name:"Action",value:"Approve-Primary-Name"},{name:"Name",value:e},{name:"Recipient",value:r},{name:"IO-Process-Id",value:o},{name:"ARIO-Process-Id",value:o}],signer:this.signer})}async removePrimaryNames({names:e,arioProcessId:r,notifyOwners:o=!1},i){return this.process.send({tags:[...i?.tags??[],{name:"Action",value:"Remove-Primary-Names"},{name:"Names",value:e.join(",")},{name:"IO-Process-Id",value:r},{name:"ARIO-Process-Id",value:r},{name:"Notify-Owners",value:o.toString()}],signer:this.signer})}};ie();ae();ne();var Eb=class{static init(e){return e!==void 0&&"signer"in e?new lP(e):new H4(e)}},H4=class{process;constructor(e){if(e===void 0||Object.keys(e).length===0)this.process=new Za({processId:$8});else if(mv(e))this.process=e.process;else if(gv(e))this.process=new Za({processId:e.processId});else throw new Rl}async accessControlList({address:e}){return this.process.read({tags:[{name:"Action",value:"Access-Control-List"},{name:"Address",value:e}]})}},lP=class extends H4{signer;constructor({signer:e,...r}){super(r),this.signer=vv(e)}async register({processId:e}){return this.process.send({tags:[{name:"Action",value:"Register"},{name:"Process-Id",value:e}],signer:this.signer})}};ie();ae();ne();ie();ae();ne();ie();ae();ne();cu();var Gfe="+",Yfe="/",Jfe="-",Xfe="_",Qfe="=";function oUe(t){let e=t.length%4;return e&&(t+=Qfe.repeat(4-e)),t.replaceAll(Jfe,Gfe).replaceAll(Xfe,Yfe)}function sUe(t){return t.replaceAll(Gfe,Jfe).replaceAll(Yfe,Xfe).replaceAll(Qfe,"")}function myt(t){let e=oUe(t);return Se.from(e,"base64")}function fUe(t){let e=t.toString("base64");return sUe(e)}function gyt(t){return fUe(cf("sha256").update(Uint8Array.from(t)).digest())}function eue(t=32){let e=oE(t);return Array.from(e,r=>r.toString(16).padStart(2,"0")).join("").slice(0,t)}ie();ae();ne();ie();ae();ne();function cP(t){try{return JSON.parse(t)}catch{return t}}ie();ae();ne();ie();ae();ne();var pP=mi(rue(),1);ie();ae();ne();var lUe=Object.defineProperty,cUe=(t,e,r)=>e in t?lUe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Rb=(t,e,r)=>(cUe(t,typeof e!="symbol"?e+"":e,r),r),vP=class{constructor(e){Rb(this,"value"),Rb(this,"next"),this.value=e}},mP=class{constructor(){Rb(this,"head"),Rb(this,"tail"),Rb(this,"_size",0),this.clear()}clear(){this.head=void 0,this.tail=void 0,this._size=0}push(e){let r=new vP(e);return this.head&&this.tail?(this.tail.next=r,this.tail=r):(this.head=r,this.tail=r),this._size++,this._size}pop(){if(!this.head)return;let e=this.head;return this.head=this.head.next,this._size--,e.value}get size(){return this._size}*[Symbol.iterator](){let e=this.head;for(;e;)yield e.value,e=e.next}};function iue(t){if(!((Number.isInteger(t)||t===1/0)&&t>0))throw new TypeError("Expected `concurrency` to be a number greater than 1");let e=new mP,r=0,o=()=>{r--,e.size>0&&e.pop()()},i=async(v,b,g)=>{r++;let _=(async()=>v(...g))();b(_);try{await _}catch{}o()},h=(v,b,g)=>{e.push(i.bind(null,v,b,g)),(async()=>(await Promise.resolve(),r<t&&e.size>0&&e.pop()()))()},c=(v,...b)=>new Promise(g=>{h(v,g,b)});return Object.defineProperties(c,{activeCount:{get:()=>r},pendingCount:{get:()=>e.size},clearQueue:{value:()=>{e.clear()}}}),c}var Vyt=async({address:t,registry:e=Eb.init()})=>{let r=await e.accessControlList({address:t});return[...new Set([...r.Owned,...r.Controlled])]};function nue(t,e){return new Promise((r,o)=>{let i=setTimeout(()=>{o(new Error("Timeout"))},t);e.then(h=>{clearTimeout(i),r(h)}).catch(h=>{clearTimeout(i),o(h)})})}var aue=class extends pP.default{contract;timeoutMs;throttle;logger;strict;antAoClient;constructor({contract:e=Tb.init({processId:Lh}),timeoutMs:r=6e4,concurrency:o=30,logger:i=Vu.default,strict:h=!1,antAoClient:c=Sl()}={}){super(),this.contract=e,this.timeoutMs=r,this.throttle=iue(o),this.logger=i,this.strict=h,this.antAoClient=c}async fetchProcessesOwnedByWallet({address:e,pageSize:r,antRegistry:o=Eb.init()}){let i={},h=await o.accessControlList({address:e}),c=new Set([...h.Owned,...h.Controlled]);await nue(this.timeoutMs,dUe({contract:this.contract,emitter:this,pageSize:r})).catch(b=>(this.emit("error",`Error getting ArNS records: ${b}`),this.logger.error("Error getting ArNS records",{message:b?.message,stack:b?.stack}),{})).then(b=>{Object.entries(b).forEach(([g,_])=>{c.has(_.processId)&&(i[_.processId]==null&&(i[_.processId]={state:void 0,names:{}}),i[_.processId].names[g]=_)})});let v=Object.keys(i).length;this.emit("progress",0,v),await Promise.all(Object.keys(i).map(async(b,g)=>this.throttle(async()=>{if(i[b].state!==void 0){this.emit("progress",g+1,v);return}let _=z4.init({process:new Za({processId:b,ao:this.antAoClient}),strict:this.strict}),M=await nue(this.timeoutMs,_.getState()).catch(x=>{this.emit("error",`Error getting state for process ${b}: ${x}`)});(M?.Owner===e||M?.Controllers.includes(e))&&(i[b].state=M,this.emit("process",b,i[b])),this.emit("progress",g+1,v)}))),this.emit("end",i)}},dUe=async({contract:t=Tb.init({processId:Lh}),emitter:e,logger:r=Vu.default,pageSize:o=1e3})=>{let i,h=Date.now(),c={};do{let v=await t.getArNSRecords({cursor:i,limit:o}).catch(b=>{r?.error("Error getting ArNS records",{message:b?.message,stack:b?.stack}),e?.emit("arns:error",`Error getting ArNS records: ${b}`)});if(!v)return{};v.items.forEach(b=>{let{name:g,..._}=b;c[g]=_}),r.debug("Fetched page of ArNS records",{totalRecordCount:v.totalItems,fetchedRecordCount:Object.keys(c).length,cursor:v.nextCursor}),e?.emit("arns:pageLoaded",{totalRecordCount:v.totalItems,fetchedRecordCount:Object.keys(c).length,records:v.items,cursor:v.nextCursor}),i=v.nextCursor}while(i!==void 0);return e?.emit("arns:end",c),r.debug("Fetched all ArNS records",{totalRecordCount:Object.keys(c).length,durationMs:Date.now()-h}),c};var Za=class{logger;ao;processId;constructor({processId:e,ao:r=Sl(),logger:o=Vu.default}){this.processId=e,this.logger=o,this.ao=r}isMessageDataEmpty(e){return e===void 0||e==="null"||e===""||e===null}async read({tags:e,retries:r=3,fromAddress:o}){let i=0,h;for(;i<r;)try{this.logger.debug("Evaluating read interaction on process",{tags:e,processId:this.processId});let c={process:this.processId,tags:e};o!==void 0&&(c.Owner=o);let v=await this.ao.dryrun(c);this.logger.debug("Read interaction result",{result:v,processId:this.processId});let b=gP(v);if(b!==void 0)throw new Error(b);if(v.Messages===void 0||v.Messages.length===0)throw this.logger.debug(`Process ${this.processId} does not support provided action.`,{result:v,tags:e,processId:this.processId}),new Error(`Process ${this.processId} does not support provided action.`);let g=v.Messages?.[0]?.Data;return this.isMessageDataEmpty(g)?void 0:cP(g)}catch(c){i++,this.logger.debug(`Read attempt ${i} failed`,{error:c?.message,stack:c?.stack,tags:e,processId:this.processId}),h=c,await new Promise(v=>setTimeout(v,2**i*1e3))}throw h}async send({tags:e,data:r,signer:o,retries:i=3}){let h=0,c;for(;h<i;)try{this.logger.debug("Evaluating send interaction on contract",{tags:e,data:r,processId:this.processId});let v=eue(32),b=await this.ao.message({process:this.processId,tags:[...e,{name:"AR-IO-SDK",value:j4}],data:r,signer:o,anchor:v});this.logger.debug("Sent message to process",{messageId:b,processId:this.processId,anchor:v});let g=await this.ao.result({message:b,process:this.processId});this.logger.debug("Message result",{output:g,messageId:b,processId:this.processId});let _=gP(g);if(_!==void 0)throw new Cw(_);if(g.Messages?.length===0||g.Messages===void 0)return{id:b};if(g.Messages.length===0)throw new Error(`Process ${this.processId} does not support provided action.`);if(this.isMessageDataEmpty(g.Messages[0].Data))return{id:b};let M=cP(g.Messages[0].Data);return this.logger.debug("Message result data",{resultData:M,messageId:b,processId:this.processId}),{id:b,result:M}}catch(v){if(this.logger.error("Error sending message to process",{error:v?.message,stack:v?.stack,processId:this.processId,tags:e}),v.message.includes("500"))this.logger.debug("Retrying send interaction",{attempts:h,retries:i,error:v?.message,processId:this.processId}),await new Promise(b=>setTimeout(b,2**h*2e3)),h++,c=v;else throw v}throw c}};var Tb=class{static init(e){return e!==void 0&&"signer"in e?new bP(e):new W4(e)}},W4=class{process;epochSettings;arweave;constructor(e){if(this.arweave=e?.arweave??Nw,e===void 0||Object.keys(e).length===0)this.process=new Za({processId:Lh});else if(mv(e))this.process=e.process;else if(gv(e))this.process=new Za({processId:e.processId});else throw new Rl}async getInfo(){return this.process.read({tags:[{name:"Action",value:"Info"}]})}async getTokenSupply(){return this.process.read({tags:[{name:"Action",value:"Total-Token-Supply"}]})}async computeEpochIndexForTimestamp(e){let r=await this.getEpochSettings(),o=r.epochZeroStartTimestamp,i=r.durationMs;return Math.floor((e-o)/i)}async computeCurrentEpochIndex(){let e=await this.getEpochSettings(),r=e.epochZeroStartTimestamp,o=e.durationMs,i=Date.now();return Math.floor((i-r)/o)}async computeEpochIndex(e){let r=e?.epochIndex;if(r!==void 0)return r;let o=e?.timestamp;if(o!==void 0)return this.computeEpochIndexForTimestamp(o)}async getEpochSettings(){return this.epochSettings??=await this.process.read({tags:[{name:"Action",value:"Epoch-Settings"}]})}async getEpoch(e){let r=await this.computeEpochIndex(e),o=await this.computeCurrentEpochIndex();if(r!==void 0&&r<o){let h=await Hd({arweave:this.arweave,epochIndex:r,processId:this.process.processId});return sue(h)}let i=[{name:"Action",value:"Epoch"},{name:"Epoch-Index",value:o.toString()}];return this.process.read({tags:yn(i)})}async getArNSRecord({name:e}){return this.process.read({tags:[{name:"Action",value:"Record"},{name:"Name",value:e}]})}async getArNSRecords(e){return this.process.read({tags:[{name:"Action",value:"Paginated-Records"},...Oa(e)]})}async getArNSReservedNames(e){return this.process.read({tags:[{name:"Action",value:"Reserved-Names"},...Oa(e)]})}async getArNSReservedName({name:e}){return this.process.read({tags:[{name:"Action",value:"Reserved-Name"},{name:"Name",value:e}]})}async getBalance({address:e}){return this.process.read({tags:[{name:"Action",value:"Balance"},{name:"Address",value:e}]})}async getBalances(e){return this.process.read({tags:[{name:"Action",value:"Paginated-Balances"},...Oa(e)]})}async getVault({address:e,vaultId:r}){return this.process.read({tags:[{name:"Action",value:"Vault"},{name:"Address",value:e},{name:"Vault-Id",value:r}]})}async getVaults(e){return this.process.read({tags:[{name:"Action",value:"Paginated-Vaults"},...Oa(e)]})}async getGateway({address:e}){return this.process.read({tags:[{name:"Action",value:"Gateway"},{name:"Address",value:e}]})}async getGatewayDelegates({address:e,...r}){return this.process.read({tags:[{name:"Action",value:"Paginated-Delegates"},{name:"Address",value:e},...Oa(r)]})}async getGatewayDelegateAllowList({address:e,...r}){return this.process.read({tags:[{name:"Action",value:"Paginated-Allowed-Delegates"},{name:"Address",value:e},...Oa(r)]})}async getGateways(e){return this.process.read({tags:[{name:"Action",value:"Paginated-Gateways"},...Oa(e)]})}async getCurrentEpoch(){return this.process.read({tags:[{name:"Action",value:"Epoch"}]})}async getPrescribedObservers(e){let r=await this.computeEpochIndex(e),o=await this.computeCurrentEpochIndex();if(r!==void 0&&r<o)return(await Hd({arweave:this.arweave,epochIndex:r,processId:this.process.processId}))?.prescribedObservers;let i=[{name:"Action",value:"Epoch-Prescribed-Observers"},{name:"Epoch-Index",value:o.toString()}];return this.process.read({tags:yn(i)})}async getPrescribedNames(e){let r=await this.computeEpochIndex(e),o=await this.computeCurrentEpochIndex();if(r!==void 0&&r<o)return(await Hd({arweave:this.arweave,epochIndex:r,processId:this.process.processId}))?.prescribedNames;let i=[{name:"Action",value:"Epoch-Prescribed-Names"},{name:"Epoch-Index",value:o.toString()}];return this.process.read({tags:yn(i)})}async getObservations(e){let r=await this.computeEpochIndex(e),o=await this.computeCurrentEpochIndex();if(r!==void 0&&r<o)return(await Hd({arweave:this.arweave,epochIndex:r,processId:this.process.processId}))?.observations;let i=[{name:"Action",value:"Epoch-Observations"},{name:"Epoch-Index",value:o.toString()}];return this.process.read({tags:yn(i)})}async getDistributions(e){let r=await this.computeEpochIndex(e),o=await this.computeCurrentEpochIndex();if(r!==void 0&&r<o)return(await Hd({arweave:this.arweave,epochIndex:r,processId:this.process.processId}))?.distributions;let i=[{name:"Action",value:"Epoch-Distributions"},{name:"Epoch-Index",value:o.toString()}];return this.process.read({tags:yn(i)})}async getEligibleEpochRewards(e,r){let o=await this.computeEpochIndex(e),i=await this.computeCurrentEpochIndex();if(o!==void 0&&o<i){let c=await Hd({arweave:this.arweave,epochIndex:o,processId:this.process.processId});return oue(c,r)}let h=[{name:"Action",value:"Epoch-Eligible-Rewards"},...Oa(r)];return this.process.read({tags:yn(h)})}async getTokenCost({intent:e,type:r,years:o,name:i,quantity:h,fromAddress:c}){let b=[{name:"Action",value:"Token-Cost"},{name:"Intent",value:e==="Buy-Record"?"Buy-Name":e},{name:"Name",value:i},{name:"Years",value:o?.toString()},{name:"Quantity",value:h?.toString()},{name:"Purchase-Type",value:r}];return this.process.read({tags:yn(b),fromAddress:c})}async getCostDetails({intent:e,type:r,years:o,name:i,quantity:h,fromAddress:c,fundFrom:v}){let g=[{name:"Action",value:"Cost-Details"},{name:"Intent",value:e==="Buy-Record"?"Buy-Name":e},{name:"Name",value:i},{name:"Years",value:o?.toString()},{name:"Quantity",value:h?.toString()},{name:"Purchase-Type",value:r},{name:"Fund-From",value:v}];return this.process.read({tags:yn(g),fromAddress:c})}async getRegistrationFees(){return this.process.read({tags:[{name:"Action",value:"Registration-Fees"}]})}async getDemandFactor(){return this.process.read({tags:[{name:"Action",value:"Demand-Factor"}]})}async getDemandFactorSettings(){return this.process.read({tags:[{name:"Action",value:"Demand-Factor-Settings"}]})}async getArNSReturnedNames(e){return this.process.read({tags:[{name:"Action",value:"Returned-Names"},...Oa(e)]})}async getArNSReturnedName({name:e}){let r=[{name:"Action",value:"Returned-Name"},{name:"Name",value:e}];return this.process.read({tags:r})}async getDelegations(e){let r=[{name:"Action",value:"Paginated-Delegations"},{name:"Address",value:e.address},...Oa(e)];return this.process.read({tags:yn(r)})}async getAllowedDelegates(e){return this.getGatewayDelegateAllowList(e)}async getGatewayVaults(e){return this.process.read({tags:[{name:"Action",value:"Paginated-Gateway-Vaults"},{name:"Address",value:e.address},...Oa(e)]})}async getPrimaryNameRequest(e){let r=[{name:"Action",value:"Primary-Name-Request"},{name:"Initiator",value:e.initiator}];return this.process.read({tags:r})}async getPrimaryNameRequests(e){return this.process.read({tags:[{name:"Action",value:"Primary-Name-Requests"},...Oa(e)]})}async getPrimaryName(e){let r=[{name:"Action",value:"Primary-Name"},{name:"Address",value:e?.address},{name:"Name",value:e?.name}];return this.process.read({tags:yn(r)})}async getPrimaryNames(e){return this.process.read({tags:[{name:"Action",value:"Primary-Names"},...Oa(e)]})}async getRedelegationFee(e){return this.process.read({tags:[{name:"Action",value:"Redelegation-Fee"},{name:"Address",value:e.address}]})}async getGatewayRegistrySettings(){return this.process.read({tags:[{name:"Action",value:"Gateway-Registry-Settings"}]})}async getAllDelegates(e){return this.process.read({tags:[{name:"Action",value:"All-Paginated-Delegates"},...Oa(e)]})}async getAllGatewayVaults(e){return this.process.read({tags:[{name:"Action",value:"All-Gateway-Vaults"},...Oa(e)]})}},bP=class extends W4{signer;constructor({signer:e,...r}){r===void 0?super({process:new Za({processId:Lh})}):super(r),this.signer=vv(e)}async transfer({target:e,qty:r},o){let{tags:i=[]}=o||{};return this.process.send({tags:[...i,{name:"Action",value:"Transfer"},{name:"Recipient",value:e},{name:"Quantity",value:r.valueOf().toString()}],signer:this.signer})}async vaultedTransfer({recipient:e,quantity:r,lockLengthMs:o,revokable:i=!1},h){let{tags:c=[]}=h||{};return this.process.send({tags:[...c,{name:"Action",value:"Vaulted-Transfer"},{name:"Recipient",value:e},{name:"Quantity",value:r.toString()},{name:"Lock-Length",value:o.toString()},{name:"Revokable",value:`${i}`}],signer:this.signer})}async revokeVault({vaultId:e,recipient:r},o){let{tags:i=[]}=o||{};return this.process.send({tags:[...i,{name:"Action",value:"Revoke-Vault"},{name:"Vault-Id",value:e},{name:"Recipient",value:r}],signer:this.signer})}async createVault({lockLengthMs:e,quantity:r},o){let{tags:i=[]}=o||{};return this.process.send({tags:[...i,{name:"Action",value:"Create-Vault"},{name:"Lock-Length",value:e.toString()},{name:"Quantity",value:r.toString()}],signer:this.signer})}async extendVault({vaultId:e,extendLengthMs:r},o){let{tags:i=[]}=o||{};return this.process.send({tags:[...i,{name:"Action",value:"Extend-Vault"},{name:"Vault-Id",value:e},{name:"Extend-Length",value:r.toString()}],signer:this.signer})}async increaseVault({vaultId:e,quantity:r},o){let{tags:i=[]}=o||{};return this.process.send({tags:[...i,{name:"Action",value:"Increase-Vault"},{name:"Vault-Id",value:e},{name:"Quantity",value:r.toString()}],signer:this.signer})}async joinNetwork({operatorStake:e,allowDelegatedStaking:r,allowedDelegates:o,delegateRewardShareRatio:i,fqdn:h,label:c,minDelegatedStake:v,note:b,port:g,properties:_,protocol:M,autoStake:x,observerAddress:E},A){let{tags:I=[]}=A||{},P=[...I,{name:"Action",value:"Join-Network"},{name:"Operator-Stake",value:e.valueOf().toString()},{name:"Allow-Delegated-Staking",value:r?.toString()},{name:"Allowed-Delegates",value:o?.join(",")},{name:"Delegate-Reward-Share-Ratio",value:i?.toString()},{name:"FQDN",value:h},{name:"Label",value:c},{name:"Min-Delegated-Stake",value:v?.valueOf().toString()},{name:"Note",value:b},{name:"Port",value:g?.toString()},{name:"Properties",value:_},{name:"Protocol",value:M},{name:"Auto-Stake",value:x?.toString()},{name:"Observer-Address",value:E}];return this.process.send({signer:this.signer,tags:yn(P)})}async leaveNetwork(e){let{tags:r=[]}=e||{};return this.process.send({signer:this.signer,tags:[...r,{name:"Action",value:"Leave-Network"}]})}async updateGatewaySettings({allowDelegatedStaking:e,allowedDelegates:r,delegateRewardShareRatio:o,fqdn:i,label:h,minDelegatedStake:c,note:v,port:b,properties:g,protocol:_,autoStake:M,observerAddress:x},E){let{tags:A=[]}=E||{},I=[...A,{name:"Action",value:"Update-Gateway-Settings"},{name:"Label",value:h},{name:"Note",value:v},{name:"FQDN",value:i},{name:"Port",value:b?.toString()},{name:"Properties",value:g},{name:"Protocol",value:_},{name:"Observer-Address",value:x},{name:"Allow-Delegated-Staking",value:e?.toString()},{name:"Allowed-Delegates",value:r?.join(",")},{name:"Delegate-Reward-Share-Ratio",value:o?.toString()},{name:"Min-Delegated-Stake",value:c?.valueOf().toString()},{name:"Auto-Stake",value:M?.toString()}];return this.process.send({signer:this.signer,tags:yn(I)})}async delegateStake(e,r){let{tags:o=[]}=r||{};return this.process.send({signer:this.signer,tags:[...o,{name:"Action",value:"Delegate-Stake"},{name:"Target",value:e.target},{name:"Quantity",value:e.stakeQty.valueOf().toString()}]})}async decreaseDelegateStake(e,r){let{tags:o=[]}=r||{};return this.process.send({signer:this.signer,tags:[...o,{name:"Action",value:"Decrease-Delegate-Stake"},{name:"Target",value:e.target},{name:"Quantity",value:e.decreaseQty.valueOf().toString()},{name:"Instant",value:`${e.instant||!1}`}]})}async instantWithdrawal(e,r){let{tags:o=[]}=r||{},i=[...o,{name:"Action",value:"Instant-Withdrawal"},{name:"Vault-Id",value:e.vaultId},{name:"Address",value:e.gatewayAddress}];return this.process.send({signer:this.signer,tags:yn(i)})}async increaseOperatorStake(e,r){let{tags:o=[]}=r||{};return this.process.send({signer:this.signer,tags:[...o,{name:"Action",value:"Increase-Operator-Stake"},{name:"Quantity",value:e.increaseQty.valueOf().toString()}]})}async decreaseOperatorStake(e,r){let{tags:o=[]}=r||{};return this.process.send({signer:this.signer,tags:[...o,{name:"Action",value:"Decrease-Operator-Stake"},{name:"Quantity",value:e.decreaseQty.valueOf().toString()},{name:"Instant",value:`${e.instant||!1}`}]})}async saveObservations(e,r){let{tags:o=[]}=r||{};return this.process.send({signer:this.signer,tags:[...o,{name:"Action",value:"Save-Observations"},{name:"Report-Tx-Id",value:e.reportTxId},{name:"Failed-Gateways",value:e.failedGateways.join(",")}]})}async buyRecord(e,r){let{tags:o=[]}=r||{},i=[...o,{name:"Action",value:"Buy-Name"},{name:"Name",value:e.name},{name:"Years",value:e.years?.toString()??"1"},{name:"Process-Id",value:e.processId},{name:"Purchase-Type",value:e.type||"lease"},{name:"Fund-From",value:e.fundFrom}];return this.process.send({signer:this.signer,tags:yn(i)})}async upgradeRecord(e,r){let{tags:o=[]}=r||{},i=[...o,{name:"Action",value:"Upgrade-Name"},{name:"Name",value:e.name},{name:"Fund-From",value:e.fundFrom}];return this.process.send({signer:this.signer,tags:yn(i)})}async extendLease(e,r){let{tags:o=[]}=r||{},i=[...o,{name:"Action",value:"Extend-Lease"},{name:"Name",value:e.name},{name:"Years",value:e.years.toString()},{name:"Fund-From",value:e.fundFrom}];return this.process.send({signer:this.signer,tags:yn(i)})}async increaseUndernameLimit(e,r){let{tags:o=[]}=r||{},i=[...o,{name:"Action",value:"Increase-Undername-Limit"},{name:"Name",value:e.name},{name:"Quantity",value:e.increaseCount.toString()},{name:"Fund-From",value:e.fundFrom}];return this.process.send({signer:this.signer,tags:yn(i)})}async cancelWithdrawal(e,r){let{tags:o=[]}=r||{},i=[...o,{name:"Action",value:"Cancel-Withdrawal"},{name:"Vault-Id",value:e.vaultId},{name:"Address",value:e.gatewayAddress}];return this.process.send({signer:this.signer,tags:yn(i)})}async requestPrimaryName(e,r){let{tags:o=[]}=r||{},i=[...o,{name:"Action",value:"Request-Primary-Name"},{name:"Name",value:e.name},{name:"Fund-From",value:e.fundFrom}];return this.process.send({signer:this.signer,tags:yn(i)})}async redelegateStake(e,r){let{tags:o=[]}=r||{},i=[...o,{name:"Action",value:"Redelegate-Stake"},{name:"Target",value:e.target},{name:"Source",value:e.source},{name:"Quantity",value:e.stakeQty.valueOf().toString()},{name:"Vault-Id",value:e.vaultId}];return this.process.send({signer:this.signer,tags:yn(i)})}};async function I3t({signer:t,module:e=hQ,ao:r=Sl(),scheduler:o=dQ,state:i,antRegistryId:h=$8,logger:c=Vu.default,authority:v=cQ}){let b=await r.spawn({module:e,scheduler:o,signer:t,data:i?JSON.stringify(i):void 0,tags:[{name:"Authority",value:v},{name:"ANT-Registry-Id",value:h}]});return c.debug("Spawned ANT",{processId:b,module:e,scheduler:o}),b}async function k3t({signer:t,processId:e,luaCodeTxId:r=lQ,ao:o=Sl(),logger:i=Vu.default,arweave:h=Nw}){let c=new Za({processId:e,ao:o,logger:i}),{api:{host:v,port:b,protocol:g}}=h.getConfig(),_=await fetch(`${g}://${v}:${b}/${r}`).then(x=>x.text()),{id:M}=await c.send({tags:[{name:"Action",value:"Eval"},{name:"App-Name",value:"ArNS-ANT"},{name:"Source-Code-TX-ID",value:r}],data:_,signer:t});return i.debug("Evolved ANT",{processId:e,luaCodeTxId:r,evalMsgId:M}),M}function pUe(t){let e=Qt.object({name:Qt.string(),value:Qt.union([Qt.string(),Qt.number()])}),r=Qt.function().args(Qt.object({data:Qt.union([Qt.string(),Qt.instanceof(Se)]),tags:Qt.array(e).optional(),target:Qt.string().optional(),anchor:Qt.string().optional()})).returns(Qt.promise(Qt.object({id:Qt.string(),raw:Qt.instanceof(ArrayBuffer)})));try{return r.parse(t),!0}catch{return!1}}function vv(t){return pUe(t)?t:"publicKey"in t?async({data:r,tags:o,target:i,anchor:h})=>{if(t.publicKey===void 0&&"setPublicKey"in t&&typeof t.setPublicKey=="function"&&await t.setPublicKey(),t instanceof ul){let b=await t.signer.signDataItem({data:r,tags:o,target:i,anchor:h}),g=new m1(Se.from(b));return{id:await g.id,raw:await g.getRaw()}}let c=Rg(r,t,{tags:o,target:i,anchor:h});return c.sign(t).then(async()=>({id:await c.id,raw:await c.getRaw()}))}:Rte(t)}var vUe="-k7t8xMoB8hW482609Z9F4bTFMC3MnuW8bTvTyT8pFI";function B3t({owner:t,targetId:e,ttlSeconds:r=3600,keywords:o=[],controllers:i=[],description:h="",ticker:c="aos",name:v="ANT"}){return{ticker:c,name:v,description:h,keywords:o,owner:t,controllers:[t,...i],balances:{[t]:1},records:{"@":{transactionId:e??vUe.toString(),ttlSeconds:r}}}}function uue(t){return Qt.object({startTimestamp:Qt.number(),startHeight:Qt.number(),distributions:Qt.any(),endTimestamp:Qt.number(),prescribedObservers:Qt.any(),prescribedNames:Qt.array(Qt.string()),observations:Qt.any(),epochIndex:Qt.number()}).parse(t)}function gP(t){let r=t.Error??t.Messages?.[0]?.Tags?.find(o=>o.name==="Error")?.value;if(r!==void 0){let o=r.match(/\[string "aos"]:(\d+):\s*(.+)/);if(o){let[,i,h]=o;return`${fue(h).trim()} (line ${i.trim()})`.trim()}return fue(r)}}function fue(t){let e="\x1B";return t.replace(new RegExp(`${e}[\\[\\]()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]`,"g"),"").trim()}var hue=t=>D8.test(t);function Z3t(t){return t!==void 0&&!isNaN(parseInt(t.toString()))}var yn=t=>t.filter(e=>e.value!==void 0&&e.value!==""),Oa=t=>{let e=[{name:"Cursor",value:t?.cursor?.toString()},{name:"Limit",value:t?.limit?.toString()},{name:"Sort-By",value:t?.sortBy?.toString()},{name:"Sort-Order",value:t?.sortOrder?.toString()}];return yn(e)},Hd=async({arweave:t,epochIndex:e,processId:r=Lh,retries:o=3,gqlUrl:i="https://arweave-search.goldsky.com/graphql"})=>{let h=mUe({epochIndex:e,processId:r});for(let c=0;c<o;c++)try{let v=await fetch(i,{method:"POST",body:h,headers:{"Content-Type":"application/json"}}).then(_=>_.json());if(v?.data?.transactions?.edges?.length===0)return;let b=v.data.transactions.edges[0].node.id,g=await t.api.get(b);return uue(g.data)}catch(v){if(c===o-1)throw v;await new Promise(b=>setTimeout(b,Math.pow(2,c)*1e3))}},mUe=({epochIndex:t,processId:e=Lh,authorities:r=["fcoN_xJeisVsPXA-trzVAuIiqO3ydLQxM-L4XbrQKzY"]})=>JSON.stringify({query:`
|
|
189
|
+
}`,i=_t.object({data:_t.object({transactions:_t.object({edges:_t.array(_t.object({node:_t.record(_t.any())}))})})});return h=>jr(h).chain(Li(c=>t(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:o,variables:{transactionIds:[c]}})}).then(async v=>{if(v.ok)return v.json();throw r('Error Encountered when querying gateway for transaction "%s"',c),new Error(`${v.status}: ${await v.text()}`)}).then(i.parse).then(hxe(["data","transactions","edges","0","node"])))).toPromise()}var _Se=oI(I5e(),1),cte=(t="@permaweb/aoconnect")=>{let e=(0,_Se.default)(t);return e.child=r=>cte(`${e.namespace}:${r}`),e.tap=(r,...o)=>gxe((...i)=>e(r,...o,...i)),e},dte=({url:t,path:e})=>e?e.startsWith("/")?dte({url:t,path:e.slice(1)}):(t=new URL(t),t.pathname+=e,t.toString()):t;function MSe(t){return j1(xw([]),F1((e,r)=>j1(dxe([],r.name),MI(r.value),Ds(r.name,Fh,e))(e),{}),_w(e=>e.length>1?e:e[0]))(t)}function Ns(t,e){return r=>Lee(MMe([$Q(t,"name"),SI(_I(e),$Q(e,"value"),bI)]),r)}function FQ(t){return Kee([[Wg(String),B1(t)],[Wg(Array),txe(t)],[bI,P9e]])}function Ad(t){let e;return Wg(Cs,t)?(e=new Error(xSe(t)),e.stack+=t.stack):Wg(Error,t)?e=t:XMe("message",t)?e=new Error(t.message):Wg(String,t)?e=new Error(t):e=new Error("An error occurred"),e}function xSe(t){return j1(e=>function r(o,i,h){return F1((c,v)=>j1(Kee([[B1(Tt.invalid_arguments),()=>r(v.argumentsError,422,"Invalid Arguments")],[B1(Tt.invalid_return_type),()=>r(v.returnTypeError,500,"Invalid Return")],[B1(Tt.invalid_union),()=>$Me(b=>r(b,400,"Invalid Union"),v.unionErrors)],[bI,()=>[{...v,status:i,contextCode:h}]]]),xI(c))(v.code),[],o.issues)}(e,400,""),e=>F1((r,o)=>{let{message:i,path:h,contextCode:c}=o,v=h[1]||h[0],b=c?`${c} `:"";return r.push(`${b}'${v}': ${i}.`),r},[],e),sxe(" | "))(t)}var SSe=_t.object({id:_t.string().min(1,{message:"message is required to be a message id"}),processId:_t.string().min(1,{message:"process is required to be a process id"})});function ESe(){return t=>jr(t).map(SSe.parse).map(()=>t)}var k2=_t.object({name:_t.string(),value:_t.string()}),ASe=_t.function().args(_t.object({Id:_t.string(),Target:_t.string(),Owner:_t.string(),Anchor:_t.string().optional(),Data:_t.any().default("1234"),Tags:_t.array(_t.object({name:_t.string(),value:_t.string()}))})).returns(_t.promise(_t.any())),RSe=_t.function().args(_t.object({id:_t.string().min(1,{message:"message id is required"}),processId:_t.string().min(1,{message:"process id is required"})})).returns(_t.promise(_t.any())),TSe=_t.function().args(_t.object({process:_t.string().min(1,{message:"process id is required"}),from:_t.string().optional(),to:_t.string().optional(),sort:_t.enum(["ASC","DESC"]).default("ASC"),limit:_t.number().optional()})).returns(_t.promise(_t.object({edges:_t.array(_t.object({cursor:_t.string(),node:_t.object({Output:_t.any().optional(),Messages:_t.array(_t.any()).optional(),Spawns:_t.array(_t.any()).optional(),Error:_t.any().optional()})}))}))),pte=_t.function().args(_t.object({processId:_t.string(),data:_t.any(),tags:_t.array(k2),anchor:_t.string().optional(),signer:_t.any()})).returns(_t.promise(_t.object({messageId:_t.string()}).passthrough())),ISe=_t.function().args(_t.object({data:_t.any(),tags:_t.array(k2),signer:_t.any()})).returns(_t.promise(_t.object({processId:_t.string()}).passthrough())),kSe=_t.function().args(_t.object({process:_t.string(),message:_t.string(),baseLayer:_t.boolean().optional(),exclude:_t.array(_t.string()).optional()})).returns(_t.promise(_t.object({assignmentId:_t.string()}).passthrough())),vte=pte,xut=_t.function().args(_t.object({suUrl:_t.string().url(),processId:_t.string()})).returns(_t.promise(_t.object({tags:_t.array(k2)}).passthrough())),Sut=_t.function().args(_t.string()).returns(_t.promise(_t.object({url:_t.string()}))),BSe=_t.function().args(_t.string()).returns(_t.promise(_t.boolean())),PSe=_t.function().args(_t.string()).returns(_t.promise(_t.object({tags:_t.array(k2)}).passthrough())),Sw=_t.function().args(_t.object({data:_t.any(),tags:_t.array(k2),target:_t.string().optional(),anchor:_t.string().optional()})).returns(_t.promise(_t.object({id:_t.string(),raw:_t.any()})));function OSe({loadResult:t}){return t=Li(RSe.implement(t)),e=>jr({id:e.id,processId:e.processId}).chain(t)}function NSe(t){let e=ESe(t),r=OSe(t);return({message:o,process:i})=>jr({id:o,processId:i}).chain(e).chain(r).map(t.logger.tap('readResult result for message "%s": %O',o)).map(h=>h).bimap(Ad,Ed).toPromise()}var CSe=_t.array(_t.object({name:_t.string(),value:_t.string()}));function LSe(){return t=>jr(t.tags).map(xw([])).map(Ns("Data-Protocol","ao")).map(Ns("Variant")).map(Ns("Type")).map(Ns("SDK")).map(xI(Fh,[{name:"Data-Protocol",value:"ao"},{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Message"},{name:"SDK",value:"aoconnect"}])).map(CSe.parse).map(Ds("tags",Fh,t))}function DSe({logger:t}){return e=>jr(e).chain(SI(_I(e.data),()=>_d(e),()=>_d(Math.random().toString().slice(-4)).map(Ds("data",Fh,e)).map(r=>j1(Sd("tags"),Ns("Content-Type"),MI({name:"Content-Type",value:"text/plain"}),Ds("tags",Fh,r))(r)).map(t.tap('added pseudo-random string as message "data"'))))}function $Se(t){let e=LSe(t),r=DSe(t),o=pte.implement(t.deployMessage);return i=>jr(i).chain(e).chain(r).chain(Li(({id:h,data:c,tags:v,anchor:b,signer:g})=>o({processId:h,data:c,tags:v,anchor:b,signer:Sw.implement(g)}))).map(h=>Ds("messageId",h.messageId,i))}function qSe(t){let e=$Se(t);return({process:r,data:o,tags:i,anchor:h,signer:c})=>jr({id:r,data:o,tags:i,anchor:h,signer:c}).chain(e).map(v=>v.messageId).bimap(Ad,Ed).toPromise()}var Dg=(t,e,r)=>o=>e(o[t])?_d(o):xl(`Tag '${t}': ${r}`);function USe({loadTransactionMeta:t,logger:e}){return t=Li(PSe.implement(t)),r=>jr(r).chain(t).map(Sd("tags")).map(MSe).chain(Dg("Data-Protocol",FQ("ao"),"value 'ao' was not found on module")).chain(Dg("Type",FQ("Module"),"value 'Module' was not found on module")).chain(Dg("Module-Format",BT,"was not found on module")).chain(Dg("Input-Encoding",BT,"was not found on module")).chain(Dg("Output-Encoding",BT,"was not found on module")).bimap(e.tap("Verifying module source failed: %s"),e.tap("Verified module source"))}function FSe({logger:t,validateScheduler:e}){return e=Li(BSe.implement(e)),r=>jr(r).chain(o=>e(o).chain(i=>i?_d(o):xl(`Valid Scheduler-Location owned by ${o} not found`))).bimap(t.tap("Verifying scheduler failed: %s"),t.tap("Verified scheduler"))}function jSe({logger:t}){return e=>jr(e).map(t.tap("Checking for signer")).chain(r=>r?_d(r):xl("signer not found"))}function zSe(t){let e=t.logger.child("verifyInput");t={...t,logger:e};let r=USe(t),o=FSe(t),i=jSe(t);return h=>jr(h).chain(c=>r(c.module).map(()=>c)).chain(c=>o(c.scheduler)).map(()=>h).chain(c=>i(c.signer).map(()=>c)).bimap(e.tap("Error when verify input: %s"),e.tap("Successfully verified inputs"))}var ZSe=_t.array(_t.object({name:_t.string(),value:_t.string()}));function HSe(){return t=>jr(t).map(Sd("tags")).map(xw([])).map(Ns("Data-Protocol","ao")).map(Ns("Variant")).map(Ns("Type")).map(Ns("Module")).map(Ns("Scheduler")).map(Ns("SDK")).map(xI(Fh,[{name:"Data-Protocol",value:"ao"},{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Process"},{name:"Module",value:t.module},{name:"Scheduler",value:t.scheduler},{name:"SDK",value:"aoconnect"}])).map(ZSe.parse).map(Ds("tags",Fh,t))}function KSe({logger:t}){return e=>jr(e).chain(SI(_I(e.data),()=>_d(e),()=>_d(Math.random().toString().slice(-4)).map(Ds("data",Fh,e)).map(r=>j1(Sd("tags"),Ns("Content-Type"),MI({name:"Content-Type",value:"text/plain"}),Ds("tags",Fh,r))(r)).map(t.tap('added pseudo-random string as process "data"'))))}function WSe(t){let e=t.logger.child("uploadProcess");t={...t,logger:e};let r=HSe(t),o=KSe(t),i=ISe.implement(t.deployProcess);return h=>jr(h).chain(r).chain(o).chain(Li(({data:c,tags:v,signer:b})=>i({data:c,tags:v,signer:Sw.implement(b)}))).map(c=>Ds("processId",c.processId,h))}function VSe(t){let e=zSe(t),r=WSe(t);return({module:o,scheduler:i,signer:h,tags:c,data:v})=>jr({module:o,scheduler:i,signer:h,tags:c,data:v}).chain(e).chain(r).map(b=>b.processId).bimap(Ad,Ed).toPromise()}function GSe(t){let e=vte.implement(t.deployMonitor);return r=>jr(r).chain(Li(({id:o,signer:i})=>e({processId:o,signer:Sw.implement(i),data:Math.random().toString().slice(-4),tags:[]}))).map(o=>Ds("monitorId",o.messageId,r))}function YSe(t){let e=GSe(t);return({process:r,signer:o})=>jr({id:r,signer:o}).chain(e).map(i=>i.monitorId).bimap(Ad,Ed).toPromise()}function JSe(t){let e=vte.implement(t.deployUnmonitor);return r=>jr(r).chain(Li(({id:o,signer:i})=>e({processId:o,signer:Sw.implement(i),data:Math.random().toString().slice(-4),tags:[]}))).map(o=>Ds("monitorId",o.messageId,r))}function XSe(t){let e=JSe(t);return({process:r,signer:o})=>jr({id:r,signer:o}).chain(e).map(i=>i.monitorId).bimap(Ad,Ed).toPromise()}var QSe=_t.object({process:_t.string().min(1,{message:"process identifier is required"}),from:_t.string().optional(),to:_t.string().optional(),sort:_t.enum(["ASC","DESC"]).default("ASC"),limit:_t.number().optional()});function eEe(){return t=>jr(t).map(QSe.parse).map(()=>t)}function tEe({queryResults:t}){return t=Li(TSe.implement(t)),e=>jr({process:e.process,from:e.from,to:e.to,sort:e.sort,limit:e.limit}).chain(t)}function rEe(t){let e=eEe(t),r=tEe(t);return({process:o,from:i,to:h,sort:c,limit:v})=>jr({process:o,from:i,to:h,sort:c,limit:v}).chain(e).chain(r).map(t.logger.tap('readResults result for message "%s": %O',o)).map(b=>b).bimap(Ad,Ed).toPromise()}var iEe=_t.object({Id:_t.string(),Target:_t.string(),Owner:_t.string(),Anchor:_t.string().optional(),Data:_t.any().default("1234"),Tags:_t.array(_t.object({name:_t.string(),value:_t.string()}))});function nEe(){return t=>jr(t).map(iEe.parse).map(e=>(e.Tags=e.Tags.concat([{name:"Data-Protocol",value:"ao"},{name:"Type",value:"Message"},{name:"Variant",value:"ao.TN.1"}]),e))}function aEe({dryrunFetch:t}){return Li(ASe.implement(t))}function oEe(t){let e=nEe(t),r=aEe(t);return o=>jr(o).map(sEe).chain(e).chain(r).toPromise()}function sEe({process:t,data:e,tags:r,anchor:o,...i}){return{Id:"1234",Owner:"1234",...i,Target:t,Data:e||"1234",Tags:r||[],Anchor:o||"0"}}function fEe(t){let e=kSe.implement(t.deployAssign);return r=>jr(r).chain(Li(({process:o,message:i,baseLayer:h,exclude:c})=>e({process:o,message:i,baseLayer:h,exclude:c}))).map(o=>Ds("assignmentId",o.assignmentId,r))}function uEe(t){let e=fEe(t);return({process:r,message:o,baseLayer:i,exclude:h})=>jr({process:r,message:o,baseLayer:i,exclude:h}).chain(e).map(c=>c.assignmentId).bimap(Ad,Ed).toPromise()}var hEe="https://arweave.net",lEe="https://mu.ao-testnet.xyz",cEe="https://cu.ao-testnet.xyz";function Sl({GRAPHQL_URL:t,GATEWAY_URL:e=hEe,MU_URL:r=lEe,CU_URL:o=cEe}={}){let i=cte();t||(t=dte({url:e,path:"/graphql"}));let{validate:h}=Pee({cacheSize:100,GRAPHQL_URL:t}),c=k9e({MAX_SIZE:25}),v=i.child("result"),b=NSe({loadResult:R9e({fetch,CU_URL:o,logger:v}),logger:v}),g=i.child("message"),_=qSe({loadProcessMeta:TT({fetch,cache:c,logger:g}),deployMessage:_9e({fetch,MU_URL:r,logger:g}),logger:g}),M=i.child("spawn"),x=VSe({loadTransactionMeta:wSe({fetch,GRAPHQL_URL:t,logger:M}),validateScheduler:h,deployProcess:M9e({fetch,MU_URL:r,logger:M}),logger:M}),E=i.child("monitor"),A=YSe({loadProcessMeta:TT({fetch,cache:c,logger:E}),deployMonitor:x9e({fetch,MU_URL:r,logger:E}),logger:E}),I=i.child("unmonitor"),P=XSe({loadProcessMeta:TT({fetch,cache:c,logger:I}),deployUnmonitor:S9e({fetch,MU_URL:r,logger:I}),logger:E}),N=i.child("results"),L=rEe({queryResults:T9e({fetch,CU_URL:o,logger:N}),logger:N}),C=i.child("dryrun"),Y=oEe({dryrunFetch:A9e({fetch,CU_URL:o,logger:C}),logger:C}),G=i.child("assign"),te=uEe({deployAssign:E9e({fetch,MU_URL:r,logger:G}),logger:g});return{result:b,results:L,message:_,spawn:x,monitor:A,unmonitor:P,dryrun:Y,assign:te}}var mte={};ZQ(mte,{createDataItemSigner:()=>DEe});var gte=oI(P5e(),1),bte={};ZQ(bte,{AVSCTap:()=>B2,ArweaveSigner:()=>II,DataItem:()=>A2,MAX_TAG_BYTES:()=>Ew,MIN_BINARY_SIZE:()=>PI,SIG_CONFIG:()=>W1,SignatureConfig:()=>Os,Signer:()=>Mte,createData:()=>Ate,default:()=>NEe,deserializeTags:()=>vw,indexToType:()=>kI,serializeTags:()=>BI,tagsExceedLimit:()=>Ete,warparbundles:()=>CEe});var dEe=Object.create,RI=Object.defineProperty,pEe=Object.getOwnPropertyDescriptor,vEe=Object.getOwnPropertyNames,mEe=Object.getPrototypeOf,gEe=Object.prototype.hasOwnProperty,zh=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),bEe=(t,e)=>{for(var r in e)RI(t,r,{get:e[r],enumerable:!0})},yEe=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of vEe(e))!gEe.call(t,i)&&i!==r&&RI(t,i,{get:()=>e[i],enumerable:!(o=pEe(e,i))||o.enumerable});return t},Rd=(t,e,r)=>(r=t!=null?dEe(mEe(t)):{},yEe(e||!t||!t.__esModule?RI(r,"default",{value:t,enumerable:!0}):r,t)),wEe=zh(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});function e(r){var o=4,i=r.length,h=i%o;if(!h)return r;var c=i,v=o-h,b=i+v,g=Se.alloc(b);for(g.write(r);v--;)g.write("=",c++);return g.toString()}t.default=e}),_Ee=zh(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=wEe();function r(b,g){return g===void 0&&(g="utf8"),Se.isBuffer(b)?h(b.toString("base64")):h(Se.from(b,g).toString("base64"))}function o(b,g){return g===void 0&&(g="utf8"),Se.from(i(b),"base64").toString(g)}function i(b){return b=b.toString(),e.default(b).replace(/\-/g,"+").replace(/_/g,"/")}function h(b){return b.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function c(b){return Se.from(i(b),"base64")}var v=r;v.encode=r,v.decode=o,v.toBase64=i,v.fromBase64=h,v.toBuffer=c,t.default=v}),TI=zh((t,e)=>{e.exports=_Ee().default,e.exports.default=e.exports}),yte=zh(t=>{"use strict";t.byteLength=b,t.toByteArray=_,t.fromByteArray=E;var e=[],r=[],o=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(h=0,c=i.length;h<c;++h)e[h]=i[h],r[i.charCodeAt(h)]=h;var h,c;r[45]=62,r[95]=63;function v(A){var I=A.length;if(I%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var P=A.indexOf("=");P===-1&&(P=I);var N=P===I?0:4-P%4;return[P,N]}function b(A){var I=v(A),P=I[0],N=I[1];return(P+N)*3/4-N}function g(A,I,P){return(I+P)*3/4-P}function _(A){var I,P=v(A),N=P[0],L=P[1],C=new o(g(A,N,L)),Y=0,G=L>0?N-4:N,te;for(te=0;te<G;te+=4)I=r[A.charCodeAt(te)]<<18|r[A.charCodeAt(te+1)]<<12|r[A.charCodeAt(te+2)]<<6|r[A.charCodeAt(te+3)],C[Y++]=I>>16&255,C[Y++]=I>>8&255,C[Y++]=I&255;return L===2&&(I=r[A.charCodeAt(te)]<<2|r[A.charCodeAt(te+1)]>>4,C[Y++]=I&255),L===1&&(I=r[A.charCodeAt(te)]<<10|r[A.charCodeAt(te+1)]<<4|r[A.charCodeAt(te+2)]>>2,C[Y++]=I>>8&255,C[Y++]=I&255),C}function M(A){return e[A>>18&63]+e[A>>12&63]+e[A>>6&63]+e[A&63]}function x(A,I,P){for(var N,L=[],C=I;C<P;C+=3)N=(A[C]<<16&16711680)+(A[C+1]<<8&65280)+(A[C+2]&255),L.push(M(N));return L.join("")}function E(A){for(var I,P=A.length,N=P%3,L=[],C=16383,Y=0,G=P-N;Y<G;Y+=C)L.push(x(A,Y,Y+C>G?G:Y+C));return N===1?(I=A[P-1],L.push(e[I>>2]+e[I<<4&63]+"==")):N===2&&(I=(A[P-2]<<8)+A[P-1],L.push(e[I>>10]+e[I>>4&63]+e[I<<2&63]+"=")),L.join("")}}),wte=zh(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.b64UrlDecode=t.b64UrlEncode=t.bufferTob64Url=t.bufferTob64=t.b64UrlToBuffer=t.stringToB64Url=t.stringToBuffer=t.bufferToString=t.b64UrlToString=t.concatBuffers=void 0;var e=yte();function r(x){let E=0;for(let P=0;P<x.length;P++)E+=x[P].byteLength;let A=new Uint8Array(E),I=0;A.set(new Uint8Array(x[0]),I),I+=x[0].byteLength;for(let P=1;P<x.length;P++)A.set(new Uint8Array(x[P]),I),I+=x[P].byteLength;return A}t.concatBuffers=r;function o(x){let E=v(x);return i(E)}t.b64UrlToString=o;function i(x){return new TextDecoder("utf-8",{fatal:!0}).decode(x)}t.bufferToString=i;function h(x){return new TextEncoder().encode(x)}t.stringToBuffer=h;function c(x){return g(h(x))}t.stringToB64Url=c;function v(x){return new Uint8Array(e.toByteArray(M(x)))}t.b64UrlToBuffer=v;function b(x){return e.fromByteArray(new Uint8Array(x))}t.bufferTob64=b;function g(x){return _(b(x))}t.bufferTob64Url=g;function _(x){return x.replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}t.b64UrlEncode=_;function M(x){x=x.replace(/\-/g,"+").replace(/\_/g,"/");let E;return x.length%4==0?E=0:E=4-x.length%4,x.concat("=".repeat(E))}t.b64UrlDecode=M}),MEe=zh(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=wte(),r=class{keyLength=4096;publicExponent=65537;hashAlgorithm="sha256";driver;constructor(){if(!this.detectWebCrypto())throw new Error("SubtleCrypto not available!");this.driver=crypto.subtle}async generateJWK(){let o=await this.driver.generateKey({name:"RSA-PSS",modulusLength:4096,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign"]),i=await this.driver.exportKey("jwk",o.privateKey);return{kty:i.kty,e:i.e,n:i.n,d:i.d,p:i.p,q:i.q,dp:i.dp,dq:i.dq,qi:i.qi}}async sign(o,i,{saltLength:h}={}){let c=await this.driver.sign({name:"RSA-PSS",saltLength:32},await this.jwkToCryptoKey(o),i);return new Uint8Array(c)}async hash(o,i="SHA-256"){let h=await this.driver.digest(i,o);return new Uint8Array(h)}async verify(o,i,h){let c={kty:"RSA",e:"AQAB",n:o},v=await this.jwkToPublicCryptoKey(c),b=await this.driver.digest("SHA-256",i),g=await this.driver.verify({name:"RSA-PSS",saltLength:0},v,h,i),_=await this.driver.verify({name:"RSA-PSS",saltLength:32},v,h,i),M=await this.driver.verify({name:"RSA-PSS",saltLength:Math.ceil((v.algorithm.modulusLength-1)/8)-b.byteLength-2},v,h,i);return g||_||M}async jwkToCryptoKey(o){return this.driver.importKey("jwk",o,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["sign"])}async jwkToPublicCryptoKey(o){return this.driver.importKey("jwk",o,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["verify"])}detectWebCrypto(){if(typeof crypto>"u")return!1;let o=crypto?.subtle;return o===void 0?!1:["generateKey","importKey","exportKey","digest","sign"].every(i=>typeof o[i]=="function")}async encrypt(o,i,h){let c=await this.driver.importKey("raw",typeof i=="string"?e.stringToBuffer(i):i,{name:"PBKDF2",length:32},!1,["deriveKey"]),v=await this.driver.deriveKey({name:"PBKDF2",salt:h?e.stringToBuffer(h):e.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},c,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),b=new Uint8Array(16);crypto.getRandomValues(b);let g=await this.driver.encrypt({name:"AES-CBC",iv:b},v,o);return e.concatBuffers([b,g])}async decrypt(o,i,h){let c=await this.driver.importKey("raw",typeof i=="string"?e.stringToBuffer(i):i,{name:"PBKDF2",length:32},!1,["deriveKey"]),v=await this.driver.deriveKey({name:"PBKDF2",salt:h?e.stringToBuffer(h):e.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},c,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),b=o.slice(0,16),g=await this.driver.decrypt({name:"AES-CBC",iv:b},v,o.slice(16));return e.concatBuffers([g])}};t.default=r}),xEe=zh(t=>{t.read=function(e,r,o,i,h){var c,v,b=h*8-i-1,g=(1<<b)-1,_=g>>1,M=-7,x=o?h-1:0,E=o?-1:1,A=e[r+x];for(x+=E,c=A&(1<<-M)-1,A>>=-M,M+=b;M>0;c=c*256+e[r+x],x+=E,M-=8);for(v=c&(1<<-M)-1,c>>=-M,M+=i;M>0;v=v*256+e[r+x],x+=E,M-=8);if(c===0)c=1-_;else{if(c===g)return v?NaN:(A?-1:1)*(1/0);v=v+Math.pow(2,i),c=c-_}return(A?-1:1)*v*Math.pow(2,c-i)},t.write=function(e,r,o,i,h,c){var v,b,g,_=c*8-h-1,M=(1<<_)-1,x=M>>1,E=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=i?0:c-1,I=i?1:-1,P=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(b=isNaN(r)?1:0,v=M):(v=Math.floor(Math.log(r)/Math.LN2),r*(g=Math.pow(2,-v))<1&&(v--,g*=2),v+x>=1?r+=E/g:r+=E*Math.pow(2,1-x),r*g>=2&&(v++,g/=2),v+x>=M?(b=0,v=M):v+x>=1?(b=(r*g-1)*Math.pow(2,h),v=v+x):(b=r*Math.pow(2,x-1)*Math.pow(2,h),v=0));h>=8;e[o+A]=b&255,A+=I,b/=256,h-=8);for(v=v<<h|b,_+=h;_>0;e[o+A]=v&255,A+=I,v/=256,_-=8);e[o+A-I]|=P*128}}),iI=zh(t=>{"use strict";var e=yte(),r=xEe(),o=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=v,t.SlowBuffer=L,t.INSPECT_MAX_BYTES=50;var i=2147483647;t.kMaxLength=i,v.TYPED_ARRAY_SUPPORT=h(),!v.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function h(){try{let T=new Uint8Array(1),k={foo:function(){return 42}};return Object.setPrototypeOf(k,Uint8Array.prototype),Object.setPrototypeOf(T,k),T.foo()===42}catch{return!1}}Object.defineProperty(v.prototype,"parent",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.buffer}}),Object.defineProperty(v.prototype,"offset",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.byteOffset}});function c(T){if(T>i)throw new RangeError('The value "'+T+'" is invalid for option "size"');let k=new Uint8Array(T);return Object.setPrototypeOf(k,v.prototype),k}function v(T,k,O){if(typeof T=="number"){if(typeof k=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return M(T)}return b(T,k,O)}v.poolSize=8192;function b(T,k,O){if(typeof T=="string")return x(T,k);if(ArrayBuffer.isView(T))return A(T);if(T==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T);if(ut(T,ArrayBuffer)||T&&ut(T.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ut(T,SharedArrayBuffer)||T&&ut(T.buffer,SharedArrayBuffer)))return I(T,k,O);if(typeof T=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let q=T.valueOf&&T.valueOf();if(q!=null&&q!==T)return v.from(q,k,O);let H=P(T);if(H)return H;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof T[Symbol.toPrimitive]=="function")return v.from(T[Symbol.toPrimitive]("string"),k,O);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T)}v.from=function(T,k,O){return b(T,k,O)},Object.setPrototypeOf(v.prototype,Uint8Array.prototype),Object.setPrototypeOf(v,Uint8Array);function g(T){if(typeof T!="number")throw new TypeError('"size" argument must be of type number');if(T<0)throw new RangeError('The value "'+T+'" is invalid for option "size"')}function _(T,k,O){return g(T),T<=0?c(T):k!==void 0?typeof O=="string"?c(T).fill(k,O):c(T).fill(k):c(T)}v.alloc=function(T,k,O){return _(T,k,O)};function M(T){return g(T),c(T<0?0:N(T)|0)}v.allocUnsafe=function(T){return M(T)},v.allocUnsafeSlow=function(T){return M(T)};function x(T,k){if((typeof k!="string"||k==="")&&(k="utf8"),!v.isEncoding(k))throw new TypeError("Unknown encoding: "+k);let O=C(T,k)|0,q=c(O),H=q.write(T,k);return H!==O&&(q=q.slice(0,H)),q}function E(T){let k=T.length<0?0:N(T.length)|0,O=c(k);for(let q=0;q<k;q+=1)O[q]=T[q]&255;return O}function A(T){if(ut(T,Uint8Array)){let k=new Uint8Array(T);return I(k.buffer,k.byteOffset,k.byteLength)}return E(T)}function I(T,k,O){if(k<0||T.byteLength<k)throw new RangeError('"offset" is outside of buffer bounds');if(T.byteLength<k+(O||0))throw new RangeError('"length" is outside of buffer bounds');let q;return k===void 0&&O===void 0?q=new Uint8Array(T):O===void 0?q=new Uint8Array(T,k):q=new Uint8Array(T,k,O),Object.setPrototypeOf(q,v.prototype),q}function P(T){if(v.isBuffer(T)){let k=N(T.length)|0,O=c(k);return O.length===0||T.copy(O,0,0,k),O}if(T.length!==void 0)return typeof T.length!="number"||Ae(T.length)?c(0):E(T);if(T.type==="Buffer"&&Array.isArray(T.data))return E(T.data)}function N(T){if(T>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return T|0}function L(T){return+T!=T&&(T=0),v.alloc(+T)}v.isBuffer=function(T){return T!=null&&T._isBuffer===!0&&T!==v.prototype},v.compare=function(T,k){if(ut(T,Uint8Array)&&(T=v.from(T,T.offset,T.byteLength)),ut(k,Uint8Array)&&(k=v.from(k,k.offset,k.byteLength)),!v.isBuffer(T)||!v.isBuffer(k))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(T===k)return 0;let O=T.length,q=k.length;for(let H=0,W=Math.min(O,q);H<W;++H)if(T[H]!==k[H]){O=T[H],q=k[H];break}return O<q?-1:q<O?1:0},v.isEncoding=function(T){switch(String(T).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},v.concat=function(T,k){if(!Array.isArray(T))throw new TypeError('"list" argument must be an Array of Buffers');if(T.length===0)return v.alloc(0);let O;if(k===void 0)for(k=0,O=0;O<T.length;++O)k+=T[O].length;let q=v.allocUnsafe(k),H=0;for(O=0;O<T.length;++O){let W=T[O];if(ut(W,Uint8Array))H+W.length>q.length?(v.isBuffer(W)||(W=v.from(W)),W.copy(q,H)):Uint8Array.prototype.set.call(q,W,H);else if(v.isBuffer(W))W.copy(q,H);else throw new TypeError('"list" argument must be an Array of Buffers');H+=W.length}return q};function C(T,k){if(v.isBuffer(T))return T.length;if(ArrayBuffer.isView(T)||ut(T,ArrayBuffer))return T.byteLength;if(typeof T!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof T);let O=T.length,q=arguments.length>2&&arguments[2]===!0;if(!q&&O===0)return 0;let H=!1;for(;;)switch(k){case"ascii":case"latin1":case"binary":return O;case"utf8":case"utf-8":return oe(T).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O*2;case"hex":return O>>>1;case"base64":return ge(T).length;default:if(H)return q?-1:oe(T).length;k=(""+k).toLowerCase(),H=!0}}v.byteLength=C;function Y(T,k,O){let q=!1;if((k===void 0||k<0)&&(k=0),k>this.length||((O===void 0||O>this.length)&&(O=this.length),O<=0)||(O>>>=0,k>>>=0,O<=k))return"";for(T||(T="utf8");;)switch(T){case"hex":return a(this,k,O);case"utf8":case"utf-8":return u(this,k,O);case"ascii":return y(this,k,O);case"latin1":case"binary":return d(this,k,O);case"base64":return f(this,k,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return p(this,k,O);default:if(q)throw new TypeError("Unknown encoding: "+T);T=(T+"").toLowerCase(),q=!0}}v.prototype._isBuffer=!0;function G(T,k,O){let q=T[k];T[k]=T[O],T[O]=q}v.prototype.swap16=function(){let T=this.length;if(T%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let k=0;k<T;k+=2)G(this,k,k+1);return this},v.prototype.swap32=function(){let T=this.length;if(T%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let k=0;k<T;k+=4)G(this,k,k+3),G(this,k+1,k+2);return this},v.prototype.swap64=function(){let T=this.length;if(T%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let k=0;k<T;k+=8)G(this,k,k+7),G(this,k+1,k+6),G(this,k+2,k+5),G(this,k+3,k+4);return this},v.prototype.toString=function(){let T=this.length;return T===0?"":arguments.length===0?u(this,0,T):Y.apply(this,arguments)},v.prototype.toLocaleString=v.prototype.toString,v.prototype.equals=function(T){if(!v.isBuffer(T))throw new TypeError("Argument must be a Buffer");return this===T?!0:v.compare(this,T)===0},v.prototype.inspect=function(){let T="",k=t.INSPECT_MAX_BYTES;return T=this.toString("hex",0,k).replace(/(.{2})/g,"$1 ").trim(),this.length>k&&(T+=" ... "),"<Buffer "+T+">"},o&&(v.prototype[o]=v.prototype.inspect),v.prototype.compare=function(T,k,O,q,H){if(ut(T,Uint8Array)&&(T=v.from(T,T.offset,T.byteLength)),!v.isBuffer(T))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof T);if(k===void 0&&(k=0),O===void 0&&(O=T?T.length:0),q===void 0&&(q=0),H===void 0&&(H=this.length),k<0||O>T.length||q<0||H>this.length)throw new RangeError("out of range index");if(q>=H&&k>=O)return 0;if(q>=H)return-1;if(k>=O)return 1;if(k>>>=0,O>>>=0,q>>>=0,H>>>=0,this===T)return 0;let W=H-q,se=O-k,st=Math.min(W,se),ue=this.slice(q,H),pe=T.slice(k,O);for(let ve=0;ve<st;++ve)if(ue[ve]!==pe[ve]){W=ue[ve],se=pe[ve];break}return W<se?-1:se<W?1:0};function te(T,k,O,q,H){if(T.length===0)return-1;if(typeof O=="string"?(q=O,O=0):O>2147483647?O=2147483647:O<-2147483648&&(O=-2147483648),O=+O,Ae(O)&&(O=H?0:T.length-1),O<0&&(O=T.length+O),O>=T.length){if(H)return-1;O=T.length-1}else if(O<0)if(H)O=0;else return-1;if(typeof k=="string"&&(k=v.from(k,q)),v.isBuffer(k))return k.length===0?-1:$(T,k,O,q,H);if(typeof k=="number")return k=k&255,typeof Uint8Array.prototype.indexOf=="function"?H?Uint8Array.prototype.indexOf.call(T,k,O):Uint8Array.prototype.lastIndexOf.call(T,k,O):$(T,[k],O,q,H);throw new TypeError("val must be string, number or Buffer")}function $(T,k,O,q,H){let W=1,se=T.length,st=k.length;if(q!==void 0&&(q=String(q).toLowerCase(),q==="ucs2"||q==="ucs-2"||q==="utf16le"||q==="utf-16le")){if(T.length<2||k.length<2)return-1;W=2,se/=2,st/=2,O/=2}function ue(ve,be){return W===1?ve[be]:ve.readUInt16BE(be*W)}let pe;if(H){let ve=-1;for(pe=O;pe<se;pe++)if(ue(T,pe)===ue(k,ve===-1?0:pe-ve)){if(ve===-1&&(ve=pe),pe-ve+1===st)return ve*W}else ve!==-1&&(pe-=pe-ve),ve=-1}else for(O+st>se&&(O=se-st),pe=O;pe>=0;pe--){let ve=!0;for(let be=0;be<st;be++)if(ue(T,pe+be)!==ue(k,be)){ve=!1;break}if(ve)return pe}return-1}v.prototype.includes=function(T,k,O){return this.indexOf(T,k,O)!==-1},v.prototype.indexOf=function(T,k,O){return te(this,T,k,O,!0)},v.prototype.lastIndexOf=function(T,k,O){return te(this,T,k,O,!1)};function F(T,k,O,q){O=Number(O)||0;let H=T.length-O;q?(q=Number(q),q>H&&(q=H)):q=H;let W=k.length;q>W/2&&(q=W/2);let se;for(se=0;se<q;++se){let st=parseInt(k.substr(se*2,2),16);if(Ae(st))return se;T[O+se]=st}return se}function V(T,k,O,q){return xe(oe(k,T.length-O),T,O,q)}function w(T,k,O,q){return xe(le(k),T,O,q)}function n(T,k,O,q){return xe(ge(k),T,O,q)}function s(T,k,O,q){return xe(ot(k,T.length-O),T,O,q)}v.prototype.write=function(T,k,O,q){if(k===void 0)q="utf8",O=this.length,k=0;else if(O===void 0&&typeof k=="string")q=k,O=this.length,k=0;else if(isFinite(k))k=k>>>0,isFinite(O)?(O=O>>>0,q===void 0&&(q="utf8")):(q=O,O=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let H=this.length-k;if((O===void 0||O>H)&&(O=H),T.length>0&&(O<0||k<0)||k>this.length)throw new RangeError("Attempt to write outside buffer bounds");q||(q="utf8");let W=!1;for(;;)switch(q){case"hex":return F(this,T,k,O);case"utf8":case"utf-8":return V(this,T,k,O);case"ascii":case"latin1":case"binary":return w(this,T,k,O);case"base64":return n(this,T,k,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s(this,T,k,O);default:if(W)throw new TypeError("Unknown encoding: "+q);q=(""+q).toLowerCase(),W=!0}},v.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function f(T,k,O){return k===0&&O===T.length?e.fromByteArray(T):e.fromByteArray(T.slice(k,O))}function u(T,k,O){O=Math.min(T.length,O);let q=[],H=k;for(;H<O;){let W=T[H],se=null,st=W>239?4:W>223?3:W>191?2:1;if(H+st<=O){let ue,pe,ve,be;switch(st){case 1:W<128&&(se=W);break;case 2:ue=T[H+1],(ue&192)===128&&(be=(W&31)<<6|ue&63,be>127&&(se=be));break;case 3:ue=T[H+1],pe=T[H+2],(ue&192)===128&&(pe&192)===128&&(be=(W&15)<<12|(ue&63)<<6|pe&63,be>2047&&(be<55296||be>57343)&&(se=be));break;case 4:ue=T[H+1],pe=T[H+2],ve=T[H+3],(ue&192)===128&&(pe&192)===128&&(ve&192)===128&&(be=(W&15)<<18|(ue&63)<<12|(pe&63)<<6|ve&63,be>65535&&be<1114112&&(se=be))}}se===null?(se=65533,st=1):se>65535&&(se-=65536,q.push(se>>>10&1023|55296),se=56320|se&1023),q.push(se),H+=st}return m(q)}var l=4096;function m(T){let k=T.length;if(k<=l)return String.fromCharCode.apply(String,T);let O="",q=0;for(;q<k;)O+=String.fromCharCode.apply(String,T.slice(q,q+=l));return O}function y(T,k,O){let q="";O=Math.min(T.length,O);for(let H=k;H<O;++H)q+=String.fromCharCode(T[H]&127);return q}function d(T,k,O){let q="";O=Math.min(T.length,O);for(let H=k;H<O;++H)q+=String.fromCharCode(T[H]);return q}function a(T,k,O){let q=T.length;(!k||k<0)&&(k=0),(!O||O<0||O>q)&&(O=q);let H="";for(let W=k;W<O;++W)H+=Ge[T[W]];return H}function p(T,k,O){let q=T.slice(k,O),H="";for(let W=0;W<q.length-1;W+=2)H+=String.fromCharCode(q[W]+q[W+1]*256);return H}v.prototype.slice=function(T,k){let O=this.length;T=~~T,k=k===void 0?O:~~k,T<0?(T+=O,T<0&&(T=0)):T>O&&(T=O),k<0?(k+=O,k<0&&(k=0)):k>O&&(k=O),k<T&&(k=T);let q=this.subarray(T,k);return Object.setPrototypeOf(q,v.prototype),q};function R(T,k,O){if(T%1!==0||T<0)throw new RangeError("offset is not uint");if(T+k>O)throw new RangeError("Trying to access beyond buffer length")}v.prototype.readUintLE=v.prototype.readUIntLE=function(T,k,O){T=T>>>0,k=k>>>0,O||R(T,k,this.length);let q=this[T],H=1,W=0;for(;++W<k&&(H*=256);)q+=this[T+W]*H;return q},v.prototype.readUintBE=v.prototype.readUIntBE=function(T,k,O){T=T>>>0,k=k>>>0,O||R(T,k,this.length);let q=this[T+--k],H=1;for(;k>0&&(H*=256);)q+=this[T+--k]*H;return q},v.prototype.readUint8=v.prototype.readUInt8=function(T,k){return T=T>>>0,k||R(T,1,this.length),this[T]},v.prototype.readUint16LE=v.prototype.readUInt16LE=function(T,k){return T=T>>>0,k||R(T,2,this.length),this[T]|this[T+1]<<8},v.prototype.readUint16BE=v.prototype.readUInt16BE=function(T,k){return T=T>>>0,k||R(T,2,this.length),this[T]<<8|this[T+1]},v.prototype.readUint32LE=v.prototype.readUInt32LE=function(T,k){return T=T>>>0,k||R(T,4,this.length),(this[T]|this[T+1]<<8|this[T+2]<<16)+this[T+3]*16777216},v.prototype.readUint32BE=v.prototype.readUInt32BE=function(T,k){return T=T>>>0,k||R(T,4,this.length),this[T]*16777216+(this[T+1]<<16|this[T+2]<<8|this[T+3])},v.prototype.readBigUInt64LE=lt(function(T){T=T>>>0,J(T,"offset");let k=this[T],O=this[T+7];(k===void 0||O===void 0)&&X(T,this.length-8);let q=k+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24,H=this[++T]+this[++T]*2**8+this[++T]*2**16+O*2**24;return BigInt(q)+(BigInt(H)<<BigInt(32))}),v.prototype.readBigUInt64BE=lt(function(T){T=T>>>0,J(T,"offset");let k=this[T],O=this[T+7];(k===void 0||O===void 0)&&X(T,this.length-8);let q=k*2**24+this[++T]*2**16+this[++T]*2**8+this[++T],H=this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+O;return(BigInt(q)<<BigInt(32))+BigInt(H)}),v.prototype.readIntLE=function(T,k,O){T=T>>>0,k=k>>>0,O||R(T,k,this.length);let q=this[T],H=1,W=0;for(;++W<k&&(H*=256);)q+=this[T+W]*H;return H*=128,q>=H&&(q-=Math.pow(2,8*k)),q},v.prototype.readIntBE=function(T,k,O){T=T>>>0,k=k>>>0,O||R(T,k,this.length);let q=k,H=1,W=this[T+--q];for(;q>0&&(H*=256);)W+=this[T+--q]*H;return H*=128,W>=H&&(W-=Math.pow(2,8*k)),W},v.prototype.readInt8=function(T,k){return T=T>>>0,k||R(T,1,this.length),this[T]&128?(255-this[T]+1)*-1:this[T]},v.prototype.readInt16LE=function(T,k){T=T>>>0,k||R(T,2,this.length);let O=this[T]|this[T+1]<<8;return O&32768?O|4294901760:O},v.prototype.readInt16BE=function(T,k){T=T>>>0,k||R(T,2,this.length);let O=this[T+1]|this[T]<<8;return O&32768?O|4294901760:O},v.prototype.readInt32LE=function(T,k){return T=T>>>0,k||R(T,4,this.length),this[T]|this[T+1]<<8|this[T+2]<<16|this[T+3]<<24},v.prototype.readInt32BE=function(T,k){return T=T>>>0,k||R(T,4,this.length),this[T]<<24|this[T+1]<<16|this[T+2]<<8|this[T+3]},v.prototype.readBigInt64LE=lt(function(T){T=T>>>0,J(T,"offset");let k=this[T],O=this[T+7];(k===void 0||O===void 0)&&X(T,this.length-8);let q=this[T+4]+this[T+5]*2**8+this[T+6]*2**16+(O<<24);return(BigInt(q)<<BigInt(32))+BigInt(k+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24)}),v.prototype.readBigInt64BE=lt(function(T){T=T>>>0,J(T,"offset");let k=this[T],O=this[T+7];(k===void 0||O===void 0)&&X(T,this.length-8);let q=(k<<24)+this[++T]*2**16+this[++T]*2**8+this[++T];return(BigInt(q)<<BigInt(32))+BigInt(this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+O)}),v.prototype.readFloatLE=function(T,k){return T=T>>>0,k||R(T,4,this.length),r.read(this,T,!0,23,4)},v.prototype.readFloatBE=function(T,k){return T=T>>>0,k||R(T,4,this.length),r.read(this,T,!1,23,4)},v.prototype.readDoubleLE=function(T,k){return T=T>>>0,k||R(T,8,this.length),r.read(this,T,!0,52,8)},v.prototype.readDoubleBE=function(T,k){return T=T>>>0,k||R(T,8,this.length),r.read(this,T,!1,52,8)};function S(T,k,O,q,H,W){if(!v.isBuffer(T))throw new TypeError('"buffer" argument must be a Buffer instance');if(k>H||k<W)throw new RangeError('"value" argument is out of bounds');if(O+q>T.length)throw new RangeError("Index out of range")}v.prototype.writeUintLE=v.prototype.writeUIntLE=function(T,k,O,q){if(T=+T,k=k>>>0,O=O>>>0,!q){let se=Math.pow(2,8*O)-1;S(this,T,k,O,se,0)}let H=1,W=0;for(this[k]=T&255;++W<O&&(H*=256);)this[k+W]=T/H&255;return k+O},v.prototype.writeUintBE=v.prototype.writeUIntBE=function(T,k,O,q){if(T=+T,k=k>>>0,O=O>>>0,!q){let se=Math.pow(2,8*O)-1;S(this,T,k,O,se,0)}let H=O-1,W=1;for(this[k+H]=T&255;--H>=0&&(W*=256);)this[k+H]=T/W&255;return k+O},v.prototype.writeUint8=v.prototype.writeUInt8=function(T,k,O){return T=+T,k=k>>>0,O||S(this,T,k,1,255,0),this[k]=T&255,k+1},v.prototype.writeUint16LE=v.prototype.writeUInt16LE=function(T,k,O){return T=+T,k=k>>>0,O||S(this,T,k,2,65535,0),this[k]=T&255,this[k+1]=T>>>8,k+2},v.prototype.writeUint16BE=v.prototype.writeUInt16BE=function(T,k,O){return T=+T,k=k>>>0,O||S(this,T,k,2,65535,0),this[k]=T>>>8,this[k+1]=T&255,k+2},v.prototype.writeUint32LE=v.prototype.writeUInt32LE=function(T,k,O){return T=+T,k=k>>>0,O||S(this,T,k,4,4294967295,0),this[k+3]=T>>>24,this[k+2]=T>>>16,this[k+1]=T>>>8,this[k]=T&255,k+4},v.prototype.writeUint32BE=v.prototype.writeUInt32BE=function(T,k,O){return T=+T,k=k>>>0,O||S(this,T,k,4,4294967295,0),this[k]=T>>>24,this[k+1]=T>>>16,this[k+2]=T>>>8,this[k+3]=T&255,k+4};function B(T,k,O,q,H){j(k,q,H,T,O,7);let W=Number(k&BigInt(4294967295));T[O++]=W,W=W>>8,T[O++]=W,W=W>>8,T[O++]=W,W=W>>8,T[O++]=W;let se=Number(k>>BigInt(32)&BigInt(4294967295));return T[O++]=se,se=se>>8,T[O++]=se,se=se>>8,T[O++]=se,se=se>>8,T[O++]=se,O}function U(T,k,O,q,H){j(k,q,H,T,O,7);let W=Number(k&BigInt(4294967295));T[O+7]=W,W=W>>8,T[O+6]=W,W=W>>8,T[O+5]=W,W=W>>8,T[O+4]=W;let se=Number(k>>BigInt(32)&BigInt(4294967295));return T[O+3]=se,se=se>>8,T[O+2]=se,se=se>>8,T[O+1]=se,se=se>>8,T[O]=se,O+8}v.prototype.writeBigUInt64LE=lt(function(T,k=0){return B(this,T,k,BigInt(0),BigInt("0xffffffffffffffff"))}),v.prototype.writeBigUInt64BE=lt(function(T,k=0){return U(this,T,k,BigInt(0),BigInt("0xffffffffffffffff"))}),v.prototype.writeIntLE=function(T,k,O,q){if(T=+T,k=k>>>0,!q){let st=Math.pow(2,8*O-1);S(this,T,k,O,st-1,-st)}let H=0,W=1,se=0;for(this[k]=T&255;++H<O&&(W*=256);)T<0&&se===0&&this[k+H-1]!==0&&(se=1),this[k+H]=(T/W>>0)-se&255;return k+O},v.prototype.writeIntBE=function(T,k,O,q){if(T=+T,k=k>>>0,!q){let st=Math.pow(2,8*O-1);S(this,T,k,O,st-1,-st)}let H=O-1,W=1,se=0;for(this[k+H]=T&255;--H>=0&&(W*=256);)T<0&&se===0&&this[k+H+1]!==0&&(se=1),this[k+H]=(T/W>>0)-se&255;return k+O},v.prototype.writeInt8=function(T,k,O){return T=+T,k=k>>>0,O||S(this,T,k,1,127,-128),T<0&&(T=255+T+1),this[k]=T&255,k+1},v.prototype.writeInt16LE=function(T,k,O){return T=+T,k=k>>>0,O||S(this,T,k,2,32767,-32768),this[k]=T&255,this[k+1]=T>>>8,k+2},v.prototype.writeInt16BE=function(T,k,O){return T=+T,k=k>>>0,O||S(this,T,k,2,32767,-32768),this[k]=T>>>8,this[k+1]=T&255,k+2},v.prototype.writeInt32LE=function(T,k,O){return T=+T,k=k>>>0,O||S(this,T,k,4,2147483647,-2147483648),this[k]=T&255,this[k+1]=T>>>8,this[k+2]=T>>>16,this[k+3]=T>>>24,k+4},v.prototype.writeInt32BE=function(T,k,O){return T=+T,k=k>>>0,O||S(this,T,k,4,2147483647,-2147483648),T<0&&(T=4294967295+T+1),this[k]=T>>>24,this[k+1]=T>>>16,this[k+2]=T>>>8,this[k+3]=T&255,k+4},v.prototype.writeBigInt64LE=lt(function(T,k=0){return B(this,T,k,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),v.prototype.writeBigInt64BE=lt(function(T,k=0){return U(this,T,k,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function D(T,k,O,q,H,W){if(O+q>T.length)throw new RangeError("Index out of range");if(O<0)throw new RangeError("Index out of range")}function re(T,k,O,q,H){return k=+k,O=O>>>0,H||D(T,k,O,4,34028234663852886e22,-34028234663852886e22),r.write(T,k,O,q,23,4),O+4}v.prototype.writeFloatLE=function(T,k,O){return re(this,T,k,!0,O)},v.prototype.writeFloatBE=function(T,k,O){return re(this,T,k,!1,O)};function Q(T,k,O,q,H){return k=+k,O=O>>>0,H||D(T,k,O,8,17976931348623157e292,-17976931348623157e292),r.write(T,k,O,q,52,8),O+8}v.prototype.writeDoubleLE=function(T,k,O){return Q(this,T,k,!0,O)},v.prototype.writeDoubleBE=function(T,k,O){return Q(this,T,k,!1,O)},v.prototype.copy=function(T,k,O,q){if(!v.isBuffer(T))throw new TypeError("argument should be a Buffer");if(O||(O=0),!q&&q!==0&&(q=this.length),k>=T.length&&(k=T.length),k||(k=0),q>0&&q<O&&(q=O),q===O||T.length===0||this.length===0)return 0;if(k<0)throw new RangeError("targetStart out of bounds");if(O<0||O>=this.length)throw new RangeError("Index out of range");if(q<0)throw new RangeError("sourceEnd out of bounds");q>this.length&&(q=this.length),T.length-k<q-O&&(q=T.length-k+O);let H=q-O;return this===T&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(k,O,q):Uint8Array.prototype.set.call(T,this.subarray(O,q),k),H},v.prototype.fill=function(T,k,O,q){if(typeof T=="string"){if(typeof k=="string"?(q=k,k=0,O=this.length):typeof O=="string"&&(q=O,O=this.length),q!==void 0&&typeof q!="string")throw new TypeError("encoding must be a string");if(typeof q=="string"&&!v.isEncoding(q))throw new TypeError("Unknown encoding: "+q);if(T.length===1){let W=T.charCodeAt(0);(q==="utf8"&&W<128||q==="latin1")&&(T=W)}}else typeof T=="number"?T=T&255:typeof T=="boolean"&&(T=Number(T));if(k<0||this.length<k||this.length<O)throw new RangeError("Out of range index");if(O<=k)return this;k=k>>>0,O=O===void 0?this.length:O>>>0,T||(T=0);let H;if(typeof T=="number")for(H=k;H<O;++H)this[H]=T;else{let W=v.isBuffer(T)?T:v.from(T,q),se=W.length;if(se===0)throw new TypeError('The value "'+T+'" is invalid for argument "value"');for(H=0;H<O-k;++H)this[H+k]=W[H%se]}return this};var Z={};function K(T,k,O){Z[T]=class extends O{constructor(){super(),Object.defineProperty(this,"message",{value:k.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${T}]`,this.stack,delete this.name}get code(){return T}set code(q){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:q,writable:!0})}toString(){return`${this.name} [${T}]: ${this.message}`}}}K("ERR_BUFFER_OUT_OF_BOUNDS",function(T){return T?`${T} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),K("ERR_INVALID_ARG_TYPE",function(T,k){return`The "${T}" argument must be of type number. Received type ${typeof k}`},TypeError),K("ERR_OUT_OF_RANGE",function(T,k,O){let q=`The value of "${T}" is out of range.`,H=O;return Number.isInteger(O)&&Math.abs(O)>2**32?H=ce(String(O)):typeof O=="bigint"&&(H=String(O),(O>BigInt(2)**BigInt(32)||O<-(BigInt(2)**BigInt(32)))&&(H=ce(H)),H+="n"),q+=` It must be ${k}. Received ${H}`,q},RangeError);function ce(T){let k="",O=T.length,q=T[0]==="-"?1:0;for(;O>=q+4;O-=3)k=`_${T.slice(O-3,O)}${k}`;return`${T.slice(0,O)}${k}`}function ee(T,k,O){J(k,"offset"),(T[k]===void 0||T[k+O]===void 0)&&X(k,T.length-(O+1))}function j(T,k,O,q,H,W){if(T>O||T<k){let se=typeof k=="bigint"?"n":"",st;throw W>3?k===0||k===BigInt(0)?st=`>= 0${se} and < 2${se} ** ${(W+1)*8}${se}`:st=`>= -(2${se} ** ${(W+1)*8-1}${se}) and < 2 ** ${(W+1)*8-1}${se}`:st=`>= ${k}${se} and <= ${O}${se}`,new Z.ERR_OUT_OF_RANGE("value",st,T)}ee(q,H,W)}function J(T,k){if(typeof T!="number")throw new Z.ERR_INVALID_ARG_TYPE(k,"number",T)}function X(T,k,O){throw Math.floor(T)!==T?(J(T,O),new Z.ERR_OUT_OF_RANGE(O||"offset","an integer",T)):k<0?new Z.ERR_BUFFER_OUT_OF_BOUNDS:new Z.ERR_OUT_OF_RANGE(O||"offset",`>= ${O?1:0} and <= ${k}`,T)}var he=/[^+/0-9A-Za-z-_]/g;function Ie(T){if(T=T.split("=")[0],T=T.trim().replace(he,""),T.length<2)return"";for(;T.length%4!==0;)T=T+"=";return T}function oe(T,k){k=k||1/0;let O,q=T.length,H=null,W=[];for(let se=0;se<q;++se){if(O=T.charCodeAt(se),O>55295&&O<57344){if(!H){if(O>56319){(k-=3)>-1&&W.push(239,191,189);continue}else if(se+1===q){(k-=3)>-1&&W.push(239,191,189);continue}H=O;continue}if(O<56320){(k-=3)>-1&&W.push(239,191,189),H=O;continue}O=(H-55296<<10|O-56320)+65536}else H&&(k-=3)>-1&&W.push(239,191,189);if(H=null,O<128){if((k-=1)<0)break;W.push(O)}else if(O<2048){if((k-=2)<0)break;W.push(O>>6|192,O&63|128)}else if(O<65536){if((k-=3)<0)break;W.push(O>>12|224,O>>6&63|128,O&63|128)}else if(O<1114112){if((k-=4)<0)break;W.push(O>>18|240,O>>12&63|128,O>>6&63|128,O&63|128)}else throw new Error("Invalid code point")}return W}function le(T){let k=[];for(let O=0;O<T.length;++O)k.push(T.charCodeAt(O)&255);return k}function ot(T,k){let O,q,H,W=[];for(let se=0;se<T.length&&!((k-=2)<0);++se)O=T.charCodeAt(se),q=O>>8,H=O%256,W.push(H),W.push(q);return W}function ge(T){return e.toByteArray(Ie(T))}function xe(T,k,O,q){let H;for(H=0;H<q&&!(H+O>=k.length||H>=T.length);++H)k[H+O]=T[H];return H}function ut(T,k){return T instanceof k||T!=null&&T.constructor!=null&&T.constructor.name!=null&&T.constructor.name===k.name}function Ae(T){return T!==T}var Ge=function(){let T="0123456789abcdef",k=new Array(256);for(let O=0;O<16;++O){let q=O*16;for(let H=0;H<16;++H)k[q+H]=T[O]+T[H]}return k}();function lt(T){return typeof BigInt>"u"?z:T}function z(){throw new Error("BigInt not supported")}}),SEe=zh((t,e)=>{typeof window<"u"?(window.global=window,global.fetch=window.fetch,e.exports={Buffer:iI().Buffer,Crypto:window.crypto}):e.exports={Buffer:iI().Buffer,Crypto:crypto}}),_te={};bEe(_te,{AVSCTap:()=>B2,ArweaveSigner:()=>II,DataItem:()=>A2,MAX_TAG_BYTES:()=>Ew,MIN_BINARY_SIZE:()=>PI,SIG_CONFIG:()=>W1,SignatureConfig:()=>Os,Signer:()=>Mte,createData:()=>Ate,deserializeTags:()=>vw,indexToType:()=>kI,serializeTags:()=>BI,tagsExceedLimit:()=>Ete});var Mte=class{signer;publicKey;signatureType;signatureLength;ownerLength;pem;static verify(t,e,r,o){throw new Error("You must implement verify method on child")}},EEe=Rd(TI(),1),If=Rd(wte(),1);async function xte(t){if(Array.isArray(t)){let i=(0,If.concatBuffers)([(0,If.stringToBuffer)("list"),(0,If.stringToBuffer)(t.length.toString())]);return await Ste(t,await qh().hash(i,"SHA-384"))}let e=t,r=(0,If.concatBuffers)([(0,If.stringToBuffer)("blob"),(0,If.stringToBuffer)(e.byteLength.toString())]),o=(0,If.concatBuffers)([await qh().hash(r,"SHA-384"),await qh().hash(e,"SHA-384")]);return await qh().hash(o,"SHA-384")}async function Ste(t,e){if(t.length<1)return e;let r=(0,If.concatBuffers)([e,await xte(t[0])]),o=await qh().hash(r,"SHA-384");return await Ste(t.slice(1),o)}var OT=Rd(MEe(),1),AEe=OT.default.default?OT.default.default:OT.default,REe=class extends AEe{getPublicKey(t){throw new Error("Unimplemented")}},TEe;function qh(){return TEe??=new REe}var Os;(function(t){t[t.ARWEAVE=1]="ARWEAVE",t[t.ED25519=2]="ED25519",t[t.ETHEREUM=3]="ETHEREUM",t[t.SOLANA=4]="SOLANA",t[t.INJECTEDAPTOS=5]="INJECTEDAPTOS",t[t.MULTIAPTOS=6]="MULTIAPTOS",t[t.TYPEDETHEREUM=7]="TYPEDETHEREUM"})(Os||(Os={}));var W1={[Os.ARWEAVE]:{sigLength:512,pubLength:512,sigName:"arweave"},[Os.ED25519]:{sigLength:64,pubLength:32,sigName:"ed25519"},[Os.ETHEREUM]:{sigLength:65,pubLength:65,sigName:"ethereum"},[Os.SOLANA]:{sigLength:64,pubLength:32,sigName:"solana"},[Os.INJECTEDAPTOS]:{sigLength:64,pubLength:32,sigName:"injectedAptos"},[Os.MULTIAPTOS]:{sigLength:64*32+4,pubLength:32*32+1,sigName:"multiAptos"},[Os.TYPEDETHEREUM]:{sigLength:65,pubLength:42,sigName:"typedEthereum"}},II=class{signatureType=1;ownerLength=W1[1].pubLength;signatureLength=W1[1].sigLength;jwk;pk;constructor(t){this.pk=t.n,this.jwk=t}get publicKey(){return EEe.default.toBuffer(this.pk)}sign(t){return qh().sign(this.jwk,t)}static async verify(t,e,r){return await qh().verify(t,e,r)}},kI={1:II},Nu=Rd(TI(),1);async function nI(t){return xte([(0,If.stringToBuffer)("dataitem"),(0,If.stringToBuffer)("1"),(0,If.stringToBuffer)(t.signatureType.toString()),t.rawOwner,t.rawTarget,t.rawAnchor,t.rawTags,t.rawData])}async function IEe(t,e){let r=await nI(t),o=await e.sign(r),i=await qh().hash(o);return{signature:Se.from(o),id:Se.from(i)}}async function kEe(t,e){let{signature:r,id:o}=await IEe(t,e);return t.getRaw().set(r,2),o}var B2=class{buf;pos;constructor(t=Se.alloc(Ew),e=0){this.buf=t,this.pos=e}writeTags(t){if(!Array.isArray(t))throw new Error("input must be array");let e=t.length,r;if(e)for(this.writeLong(e),r=0;r<e;r++){let o=t[r];if(o?.name===void 0||o?.value===void 0)throw new Error(`Invalid tag format for ${o}, expected {name:string, value: string}`);this.writeString(o.name),this.writeString(o.value)}this.writeLong(0)}toBuffer(){let t=Se.alloc(this.pos);if(this.pos>this.buf.length)throw new Error(`Too many tag bytes (${this.pos} > ${this.buf.length})`);return this.buf.copy(t,0,0,this.pos),t}tagsExceedLimit(){return this.pos>this.buf.length}writeLong(t){let e=this.buf,r,o;if(t>=-1073741824&&t<1073741824){o=t>=0?t<<1:~t<<1|1;do e[this.pos]=o&127,o>>=7;while(o&&(e[this.pos++]|=128))}else{r=t>=0?t*2:-t*2-1;do e[this.pos]=r&127,r/=128;while(r>=1&&(e[this.pos++]|=128))}this.pos++,this.buf=e}writeString(t){let e=Se.byteLength(t),r=this.buf;this.writeLong(e);let o=this.pos;if(this.pos+=e,!(this.pos>r.length)){if(e>64)this.buf.write(t,this.pos-e,e,"utf8");else{let i,h,c,v;for(i=0,h=e;i<h;i++)c=t.charCodeAt(i),c<128?r[o++]=c:c<2048?(r[o++]=c>>6|192,r[o++]=c&63|128):(c&64512)===55296&&((v=t.charCodeAt(i+1))&64512)===56320?(c=65536+((c&1023)<<10)+(v&1023),i++,r[o++]=c>>18|240,r[o++]=c>>12&63|128,r[o++]=c>>6&63|128,r[o++]=c&63|128):(r[o++]=c>>12|224,r[o++]=c>>6&63|128,r[o++]=c&63|128)}this.buf=r}}readLong(){let t=0,e=0,r=this.buf,o,i,h,c;do o=r[this.pos++],i=o&128,t|=(o&127)<<e,e+=7;while(i&&e<28);if(i){h=t,c=268435456;do o=r[this.pos++],h+=(o&127)*c,c*=128;while(o&128);return(h%2?-(h+1):h)/2}return t>>1^-(t&1)}skipLong(){let t=this.buf;for(;t[this.pos++]&128;);}readTags(){let t=[],e;for(;e=this.readLong();)for(e<0&&(e=-e,this.skipLong());e--;){let r=this.readString(),o=this.readString();t.push({name:r,value:o})}return t}readString(){let t=this.readLong(),e=this.pos,r=this.buf;if(this.pos+=t,!(this.pos>r.length))return this.buf.slice(e,e+t).toString()}};function BI(t){let e=new B2;return e.writeTags(t),e.toBuffer()}function Ete(t){let e=new B2;return e.writeTags(t),e.tagsExceedLimit()}function vw(t){return new B2(t).readTags()}function pl(t){let e=0;for(let r=t.length-1;r>=0;r--)e=e*256+t[r];return e}function BEe(t){if(t>29)throw new Error("Short too long");let e=[0,0];for(let r=0;r<e.length;r++){let o=t&255;e[r]=o,t=(t-o)/256}return Uint8Array.from(e)}function jQ(t){let e=[0,0,0,0,0,0,0,0];for(let r=0;r<e.length;r++){let o=t&255;e[r]=o,t=(t-o)/256}return Uint8Array.from(e)}var PEe=Rd(SEe(),1),R1=Rd(iI(),1),Ew=4096,PI=80,A2=class{binary;_id;constructor(t){this.binary=t}static isDataItem(t){return t.binary!==void 0}get signatureType(){let t=pl(this.binary.subarray(0,2));if(Os?.[t]!==void 0)return t;throw new Error("Unknown signature type: "+t)}async isValid(){return A2.verify(this.binary)}get id(){return(async()=>Nu.default.encode(await this.rawId))()}set id(t){this._id=Nu.default.toBuffer(t)}get rawId(){return(async()=>R1.Buffer.from(await PEe.Crypto.subtle.digest("SHA-256",this.rawSignature)))()}set rawId(t){this._id=t}get rawSignature(){return this.binary.subarray(2,2+this.signatureLength)}get signature(){return Nu.default.encode(this.rawSignature)}set rawOwner(t){if(t.byteLength!=this.ownerLength)throw new Error(`Expected raw owner (pubkey) to be ${this.ownerLength} bytes, got ${t.byteLength} bytes.`);this.binary.set(t,2+this.signatureLength)}get rawOwner(){return this.binary.subarray(2+this.signatureLength,2+this.signatureLength+this.ownerLength)}get signatureLength(){return W1[this.signatureType].sigLength}get owner(){return Nu.default.encode(this.rawOwner)}get ownerLength(){return W1[this.signatureType].pubLength}get rawTarget(){let t=this.getTargetStart();return this.binary[t]==1?this.binary.subarray(t+1,t+33):R1.Buffer.alloc(0)}get target(){return Nu.default.encode(this.rawTarget)}get rawAnchor(){let t=this.getAnchorStart();return this.binary[t]==1?this.binary.subarray(t+1,t+33):R1.Buffer.alloc(0)}get anchor(){return this.rawAnchor.toString()}get rawTags(){let t=this.getTagsStart(),e=pl(this.binary.subarray(t+8,t+16));return this.binary.subarray(t+16,t+16+e)}get tags(){let t=this.getTagsStart();if(pl(this.binary.subarray(t,t+8))==0)return[];let e=pl(this.binary.subarray(t+8,t+16));return vw(R1.Buffer.from(this.binary.subarray(t+16,t+16+e)))}get tagsB64Url(){return this.tags.map(t=>({name:Nu.default.encode(t.name),value:Nu.default.encode(t.value)}))}getStartOfData(){let t=this.getTagsStart(),e=this.binary.subarray(t+8,t+16),r=pl(e);return t+16+r}get rawData(){let t=this.getTagsStart(),e=this.binary.subarray(t+8,t+16),r=pl(e),o=t+16+r;return this.binary.subarray(o,this.binary.length)}get data(){return Nu.default.encode(this.rawData)}getRaw(){return this.binary}async sign(t){return this._id=await kEe(this,t),this.rawId}async setSignature(t){this.binary.set(t,2),this._id=R1.Buffer.from(await qh().hash(t))}isSigned(){return(this._id?.length??0)>0}toJSON(){return{signature:this.signature,owner:this.owner,target:this.target,tags:this.tags.map(t=>({name:Nu.default.encode(t.name),value:Nu.default.encode(t.value)})),data:this.data}}static async verify(t){if(t.byteLength<PI)return!1;let e=new A2(t),r=e.signatureType,o=e.getTagsStart(),i=pl(t.subarray(o,o+8)),h=t.subarray(o+8,o+16),c=pl(h);if(c>Ew)return!1;if(i>0)try{if(vw(R1.Buffer.from(t.subarray(o+16,o+16+c))).length!==i)return!1}catch{return!1}let v=kI[r],b=await nI(e);return await v.verify(e.rawOwner,b,e.rawSignature)}async getSignatureData(){return nI(this)}getTagsStart(){let t=this.getTargetStart(),e=this.binary[t]==1,r=t+(e?33:1),o=this.binary[r]==1;return r+=o?33:1,r}getTargetStart(){return 2+this.signatureLength+this.ownerLength}getAnchorStart(){let t=this.getTargetStart()+1,e=this.binary[this.getTargetStart()]==1;return t+=e?32:0,t}},OEe=Rd(TI(),1);function Ate(t,e,r){let o=e.publicKey,i=r?.target?OEe.default.toBuffer(r.target):null,h=1+(i?.byteLength??0),c=r?.anchor?Se.from(r.anchor):null,v=1+(c?.byteLength??0),b=(r?.tags?.length??0)>0?BI(r.tags):null,g=16+(b?b.byteLength:0),_=Se.from(t),M=_.byteLength,x=2+e.signatureLength+e.ownerLength+h+v+g+M,E=Se.alloc(x);if(E.set(BEe(e.signatureType),0),E.set(new Uint8Array(e.signatureLength).fill(0),2),o.byteLength!==e.ownerLength)throw new Error(`Owner must be ${e.ownerLength} bytes, but was incorrectly ${o.byteLength}`);E.set(o,2+e.signatureLength);let A=2+e.signatureLength+e.ownerLength;if(E[A]=i?1:0,i){if(i.byteLength!==32)throw new Error(`Target must be 32 bytes but was incorrectly ${i.byteLength}`);E.set(i,A+1)}let I=A+h,P=I+1;if(E[I]=c?1:0,c){if(P+=c.byteLength,c.byteLength!==32)throw new Error("Anchor must be 32 bytes");E.set(c,I+1)}E.set(jQ(r?.tags?.length??0),P);let N=jQ(b?.byteLength??0);E.set(N,P+8),b&&E.set(b,P+16);let L=P+g;return E.set(_,L),new A2(E)}var OI={..._te};globalThis.arbundles??=OI;var NEe=OI,CEe=OI;globalThis.Buffer||(globalThis.Buffer=gte.Buffer);var{DataItem:LEe}=bte;function DEe(t){return async({data:r,tags:o,target:i,anchor:h,createDataItem:c=v=>new LEe(v)})=>{let v=await t.signDataItem({data:r,tags:o,target:i,anchor:h}),b=c(gte.Buffer.from(v));return{id:await b.id,raw:await b.getRaw()}}}var $Ee=globalThis.GATEWAY_URL||void 0,qEe=globalThis.MU_URL||void 0,UEe=globalThis.CU_URL||void 0,FEe=globalThis.GRAPHQL_URL||void 0,{result:Eut,results:Aut,message:Rut,spawn:Tut,monitor:Iut,unmonitor:kut,dryrun:But,assign:Put}=Sl({GATEWAY_URL:$Ee,MU_URL:qEe,CU_URL:UEe,GRAPHQL_URL:FEe}),Rte=mte.createDataItemSigner;ie();ae();ne();var wre=mi(yre(),1),Nw=wre.default.init({host:"arweave.net",port:443,protocol:"https"});ie();ae();ne();ie();ae();ne();var Lf=class extends Error{constructor(e){super(e),this.name=this.constructor.name}},_re=class extends Lf{},Mre=class extends Lf{},xre=class extends Lf{constructor(e,r){super(`Failed request: ${e}: ${r}`)}},Sre=class extends Lf{},Cw=class extends Lf{},Ere=class extends Lf{constructor(){super("Invalid signer. Please provide a valid signer to interact with the contract.")}},Rl=class extends Lf{constructor(){super("Invalid contract configuration")}},Are=class extends Lf{constructor(){super("Invalid process configuration")}},Rre=class extends Lf{};ie();ae();ne();var Hf=mi(Wfe(),1);ie();ae();ne();var j4="3.8.0";var Vu=class t{logger;silent=!1;static default=new t;constructor({level:e="info"}={}){e==="none"&&(this.silent=!0),typeof window<"u"?this.logger=console:this.logger=(0,Hf.createLogger)({level:e,silent:this.silent,defaultMeta:{name:"ar-io-sdk",version:j4},format:Hf.format.combine(Hf.format.timestamp(),Hf.format.json()),transports:[new Hf.transports.Console({format:Hf.format.combine(Hf.format.timestamp(),Hf.format.json())})]})}info(e,...r){this.silent||this.logger.info(e,...r)}warn(e,...r){this.silent||this.logger.warn(e,...r)}error(e,...r){this.silent||this.logger.error(e,...r)}debug(e,...r){this.silent||this.logger.debug(e,...r)}setLogLevel(e){this.silent=e==="none","silent"in this.logger&&(this.logger.silent=e==="none"),"level"in this.logger&&(this.logger.level=e)}};ie();ae();ne();ie();ae();ne();var Vfe=t=>{let e=Object.entries(t).sort(([r,o],[i,h])=>r==="@"?-1:i==="@"?1:"priority"in o&&!("priority"in h)?-1:!("priority"in o)&&"priority"in h?1:o.priority!==void 0&&h.priority!==void 0?o.priority===h.priority?r<i?-1:r>i?1:0:o.priority-h.priority:r<i?-1:r>i?1:0);return Object.fromEntries(e.map(([r,o],i)=>[r,{...o,index:i}]))};ie();ae();ne();function Pl(t,e){let r=t.safeParse(e);if(!r.success)throw new Error(JSON.stringify(r.error.format(),null,2));return r}var z4=class{static init(e){return e!==void 0&&"signer"in e?new hP(e):new Z4(e)}},Z4=class{process;processId;strict;constructor(e){if(this.strict=e.strict||!1,mv(e))this.process=e.process;else if(gv(e))this.process=new Za({processId:e.processId});else throw new Rl;this.processId=this.process.processId}async getState({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"State"}],o=await this.process.read({tags:r});return e&&Pl(ST.passthrough().and(Qt.object({Records:Qt.record(Qt.string(),q8.passthrough())})),o),o}async getInfo({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"Info"}],o=await this.process.read({tags:r});return e&&Pl(gQ.passthrough(),o),o}async getLogo(){return(await this.getInfo()).Logo}async getRecord({undername:e},{strict:r}={strict:this.strict}){let o=[{name:"Sub-Domain",value:e},{name:"Action",value:"Record"}],i=await this.process.read({tags:o});return r&&Pl(q8.passthrough(),i),i}async getRecords({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"Records"}],o=await this.process.read({tags:r});return e&&Pl(_T,o),Vfe(o)}async getOwner({strict:e}={strict:this.strict}){return(await this.getInfo({strict:e})).Owner}async getControllers({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"Controllers"}],o=await this.process.read({tags:r});return e&&Pl(MT,o),o}async getName({strict:e}={strict:this.strict}){return(await this.getInfo({strict:e})).Name}async getTicker({strict:e}={strict:this.strict}){return(await this.getInfo({strict:e})).Ticker}async getBalances({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"Balances"}],o=await this.process.read({tags:r});return e&&Pl(xT,o),o}async getBalance({address:e},{strict:r}={strict:this.strict}){let o=[{name:"Action",value:"Balance"},{name:"Recipient",value:e}],i=await this.process.read({tags:o});return r&&Pl(Qt.number(),i),i}async getHandlers(){let e=await this.getInfo();return e.Handlers??e.HandlerNames}},hP=class extends Z4{signer;constructor({signer:e,...r}){super(r),this.signer=vv(e)}async transfer({target:e},r){let o=[...r?.tags??[],{name:"Action",value:"Transfer"},{name:"Recipient",value:e}];return this.process.send({tags:o,signer:this.signer})}async addController({controller:e},r){let o=[...r?.tags??[],{name:"Action",value:"Add-Controller"},{name:"Controller",value:e}];return this.process.send({tags:o,signer:this.signer})}async removeController({controller:e},r){let o=[...r?.tags??[],{name:"Action",value:"Remove-Controller"},{name:"Controller",value:e}];return this.process.send({tags:o,signer:this.signer})}async setRecord({undername:e,transactionId:r,ttlSeconds:o},i){return this.process.send({tags:[...i?.tags??[],{name:"Action",value:"Set-Record"},{name:"Sub-Domain",value:e},{name:"Transaction-Id",value:r},{name:"TTL-Seconds",value:o.toString()}],signer:this.signer})}async setBaseNameRecord({transactionId:e,ttlSeconds:r},o){return this.setRecord({transactionId:e,ttlSeconds:r,undername:"@"},o)}async setUndernameRecord({undername:e,transactionId:r,ttlSeconds:o},i){return this.setRecord({undername:e,transactionId:r,ttlSeconds:o},i)}async removeUndernameRecord({undername:e}){return this.removeRecord({undername:e})}async removeRecord({undername:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Remove-Record"},{name:"Sub-Domain",value:e}],signer:this.signer})}async setTicker({ticker:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Ticker"},{name:"Ticker",value:e}],signer:this.signer})}async setName({name:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Name"},{name:"Name",value:e}],signer:this.signer})}async setDescription({description:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Description"},{name:"Description",value:e}],signer:this.signer})}async setKeywords({keywords:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Keywords"},{name:"Keywords",value:JSON.stringify(e)}],signer:this.signer})}async setLogo({txId:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Logo"},{name:"Logo",value:e}],signer:this.signer})}async releaseName({name:e,arioProcessId:r},o){return this.process.send({tags:[...o?.tags??[],{name:"Action",value:"Release-Name"},{name:"Name",value:e},{name:"IO-Process-Id",value:r},{name:"ARIO-Process-Id",value:r}],signer:this.signer})}async reassignName({name:e,arioProcessId:r,antProcessId:o},i){return this.process.send({tags:[...i?.tags??[],{name:"Action",value:"Reassign-Name"},{name:"Name",value:e},{name:"IO-Process-Id",value:r},{name:"ARIO-Process-Id",value:r},{name:"Process-Id",value:o}],signer:this.signer})}async approvePrimaryNameRequest({name:e,address:r,arioProcessId:o},i){return this.process.send({tags:[...i?.tags??[],{name:"Action",value:"Approve-Primary-Name"},{name:"Name",value:e},{name:"Recipient",value:r},{name:"IO-Process-Id",value:o},{name:"ARIO-Process-Id",value:o}],signer:this.signer})}async removePrimaryNames({names:e,arioProcessId:r,notifyOwners:o=!1},i){return this.process.send({tags:[...i?.tags??[],{name:"Action",value:"Remove-Primary-Names"},{name:"Names",value:e.join(",")},{name:"IO-Process-Id",value:r},{name:"ARIO-Process-Id",value:r},{name:"Notify-Owners",value:o.toString()}],signer:this.signer})}};ie();ae();ne();var Eb=class{static init(e){return e!==void 0&&"signer"in e?new lP(e):new H4(e)}},H4=class{process;constructor(e){if(e===void 0||Object.keys(e).length===0)this.process=new Za({processId:$8});else if(mv(e))this.process=e.process;else if(gv(e))this.process=new Za({processId:e.processId});else throw new Rl}async accessControlList({address:e}){return this.process.read({tags:[{name:"Action",value:"Access-Control-List"},{name:"Address",value:e}]})}},lP=class extends H4{signer;constructor({signer:e,...r}){super(r),this.signer=vv(e)}async register({processId:e}){return this.process.send({tags:[{name:"Action",value:"Register"},{name:"Process-Id",value:e}],signer:this.signer})}};ie();ae();ne();ie();ae();ne();ie();ae();ne();cu();var Gfe="+",Yfe="/",Jfe="-",Xfe="_",Qfe="=";function oUe(t){let e=t.length%4;return e&&(t+=Qfe.repeat(4-e)),t.replaceAll(Jfe,Gfe).replaceAll(Xfe,Yfe)}function sUe(t){return t.replaceAll(Gfe,Jfe).replaceAll(Yfe,Xfe).replaceAll(Qfe,"")}function myt(t){let e=oUe(t);return Se.from(e,"base64")}function fUe(t){let e=t.toString("base64");return sUe(e)}function gyt(t){return fUe(cf("sha256").update(Uint8Array.from(t)).digest())}function eue(t=32){let e=oE(t);return Array.from(e,r=>r.toString(16).padStart(2,"0")).join("").slice(0,t)}ie();ae();ne();ie();ae();ne();function cP(t){try{return JSON.parse(t)}catch{return t}}ie();ae();ne();ie();ae();ne();var pP=mi(rue(),1);ie();ae();ne();var lUe=Object.defineProperty,cUe=(t,e,r)=>e in t?lUe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Rb=(t,e,r)=>(cUe(t,typeof e!="symbol"?e+"":e,r),r),vP=class{constructor(e){Rb(this,"value"),Rb(this,"next"),this.value=e}},mP=class{constructor(){Rb(this,"head"),Rb(this,"tail"),Rb(this,"_size",0),this.clear()}clear(){this.head=void 0,this.tail=void 0,this._size=0}push(e){let r=new vP(e);return this.head&&this.tail?(this.tail.next=r,this.tail=r):(this.head=r,this.tail=r),this._size++,this._size}pop(){if(!this.head)return;let e=this.head;return this.head=this.head.next,this._size--,e.value}get size(){return this._size}*[Symbol.iterator](){let e=this.head;for(;e;)yield e.value,e=e.next}};function iue(t){if(!((Number.isInteger(t)||t===1/0)&&t>0))throw new TypeError("Expected `concurrency` to be a number greater than 1");let e=new mP,r=0,o=()=>{r--,e.size>0&&e.pop()()},i=async(v,b,g)=>{r++;let _=(async()=>v(...g))();b(_);try{await _}catch{}o()},h=(v,b,g)=>{e.push(i.bind(null,v,b,g)),(async()=>(await Promise.resolve(),r<t&&e.size>0&&e.pop()()))()},c=(v,...b)=>new Promise(g=>{h(v,g,b)});return Object.defineProperties(c,{activeCount:{get:()=>r},pendingCount:{get:()=>e.size},clearQueue:{value:()=>{e.clear()}}}),c}var Vyt=async({address:t,registry:e=Eb.init()})=>{let r=await e.accessControlList({address:t});return[...new Set([...r.Owned,...r.Controlled])]};function nue(t,e){return new Promise((r,o)=>{let i=setTimeout(()=>{o(new Error("Timeout"))},t);e.then(h=>{clearTimeout(i),r(h)}).catch(h=>{clearTimeout(i),o(h)})})}var aue=class extends pP.default{contract;timeoutMs;throttle;logger;strict;antAoClient;constructor({contract:e=Tb.init({processId:Lh}),timeoutMs:r=6e4,concurrency:o=30,logger:i=Vu.default,strict:h=!1,antAoClient:c=Sl()}={}){super(),this.contract=e,this.timeoutMs=r,this.throttle=iue(o),this.logger=i,this.strict=h,this.antAoClient=c}async fetchProcessesOwnedByWallet({address:e,pageSize:r,antRegistry:o=Eb.init()}){let i={},h=await o.accessControlList({address:e}),c=new Set([...h.Owned,...h.Controlled]);await nue(this.timeoutMs,dUe({contract:this.contract,emitter:this,pageSize:r})).catch(b=>(this.emit("error",`Error getting ArNS records: ${b}`),this.logger.error("Error getting ArNS records",{message:b?.message,stack:b?.stack}),{})).then(b=>{Object.entries(b).forEach(([g,_])=>{c.has(_.processId)&&(i[_.processId]==null&&(i[_.processId]={state:void 0,names:{}}),i[_.processId].names[g]=_)})});let v=Object.keys(i).length;this.emit("progress",0,v),await Promise.all(Object.keys(i).map(async(b,g)=>this.throttle(async()=>{if(i[b].state!==void 0){this.emit("progress",g+1,v);return}let _=z4.init({process:new Za({processId:b,ao:this.antAoClient}),strict:this.strict}),M=await nue(this.timeoutMs,_.getState()).catch(x=>{this.emit("error",`Error getting state for process ${b}: ${x}`)});(M?.Owner===e||M?.Controllers.includes(e))&&(i[b].state=M,this.emit("process",b,i[b])),this.emit("progress",g+1,v)}))),this.emit("end",i)}},dUe=async({contract:t=Tb.init({processId:Lh}),emitter:e,logger:r=Vu.default,pageSize:o=1e3})=>{let i,h=Date.now(),c={};do{let v=await t.getArNSRecords({cursor:i,limit:o}).catch(b=>{r?.error("Error getting ArNS records",{message:b?.message,stack:b?.stack}),e?.emit("arns:error",`Error getting ArNS records: ${b}`)});if(!v)return{};v.items.forEach(b=>{let{name:g,..._}=b;c[g]=_}),r.debug("Fetched page of ArNS records",{totalRecordCount:v.totalItems,fetchedRecordCount:Object.keys(c).length,cursor:v.nextCursor}),e?.emit("arns:pageLoaded",{totalRecordCount:v.totalItems,fetchedRecordCount:Object.keys(c).length,records:v.items,cursor:v.nextCursor}),i=v.nextCursor}while(i!==void 0);return e?.emit("arns:end",c),r.debug("Fetched all ArNS records",{totalRecordCount:Object.keys(c).length,durationMs:Date.now()-h}),c};var Za=class{logger;ao;processId;constructor({processId:e,ao:r=Sl(),logger:o=Vu.default}){this.processId=e,this.logger=o,this.ao=r}isMessageDataEmpty(e){return e===void 0||e==="null"||e===""||e===null}async read({tags:e,retries:r=3,fromAddress:o}){let i=0,h;for(;i<r;)try{this.logger.debug("Evaluating read interaction on process",{tags:e,processId:this.processId});let c={process:this.processId,tags:e};o!==void 0&&(c.Owner=o);let v=await this.ao.dryrun(c);this.logger.debug("Read interaction result",{result:v,processId:this.processId});let b=gP(v);if(b!==void 0)throw new Error(b);if(v.Messages===void 0||v.Messages.length===0)throw this.logger.debug(`Process ${this.processId} does not support provided action.`,{result:v,tags:e,processId:this.processId}),new Error(`Process ${this.processId} does not support provided action.`);let g=v.Messages?.[0]?.Data;return this.isMessageDataEmpty(g)?void 0:cP(g)}catch(c){i++,this.logger.debug(`Read attempt ${i} failed`,{error:c?.message,stack:c?.stack,tags:e,processId:this.processId}),h=c,await new Promise(v=>setTimeout(v,2**i*1e3))}throw h}async send({tags:e,data:r,signer:o,retries:i=3}){let h=0,c;for(;h<i;)try{this.logger.debug("Evaluating send interaction on contract",{tags:e,data:r,processId:this.processId});let v=eue(32),b=await this.ao.message({process:this.processId,tags:[...e,{name:"AR-IO-SDK",value:j4}],data:r,signer:o,anchor:v});this.logger.debug("Sent message to process",{messageId:b,processId:this.processId,anchor:v});let g=await this.ao.result({message:b,process:this.processId});this.logger.debug("Message result",{output:g,messageId:b,processId:this.processId});let _=gP(g);if(_!==void 0)throw new Cw(_);if(g.Messages?.length===0||g.Messages===void 0)return{id:b};if(g.Messages.length===0)throw new Error(`Process ${this.processId} does not support provided action.`);if(this.isMessageDataEmpty(g.Messages[0].Data))return{id:b};let M=cP(g.Messages[0].Data);return this.logger.debug("Message result data",{resultData:M,messageId:b,processId:this.processId}),{id:b,result:M}}catch(v){if(this.logger.error("Error sending message to process",{error:v?.message,stack:v?.stack,processId:this.processId,tags:e}),v.message.includes("500"))this.logger.debug("Retrying send interaction",{attempts:h,retries:i,error:v?.message,processId:this.processId}),await new Promise(b=>setTimeout(b,2**h*2e3)),h++,c=v;else throw v}throw c}};var Tb=class{static init(e){return e!==void 0&&"signer"in e?new bP(e):new W4(e)}},W4=class{process;epochSettings;arweave;constructor(e){if(this.arweave=e?.arweave??Nw,e===void 0||Object.keys(e).length===0)this.process=new Za({processId:Lh});else if(mv(e))this.process=e.process;else if(gv(e))this.process=new Za({processId:e.processId});else throw new Rl}async getInfo(){return this.process.read({tags:[{name:"Action",value:"Info"}]})}async getTokenSupply(){return this.process.read({tags:[{name:"Action",value:"Total-Token-Supply"}]})}async computeEpochIndexForTimestamp(e){let r=await this.getEpochSettings(),o=r.epochZeroStartTimestamp,i=r.durationMs;return Math.floor((e-o)/i)}async computeCurrentEpochIndex(){let e=await this.getEpochSettings(),r=e.epochZeroStartTimestamp,o=e.durationMs,i=Date.now();return Math.floor((i-r)/o)}async computeEpochIndex(e){let r=e?.epochIndex;if(r!==void 0)return r;let o=e?.timestamp;if(o!==void 0)return this.computeEpochIndexForTimestamp(o)}async getEpochSettings(){return this.epochSettings??=await this.process.read({tags:[{name:"Action",value:"Epoch-Settings"}]})}async getEpoch(e){let r=await this.computeEpochIndex(e),o=await this.computeCurrentEpochIndex();if(r!==void 0&&r<o){let h=await Hd({arweave:this.arweave,epochIndex:r,processId:this.process.processId});return sue(h)}let i=[{name:"Action",value:"Epoch"},{name:"Epoch-Index",value:o.toString()}];return this.process.read({tags:yn(i)})}async getArNSRecord({name:e}){return this.process.read({tags:[{name:"Action",value:"Record"},{name:"Name",value:e}]})}async getArNSRecords(e){return this.process.read({tags:[{name:"Action",value:"Paginated-Records"},...Oa(e)]})}async getArNSReservedNames(e){return this.process.read({tags:[{name:"Action",value:"Reserved-Names"},...Oa(e)]})}async getArNSReservedName({name:e}){return this.process.read({tags:[{name:"Action",value:"Reserved-Name"},{name:"Name",value:e}]})}async getBalance({address:e}){return this.process.read({tags:[{name:"Action",value:"Balance"},{name:"Address",value:e}]})}async getBalances(e){return this.process.read({tags:[{name:"Action",value:"Paginated-Balances"},...Oa(e)]})}async getVault({address:e,vaultId:r}){return this.process.read({tags:[{name:"Action",value:"Vault"},{name:"Address",value:e},{name:"Vault-Id",value:r}]})}async getVaults(e){return this.process.read({tags:[{name:"Action",value:"Paginated-Vaults"},...Oa(e)]})}async getGateway({address:e}){return this.process.read({tags:[{name:"Action",value:"Gateway"},{name:"Address",value:e}]})}async getGatewayDelegates({address:e,...r}){return this.process.read({tags:[{name:"Action",value:"Paginated-Delegates"},{name:"Address",value:e},...Oa(r)]})}async getGatewayDelegateAllowList({address:e,...r}){return this.process.read({tags:[{name:"Action",value:"Paginated-Allowed-Delegates"},{name:"Address",value:e},...Oa(r)]})}async getGateways(e){return this.process.read({tags:[{name:"Action",value:"Paginated-Gateways"},...Oa(e)]})}async getCurrentEpoch(){return this.process.read({tags:[{name:"Action",value:"Epoch"}]})}async getPrescribedObservers(e){let r=await this.computeEpochIndex(e),o=await this.computeCurrentEpochIndex();if(r!==void 0&&r<o)return(await Hd({arweave:this.arweave,epochIndex:r,processId:this.process.processId}))?.prescribedObservers;let i=[{name:"Action",value:"Epoch-Prescribed-Observers"},{name:"Epoch-Index",value:o.toString()}];return this.process.read({tags:yn(i)})}async getPrescribedNames(e){let r=await this.computeEpochIndex(e),o=await this.computeCurrentEpochIndex();if(r!==void 0&&r<o)return(await Hd({arweave:this.arweave,epochIndex:r,processId:this.process.processId}))?.prescribedNames;let i=[{name:"Action",value:"Epoch-Prescribed-Names"},{name:"Epoch-Index",value:o.toString()}];return this.process.read({tags:yn(i)})}async getObservations(e){let r=await this.computeEpochIndex(e),o=await this.computeCurrentEpochIndex();if(r!==void 0&&r<o)return(await Hd({arweave:this.arweave,epochIndex:r,processId:this.process.processId}))?.observations;let i=[{name:"Action",value:"Epoch-Observations"},{name:"Epoch-Index",value:o.toString()}];return this.process.read({tags:yn(i)})}async getDistributions(e){let r=await this.computeEpochIndex(e),o=await this.computeCurrentEpochIndex();if(r!==void 0&&r<o)return(await Hd({arweave:this.arweave,epochIndex:r,processId:this.process.processId}))?.distributions;let i=[{name:"Action",value:"Epoch-Distributions"},{name:"Epoch-Index",value:o.toString()}];return this.process.read({tags:yn(i)})}async getEligibleEpochRewards(e,r){let o=await this.computeEpochIndex(e),i=await this.computeCurrentEpochIndex();if(o!==void 0&&o<i){let c=await Hd({arweave:this.arweave,epochIndex:o,processId:this.process.processId});return oue(c,r)}let h=[{name:"Action",value:"Epoch-Eligible-Rewards"},...Oa(r)];return this.process.read({tags:yn(h)})}async getTokenCost({intent:e,type:r,years:o,name:i,quantity:h,fromAddress:c}){let b=[{name:"Action",value:"Token-Cost"},{name:"Intent",value:e==="Buy-Record"?"Buy-Name":e},{name:"Name",value:i},{name:"Years",value:o?.toString()},{name:"Quantity",value:h?.toString()},{name:"Purchase-Type",value:r}];return this.process.read({tags:yn(b),fromAddress:c})}async getCostDetails({intent:e,type:r,years:o,name:i,quantity:h,fromAddress:c,fundFrom:v}){let g=[{name:"Action",value:"Cost-Details"},{name:"Intent",value:e==="Buy-Record"?"Buy-Name":e},{name:"Name",value:i},{name:"Years",value:o?.toString()},{name:"Quantity",value:h?.toString()},{name:"Purchase-Type",value:r},{name:"Fund-From",value:v}];return this.process.read({tags:yn(g),fromAddress:c})}async getRegistrationFees(){return this.process.read({tags:[{name:"Action",value:"Registration-Fees"}]})}async getDemandFactor(){return this.process.read({tags:[{name:"Action",value:"Demand-Factor"}]})}async getDemandFactorSettings(){return this.process.read({tags:[{name:"Action",value:"Demand-Factor-Settings"}]})}async getArNSReturnedNames(e){return this.process.read({tags:[{name:"Action",value:"Returned-Names"},...Oa(e)]})}async getArNSReturnedName({name:e}){let r=[{name:"Action",value:"Returned-Name"},{name:"Name",value:e}];return this.process.read({tags:r})}async getDelegations(e){let r=[{name:"Action",value:"Paginated-Delegations"},{name:"Address",value:e.address},...Oa(e)];return this.process.read({tags:yn(r)})}async getAllowedDelegates(e){return this.getGatewayDelegateAllowList(e)}async getGatewayVaults(e){return this.process.read({tags:[{name:"Action",value:"Paginated-Gateway-Vaults"},{name:"Address",value:e.address},...Oa(e)]})}async getPrimaryNameRequest(e){let r=[{name:"Action",value:"Primary-Name-Request"},{name:"Initiator",value:e.initiator}];return this.process.read({tags:r})}async getPrimaryNameRequests(e){return this.process.read({tags:[{name:"Action",value:"Primary-Name-Requests"},...Oa(e)]})}async getPrimaryName(e){let r=[{name:"Action",value:"Primary-Name"},{name:"Address",value:e?.address},{name:"Name",value:e?.name}];return this.process.read({tags:yn(r)})}async getPrimaryNames(e){return this.process.read({tags:[{name:"Action",value:"Primary-Names"},...Oa(e)]})}async getRedelegationFee(e){return this.process.read({tags:[{name:"Action",value:"Redelegation-Fee"},{name:"Address",value:e.address}]})}async getGatewayRegistrySettings(){return this.process.read({tags:[{name:"Action",value:"Gateway-Registry-Settings"}]})}async getAllDelegates(e){return this.process.read({tags:[{name:"Action",value:"All-Paginated-Delegates"},...Oa(e)]})}async getAllGatewayVaults(e){return this.process.read({tags:[{name:"Action",value:"All-Gateway-Vaults"},...Oa(e)]})}},bP=class extends W4{signer;constructor({signer:e,...r}){r===void 0?super({process:new Za({processId:Lh})}):super(r),this.signer=vv(e)}async transfer({target:e,qty:r},o){let{tags:i=[]}=o||{};return this.process.send({tags:[...i,{name:"Action",value:"Transfer"},{name:"Recipient",value:e},{name:"Quantity",value:r.valueOf().toString()}],signer:this.signer})}async vaultedTransfer({recipient:e,quantity:r,lockLengthMs:o,revokable:i=!1},h){let{tags:c=[]}=h||{};return this.process.send({tags:[...c,{name:"Action",value:"Vaulted-Transfer"},{name:"Recipient",value:e},{name:"Quantity",value:r.toString()},{name:"Lock-Length",value:o.toString()},{name:"Revokable",value:`${i}`}],signer:this.signer})}async revokeVault({vaultId:e,recipient:r},o){let{tags:i=[]}=o||{};return this.process.send({tags:[...i,{name:"Action",value:"Revoke-Vault"},{name:"Vault-Id",value:e},{name:"Recipient",value:r}],signer:this.signer})}async createVault({lockLengthMs:e,quantity:r},o){let{tags:i=[]}=o||{};return this.process.send({tags:[...i,{name:"Action",value:"Create-Vault"},{name:"Lock-Length",value:e.toString()},{name:"Quantity",value:r.toString()}],signer:this.signer})}async extendVault({vaultId:e,extendLengthMs:r},o){let{tags:i=[]}=o||{};return this.process.send({tags:[...i,{name:"Action",value:"Extend-Vault"},{name:"Vault-Id",value:e},{name:"Extend-Length",value:r.toString()}],signer:this.signer})}async increaseVault({vaultId:e,quantity:r},o){let{tags:i=[]}=o||{};return this.process.send({tags:[...i,{name:"Action",value:"Increase-Vault"},{name:"Vault-Id",value:e},{name:"Quantity",value:r.toString()}],signer:this.signer})}async joinNetwork({operatorStake:e,allowDelegatedStaking:r,allowedDelegates:o,delegateRewardShareRatio:i,fqdn:h,label:c,minDelegatedStake:v,note:b,port:g,properties:_,protocol:M,autoStake:x,observerAddress:E},A){let{tags:I=[]}=A||{},P=[...I,{name:"Action",value:"Join-Network"},{name:"Operator-Stake",value:e.valueOf().toString()},{name:"Allow-Delegated-Staking",value:r?.toString()},{name:"Allowed-Delegates",value:o?.join(",")},{name:"Delegate-Reward-Share-Ratio",value:i?.toString()},{name:"FQDN",value:h},{name:"Label",value:c},{name:"Min-Delegated-Stake",value:v?.valueOf().toString()},{name:"Note",value:b},{name:"Port",value:g?.toString()},{name:"Properties",value:_},{name:"Protocol",value:M},{name:"Auto-Stake",value:x?.toString()},{name:"Observer-Address",value:E}];return this.process.send({signer:this.signer,tags:yn(P)})}async leaveNetwork(e){let{tags:r=[]}=e||{};return this.process.send({signer:this.signer,tags:[...r,{name:"Action",value:"Leave-Network"}]})}async updateGatewaySettings({allowDelegatedStaking:e,allowedDelegates:r,delegateRewardShareRatio:o,fqdn:i,label:h,minDelegatedStake:c,note:v,port:b,properties:g,protocol:_,autoStake:M,observerAddress:x},E){let{tags:A=[]}=E||{},I=[...A,{name:"Action",value:"Update-Gateway-Settings"},{name:"Label",value:h},{name:"Note",value:v},{name:"FQDN",value:i},{name:"Port",value:b?.toString()},{name:"Properties",value:g},{name:"Protocol",value:_},{name:"Observer-Address",value:x},{name:"Allow-Delegated-Staking",value:e?.toString()},{name:"Allowed-Delegates",value:r?.join(",")},{name:"Delegate-Reward-Share-Ratio",value:o?.toString()},{name:"Min-Delegated-Stake",value:c?.valueOf().toString()},{name:"Auto-Stake",value:M?.toString()}];return this.process.send({signer:this.signer,tags:yn(I)})}async delegateStake(e,r){let{tags:o=[]}=r||{};return this.process.send({signer:this.signer,tags:[...o,{name:"Action",value:"Delegate-Stake"},{name:"Target",value:e.target},{name:"Quantity",value:e.stakeQty.valueOf().toString()}]})}async decreaseDelegateStake(e,r){let{tags:o=[]}=r||{};return this.process.send({signer:this.signer,tags:[...o,{name:"Action",value:"Decrease-Delegate-Stake"},{name:"Target",value:e.target},{name:"Quantity",value:e.decreaseQty.valueOf().toString()},{name:"Instant",value:`${e.instant||!1}`}]})}async instantWithdrawal(e,r){let{tags:o=[]}=r||{},i=[...o,{name:"Action",value:"Instant-Withdrawal"},{name:"Vault-Id",value:e.vaultId},{name:"Address",value:e.gatewayAddress}];return this.process.send({signer:this.signer,tags:yn(i)})}async increaseOperatorStake(e,r){let{tags:o=[]}=r||{};return this.process.send({signer:this.signer,tags:[...o,{name:"Action",value:"Increase-Operator-Stake"},{name:"Quantity",value:e.increaseQty.valueOf().toString()}]})}async decreaseOperatorStake(e,r){let{tags:o=[]}=r||{};return this.process.send({signer:this.signer,tags:[...o,{name:"Action",value:"Decrease-Operator-Stake"},{name:"Quantity",value:e.decreaseQty.valueOf().toString()},{name:"Instant",value:`${e.instant||!1}`}]})}async saveObservations(e,r){let{tags:o=[]}=r||{};return this.process.send({signer:this.signer,tags:[...o,{name:"Action",value:"Save-Observations"},{name:"Report-Tx-Id",value:e.reportTxId},{name:"Failed-Gateways",value:e.failedGateways.join(",")}]})}async buyRecord(e,r){let{tags:o=[]}=r||{},i=[...o,{name:"Action",value:"Buy-Name"},{name:"Name",value:e.name},{name:"Years",value:e.years?.toString()??"1"},{name:"Process-Id",value:e.processId},{name:"Purchase-Type",value:e.type||"lease"},{name:"Fund-From",value:e.fundFrom}];return this.process.send({signer:this.signer,tags:yn(i)})}async upgradeRecord(e,r){let{tags:o=[]}=r||{},i=[...o,{name:"Action",value:"Upgrade-Name"},{name:"Name",value:e.name},{name:"Fund-From",value:e.fundFrom}];return this.process.send({signer:this.signer,tags:yn(i)})}async extendLease(e,r){let{tags:o=[]}=r||{},i=[...o,{name:"Action",value:"Extend-Lease"},{name:"Name",value:e.name},{name:"Years",value:e.years.toString()},{name:"Fund-From",value:e.fundFrom}];return this.process.send({signer:this.signer,tags:yn(i)})}async increaseUndernameLimit(e,r){let{tags:o=[]}=r||{},i=[...o,{name:"Action",value:"Increase-Undername-Limit"},{name:"Name",value:e.name},{name:"Quantity",value:e.increaseCount.toString()},{name:"Fund-From",value:e.fundFrom}];return this.process.send({signer:this.signer,tags:yn(i)})}async cancelWithdrawal(e,r){let{tags:o=[]}=r||{},i=[...o,{name:"Action",value:"Cancel-Withdrawal"},{name:"Vault-Id",value:e.vaultId},{name:"Address",value:e.gatewayAddress}];return this.process.send({signer:this.signer,tags:yn(i)})}async requestPrimaryName(e,r){let{tags:o=[]}=r||{},i=[...o,{name:"Action",value:"Request-Primary-Name"},{name:"Name",value:e.name},{name:"Fund-From",value:e.fundFrom}];return this.process.send({signer:this.signer,tags:yn(i)})}async redelegateStake(e,r){let{tags:o=[]}=r||{},i=[...o,{name:"Action",value:"Redelegate-Stake"},{name:"Target",value:e.target},{name:"Source",value:e.source},{name:"Quantity",value:e.stakeQty.valueOf().toString()},{name:"Vault-Id",value:e.vaultId}];return this.process.send({signer:this.signer,tags:yn(i)})}};async function I3t({signer:t,module:e=hQ,ao:r=Sl(),scheduler:o=dQ,state:i,antRegistryId:h=$8,logger:c=Vu.default,authority:v=cQ}){let b=await r.spawn({module:e,scheduler:o,signer:t,data:i?JSON.stringify(i):void 0,tags:[{name:"Authority",value:v},{name:"ANT-Registry-Id",value:h}]});return c.debug("Spawned ANT",{processId:b,module:e,scheduler:o}),b}async function k3t({signer:t,processId:e,luaCodeTxId:r=lQ,ao:o=Sl(),logger:i=Vu.default,arweave:h=Nw}){let c=new Za({processId:e,ao:o,logger:i}),{api:{host:v,port:b,protocol:g}}=h.getConfig(),_=await fetch(`${g}://${v}:${b}/${r}`).then(x=>x.text()),{id:M}=await c.send({tags:[{name:"Action",value:"Eval"},{name:"App-Name",value:"ArNS-ANT"},{name:"Source-Code-TX-ID",value:r}],data:_,signer:t});return i.debug("Evolved ANT",{processId:e,luaCodeTxId:r,evalMsgId:M}),M}function pUe(t){let e=Qt.object({name:Qt.string(),value:Qt.union([Qt.string(),Qt.number()])}),r=Qt.function().args(Qt.object({data:Qt.union([Qt.string(),Qt.instanceof(Se)]),tags:Qt.array(e).optional(),target:Qt.string().optional(),anchor:Qt.string().optional()})).returns(Qt.promise(Qt.object({id:Qt.string(),raw:Qt.instanceof(ArrayBuffer)})));try{return r.parse(t),!0}catch{return!1}}function vv(t){return pUe(t)?t:"publicKey"in t?async({data:r,tags:o,target:i,anchor:h})=>{if(t.publicKey===void 0&&"setPublicKey"in t&&typeof t.setPublicKey=="function"&&await t.setPublicKey(),t instanceof ul){let b=await t.signer.signDataItem({data:r,tags:o,target:i,anchor:h}),g=new m1(Se.from(b));return{id:await g.id,raw:await g.getRaw()}}let c=Rg(r,t,{tags:o,target:i,anchor:h});return c.sign(t).then(async()=>({id:await c.id,raw:await c.getRaw()}))}:Rte(t)}var vUe="-k7t8xMoB8hW482609Z9F4bTFMC3MnuW8bTvTyT8pFI";function B3t({owner:t,targetId:e,ttlSeconds:r=3600,keywords:o=[],controllers:i=[],description:h="",ticker:c="aos",name:v="ANT"}){return{ticker:c,name:v,description:h,keywords:o,owner:t,controllers:[t,...i],balances:{[t]:1},records:{"@":{transactionId:e??vUe.toString(),ttlSeconds:r}}}}function uue(t){return Qt.object({startTimestamp:Qt.number(),startHeight:Qt.number(),distributions:Qt.any(),endTimestamp:Qt.number(),prescribedObservers:Qt.any(),prescribedNames:Qt.array(Qt.string()),observations:Qt.any(),epochIndex:Qt.number()}).parse(t)}function gP(t){let r=t.Error??t.Messages?.[0]?.Tags?.find(o=>o.name==="Error")?.value;if(r!==void 0){let o=r.match(/\[string "aos"]:(\d+):\s*(.+)/);if(o){let[,i,h]=o;return`${fue(h).trim()} (line ${i.trim()})`.trim()}return fue(r)}}function fue(t){let e="\x1B";return t.replace(new RegExp(`${e}[\\[\\]()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]`,"g"),"").trim()}var hue=t=>D8.test(t);function Z3t(t){return t!==void 0&&!isNaN(parseInt(t.toString()))}var yn=t=>t.filter(e=>e.value!==void 0&&e.value!==""),Oa=t=>{let e=[{name:"Cursor",value:t?.cursor?.toString()},{name:"Limit",value:t?.limit?.toString()},{name:"Sort-By",value:t?.sortBy?.toString()},{name:"Sort-Order",value:t?.sortOrder?.toString()}];return yn(e)},Hd=async({arweave:t,epochIndex:e,processId:r=Lh,retries:o=3,gqlUrl:i="https://arweave-search.goldsky.com/graphql"})=>{let h=mUe({epochIndex:e,processId:r});for(let c=0;c<o;c++)try{let v=await fetch(i,{method:"POST",body:h,headers:{"Content-Type":"application/json"}}).then(_=>_.json());if(v?.data?.transactions?.edges?.length===0)return;let b=v.data.transactions.edges[0].node.id,g=await t.api.get(b);return uue(g.data)}catch(v){if(c===o-1)throw v;await new Promise(b=>setTimeout(b,Math.pow(2,c)*1e3))}},mUe=({epochIndex:t,processId:e=Lh,authorities:r=["fcoN_xJeisVsPXA-trzVAuIiqO3ydLQxM-L4XbrQKzY"]})=>JSON.stringify({query:`
|
|
190
190
|
query {
|
|
191
191
|
transactions(
|
|
192
192
|
tags: [
|
|
@@ -206,7 +206,7 @@ nonce: bundlr`),Se.from(i))}};ie();ae();ne();var Qc=class{_publicKey;ownerLength
|
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
|
-
`});function oue(t,e){let r=[],o=e?.sortBy??"eligibleReward",i=e?.sortOrder??"desc",h=e?.limit??100;if(!yP(t))return{hasMore:!1,items:[],totalItems:0,limit:h,sortOrder:i,sortBy:o};let c=t?.distributions.rewards.eligible;for(let[g,_]of Object.entries(c)){r.push({type:"operatorReward",recipient:g,eligibleReward:_.operatorReward,cursorId:g+"_"+g,gatewayAddress:g});for(let[M,x]of Object.entries(_.delegateRewards))r.push({type:"delegateReward",recipient:M,eligibleReward:x,cursorId:g+"_"+M,gatewayAddress:g})}r.sort((g,_)=>{let M=g[o],x=_[o];return M===x||M===void 0||x===void 0?0:i==="asc"?M>x?1:-1:M<x?1:-1});let v=e?.cursor!==void 0?r.findIndex(g=>g.cursorId===e.cursor)+1:0,b=h?v+h:r.length;return{hasMore:b<r.length,items:r.slice(v,b),totalItems:r.length,limit:h,sortOrder:i,nextCursor:r[b]?.cursorId,sortBy:o}}function sue(t){if(t!==void 0)return yP(t)?{...t,distributions:{...t.distributions,rewards:{...t.distributions.rewards,eligible:void 0}}}:t}var gUe=t=>t.distributedTimestamp!==void 0,yP=t=>t!==void 0&&t.distributions!==void 0&&gUe(t.distributions),bUe=["Buy-Name","Buy-Record","Extend-Lease","Increase-Undername-Limit","Upgrade-Name","Primary-Name-Request"],Y3t=["Buy-Record","Buy-Name","Extend-Lease"],J3t=t=>bUe.indexOf(t)!==-1,yUe=["balance","stakes","any"],X3t=t=>yUe.indexOf(t)!==-1;function mv(t){return"process"in t}function gv(t){return"processId"in t&&typeof t.processId=="string"&&hue(t.processId)===!0}function Q3t(t){return t.type==="lease"}ie();ae();ne();var wP=class t{constructor(e){this.positiveFiniteInteger=e;if(!Number.isFinite(this.positiveFiniteInteger)||!Number.isInteger(this.positiveFiniteInteger)||this.positiveFiniteInteger<0)throw new Error(`Number must be a non-negative integer value! ${e}`)}[Symbol.toPrimitive](e){return e==="string"&&this.toString(),this.positiveFiniteInteger}plus(e){return new t(this.positiveFiniteInteger+e.positiveFiniteInteger)}minus(e){return new t(this.positiveFiniteInteger-e.positiveFiniteInteger)}isGreaterThan(e){return this.positiveFiniteInteger>e.positiveFiniteInteger}isGreaterThanOrEqualTo(e){return this.positiveFiniteInteger>=e.positiveFiniteInteger}isLessThan(e){return this.positiveFiniteInteger<e.positiveFiniteInteger}isLessThanOrEqualTo(e){return this.positiveFiniteInteger<=e.positiveFiniteInteger}toString(){return`${this.positiveFiniteInteger}`}valueOf(){return this.positiveFiniteInteger}toJSON(){return this.positiveFiniteInteger}equals(e){return this.positiveFiniteInteger===e.positiveFiniteInteger}},_P=class{value;constructor(e){if(!Number.isFinite(e)||e<0)throw new Error("ARIOToken must be a non-negative finite number");this.value=+e.toFixed(6)}valueOf(){return this.value}toMARIO(){return new MP(Math.floor(this.value*wT))}toString(){return`${this.value}`}},MP=class t extends wP{constructor(e){super(e)}multiply(e){let r=Math.floor(this.valueOf()*e.valueOf());return new t(r)}divide(e){if(e.valueOf()===0)throw new Error("Cannot divide by zero");let r=Math.floor(this.valueOf()/e.valueOf());return new t(r)}plus(e){let r=super.plus(e);return new t(r.valueOf())}minus(e){let r=super.minus(e);return new t(r.valueOf())}toARIO(){return new _P(this.valueOf()/wT)}};export{z4 as ANT,Eb as ANTRegistry,lQ as ANT_LUA_ID,$8 as ANT_REGISTRY_ID,Za as AOProcess,hQ as AOS_MODULE_ID,cQ as AO_AUTHORITY,Tb as ARIO,W4 as ARIOReadable,_P as ARIOToken,bP as ARIOWriteable,d5e as ARIO_DEVNET_PROCESS_ID,
|
|
209
|
+
`});function oue(t,e){let r=[],o=e?.sortBy??"eligibleReward",i=e?.sortOrder??"desc",h=e?.limit??100;if(!yP(t))return{hasMore:!1,items:[],totalItems:0,limit:h,sortOrder:i,sortBy:o};let c=t?.distributions.rewards.eligible;for(let[g,_]of Object.entries(c)){r.push({type:"operatorReward",recipient:g,eligibleReward:_.operatorReward,cursorId:g+"_"+g,gatewayAddress:g});for(let[M,x]of Object.entries(_.delegateRewards))r.push({type:"delegateReward",recipient:M,eligibleReward:x,cursorId:g+"_"+M,gatewayAddress:g})}r.sort((g,_)=>{let M=g[o],x=_[o];return M===x||M===void 0||x===void 0?0:i==="asc"?M>x?1:-1:M<x?1:-1});let v=e?.cursor!==void 0?r.findIndex(g=>g.cursorId===e.cursor)+1:0,b=h?v+h:r.length;return{hasMore:b<r.length,items:r.slice(v,b),totalItems:r.length,limit:h,sortOrder:i,nextCursor:r[b]?.cursorId,sortBy:o}}function sue(t){if(t!==void 0)return yP(t)?{...t,distributions:{...t.distributions,rewards:{...t.distributions.rewards,eligible:void 0}}}:t}var gUe=t=>t.distributedTimestamp!==void 0,yP=t=>t!==void 0&&t.distributions!==void 0&&gUe(t.distributions),bUe=["Buy-Name","Buy-Record","Extend-Lease","Increase-Undername-Limit","Upgrade-Name","Primary-Name-Request"],Y3t=["Buy-Record","Buy-Name","Extend-Lease"],J3t=t=>bUe.indexOf(t)!==-1,yUe=["balance","stakes","any"],X3t=t=>yUe.indexOf(t)!==-1;function mv(t){return"process"in t}function gv(t){return"processId"in t&&typeof t.processId=="string"&&hue(t.processId)===!0}function Q3t(t){return t.type==="lease"}ie();ae();ne();var wP=class t{constructor(e){this.positiveFiniteInteger=e;if(!Number.isFinite(this.positiveFiniteInteger)||!Number.isInteger(this.positiveFiniteInteger)||this.positiveFiniteInteger<0)throw new Error(`Number must be a non-negative integer value! ${e}`)}[Symbol.toPrimitive](e){return e==="string"&&this.toString(),this.positiveFiniteInteger}plus(e){return new t(this.positiveFiniteInteger+e.positiveFiniteInteger)}minus(e){return new t(this.positiveFiniteInteger-e.positiveFiniteInteger)}isGreaterThan(e){return this.positiveFiniteInteger>e.positiveFiniteInteger}isGreaterThanOrEqualTo(e){return this.positiveFiniteInteger>=e.positiveFiniteInteger}isLessThan(e){return this.positiveFiniteInteger<e.positiveFiniteInteger}isLessThanOrEqualTo(e){return this.positiveFiniteInteger<=e.positiveFiniteInteger}toString(){return`${this.positiveFiniteInteger}`}valueOf(){return this.positiveFiniteInteger}toJSON(){return this.positiveFiniteInteger}equals(e){return this.positiveFiniteInteger===e.positiveFiniteInteger}},_P=class{value;constructor(e){if(!Number.isFinite(e)||e<0)throw new Error("ARIOToken must be a non-negative finite number");this.value=+e.toFixed(6)}valueOf(){return this.value}toMARIO(){return new MP(Math.floor(this.value*wT))}toString(){return`${this.value}`}},MP=class t extends wP{constructor(e){super(e)}multiply(e){let r=Math.floor(this.valueOf()*e.valueOf());return new t(r)}divide(e){if(e.valueOf()===0)throw new Error("Cannot divide by zero");let r=Math.floor(this.valueOf()/e.valueOf());return new t(r)}plus(e){let r=super.plus(e);return new t(r.valueOf())}minus(e){let r=super.minus(e);return new t(r.valueOf())}toARIO(){return new _P(this.valueOf()/wT)}};export{z4 as ANT,Eb as ANTRegistry,lQ as ANT_LUA_ID,$8 as ANT_REGISTRY_ID,Za as AOProcess,hQ as AOS_MODULE_ID,cQ as AO_AUTHORITY,Tb as ARIO,W4 as ARIOReadable,_P as ARIOToken,bP as ARIOWriteable,d5e as ARIO_DEVNET_PROCESS_ID,Lh as ARIO_MAINNET_PROCESS_ID,iut as ARIO_TESTNET_PROCESS_ID,tut as ARNS_DEVNET_REGISTRY_TX,eut as ARNS_TESTNET_REGISTRY_TX,D8 as ARWEAVE_TX_REGEX,Rre as AbortError,xT as AntBalancesSchema,MT as AntControllersSchema,p5e as AntDescriptionSchema,g5e as AntHandlerNames,vQ as AntHandlersSchema,gQ as AntInfoSchema,mQ as AntKeywordsSchema,v5e as AntReadHandlers,q8 as AntRecordSchema,_T as AntRecordsSchema,ST as AntStateSchema,m5e as AntWriteHandlers,Z4 as AoANTReadable,H4 as AoANTRegistryReadable,lP as AoANTRegistryWriteable,hP as AoANTWriteable,aue as ArNSEventEmitter,ul as ArconnectSigner,z0 as ArweaveSigner,gd as ArweaveTxIdSchema,Mre as BadRequest,Lf as BaseError,dQ as DEFAULT_SCHEDULER_ID,Xft as FQDN_REGEX,xre as FailedRequestError,pQ as IntegerStringSchema,Rl as InvalidContractConfigurationError,Are as InvalidProcessConfigurationError,Ere as InvalidSignerError,Vu as Logger,wT as MARIO_PER_ARIO,_re as NotFound,Qft as SORT_KEY_REGEX,Sre as UnknownError,Cw as WriteInteractionError,rut as arioDevnetProcessId,vv as createAoSigner,vUe as defaultTargetManifestId,mUe as epochDistributionNoticeGqlQuery,gP as errorMessageFromOutput,k3t as evolveANT,dUe as fetchAllArNSRecords,myt as fromB64Url,yUe as fundFromOptions,Vyt as getANTProcessesOwnedByWallet,Hd as getEpochDataFromGql,eue as getRandomText,B3t as initANTStateForAddress,Y3t as intentsUsingYears,hut as isAoANTState,pUe as isAoSigner,Z3t as isBlockHeight,yP as isDistributedEpoch,gUe as isDistributedEpochData,Q3t as isLeasedArNSRecord,mv as isProcessConfiguration,gv as isProcessIdConfiguration,X3t as isValidFundFrom,J3t as isValidIntent,MP as mARIOToken,Oa as paginationParamsToTags,uue as parseAoEpochData,Pl as parseSchemaResult,yn as pruneTags,sue as removeEligibleRewardsFromEpochData,fue as removeUnicodeFromError,cP as safeDecode,gyt as sha256B64Url,Vfe as sortANTRecords,oue as sortAndPaginateEpochDataIntoEligibleDistributions,I3t as spawnANT,fUe as toB64Url,bUe as validIntents,hue as validateArweaveId};
|
|
210
210
|
/*! Bundled license information:
|
|
211
211
|
|
|
212
212
|
@jspm/core/nodelibs/browser/buffer.js:
|